Comparing version 0.4.18 to 0.4.19
@@ -19,3 +19,2 @@ import { DataSource } from '../stream/data_source'; | ||
this.value = props.value; | ||
this.needAttach = true; | ||
if (props.value instanceof DataSource || props.value instanceof DuplexDataSource) { | ||
@@ -40,3 +39,2 @@ if (!this.cleanUp) { | ||
this.selectedIndex = props.selectedIndex; | ||
this.needAttach = true; | ||
if (props.selectedIndex instanceof DataSource || props.selectedIndex instanceof DuplexDataSource) { | ||
@@ -43,0 +41,0 @@ if (!this.cleanUp) { |
@@ -58,5 +58,5 @@ import { ArrayDataSource, DataSource } from '../../stream/data_source'; | ||
private children; | ||
protected needAttach: boolean; | ||
node: HTMLElement; | ||
protected cleanUp: CancellationToken; | ||
protected pendingChildren: ChildNode[]; | ||
constructor(props: AurumElementProps<any>, children: ChildNode[], domNodeName: string); | ||
@@ -63,0 +63,0 @@ private initialize; |
@@ -59,3 +59,2 @@ import { ArrayDataSource, DataSource } from '../../stream/data_source'; | ||
this.onAttach = props.onAttach; | ||
this.needAttach = true; | ||
} | ||
@@ -67,3 +66,3 @@ this.onDetach = props.onDetach; | ||
if (children) { | ||
this.addChildren(children); | ||
this.pendingChildren = children; | ||
} | ||
@@ -186,11 +185,11 @@ } | ||
var _a, _b, _c; | ||
if (this.needAttach) { | ||
if (parent.isConnected()) { | ||
(_a = this.onAttach) === null || _a === void 0 ? void 0 : _a.call(this, this.node); | ||
for (const child of this.node.childNodes) { | ||
(_c = (_b = child[ownerSymbol]) === null || _b === void 0 ? void 0 : _b.handleAttach) === null || _c === void 0 ? void 0 : _c.call(_b, this); | ||
} | ||
if (parent.isConnected()) { | ||
if (this.pendingChildren) { | ||
this.addChildren(this.pendingChildren); | ||
this.pendingChildren = undefined; | ||
} | ||
else { | ||
parent.needAttach = true; | ||
(_a = this.onAttach) === null || _a === void 0 ? void 0 : _a.call(this, this.node); | ||
this.onAttach = undefined; | ||
for (const child of this.node.childNodes) { | ||
(_c = (_b = child[ownerSymbol]) === null || _b === void 0 ? void 0 : _b.handleAttach) === null || _c === void 0 ? void 0 : _c.call(_b, this); | ||
} | ||
@@ -217,2 +216,3 @@ } | ||
} | ||
this.node[ownerSymbol] = undefined; | ||
} | ||
@@ -219,0 +219,0 @@ } |
{ | ||
"name": "aurumjs", | ||
"version": "0.4.18", | ||
"version": "0.4.19", | ||
"description": "Fast and concise declarative DOM rendering library for javascript", | ||
@@ -5,0 +5,0 @@ "main": "prebuilt/aurumjs.js", |
@@ -1,2 +0,2 @@ | ||
var t=function(t){this.data=t};t.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)}},t.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 e=function(t){var e=this;void 0===t&&(t=[]),this.length=0,t.forEach(function(t){return e.append(t)})};e.prototype.find=function(t){for(var e=this.rootNode;e&&!t(e);)e=e.next;return e},e.prototype.append=function(e){return this.rootNode||this.lastNode?(this.lastNode.next=new t(e),this.lastNode.next.previous=this.lastNode,this.lastNode=this.lastNode.next):this.rootNode=this.lastNode=new t(e),this.length++,e},e.prototype.forEach=function(t){this.find(function(e){return t(e.data),!1})},e.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 n=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];this.cancelables=new e(t),this._isCancelled=!1},o={isCanceled:{configurable:!0}};o.isCanceled.get=function(){return this._isCancelled},n.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},n.prototype.removeCancelable=function(t){return this.throwIfCancelled("attempting to remove cancellable from token that is already cancelled"),this.cancelables.remove(t),this},n.prototype.addDisposable=function(t){return this.addCancelable(function(){return t.dispose()}),this},n.prototype.callIfNotCancelled=function(t){this.isCanceled||t()},n.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)},n.prototype.setInterval=function(t,e){var n=setInterval(t,e);this.addCancelable(function(){return clearInterval(n)})},n.prototype.requestAnimationFrame=function(t){var e=this,n=requestAnimationFrame(function(){e.removeCancelable(o),t()}),o=function(){return cancelAnimationFrame(n)};this.addCancelable(o)},n.prototype.animationLoop=function(t){var e=requestAnimationFrame(function n(o){t(o),e=requestAnimationFrame(n)});this.addCancelable(function(){return cancelAnimationFrame(e)})},n.prototype.throwIfCancelled=function(t){if(this.isCanceled)throw new Error(t||"cancellation token is cancelled")},n.prototype.chain=function(t,e){return void 0===e&&(e=!1),e&&t.chain(this,!1),this.addCancelable(function(){return t.cancel()}),this},n.prototype.registerDomEvent=function(t,e,n){return t.addEventListener(e,n),this.addCancelable(function(){return t.removeEventListener(e,n)}),this},n.prototype.cancel=function(){this.isCanceled||(this._isCancelled=!0,this.cancelables.forEach(function(t){return t()}),this.cancelables=void 0)},Object.defineProperties(n.prototype,o);var r=function(){this.subscribeChannel=[],this.subscribeOnceChannel=[],this.onAfterFire=[]},i={subscriptions:{configurable:!0}};i.subscriptions.get=function(){return this.subscribeChannel.length+this.subscribeOnceChannel.length},r.prototype.subscribe=function(t,e){return this.createSubscription(t,this.subscribeChannel,e).facade},r.prototype.subscribeOnce=function(t,e){return this.createSubscription(t,this.subscribeOnceChannel,e).facade},r.prototype.hasSubscriptions=function(){return this.subscriptions>0},r.prototype.cancelAll=function(){var t,e=this;this.isFiring?this.onAfterFire.push(function(){var t;e.subscribeChannel.length=0,e.subscribeOnceChannel.length=0,null===(t=e.onEmpty)||void 0===t||t.call(e)}):(this.subscribeChannel.length=0,this.subscribeOnceChannel.length=0,null===(t=this.onEmpty)||void 0===t||t.call(this))},r.prototype.afterFire=function(){this.onAfterFire.length>0&&(this.onAfterFire.forEach(function(t){return t()}),this.onAfterFire.length=0)},r.prototype.fire=function(t){this.isFiring=!0;for(var e=this.subscribeChannel.length,n=0;n<e;n++)this.subscribeChannel[n].callback(t);if(this.subscribeOnceChannel.length>0){e=this.subscribeOnceChannel.length;for(var o=0;o<e;o++)this.subscribeOnceChannel[o].callback(t);this.subscribeOnceChannel.length=0}this.isFiring=!1,this.afterFire()},r.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}},r.prototype.cancel=function(t,e){var n,o=this,r=e.indexOf(t);r>=0&&(this.isFiring?this.onAfterFire.push(function(){return o.cancel(t,e)}):(e.splice(r,1),this.hasSubscriptions()||null===(n=this.onEmpty)||void 0===n||n.call(this)))},Object.defineProperties(r.prototype,i);var a=function(t){this.value=t,this.primed=void 0!==t,this.updateEvent=new r};a.prototype.update=function(t){if(this.primed=!0,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},a.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},a.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},a.prototype.listenOnce=function(t,e){return this.updateEvent.subscribeOnce(t,e).cancel},a.prototype.filter=function(t,e){e=null!=e?e:new n;var o=new s(e);return this.listen(function(e){t(e,o.value)&&o.update(e)},e),o},a.prototype.max=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)>0:t>e},t)},a.prototype.min=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)<0:t<e},t)},a.prototype.pipe=function(t,e){this.listen(function(e){return t.update(e)},e)},a.prototype.map=function(t,e){var o;return e=null!=e?e:new n,o=this.primed?new s(e,t(this.value)):new s(e),this.listen(function(e){o.update(t(e))},e),o},a.prototype.tap=function(t,e){return this.listen(function(e){t(e)},e),this},a.prototype.await=function(t){t=null!=t?t:new n;var e=new s(t);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},a.prototype.unique=function(t){t=null!=t?t:new n;var e=new s(t,this.value);return this.listen(function(t){t!==e.value&&e.update(t)},t),e},a.prototype.diff=function(t){t=null!=t?t:new n;var e=new s(t,{new:this.value,old:void 0});return this.listen(function(t){e.update({new:t,old:e.value.new})},t),e},a.prototype.reduce=function(t,e,o){o=null!=o?o:new n;var r=new s(o,e);return this.listen(function(e){return r.update(t(r.value,e))},o),r},a.prototype.aggregate=function(t,e,o){var r=this;o=null!=o?o:new n;var i=new s(o,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},a.prototype.aggregateThree=function(t,e,o,r){var i=this;r=null!=r?r:new n;var a=new s(r,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},a.prototype.aggregateFour=function(t,e,o,r,i){var a=this;i=null!=i?i:new n;var u=new s(i,r(this.value,t.value,e.value,o.value));return this.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),t.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),e.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),o.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),u},a.prototype.stringJoin=function(t,e){e=null!=e?e:new n;var o=new s(e,"");return this.listen(function(e){return o.update(o.value+t+e.toString())},e),o},a.prototype.combine=function(t,e){e=null!=e?e:new n;var o=new s(e);this.pipe(o,e);for(var r=0,i=t;r<i.length;r+=1)i[r].pipe(o,e);return o},a.prototype.delay=function(t,e){e=null!=e?e:new n;var o=new s(e,this.value);return this.listen(function(e){setTimeout(function(){o.update(e)},t)},e),o},a.prototype.skip=function(t,e){e=null!=e?e:new n;var o=new s(e,this.value);return this.listen(function(e){0===t?o.update(e):t--},e),o},a.prototype.cutoff=function(t,e){e=null!=e?e:new n;var o=new s(e,this.value);return this.listen(function(e){t-- >0&&o.update(e)},e),o},a.prototype.awaitNextUpdate=function(t){var e=this;return new Promise(function(n){e.listenOnce(function(t){return n(t)},t)})},a.prototype.debounce=function(t,e){e=null!=e?e:new n;var o,r=new s(e,this.value);return this.listen(function(e){clearTimeout(o),o=setTimeout(function(){r.update(e)},t)},e),r},a.prototype.throttle=function(t,e){e=null!=e?e:new n;var o=new s(e,this.value),r=!1;return this.listen(function(e){r||(o.update(e),r=!0,setTimeout(function(){r=!1},t))},e),o},a.prototype.buffer=function(t,e){e=null!=e?e:new n;var o,r=new s(e),i=[];return this.listen(function(e){i.push(e),o||(o=setTimeout(function(){o=void 0,r.update(i),i=[]},t))},e),r},a.prototype.accumulate=function(t){var e=new u;return this.listen(function(t){e.push(t)},t),e},a.prototype.pick=function(t,e){var o;e=null!=e?e:new n;var r=new s(e,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},a.prototype.cancelAll=function(){this.updateEvent.cancelAll()};var s=function(t){function e(e,n){var o=this;t.call(this,n),this.disposeToken=e,this.updateEvent.onEmpty=function(){e.cancel(),Object.defineProperty(o,"value",{get:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')},set:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')}})}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.persist=function(){return this.updateEvent.onEmpty=void 0,this},e.prototype.listen=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listen.call(this,e,n)},e.prototype.listenAndRepeat=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listenAndRepeat.call(this,e,n)},e.prototype.listenOnce=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listen.call(this,e,n)},e}(a),u=function(t){this.data=t?t.slice():[],this.lengthSource=new a(this.data.length),this.updateEvent=new r},c={length:{configurable:!0}};u.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)},u.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},u.prototype.listenOnce=function(t,e){return this.updateEvent.subscribeOnce(t,e).cancel},u.prototype.awaitNextUpdate=function(t){var e=this;return new Promise(function(n){e.listenOnce(function(t){return n(t)},t)})},c.length.get=function(){return this.lengthSource},u.prototype.getData=function(){return this.data},u.prototype.get=function(t){return this.data[t]},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length))},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length)}},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length)}},u.prototype.appendArray=function(t){this.data=this.data.concat(t),this.update({operation:"add",operationDetailed:"append",count:t.length,index:this.data.length-t.length,items:t,newState:this.data}),this.lengthSource.value!==this.data.length&&this.lengthSource.update(this.data.length)},u.prototype.push=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.appendArray(t)},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length)},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length),t},u.prototype.merge=function(t){var e=this.data;this.data=t.slice(),this.update({operation:"merge",operationDetailed:"merge",previousState:e,index:0,items:this.data,newState:this.data}),this.lengthSource.value!==this.data.length&&this.lengthSource.update(this.data.length)},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length)},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length)},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length))},u.prototype.clear=function(){if(0!==this.data.length){var t=this.data;this.data=[],this.update({operation:"remove",operationDetailed:"clear",count:t.length,index:0,items:t,newState:this.data}),this.lengthSource.value!==this.data.length&&this.lengthSource.update(this.data.length)}},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length),t},u.prototype.toArray=function(){return this.data.slice()},u.prototype.sort=function(t,e,n){void 0===e&&(e=[]);var o=new d(this,t,n);return e.forEach(function(t){t.listen(function(){return o.refresh()})}),o},u.prototype.map=function(t,e,n){void 0===e&&(e=[]);var o=new h(this,t,n);return e.forEach(function(t){t.listen(function(){return o.refresh()})}),o},u.prototype.filter=function(t,e,n){void 0===e&&(e=[]);var o=new f(this,t,n);return e.forEach(function(t){t.listen(function(){return o.refresh()},n)}),o},u.prototype.forEach=function(t){return this.data.forEach(t)},u.prototype.update=function(t){this.updateEvent.fire(t)},Object.defineProperties(u.prototype,c);var l,p=function(t){function e(e,n){var o=this;t.call(this,n),this.disposeToken=e,this.updateEvent.onEmpty=function(){e.cancel(),Object.defineProperty(o,"data",{get:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')},set:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')}})}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.persist=function(){return this.updateEvent.onEmpty=void 0,this},e.prototype.listenAndRepeat=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listenAndRepeat.call(this,e,n)},e.prototype.listen=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listen.call(this,e,n)},e.prototype.listenOnce=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listenOnce.call(this,e,n)},e}(u),h=function(t){function e(e,o,r){var i=this;void 0===r&&(r=new n);var a=e.getData().map(o);t.call(this,r,a),this.parent=e,this.mapper=o,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":i.removeLeft(t.count);break;case"removeRight":i.removeRight(t.count);break;case"remove":i.remove(i.data[t.index]);break;case"clear":i.clear();break;case"prepend":(e=i).unshift.apply(e,t.items.map(i.mapper));break;case"append":i.appendArray(t.items.map(i.mapper));break;case"swap":i.swap(t.index,t.index2);break;case"replace":i.set(t.index,i.mapper(t.items[0]));break;case"merge":for(var n=i.data.slice(),o=t.previousState.slice(),r=0;r<t.newState.length;r++)if(i.data.length<=r&&i.data.push(i.mapper(t.newState[r])),o[r]!==t.newState[r]){var a=o.indexOf(t.newState[r]);if(-1!==a){var s=i.data[r];i.data[r]=i.data[a],i.data[a]=s;var u=o[r];o[r]=o[a],o[a]=u}else i.data.splice(r,0,i.mapper(t.newState[r])),o.splice(r,0,t.newState[r])}i.data.length>t.newState.length&&(i.data.length=t.newState.length),i.update({operation:"merge",operationDetailed:"merge",previousState:n,index:0,items:i.data,newState:i.data})}},r)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.refresh=function(){this.merge(this.parent.data.map(this.mapper))},e}(p),d=function(t){function e(e,o,r){var i=this;void 0===r&&(r=new n);var a=e.getData().slice().sort(o);t.call(this,r,a),this.parent=e,this.comparator=o,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)i.remove(o[n]);break;case"remove":i.remove(t.items[0]);break;case"clear":i.clear();break;case"prepend":(e=i).unshift.apply(e,t.items),i.data.sort(i.comparator);break;case"append":i.appendSorted(t.items);break;case"merge":i.merge(t.items.slice().sort(i.comparator));break;case"swap":break;case"replace":i.remove(t.target),i.appendSorted(t.items)}},r)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.appendSorted=function(t){this.merge(this.data.concat(t).sort(this.comparator))},e.prototype.refresh=function(){this.merge(this.parent.getData().slice().sort(this.comparator))},e}(p),f=function(t){function e(e,o,r){var i=this;void 0===r&&(r=new n),Array.isArray(e)&&(e=new u(e));var a=e.data.filter(o=null!=o?o:function(){return!0});t.call(this,r,a),this.parent=e,this.viewFilter=o,e.listen(function(t){var e,n;switch(t.operationDetailed){case"clear":i.clear();break;case"removeLeft":case"removeRight":case"remove":for(var o=0,r=t.items;o<r.length;o+=1)i.remove(r[o]);break;case"prepend":n=t.items.filter(i.viewFilter),(e=i).unshift.apply(e,n);break;case"append":n=t.items.filter(i.viewFilter),i.appendArray(n);break;case"merge":i.merge(t.items.filter(i.viewFilter));break;case"swap":var a=i.data.indexOf(t.items[0]),s=i.data.indexOf(t.items[1]);-1!==a&&-1!==s&&i.swap(a,s);break;case"replace":var u=i.data.indexOf(t.target);-1!==u&&(i.viewFilter(t.items[0])?i.set(u,t.items[0]):i.remove(t.target))}},r)}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.merge(this.parent.data.filter(this.viewFilter))},e}(p),v=Symbol("owner"),y=function(t){var e=this;this.node=this.create(t),t instanceof a&&t.listen(function(t){e.node&&(e.node.textContent=t)})};y.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},y.prototype.create=function(t){var e=document.createTextNode(this.resolveStringSource(t));return e[v]=this,e},y.prototype.remove=function(){this.hasParent()&&this.node.parentElement[v].removeChild(this.node)},y.prototype.hasParent=function(){return!!this.node.parentElement},(l=exports.DataFlow||(exports.DataFlow={}))[l.UPSTREAM=0]="UPSTREAM",l[l.DOWNSTREAM=1]="DOWNSTREAM";var m=function(t,e){void 0===e&&(e=!0),this.value=t,this.updateDownstreamEvent=new r,this.updateUpstreamEvent=new r,this.propagateWritesToReadStream=e};m.fromTwoDataSource=function(t,e,n,o){void 0===o&&(o=!0);var r=new m(n,o);return r.updateDownstreamEvent=t.updateEvent,r.updateUpstreamEvent=e.updateEvent,r},m.createOneWay=function(t,e){return void 0===t&&(t=exports.DataFlow.DOWNSTREAM),new m(e,!1).oneWayFlow(t)},m.prototype.updateDownstream=function(t){if(this.updatingDownstream)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.updatingDownstream=!0,this.value=t,this.updateDownstreamEvent.fire(t),this.updatingDownstream=!1},m.prototype.updateUpstream=function(t){if(this.updatingUpstream)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.updatingUpstream=!0,this.value=t,this.updateUpstreamEvent.fire(t),this.propagateWritesToReadStream&&this.updateDownstreamEvent.fire(t),this.updatingUpstream=!1},m.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},m.prototype.listen=function(t,e){return this.updateDownstreamEvent.subscribe(t,e).cancel},m.prototype.listenUpstream=function(t,e){return this.updateUpstreamEvent.subscribe(t,e).cancel},m.prototype.listenUpstreamOnce=function(t,e){return this.updateUpstreamEvent.subscribeOnce(t,e).cancel},m.prototype.listenDownstream=function(t,e){return this.updateDownstreamEvent.subscribe(t,e).cancel},m.prototype.downStreamToDataSource=function(t){var e=new a(this.value);return this.listenDownstream(function(t){e.update(t)},t),e},m.prototype.aggregate=function(t,e,o){var r=this;o=null!=o?o:new n;var i=new s(o,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},m.prototype.aggregateThree=function(t,e,o,r){var i=this;r=null!=r?r:new n;var a=new s(r,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},m.prototype.aggregateFour=function(t,e,o,r,i){var a=this;i=null!=i?i:new n;var u=new s(i,r(this.value,t.value,e.value,o.value));return this.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),t.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),e.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),o.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),u},m.prototype.filter=function(t,e,n){var o=this;if("function"==typeof e){var r=new m(void 0,!1);return this.listenDownstream(function(e){t(e,r.value)&&r.updateDownstream(e)},n),r.listenUpstream(function(t){e(t,o.value)&&o.updateUpstream(t)},n),r}var i=new a;return this.listenDownstream(function(e){t(e,i.value)&&i.update(e)},e),i},m.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)},m.prototype.map=function(t,e,n){var o=this;if("function"==typeof e){var r=new m(t(this.value),!1);return this.listenDownstream(function(e){return r.updateDownstream(t(e))},n),r.listenUpstream(function(t){return o.updateUpstream(e(t))},n),r}var i=new a(t(this.value));return this.listenDownstream(function(e){return i.update(t(e))},e),i},m.prototype.listenOnce=function(t,e){return this.updateDownstreamEvent.subscribeOnce(t,e).cancel},m.prototype.awaitNextUpdate=function(t){var e=this;return new Promise(function(n){e.listenOnce(function(t){return n(t)},t)})},m.prototype.debounceUpstream=function(t,e){var n,o=this,r=new m(this.value);return r.listenUpstream(function(e){clearTimeout(n),n=setTimeout(function(){o.updateUpstream(e)},t)},e),this.listenDownstream(function(t){r.updateDownstream(t)},e),r},m.prototype.debounceDownstream=function(t,e){var n,o=this,r=new m(this.value);return this.listenDownstream(function(e){clearTimeout(n),n=setTimeout(function(){r.updateDownstream(e)},t)},e),r.listenUpstream(function(t){o.updateUpstream(t)},e),r},m.prototype.unique=function(t){var e=this,n=new m(this.value,!1),o=this.value,r=this.value;return this.listenDownstream(function(t){r!==t&&(r=t,n.updateDownstream(t))},t),n.listenUpstream(function(t){o!==t&&(o=t,e.updateUpstream(t))},t),n},m.prototype.oneWayFlow=function(t,e){var n=this;void 0===t&&(t=exports.DataFlow.DOWNSTREAM);var o=new m(this.value,!1);return t===exports.DataFlow.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},m.prototype.reduce=function(t,e,n){var o=new a(e);return this.listen(function(e){return o.update(t(o.value,e))},n),o},m.prototype.cancelAll=function(){this.updateDownstreamEvent.cancelAll(),this.updateUpstreamEvent.cancelAll()};var g=Symbol("AurumElementModel"),b={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"},w=["id","name","draggable","tabindex","style","role","contentEditable"];function _(t){return t&&t[g]?_(t.constructor(t.props,t.innerNodes)):t}var x=function(t,e,n){var o;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===(o=t.onCreate)||void 0===o||o.call(t,this.node)),e&&this.addChildren(e)};x.prototype.initialize=function(t){this.createEventHandlers(b,t);var e=Object.keys(t).filter(function(t){return t.includes("-")});this.bindProps(w,t,e),t.class&&this.handleClass(t.class)},x.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 u=s[a];e[u]&&this.assignStringSourceToAttribute(e[u],u)}},x.prototype.createEventHandlers=function(t,e){var n=this,o=function(o){e[t[o]]&&(e[t[o]]instanceof a?n.node.addEventListener(o,function(n){return e[t[o]].update(n)}):e[t[o]]instanceof m?n.node.addEventListener(o,function(n){return e[t[o]].updateDownstream(n)}):"function"==typeof e[t[o]]&&n.node.addEventListener(o,function(n){return e[t[o]](n)}))};for(var r in t)o(r)},x.prototype.render=function(){for(var t,e,n=0,o=0;o<this.children.length;o++,n++)this.children[o]instanceof O?n=this.renderFragment(this.children[o],n):this.renderChild(this.children[o],n);for(;this.node.childNodes.length>n;){var r=this.node.childNodes[this.node.childNodes.length-1];this.node.removeChild(r),null===(e=null===(t=r[v])||void 0===t?void 0:t.handleDetach)||void 0===e||e.call(t)}},x.prototype.renderFragment=function(t,e){for(var n=0;n<t.children.length;n++,e++)t.children[n]instanceof O?e=this.renderFragment(t.children[n],e):this.renderChild(t.children[n],e);return--e},x.prototype.renderChild=function(t,e){if(this.node.childNodes.length<=e)return this.addChildDom(t);if(this.node.childNodes[e][v]!==t){var n=this.getChildIndex(t.node);-1!==n?this.swapChildrenDom(e,n):this.addDomNodeAt(t.node,e)}},x.prototype.assignStringSourceToAttribute=function(t,e){var o=this;"string"==typeof t||"boolean"==typeof t?"boolean"==typeof t?t?this.node.setAttribute(e,""):this.node.removeAttribute(e):this.node.setAttribute(e,t):(this.cleanUp||(this.cleanUp=new n),t.unique(this.cleanUp).listenAndRepeat(function(t){"boolean"==typeof t?t?o.node.setAttribute(e,""):o.node.removeAttribute(e):o.node.setAttribute(e,t)}))},x.prototype.handleAttach=function(t){var e,n,o;if(this.needAttach)if(t.isConnected()){null===(e=this.onAttach)||void 0===e||e.call(this,this.node);for(var r=0,i=this.node.childNodes;r<i.length;r+=1)null===(o=null===(n=i[r][v])||void 0===n?void 0:n.handleAttach)||void 0===o||o.call(n,this)}else t.needAttach=!0},x.prototype.handleDetach=function(){var t,e,n;if(this.cleanUp&&this.cleanUp.cancel(),!this.node.isConnected){null===(t=this.onDetach)||void 0===t||t.call(this,this.node);for(var o=0,r=this.children;o<r.length;o+=1){var i=r[o];i instanceof O&&i.handleDetach()}for(var a=0,s=this.node.childNodes;a<s.length;a+=1){var u=s[a];u[v]&&(null===(n=(e=u[v]).handleDetach)||void 0===n||n.call(e))}}},x.prototype.handleClass=function(t){var e=this;if("string"==typeof t)this.node.className=t;else if(t instanceof a||t instanceof m)this.cleanUp||(this.cleanUp=new n),t.value&&(Array.isArray(t.value)?(this.node.className=t.value.join(" "),t.unique(this.cleanUp).listen(function(){e.node.className=t.value.join(" ")})):(this.node.className=t.value,t.unique(this.cleanUp).listen(function(){e.node.className=t.value}))),t.unique(this.cleanUp).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 s=i[r];s instanceof a&&(this.cleanUp||(this.cleanUp=new n),s.unique(this.cleanUp).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}))}}},x.prototype.create=function(t){var e=document.createElement(t);return e[v]=this,e},x.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},x.prototype.hasChild=function(t){for(var e=0,n=t.childNodes;e<n.length;e+=1)if(n[e]===t)return!0;return!1},x.prototype.addChildDom=function(t){var e;this.node.appendChild(t.node),null===(e=t.handleAttach)||void 0===e||e.call(t,this)},x.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))}},x.prototype.addDomNodeAt=function(t,e){var n,o,r,i;e>=this.node.childNodes.length?(this.node.appendChild(t),null===(o=(n=t[v]).handleAttach)||void 0===o||o.call(n,this)):(this.node.insertBefore(t,this.node.childNodes[e]),null===(i=(r=t[v]).handleAttach)||void 0===i||i.call(r,this))},x.prototype.remove=function(){this.hasParent()&&this.node.parentElement[v].removeChild(this.node)},x.prototype.hasParent=function(){return!!this.node.parentElement},x.prototype.isConnected=function(){return this.node.isConnected},x.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1),this.render()},x.prototype.removeChildAt=function(t){this.children.splice(t,1),this.render()},x.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()}},x.prototype.clearChildren=function(){this.children.length=0,this.render()},x.prototype.addChild=function(t){if(null!=t&&(!t[g]||void 0!==(t=_(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()},x.prototype.childNodeToAurum=function(t){var e=this;if(t instanceof x)return t;if(t instanceof Promise){var n=new O({});return t.then(function(t){n.addChildren([t]),e.render()}),n}if(t instanceof u){var o=new O({repeatModel:t});return o.onChange.subscribe(function(){return e.render()}),o}if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return new y(t.toString());if(t instanceof a){var r=new O({},[t]);return r.onChange.subscribe(function(){return e.render()}),r}throw new Error("Unsupported child type")},x.prototype.addChildAt=function(t,e){this.children.splice(e,0,this.childNodeToAurum(t)),this.render()},x.prototype.addChildren=function(t){if(0!==t.length)for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e])};var O=function(t,e){this.cancellationToken=new n,this.onChange=new r,this.children=[],t.repeatModel?this.handleRepeat(t.repeatModel):e&&this.addChildren(e)};O.prototype.handleDetach=function(){this.cancellationToken.cancel()},O.prototype.addChildren=function(t){for(var e=this,n=function(){var t=r[o],n=void 0;if((n=t[g]?_(t):t)instanceof x)e.children.push(n);else{if(!(n instanceof a))throw new Error("case not yet implemented");var i=void 0,s=void 0,u={ts:void 0};n.unique().listenAndRepeat(function(t){if(u.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,u,u.ts)}else i=e.handleSourceChild(t,i,n,u,u.ts)},e.cancellationToken)}},o=0,r=t;o<r.length;o+=1)n()},O.prototype.handleSourceChild=function(t,e,n,o,r){var i=this;if(Array.isArray(t))for(var s=0,c=t;s<c.length;s+=1)this.handleSourceChild(c[s],e,n,o,r);if(null!=t){if(t[g]&&(t=_(t)),"string"==typeof t||"bigint"==typeof t||"number"==typeof t||"boolean"==typeof t)if(e){if(e instanceof x){var l=new y(null!=n?n:t);this.children.splice(this.children.indexOf(e),1,l),e=l,this.onChange.fire()}}else{var p=new y(null!=n?n:t);this.children.push(p),e=p,this.onChange.fire()}else if(t instanceof x)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){o.ts===r&&(i.addChildren([t]),i.onChange.fire())});else if(t instanceof a)if(e){if(e!==t){var h=new O({},[t]);h.onChange.subscribe(function(){return i.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,h),e=h,this.onChange.fire()}}else{var d=new O({},[t]);e=d,this.children.push(d),d.onChange.subscribe(function(){return i.onChange.fire()}),this.onChange.fire()}else if(t instanceof u)if(e){if(e!==t){var f=new O({repeatModel:t});f.onChange.subscribe(function(){return i.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,f),e=f,this.onChange.fire()}}else{var v=new O({repeatModel:t});e=v,this.children.push(v),v.onChange.subscribe(function(){return i.onChange.fire()}),this.onChange.fire()}return e}e&&(this.children.splice(this.children.indexOf(e),1),e=void 0,this.onChange.fire())},O.prototype.handleRepeat=function(t){var e=this;t.listenAndRepeat(function(t){var n;switch(t.operationDetailed){case"replace":e.children[t.index]=_(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"merge":for(var r=t.previousState.slice(),i=0;i<t.newState.length;i++)if(e.children.length<=i&&e.children.push(_(t.newState[i])),r[i]!==t.newState[i]){var a=r.indexOf(t.newState[i]);if(-1!==a){var s=e.children[i];e.children[i]=e.children[a],e.children[a]=s;var u=r[i];r[i]=r[a],r[a]=u}else e.children.splice(i,0,_(t.newState[i])),r.splice(i,0,t.newState[i])}e.children.length>t.newState.length&&(e.children.length=t.newState.length);break;case"append":e.children=e.children.concat(t.items.map(_));break;case"prepend":(n=e.children).unshift.apply(n,t.items.map(_));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()},this.cancellationToken)};var C=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}(x),S=Symbol("route");function E(){var t=location.hash.substring(1);return t.includes("?")?t.substring(0,t.indexOf("?")):t.includes("#")?t.substring(0,t.indexOf("#")):t}var D=Symbol("switchCase"),A=function(t){t&&(this.data=t),this.updateEvent=new r,this.updateEventOnKey=new Map};A.prototype.pick=function(t,e){var n,o=new a(null===(n=this.data)||void 0===n?void 0:n[t]);return this.listenOnKey(t,function(t){o.update(t.newValue)},e),o},A.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},A.prototype.listenOnKeyAndRepeat=function(t,e,n){return e({key:t,newValue:this.data[t],oldValue:void 0}),this.listenOnKey(t,e,n)},A.prototype.listenOnKey=function(t,e,n){return this.updateEventOnKey.has(t)||this.updateEventOnKey.set(t,new r),this.updateEventOnKey.get(t).subscribe(e,n).cancel},A.prototype.keys=function(){return Object.keys(this.data)},A.prototype.values=function(){return Object.values(this.data)},A.prototype.get=function(t){return this.data[t]},A.prototype.delete=function(t){var e=this.data[t];delete this.data[t],this.updateEvent.fire({oldValue:e,key:t,newValue:void 0,deleted:!0}),this.updateEventOnKey.has(t)&&this.updateEventOnKey.get(t).fire({oldValue:e,key:t,newValue:void 0})},A.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]})}},A.prototype.assign=function(t){if(t instanceof A)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])}},A.prototype.toObject=function(){return Object.assign({},this.data)},A.prototype.toDataSource=function(){var t=this,e=new a(this.data);return this.listen(function(n){e.update(t.data)}),e};var k=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}(x),j=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}(x),U={input:"onInput",change:"onChange"},N=["placeholder","readonly","disabled","accept","alt","autocomplete","autofocus","checked","defaultChecked","formAction","formEnctype","formMethod","formNoValidate","formTarget","max","maxLength","min","minLength","pattern","multiple","required","type"],T=function(t){function e(e,o){var r,i,s=this;t.call(this,e,o,"input"),null!==e&&(e.value instanceof a||e.value instanceof m?(this.cleanUp||(this.cleanUp=new n),e.value.unique(this.cleanUp).listenAndRepeat(function(t){return s.node.value=t}),this.node.addEventListener("input",function(){e.value instanceof a?e.value.update(s.node.value):e.value instanceof m&&e.value.updateUpstream(s.node.value)})):this.node.value=null!==(r=e.value)&&void 0!==r?r:"",e.checked instanceof a||e.checked instanceof m?(this.cleanUp||(this.cleanUp=new n),e.checked.unique(this.cleanUp).listenAndRepeat(function(t){return s.node.checked=t}),this.node.addEventListener("change",function(){e.checked instanceof a?e.checked.update(s.node.checked):e.checked instanceof m&&e.checked.updateUpstream(s.node.checked)})):this.node.checked=null!==(i=e.checked)&&void 0!==i&&i,this.bindProps(N,e),this.createEventHandlers(U,e))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(x),P=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}(x),F=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}(x),R=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}(x),I=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}(x),L=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}(x),M=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}(x),q=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}(x),V=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}(x),K=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}(x),W=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}(x),H=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}(x),z=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}(x),B=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}(x),J=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}(x),G=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}(x),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}(x),X=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}(x),Y=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}(x),Z=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}(x),$=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}(x),tt=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}(x),et={input:"onInput",change:"onChange"},nt=["placeholder","readonly","disabled","rows","wrap","autocomplete","autofocus","max","maxLength","min","minLength","required","type"],ot=function(t){function e(e,o){var r,i,a,s=this;t.call(this,e,o,"textArea"),null!==e&&(e.inputValueSource?(this.node.value=null!==(i=null!==(r=e.initialValue)&&void 0!==r?r:e.inputValueSource.value)&&void 0!==i?i:"",this.cleanUp||(this.cleanUp=new n),e.inputValueSource.unique(this.cleanUp).listen(function(t){return s.node.value=t})):this.node.value=null!==(a=e.initialValue)&&void 0!==a?a:"",this.bindProps(nt,e),this.createEventHandlers(et,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(s.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(x),rt=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}(x),it=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}(x),at=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}(x),st=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}(x),ut=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}(x),ct=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}(x),lt=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}(x),pt=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}(x),ht=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}(x),dt=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}(x),ft=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}(x),vt=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}(x),yt=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}(x),mt=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}(x),gt=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}(x),bt=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}(x),wt=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}(x),_t=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}(x),xt=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}(x),Ot=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}(x),Ct={change:"onChange"},St=function(t){function e(e,o){var r=this;t.call(this,e,o,"select"),null!==e&&(this.createEventHandlers(Ct,e),e.value&&(this.value=e.value,this.needAttach=!0,(e.value instanceof a||e.value instanceof m)&&(this.cleanUp||(this.cleanUp=new n),e.value.listen(function(t){r.node.value=t},this.cleanUp),this.node.addEventListener("change",function(){e.value instanceof a?e.value.update(r.node.value):e.value instanceof m&&e.value.updateUpstream(r.node.value)}))),e.selectedIndex&&(this.selectedIndex=e.selectedIndex,this.needAttach=!0,(e.selectedIndex instanceof a||e.selectedIndex instanceof m)&&(this.cleanUp||(this.cleanUp=new n),e.selectedIndex.listen(function(t){r.node.selectedIndex=t},this.cleanUp),this.node.addEventListener("change",function(){e.selectedIndex instanceof a?e.selectedIndex.update(r.node.selectedIndex):e.selectedIndex instanceof m&&e.selectedIndex.updateUpstream(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.value instanceof a||this.value instanceof m?this.node.value=this.value.value:void 0!==this.value?this.node.value=this.value:this.selectedIndex instanceof a||this.selectedIndex instanceof m?this.node.selectedIndex=this.selectedIndex.value:void 0!==this.selectedIndex&&(this.node.selectedIndex=this.selectedIndex))},e}(x),Et=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}(x),Dt=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}(x),At=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}(x),kt=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}(x),jt=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}(x),Ut=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}(x),Nt=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}(x),Tt=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}(x),Pt=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}(x),Ft=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}(x),Rt=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}(x),It=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}(x),Lt=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}(x),Mt={button:j,div:k,input:T,li:P,span:F,style:R,ul:L,p:M,img:q,link:V,canvas:K,a:W,article:H,br:z,form:B,label:J,ol:G,pre:Q,progress:X,table:Y,td:Z,tr:$,th:tt,textarea:ot,h1:rt,h2:it,h3:at,h4:st,h5:ut,h6:ct,header:lt,footer:pt,nav:ht,b:dt,i:ft,script:vt,abbr:yt,area:mt,aside:gt,audio:I,em:bt,heading:wt,iframe:_t,noscript:xt,option:function(t){function e(e,n){t.call(this,e,n,"option"),e&&this.bindProps(["value"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(x),q:Ot,select:St,source:Et,title:Dt,video:At,tbody:kt,tfoot:jt,thead:Ut,summary:Nt,details:Tt,sub:Pt,sup:Ft,svg:Rt,data:It,time:Lt,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}(x)},qt=function(){};qt.attach=function(t,e){var n=_(t);if(e[v])throw new Error("This node is already managed by aurum and cannot be used");if(!(n instanceof x))throw new Error("Root node of aurum application must be a single dom node");e.appendChild(n.node),n.handleAttach(n),e[v]=n},qt.isAttached=function(t){return void 0!==t[v]},qt.detach=function(t){t[v]&&(t[v].node.remove(),t[v].handleDetach(),t[v]=void 0)},qt.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=Mt[t]))throw new Error("Node "+a+" does not exist or is not supported")}return Object.getPrototypeOf(t)===x?((n={})[g]=!0,n.constructor=function(e,n){return new t(e,n)},n.props=e,n.innerNodes=r,n):((o={})[g]=!0,o.constructor=t,o.props=e,o.innerNodes=r,o)},exports.aurumElementModelIdentitiy=g,exports.prerender=_,exports.AurumElement=x,exports.AurumFragment=O,exports.Custom=C,exports.AurumRouter=function(t,e){if((e=e.map(_)).some(function(t){return!t[S]}))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 a(E());return window.addEventListener("hashchange",function(){n.update(E())}),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)})},exports.Route=function(t,e){var n;return(n={})[S]=!0,n.content=e,n.default=!1,n.href=t.href,n},exports.DefaultRoute=function(t,e){var n;return(n={})[S]=!0,n.content=e,n.default=!0,n.href=void 0,n},exports.Suspense=function(t,e){var n=new a(null==t?void 0:t.fallback);return Promise.all(e.map(_)).then(function(t){n.update(t)}),n},exports.Switch=function(t,e){if((e=e.map(_)).some(function(t){return!t[D]}))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");var n=t.state.unique();return n.primed=!0,n.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={})[D]=!0,n.content=e,n.default=!1,n.value=t.when,n},exports.DefaultSwitchCase=function(t,e){var n;return(n={})[D]=!0,n.content=e,n.default=!0,n.value=void 0,n},exports.DataSource=a,exports.TransientDataSource=s,exports.ArrayDataSource=u,exports.TransientArrayDataSource=p,exports.MappedArrayView=h,exports.SortedArrayView=d,exports.FilteredArrayView=f,exports.DuplexDataSource=m,exports.ObjectDataSource=A,exports.Aurum=qt,exports.CancellationToken=n,exports.aurumClassName=function(t,e){var n=[],o=function(o){if(t[o])if(t[o]instanceof a||t[o]instanceof m){var r=t[o],i=new a(r.value?o:"");r.listen(function(t){i.update(r.value?o:"")},e),n.push(i)}else n.push(o)};for(var r in t)o(r);return n}; | ||
var t=function(t){this.data=t};t.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)}},t.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 e=function(t){var e=this;void 0===t&&(t=[]),this.length=0,t.forEach(function(t){return e.append(t)})};e.prototype.find=function(t){for(var e=this.rootNode;e&&!t(e);)e=e.next;return e},e.prototype.append=function(e){return this.rootNode||this.lastNode?(this.lastNode.next=new t(e),this.lastNode.next.previous=this.lastNode,this.lastNode=this.lastNode.next):this.rootNode=this.lastNode=new t(e),this.length++,e},e.prototype.forEach=function(t){this.find(function(e){return t(e.data),!1})},e.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 n=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];this.cancelables=new e(t),this._isCancelled=!1},o={isCanceled:{configurable:!0}};o.isCanceled.get=function(){return this._isCancelled},n.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},n.prototype.removeCancelable=function(t){return this.throwIfCancelled("attempting to remove cancellable from token that is already cancelled"),this.cancelables.remove(t),this},n.prototype.addDisposable=function(t){return this.addCancelable(function(){return t.dispose()}),this},n.prototype.callIfNotCancelled=function(t){this.isCanceled||t()},n.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)},n.prototype.setInterval=function(t,e){var n=setInterval(t,e);this.addCancelable(function(){return clearInterval(n)})},n.prototype.requestAnimationFrame=function(t){var e=this,n=requestAnimationFrame(function(){e.removeCancelable(o),t()}),o=function(){return cancelAnimationFrame(n)};this.addCancelable(o)},n.prototype.animationLoop=function(t){var e=requestAnimationFrame(function n(o){t(o),e=requestAnimationFrame(n)});this.addCancelable(function(){return cancelAnimationFrame(e)})},n.prototype.throwIfCancelled=function(t){if(this.isCanceled)throw new Error(t||"cancellation token is cancelled")},n.prototype.chain=function(t,e){return void 0===e&&(e=!1),e&&t.chain(this,!1),this.addCancelable(function(){return t.cancel()}),this},n.prototype.registerDomEvent=function(t,e,n){return t.addEventListener(e,n),this.addCancelable(function(){return t.removeEventListener(e,n)}),this},n.prototype.cancel=function(){this.isCanceled||(this._isCancelled=!0,this.cancelables.forEach(function(t){return t()}),this.cancelables=void 0)},Object.defineProperties(n.prototype,o);var r=function(){this.subscribeChannel=[],this.subscribeOnceChannel=[],this.onAfterFire=[]},i={subscriptions:{configurable:!0}};i.subscriptions.get=function(){return this.subscribeChannel.length+this.subscribeOnceChannel.length},r.prototype.subscribe=function(t,e){return this.createSubscription(t,this.subscribeChannel,e).facade},r.prototype.subscribeOnce=function(t,e){return this.createSubscription(t,this.subscribeOnceChannel,e).facade},r.prototype.hasSubscriptions=function(){return this.subscriptions>0},r.prototype.cancelAll=function(){var t,e=this;this.isFiring?this.onAfterFire.push(function(){var t;e.subscribeChannel.length=0,e.subscribeOnceChannel.length=0,null===(t=e.onEmpty)||void 0===t||t.call(e)}):(this.subscribeChannel.length=0,this.subscribeOnceChannel.length=0,null===(t=this.onEmpty)||void 0===t||t.call(this))},r.prototype.afterFire=function(){this.onAfterFire.length>0&&(this.onAfterFire.forEach(function(t){return t()}),this.onAfterFire.length=0)},r.prototype.fire=function(t){this.isFiring=!0;for(var e=this.subscribeChannel.length,n=0;n<e;n++)this.subscribeChannel[n].callback(t);if(this.subscribeOnceChannel.length>0){e=this.subscribeOnceChannel.length;for(var o=0;o<e;o++)this.subscribeOnceChannel[o].callback(t);this.subscribeOnceChannel.length=0}this.isFiring=!1,this.afterFire()},r.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}},r.prototype.cancel=function(t,e){var n,o=this,r=e.indexOf(t);r>=0&&(this.isFiring?this.onAfterFire.push(function(){return o.cancel(t,e)}):(e.splice(r,1),this.hasSubscriptions()||null===(n=this.onEmpty)||void 0===n||n.call(this)))},Object.defineProperties(r.prototype,i);var a=function(t){this.value=t,this.primed=void 0!==t,this.updateEvent=new r};a.prototype.update=function(t){if(this.primed=!0,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},a.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},a.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},a.prototype.listenOnce=function(t,e){return this.updateEvent.subscribeOnce(t,e).cancel},a.prototype.filter=function(t,e){e=null!=e?e:new n;var o=new s(e);return this.listen(function(e){t(e,o.value)&&o.update(e)},e),o},a.prototype.max=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)>0:t>e},t)},a.prototype.min=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)<0:t<e},t)},a.prototype.pipe=function(t,e){this.listen(function(e){return t.update(e)},e)},a.prototype.map=function(t,e){var o;return e=null!=e?e:new n,o=this.primed?new s(e,t(this.value)):new s(e),this.listen(function(e){o.update(t(e))},e),o},a.prototype.tap=function(t,e){return this.listen(function(e){t(e)},e),this},a.prototype.await=function(t){t=null!=t?t:new n;var e=new s(t);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},a.prototype.unique=function(t){t=null!=t?t:new n;var e=new s(t,this.value);return this.listen(function(t){t!==e.value&&e.update(t)},t),e},a.prototype.diff=function(t){t=null!=t?t:new n;var e=new s(t,{new:this.value,old:void 0});return this.listen(function(t){e.update({new:t,old:e.value.new})},t),e},a.prototype.reduce=function(t,e,o){o=null!=o?o:new n;var r=new s(o,e);return this.listen(function(e){return r.update(t(r.value,e))},o),r},a.prototype.aggregate=function(t,e,o){var r=this;o=null!=o?o:new n;var i=new s(o,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},a.prototype.aggregateThree=function(t,e,o,r){var i=this;r=null!=r?r:new n;var a=new s(r,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},a.prototype.aggregateFour=function(t,e,o,r,i){var a=this;i=null!=i?i:new n;var u=new s(i,r(this.value,t.value,e.value,o.value));return this.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),t.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),e.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),o.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),u},a.prototype.stringJoin=function(t,e){e=null!=e?e:new n;var o=new s(e,"");return this.listen(function(e){return o.update(o.value+t+e.toString())},e),o},a.prototype.combine=function(t,e){e=null!=e?e:new n;var o=new s(e);this.pipe(o,e);for(var r=0,i=t;r<i.length;r+=1)i[r].pipe(o,e);return o},a.prototype.delay=function(t,e){e=null!=e?e:new n;var o=new s(e,this.value);return this.listen(function(e){setTimeout(function(){o.update(e)},t)},e),o},a.prototype.skip=function(t,e){e=null!=e?e:new n;var o=new s(e,this.value);return this.listen(function(e){0===t?o.update(e):t--},e),o},a.prototype.cutoff=function(t,e){e=null!=e?e:new n;var o=new s(e,this.value);return this.listen(function(e){t-- >0&&o.update(e)},e),o},a.prototype.awaitNextUpdate=function(t){var e=this;return new Promise(function(n){e.listenOnce(function(t){return n(t)},t)})},a.prototype.debounce=function(t,e){e=null!=e?e:new n;var o,r=new s(e,this.value);return this.listen(function(e){clearTimeout(o),o=setTimeout(function(){r.update(e)},t)},e),r},a.prototype.throttle=function(t,e){e=null!=e?e:new n;var o=new s(e,this.value),r=!1;return this.listen(function(e){r||(o.update(e),r=!0,setTimeout(function(){r=!1},t))},e),o},a.prototype.buffer=function(t,e){e=null!=e?e:new n;var o,r=new s(e),i=[];return this.listen(function(e){i.push(e),o||(o=setTimeout(function(){o=void 0,r.update(i),i=[]},t))},e),r},a.prototype.accumulate=function(t){var e=new u;return this.listen(function(t){e.push(t)},t),e},a.prototype.pick=function(t,e){var o;e=null!=e?e:new n;var r=new s(e,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},a.prototype.cancelAll=function(){this.updateEvent.cancelAll()};var s=function(t){function e(e,n){var o=this;t.call(this,n),this.disposeToken=e,this.updateEvent.onEmpty=function(){e.cancel(),Object.defineProperty(o,"value",{get:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')},set:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')}})}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.persist=function(){return this.updateEvent.onEmpty=void 0,this},e.prototype.listen=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listen.call(this,e,n)},e.prototype.listenAndRepeat=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listenAndRepeat.call(this,e,n)},e.prototype.listenOnce=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listen.call(this,e,n)},e}(a),u=function(t){this.data=t?t.slice():[],this.lengthSource=new a(this.data.length),this.updateEvent=new r},c={length:{configurable:!0}};u.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)},u.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},u.prototype.listenOnce=function(t,e){return this.updateEvent.subscribeOnce(t,e).cancel},u.prototype.awaitNextUpdate=function(t){var e=this;return new Promise(function(n){e.listenOnce(function(t){return n(t)},t)})},c.length.get=function(){return this.lengthSource},u.prototype.getData=function(){return this.data},u.prototype.get=function(t){return this.data[t]},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length))},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length)}},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length)}},u.prototype.appendArray=function(t){this.data=this.data.concat(t),this.update({operation:"add",operationDetailed:"append",count:t.length,index:this.data.length-t.length,items:t,newState:this.data}),this.lengthSource.value!==this.data.length&&this.lengthSource.update(this.data.length)},u.prototype.push=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.appendArray(t)},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length)},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length),t},u.prototype.merge=function(t){var e=this.data;this.data=t.slice(),this.update({operation:"merge",operationDetailed:"merge",previousState:e,index:0,items:this.data,newState:this.data}),this.lengthSource.value!==this.data.length&&this.lengthSource.update(this.data.length)},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length)},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length)},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length))},u.prototype.clear=function(){if(0!==this.data.length){var t=this.data;this.data=[],this.update({operation:"remove",operationDetailed:"clear",count:t.length,index:0,items:t,newState:this.data}),this.lengthSource.value!==this.data.length&&this.lengthSource.update(this.data.length)}},u.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.value!==this.data.length&&this.lengthSource.update(this.data.length),t},u.prototype.toArray=function(){return this.data.slice()},u.prototype.sort=function(t,e,n){void 0===e&&(e=[]);var o=new d(this,t,n);return e.forEach(function(t){t.listen(function(){return o.refresh()})}),o},u.prototype.map=function(t,e,n){void 0===e&&(e=[]);var o=new h(this,t,n);return e.forEach(function(t){t.listen(function(){return o.refresh()})}),o},u.prototype.filter=function(t,e,n){void 0===e&&(e=[]);var o=new f(this,t,n);return e.forEach(function(t){t.listen(function(){return o.refresh()},n)}),o},u.prototype.forEach=function(t){return this.data.forEach(t)},u.prototype.update=function(t){this.updateEvent.fire(t)},Object.defineProperties(u.prototype,c);var l,p=function(t){function e(e,n){var o=this;t.call(this,n),this.disposeToken=e,this.updateEvent.onEmpty=function(){e.cancel(),Object.defineProperty(o,"data",{get:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')},set:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')}})}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.persist=function(){return this.updateEvent.onEmpty=void 0,this},e.prototype.listenAndRepeat=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listenAndRepeat.call(this,e,n)},e.prototype.listen=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listen.call(this,e,n)},e.prototype.listenOnce=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listenOnce.call(this,e,n)},e}(u),h=function(t){function e(e,o,r){var i=this;void 0===r&&(r=new n);var a=e.getData().map(o);t.call(this,r,a),this.parent=e,this.mapper=o,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":i.removeLeft(t.count);break;case"removeRight":i.removeRight(t.count);break;case"remove":i.remove(i.data[t.index]);break;case"clear":i.clear();break;case"prepend":(e=i).unshift.apply(e,t.items.map(i.mapper));break;case"append":i.appendArray(t.items.map(i.mapper));break;case"swap":i.swap(t.index,t.index2);break;case"replace":i.set(t.index,i.mapper(t.items[0]));break;case"merge":for(var n=i.data.slice(),o=t.previousState.slice(),r=0;r<t.newState.length;r++)if(i.data.length<=r&&i.data.push(i.mapper(t.newState[r])),o[r]!==t.newState[r]){var a=o.indexOf(t.newState[r]);if(-1!==a){var s=i.data[r];i.data[r]=i.data[a],i.data[a]=s;var u=o[r];o[r]=o[a],o[a]=u}else i.data.splice(r,0,i.mapper(t.newState[r])),o.splice(r,0,t.newState[r])}i.data.length>t.newState.length&&(i.data.length=t.newState.length),i.update({operation:"merge",operationDetailed:"merge",previousState:n,index:0,items:i.data,newState:i.data})}},r)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.refresh=function(){this.merge(this.parent.data.map(this.mapper))},e}(p),d=function(t){function e(e,o,r){var i=this;void 0===r&&(r=new n);var a=e.getData().slice().sort(o);t.call(this,r,a),this.parent=e,this.comparator=o,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)i.remove(o[n]);break;case"remove":i.remove(t.items[0]);break;case"clear":i.clear();break;case"prepend":(e=i).unshift.apply(e,t.items),i.data.sort(i.comparator);break;case"append":i.appendSorted(t.items);break;case"merge":i.merge(t.items.slice().sort(i.comparator));break;case"swap":break;case"replace":i.remove(t.target),i.appendSorted(t.items)}},r)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.appendSorted=function(t){this.merge(this.data.concat(t).sort(this.comparator))},e.prototype.refresh=function(){this.merge(this.parent.getData().slice().sort(this.comparator))},e}(p),f=function(t){function e(e,o,r){var i=this;void 0===r&&(r=new n),Array.isArray(e)&&(e=new u(e));var a=e.data.filter(o=null!=o?o:function(){return!0});t.call(this,r,a),this.parent=e,this.viewFilter=o,e.listen(function(t){var e,n;switch(t.operationDetailed){case"clear":i.clear();break;case"removeLeft":case"removeRight":case"remove":for(var o=0,r=t.items;o<r.length;o+=1)i.remove(r[o]);break;case"prepend":n=t.items.filter(i.viewFilter),(e=i).unshift.apply(e,n);break;case"append":n=t.items.filter(i.viewFilter),i.appendArray(n);break;case"merge":i.merge(t.items.filter(i.viewFilter));break;case"swap":var a=i.data.indexOf(t.items[0]),s=i.data.indexOf(t.items[1]);-1!==a&&-1!==s&&i.swap(a,s);break;case"replace":var u=i.data.indexOf(t.target);-1!==u&&(i.viewFilter(t.items[0])?i.set(u,t.items[0]):i.remove(t.target))}},r)}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.merge(this.parent.data.filter(this.viewFilter))},e}(p),v=Symbol("owner"),y=function(t){var e=this;this.node=this.create(t),t instanceof a&&t.listen(function(t){e.node&&(e.node.textContent=t)})};y.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},y.prototype.create=function(t){var e=document.createTextNode(this.resolveStringSource(t));return e[v]=this,e},y.prototype.remove=function(){this.hasParent()&&this.node.parentElement[v].removeChild(this.node)},y.prototype.hasParent=function(){return!!this.node.parentElement},(l=exports.DataFlow||(exports.DataFlow={}))[l.UPSTREAM=0]="UPSTREAM",l[l.DOWNSTREAM=1]="DOWNSTREAM";var m=function(t,e){void 0===e&&(e=!0),this.value=t,this.updateDownstreamEvent=new r,this.updateUpstreamEvent=new r,this.propagateWritesToReadStream=e};m.fromTwoDataSource=function(t,e,n,o){void 0===o&&(o=!0);var r=new m(n,o);return r.updateDownstreamEvent=t.updateEvent,r.updateUpstreamEvent=e.updateEvent,r},m.createOneWay=function(t,e){return void 0===t&&(t=exports.DataFlow.DOWNSTREAM),new m(e,!1).oneWayFlow(t)},m.prototype.updateDownstream=function(t){if(this.updatingDownstream)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.updatingDownstream=!0,this.value=t,this.updateDownstreamEvent.fire(t),this.updatingDownstream=!1},m.prototype.updateUpstream=function(t){if(this.updatingUpstream)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.updatingUpstream=!0,this.value=t,this.updateUpstreamEvent.fire(t),this.propagateWritesToReadStream&&this.updateDownstreamEvent.fire(t),this.updatingUpstream=!1},m.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},m.prototype.listen=function(t,e){return this.updateDownstreamEvent.subscribe(t,e).cancel},m.prototype.listenUpstream=function(t,e){return this.updateUpstreamEvent.subscribe(t,e).cancel},m.prototype.listenUpstreamOnce=function(t,e){return this.updateUpstreamEvent.subscribeOnce(t,e).cancel},m.prototype.listenDownstream=function(t,e){return this.updateDownstreamEvent.subscribe(t,e).cancel},m.prototype.downStreamToDataSource=function(t){var e=new a(this.value);return this.listenDownstream(function(t){e.update(t)},t),e},m.prototype.aggregate=function(t,e,o){var r=this;o=null!=o?o:new n;var i=new s(o,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},m.prototype.aggregateThree=function(t,e,o,r){var i=this;r=null!=r?r:new n;var a=new s(r,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},m.prototype.aggregateFour=function(t,e,o,r,i){var a=this;i=null!=i?i:new n;var u=new s(i,r(this.value,t.value,e.value,o.value));return this.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),t.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),e.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),o.listen(function(){return u.update(r(a.value,t.value,e.value,o.value))},i),u},m.prototype.filter=function(t,e,n){var o=this;if("function"==typeof e){var r=new m(void 0,!1);return this.listenDownstream(function(e){t(e,r.value)&&r.updateDownstream(e)},n),r.listenUpstream(function(t){e(t,o.value)&&o.updateUpstream(t)},n),r}var i=new a;return this.listenDownstream(function(e){t(e,i.value)&&i.update(e)},e),i},m.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)},m.prototype.map=function(t,e,n){var o=this;if("function"==typeof e){var r=new m(t(this.value),!1);return this.listenDownstream(function(e){return r.updateDownstream(t(e))},n),r.listenUpstream(function(t){return o.updateUpstream(e(t))},n),r}var i=new a(t(this.value));return this.listenDownstream(function(e){return i.update(t(e))},e),i},m.prototype.listenOnce=function(t,e){return this.updateDownstreamEvent.subscribeOnce(t,e).cancel},m.prototype.awaitNextUpdate=function(t){var e=this;return new Promise(function(n){e.listenOnce(function(t){return n(t)},t)})},m.prototype.debounceUpstream=function(t,e){var n,o=this,r=new m(this.value);return r.listenUpstream(function(e){clearTimeout(n),n=setTimeout(function(){o.updateUpstream(e)},t)},e),this.listenDownstream(function(t){r.updateDownstream(t)},e),r},m.prototype.debounceDownstream=function(t,e){var n,o=this,r=new m(this.value);return this.listenDownstream(function(e){clearTimeout(n),n=setTimeout(function(){r.updateDownstream(e)},t)},e),r.listenUpstream(function(t){o.updateUpstream(t)},e),r},m.prototype.unique=function(t){var e=this,n=new m(this.value,!1),o=this.value,r=this.value;return this.listenDownstream(function(t){r!==t&&(r=t,n.updateDownstream(t))},t),n.listenUpstream(function(t){o!==t&&(o=t,e.updateUpstream(t))},t),n},m.prototype.oneWayFlow=function(t,e){var n=this;void 0===t&&(t=exports.DataFlow.DOWNSTREAM);var o=new m(this.value,!1);return t===exports.DataFlow.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},m.prototype.reduce=function(t,e,n){var o=new a(e);return this.listen(function(e){return o.update(t(o.value,e))},n),o},m.prototype.cancelAll=function(){this.updateDownstreamEvent.cancelAll(),this.updateUpstreamEvent.cancelAll()};var g=Symbol("AurumElementModel"),b={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"},w=["id","name","draggable","tabindex","style","role","contentEditable"];function _(t){return t&&t[g]?_(t.constructor(t.props,t.innerNodes)):t}var x=function(t,e,n){var o;this.node=this.create(n),this.children=[],null!=t&&(t.onAttach&&(this.onAttach=t.onAttach),this.onDetach=t.onDetach,this.initialize(t),null===(o=t.onCreate)||void 0===o||o.call(t,this.node)),e&&(this.pendingChildren=e)};x.prototype.initialize=function(t){this.createEventHandlers(b,t);var e=Object.keys(t).filter(function(t){return t.includes("-")});this.bindProps(w,t,e),t.class&&this.handleClass(t.class)},x.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 u=s[a];e[u]&&this.assignStringSourceToAttribute(e[u],u)}},x.prototype.createEventHandlers=function(t,e){var n=this,o=function(o){e[t[o]]&&(e[t[o]]instanceof a?n.node.addEventListener(o,function(n){return e[t[o]].update(n)}):e[t[o]]instanceof m?n.node.addEventListener(o,function(n){return e[t[o]].updateDownstream(n)}):"function"==typeof e[t[o]]&&n.node.addEventListener(o,function(n){return e[t[o]](n)}))};for(var r in t)o(r)},x.prototype.render=function(){for(var t,e,n=0,o=0;o<this.children.length;o++,n++)this.children[o]instanceof O?n=this.renderFragment(this.children[o],n):this.renderChild(this.children[o],n);for(;this.node.childNodes.length>n;){var r=this.node.childNodes[this.node.childNodes.length-1];this.node.removeChild(r),null===(e=null===(t=r[v])||void 0===t?void 0:t.handleDetach)||void 0===e||e.call(t)}},x.prototype.renderFragment=function(t,e){for(var n=0;n<t.children.length;n++,e++)t.children[n]instanceof O?e=this.renderFragment(t.children[n],e):this.renderChild(t.children[n],e);return--e},x.prototype.renderChild=function(t,e){if(this.node.childNodes.length<=e)return this.addChildDom(t);if(this.node.childNodes[e][v]!==t){var n=this.getChildIndex(t.node);-1!==n?this.swapChildrenDom(e,n):this.addDomNodeAt(t.node,e)}},x.prototype.assignStringSourceToAttribute=function(t,e){var o=this;"string"==typeof t||"boolean"==typeof t?"boolean"==typeof t?t?this.node.setAttribute(e,""):this.node.removeAttribute(e):this.node.setAttribute(e,t):(this.cleanUp||(this.cleanUp=new n),t.unique(this.cleanUp).listenAndRepeat(function(t){"boolean"==typeof t?t?o.node.setAttribute(e,""):o.node.removeAttribute(e):o.node.setAttribute(e,t)}))},x.prototype.handleAttach=function(t){var e,n,o;if(t.isConnected()){this.pendingChildren&&(this.addChildren(this.pendingChildren),this.pendingChildren=void 0),null===(e=this.onAttach)||void 0===e||e.call(this,this.node),this.onAttach=void 0;for(var r=0,i=this.node.childNodes;r<i.length;r+=1)null===(o=null===(n=i[r][v])||void 0===n?void 0:n.handleAttach)||void 0===o||o.call(n,this)}},x.prototype.handleDetach=function(){var t,e,n;if(this.cleanUp&&this.cleanUp.cancel(),!this.node.isConnected){null===(t=this.onDetach)||void 0===t||t.call(this,this.node);for(var o=0,r=this.children;o<r.length;o+=1){var i=r[o];i instanceof O&&i.handleDetach()}for(var a=0,s=this.node.childNodes;a<s.length;a+=1){var u=s[a];u[v]&&(null===(n=(e=u[v]).handleDetach)||void 0===n||n.call(e))}this.node[v]=void 0}},x.prototype.handleClass=function(t){var e=this;if("string"==typeof t)this.node.className=t;else if(t instanceof a||t instanceof m)this.cleanUp||(this.cleanUp=new n),t.value&&(Array.isArray(t.value)?(this.node.className=t.value.join(" "),t.unique(this.cleanUp).listen(function(){e.node.className=t.value.join(" ")})):(this.node.className=t.value,t.unique(this.cleanUp).listen(function(){e.node.className=t.value}))),t.unique(this.cleanUp).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 s=i[r];s instanceof a&&(this.cleanUp||(this.cleanUp=new n),s.unique(this.cleanUp).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}))}}},x.prototype.create=function(t){var e=document.createElement(t);return e[v]=this,e},x.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},x.prototype.hasChild=function(t){for(var e=0,n=t.childNodes;e<n.length;e+=1)if(n[e]===t)return!0;return!1},x.prototype.addChildDom=function(t){var e;this.node.appendChild(t.node),null===(e=t.handleAttach)||void 0===e||e.call(t,this)},x.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))}},x.prototype.addDomNodeAt=function(t,e){var n,o,r,i;e>=this.node.childNodes.length?(this.node.appendChild(t),null===(o=(n=t[v]).handleAttach)||void 0===o||o.call(n,this)):(this.node.insertBefore(t,this.node.childNodes[e]),null===(i=(r=t[v]).handleAttach)||void 0===i||i.call(r,this))},x.prototype.remove=function(){this.hasParent()&&this.node.parentElement[v].removeChild(this.node)},x.prototype.hasParent=function(){return!!this.node.parentElement},x.prototype.isConnected=function(){return this.node.isConnected},x.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1),this.render()},x.prototype.removeChildAt=function(t){this.children.splice(t,1),this.render()},x.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()}},x.prototype.clearChildren=function(){this.children.length=0,this.render()},x.prototype.addChild=function(t){if(null!=t&&(!t[g]||void 0!==(t=_(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()},x.prototype.childNodeToAurum=function(t){var e=this;if(t instanceof x)return t;if(t instanceof Promise){var n=new O({});return t.then(function(t){n.addChildren([t]),e.render()}),n}if(t instanceof u){var o=new O({repeatModel:t});return o.onChange.subscribe(function(){return e.render()}),o}if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return new y(t.toString());if(t instanceof a){var r=new O({},[t]);return r.onChange.subscribe(function(){return e.render()}),r}throw new Error("Unsupported child type")},x.prototype.addChildAt=function(t,e){this.children.splice(e,0,this.childNodeToAurum(t)),this.render()},x.prototype.addChildren=function(t){if(0!==t.length)for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e])};var O=function(t,e){this.cancellationToken=new n,this.onChange=new r,this.children=[],t.repeatModel?this.handleRepeat(t.repeatModel):e&&this.addChildren(e)};O.prototype.handleDetach=function(){this.cancellationToken.cancel()},O.prototype.addChildren=function(t){for(var e=this,n=function(){var t=r[o],n=void 0;if((n=t[g]?_(t):t)instanceof x)e.children.push(n);else{if(!(n instanceof a))throw new Error("case not yet implemented");var i=void 0,s=void 0,u={ts:void 0};n.unique().listenAndRepeat(function(t){if(u.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,u,u.ts)}else i=e.handleSourceChild(t,i,n,u,u.ts)},e.cancellationToken)}},o=0,r=t;o<r.length;o+=1)n()},O.prototype.handleSourceChild=function(t,e,n,o,r){var i=this;if(Array.isArray(t))for(var s=0,c=t;s<c.length;s+=1)this.handleSourceChild(c[s],e,n,o,r);if(null!=t){if(t[g]&&(t=_(t)),"string"==typeof t||"bigint"==typeof t||"number"==typeof t||"boolean"==typeof t)if(e){if(e instanceof x){var l=new y(null!=n?n:t);this.children.splice(this.children.indexOf(e),1,l),e=l,this.onChange.fire()}}else{var p=new y(null!=n?n:t);this.children.push(p),e=p,this.onChange.fire()}else if(t instanceof x)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){o.ts===r&&(i.addChildren([t]),i.onChange.fire())});else if(t instanceof a)if(e){if(e!==t){var h=new O({},[t]);h.onChange.subscribe(function(){return i.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,h),e=h,this.onChange.fire()}}else{var d=new O({},[t]);e=d,this.children.push(d),d.onChange.subscribe(function(){return i.onChange.fire()}),this.onChange.fire()}else if(t instanceof u)if(e){if(e!==t){var f=new O({repeatModel:t});f.onChange.subscribe(function(){return i.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,f),e=f,this.onChange.fire()}}else{var v=new O({repeatModel:t});e=v,this.children.push(v),v.onChange.subscribe(function(){return i.onChange.fire()}),this.onChange.fire()}return e}e&&(this.children.splice(this.children.indexOf(e),1),e=void 0,this.onChange.fire())},O.prototype.handleRepeat=function(t){var e=this;t.listenAndRepeat(function(t){var n;switch(t.operationDetailed){case"replace":e.children[t.index]=_(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"merge":for(var r=t.previousState.slice(),i=0;i<t.newState.length;i++)if(e.children.length<=i&&e.children.push(_(t.newState[i])),r[i]!==t.newState[i]){var a=r.indexOf(t.newState[i]);if(-1!==a){var s=e.children[i];e.children[i]=e.children[a],e.children[a]=s;var u=r[i];r[i]=r[a],r[a]=u}else e.children.splice(i,0,_(t.newState[i])),r.splice(i,0,t.newState[i])}e.children.length>t.newState.length&&(e.children.length=t.newState.length);break;case"append":e.children=e.children.concat(t.items.map(_));break;case"prepend":(n=e.children).unshift.apply(n,t.items.map(_));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()},this.cancellationToken)};var C=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}(x),S=Symbol("route");function E(){var t=location.hash.substring(1);return t.includes("?")?t.substring(0,t.indexOf("?")):t.includes("#")?t.substring(0,t.indexOf("#")):t}var D=Symbol("switchCase"),A=function(t){t&&(this.data=t),this.updateEvent=new r,this.updateEventOnKey=new Map};A.prototype.pick=function(t,e){var n,o=new a(null===(n=this.data)||void 0===n?void 0:n[t]);return this.listenOnKey(t,function(t){o.update(t.newValue)},e),o},A.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},A.prototype.listenOnKeyAndRepeat=function(t,e,n){return e({key:t,newValue:this.data[t],oldValue:void 0}),this.listenOnKey(t,e,n)},A.prototype.listenOnKey=function(t,e,n){return this.updateEventOnKey.has(t)||this.updateEventOnKey.set(t,new r),this.updateEventOnKey.get(t).subscribe(e,n).cancel},A.prototype.keys=function(){return Object.keys(this.data)},A.prototype.values=function(){return Object.values(this.data)},A.prototype.get=function(t){return this.data[t]},A.prototype.delete=function(t){var e=this.data[t];delete this.data[t],this.updateEvent.fire({oldValue:e,key:t,newValue:void 0,deleted:!0}),this.updateEventOnKey.has(t)&&this.updateEventOnKey.get(t).fire({oldValue:e,key:t,newValue:void 0})},A.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]})}},A.prototype.assign=function(t){if(t instanceof A)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])}},A.prototype.toObject=function(){return Object.assign({},this.data)},A.prototype.toDataSource=function(){var t=this,e=new a(this.data);return this.listen(function(n){e.update(t.data)}),e};var k=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}(x),j=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}(x),U={input:"onInput",change:"onChange"},N=["placeholder","readonly","disabled","accept","alt","autocomplete","autofocus","checked","defaultChecked","formAction","formEnctype","formMethod","formNoValidate","formTarget","max","maxLength","min","minLength","pattern","multiple","required","type"],T=function(t){function e(e,o){var r,i,s=this;t.call(this,e,o,"input"),null!==e&&(e.value instanceof a||e.value instanceof m?(this.cleanUp||(this.cleanUp=new n),e.value.unique(this.cleanUp).listenAndRepeat(function(t){return s.node.value=t}),this.node.addEventListener("input",function(){e.value instanceof a?e.value.update(s.node.value):e.value instanceof m&&e.value.updateUpstream(s.node.value)})):this.node.value=null!==(r=e.value)&&void 0!==r?r:"",e.checked instanceof a||e.checked instanceof m?(this.cleanUp||(this.cleanUp=new n),e.checked.unique(this.cleanUp).listenAndRepeat(function(t){return s.node.checked=t}),this.node.addEventListener("change",function(){e.checked instanceof a?e.checked.update(s.node.checked):e.checked instanceof m&&e.checked.updateUpstream(s.node.checked)})):this.node.checked=null!==(i=e.checked)&&void 0!==i&&i,this.bindProps(N,e),this.createEventHandlers(U,e))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(x),P=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}(x),F=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}(x),R=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}(x),I=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}(x),L=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}(x),M=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}(x),q=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}(x),V=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}(x),K=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}(x),W=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}(x),H=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}(x),z=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}(x),B=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}(x),J=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}(x),G=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}(x),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}(x),X=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}(x),Y=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}(x),Z=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}(x),$=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}(x),tt=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}(x),et={input:"onInput",change:"onChange"},nt=["placeholder","readonly","disabled","rows","wrap","autocomplete","autofocus","max","maxLength","min","minLength","required","type"],ot=function(t){function e(e,o){var r,i,a,s=this;t.call(this,e,o,"textArea"),null!==e&&(e.inputValueSource?(this.node.value=null!==(i=null!==(r=e.initialValue)&&void 0!==r?r:e.inputValueSource.value)&&void 0!==i?i:"",this.cleanUp||(this.cleanUp=new n),e.inputValueSource.unique(this.cleanUp).listen(function(t){return s.node.value=t})):this.node.value=null!==(a=e.initialValue)&&void 0!==a?a:"",this.bindProps(nt,e),this.createEventHandlers(et,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(s.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(x),rt=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}(x),it=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}(x),at=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}(x),st=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}(x),ut=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}(x),ct=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}(x),lt=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}(x),pt=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}(x),ht=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}(x),dt=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}(x),ft=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}(x),vt=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}(x),yt=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}(x),mt=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}(x),gt=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}(x),bt=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}(x),wt=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}(x),_t=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}(x),xt=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}(x),Ot=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}(x),Ct={change:"onChange"},St=function(t){function e(e,o){var r=this;t.call(this,e,o,"select"),null!==e&&(this.createEventHandlers(Ct,e),e.value&&(this.value=e.value,(e.value instanceof a||e.value instanceof m)&&(this.cleanUp||(this.cleanUp=new n),e.value.listen(function(t){r.node.value=t},this.cleanUp),this.node.addEventListener("change",function(){e.value instanceof a?e.value.update(r.node.value):e.value instanceof m&&e.value.updateUpstream(r.node.value)}))),e.selectedIndex&&(this.selectedIndex=e.selectedIndex,(e.selectedIndex instanceof a||e.selectedIndex instanceof m)&&(this.cleanUp||(this.cleanUp=new n),e.selectedIndex.listen(function(t){r.node.selectedIndex=t},this.cleanUp),this.node.addEventListener("change",function(){e.selectedIndex instanceof a?e.selectedIndex.update(r.node.selectedIndex):e.selectedIndex instanceof m&&e.selectedIndex.updateUpstream(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.value instanceof a||this.value instanceof m?this.node.value=this.value.value:void 0!==this.value?this.node.value=this.value:this.selectedIndex instanceof a||this.selectedIndex instanceof m?this.node.selectedIndex=this.selectedIndex.value:void 0!==this.selectedIndex&&(this.node.selectedIndex=this.selectedIndex))},e}(x),Et=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}(x),Dt=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}(x),At=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}(x),kt=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}(x),jt=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}(x),Ut=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}(x),Nt=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}(x),Tt=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}(x),Pt=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}(x),Ft=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}(x),Rt=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}(x),It=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}(x),Lt=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}(x),Mt={button:j,div:k,input:T,li:P,span:F,style:R,ul:L,p:M,img:q,link:V,canvas:K,a:W,article:H,br:z,form:B,label:J,ol:G,pre:Q,progress:X,table:Y,td:Z,tr:$,th:tt,textarea:ot,h1:rt,h2:it,h3:at,h4:st,h5:ut,h6:ct,header:lt,footer:pt,nav:ht,b:dt,i:ft,script:vt,abbr:yt,area:mt,aside:gt,audio:I,em:bt,heading:wt,iframe:_t,noscript:xt,option:function(t){function e(e,n){t.call(this,e,n,"option"),e&&this.bindProps(["value"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(x),q:Ot,select:St,source:Et,title:Dt,video:At,tbody:kt,tfoot:jt,thead:Ut,summary:Nt,details:Tt,sub:Pt,sup:Ft,svg:Rt,data:It,time:Lt,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}(x)},qt=function(){};qt.attach=function(t,e){var n=_(t);if(e[v])throw new Error("This node is already managed by aurum and cannot be used");if(!(n instanceof x))throw new Error("Root node of aurum application must be a single dom node");e.appendChild(n.node),n.handleAttach(n),e[v]=n},qt.isAttached=function(t){return void 0!==t[v]},qt.detach=function(t){t[v]&&(t[v].node.remove(),t[v].handleDetach(),t[v]=void 0)},qt.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=Mt[t]))throw new Error("Node "+a+" does not exist or is not supported")}return Object.getPrototypeOf(t)===x?((n={})[g]=!0,n.constructor=function(e,n){return new t(e,n)},n.props=e,n.innerNodes=r,n):((o={})[g]=!0,o.constructor=t,o.props=e,o.innerNodes=r,o)},exports.aurumElementModelIdentitiy=g,exports.prerender=_,exports.AurumElement=x,exports.AurumFragment=O,exports.Custom=C,exports.AurumRouter=function(t,e){if((e=e.map(_)).some(function(t){return!t[S]}))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 a(E());return window.addEventListener("hashchange",function(){n.update(E())}),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)})},exports.Route=function(t,e){var n;return(n={})[S]=!0,n.content=e,n.default=!1,n.href=t.href,n},exports.DefaultRoute=function(t,e){var n;return(n={})[S]=!0,n.content=e,n.default=!0,n.href=void 0,n},exports.Suspense=function(t,e){var n=new a(null==t?void 0:t.fallback);return Promise.all(e.map(_)).then(function(t){n.update(t)}),n},exports.Switch=function(t,e){if((e=e.map(_)).some(function(t){return!t[D]}))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");var n=t.state.unique();return n.primed=!0,n.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={})[D]=!0,n.content=e,n.default=!1,n.value=t.when,n},exports.DefaultSwitchCase=function(t,e){var n;return(n={})[D]=!0,n.content=e,n.default=!0,n.value=void 0,n},exports.DataSource=a,exports.TransientDataSource=s,exports.ArrayDataSource=u,exports.TransientArrayDataSource=p,exports.MappedArrayView=h,exports.SortedArrayView=d,exports.FilteredArrayView=f,exports.DuplexDataSource=m,exports.ObjectDataSource=A,exports.Aurum=qt,exports.CancellationToken=n,exports.aurumClassName=function(t,e){var n=[],o=function(o){if(t[o])if(t[o]instanceof a||t[o]instanceof m){var r=t[o],i=new a(r.value?o:"");r.listen(function(t){i.update(r.value?o:"")},e),n.push(i)}else n.push(o)};for(var r in t)o(r);return n}; | ||
//# 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(t){this.data=t};e.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)}},e.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 n=function(t){var e=this;void 0===t&&(t=[]),this.length=0,t.forEach(function(t){return e.append(t)})};n.prototype.find=function(t){for(var e=this.rootNode;e&&!t(e);)e=e.next;return e},n.prototype.append=function(t){return this.rootNode||this.lastNode?(this.lastNode.next=new e(t),this.lastNode.next.previous=this.lastNode,this.lastNode=this.lastNode.next):this.rootNode=this.lastNode=new e(t),this.length++,t},n.prototype.forEach=function(t){this.find(function(e){return t(e.data),!1})},n.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 o=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.cancelables=new n(t),this._isCancelled=!1},r={isCanceled:{configurable:!0}};r.isCanceled.get=function(){return this._isCancelled},o.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},o.prototype.removeCancelable=function(t){return this.throwIfCancelled("attempting to remove cancellable from token that is already cancelled"),this.cancelables.remove(t),this},o.prototype.addDisposable=function(t){return this.addCancelable(function(){return t.dispose()}),this},o.prototype.callIfNotCancelled=function(t){this.isCanceled||t()},o.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)},o.prototype.setInterval=function(t,e){var n=setInterval(t,e);this.addCancelable(function(){return clearInterval(n)})},o.prototype.requestAnimationFrame=function(t){var e=this,n=requestAnimationFrame(function(){e.removeCancelable(o),t()}),o=function(){return cancelAnimationFrame(n)};this.addCancelable(o)},o.prototype.animationLoop=function(t){var e=requestAnimationFrame(function n(o){t(o),e=requestAnimationFrame(n)});this.addCancelable(function(){return cancelAnimationFrame(e)})},o.prototype.throwIfCancelled=function(t){if(this.isCanceled)throw new Error(t||"cancellation token is cancelled")},o.prototype.chain=function(t,e){return void 0===e&&(e=!1),e&&t.chain(this,!1),this.addCancelable(function(){return t.cancel()}),this},o.prototype.registerDomEvent=function(t,e,n){return t.addEventListener(e,n),this.addCancelable(function(){return t.removeEventListener(e,n)}),this},o.prototype.cancel=function(){this.isCanceled||(this._isCancelled=!0,this.cancelables.forEach(function(t){return t()}),this.cancelables=void 0)},Object.defineProperties(o.prototype,r);var i=function(){this.subscribeChannel=[],this.subscribeOnceChannel=[],this.onAfterFire=[]},a={subscriptions:{configurable:!0}};a.subscriptions.get=function(){return this.subscribeChannel.length+this.subscribeOnceChannel.length},i.prototype.subscribe=function(t,e){return this.createSubscription(t,this.subscribeChannel,e).facade},i.prototype.subscribeOnce=function(t,e){return this.createSubscription(t,this.subscribeOnceChannel,e).facade},i.prototype.hasSubscriptions=function(){return this.subscriptions>0},i.prototype.cancelAll=function(){var t,e=this;this.isFiring?this.onAfterFire.push(function(){var t;e.subscribeChannel.length=0,e.subscribeOnceChannel.length=0,null===(t=e.onEmpty)||void 0===t||t.call(e)}):(this.subscribeChannel.length=0,this.subscribeOnceChannel.length=0,null===(t=this.onEmpty)||void 0===t||t.call(this))},i.prototype.afterFire=function(){this.onAfterFire.length>0&&(this.onAfterFire.forEach(function(t){return t()}),this.onAfterFire.length=0)},i.prototype.fire=function(t){this.isFiring=!0;for(var e=this.subscribeChannel.length,n=0;n<e;n++)this.subscribeChannel[n].callback(t);if(this.subscribeOnceChannel.length>0){e=this.subscribeOnceChannel.length;for(var o=0;o<e;o++)this.subscribeOnceChannel[o].callback(t);this.subscribeOnceChannel.length=0}this.isFiring=!1,this.afterFire()},i.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}},i.prototype.cancel=function(t,e){var n,o=this,r=e.indexOf(t);r>=0&&(this.isFiring?this.onAfterFire.push(function(){return o.cancel(t,e)}):(e.splice(r,1),this.hasSubscriptions()||null===(n=this.onEmpty)||void 0===n||n.call(this)))},Object.defineProperties(i.prototype,a);var s=function(t){this.value=t,this.primed=void 0!==t,this.updateEvent=new i};s.prototype.update=function(t){if(this.primed=!0,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},s.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},s.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},s.prototype.listenOnce=function(t,e){return this.updateEvent.subscribeOnce(t,e).cancel},s.prototype.filter=function(t,e){e=null!=e?e:new o;var n=new u(e);return this.listen(function(e){t(e,n.value)&&n.update(e)},e),n},s.prototype.max=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)>0:t>e},t)},s.prototype.min=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)<0:t<e},t)},s.prototype.pipe=function(t,e){this.listen(function(e){return t.update(e)},e)},s.prototype.map=function(t,e){var n;return e=null!=e?e:new o,n=this.primed?new u(e,t(this.value)):new u(e),this.listen(function(e){n.update(t(e))},e),n},s.prototype.tap=function(t,e){return this.listen(function(e){t(e)},e),this},s.prototype.await=function(t){t=null!=t?t:new o;var e=new u(t);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},s.prototype.unique=function(t){t=null!=t?t:new o;var e=new u(t,this.value);return this.listen(function(t){t!==e.value&&e.update(t)},t),e},s.prototype.diff=function(t){t=null!=t?t:new o;var e=new u(t,{new:this.value,old:void 0});return this.listen(function(t){e.update({new:t,old:e.value.new})},t),e},s.prototype.reduce=function(t,e,n){n=null!=n?n:new o;var r=new u(n,e);return this.listen(function(e){return r.update(t(r.value,e))},n),r},s.prototype.aggregate=function(t,e,n){var r=this;n=null!=n?n:new o;var i=new u(n,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},s.prototype.aggregateThree=function(t,e,n,r){var i=this;r=null!=r?r:new o;var a=new u(r,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},s.prototype.aggregateFour=function(t,e,n,r,i){var a=this;i=null!=i?i:new o;var s=new u(i,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},s.prototype.stringJoin=function(t,e){e=null!=e?e:new o;var n=new u(e,"");return this.listen(function(e){return n.update(n.value+t+e.toString())},e),n},s.prototype.combine=function(t,e){e=null!=e?e:new o;var n=new u(e);this.pipe(n,e);for(var r=0,i=t;r<i.length;r+=1)i[r].pipe(n,e);return n},s.prototype.delay=function(t,e){e=null!=e?e:new o;var n=new u(e,this.value);return this.listen(function(e){setTimeout(function(){n.update(e)},t)},e),n},s.prototype.skip=function(t,e){e=null!=e?e:new o;var n=new u(e,this.value);return this.listen(function(e){0===t?n.update(e):t--},e),n},s.prototype.cutoff=function(t,e){e=null!=e?e:new o;var n=new u(e,this.value);return this.listen(function(e){t-- >0&&n.update(e)},e),n},s.prototype.awaitNextUpdate=function(t){var e=this;return new Promise(function(n){e.listenOnce(function(t){return n(t)},t)})},s.prototype.debounce=function(t,e){e=null!=e?e:new o;var n,r=new u(e,this.value);return this.listen(function(e){clearTimeout(n),n=setTimeout(function(){r.update(e)},t)},e),r},s.prototype.throttle=function(t,e){e=null!=e?e:new o;var n=new u(e,this.value),r=!1;return this.listen(function(e){r||(n.update(e),r=!0,setTimeout(function(){r=!1},t))},e),n},s.prototype.buffer=function(t,e){e=null!=e?e:new o;var n,r=new u(e),i=[];return this.listen(function(e){i.push(e),n||(n=setTimeout(function(){n=void 0,r.update(i),i=[]},t))},e),r},s.prototype.accumulate=function(t){var e=new c;return this.listen(function(t){e.push(t)},t),e},s.prototype.pick=function(t,e){var n;e=null!=e?e:new o;var r=new u(e,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},s.prototype.cancelAll=function(){this.updateEvent.cancelAll()};var u=function(t){function e(e,n){var o=this;t.call(this,n),this.disposeToken=e,this.updateEvent.onEmpty=function(){e.cancel(),Object.defineProperty(o,"value",{get:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')},set:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')}})}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.persist=function(){return this.updateEvent.onEmpty=void 0,this},e.prototype.listen=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listen.call(this,e,n)},e.prototype.listenAndRepeat=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listenAndRepeat.call(this,e,n)},e.prototype.listenOnce=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listen.call(this,e,n)},e}(s),c=function(t){this.data=t?t.slice():[],this.lengthSource=new s(this.data.length),this.updateEvent=new i},l={length:{configurable:!0}};c.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)},c.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},c.prototype.listenOnce=function(t,e){return this.updateEvent.subscribeOnce(t,e).cancel},c.prototype.awaitNextUpdate=function(t){var e=this;return new Promise(function(n){e.listenOnce(function(t){return n(t)},t)})},l.length.get=function(){return this.lengthSource},c.prototype.getData=function(){return this.data},c.prototype.get=function(t){return this.data[t]},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length))},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length)}},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length)}},c.prototype.appendArray=function(t){this.data=this.data.concat(t),this.update({operation:"add",operationDetailed:"append",count:t.length,index:this.data.length-t.length,items:t,newState:this.data}),this.lengthSource.value!==this.data.length&&this.lengthSource.update(this.data.length)},c.prototype.push=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.appendArray(t)},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length)},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length),t},c.prototype.merge=function(t){var e=this.data;this.data=t.slice(),this.update({operation:"merge",operationDetailed:"merge",previousState:e,index:0,items:this.data,newState:this.data}),this.lengthSource.value!==this.data.length&&this.lengthSource.update(this.data.length)},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length)},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length)},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length))},c.prototype.clear=function(){if(0!==this.data.length){var t=this.data;this.data=[],this.update({operation:"remove",operationDetailed:"clear",count:t.length,index:0,items:t,newState:this.data}),this.lengthSource.value!==this.data.length&&this.lengthSource.update(this.data.length)}},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length),t},c.prototype.toArray=function(){return this.data.slice()},c.prototype.sort=function(t,e,n){void 0===e&&(e=[]);var o=new f(this,t,n);return e.forEach(function(t){t.listen(function(){return o.refresh()})}),o},c.prototype.map=function(t,e,n){void 0===e&&(e=[]);var o=new d(this,t,n);return e.forEach(function(t){t.listen(function(){return o.refresh()})}),o},c.prototype.filter=function(t,e,n){void 0===e&&(e=[]);var o=new v(this,t,n);return e.forEach(function(t){t.listen(function(){return o.refresh()},n)}),o},c.prototype.forEach=function(t){return this.data.forEach(t)},c.prototype.update=function(t){this.updateEvent.fire(t)},Object.defineProperties(c.prototype,l);var p,h=function(t){function e(e,n){var o=this;t.call(this,n),this.disposeToken=e,this.updateEvent.onEmpty=function(){e.cancel(),Object.defineProperty(o,"data",{get:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')},set:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')}})}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.persist=function(){return this.updateEvent.onEmpty=void 0,this},e.prototype.listenAndRepeat=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listenAndRepeat.call(this,e,n)},e.prototype.listen=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listen.call(this,e,n)},e.prototype.listenOnce=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listenOnce.call(this,e,n)},e}(c),d=function(t){function e(e,n,r){var i=this;void 0===r&&(r=new o);var a=e.getData().map(n);t.call(this,r,a),this.parent=e,this.mapper=n,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":i.removeLeft(t.count);break;case"removeRight":i.removeRight(t.count);break;case"remove":i.remove(i.data[t.index]);break;case"clear":i.clear();break;case"prepend":(e=i).unshift.apply(e,t.items.map(i.mapper));break;case"append":i.appendArray(t.items.map(i.mapper));break;case"swap":i.swap(t.index,t.index2);break;case"replace":i.set(t.index,i.mapper(t.items[0]));break;case"merge":for(var n=i.data.slice(),o=t.previousState.slice(),r=0;r<t.newState.length;r++)if(i.data.length<=r&&i.data.push(i.mapper(t.newState[r])),o[r]!==t.newState[r]){var a=o.indexOf(t.newState[r]);if(-1!==a){var s=i.data[r];i.data[r]=i.data[a],i.data[a]=s;var u=o[r];o[r]=o[a],o[a]=u}else i.data.splice(r,0,i.mapper(t.newState[r])),o.splice(r,0,t.newState[r])}i.data.length>t.newState.length&&(i.data.length=t.newState.length),i.update({operation:"merge",operationDetailed:"merge",previousState:n,index:0,items:i.data,newState:i.data})}},r)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.refresh=function(){this.merge(this.parent.data.map(this.mapper))},e}(h),f=function(t){function e(e,n,r){var i=this;void 0===r&&(r=new o);var a=e.getData().slice().sort(n);t.call(this,r,a),this.parent=e,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)i.remove(o[n]);break;case"remove":i.remove(t.items[0]);break;case"clear":i.clear();break;case"prepend":(e=i).unshift.apply(e,t.items),i.data.sort(i.comparator);break;case"append":i.appendSorted(t.items);break;case"merge":i.merge(t.items.slice().sort(i.comparator));break;case"swap":break;case"replace":i.remove(t.target),i.appendSorted(t.items)}},r)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.appendSorted=function(t){this.merge(this.data.concat(t).sort(this.comparator))},e.prototype.refresh=function(){this.merge(this.parent.getData().slice().sort(this.comparator))},e}(h),v=function(t){function e(e,n,r){var i=this;void 0===r&&(r=new o),Array.isArray(e)&&(e=new c(e));var a=e.data.filter(n=null!=n?n:function(){return!0});t.call(this,r,a),this.parent=e,this.viewFilter=n,e.listen(function(t){var e,n;switch(t.operationDetailed){case"clear":i.clear();break;case"removeLeft":case"removeRight":case"remove":for(var o=0,r=t.items;o<r.length;o+=1)i.remove(r[o]);break;case"prepend":n=t.items.filter(i.viewFilter),(e=i).unshift.apply(e,n);break;case"append":n=t.items.filter(i.viewFilter),i.appendArray(n);break;case"merge":i.merge(t.items.filter(i.viewFilter));break;case"swap":var a=i.data.indexOf(t.items[0]),s=i.data.indexOf(t.items[1]);-1!==a&&-1!==s&&i.swap(a,s);break;case"replace":var u=i.data.indexOf(t.target);-1!==u&&(i.viewFilter(t.items[0])?i.set(u,t.items[0]):i.remove(t.target))}},r)}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.merge(this.parent.data.filter(this.viewFilter))},e}(h),y=Symbol("owner"),m=function(t){var e=this;this.node=this.create(t),t instanceof s&&t.listen(function(t){e.node&&(e.node.textContent=t)})};m.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},m.prototype.create=function(t){var e=document.createTextNode(this.resolveStringSource(t));return e[y]=this,e},m.prototype.remove=function(){this.hasParent()&&this.node.parentElement[y].removeChild(this.node)},m.prototype.hasParent=function(){return!!this.node.parentElement},(p=t.DataFlow||(t.DataFlow={}))[p.UPSTREAM=0]="UPSTREAM",p[p.DOWNSTREAM=1]="DOWNSTREAM";var g=function(t,e){void 0===e&&(e=!0),this.value=t,this.updateDownstreamEvent=new i,this.updateUpstreamEvent=new i,this.propagateWritesToReadStream=e};g.fromTwoDataSource=function(t,e,n,o){void 0===o&&(o=!0);var r=new g(n,o);return r.updateDownstreamEvent=t.updateEvent,r.updateUpstreamEvent=e.updateEvent,r},g.createOneWay=function(e,n){return void 0===e&&(e=t.DataFlow.DOWNSTREAM),new g(n,!1).oneWayFlow(e)},g.prototype.updateDownstream=function(t){if(this.updatingDownstream)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.updatingDownstream=!0,this.value=t,this.updateDownstreamEvent.fire(t),this.updatingDownstream=!1},g.prototype.updateUpstream=function(t){if(this.updatingUpstream)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.updatingUpstream=!0,this.value=t,this.updateUpstreamEvent.fire(t),this.propagateWritesToReadStream&&this.updateDownstreamEvent.fire(t),this.updatingUpstream=!1},g.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},g.prototype.listen=function(t,e){return this.updateDownstreamEvent.subscribe(t,e).cancel},g.prototype.listenUpstream=function(t,e){return this.updateUpstreamEvent.subscribe(t,e).cancel},g.prototype.listenUpstreamOnce=function(t,e){return this.updateUpstreamEvent.subscribeOnce(t,e).cancel},g.prototype.listenDownstream=function(t,e){return this.updateDownstreamEvent.subscribe(t,e).cancel},g.prototype.downStreamToDataSource=function(t){var e=new s(this.value);return this.listenDownstream(function(t){e.update(t)},t),e},g.prototype.aggregate=function(t,e,n){var r=this;n=null!=n?n:new o;var i=new u(n,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},g.prototype.aggregateThree=function(t,e,n,r){var i=this;r=null!=r?r:new o;var a=new u(r,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},g.prototype.aggregateFour=function(t,e,n,r,i){var a=this;i=null!=i?i:new o;var s=new u(i,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},g.prototype.filter=function(t,e,n){var o=this;if("function"==typeof e){var r=new g(void 0,!1);return this.listenDownstream(function(e){t(e,r.value)&&r.updateDownstream(e)},n),r.listenUpstream(function(t){e(t,o.value)&&o.updateUpstream(t)},n),r}var i=new s;return this.listenDownstream(function(e){t(e,i.value)&&i.update(e)},e),i},g.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)},g.prototype.map=function(t,e,n){var o=this;if("function"==typeof e){var r=new g(t(this.value),!1);return this.listenDownstream(function(e){return r.updateDownstream(t(e))},n),r.listenUpstream(function(t){return o.updateUpstream(e(t))},n),r}var i=new s(t(this.value));return this.listenDownstream(function(e){return i.update(t(e))},e),i},g.prototype.listenOnce=function(t,e){return this.updateDownstreamEvent.subscribeOnce(t,e).cancel},g.prototype.awaitNextUpdate=function(t){var e=this;return new Promise(function(n){e.listenOnce(function(t){return n(t)},t)})},g.prototype.debounceUpstream=function(t,e){var n,o=this,r=new g(this.value);return r.listenUpstream(function(e){clearTimeout(n),n=setTimeout(function(){o.updateUpstream(e)},t)},e),this.listenDownstream(function(t){r.updateDownstream(t)},e),r},g.prototype.debounceDownstream=function(t,e){var n,o=this,r=new g(this.value);return this.listenDownstream(function(e){clearTimeout(n),n=setTimeout(function(){r.updateDownstream(e)},t)},e),r.listenUpstream(function(t){o.updateUpstream(t)},e),r},g.prototype.unique=function(t){var e=this,n=new g(this.value,!1),o=this.value,r=this.value;return this.listenDownstream(function(t){r!==t&&(r=t,n.updateDownstream(t))},t),n.listenUpstream(function(t){o!==t&&(o=t,e.updateUpstream(t))},t),n},g.prototype.oneWayFlow=function(e,n){var o=this;void 0===e&&(e=t.DataFlow.DOWNSTREAM);var r=new g(this.value,!1);return e===t.DataFlow.DOWNSTREAM?(this.listenDownstream(function(t){return r.updateDownstream(t)},n),r.updateUpstream=function(){}):(r.listenUpstream(function(t){return o.updateUpstream(t)}),r.updateDownstream=function(){}),r},g.prototype.reduce=function(t,e,n){var o=new s(e);return this.listen(function(e){return o.update(t(o.value,e))},n),o},g.prototype.cancelAll=function(){this.updateDownstreamEvent.cancelAll(),this.updateUpstreamEvent.cancelAll()};var b=Symbol("AurumElementModel"),w={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"},_=["id","name","draggable","tabindex","style","role","contentEditable"];function O(t){return t&&t[b]?O(t.constructor(t.props,t.innerNodes)):t}var C=function(t,e,n){var o;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===(o=t.onCreate)||void 0===o||o.call(t,this.node)),e&&this.addChildren(e)};C.prototype.initialize=function(t){this.createEventHandlers(w,t);var e=Object.keys(t).filter(function(t){return t.includes("-")});this.bindProps(_,t,e),t.class&&this.handleClass(t.class)},C.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 u=s[a];e[u]&&this.assignStringSourceToAttribute(e[u],u)}},C.prototype.createEventHandlers=function(t,e){var n=this,o=function(o){e[t[o]]&&(e[t[o]]instanceof s?n.node.addEventListener(o,function(n){return e[t[o]].update(n)}):e[t[o]]instanceof g?n.node.addEventListener(o,function(n){return e[t[o]].updateDownstream(n)}):"function"==typeof e[t[o]]&&n.node.addEventListener(o,function(n){return e[t[o]](n)}))};for(var r in t)o(r)},C.prototype.render=function(){for(var t,e,n=0,o=0;o<this.children.length;o++,n++)this.children[o]instanceof S?n=this.renderFragment(this.children[o],n):this.renderChild(this.children[o],n);for(;this.node.childNodes.length>n;){var r=this.node.childNodes[this.node.childNodes.length-1];this.node.removeChild(r),null===(e=null===(t=r[y])||void 0===t?void 0:t.handleDetach)||void 0===e||e.call(t)}},C.prototype.renderFragment=function(t,e){for(var n=0;n<t.children.length;n++,e++)t.children[n]instanceof S?e=this.renderFragment(t.children[n],e):this.renderChild(t.children[n],e);return--e},C.prototype.renderChild=function(t,e){if(this.node.childNodes.length<=e)return this.addChildDom(t);if(this.node.childNodes[e][y]!==t){var n=this.getChildIndex(t.node);-1!==n?this.swapChildrenDom(e,n):this.addDomNodeAt(t.node,e)}},C.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):(this.cleanUp||(this.cleanUp=new o),t.unique(this.cleanUp).listenAndRepeat(function(t){"boolean"==typeof t?t?n.node.setAttribute(e,""):n.node.removeAttribute(e):n.node.setAttribute(e,t)}))},C.prototype.handleAttach=function(t){var e,n,o;if(this.needAttach)if(t.isConnected()){null===(e=this.onAttach)||void 0===e||e.call(this,this.node);for(var r=0,i=this.node.childNodes;r<i.length;r+=1)null===(o=null===(n=i[r][y])||void 0===n?void 0:n.handleAttach)||void 0===o||o.call(n,this)}else t.needAttach=!0},C.prototype.handleDetach=function(){var t,e,n;if(this.cleanUp&&this.cleanUp.cancel(),!this.node.isConnected){null===(t=this.onDetach)||void 0===t||t.call(this,this.node);for(var o=0,r=this.children;o<r.length;o+=1){var i=r[o];i instanceof S&&i.handleDetach()}for(var a=0,s=this.node.childNodes;a<s.length;a+=1){var u=s[a];u[y]&&(null===(n=(e=u[y]).handleDetach)||void 0===n||n.call(e))}}},C.prototype.handleClass=function(t){var e=this;if("string"==typeof t)this.node.className=t;else if(t instanceof s||t instanceof g)this.cleanUp||(this.cleanUp=new o),t.value&&(Array.isArray(t.value)?(this.node.className=t.value.join(" "),t.unique(this.cleanUp).listen(function(){e.node.className=t.value.join(" ")})):(this.node.className=t.value,t.unique(this.cleanUp).listen(function(){e.node.className=t.value}))),t.unique(this.cleanUp).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 s&&(this.cleanUp||(this.cleanUp=new o),a.unique(this.cleanUp).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}))}}},C.prototype.create=function(t){var e=document.createElement(t);return e[y]=this,e},C.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},C.prototype.hasChild=function(t){for(var e=0,n=t.childNodes;e<n.length;e+=1)if(n[e]===t)return!0;return!1},C.prototype.addChildDom=function(t){var e;this.node.appendChild(t.node),null===(e=t.handleAttach)||void 0===e||e.call(t,this)},C.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))}},C.prototype.addDomNodeAt=function(t,e){var n,o,r,i;e>=this.node.childNodes.length?(this.node.appendChild(t),null===(o=(n=t[y]).handleAttach)||void 0===o||o.call(n,this)):(this.node.insertBefore(t,this.node.childNodes[e]),null===(i=(r=t[y]).handleAttach)||void 0===i||i.call(r,this))},C.prototype.remove=function(){this.hasParent()&&this.node.parentElement[y].removeChild(this.node)},C.prototype.hasParent=function(){return!!this.node.parentElement},C.prototype.isConnected=function(){return this.node.isConnected},C.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1),this.render()},C.prototype.removeChildAt=function(t){this.children.splice(t,1),this.render()},C.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()}},C.prototype.clearChildren=function(){this.children.length=0,this.render()},C.prototype.addChild=function(t){if(null!=t&&(!t[b]||void 0!==(t=O(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()},C.prototype.childNodeToAurum=function(t){var e=this;if(t instanceof C)return t;if(t instanceof Promise){var n=new S({});return t.then(function(t){n.addChildren([t]),e.render()}),n}if(t instanceof c){var o=new S({repeatModel:t});return o.onChange.subscribe(function(){return e.render()}),o}if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return new m(t.toString());if(t instanceof s){var r=new S({},[t]);return r.onChange.subscribe(function(){return e.render()}),r}throw new Error("Unsupported child type")},C.prototype.addChildAt=function(t,e){this.children.splice(e,0,this.childNodeToAurum(t)),this.render()},C.prototype.addChildren=function(t){if(0!==t.length)for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e])};var S=function(t,e){this.cancellationToken=new o,this.onChange=new i,this.children=[],t.repeatModel?this.handleRepeat(t.repeatModel):e&&this.addChildren(e)};S.prototype.handleDetach=function(){this.cancellationToken.cancel()},S.prototype.addChildren=function(t){for(var e=this,n=function(){var t=r[o],n=void 0;if((n=t[b]?O(t):t)instanceof C)e.children.push(n);else{if(!(n instanceof s))throw new Error("case not yet implemented");var i=void 0,a=void 0,u={ts:void 0};n.unique().listenAndRepeat(function(t){if(u.ts=Date.now(),null==t&&a)return e.children.length=0,e.onChange.fire(),void(a=!1);if(!Array.isArray(t)&&a&&(e.children.length=0,e.onChange.fire(),a=!1),Array.isArray(t)){a=!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,u,u.ts)}else i=e.handleSourceChild(t,i,n,u,u.ts)},e.cancellationToken)}},o=0,r=t;o<r.length;o+=1)n()},S.prototype.handleSourceChild=function(t,e,n,o,r){var i=this;if(Array.isArray(t))for(var a=0,u=t;a<u.length;a+=1)this.handleSourceChild(u[a],e,n,o,r);if(null!=t){if(t[b]&&(t=O(t)),"string"==typeof t||"bigint"==typeof t||"number"==typeof t||"boolean"==typeof t)if(e){if(e instanceof C){var l=new m(null!=n?n:t);this.children.splice(this.children.indexOf(e),1,l),e=l,this.onChange.fire()}}else{var p=new m(null!=n?n:t);this.children.push(p),e=p,this.onChange.fire()}else if(t instanceof C)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){o.ts===r&&(i.addChildren([t]),i.onChange.fire())});else if(t instanceof s)if(e){if(e!==t){var h=new S({},[t]);h.onChange.subscribe(function(){return i.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,h),e=h,this.onChange.fire()}}else{var d=new S({},[t]);e=d,this.children.push(d),d.onChange.subscribe(function(){return i.onChange.fire()}),this.onChange.fire()}else if(t instanceof c)if(e){if(e!==t){var f=new S({repeatModel:t});f.onChange.subscribe(function(){return i.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,f),e=f,this.onChange.fire()}}else{var v=new S({repeatModel:t});e=v,this.children.push(v),v.onChange.subscribe(function(){return i.onChange.fire()}),this.onChange.fire()}return e}e&&(this.children.splice(this.children.indexOf(e),1),e=void 0,this.onChange.fire())},S.prototype.handleRepeat=function(t){var e=this;t.listenAndRepeat(function(t){var n;switch(t.operationDetailed){case"replace":e.children[t.index]=O(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"merge":for(var r=t.previousState.slice(),i=0;i<t.newState.length;i++)if(e.children.length<=i&&e.children.push(O(t.newState[i])),r[i]!==t.newState[i]){var a=r.indexOf(t.newState[i]);if(-1!==a){var s=e.children[i];e.children[i]=e.children[a],e.children[a]=s;var u=r[i];r[i]=r[a],r[a]=u}else e.children.splice(i,0,O(t.newState[i])),r.splice(i,0,t.newState[i])}e.children.length>t.newState.length&&(e.children.length=t.newState.length);break;case"append":e.children=e.children.concat(t.items.map(O));break;case"prepend":(n=e.children).unshift.apply(n,t.items.map(O));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()},this.cancellationToken)};var x=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}(C),E=Symbol("route");function D(){var t=location.hash.substring(1);return t.includes("?")?t.substring(0,t.indexOf("?")):t.includes("#")?t.substring(0,t.indexOf("#")):t}var A=Symbol("switchCase"),k=function(t){t&&(this.data=t),this.updateEvent=new i,this.updateEventOnKey=new Map};k.prototype.pick=function(t,e){var n,o=new s(null===(n=this.data)||void 0===n?void 0:n[t]);return this.listenOnKey(t,function(t){o.update(t.newValue)},e),o},k.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},k.prototype.listenOnKeyAndRepeat=function(t,e,n){return e({key:t,newValue:this.data[t],oldValue:void 0}),this.listenOnKey(t,e,n)},k.prototype.listenOnKey=function(t,e,n){return this.updateEventOnKey.has(t)||this.updateEventOnKey.set(t,new i),this.updateEventOnKey.get(t).subscribe(e,n).cancel},k.prototype.keys=function(){return Object.keys(this.data)},k.prototype.values=function(){return Object.values(this.data)},k.prototype.get=function(t){return this.data[t]},k.prototype.delete=function(t){var e=this.data[t];delete this.data[t],this.updateEvent.fire({oldValue:e,key:t,newValue:void 0,deleted:!0}),this.updateEventOnKey.has(t)&&this.updateEventOnKey.get(t).fire({oldValue:e,key:t,newValue:void 0})},k.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]})}},k.prototype.assign=function(t){if(t instanceof k)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])}},k.prototype.toObject=function(){return Object.assign({},this.data)},k.prototype.toDataSource=function(){var t=this,e=new s(this.data);return this.listen(function(n){e.update(t.data)}),e};var j=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}(C),U=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}(C),N={input:"onInput",change:"onChange"},T=["placeholder","readonly","disabled","accept","alt","autocomplete","autofocus","checked","defaultChecked","formAction","formEnctype","formMethod","formNoValidate","formTarget","max","maxLength","min","minLength","pattern","multiple","required","type"],P=function(t){function e(e,n){var r,i,a=this;t.call(this,e,n,"input"),null!==e&&(e.value instanceof s||e.value instanceof g?(this.cleanUp||(this.cleanUp=new o),e.value.unique(this.cleanUp).listenAndRepeat(function(t){return a.node.value=t}),this.node.addEventListener("input",function(){e.value instanceof s?e.value.update(a.node.value):e.value instanceof g&&e.value.updateUpstream(a.node.value)})):this.node.value=null!==(r=e.value)&&void 0!==r?r:"",e.checked instanceof s||e.checked instanceof g?(this.cleanUp||(this.cleanUp=new o),e.checked.unique(this.cleanUp).listenAndRepeat(function(t){return a.node.checked=t}),this.node.addEventListener("change",function(){e.checked instanceof s?e.checked.update(a.node.checked):e.checked instanceof g&&e.checked.updateUpstream(a.node.checked)})):this.node.checked=null!==(i=e.checked)&&void 0!==i&&i,this.bindProps(T,e),this.createEventHandlers(N,e))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(C),F=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}(C),R=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}(C),I=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}(C),L=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}(C),M=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}(C),q=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}(C),V=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}(C),K=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}(C),W=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}(C),H=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}(C),z=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}(C),B=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}(C),J=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}(C),G=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}(C),Q=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}(C),X=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}(C),Y=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}(C),Z=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}(C),$=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}(C),tt=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}(C),et=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}(C),nt={input:"onInput",change:"onChange"},ot=["placeholder","readonly","disabled","rows","wrap","autocomplete","autofocus","max","maxLength","min","minLength","required","type"],rt=function(t){function e(e,n){var r,i,a,s=this;t.call(this,e,n,"textArea"),null!==e&&(e.inputValueSource?(this.node.value=null!==(i=null!==(r=e.initialValue)&&void 0!==r?r:e.inputValueSource.value)&&void 0!==i?i:"",this.cleanUp||(this.cleanUp=new o),e.inputValueSource.unique(this.cleanUp).listen(function(t){return s.node.value=t})):this.node.value=null!==(a=e.initialValue)&&void 0!==a?a:"",this.bindProps(ot,e),this.createEventHandlers(nt,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(s.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(C),it=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}(C),at=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}(C),st=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}(C),ut=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}(C),ct=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}(C),lt=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}(C),pt=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}(C),ht=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}(C),dt=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}(C),ft=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}(C),vt=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}(C),yt=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}(C),mt=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}(C),gt=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}(C),bt=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}(C),wt=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}(C),_t=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}(C),Ot=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}(C),Ct=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}(C),St=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}(C),xt={change:"onChange"},Et=function(t){function e(e,n){var r=this;t.call(this,e,n,"select"),null!==e&&(this.createEventHandlers(xt,e),e.value&&(this.value=e.value,this.needAttach=!0,(e.value instanceof s||e.value instanceof g)&&(this.cleanUp||(this.cleanUp=new o),e.value.listen(function(t){r.node.value=t},this.cleanUp),this.node.addEventListener("change",function(){e.value instanceof s?e.value.update(r.node.value):e.value instanceof g&&e.value.updateUpstream(r.node.value)}))),e.selectedIndex&&(this.selectedIndex=e.selectedIndex,this.needAttach=!0,(e.selectedIndex instanceof s||e.selectedIndex instanceof g)&&(this.cleanUp||(this.cleanUp=new o),e.selectedIndex.listen(function(t){r.node.selectedIndex=t},this.cleanUp),this.node.addEventListener("change",function(){e.selectedIndex instanceof s?e.selectedIndex.update(r.node.selectedIndex):e.selectedIndex instanceof g&&e.selectedIndex.updateUpstream(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.value instanceof s||this.value instanceof g?this.node.value=this.value.value:void 0!==this.value?this.node.value=this.value:this.selectedIndex instanceof s||this.selectedIndex instanceof g?this.node.selectedIndex=this.selectedIndex.value:void 0!==this.selectedIndex&&(this.node.selectedIndex=this.selectedIndex))},e}(C),Dt=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}(C),At=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}(C),kt=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}(C),jt=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}(C),Ut=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}(C),Nt=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}(C),Tt=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}(C),Pt=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}(C),Ft=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}(C),Rt=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}(C),It=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}(C),Lt=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}(C),Mt=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}(C),qt={button:U,div:j,input:P,li:F,span:R,style:I,ul:M,p:q,img:V,link:K,canvas:W,a:H,article:z,br:B,form:J,label:G,ol:Q,pre:X,progress:Y,table:Z,td:$,tr:tt,th:et,textarea:rt,h1:it,h2:at,h3:st,h4:ut,h5:ct,h6:lt,header:pt,footer:ht,nav:dt,b:ft,i:vt,script:yt,abbr:mt,area:gt,aside:bt,audio:L,em:wt,heading:_t,iframe:Ot,noscript:Ct,option:function(t){function e(e,n){t.call(this,e,n,"option"),e&&this.bindProps(["value"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(C),q:St,select:Et,source:Dt,title:At,video:kt,tbody:jt,tfoot:Ut,thead:Nt,summary:Tt,details:Pt,sub:Ft,sup:Rt,svg:It,data:Lt,time:Mt,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}(C)},Vt=function(){};Vt.attach=function(t,e){var n=O(t);if(e[y])throw new Error("This node is already managed by aurum and cannot be used");if(!(n instanceof C))throw new Error("Root node of aurum application must be a single dom node");e.appendChild(n.node),n.handleAttach(n),e[y]=n},Vt.isAttached=function(t){return void 0!==t[y]},Vt.detach=function(t){t[y]&&(t[y].node.remove(),t[y].handleDetach(),t[y]=void 0)},Vt.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=qt[t]))throw new Error("Node "+a+" does not exist or is not supported")}return Object.getPrototypeOf(t)===C?((n={})[b]=!0,n.constructor=function(e,n){return new t(e,n)},n.props=e,n.innerNodes=r,n):((o={})[b]=!0,o.constructor=t,o.props=e,o.innerNodes=r,o)},t.aurumElementModelIdentitiy=b,t.prerender=O,t.AurumElement=C,t.AurumFragment=S,t.Custom=x,t.AurumRouter=function(t,e){if((e=e.map(O)).some(function(t){return!t[E]}))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 s(D());return window.addEventListener("hashchange",function(){n.update(D())}),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={})[E]=!0,n.content=e,n.default=!1,n.href=t.href,n},t.DefaultRoute=function(t,e){var n;return(n={})[E]=!0,n.content=e,n.default=!0,n.href=void 0,n},t.Suspense=function(t,e){var n=new s(null==t?void 0:t.fallback);return Promise.all(e.map(O)).then(function(t){n.update(t)}),n},t.Switch=function(t,e){if((e=e.map(O)).some(function(t){return!t[A]}))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");var n=t.state.unique();return n.primed=!0,n.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={})[A]=!0,n.content=e,n.default=!1,n.value=t.when,n},t.DefaultSwitchCase=function(t,e){var n;return(n={})[A]=!0,n.content=e,n.default=!0,n.value=void 0,n},t.DataSource=s,t.TransientDataSource=u,t.ArrayDataSource=c,t.TransientArrayDataSource=h,t.MappedArrayView=d,t.SortedArrayView=f,t.FilteredArrayView=v,t.DuplexDataSource=g,t.ObjectDataSource=k,t.Aurum=Vt,t.CancellationToken=o,t.aurumClassName=function(t,e){var n=[],o=function(o){if(t[o])if(t[o]instanceof s||t[o]instanceof g){var r=t[o],i=new s(r.value?o:"");r.listen(function(t){i.update(r.value?o:"")},e),n.push(i)}else n.push(o)};for(var r in t)o(r);return n}}); | ||
!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(t){this.data=t};e.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)}},e.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 n=function(t){var e=this;void 0===t&&(t=[]),this.length=0,t.forEach(function(t){return e.append(t)})};n.prototype.find=function(t){for(var e=this.rootNode;e&&!t(e);)e=e.next;return e},n.prototype.append=function(t){return this.rootNode||this.lastNode?(this.lastNode.next=new e(t),this.lastNode.next.previous=this.lastNode,this.lastNode=this.lastNode.next):this.rootNode=this.lastNode=new e(t),this.length++,t},n.prototype.forEach=function(t){this.find(function(e){return t(e.data),!1})},n.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 o=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.cancelables=new n(t),this._isCancelled=!1},r={isCanceled:{configurable:!0}};r.isCanceled.get=function(){return this._isCancelled},o.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},o.prototype.removeCancelable=function(t){return this.throwIfCancelled("attempting to remove cancellable from token that is already cancelled"),this.cancelables.remove(t),this},o.prototype.addDisposable=function(t){return this.addCancelable(function(){return t.dispose()}),this},o.prototype.callIfNotCancelled=function(t){this.isCanceled||t()},o.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)},o.prototype.setInterval=function(t,e){var n=setInterval(t,e);this.addCancelable(function(){return clearInterval(n)})},o.prototype.requestAnimationFrame=function(t){var e=this,n=requestAnimationFrame(function(){e.removeCancelable(o),t()}),o=function(){return cancelAnimationFrame(n)};this.addCancelable(o)},o.prototype.animationLoop=function(t){var e=requestAnimationFrame(function n(o){t(o),e=requestAnimationFrame(n)});this.addCancelable(function(){return cancelAnimationFrame(e)})},o.prototype.throwIfCancelled=function(t){if(this.isCanceled)throw new Error(t||"cancellation token is cancelled")},o.prototype.chain=function(t,e){return void 0===e&&(e=!1),e&&t.chain(this,!1),this.addCancelable(function(){return t.cancel()}),this},o.prototype.registerDomEvent=function(t,e,n){return t.addEventListener(e,n),this.addCancelable(function(){return t.removeEventListener(e,n)}),this},o.prototype.cancel=function(){this.isCanceled||(this._isCancelled=!0,this.cancelables.forEach(function(t){return t()}),this.cancelables=void 0)},Object.defineProperties(o.prototype,r);var i=function(){this.subscribeChannel=[],this.subscribeOnceChannel=[],this.onAfterFire=[]},a={subscriptions:{configurable:!0}};a.subscriptions.get=function(){return this.subscribeChannel.length+this.subscribeOnceChannel.length},i.prototype.subscribe=function(t,e){return this.createSubscription(t,this.subscribeChannel,e).facade},i.prototype.subscribeOnce=function(t,e){return this.createSubscription(t,this.subscribeOnceChannel,e).facade},i.prototype.hasSubscriptions=function(){return this.subscriptions>0},i.prototype.cancelAll=function(){var t,e=this;this.isFiring?this.onAfterFire.push(function(){var t;e.subscribeChannel.length=0,e.subscribeOnceChannel.length=0,null===(t=e.onEmpty)||void 0===t||t.call(e)}):(this.subscribeChannel.length=0,this.subscribeOnceChannel.length=0,null===(t=this.onEmpty)||void 0===t||t.call(this))},i.prototype.afterFire=function(){this.onAfterFire.length>0&&(this.onAfterFire.forEach(function(t){return t()}),this.onAfterFire.length=0)},i.prototype.fire=function(t){this.isFiring=!0;for(var e=this.subscribeChannel.length,n=0;n<e;n++)this.subscribeChannel[n].callback(t);if(this.subscribeOnceChannel.length>0){e=this.subscribeOnceChannel.length;for(var o=0;o<e;o++)this.subscribeOnceChannel[o].callback(t);this.subscribeOnceChannel.length=0}this.isFiring=!1,this.afterFire()},i.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}},i.prototype.cancel=function(t,e){var n,o=this,r=e.indexOf(t);r>=0&&(this.isFiring?this.onAfterFire.push(function(){return o.cancel(t,e)}):(e.splice(r,1),this.hasSubscriptions()||null===(n=this.onEmpty)||void 0===n||n.call(this)))},Object.defineProperties(i.prototype,a);var s=function(t){this.value=t,this.primed=void 0!==t,this.updateEvent=new i};s.prototype.update=function(t){if(this.primed=!0,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},s.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},s.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},s.prototype.listenOnce=function(t,e){return this.updateEvent.subscribeOnce(t,e).cancel},s.prototype.filter=function(t,e){e=null!=e?e:new o;var n=new u(e);return this.listen(function(e){t(e,n.value)&&n.update(e)},e),n},s.prototype.max=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)>0:t>e},t)},s.prototype.min=function(t){return this.filter(function(t,e){return"string"==typeof t&&"string"==typeof e?t.localeCompare(e)<0:t<e},t)},s.prototype.pipe=function(t,e){this.listen(function(e){return t.update(e)},e)},s.prototype.map=function(t,e){var n;return e=null!=e?e:new o,n=this.primed?new u(e,t(this.value)):new u(e),this.listen(function(e){n.update(t(e))},e),n},s.prototype.tap=function(t,e){return this.listen(function(e){t(e)},e),this},s.prototype.await=function(t){t=null!=t?t:new o;var e=new u(t);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},s.prototype.unique=function(t){t=null!=t?t:new o;var e=new u(t,this.value);return this.listen(function(t){t!==e.value&&e.update(t)},t),e},s.prototype.diff=function(t){t=null!=t?t:new o;var e=new u(t,{new:this.value,old:void 0});return this.listen(function(t){e.update({new:t,old:e.value.new})},t),e},s.prototype.reduce=function(t,e,n){n=null!=n?n:new o;var r=new u(n,e);return this.listen(function(e){return r.update(t(r.value,e))},n),r},s.prototype.aggregate=function(t,e,n){var r=this;n=null!=n?n:new o;var i=new u(n,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},s.prototype.aggregateThree=function(t,e,n,r){var i=this;r=null!=r?r:new o;var a=new u(r,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},s.prototype.aggregateFour=function(t,e,n,r,i){var a=this;i=null!=i?i:new o;var s=new u(i,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},s.prototype.stringJoin=function(t,e){e=null!=e?e:new o;var n=new u(e,"");return this.listen(function(e){return n.update(n.value+t+e.toString())},e),n},s.prototype.combine=function(t,e){e=null!=e?e:new o;var n=new u(e);this.pipe(n,e);for(var r=0,i=t;r<i.length;r+=1)i[r].pipe(n,e);return n},s.prototype.delay=function(t,e){e=null!=e?e:new o;var n=new u(e,this.value);return this.listen(function(e){setTimeout(function(){n.update(e)},t)},e),n},s.prototype.skip=function(t,e){e=null!=e?e:new o;var n=new u(e,this.value);return this.listen(function(e){0===t?n.update(e):t--},e),n},s.prototype.cutoff=function(t,e){e=null!=e?e:new o;var n=new u(e,this.value);return this.listen(function(e){t-- >0&&n.update(e)},e),n},s.prototype.awaitNextUpdate=function(t){var e=this;return new Promise(function(n){e.listenOnce(function(t){return n(t)},t)})},s.prototype.debounce=function(t,e){e=null!=e?e:new o;var n,r=new u(e,this.value);return this.listen(function(e){clearTimeout(n),n=setTimeout(function(){r.update(e)},t)},e),r},s.prototype.throttle=function(t,e){e=null!=e?e:new o;var n=new u(e,this.value),r=!1;return this.listen(function(e){r||(n.update(e),r=!0,setTimeout(function(){r=!1},t))},e),n},s.prototype.buffer=function(t,e){e=null!=e?e:new o;var n,r=new u(e),i=[];return this.listen(function(e){i.push(e),n||(n=setTimeout(function(){n=void 0,r.update(i),i=[]},t))},e),r},s.prototype.accumulate=function(t){var e=new c;return this.listen(function(t){e.push(t)},t),e},s.prototype.pick=function(t,e){var n;e=null!=e?e:new o;var r=new u(e,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},s.prototype.cancelAll=function(){this.updateEvent.cancelAll()};var u=function(t){function e(e,n){var o=this;t.call(this,n),this.disposeToken=e,this.updateEvent.onEmpty=function(){e.cancel(),Object.defineProperty(o,"value",{get:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')},set:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')}})}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.persist=function(){return this.updateEvent.onEmpty=void 0,this},e.prototype.listen=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listen.call(this,e,n)},e.prototype.listenAndRepeat=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listenAndRepeat.call(this,e,n)},e.prototype.listenOnce=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listen.call(this,e,n)},e}(s),c=function(t){this.data=t?t.slice():[],this.lengthSource=new s(this.data.length),this.updateEvent=new i},l={length:{configurable:!0}};c.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)},c.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},c.prototype.listenOnce=function(t,e){return this.updateEvent.subscribeOnce(t,e).cancel},c.prototype.awaitNextUpdate=function(t){var e=this;return new Promise(function(n){e.listenOnce(function(t){return n(t)},t)})},l.length.get=function(){return this.lengthSource},c.prototype.getData=function(){return this.data},c.prototype.get=function(t){return this.data[t]},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length))},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length)}},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length)}},c.prototype.appendArray=function(t){this.data=this.data.concat(t),this.update({operation:"add",operationDetailed:"append",count:t.length,index:this.data.length-t.length,items:t,newState:this.data}),this.lengthSource.value!==this.data.length&&this.lengthSource.update(this.data.length)},c.prototype.push=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.appendArray(t)},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length)},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length),t},c.prototype.merge=function(t){var e=this.data;this.data=t.slice(),this.update({operation:"merge",operationDetailed:"merge",previousState:e,index:0,items:this.data,newState:this.data}),this.lengthSource.value!==this.data.length&&this.lengthSource.update(this.data.length)},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length)},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length)},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length))},c.prototype.clear=function(){if(0!==this.data.length){var t=this.data;this.data=[],this.update({operation:"remove",operationDetailed:"clear",count:t.length,index:0,items:t,newState:this.data}),this.lengthSource.value!==this.data.length&&this.lengthSource.update(this.data.length)}},c.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.value!==this.data.length&&this.lengthSource.update(this.data.length),t},c.prototype.toArray=function(){return this.data.slice()},c.prototype.sort=function(t,e,n){void 0===e&&(e=[]);var o=new f(this,t,n);return e.forEach(function(t){t.listen(function(){return o.refresh()})}),o},c.prototype.map=function(t,e,n){void 0===e&&(e=[]);var o=new d(this,t,n);return e.forEach(function(t){t.listen(function(){return o.refresh()})}),o},c.prototype.filter=function(t,e,n){void 0===e&&(e=[]);var o=new v(this,t,n);return e.forEach(function(t){t.listen(function(){return o.refresh()},n)}),o},c.prototype.forEach=function(t){return this.data.forEach(t)},c.prototype.update=function(t){this.updateEvent.fire(t)},Object.defineProperties(c.prototype,l);var p,h=function(t){function e(e,n){var o=this;t.call(this,n),this.disposeToken=e,this.updateEvent.onEmpty=function(){e.cancel(),Object.defineProperty(o,"data",{get:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')},set:function(){throw new Error('Transient data source has expired and can no longer be used if you wish to use it even after all listeners were removed "persist". Note that persisted data sources will not be garabge collected unless you remove the subscription they have on their parent source')}})}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.persist=function(){return this.updateEvent.onEmpty=void 0,this},e.prototype.listenAndRepeat=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listenAndRepeat.call(this,e,n)},e.prototype.listen=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listen.call(this,e,n)},e.prototype.listenOnce=function(e,n){return this.disposeToken.throwIfCancelled("Transient data source has expired. Listening not possible"),t.prototype.listenOnce.call(this,e,n)},e}(c),d=function(t){function e(e,n,r){var i=this;void 0===r&&(r=new o);var a=e.getData().map(n);t.call(this,r,a),this.parent=e,this.mapper=n,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":i.removeLeft(t.count);break;case"removeRight":i.removeRight(t.count);break;case"remove":i.remove(i.data[t.index]);break;case"clear":i.clear();break;case"prepend":(e=i).unshift.apply(e,t.items.map(i.mapper));break;case"append":i.appendArray(t.items.map(i.mapper));break;case"swap":i.swap(t.index,t.index2);break;case"replace":i.set(t.index,i.mapper(t.items[0]));break;case"merge":for(var n=i.data.slice(),o=t.previousState.slice(),r=0;r<t.newState.length;r++)if(i.data.length<=r&&i.data.push(i.mapper(t.newState[r])),o[r]!==t.newState[r]){var a=o.indexOf(t.newState[r]);if(-1!==a){var s=i.data[r];i.data[r]=i.data[a],i.data[a]=s;var u=o[r];o[r]=o[a],o[a]=u}else i.data.splice(r,0,i.mapper(t.newState[r])),o.splice(r,0,t.newState[r])}i.data.length>t.newState.length&&(i.data.length=t.newState.length),i.update({operation:"merge",operationDetailed:"merge",previousState:n,index:0,items:i.data,newState:i.data})}},r)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.refresh=function(){this.merge(this.parent.data.map(this.mapper))},e}(h),f=function(t){function e(e,n,r){var i=this;void 0===r&&(r=new o);var a=e.getData().slice().sort(n);t.call(this,r,a),this.parent=e,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)i.remove(o[n]);break;case"remove":i.remove(t.items[0]);break;case"clear":i.clear();break;case"prepend":(e=i).unshift.apply(e,t.items),i.data.sort(i.comparator);break;case"append":i.appendSorted(t.items);break;case"merge":i.merge(t.items.slice().sort(i.comparator));break;case"swap":break;case"replace":i.remove(t.target),i.appendSorted(t.items)}},r)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.appendSorted=function(t){this.merge(this.data.concat(t).sort(this.comparator))},e.prototype.refresh=function(){this.merge(this.parent.getData().slice().sort(this.comparator))},e}(h),v=function(t){function e(e,n,r){var i=this;void 0===r&&(r=new o),Array.isArray(e)&&(e=new c(e));var a=e.data.filter(n=null!=n?n:function(){return!0});t.call(this,r,a),this.parent=e,this.viewFilter=n,e.listen(function(t){var e,n;switch(t.operationDetailed){case"clear":i.clear();break;case"removeLeft":case"removeRight":case"remove":for(var o=0,r=t.items;o<r.length;o+=1)i.remove(r[o]);break;case"prepend":n=t.items.filter(i.viewFilter),(e=i).unshift.apply(e,n);break;case"append":n=t.items.filter(i.viewFilter),i.appendArray(n);break;case"merge":i.merge(t.items.filter(i.viewFilter));break;case"swap":var a=i.data.indexOf(t.items[0]),s=i.data.indexOf(t.items[1]);-1!==a&&-1!==s&&i.swap(a,s);break;case"replace":var u=i.data.indexOf(t.target);-1!==u&&(i.viewFilter(t.items[0])?i.set(u,t.items[0]):i.remove(t.target))}},r)}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.merge(this.parent.data.filter(this.viewFilter))},e}(h),y=Symbol("owner"),m=function(t){var e=this;this.node=this.create(t),t instanceof s&&t.listen(function(t){e.node&&(e.node.textContent=t)})};m.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},m.prototype.create=function(t){var e=document.createTextNode(this.resolveStringSource(t));return e[y]=this,e},m.prototype.remove=function(){this.hasParent()&&this.node.parentElement[y].removeChild(this.node)},m.prototype.hasParent=function(){return!!this.node.parentElement},(p=t.DataFlow||(t.DataFlow={}))[p.UPSTREAM=0]="UPSTREAM",p[p.DOWNSTREAM=1]="DOWNSTREAM";var g=function(t,e){void 0===e&&(e=!0),this.value=t,this.updateDownstreamEvent=new i,this.updateUpstreamEvent=new i,this.propagateWritesToReadStream=e};g.fromTwoDataSource=function(t,e,n,o){void 0===o&&(o=!0);var r=new g(n,o);return r.updateDownstreamEvent=t.updateEvent,r.updateUpstreamEvent=e.updateEvent,r},g.createOneWay=function(e,n){return void 0===e&&(e=t.DataFlow.DOWNSTREAM),new g(n,!1).oneWayFlow(e)},g.prototype.updateDownstream=function(t){if(this.updatingDownstream)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.updatingDownstream=!0,this.value=t,this.updateDownstreamEvent.fire(t),this.updatingDownstream=!1},g.prototype.updateUpstream=function(t){if(this.updatingUpstream)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.updatingUpstream=!0,this.value=t,this.updateUpstreamEvent.fire(t),this.propagateWritesToReadStream&&this.updateDownstreamEvent.fire(t),this.updatingUpstream=!1},g.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},g.prototype.listen=function(t,e){return this.updateDownstreamEvent.subscribe(t,e).cancel},g.prototype.listenUpstream=function(t,e){return this.updateUpstreamEvent.subscribe(t,e).cancel},g.prototype.listenUpstreamOnce=function(t,e){return this.updateUpstreamEvent.subscribeOnce(t,e).cancel},g.prototype.listenDownstream=function(t,e){return this.updateDownstreamEvent.subscribe(t,e).cancel},g.prototype.downStreamToDataSource=function(t){var e=new s(this.value);return this.listenDownstream(function(t){e.update(t)},t),e},g.prototype.aggregate=function(t,e,n){var r=this;n=null!=n?n:new o;var i=new u(n,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},g.prototype.aggregateThree=function(t,e,n,r){var i=this;r=null!=r?r:new o;var a=new u(r,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},g.prototype.aggregateFour=function(t,e,n,r,i){var a=this;i=null!=i?i:new o;var s=new u(i,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},g.prototype.filter=function(t,e,n){var o=this;if("function"==typeof e){var r=new g(void 0,!1);return this.listenDownstream(function(e){t(e,r.value)&&r.updateDownstream(e)},n),r.listenUpstream(function(t){e(t,o.value)&&o.updateUpstream(t)},n),r}var i=new s;return this.listenDownstream(function(e){t(e,i.value)&&i.update(e)},e),i},g.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)},g.prototype.map=function(t,e,n){var o=this;if("function"==typeof e){var r=new g(t(this.value),!1);return this.listenDownstream(function(e){return r.updateDownstream(t(e))},n),r.listenUpstream(function(t){return o.updateUpstream(e(t))},n),r}var i=new s(t(this.value));return this.listenDownstream(function(e){return i.update(t(e))},e),i},g.prototype.listenOnce=function(t,e){return this.updateDownstreamEvent.subscribeOnce(t,e).cancel},g.prototype.awaitNextUpdate=function(t){var e=this;return new Promise(function(n){e.listenOnce(function(t){return n(t)},t)})},g.prototype.debounceUpstream=function(t,e){var n,o=this,r=new g(this.value);return r.listenUpstream(function(e){clearTimeout(n),n=setTimeout(function(){o.updateUpstream(e)},t)},e),this.listenDownstream(function(t){r.updateDownstream(t)},e),r},g.prototype.debounceDownstream=function(t,e){var n,o=this,r=new g(this.value);return this.listenDownstream(function(e){clearTimeout(n),n=setTimeout(function(){r.updateDownstream(e)},t)},e),r.listenUpstream(function(t){o.updateUpstream(t)},e),r},g.prototype.unique=function(t){var e=this,n=new g(this.value,!1),o=this.value,r=this.value;return this.listenDownstream(function(t){r!==t&&(r=t,n.updateDownstream(t))},t),n.listenUpstream(function(t){o!==t&&(o=t,e.updateUpstream(t))},t),n},g.prototype.oneWayFlow=function(e,n){var o=this;void 0===e&&(e=t.DataFlow.DOWNSTREAM);var r=new g(this.value,!1);return e===t.DataFlow.DOWNSTREAM?(this.listenDownstream(function(t){return r.updateDownstream(t)},n),r.updateUpstream=function(){}):(r.listenUpstream(function(t){return o.updateUpstream(t)}),r.updateDownstream=function(){}),r},g.prototype.reduce=function(t,e,n){var o=new s(e);return this.listen(function(e){return o.update(t(o.value,e))},n),o},g.prototype.cancelAll=function(){this.updateDownstreamEvent.cancelAll(),this.updateUpstreamEvent.cancelAll()};var b=Symbol("AurumElementModel"),w={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"},_=["id","name","draggable","tabindex","style","role","contentEditable"];function O(t){return t&&t[b]?O(t.constructor(t.props,t.innerNodes)):t}var C=function(t,e,n){var o;this.node=this.create(n),this.children=[],null!=t&&(t.onAttach&&(this.onAttach=t.onAttach),this.onDetach=t.onDetach,this.initialize(t),null===(o=t.onCreate)||void 0===o||o.call(t,this.node)),e&&(this.pendingChildren=e)};C.prototype.initialize=function(t){this.createEventHandlers(w,t);var e=Object.keys(t).filter(function(t){return t.includes("-")});this.bindProps(_,t,e),t.class&&this.handleClass(t.class)},C.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 u=s[a];e[u]&&this.assignStringSourceToAttribute(e[u],u)}},C.prototype.createEventHandlers=function(t,e){var n=this,o=function(o){e[t[o]]&&(e[t[o]]instanceof s?n.node.addEventListener(o,function(n){return e[t[o]].update(n)}):e[t[o]]instanceof g?n.node.addEventListener(o,function(n){return e[t[o]].updateDownstream(n)}):"function"==typeof e[t[o]]&&n.node.addEventListener(o,function(n){return e[t[o]](n)}))};for(var r in t)o(r)},C.prototype.render=function(){for(var t,e,n=0,o=0;o<this.children.length;o++,n++)this.children[o]instanceof S?n=this.renderFragment(this.children[o],n):this.renderChild(this.children[o],n);for(;this.node.childNodes.length>n;){var r=this.node.childNodes[this.node.childNodes.length-1];this.node.removeChild(r),null===(e=null===(t=r[y])||void 0===t?void 0:t.handleDetach)||void 0===e||e.call(t)}},C.prototype.renderFragment=function(t,e){for(var n=0;n<t.children.length;n++,e++)t.children[n]instanceof S?e=this.renderFragment(t.children[n],e):this.renderChild(t.children[n],e);return--e},C.prototype.renderChild=function(t,e){if(this.node.childNodes.length<=e)return this.addChildDom(t);if(this.node.childNodes[e][y]!==t){var n=this.getChildIndex(t.node);-1!==n?this.swapChildrenDom(e,n):this.addDomNodeAt(t.node,e)}},C.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):(this.cleanUp||(this.cleanUp=new o),t.unique(this.cleanUp).listenAndRepeat(function(t){"boolean"==typeof t?t?n.node.setAttribute(e,""):n.node.removeAttribute(e):n.node.setAttribute(e,t)}))},C.prototype.handleAttach=function(t){var e,n,o;if(t.isConnected()){this.pendingChildren&&(this.addChildren(this.pendingChildren),this.pendingChildren=void 0),null===(e=this.onAttach)||void 0===e||e.call(this,this.node),this.onAttach=void 0;for(var r=0,i=this.node.childNodes;r<i.length;r+=1)null===(o=null===(n=i[r][y])||void 0===n?void 0:n.handleAttach)||void 0===o||o.call(n,this)}},C.prototype.handleDetach=function(){var t,e,n;if(this.cleanUp&&this.cleanUp.cancel(),!this.node.isConnected){null===(t=this.onDetach)||void 0===t||t.call(this,this.node);for(var o=0,r=this.children;o<r.length;o+=1){var i=r[o];i instanceof S&&i.handleDetach()}for(var a=0,s=this.node.childNodes;a<s.length;a+=1){var u=s[a];u[y]&&(null===(n=(e=u[y]).handleDetach)||void 0===n||n.call(e))}this.node[y]=void 0}},C.prototype.handleClass=function(t){var e=this;if("string"==typeof t)this.node.className=t;else if(t instanceof s||t instanceof g)this.cleanUp||(this.cleanUp=new o),t.value&&(Array.isArray(t.value)?(this.node.className=t.value.join(" "),t.unique(this.cleanUp).listen(function(){e.node.className=t.value.join(" ")})):(this.node.className=t.value,t.unique(this.cleanUp).listen(function(){e.node.className=t.value}))),t.unique(this.cleanUp).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 s&&(this.cleanUp||(this.cleanUp=new o),a.unique(this.cleanUp).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}))}}},C.prototype.create=function(t){var e=document.createElement(t);return e[y]=this,e},C.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},C.prototype.hasChild=function(t){for(var e=0,n=t.childNodes;e<n.length;e+=1)if(n[e]===t)return!0;return!1},C.prototype.addChildDom=function(t){var e;this.node.appendChild(t.node),null===(e=t.handleAttach)||void 0===e||e.call(t,this)},C.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))}},C.prototype.addDomNodeAt=function(t,e){var n,o,r,i;e>=this.node.childNodes.length?(this.node.appendChild(t),null===(o=(n=t[y]).handleAttach)||void 0===o||o.call(n,this)):(this.node.insertBefore(t,this.node.childNodes[e]),null===(i=(r=t[y]).handleAttach)||void 0===i||i.call(r,this))},C.prototype.remove=function(){this.hasParent()&&this.node.parentElement[y].removeChild(this.node)},C.prototype.hasParent=function(){return!!this.node.parentElement},C.prototype.isConnected=function(){return this.node.isConnected},C.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1),this.render()},C.prototype.removeChildAt=function(t){this.children.splice(t,1),this.render()},C.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()}},C.prototype.clearChildren=function(){this.children.length=0,this.render()},C.prototype.addChild=function(t){if(null!=t&&(!t[b]||void 0!==(t=O(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()},C.prototype.childNodeToAurum=function(t){var e=this;if(t instanceof C)return t;if(t instanceof Promise){var n=new S({});return t.then(function(t){n.addChildren([t]),e.render()}),n}if(t instanceof c){var o=new S({repeatModel:t});return o.onChange.subscribe(function(){return e.render()}),o}if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return new m(t.toString());if(t instanceof s){var r=new S({},[t]);return r.onChange.subscribe(function(){return e.render()}),r}throw new Error("Unsupported child type")},C.prototype.addChildAt=function(t,e){this.children.splice(e,0,this.childNodeToAurum(t)),this.render()},C.prototype.addChildren=function(t){if(0!==t.length)for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e])};var S=function(t,e){this.cancellationToken=new o,this.onChange=new i,this.children=[],t.repeatModel?this.handleRepeat(t.repeatModel):e&&this.addChildren(e)};S.prototype.handleDetach=function(){this.cancellationToken.cancel()},S.prototype.addChildren=function(t){for(var e=this,n=function(){var t=r[o],n=void 0;if((n=t[b]?O(t):t)instanceof C)e.children.push(n);else{if(!(n instanceof s))throw new Error("case not yet implemented");var i=void 0,a=void 0,u={ts:void 0};n.unique().listenAndRepeat(function(t){if(u.ts=Date.now(),null==t&&a)return e.children.length=0,e.onChange.fire(),void(a=!1);if(!Array.isArray(t)&&a&&(e.children.length=0,e.onChange.fire(),a=!1),Array.isArray(t)){a=!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,u,u.ts)}else i=e.handleSourceChild(t,i,n,u,u.ts)},e.cancellationToken)}},o=0,r=t;o<r.length;o+=1)n()},S.prototype.handleSourceChild=function(t,e,n,o,r){var i=this;if(Array.isArray(t))for(var a=0,u=t;a<u.length;a+=1)this.handleSourceChild(u[a],e,n,o,r);if(null!=t){if(t[b]&&(t=O(t)),"string"==typeof t||"bigint"==typeof t||"number"==typeof t||"boolean"==typeof t)if(e){if(e instanceof C){var l=new m(null!=n?n:t);this.children.splice(this.children.indexOf(e),1,l),e=l,this.onChange.fire()}}else{var p=new m(null!=n?n:t);this.children.push(p),e=p,this.onChange.fire()}else if(t instanceof C)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){o.ts===r&&(i.addChildren([t]),i.onChange.fire())});else if(t instanceof s)if(e){if(e!==t){var h=new S({},[t]);h.onChange.subscribe(function(){return i.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,h),e=h,this.onChange.fire()}}else{var d=new S({},[t]);e=d,this.children.push(d),d.onChange.subscribe(function(){return i.onChange.fire()}),this.onChange.fire()}else if(t instanceof c)if(e){if(e!==t){var f=new S({repeatModel:t});f.onChange.subscribe(function(){return i.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,f),e=f,this.onChange.fire()}}else{var v=new S({repeatModel:t});e=v,this.children.push(v),v.onChange.subscribe(function(){return i.onChange.fire()}),this.onChange.fire()}return e}e&&(this.children.splice(this.children.indexOf(e),1),e=void 0,this.onChange.fire())},S.prototype.handleRepeat=function(t){var e=this;t.listenAndRepeat(function(t){var n;switch(t.operationDetailed){case"replace":e.children[t.index]=O(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"merge":for(var r=t.previousState.slice(),i=0;i<t.newState.length;i++)if(e.children.length<=i&&e.children.push(O(t.newState[i])),r[i]!==t.newState[i]){var a=r.indexOf(t.newState[i]);if(-1!==a){var s=e.children[i];e.children[i]=e.children[a],e.children[a]=s;var u=r[i];r[i]=r[a],r[a]=u}else e.children.splice(i,0,O(t.newState[i])),r.splice(i,0,t.newState[i])}e.children.length>t.newState.length&&(e.children.length=t.newState.length);break;case"append":e.children=e.children.concat(t.items.map(O));break;case"prepend":(n=e.children).unshift.apply(n,t.items.map(O));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()},this.cancellationToken)};var x=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}(C),E=Symbol("route");function D(){var t=location.hash.substring(1);return t.includes("?")?t.substring(0,t.indexOf("?")):t.includes("#")?t.substring(0,t.indexOf("#")):t}var A=Symbol("switchCase"),k=function(t){t&&(this.data=t),this.updateEvent=new i,this.updateEventOnKey=new Map};k.prototype.pick=function(t,e){var n,o=new s(null===(n=this.data)||void 0===n?void 0:n[t]);return this.listenOnKey(t,function(t){o.update(t.newValue)},e),o},k.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},k.prototype.listenOnKeyAndRepeat=function(t,e,n){return e({key:t,newValue:this.data[t],oldValue:void 0}),this.listenOnKey(t,e,n)},k.prototype.listenOnKey=function(t,e,n){return this.updateEventOnKey.has(t)||this.updateEventOnKey.set(t,new i),this.updateEventOnKey.get(t).subscribe(e,n).cancel},k.prototype.keys=function(){return Object.keys(this.data)},k.prototype.values=function(){return Object.values(this.data)},k.prototype.get=function(t){return this.data[t]},k.prototype.delete=function(t){var e=this.data[t];delete this.data[t],this.updateEvent.fire({oldValue:e,key:t,newValue:void 0,deleted:!0}),this.updateEventOnKey.has(t)&&this.updateEventOnKey.get(t).fire({oldValue:e,key:t,newValue:void 0})},k.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]})}},k.prototype.assign=function(t){if(t instanceof k)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])}},k.prototype.toObject=function(){return Object.assign({},this.data)},k.prototype.toDataSource=function(){var t=this,e=new s(this.data);return this.listen(function(n){e.update(t.data)}),e};var j=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}(C),U=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}(C),N={input:"onInput",change:"onChange"},T=["placeholder","readonly","disabled","accept","alt","autocomplete","autofocus","checked","defaultChecked","formAction","formEnctype","formMethod","formNoValidate","formTarget","max","maxLength","min","minLength","pattern","multiple","required","type"],P=function(t){function e(e,n){var r,i,a=this;t.call(this,e,n,"input"),null!==e&&(e.value instanceof s||e.value instanceof g?(this.cleanUp||(this.cleanUp=new o),e.value.unique(this.cleanUp).listenAndRepeat(function(t){return a.node.value=t}),this.node.addEventListener("input",function(){e.value instanceof s?e.value.update(a.node.value):e.value instanceof g&&e.value.updateUpstream(a.node.value)})):this.node.value=null!==(r=e.value)&&void 0!==r?r:"",e.checked instanceof s||e.checked instanceof g?(this.cleanUp||(this.cleanUp=new o),e.checked.unique(this.cleanUp).listenAndRepeat(function(t){return a.node.checked=t}),this.node.addEventListener("change",function(){e.checked instanceof s?e.checked.update(a.node.checked):e.checked instanceof g&&e.checked.updateUpstream(a.node.checked)})):this.node.checked=null!==(i=e.checked)&&void 0!==i&&i,this.bindProps(T,e),this.createEventHandlers(N,e))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(C),F=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}(C),R=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}(C),I=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}(C),L=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}(C),M=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}(C),q=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}(C),V=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}(C),K=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}(C),W=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}(C),H=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}(C),z=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}(C),B=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}(C),J=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}(C),G=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}(C),Q=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}(C),X=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}(C),Y=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}(C),Z=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}(C),$=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}(C),tt=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}(C),et=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}(C),nt={input:"onInput",change:"onChange"},ot=["placeholder","readonly","disabled","rows","wrap","autocomplete","autofocus","max","maxLength","min","minLength","required","type"],rt=function(t){function e(e,n){var r,i,a,s=this;t.call(this,e,n,"textArea"),null!==e&&(e.inputValueSource?(this.node.value=null!==(i=null!==(r=e.initialValue)&&void 0!==r?r:e.inputValueSource.value)&&void 0!==i?i:"",this.cleanUp||(this.cleanUp=new o),e.inputValueSource.unique(this.cleanUp).listen(function(t){return s.node.value=t})):this.node.value=null!==(a=e.initialValue)&&void 0!==a?a:"",this.bindProps(ot,e),this.createEventHandlers(nt,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(s.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(C),it=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}(C),at=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}(C),st=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}(C),ut=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}(C),ct=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}(C),lt=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}(C),pt=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}(C),ht=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}(C),dt=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}(C),ft=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}(C),vt=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}(C),yt=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}(C),mt=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}(C),gt=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}(C),bt=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}(C),wt=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}(C),_t=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}(C),Ot=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}(C),Ct=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}(C),St=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}(C),xt={change:"onChange"},Et=function(t){function e(e,n){var r=this;t.call(this,e,n,"select"),null!==e&&(this.createEventHandlers(xt,e),e.value&&(this.value=e.value,(e.value instanceof s||e.value instanceof g)&&(this.cleanUp||(this.cleanUp=new o),e.value.listen(function(t){r.node.value=t},this.cleanUp),this.node.addEventListener("change",function(){e.value instanceof s?e.value.update(r.node.value):e.value instanceof g&&e.value.updateUpstream(r.node.value)}))),e.selectedIndex&&(this.selectedIndex=e.selectedIndex,(e.selectedIndex instanceof s||e.selectedIndex instanceof g)&&(this.cleanUp||(this.cleanUp=new o),e.selectedIndex.listen(function(t){r.node.selectedIndex=t},this.cleanUp),this.node.addEventListener("change",function(){e.selectedIndex instanceof s?e.selectedIndex.update(r.node.selectedIndex):e.selectedIndex instanceof g&&e.selectedIndex.updateUpstream(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.value instanceof s||this.value instanceof g?this.node.value=this.value.value:void 0!==this.value?this.node.value=this.value:this.selectedIndex instanceof s||this.selectedIndex instanceof g?this.node.selectedIndex=this.selectedIndex.value:void 0!==this.selectedIndex&&(this.node.selectedIndex=this.selectedIndex))},e}(C),Dt=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}(C),At=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}(C),kt=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}(C),jt=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}(C),Ut=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}(C),Nt=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}(C),Tt=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}(C),Pt=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}(C),Ft=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}(C),Rt=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}(C),It=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}(C),Lt=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}(C),Mt=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}(C),qt={button:U,div:j,input:P,li:F,span:R,style:I,ul:M,p:q,img:V,link:K,canvas:W,a:H,article:z,br:B,form:J,label:G,ol:Q,pre:X,progress:Y,table:Z,td:$,tr:tt,th:et,textarea:rt,h1:it,h2:at,h3:st,h4:ut,h5:ct,h6:lt,header:pt,footer:ht,nav:dt,b:ft,i:vt,script:yt,abbr:mt,area:gt,aside:bt,audio:L,em:wt,heading:_t,iframe:Ot,noscript:Ct,option:function(t){function e(e,n){t.call(this,e,n,"option"),e&&this.bindProps(["value"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(C),q:St,select:Et,source:Dt,title:At,video:kt,tbody:jt,tfoot:Ut,thead:Nt,summary:Tt,details:Pt,sub:Ft,sup:Rt,svg:It,data:Lt,time:Mt,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}(C)},Vt=function(){};Vt.attach=function(t,e){var n=O(t);if(e[y])throw new Error("This node is already managed by aurum and cannot be used");if(!(n instanceof C))throw new Error("Root node of aurum application must be a single dom node");e.appendChild(n.node),n.handleAttach(n),e[y]=n},Vt.isAttached=function(t){return void 0!==t[y]},Vt.detach=function(t){t[y]&&(t[y].node.remove(),t[y].handleDetach(),t[y]=void 0)},Vt.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=qt[t]))throw new Error("Node "+a+" does not exist or is not supported")}return Object.getPrototypeOf(t)===C?((n={})[b]=!0,n.constructor=function(e,n){return new t(e,n)},n.props=e,n.innerNodes=r,n):((o={})[b]=!0,o.constructor=t,o.props=e,o.innerNodes=r,o)},t.aurumElementModelIdentitiy=b,t.prerender=O,t.AurumElement=C,t.AurumFragment=S,t.Custom=x,t.AurumRouter=function(t,e){if((e=e.map(O)).some(function(t){return!t[E]}))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 s(D());return window.addEventListener("hashchange",function(){n.update(D())}),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={})[E]=!0,n.content=e,n.default=!1,n.href=t.href,n},t.DefaultRoute=function(t,e){var n;return(n={})[E]=!0,n.content=e,n.default=!0,n.href=void 0,n},t.Suspense=function(t,e){var n=new s(null==t?void 0:t.fallback);return Promise.all(e.map(O)).then(function(t){n.update(t)}),n},t.Switch=function(t,e){if((e=e.map(O)).some(function(t){return!t[A]}))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");var n=t.state.unique();return n.primed=!0,n.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={})[A]=!0,n.content=e,n.default=!1,n.value=t.when,n},t.DefaultSwitchCase=function(t,e){var n;return(n={})[A]=!0,n.content=e,n.default=!0,n.value=void 0,n},t.DataSource=s,t.TransientDataSource=u,t.ArrayDataSource=c,t.TransientArrayDataSource=h,t.MappedArrayView=d,t.SortedArrayView=f,t.FilteredArrayView=v,t.DuplexDataSource=g,t.ObjectDataSource=k,t.Aurum=Vt,t.CancellationToken=o,t.aurumClassName=function(t,e){var n=[],o=function(o){if(t[o])if(t[o]instanceof s||t[o]instanceof g){var r=t[o],i=new s(r.value?o:"");r.listen(function(t){i.update(r.value?o:"")},e),n.push(i)}else n.push(o)};for(var r in t)o(r);return n}}); | ||
//# 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 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
5519713
148450