Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aurumjs

Package Overview
Dependencies
Maintainers
1
Versions
244
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aurumjs - npm Package Compare versions

Comparing version 0.3.14 to 0.3.15

3

dist/nodes/special/suspense.js
import { DataSource } from '../../stream/data_source';
import { buildRenderableFromModel } from './aurum_element';
export function Suspense(props, children) {
const data = new DataSource(props.fallback);
Promise.all(children).then(() => {
Promise.all(children.map(buildRenderableFromModel)).then(() => {
data.update(children);

@@ -6,0 +7,0 @@ });

{
"name": "aurumjs",
"version": "0.3.14",
"version": "0.3.15",
"description": "Fast and concise declarative DOM rendering library for javascript",

@@ -5,0 +5,0 @@ "main": "dist/aurum.js",

@@ -1,2 +0,2 @@

var t=function(){this.subscribeChannel=[],this.onAfterFire=[]},e={subscriptions:{configurable:!0}};e.subscriptions.get=function(){return this.subscribeChannel.length},t.prototype.subscribe=function(t,e){return this.createSubscription(t,this.subscribeChannel,e).facade},t.prototype.hasSubscriptions=function(){return this.subscriptions>0},t.prototype.cancelAll=function(){var t=this;this.isFiring?this.onAfterFire.push(function(){return t.subscribeChannel.length=0}):this.subscribeChannel.length=0},t.prototype.fireFiltered=function(t,e){this.isFiring=!0;for(var n=this.subscribeChannel.length,o=0;o<n;o++)this.subscribeChannel[o].callback!==e&&this.subscribeChannel[o].callback(t);this.isFiring=!1,this.afterFire()},t.prototype.afterFire=function(){this.onAfterFire.length>0&&(this.onAfterFire.forEach(function(t){return t()}),this.onAfterFire.length=0)},t.prototype.fire=function(t){this.isFiring=!0;for(var e=this.subscribeChannel.length,n=0;n<e;n++)this.subscribeChannel[n].callback(t);this.isFiring=!1,this.afterFire()},t.prototype.createSubscription=function(t,e,n){var o=this,r={callback:t},i={cancel:function(){o.cancel(r,e)}};return void 0!==n&&n.addCancelable(function(){return o.cancel(r,e)}),e.push(r),{subscription:r,facade:i}},t.prototype.cancel=function(t,e){var n=this,o=e.indexOf(t);o>=0&&(this.isFiring?this.onAfterFire.push(function(){return n.cancel(t,e)}):e.splice(o,1))},Object.defineProperties(t.prototype,e);var n=function(e){this.value=e,this.updateEvent=new t};n.prototype.update=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateEvent.fire(t),this.updating=!1},n.prototype.backPropagate=function(t,e){this.value=e,this.updating=!0,this.updateEvent.fireFiltered(e,t),this.updating=!1},n.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},n.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},n.prototype.filter=function(t,e){var o=new n;return this.listen(function(e){t(e)&&o.update(e)},e),o},n.prototype.filterDuplex=function(t,e){var o=this,r=new n,i=function(e){t(e)&&r.backPropagate(a,e)},a=function(e){t(e)&&o.backPropagate(i,e)};return this.listen(i,e),r.listen(a,e),r},n.prototype.pipe=function(t,e){this.listen(function(e){return t.update(e)},e)},n.prototype.pipeDuplex=function(t,e){var n=this,o=function(e){return t.backPropagate(r,e)},r=function(t){return n.backPropagate(o,t)};this.listen(o,e),t.listen(r,e)},n.prototype.map=function(t,e){var o=new n(t(this.value));return this.listen(function(e){o.update(t(e))},e),o},n.prototype.mapDuplex=function(t,e,o){var r=this,i=new n(t(this.value)),a=function(e){return i.backPropagate(c,t(e))},c=function(t){return r.backPropagate(a,e(t))};return this.listen(a,o),i.listen(c,o),i},n.prototype.unique=function(t){var e=new n(this.value);return this.listen(function(t){t!==e.value&&e.update(t)},t),e},n.prototype.uniqueDuplex=function(t){var e=this,o=new n(this.value),r=function(t){t!==o.value&&o.backPropagate(i,t)},i=function(t){t!==e.value&&e.backPropagate(r,t)};return this.listen(r,t),o.listen(i,t),o},n.prototype.reduce=function(t,e,o){var r=new n(e);return this.listen(function(e){return r.update(t(r.value,e))},o),r},n.prototype.aggregate=function(t,e,o){var r=this,i=new n(e(this.value,t.value));return this.listen(function(){return i.update(e(r.value,t.value))},o),t.listen(function(){return i.update(e(r.value,t.value))},o),i},n.prototype.combine=function(t,e){var o=new n;return this.pipe(o,e),t.pipe(o,e),o},n.prototype.debounce=function(t,e){var o,r=new n(this.value);return this.listen(function(e){clearTimeout(o),o=setTimeout(function(){r.update(e)},t)},e),r},n.prototype.buffer=function(t,e){var o,r=new n,i=[];return this.listen(function(e){i.push(e),o||(o=setTimeout(function(){o=void 0,r.update(i),i=[]},t))},e),r},n.prototype.queue=function(t){var e=new o;return this.listen(function(t){e.push(t)},t),e},n.prototype.pick=function(t,e){var o,r=new n(null===(o=this.value)||void 0===o?void 0:o[t]);return this.listen(function(e){r.update(null!=e?e[t]:e)},e),r},n.prototype.cancelAll=function(){this.updateEvent.cancelAll()};var o=function(e){this.data=e?e.slice():[],this.lengthSource=new n(this.data.length).unique(),this.updateEvent=new t},r={length:{configurable:!0}};o.prototype.listenAndRepeat=function(t,e){return t({operation:"add",operationDetailed:"append",index:0,items:this.data,newState:this.data,count:this.data.length}),this.listen(t,e)},o.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},r.length.get=function(){return this.lengthSource},o.prototype.getData=function(){return this.data.slice()},o.prototype.get=function(t){return this.data[t]},o.prototype.set=function(t,e){var n=this.data[t];n!==e&&(this.data[t]=e,this.update({operation:"replace",operationDetailed:"replace",target:n,count:1,index:t,items:[e],newState:this.data}),this.lengthSource.update(this.data.length))},o.prototype.swap=function(t,e){if(t!==e){var n=this.data[t],o=this.data[e];this.data[e]=n,this.data[t]=o,this.update({operation:"swap",operationDetailed:"swap",index:t,index2:e,items:[n,o],newState:this.data}),this.lengthSource.update(this.data.length)}},o.prototype.swapItems=function(t,e){if(t!==e){var n=this.data.indexOf(t),o=this.data.indexOf(e);-1!==n&&-1!==o&&(this.data[o]=t,this.data[n]=e),this.update({operation:"swap",operationDetailed:"swap",index:n,index2:o,items:[t,e],newState:this.data}),this.lengthSource.update(this.data.length)}},o.prototype.appendArray=function(t){var e=this.data;this.data=new Array(e.length);var n=0;for(n=0;n<e.length;n++)this.data[n]=e[n];for(var o=0;o<t.length;o++)this.data[n+o]=t[o];this.update({operation:"add",operationDetailed:"append",count:t.length,index:this.data.length-t.length,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.push=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.appendArray(t),this.lengthSource.update(this.data.length)},o.prototype.unshift=function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];(t=this.data).unshift.apply(t,e),this.update({operation:"add",operationDetailed:"prepend",count:e.length,items:e,index:0,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.pop=function(){var t=this.data.pop();return this.update({operation:"remove",operationDetailed:"removeRight",count:1,index:this.data.length,items:[t],newState:this.data}),this.lengthSource.update(this.data.length),t},o.prototype.merge=function(t){for(var e=0;e<t.length;e++)this.data[e]!==t[e]&&(this.data.length>e?this.set(e,t[e]):this.push(t[e]));this.data.length>t.length&&this.removeRight(this.data.length-t.length),this.lengthSource.update(this.data.length)},o.prototype.removeRight=function(t){var e=this.data.length,n=this.data.splice(e-t,t);this.update({operation:"remove",operationDetailed:"removeRight",count:t,index:e-t,items:n,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.removeLeft=function(t){var e=this.data.splice(0,t);this.update({operation:"remove",operationDetailed:"removeLeft",count:t,index:0,items:e,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.remove=function(t){var e=this.data.indexOf(t);-1!==e&&(this.data.splice(e,1),this.update({operation:"remove",operationDetailed:"remove",count:1,index:e,items:[t],newState:this.data}),this.lengthSource.update(this.data.length))},o.prototype.clear=function(){var t=this.data;this.data=[],this.update({operation:"remove",operationDetailed:"clear",count:t.length,index:0,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.shift=function(){var t=this.data.shift();return this.update({operation:"remove",operationDetailed:"removeLeft",items:[t],count:1,index:0,newState:this.data}),this.lengthSource.update(this.data.length),t},o.prototype.toArray=function(){return this.data.slice()},o.prototype.sort=function(t,e){return new a(this,t,e)},o.prototype.map=function(t,e){return new i(this,t,e)},o.prototype.filter=function(t,e){return new c(this,t,e)},o.prototype.forEach=function(t){return this.data.forEach(t)},o.prototype.toDataSource=function(){var t=new n(this.data);return this.listen(function(e){t.update(e.newState)}),t},o.prototype.update=function(t){this.updateEvent.fire(t)},Object.defineProperties(o.prototype,r);var i=function(t){function e(e,n,o){var r=this,i=e.getData().map(n);t.call(this,i),this.mapper=n,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(r.data[t.index]);break;case"clear":r.clear();break;case"prepend":(e=r).unshift.apply(e,t.items.map(r.mapper));break;case"append":r.appendArray(t.items.map(r.mapper));break;case"swap":r.swap(t.index,t.index2);break;case"replace":r.set(t.index,r.mapper(t.items[0]))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(o),a=function(t){function e(e,n,o){var r=this,i=e.getData().sort(n);t.call(this,i),this.comparator=n,e.listen(function(t){var e,n;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(t.items[0]);break;case"clear":r.data.length=0;break;case"prepend":(e=r).unshift.apply(e,t.items),r.data.sort(r.comparator);break;case"append":(n=r).push.apply(n,t.items),r.data.sort(r.comparator);break;case"swap":break;case"replace":r.set(t.index,t.items[0]),r.data.sort(r.comparator)}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(o),c=function(t){function e(e,n,o){var r=this;Array.isArray(e)&&(e=new t(e));var i=e.data.filter(n=null!=n?n:function(){return!0});t.call(this,i),this.parent=e,this.viewFilter=n,e.listen(function(t){var e,n,o;switch(t.operationDetailed){case"clear":r.clear();break;case"removeLeft":case"removeRight":case"remove":for(var i=0,a=t.items;i<a.length;i+=1)r.remove(a[i]);break;case"prepend":o=t.items.filter(r.viewFilter),(e=r).unshift.apply(e,o);break;case"append":o=t.items.filter(r.viewFilter),(n=r).push.apply(n,o);break;case"swap":var c=r.data.indexOf(t.items[0]),s=r.data.indexOf(t.items[1]);-1!==c&&-1!==s&&r.swap(c,s);break;case"replace":var u=r.data.indexOf(t.target);-1!==u&&(r.viewFilter(t.items[0])?r.set(u,t.items[0]):r.remove(t.target))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.updateFilter=function(t){if(this.viewFilter!==t)return this.viewFilter=t,this.refresh(),this.data.length},e.prototype.refresh=function(){var t;this.clear();var e=this.parent.data.filter(this.viewFilter);(t=this).push.apply(t,e)},e}(o),s=function(e){e&&(this.data=e),this.updateEvent=new t,this.updateEventOnKey=new Map};s.prototype.pick=function(t,e){var o,r=new n(null===(o=this.data)||void 0===o?void 0:o[t]);return this.listenOnKey(t,function(t){r.update(t.newValue)},e),r},s.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},s.prototype.listenOnKeyAndRepeat=function(t,e,n){return e({key:t,newValue:this.data[t],oldValue:void 0}),this.listenOnKey(t,e,n)},s.prototype.listenOnKey=function(e,n,o){return this.updateEventOnKey.has(e)||this.updateEventOnKey.set(e,new t),this.updateEventOnKey.get(e).subscribe(n,o).cancel},s.prototype.get=function(t){return this.data[t]},s.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]})}},s.prototype.assign=function(t){for(var e=0,n=Object.keys(t);e<n.length;e+=1){var o=n[e];this.set(o,t[o])}},s.prototype.toObject=function(){return Object.assign({},this.data)},s.prototype.toDataSource=function(){var t=this,e=new n(this.data);return this.listen(function(n){e.update(t.data)}),e};var u=Symbol("owner"),p=function(t){var e=this;this.node=this.create(t),t instanceof n&&t.listen(function(t){e.node&&(e.node.textContent=t)})};p.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},p.prototype.create=function(t){var e=document.createTextNode(this.resolveStringSource(t));return e[u]=this,e},p.prototype.remove=function(){this.hasParent()&&this.node.parentElement[u].removeChild(this.node)},p.prototype.hasParent=function(){return!!this.node.parentElement};var l=Symbol("AurumElementModel"),h={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"},d=["id","name","draggable","tabindex","style","role","contentEditable"];function f(t){return t&&t[l]?f(t.constructor(t.props,t.innerNodes)):t}var v=function(t,e,n){var o,r;this.node=this.create(n),this.children=[],null!=t&&(t.onAttach&&(this.onAttach=t.onAttach,this.needAttach=!0),this.onDetach=t.onDetach,this.initialize(t),null===(r=(o=t).onCreate)||void 0===r||r.call(o,this.node)),e&&this.addChildren(e)};v.prototype.initialize=function(t){this.createEventHandlers(h,t);var e=Object.keys(t).filter(function(t){return t.includes("-")});this.bindProps(d,t,e),t.class&&this.handleClass(t.class)},v.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,c=n;a<c.length;a+=1){var s=c[a];e[s]&&this.assignStringSourceToAttribute(e[s],s)}},v.prototype.createEventHandlers=function(t,e){var o=this,r=function(r){e[t[r]]&&(e[t[r]]instanceof n?o.node.addEventListener(r,function(n){return e[t[r]].update(n)}):"function"==typeof e[t[r]]&&o.node.addEventListener(r,function(n){return e[t[r]](n)}))};for(var i in t)r(i)},v.prototype.render=function(){for(var t=0,e=0;e<this.children.length;e++,t++)this.children[e]instanceof y?t=this.renderFragment(this.children[e],t):this.renderChild(this.children[e],t);for(;this.node.childNodes.length>t;)this.node.removeChild(this.node.childNodes[this.node.childNodes.length-1])},v.prototype.renderFragment=function(t,e){for(var n=0;n<t.children.length;n++,e++)t.children[n]instanceof y?e=this.renderFragment(t.children[n],e):this.renderChild(t.children[n],e);return--e},v.prototype.renderChild=function(t,e){if(this.node.childNodes.length<=e)return this.addChildDom(t);if(this.node.childNodes[e][u]!==t){var n=this.getChildIndex(t.node);-1!==n?this.swapChildrenDom(e,n):this.addDomNodeAt(t.node,e)}},v.prototype.assignStringSourceToAttribute=function(t,e){var n=this;"string"==typeof t||"boolean"==typeof t?this.node.setAttribute(e,t):(t.value&&this.node.setAttribute(e,t.value),t.unique().listen(function(t){return n.node.setAttribute(e,t)}))},v.prototype.handleAttach=function(t){var e,n,o,r;if(this.needAttach)if(t.isConnected()){null===(e=this.onAttach)||void 0===e||e.call(this,this.node);for(var i=0,a=this.node.childNodes;i<a.length;i+=1)null===(r=null===(n=a[i][u])||void 0===n?void 0:(o=n).handleAttach)||void 0===r||r.call(o,this)}else t.needAttach=!0},v.prototype.handleDetach=function(){var t,e,n;if(!this.node.isConnected){null===(t=this.onDetach)||void 0===t||t.call(this,this.node);for(var o=0,r=this.node.childNodes;o<r.length;o+=1){var i=r[o];i[u]&&(null===(n=(e=i[u]).handleDetach)||void 0===n||n.call(e))}}},v.prototype.handleClass=function(t){var e=this;if("string"==typeof t)this.node.className=t;else if(t instanceof n)t.value&&(Array.isArray(t.value)?(this.node.className=t.value.join(" "),t.unique().listen(function(){e.node.className=t.value.join(" ")})):(this.node.className=t.value,t.unique().listen(function(){e.node.className=t.value}))),t.unique().listen(function(t){return e.node.className=t});else{var o=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");this.node.className=o;for(var r=0,i=t;r<i.length;r+=1){var a=i[r];a instanceof n&&a.unique().listen(function(n){var o=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");e.node.className=o})}}},v.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},v.prototype.create=function(t){var e=document.createElement(t);return e[u]=this,e},v.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},v.prototype.hasChild=function(t){for(var e=0,n=t.children;e<n.length;e+=1)if(n[e]===t)return!0;return!1},v.prototype.addChildDom=function(t){var e,n;this.node.appendChild(t.node),null===(n=(e=t).handleAttach)||void 0===n||n.call(e,this)},v.prototype.swapChildrenDom=function(t,e){if(t!==e){var n=this.node.children[t],o=this.node.children[e];n.remove(),o.remove(),t<e?(this.addDomNodeAt(o,t),this.addDomNodeAt(n,e)):(this.addDomNodeAt(n,e),this.addDomNodeAt(o,t))}},v.prototype.addDomNodeAt=function(t,e){var n,o,r,i;e>=this.node.childElementCount?(this.node.appendChild(t),null===(o=(n=t[u]).handleAttach)||void 0===o||o.call(n,this)):(this.node.insertBefore(t,this.node.children[e]),null===(i=(r=t[u]).handleAttach)||void 0===i||i.call(r,this))},v.prototype.remove=function(){this.hasParent()&&this.node.parentElement[u].removeChild(this.node)},v.prototype.hasParent=function(){return!!this.node.parentElement},v.prototype.isConnected=function(){return this.node.isConnected},v.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1),this.render()},v.prototype.removeChildAt=function(t){this.children.splice(t,1),this.render()},v.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()}},v.prototype.clearChildren=function(){this.children.length=0,this.render()},v.prototype.addChild=function(t){if(null!=t&&(!t[l]||void 0!==(t=f(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()},v.prototype.childNodeToAurum=function(t){var e=this;if(t instanceof v)return t;if(t instanceof Promise){var r=new y({});return t.then(function(t){r.addChildren([t]),e.render()}),r}if(t instanceof o){var i=new y({repeatModel:t});return i.onChange.subscribe(function(){return e.render()}),i}if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return new p(t.toString());if(t instanceof n){var a=new y({},[t]);return a.onChange.subscribe(function(){return e.render()}),a}throw new Error("Unsupported child type")},v.prototype.addChildAt=function(t,e){this.children.splice(e,0,this.childNodeToAurum(t)),this.render()},v.prototype.addChildren=function(t){if(0!==t.length)for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e])};var y=function(e,n){this.onChange=new t,this.children=[],e.repeatModel?this.handleRepeat(e.repeatModel):n&&this.addChildren(n)};y.prototype.addChildren=function(t){for(var e=this,o=function(){var t=i[r],o=void 0;if((o=t[l]?f(t):t)instanceof v)e.children.push(o);else{if(!(o instanceof n))throw new Error("case not yet implemented");var a=void 0,c=void 0,s={ts:void 0};o.unique().listenAndRepeat(function(t){if(s.ts=Date.now(),null==t&&c)return e.children.length=0,e.onChange.fire(),void(c=!1);if(!Array.isArray(t)&&c&&(e.children.length=0,e.onChange.fire(),c=!1),Array.isArray(t)){c=!0,e.children.length=0,e.onChange.fire();for(var n=0,r=t;n<r.length;n+=1)e.handleSourceChild(r[n],void 0,void 0,s,s.ts)}else a=e.handleSourceChild(t,a,o,s,s.ts)})}},r=0,i=t;r<i.length;r+=1)o()},y.prototype.handleSourceChild=function(t,e,r,i,a){var c=this;if(null!=t){if(t[l]&&(t=f(t)),"string"==typeof t||"bigint"==typeof t||"number"==typeof t||"boolean"==typeof t)if(e){if(e instanceof v){var s=new p(null!=r?r:t);this.children.splice(this.children.indexOf(e),1,s),e=s,this.onChange.fire()}}else{var u=new p(null!=r?r:t);this.children.push(u),e=u,this.onChange.fire()}else if(t instanceof v)t!==e&&(e?this.children.splice(this.children.indexOf(e),1,t):this.children.push(t),e=t,this.onChange.fire());else if(t instanceof Promise)t.then(function(t){i.ts===a&&(c.addChildren([t]),c.onChange.fire())});else if(t instanceof n)if(e){if(e!==t){var h=new y({},[t]);h.onChange.subscribe(function(){return c.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,h),e=h,this.onChange.fire()}}else{var d=new y({},[t]);e=d,this.children.push(d),d.onChange.subscribe(function(){return c.onChange.fire()}),this.onChange.fire()}else if(t instanceof o)if(e){if(e!==t){var b=new y({repeatModel:t});b.onChange.subscribe(function(){return c.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,b),e=b,this.onChange.fire()}}else{var _=new y({repeatModel:t});e=_,this.children.push(_),_.onChange.subscribe(function(){return c.onChange.fire()}),this.onChange.fire()}return e}e&&(this.children.splice(this.children.indexOf(e),1),e=void 0,this.onChange.fire())},y.prototype.handleRepeat=function(t){var e=this;t.listenAndRepeat(function(t){var n;switch(t.operationDetailed){case"replace":e.children[t.index]=f(t.items[0]);break;case"swap":var o=e.children[t.index2];e.children[t.index2]=e.children[t.index],e.children[t.index]=o;break;case"append":e.children=e.children.concat(t.items.map(f));break;case"prepend":(n=e.children).unshift.apply(n,t.items.map(f));break;case"remove":case"removeLeft":case"removeRight":e.children.splice(t.index,t.count);break;case"clear":e.children=[];break;default:throw new Error("unhandled operation")}e.onChange.fire()})};var b=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}(v),_=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}(v),g={input:"onInput",change:"onChange"},m=["placeholder","readonly","disabled","accept","alt","autocomplete","autofocus","checked","defaultChecked","formAction","formEnctype","formMethod","formNoValidate","formTarget","max","maxLength","min","minLength","pattern","multiple","required","type"],w=function(t){function e(e,n){var o,r=this;t.call(this,e,n,"input"),null!==e&&(e.inputValueSource?e.inputValueSource.unique().listenAndRepeat(function(t){return r.node.value=t}):this.node.value=null!=(o=e.initialValue)?o:"",this.bindProps(m,e),this.createEventHandlers(g,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(r.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),x=function(t){function e(e,n){t.call(this,e,n,"li")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),C=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}(v),O=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}(v),S=function(t){function e(e,n){t.call(this,e,n,"audio"),null!==e&&this.bindProps(["controls","autoplay","loop","muted","preload","src"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),A=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}(v),j=function(t){function e(e,n){t.call(this,e,n,"p")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),k=function(t){function e(e,n){t.call(this,e,n,"img"),null!==e&&this.bindProps(["src","alt","width","height","referrerPolicy","sizes","srcset","useMap"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),E=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}(v),N=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}(v),D=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}(v),P=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}(v),F=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}(v),R=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}(v),I=function(t){function e(e,n){t.call(this,e,n,"label"),null!==e&&this.bindProps(["for"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),L=function(t){function e(e,n){t.call(this,e,n,"ol")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),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}(v),V=function(t){function e(e,n){t.call(this,e,n,"progress"),null!==e&&this.bindProps(["max","value"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),M=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}(v),T=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}(v),K=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}(v),H=function(t){function e(e,n){t.call(this,e,n,"th")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),z={input:"onInput",change:"onChange"},U=["placeholder","readonly","disabled","rows","wrap","autocomplete","autofocus","max","maxLength","min","minLength","required","type"],B=function(t){function e(e,n){var o,r,i,a=this;t.call(this,e,n,"textArea"),null!==e&&(e.inputValueSource?(this.node.value=null!=(r=null!=(o=e.initialValue)?o:e.inputValueSource.value)?r:"",e.inputValueSource.unique().listen(function(t){return a.node.value=t})):this.node.value=null!=(i=e.initialValue)?i:"",this.bindProps(U,e),this.createEventHandlers(z,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(a.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),W=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}(v),G=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}(v),J=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}(v),Q=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}(v),X=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}(v),Y=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}(v),Z=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}(v),$=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}(v),tt=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}(v),et=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}(v),nt=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}(v),ot=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}(v),rt=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}(v),it=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}(v),at=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}(v),ct=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}(v),st=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}(v),ut=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}(v),pt=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}(v),lt=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}(v),ht={change:"onChange"},dt=function(t){function e(e,n){var o,r=this;t.call(this,e,n,"select"),null!==e&&(this.createEventHandlers(ht,e),this.initialSelection=e.initialSelection,e.selectedIndexSource?(this.selectedIndexSource=e.selectedIndexSource,e.selectedIndexSource.unique().listenAndRepeat(function(t){return r.node.selectedIndex=t})):this.node.selectedIndex=null!=(o=e.initialSelection)?o:-1,e.selectedIndexSource&&(this.needAttach=!0,this.node.addEventListener("change",function(){e.selectedIndexSource.update(r.node.selectedIndex)})))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleAttach=function(e){t.prototype.handleAttach.call(this,e),this.node.isConnected&&(this.selectedIndexSource?this.node.selectedIndex=this.selectedIndexSource.value:void 0!==this.initialSelection&&(this.node.selectedIndex=this.initialSelection))},e}(v),ft=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}(v),vt=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}(v),yt=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}(v),bt=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}(v),_t=function(t){function e(e,n){t.call(this,e,n,"tfoot")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),gt=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}(v),mt=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}(v),wt=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}(v),xt=function(t){function e(e,n){t.call(this,e,n,"sub")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),Ct=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}(v),Ot=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}(v),St=function(t){function e(e,n){t.call(this,e,n,"data"),null!==e&&this.bindProps(["datalue"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),At=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}(v),jt={button:_,div:b,input:w,li:x,span:C,style:O,ul:A,p:j,img:k,link:E,canvas:N,a:D,article:P,br:F,form:R,label:I,ol:L,pre:q,progress:V,table:M,td:T,tr:K,th:H,textarea:B,h1:W,h2:G,h3:J,h4:Q,h5:X,h6:Y,header:Z,footer:$,nav:tt,b:et,i:nt,script:ot,abbr:rt,area:it,aside:at,audio:S,em:ct,heading:st,iframe:ut,noscript:pt,option:function(t){function e(e,n){t.call(this,e,n,"option")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),q:lt,select:dt,source:ft,title:vt,video:yt,tbody:bt,tfoot:_t,thead:gt,summary:mt,details:wt,sub:xt,sup:Ct,svg:Ot,data:St,time:At,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}(v)},kt=function(){};kt.attach=function(t,e){var n=f(t);if(e[u])throw new Error("This node is already managed by aurum and cannot be used");if(!(n instanceof v))throw new Error("Root node of aurum application must be a single dom node");e.appendChild(n.node),n.handleAttach(n),e[u]=n},kt.isAttached=function(t){return void 0!==t[u]},kt.detach=function(t){t[u]&&(t[u].node.remove(),t[u].handleDetach(),t[u]=void 0)},kt.factory=function(t,e){for(var n,o,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];if("string"==typeof t){var a=t;if(void 0===(t=jt[t]))throw new Error("Node "+a+" does not exist or is not supported")}return Object.getPrototypeOf(t)===v?((n={})[l]=!0,n.constructor=function(e,n){return new t(e,n)},n.props=e,n.innerNodes=r,n):((o={})[l]=!0,o.constructor=t,o.props=e,o.innerNodes=r,o)};var Et=function(t){this.data=t};Et.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)}},Et.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 Nt=function(t){var e=this;void 0===t&&(t=[]),this.length=0,t.forEach(function(t){return e.append(t)})};Nt.prototype.find=function(t){for(var e=this.rootNode;e&&!t(e);)e=e.next;return e},Nt.prototype.append=function(t){return this.rootNode||this.lastNode?(this.lastNode.next=new Et(t),this.lastNode.next.previous=this.lastNode,this.lastNode=this.lastNode.next):this.rootNode=this.lastNode=new Et(t),this.length++,t},Nt.prototype.forEach=function(t){this.find(function(e){return t(e.data),!1})},Nt.prototype.prepend=function(t){return this.rootNode||this.lastNode?(this.rootNode.previous=new Et(t),this.rootNode.previous.next=this.rootNode,this.rootNode=this.rootNode.previous):this.rootNode=this.lastNode=new Et(t),this.length++,t},Nt.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 Dt=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.cancelables=new Nt(t),this._isCancelled=!1},Pt={isCanceled:{configurable:!0}};Pt.isCanceled.get=function(){return this._isCancelled},Dt.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},Dt.prototype.removeCancelable=function(t){return this.throwIfCancelled("attempting to remove cancellable from token that is already cancelled"),this.cancelables.remove(t),this},Dt.prototype.addDisposable=function(t){return this.addCancelable(function(){return t.dispose()}),this},Dt.prototype.callIfNotCancelled=function(t){this.isCanceled||t()},Dt.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)},Dt.prototype.setInterval=function(t,e){var n=setInterval(t,e);this.addCancelable(function(){return clearInterval(n)})},Dt.prototype.requestAnimationFrame=function(t){var e=requestAnimationFrame(t);this.addCancelable(function(){return cancelAnimationFrame(e)})},Dt.prototype.animationLoop=function(t){var e=requestAnimationFrame(function n(o){t(o),e=requestAnimationFrame(n)});this.addCancelable(function(){return cancelAnimationFrame(e)})},Dt.prototype.throwIfCancelled=function(t){if(this.isCanceled)throw new Error(t||"cancellation token is cancelled")},Dt.prototype.chain=function(t,e){return void 0===e&&(e=!1),e&&t.chain(this,!1),this.addCancelable(function(){return t.cancel()}),this},Dt.prototype.registerDomEvent=function(t,e,n){return t.addEventListener(e,n),this.addCancelable(function(){return t.removeEventListener(e,n)}),this},Dt.prototype.cancel=function(){this.isCanceled||(this._isCancelled=!0,this.cancelables.forEach(function(t){return t()}),this.cancelables=void 0)},Object.defineProperties(Dt.prototype,Pt);var Ft=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}(v),Rt=Symbol("route");function It(){var t=location.hash.substring(1);return t.includes("?")?t.substring(0,t.indexOf("?")):t.includes("#")?t.substring(0,t.indexOf("#")):t}var Lt=Symbol("switchCase");exports.DataSource=n,exports.ArrayDataSource=o,exports.MappedArrayView=i,exports.SortedArrayView=a,exports.FilteredArrayView=c,exports.ObjectDataSource=s,exports.Aurum=kt,exports.CancellationToken=Dt,exports.Custom=Ft,exports.AurumRouter=function(t,e){if((e=e.map(f)).some(function(t){return!t[Rt]}))throw new Error("Aurum Router only accepts Route and DefaultRoute instances as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default routes only 0 or 1 allowed");var o=new n(It());return window.addEventListener("hashchange",function(){o.update(It())}),o.unique().map(function(t){return function(t,e){var n,o;if(null==t)return null===(n=e.find(function(t){return t.default}))||void 0===n?void 0:n.content;if(e.find(function(e){return e.href===t}))return e.find(function(e){return e.href===t}).content;var r=t.split("/");r.pop();for(var i=function(){var t=r.join("/");if(e.find(function(e){return e.href===t}))return{v:e.find(function(e){return e.href===t}).content};r.pop()};r.length;){var a=i();if(a)return a.v}return null===(o=e.find(function(t){return t.default}))||void 0===o?void 0:o.content}(t,e)})},exports.Route=function(t,e){var n;return(n={})[Rt]=!0,n.content=e,n.default=!1,n.href=t.href,n},exports.DefaultRoute=function(t,e){var n;return(n={})[Rt]=!0,n.content=e,n.default=!0,n.href=void 0,n},exports.Suspense=function(t,e){var o=new n(t.fallback);return Promise.all(e).then(function(){o.update(e)}),o},exports.Switch=function(t,e){if((e=e.map(f)).some(function(t){return!t[Lt]}))throw new Error("Switch only accepts SwitchCase as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default switch cases only 0 or 1 allowed");return t.state.unique().map(function(t){return function(t,e){var n,o,r;return null!==(o=null===(n=e.find(function(e){return e.value===t}))||void 0===n?void 0:n.content)&&void 0!==o?o:null===(r=e.find(function(t){return t.default}))||void 0===r?void 0:r.content}(t,e)})},exports.SwitchCase=function(t,e){var n;return(n={})[Lt]=!0,n.content=e,n.default=!1,n.value=t.when,n},exports.DefaultSwitchCase=function(t,e){var n;return(n={})[Lt]=!0,n.content=e,n.default=!0,n.value=void 0,n},exports.aurumElementModelIdentitiy=l,exports.buildRenderableFromModel=f,exports.AurumElement=v,exports.AurumFragment=y;
var t=function(){this.subscribeChannel=[],this.onAfterFire=[]},e={subscriptions:{configurable:!0}};e.subscriptions.get=function(){return this.subscribeChannel.length},t.prototype.subscribe=function(t,e){return this.createSubscription(t,this.subscribeChannel,e).facade},t.prototype.hasSubscriptions=function(){return this.subscriptions>0},t.prototype.cancelAll=function(){var t=this;this.isFiring?this.onAfterFire.push(function(){return t.subscribeChannel.length=0}):this.subscribeChannel.length=0},t.prototype.fireFiltered=function(t,e){this.isFiring=!0;for(var n=this.subscribeChannel.length,o=0;o<n;o++)this.subscribeChannel[o].callback!==e&&this.subscribeChannel[o].callback(t);this.isFiring=!1,this.afterFire()},t.prototype.afterFire=function(){this.onAfterFire.length>0&&(this.onAfterFire.forEach(function(t){return t()}),this.onAfterFire.length=0)},t.prototype.fire=function(t){this.isFiring=!0;for(var e=this.subscribeChannel.length,n=0;n<e;n++)this.subscribeChannel[n].callback(t);this.isFiring=!1,this.afterFire()},t.prototype.createSubscription=function(t,e,n){var o=this,r={callback:t},i={cancel:function(){o.cancel(r,e)}};return void 0!==n&&n.addCancelable(function(){return o.cancel(r,e)}),e.push(r),{subscription:r,facade:i}},t.prototype.cancel=function(t,e){var n=this,o=e.indexOf(t);o>=0&&(this.isFiring?this.onAfterFire.push(function(){return n.cancel(t,e)}):e.splice(o,1))},Object.defineProperties(t.prototype,e);var n=function(e){this.value=e,this.updateEvent=new t};n.prototype.update=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateEvent.fire(t),this.updating=!1},n.prototype.backPropagate=function(t,e){this.value=e,this.updating=!0,this.updateEvent.fireFiltered(e,t),this.updating=!1},n.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},n.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},n.prototype.filter=function(t,e){var o=new n;return this.listen(function(e){t(e)&&o.update(e)},e),o},n.prototype.filterDuplex=function(t,e){var o=this,r=new n,i=function(e){t(e)&&r.backPropagate(a,e)},a=function(e){t(e)&&o.backPropagate(i,e)};return this.listen(i,e),r.listen(a,e),r},n.prototype.pipe=function(t,e){this.listen(function(e){return t.update(e)},e)},n.prototype.pipeDuplex=function(t,e){var n=this,o=function(e){return t.backPropagate(r,e)},r=function(t){return n.backPropagate(o,t)};this.listen(o,e),t.listen(r,e)},n.prototype.map=function(t,e){var o=new n(t(this.value));return this.listen(function(e){o.update(t(e))},e),o},n.prototype.mapDuplex=function(t,e,o){var r=this,i=new n(t(this.value)),a=function(e){return i.backPropagate(c,t(e))},c=function(t){return r.backPropagate(a,e(t))};return this.listen(a,o),i.listen(c,o),i},n.prototype.unique=function(t){var e=new n(this.value);return this.listen(function(t){t!==e.value&&e.update(t)},t),e},n.prototype.uniqueDuplex=function(t){var e=this,o=new n(this.value),r=function(t){t!==o.value&&o.backPropagate(i,t)},i=function(t){t!==e.value&&e.backPropagate(r,t)};return this.listen(r,t),o.listen(i,t),o},n.prototype.reduce=function(t,e,o){var r=new n(e);return this.listen(function(e){return r.update(t(r.value,e))},o),r},n.prototype.aggregate=function(t,e,o){var r=this,i=new n(e(this.value,t.value));return this.listen(function(){return i.update(e(r.value,t.value))},o),t.listen(function(){return i.update(e(r.value,t.value))},o),i},n.prototype.combine=function(t,e){var o=new n;return this.pipe(o,e),t.pipe(o,e),o},n.prototype.debounce=function(t,e){var o,r=new n(this.value);return this.listen(function(e){clearTimeout(o),o=setTimeout(function(){r.update(e)},t)},e),r},n.prototype.buffer=function(t,e){var o,r=new n,i=[];return this.listen(function(e){i.push(e),o||(o=setTimeout(function(){o=void 0,r.update(i),i=[]},t))},e),r},n.prototype.queue=function(t){var e=new o;return this.listen(function(t){e.push(t)},t),e},n.prototype.pick=function(t,e){var o,r=new n(null===(o=this.value)||void 0===o?void 0:o[t]);return this.listen(function(e){r.update(null!=e?e[t]:e)},e),r},n.prototype.cancelAll=function(){this.updateEvent.cancelAll()};var o=function(e){this.data=e?e.slice():[],this.lengthSource=new n(this.data.length).unique(),this.updateEvent=new t},r={length:{configurable:!0}};o.prototype.listenAndRepeat=function(t,e){return t({operation:"add",operationDetailed:"append",index:0,items:this.data,newState:this.data,count:this.data.length}),this.listen(t,e)},o.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},r.length.get=function(){return this.lengthSource},o.prototype.getData=function(){return this.data.slice()},o.prototype.get=function(t){return this.data[t]},o.prototype.set=function(t,e){var n=this.data[t];n!==e&&(this.data[t]=e,this.update({operation:"replace",operationDetailed:"replace",target:n,count:1,index:t,items:[e],newState:this.data}),this.lengthSource.update(this.data.length))},o.prototype.swap=function(t,e){if(t!==e){var n=this.data[t],o=this.data[e];this.data[e]=n,this.data[t]=o,this.update({operation:"swap",operationDetailed:"swap",index:t,index2:e,items:[n,o],newState:this.data}),this.lengthSource.update(this.data.length)}},o.prototype.swapItems=function(t,e){if(t!==e){var n=this.data.indexOf(t),o=this.data.indexOf(e);-1!==n&&-1!==o&&(this.data[o]=t,this.data[n]=e),this.update({operation:"swap",operationDetailed:"swap",index:n,index2:o,items:[t,e],newState:this.data}),this.lengthSource.update(this.data.length)}},o.prototype.appendArray=function(t){var e=this.data;this.data=new Array(e.length);var n=0;for(n=0;n<e.length;n++)this.data[n]=e[n];for(var o=0;o<t.length;o++)this.data[n+o]=t[o];this.update({operation:"add",operationDetailed:"append",count:t.length,index:this.data.length-t.length,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.push=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.appendArray(t),this.lengthSource.update(this.data.length)},o.prototype.unshift=function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];(t=this.data).unshift.apply(t,e),this.update({operation:"add",operationDetailed:"prepend",count:e.length,items:e,index:0,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.pop=function(){var t=this.data.pop();return this.update({operation:"remove",operationDetailed:"removeRight",count:1,index:this.data.length,items:[t],newState:this.data}),this.lengthSource.update(this.data.length),t},o.prototype.merge=function(t){for(var e=0;e<t.length;e++)this.data[e]!==t[e]&&(this.data.length>e?this.set(e,t[e]):this.push(t[e]));this.data.length>t.length&&this.removeRight(this.data.length-t.length),this.lengthSource.update(this.data.length)},o.prototype.removeRight=function(t){var e=this.data.length,n=this.data.splice(e-t,t);this.update({operation:"remove",operationDetailed:"removeRight",count:t,index:e-t,items:n,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.removeLeft=function(t){var e=this.data.splice(0,t);this.update({operation:"remove",operationDetailed:"removeLeft",count:t,index:0,items:e,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.remove=function(t){var e=this.data.indexOf(t);-1!==e&&(this.data.splice(e,1),this.update({operation:"remove",operationDetailed:"remove",count:1,index:e,items:[t],newState:this.data}),this.lengthSource.update(this.data.length))},o.prototype.clear=function(){var t=this.data;this.data=[],this.update({operation:"remove",operationDetailed:"clear",count:t.length,index:0,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},o.prototype.shift=function(){var t=this.data.shift();return this.update({operation:"remove",operationDetailed:"removeLeft",items:[t],count:1,index:0,newState:this.data}),this.lengthSource.update(this.data.length),t},o.prototype.toArray=function(){return this.data.slice()},o.prototype.sort=function(t,e){return new a(this,t,e)},o.prototype.map=function(t,e){return new i(this,t,e)},o.prototype.filter=function(t,e){return new c(this,t,e)},o.prototype.forEach=function(t){return this.data.forEach(t)},o.prototype.toDataSource=function(){var t=new n(this.data);return this.listen(function(e){t.update(e.newState)}),t},o.prototype.update=function(t){this.updateEvent.fire(t)},Object.defineProperties(o.prototype,r);var i=function(t){function e(e,n,o){var r=this,i=e.getData().map(n);t.call(this,i),this.mapper=n,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(r.data[t.index]);break;case"clear":r.clear();break;case"prepend":(e=r).unshift.apply(e,t.items.map(r.mapper));break;case"append":r.appendArray(t.items.map(r.mapper));break;case"swap":r.swap(t.index,t.index2);break;case"replace":r.set(t.index,r.mapper(t.items[0]))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(o),a=function(t){function e(e,n,o){var r=this,i=e.getData().sort(n);t.call(this,i),this.comparator=n,e.listen(function(t){var e,n;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(t.items[0]);break;case"clear":r.data.length=0;break;case"prepend":(e=r).unshift.apply(e,t.items),r.data.sort(r.comparator);break;case"append":(n=r).push.apply(n,t.items),r.data.sort(r.comparator);break;case"swap":break;case"replace":r.set(t.index,t.items[0]),r.data.sort(r.comparator)}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(o),c=function(t){function e(e,n,o){var r=this;Array.isArray(e)&&(e=new t(e));var i=e.data.filter(n=null!=n?n:function(){return!0});t.call(this,i),this.parent=e,this.viewFilter=n,e.listen(function(t){var e,n,o;switch(t.operationDetailed){case"clear":r.clear();break;case"removeLeft":case"removeRight":case"remove":for(var i=0,a=t.items;i<a.length;i+=1)r.remove(a[i]);break;case"prepend":o=t.items.filter(r.viewFilter),(e=r).unshift.apply(e,o);break;case"append":o=t.items.filter(r.viewFilter),(n=r).push.apply(n,o);break;case"swap":var c=r.data.indexOf(t.items[0]),s=r.data.indexOf(t.items[1]);-1!==c&&-1!==s&&r.swap(c,s);break;case"replace":var u=r.data.indexOf(t.target);-1!==u&&(r.viewFilter(t.items[0])?r.set(u,t.items[0]):r.remove(t.target))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.updateFilter=function(t){if(this.viewFilter!==t)return this.viewFilter=t,this.refresh(),this.data.length},e.prototype.refresh=function(){var t;this.clear();var e=this.parent.data.filter(this.viewFilter);(t=this).push.apply(t,e)},e}(o),s=function(e){e&&(this.data=e),this.updateEvent=new t,this.updateEventOnKey=new Map};s.prototype.pick=function(t,e){var o,r=new n(null===(o=this.data)||void 0===o?void 0:o[t]);return this.listenOnKey(t,function(t){r.update(t.newValue)},e),r},s.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},s.prototype.listenOnKeyAndRepeat=function(t,e,n){return e({key:t,newValue:this.data[t],oldValue:void 0}),this.listenOnKey(t,e,n)},s.prototype.listenOnKey=function(e,n,o){return this.updateEventOnKey.has(e)||this.updateEventOnKey.set(e,new t),this.updateEventOnKey.get(e).subscribe(n,o).cancel},s.prototype.get=function(t){return this.data[t]},s.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]})}},s.prototype.assign=function(t){for(var e=0,n=Object.keys(t);e<n.length;e+=1){var o=n[e];this.set(o,t[o])}},s.prototype.toObject=function(){return Object.assign({},this.data)},s.prototype.toDataSource=function(){var t=this,e=new n(this.data);return this.listen(function(n){e.update(t.data)}),e};var u=Symbol("owner"),p=function(t){var e=this;this.node=this.create(t),t instanceof n&&t.listen(function(t){e.node&&(e.node.textContent=t)})};p.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},p.prototype.create=function(t){var e=document.createTextNode(this.resolveStringSource(t));return e[u]=this,e},p.prototype.remove=function(){this.hasParent()&&this.node.parentElement[u].removeChild(this.node)},p.prototype.hasParent=function(){return!!this.node.parentElement};var l=Symbol("AurumElementModel"),h={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"},d=["id","name","draggable","tabindex","style","role","contentEditable"];function f(t){return t&&t[l]?f(t.constructor(t.props,t.innerNodes)):t}var v=function(t,e,n){var o,r;this.node=this.create(n),this.children=[],null!=t&&(t.onAttach&&(this.onAttach=t.onAttach,this.needAttach=!0),this.onDetach=t.onDetach,this.initialize(t),null===(r=(o=t).onCreate)||void 0===r||r.call(o,this.node)),e&&this.addChildren(e)};v.prototype.initialize=function(t){this.createEventHandlers(h,t);var e=Object.keys(t).filter(function(t){return t.includes("-")});this.bindProps(d,t,e),t.class&&this.handleClass(t.class)},v.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,c=n;a<c.length;a+=1){var s=c[a];e[s]&&this.assignStringSourceToAttribute(e[s],s)}},v.prototype.createEventHandlers=function(t,e){var o=this,r=function(r){e[t[r]]&&(e[t[r]]instanceof n?o.node.addEventListener(r,function(n){return e[t[r]].update(n)}):"function"==typeof e[t[r]]&&o.node.addEventListener(r,function(n){return e[t[r]](n)}))};for(var i in t)r(i)},v.prototype.render=function(){for(var t=0,e=0;e<this.children.length;e++,t++)this.children[e]instanceof y?t=this.renderFragment(this.children[e],t):this.renderChild(this.children[e],t);for(;this.node.childNodes.length>t;)this.node.removeChild(this.node.childNodes[this.node.childNodes.length-1])},v.prototype.renderFragment=function(t,e){for(var n=0;n<t.children.length;n++,e++)t.children[n]instanceof y?e=this.renderFragment(t.children[n],e):this.renderChild(t.children[n],e);return--e},v.prototype.renderChild=function(t,e){if(this.node.childNodes.length<=e)return this.addChildDom(t);if(this.node.childNodes[e][u]!==t){var n=this.getChildIndex(t.node);-1!==n?this.swapChildrenDom(e,n):this.addDomNodeAt(t.node,e)}},v.prototype.assignStringSourceToAttribute=function(t,e){var n=this;"string"==typeof t||"boolean"==typeof t?this.node.setAttribute(e,t):(t.value&&this.node.setAttribute(e,t.value),t.unique().listen(function(t){return n.node.setAttribute(e,t)}))},v.prototype.handleAttach=function(t){var e,n,o,r;if(this.needAttach)if(t.isConnected()){null===(e=this.onAttach)||void 0===e||e.call(this,this.node);for(var i=0,a=this.node.childNodes;i<a.length;i+=1)null===(r=null===(n=a[i][u])||void 0===n?void 0:(o=n).handleAttach)||void 0===r||r.call(o,this)}else t.needAttach=!0},v.prototype.handleDetach=function(){var t,e,n;if(!this.node.isConnected){null===(t=this.onDetach)||void 0===t||t.call(this,this.node);for(var o=0,r=this.node.childNodes;o<r.length;o+=1){var i=r[o];i[u]&&(null===(n=(e=i[u]).handleDetach)||void 0===n||n.call(e))}}},v.prototype.handleClass=function(t){var e=this;if("string"==typeof t)this.node.className=t;else if(t instanceof n)t.value&&(Array.isArray(t.value)?(this.node.className=t.value.join(" "),t.unique().listen(function(){e.node.className=t.value.join(" ")})):(this.node.className=t.value,t.unique().listen(function(){e.node.className=t.value}))),t.unique().listen(function(t){return e.node.className=t});else{var o=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");this.node.className=o;for(var r=0,i=t;r<i.length;r+=1){var a=i[r];a instanceof n&&a.unique().listen(function(n){var o=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");e.node.className=o})}}},v.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},v.prototype.create=function(t){var e=document.createElement(t);return e[u]=this,e},v.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},v.prototype.hasChild=function(t){for(var e=0,n=t.children;e<n.length;e+=1)if(n[e]===t)return!0;return!1},v.prototype.addChildDom=function(t){var e,n;this.node.appendChild(t.node),null===(n=(e=t).handleAttach)||void 0===n||n.call(e,this)},v.prototype.swapChildrenDom=function(t,e){if(t!==e){var n=this.node.children[t],o=this.node.children[e];n.remove(),o.remove(),t<e?(this.addDomNodeAt(o,t),this.addDomNodeAt(n,e)):(this.addDomNodeAt(n,e),this.addDomNodeAt(o,t))}},v.prototype.addDomNodeAt=function(t,e){var n,o,r,i;e>=this.node.childElementCount?(this.node.appendChild(t),null===(o=(n=t[u]).handleAttach)||void 0===o||o.call(n,this)):(this.node.insertBefore(t,this.node.children[e]),null===(i=(r=t[u]).handleAttach)||void 0===i||i.call(r,this))},v.prototype.remove=function(){this.hasParent()&&this.node.parentElement[u].removeChild(this.node)},v.prototype.hasParent=function(){return!!this.node.parentElement},v.prototype.isConnected=function(){return this.node.isConnected},v.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1),this.render()},v.prototype.removeChildAt=function(t){this.children.splice(t,1),this.render()},v.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()}},v.prototype.clearChildren=function(){this.children.length=0,this.render()},v.prototype.addChild=function(t){if(null!=t&&(!t[l]||void 0!==(t=f(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()},v.prototype.childNodeToAurum=function(t){var e=this;if(t instanceof v)return t;if(t instanceof Promise){var r=new y({});return t.then(function(t){r.addChildren([t]),e.render()}),r}if(t instanceof o){var i=new y({repeatModel:t});return i.onChange.subscribe(function(){return e.render()}),i}if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return new p(t.toString());if(t instanceof n){var a=new y({},[t]);return a.onChange.subscribe(function(){return e.render()}),a}throw new Error("Unsupported child type")},v.prototype.addChildAt=function(t,e){this.children.splice(e,0,this.childNodeToAurum(t)),this.render()},v.prototype.addChildren=function(t){if(0!==t.length)for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e])};var y=function(e,n){this.onChange=new t,this.children=[],e.repeatModel?this.handleRepeat(e.repeatModel):n&&this.addChildren(n)};y.prototype.addChildren=function(t){for(var e=this,o=function(){var t=i[r],o=void 0;if((o=t[l]?f(t):t)instanceof v)e.children.push(o);else{if(!(o instanceof n))throw new Error("case not yet implemented");var a=void 0,c=void 0,s={ts:void 0};o.unique().listenAndRepeat(function(t){if(s.ts=Date.now(),null==t&&c)return e.children.length=0,e.onChange.fire(),void(c=!1);if(!Array.isArray(t)&&c&&(e.children.length=0,e.onChange.fire(),c=!1),Array.isArray(t)){c=!0,e.children.length=0,e.onChange.fire();for(var n=0,r=t;n<r.length;n+=1)e.handleSourceChild(r[n],void 0,void 0,s,s.ts)}else a=e.handleSourceChild(t,a,o,s,s.ts)})}},r=0,i=t;r<i.length;r+=1)o()},y.prototype.handleSourceChild=function(t,e,r,i,a){var c=this;if(null!=t){if(t[l]&&(t=f(t)),"string"==typeof t||"bigint"==typeof t||"number"==typeof t||"boolean"==typeof t)if(e){if(e instanceof v){var s=new p(null!=r?r:t);this.children.splice(this.children.indexOf(e),1,s),e=s,this.onChange.fire()}}else{var u=new p(null!=r?r:t);this.children.push(u),e=u,this.onChange.fire()}else if(t instanceof v)t!==e&&(e?this.children.splice(this.children.indexOf(e),1,t):this.children.push(t),e=t,this.onChange.fire());else if(t instanceof Promise)t.then(function(t){i.ts===a&&(c.addChildren([t]),c.onChange.fire())});else if(t instanceof n)if(e){if(e!==t){var h=new y({},[t]);h.onChange.subscribe(function(){return c.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,h),e=h,this.onChange.fire()}}else{var d=new y({},[t]);e=d,this.children.push(d),d.onChange.subscribe(function(){return c.onChange.fire()}),this.onChange.fire()}else if(t instanceof o)if(e){if(e!==t){var b=new y({repeatModel:t});b.onChange.subscribe(function(){return c.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,b),e=b,this.onChange.fire()}}else{var _=new y({repeatModel:t});e=_,this.children.push(_),_.onChange.subscribe(function(){return c.onChange.fire()}),this.onChange.fire()}return e}e&&(this.children.splice(this.children.indexOf(e),1),e=void 0,this.onChange.fire())},y.prototype.handleRepeat=function(t){var e=this;t.listenAndRepeat(function(t){var n;switch(t.operationDetailed){case"replace":e.children[t.index]=f(t.items[0]);break;case"swap":var o=e.children[t.index2];e.children[t.index2]=e.children[t.index],e.children[t.index]=o;break;case"append":e.children=e.children.concat(t.items.map(f));break;case"prepend":(n=e.children).unshift.apply(n,t.items.map(f));break;case"remove":case"removeLeft":case"removeRight":e.children.splice(t.index,t.count);break;case"clear":e.children=[];break;default:throw new Error("unhandled operation")}e.onChange.fire()})};var b=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}(v),_=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}(v),g={input:"onInput",change:"onChange"},m=["placeholder","readonly","disabled","accept","alt","autocomplete","autofocus","checked","defaultChecked","formAction","formEnctype","formMethod","formNoValidate","formTarget","max","maxLength","min","minLength","pattern","multiple","required","type"],w=function(t){function e(e,n){var o,r=this;t.call(this,e,n,"input"),null!==e&&(e.inputValueSource?e.inputValueSource.unique().listenAndRepeat(function(t){return r.node.value=t}):this.node.value=null!=(o=e.initialValue)?o:"",this.bindProps(m,e),this.createEventHandlers(g,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(r.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),x=function(t){function e(e,n){t.call(this,e,n,"li")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),C=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}(v),O=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}(v),S=function(t){function e(e,n){t.call(this,e,n,"audio"),null!==e&&this.bindProps(["controls","autoplay","loop","muted","preload","src"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),A=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}(v),j=function(t){function e(e,n){t.call(this,e,n,"p")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),k=function(t){function e(e,n){t.call(this,e,n,"img"),null!==e&&this.bindProps(["src","alt","width","height","referrerPolicy","sizes","srcset","useMap"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),E=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}(v),N=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}(v),D=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}(v),P=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}(v),F=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}(v),R=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}(v),I=function(t){function e(e,n){t.call(this,e,n,"label"),null!==e&&this.bindProps(["for"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),L=function(t){function e(e,n){t.call(this,e,n,"ol")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),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}(v),V=function(t){function e(e,n){t.call(this,e,n,"progress"),null!==e&&this.bindProps(["max","value"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),M=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}(v),T=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}(v),K=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}(v),H=function(t){function e(e,n){t.call(this,e,n,"th")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),z={input:"onInput",change:"onChange"},U=["placeholder","readonly","disabled","rows","wrap","autocomplete","autofocus","max","maxLength","min","minLength","required","type"],B=function(t){function e(e,n){var o,r,i,a=this;t.call(this,e,n,"textArea"),null!==e&&(e.inputValueSource?(this.node.value=null!=(r=null!=(o=e.initialValue)?o:e.inputValueSource.value)?r:"",e.inputValueSource.unique().listen(function(t){return a.node.value=t})):this.node.value=null!=(i=e.initialValue)?i:"",this.bindProps(U,e),this.createEventHandlers(z,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(a.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),W=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}(v),G=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}(v),J=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}(v),Q=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}(v),X=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}(v),Y=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}(v),Z=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}(v),$=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}(v),tt=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}(v),et=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}(v),nt=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}(v),ot=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}(v),rt=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}(v),it=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}(v),at=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}(v),ct=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}(v),st=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}(v),ut=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}(v),pt=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}(v),lt=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}(v),ht={change:"onChange"},dt=function(t){function e(e,n){var o,r=this;t.call(this,e,n,"select"),null!==e&&(this.createEventHandlers(ht,e),this.initialSelection=e.initialSelection,e.selectedIndexSource?(this.selectedIndexSource=e.selectedIndexSource,e.selectedIndexSource.unique().listenAndRepeat(function(t){return r.node.selectedIndex=t})):this.node.selectedIndex=null!=(o=e.initialSelection)?o:-1,e.selectedIndexSource&&(this.needAttach=!0,this.node.addEventListener("change",function(){e.selectedIndexSource.update(r.node.selectedIndex)})))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleAttach=function(e){t.prototype.handleAttach.call(this,e),this.node.isConnected&&(this.selectedIndexSource?this.node.selectedIndex=this.selectedIndexSource.value:void 0!==this.initialSelection&&(this.node.selectedIndex=this.initialSelection))},e}(v),ft=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}(v),vt=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}(v),yt=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}(v),bt=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}(v),_t=function(t){function e(e,n){t.call(this,e,n,"tfoot")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),gt=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}(v),mt=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}(v),wt=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}(v),xt=function(t){function e(e,n){t.call(this,e,n,"sub")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),Ct=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}(v),Ot=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}(v),St=function(t){function e(e,n){t.call(this,e,n,"data"),null!==e&&this.bindProps(["datalue"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),At=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}(v),jt={button:_,div:b,input:w,li:x,span:C,style:O,ul:A,p:j,img:k,link:E,canvas:N,a:D,article:P,br:F,form:R,label:I,ol:L,pre:q,progress:V,table:M,td:T,tr:K,th:H,textarea:B,h1:W,h2:G,h3:J,h4:Q,h5:X,h6:Y,header:Z,footer:$,nav:tt,b:et,i:nt,script:ot,abbr:rt,area:it,aside:at,audio:S,em:ct,heading:st,iframe:ut,noscript:pt,option:function(t){function e(e,n){t.call(this,e,n,"option")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(v),q:lt,select:dt,source:ft,title:vt,video:yt,tbody:bt,tfoot:_t,thead:gt,summary:mt,details:wt,sub:xt,sup:Ct,svg:Ot,data:St,time:At,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}(v)},kt=function(){};kt.attach=function(t,e){var n=f(t);if(e[u])throw new Error("This node is already managed by aurum and cannot be used");if(!(n instanceof v))throw new Error("Root node of aurum application must be a single dom node");e.appendChild(n.node),n.handleAttach(n),e[u]=n},kt.isAttached=function(t){return void 0!==t[u]},kt.detach=function(t){t[u]&&(t[u].node.remove(),t[u].handleDetach(),t[u]=void 0)},kt.factory=function(t,e){for(var n,o,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];if("string"==typeof t){var a=t;if(void 0===(t=jt[t]))throw new Error("Node "+a+" does not exist or is not supported")}return Object.getPrototypeOf(t)===v?((n={})[l]=!0,n.constructor=function(e,n){return new t(e,n)},n.props=e,n.innerNodes=r,n):((o={})[l]=!0,o.constructor=t,o.props=e,o.innerNodes=r,o)};var Et=function(t){this.data=t};Et.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)}},Et.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 Nt=function(t){var e=this;void 0===t&&(t=[]),this.length=0,t.forEach(function(t){return e.append(t)})};Nt.prototype.find=function(t){for(var e=this.rootNode;e&&!t(e);)e=e.next;return e},Nt.prototype.append=function(t){return this.rootNode||this.lastNode?(this.lastNode.next=new Et(t),this.lastNode.next.previous=this.lastNode,this.lastNode=this.lastNode.next):this.rootNode=this.lastNode=new Et(t),this.length++,t},Nt.prototype.forEach=function(t){this.find(function(e){return t(e.data),!1})},Nt.prototype.prepend=function(t){return this.rootNode||this.lastNode?(this.rootNode.previous=new Et(t),this.rootNode.previous.next=this.rootNode,this.rootNode=this.rootNode.previous):this.rootNode=this.lastNode=new Et(t),this.length++,t},Nt.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 Dt=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.cancelables=new Nt(t),this._isCancelled=!1},Pt={isCanceled:{configurable:!0}};Pt.isCanceled.get=function(){return this._isCancelled},Dt.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},Dt.prototype.removeCancelable=function(t){return this.throwIfCancelled("attempting to remove cancellable from token that is already cancelled"),this.cancelables.remove(t),this},Dt.prototype.addDisposable=function(t){return this.addCancelable(function(){return t.dispose()}),this},Dt.prototype.callIfNotCancelled=function(t){this.isCanceled||t()},Dt.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)},Dt.prototype.setInterval=function(t,e){var n=setInterval(t,e);this.addCancelable(function(){return clearInterval(n)})},Dt.prototype.requestAnimationFrame=function(t){var e=requestAnimationFrame(t);this.addCancelable(function(){return cancelAnimationFrame(e)})},Dt.prototype.animationLoop=function(t){var e=requestAnimationFrame(function n(o){t(o),e=requestAnimationFrame(n)});this.addCancelable(function(){return cancelAnimationFrame(e)})},Dt.prototype.throwIfCancelled=function(t){if(this.isCanceled)throw new Error(t||"cancellation token is cancelled")},Dt.prototype.chain=function(t,e){return void 0===e&&(e=!1),e&&t.chain(this,!1),this.addCancelable(function(){return t.cancel()}),this},Dt.prototype.registerDomEvent=function(t,e,n){return t.addEventListener(e,n),this.addCancelable(function(){return t.removeEventListener(e,n)}),this},Dt.prototype.cancel=function(){this.isCanceled||(this._isCancelled=!0,this.cancelables.forEach(function(t){return t()}),this.cancelables=void 0)},Object.defineProperties(Dt.prototype,Pt);var Ft=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}(v),Rt=Symbol("route");function It(){var t=location.hash.substring(1);return t.includes("?")?t.substring(0,t.indexOf("?")):t.includes("#")?t.substring(0,t.indexOf("#")):t}var Lt=Symbol("switchCase");exports.DataSource=n,exports.ArrayDataSource=o,exports.MappedArrayView=i,exports.SortedArrayView=a,exports.FilteredArrayView=c,exports.ObjectDataSource=s,exports.Aurum=kt,exports.CancellationToken=Dt,exports.Custom=Ft,exports.AurumRouter=function(t,e){if((e=e.map(f)).some(function(t){return!t[Rt]}))throw new Error("Aurum Router only accepts Route and DefaultRoute instances as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default routes only 0 or 1 allowed");var o=new n(It());return window.addEventListener("hashchange",function(){o.update(It())}),o.unique().map(function(t){return function(t,e){var n,o;if(null==t)return null===(n=e.find(function(t){return t.default}))||void 0===n?void 0:n.content;if(e.find(function(e){return e.href===t}))return e.find(function(e){return e.href===t}).content;var r=t.split("/");r.pop();for(var i=function(){var t=r.join("/");if(e.find(function(e){return e.href===t}))return{v:e.find(function(e){return e.href===t}).content};r.pop()};r.length;){var a=i();if(a)return a.v}return null===(o=e.find(function(t){return t.default}))||void 0===o?void 0:o.content}(t,e)})},exports.Route=function(t,e){var n;return(n={})[Rt]=!0,n.content=e,n.default=!1,n.href=t.href,n},exports.DefaultRoute=function(t,e){var n;return(n={})[Rt]=!0,n.content=e,n.default=!0,n.href=void 0,n},exports.Suspense=function(t,e){var o=new n(t.fallback);return Promise.all(e.map(f)).then(function(){o.update(e)}),o},exports.Switch=function(t,e){if((e=e.map(f)).some(function(t){return!t[Lt]}))throw new Error("Switch only accepts SwitchCase as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default switch cases only 0 or 1 allowed");return t.state.unique().map(function(t){return function(t,e){var n,o,r;return null!==(o=null===(n=e.find(function(e){return e.value===t}))||void 0===n?void 0:n.content)&&void 0!==o?o:null===(r=e.find(function(t){return t.default}))||void 0===r?void 0:r.content}(t,e)})},exports.SwitchCase=function(t,e){var n;return(n={})[Lt]=!0,n.content=e,n.default=!1,n.value=t.when,n},exports.DefaultSwitchCase=function(t,e){var n;return(n={})[Lt]=!0,n.content=e,n.default=!0,n.value=void 0,n},exports.aurumElementModelIdentitiy=l,exports.buildRenderableFromModel=f,exports.AurumElement=v,exports.AurumFragment=y;
//# sourceMappingURL=aurumjs.js.map

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.aurum={})}(this,function(t){var e=function(){this.subscribeChannel=[],this.onAfterFire=[]},n={subscriptions:{configurable:!0}};n.subscriptions.get=function(){return this.subscribeChannel.length},e.prototype.subscribe=function(t,e){return this.createSubscription(t,this.subscribeChannel,e).facade},e.prototype.hasSubscriptions=function(){return this.subscriptions>0},e.prototype.cancelAll=function(){var t=this;this.isFiring?this.onAfterFire.push(function(){return t.subscribeChannel.length=0}):this.subscribeChannel.length=0},e.prototype.fireFiltered=function(t,e){this.isFiring=!0;for(var n=this.subscribeChannel.length,o=0;o<n;o++)this.subscribeChannel[o].callback!==e&&this.subscribeChannel[o].callback(t);this.isFiring=!1,this.afterFire()},e.prototype.afterFire=function(){this.onAfterFire.length>0&&(this.onAfterFire.forEach(function(t){return t()}),this.onAfterFire.length=0)},e.prototype.fire=function(t){this.isFiring=!0;for(var e=this.subscribeChannel.length,n=0;n<e;n++)this.subscribeChannel[n].callback(t);this.isFiring=!1,this.afterFire()},e.prototype.createSubscription=function(t,e,n){var o=this,r={callback:t},i={cancel:function(){o.cancel(r,e)}};return void 0!==n&&n.addCancelable(function(){return o.cancel(r,e)}),e.push(r),{subscription:r,facade:i}},e.prototype.cancel=function(t,e){var n=this,o=e.indexOf(t);o>=0&&(this.isFiring?this.onAfterFire.push(function(){return n.cancel(t,e)}):e.splice(o,1))},Object.defineProperties(e.prototype,n);var o=function(t){this.value=t,this.updateEvent=new e};o.prototype.update=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateEvent.fire(t),this.updating=!1},o.prototype.backPropagate=function(t,e){this.value=e,this.updating=!0,this.updateEvent.fireFiltered(e,t),this.updating=!1},o.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},o.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},o.prototype.filter=function(t,e){var n=new o;return this.listen(function(e){t(e)&&n.update(e)},e),n},o.prototype.filterDuplex=function(t,e){var n=this,r=new o,i=function(e){t(e)&&r.backPropagate(a,e)},a=function(e){t(e)&&n.backPropagate(i,e)};return this.listen(i,e),r.listen(a,e),r},o.prototype.pipe=function(t,e){this.listen(function(e){return t.update(e)},e)},o.prototype.pipeDuplex=function(t,e){var n=this,o=function(e){return t.backPropagate(r,e)},r=function(t){return n.backPropagate(o,t)};this.listen(o,e),t.listen(r,e)},o.prototype.map=function(t,e){var n=new o(t(this.value));return this.listen(function(e){n.update(t(e))},e),n},o.prototype.mapDuplex=function(t,e,n){var r=this,i=new o(t(this.value)),a=function(e){return i.backPropagate(c,t(e))},c=function(t){return r.backPropagate(a,e(t))};return this.listen(a,n),i.listen(c,n),i},o.prototype.unique=function(t){var e=new o(this.value);return this.listen(function(t){t!==e.value&&e.update(t)},t),e},o.prototype.uniqueDuplex=function(t){var e=this,n=new o(this.value),r=function(t){t!==n.value&&n.backPropagate(i,t)},i=function(t){t!==e.value&&e.backPropagate(r,t)};return this.listen(r,t),n.listen(i,t),n},o.prototype.reduce=function(t,e,n){var r=new o(e);return this.listen(function(e){return r.update(t(r.value,e))},n),r},o.prototype.aggregate=function(t,e,n){var r=this,i=new o(e(this.value,t.value));return this.listen(function(){return i.update(e(r.value,t.value))},n),t.listen(function(){return i.update(e(r.value,t.value))},n),i},o.prototype.combine=function(t,e){var n=new o;return this.pipe(n,e),t.pipe(n,e),n},o.prototype.debounce=function(t,e){var n,r=new o(this.value);return this.listen(function(e){clearTimeout(n),n=setTimeout(function(){r.update(e)},t)},e),r},o.prototype.buffer=function(t,e){var n,r=new o,i=[];return this.listen(function(e){i.push(e),n||(n=setTimeout(function(){n=void 0,r.update(i),i=[]},t))},e),r},o.prototype.queue=function(t){var e=new r;return this.listen(function(t){e.push(t)},t),e},o.prototype.pick=function(t,e){var n,r=new o(null===(n=this.value)||void 0===n?void 0:n[t]);return this.listen(function(e){r.update(null!=e?e[t]:e)},e),r},o.prototype.cancelAll=function(){this.updateEvent.cancelAll()};var r=function(t){this.data=t?t.slice():[],this.lengthSource=new o(this.data.length).unique(),this.updateEvent=new e},i={length:{configurable:!0}};r.prototype.listenAndRepeat=function(t,e){return t({operation:"add",operationDetailed:"append",index:0,items:this.data,newState:this.data,count:this.data.length}),this.listen(t,e)},r.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},i.length.get=function(){return this.lengthSource},r.prototype.getData=function(){return this.data.slice()},r.prototype.get=function(t){return this.data[t]},r.prototype.set=function(t,e){var n=this.data[t];n!==e&&(this.data[t]=e,this.update({operation:"replace",operationDetailed:"replace",target:n,count:1,index:t,items:[e],newState:this.data}),this.lengthSource.update(this.data.length))},r.prototype.swap=function(t,e){if(t!==e){var n=this.data[t],o=this.data[e];this.data[e]=n,this.data[t]=o,this.update({operation:"swap",operationDetailed:"swap",index:t,index2:e,items:[n,o],newState:this.data}),this.lengthSource.update(this.data.length)}},r.prototype.swapItems=function(t,e){if(t!==e){var n=this.data.indexOf(t),o=this.data.indexOf(e);-1!==n&&-1!==o&&(this.data[o]=t,this.data[n]=e),this.update({operation:"swap",operationDetailed:"swap",index:n,index2:o,items:[t,e],newState:this.data}),this.lengthSource.update(this.data.length)}},r.prototype.appendArray=function(t){var e=this.data;this.data=new Array(e.length);var n=0;for(n=0;n<e.length;n++)this.data[n]=e[n];for(var o=0;o<t.length;o++)this.data[n+o]=t[o];this.update({operation:"add",operationDetailed:"append",count:t.length,index:this.data.length-t.length,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.push=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.appendArray(t),this.lengthSource.update(this.data.length)},r.prototype.unshift=function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];(t=this.data).unshift.apply(t,e),this.update({operation:"add",operationDetailed:"prepend",count:e.length,items:e,index:0,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.pop=function(){var t=this.data.pop();return this.update({operation:"remove",operationDetailed:"removeRight",count:1,index:this.data.length,items:[t],newState:this.data}),this.lengthSource.update(this.data.length),t},r.prototype.merge=function(t){for(var e=0;e<t.length;e++)this.data[e]!==t[e]&&(this.data.length>e?this.set(e,t[e]):this.push(t[e]));this.data.length>t.length&&this.removeRight(this.data.length-t.length),this.lengthSource.update(this.data.length)},r.prototype.removeRight=function(t){var e=this.data.length,n=this.data.splice(e-t,t);this.update({operation:"remove",operationDetailed:"removeRight",count:t,index:e-t,items:n,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.removeLeft=function(t){var e=this.data.splice(0,t);this.update({operation:"remove",operationDetailed:"removeLeft",count:t,index:0,items:e,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.remove=function(t){var e=this.data.indexOf(t);-1!==e&&(this.data.splice(e,1),this.update({operation:"remove",operationDetailed:"remove",count:1,index:e,items:[t],newState:this.data}),this.lengthSource.update(this.data.length))},r.prototype.clear=function(){var t=this.data;this.data=[],this.update({operation:"remove",operationDetailed:"clear",count:t.length,index:0,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.shift=function(){var t=this.data.shift();return this.update({operation:"remove",operationDetailed:"removeLeft",items:[t],count:1,index:0,newState:this.data}),this.lengthSource.update(this.data.length),t},r.prototype.toArray=function(){return this.data.slice()},r.prototype.sort=function(t,e){return new c(this,t,e)},r.prototype.map=function(t,e){return new a(this,t,e)},r.prototype.filter=function(t,e){return new s(this,t,e)},r.prototype.forEach=function(t){return this.data.forEach(t)},r.prototype.toDataSource=function(){var t=new o(this.data);return this.listen(function(e){t.update(e.newState)}),t},r.prototype.update=function(t){this.updateEvent.fire(t)},Object.defineProperties(r.prototype,i);var a=function(t){function e(e,n,o){var r=this,i=e.getData().map(n);t.call(this,i),this.mapper=n,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(r.data[t.index]);break;case"clear":r.clear();break;case"prepend":(e=r).unshift.apply(e,t.items.map(r.mapper));break;case"append":r.appendArray(t.items.map(r.mapper));break;case"swap":r.swap(t.index,t.index2);break;case"replace":r.set(t.index,r.mapper(t.items[0]))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(r),c=function(t){function e(e,n,o){var r=this,i=e.getData().sort(n);t.call(this,i),this.comparator=n,e.listen(function(t){var e,n;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(t.items[0]);break;case"clear":r.data.length=0;break;case"prepend":(e=r).unshift.apply(e,t.items),r.data.sort(r.comparator);break;case"append":(n=r).push.apply(n,t.items),r.data.sort(r.comparator);break;case"swap":break;case"replace":r.set(t.index,t.items[0]),r.data.sort(r.comparator)}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(r),s=function(t){function e(e,n,o){var r=this;Array.isArray(e)&&(e=new t(e));var i=e.data.filter(n=null!=n?n:function(){return!0});t.call(this,i),this.parent=e,this.viewFilter=n,e.listen(function(t){var e,n,o;switch(t.operationDetailed){case"clear":r.clear();break;case"removeLeft":case"removeRight":case"remove":for(var i=0,a=t.items;i<a.length;i+=1)r.remove(a[i]);break;case"prepend":o=t.items.filter(r.viewFilter),(e=r).unshift.apply(e,o);break;case"append":o=t.items.filter(r.viewFilter),(n=r).push.apply(n,o);break;case"swap":var c=r.data.indexOf(t.items[0]),s=r.data.indexOf(t.items[1]);-1!==c&&-1!==s&&r.swap(c,s);break;case"replace":var u=r.data.indexOf(t.target);-1!==u&&(r.viewFilter(t.items[0])?r.set(u,t.items[0]):r.remove(t.target))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.updateFilter=function(t){if(this.viewFilter!==t)return this.viewFilter=t,this.refresh(),this.data.length},e.prototype.refresh=function(){var t;this.clear();var e=this.parent.data.filter(this.viewFilter);(t=this).push.apply(t,e)},e}(r),u=function(t){t&&(this.data=t),this.updateEvent=new e,this.updateEventOnKey=new Map};u.prototype.pick=function(t,e){var n,r=new o(null===(n=this.data)||void 0===n?void 0:n[t]);return this.listenOnKey(t,function(t){r.update(t.newValue)},e),r},u.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},u.prototype.listenOnKeyAndRepeat=function(t,e,n){return e({key:t,newValue:this.data[t],oldValue:void 0}),this.listenOnKey(t,e,n)},u.prototype.listenOnKey=function(t,n,o){return this.updateEventOnKey.has(t)||this.updateEventOnKey.set(t,new e),this.updateEventOnKey.get(t).subscribe(n,o).cancel},u.prototype.get=function(t){return this.data[t]},u.prototype.set=function(t,e){if(this.data[t]!==e){var n=this.data[t];this.data[t]=e,this.updateEvent.fire({oldValue:n,key:t,newValue:this.data[t]}),this.updateEventOnKey.has(t)&&this.updateEventOnKey.get(t).fire({oldValue:n,key:t,newValue:this.data[t]})}},u.prototype.assign=function(t){for(var e=0,n=Object.keys(t);e<n.length;e+=1){var o=n[e];this.set(o,t[o])}},u.prototype.toObject=function(){return Object.assign({},this.data)},u.prototype.toDataSource=function(){var t=this,e=new o(this.data);return this.listen(function(n){e.update(t.data)}),e};var l=Symbol("owner"),p=function(t){var e=this;this.node=this.create(t),t instanceof o&&t.listen(function(t){e.node&&(e.node.textContent=t)})};p.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},p.prototype.create=function(t){var e=document.createTextNode(this.resolveStringSource(t));return e[l]=this,e},p.prototype.remove=function(){this.hasParent()&&this.node.parentElement[l].removeChild(this.node)},p.prototype.hasParent=function(){return!!this.node.parentElement};var h=Symbol("AurumElementModel"),d={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"},f=["id","name","draggable","tabindex","style","role","contentEditable"];function v(t){return t&&t[h]?v(t.constructor(t.props,t.innerNodes)):t}var y=function(t,e,n){var o,r;this.node=this.create(n),this.children=[],null!=t&&(t.onAttach&&(this.onAttach=t.onAttach,this.needAttach=!0),this.onDetach=t.onDetach,this.initialize(t),null===(r=(o=t).onCreate)||void 0===r||r.call(o,this.node)),e&&this.addChildren(e)};y.prototype.initialize=function(t){this.createEventHandlers(d,t);var e=Object.keys(t).filter(function(t){return t.includes("-")});this.bindProps(f,t,e),t.class&&this.handleClass(t.class)},y.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,c=n;a<c.length;a+=1){var s=c[a];e[s]&&this.assignStringSourceToAttribute(e[s],s)}},y.prototype.createEventHandlers=function(t,e){var n=this,r=function(r){e[t[r]]&&(e[t[r]]instanceof o?n.node.addEventListener(r,function(n){return e[t[r]].update(n)}):"function"==typeof e[t[r]]&&n.node.addEventListener(r,function(n){return e[t[r]](n)}))};for(var i in t)r(i)},y.prototype.render=function(){for(var t=0,e=0;e<this.children.length;e++,t++)this.children[e]instanceof b?t=this.renderFragment(this.children[e],t):this.renderChild(this.children[e],t);for(;this.node.childNodes.length>t;)this.node.removeChild(this.node.childNodes[this.node.childNodes.length-1])},y.prototype.renderFragment=function(t,e){for(var n=0;n<t.children.length;n++,e++)t.children[n]instanceof b?e=this.renderFragment(t.children[n],e):this.renderChild(t.children[n],e);return--e},y.prototype.renderChild=function(t,e){if(this.node.childNodes.length<=e)return this.addChildDom(t);if(this.node.childNodes[e][l]!==t){var n=this.getChildIndex(t.node);-1!==n?this.swapChildrenDom(e,n):this.addDomNodeAt(t.node,e)}},y.prototype.assignStringSourceToAttribute=function(t,e){var n=this;"string"==typeof t||"boolean"==typeof t?this.node.setAttribute(e,t):(t.value&&this.node.setAttribute(e,t.value),t.unique().listen(function(t){return n.node.setAttribute(e,t)}))},y.prototype.handleAttach=function(t){var e,n,o,r;if(this.needAttach)if(t.isConnected()){null===(e=this.onAttach)||void 0===e||e.call(this,this.node);for(var i=0,a=this.node.childNodes;i<a.length;i+=1)null===(r=null===(n=a[i][l])||void 0===n?void 0:(o=n).handleAttach)||void 0===r||r.call(o,this)}else t.needAttach=!0},y.prototype.handleDetach=function(){var t,e,n;if(!this.node.isConnected){null===(t=this.onDetach)||void 0===t||t.call(this,this.node);for(var o=0,r=this.node.childNodes;o<r.length;o+=1){var i=r[o];i[l]&&(null===(n=(e=i[l]).handleDetach)||void 0===n||n.call(e))}}},y.prototype.handleClass=function(t){var e=this;if("string"==typeof t)this.node.className=t;else if(t instanceof o)t.value&&(Array.isArray(t.value)?(this.node.className=t.value.join(" "),t.unique().listen(function(){e.node.className=t.value.join(" ")})):(this.node.className=t.value,t.unique().listen(function(){e.node.className=t.value}))),t.unique().listen(function(t){return e.node.className=t});else{var n=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");this.node.className=n;for(var r=0,i=t;r<i.length;r+=1){var a=i[r];a instanceof o&&a.unique().listen(function(n){var o=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");e.node.className=o})}}},y.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},y.prototype.create=function(t){var e=document.createElement(t);return e[l]=this,e},y.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},y.prototype.hasChild=function(t){for(var e=0,n=t.children;e<n.length;e+=1)if(n[e]===t)return!0;return!1},y.prototype.addChildDom=function(t){var e,n;this.node.appendChild(t.node),null===(n=(e=t).handleAttach)||void 0===n||n.call(e,this)},y.prototype.swapChildrenDom=function(t,e){if(t!==e){var n=this.node.children[t],o=this.node.children[e];n.remove(),o.remove(),t<e?(this.addDomNodeAt(o,t),this.addDomNodeAt(n,e)):(this.addDomNodeAt(n,e),this.addDomNodeAt(o,t))}},y.prototype.addDomNodeAt=function(t,e){var n,o,r,i;e>=this.node.childElementCount?(this.node.appendChild(t),null===(o=(n=t[l]).handleAttach)||void 0===o||o.call(n,this)):(this.node.insertBefore(t,this.node.children[e]),null===(i=(r=t[l]).handleAttach)||void 0===i||i.call(r,this))},y.prototype.remove=function(){this.hasParent()&&this.node.parentElement[l].removeChild(this.node)},y.prototype.hasParent=function(){return!!this.node.parentElement},y.prototype.isConnected=function(){return this.node.isConnected},y.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1),this.render()},y.prototype.removeChildAt=function(t){this.children.splice(t,1),this.render()},y.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()}},y.prototype.clearChildren=function(){this.children.length=0,this.render()},y.prototype.addChild=function(t){if(null!=t&&(!t[h]||void 0!==(t=v(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()},y.prototype.childNodeToAurum=function(t){var e=this;if(t instanceof y)return t;if(t instanceof Promise){var n=new b({});return t.then(function(t){n.addChildren([t]),e.render()}),n}if(t instanceof r){var i=new b({repeatModel:t});return i.onChange.subscribe(function(){return e.render()}),i}if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return new p(t.toString());if(t instanceof o){var a=new b({},[t]);return a.onChange.subscribe(function(){return e.render()}),a}throw new Error("Unsupported child type")},y.prototype.addChildAt=function(t,e){this.children.splice(e,0,this.childNodeToAurum(t)),this.render()},y.prototype.addChildren=function(t){if(0!==t.length)for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e])};var b=function(t,n){this.onChange=new e,this.children=[],t.repeatModel?this.handleRepeat(t.repeatModel):n&&this.addChildren(n)};b.prototype.addChildren=function(t){for(var e=this,n=function(){var t=i[r],n=void 0;if((n=t[h]?v(t):t)instanceof y)e.children.push(n);else{if(!(n instanceof o))throw new Error("case not yet implemented");var a=void 0,c=void 0,s={ts:void 0};n.unique().listenAndRepeat(function(t){if(s.ts=Date.now(),null==t&&c)return e.children.length=0,e.onChange.fire(),void(c=!1);if(!Array.isArray(t)&&c&&(e.children.length=0,e.onChange.fire(),c=!1),Array.isArray(t)){c=!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,s,s.ts)}else a=e.handleSourceChild(t,a,n,s,s.ts)})}},r=0,i=t;r<i.length;r+=1)n()},b.prototype.handleSourceChild=function(t,e,n,i,a){var c=this;if(null!=t){if(t[h]&&(t=v(t)),"string"==typeof t||"bigint"==typeof t||"number"==typeof t||"boolean"==typeof t)if(e){if(e instanceof y){var s=new p(null!=n?n:t);this.children.splice(this.children.indexOf(e),1,s),e=s,this.onChange.fire()}}else{var u=new p(null!=n?n:t);this.children.push(u),e=u,this.onChange.fire()}else if(t instanceof y)t!==e&&(e?this.children.splice(this.children.indexOf(e),1,t):this.children.push(t),e=t,this.onChange.fire());else if(t instanceof Promise)t.then(function(t){i.ts===a&&(c.addChildren([t]),c.onChange.fire())});else if(t instanceof o)if(e){if(e!==t){var l=new b({},[t]);l.onChange.subscribe(function(){return c.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,l),e=l,this.onChange.fire()}}else{var d=new b({},[t]);e=d,this.children.push(d),d.onChange.subscribe(function(){return c.onChange.fire()}),this.onChange.fire()}else if(t instanceof r)if(e){if(e!==t){var f=new b({repeatModel:t});f.onChange.subscribe(function(){return c.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,f),e=f,this.onChange.fire()}}else{var _=new b({repeatModel:t});e=_,this.children.push(_),_.onChange.subscribe(function(){return c.onChange.fire()}),this.onChange.fire()}return e}e&&(this.children.splice(this.children.indexOf(e),1),e=void 0,this.onChange.fire())},b.prototype.handleRepeat=function(t){var e=this;t.listenAndRepeat(function(t){var n;switch(t.operationDetailed){case"replace":e.children[t.index]=v(t.items[0]);break;case"swap":var o=e.children[t.index2];e.children[t.index2]=e.children[t.index],e.children[t.index]=o;break;case"append":e.children=e.children.concat(t.items.map(v));break;case"prepend":(n=e.children).unshift.apply(n,t.items.map(v));break;case"remove":case"removeLeft":case"removeRight":e.children.splice(t.index,t.count);break;case"clear":e.children=[];break;default:throw new Error("unhandled operation")}e.onChange.fire()})};var _=function(t){function e(e,n){t.call(this,e,n,"div")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),g=function(t){function e(e,n){t.call(this,e,n,"button"),null!==e&&this.bindProps(["disabled"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),m={input:"onInput",change:"onChange"},w=["placeholder","readonly","disabled","accept","alt","autocomplete","autofocus","checked","defaultChecked","formAction","formEnctype","formMethod","formNoValidate","formTarget","max","maxLength","min","minLength","pattern","multiple","required","type"],C=function(t){function e(e,n){var o,r=this;t.call(this,e,n,"input"),null!==e&&(e.inputValueSource?e.inputValueSource.unique().listenAndRepeat(function(t){return r.node.value=t}):this.node.value=null!=(o=e.initialValue)?o:"",this.bindProps(w,e),this.createEventHandlers(m,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(r.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),O=function(t){function e(e,n){t.call(this,e,n,"li")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),x=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}(y),S=function(t){function e(e,n){t.call(this,e,n,"style"),null!==e&&this.bindProps(["media"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),A=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}(y),j=function(t){function e(e,n){t.call(this,e,n,"ul")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),k=function(t){function e(e,n){t.call(this,e,n,"p")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),E=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}(y),N=function(t){function e(e,n){t.call(this,e,n,"link"),null!==e&&this.bindProps(["href","rel","media","as","disabled","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),D=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}(y),P=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}(y),F=function(t){function e(e,n){t.call(this,e,n,"article")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),R=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}(y),I=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}(y),L=function(t){function e(e,n){t.call(this,e,n,"label"),null!==e&&this.bindProps(["for"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),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}(y),V=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}(y),M=function(t){function e(e,n){t.call(this,e,n,"progress"),null!==e&&this.bindProps(["max","value"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),T=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}(y),K=function(t){function e(e,n){t.call(this,e,n,"td")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),H=function(t){function e(e,n){t.call(this,e,n,"tr")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),z=function(t){function e(e,n){t.call(this,e,n,"th")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),U={input:"onInput",change:"onChange"},B=["placeholder","readonly","disabled","rows","wrap","autocomplete","autofocus","max","maxLength","min","minLength","required","type"],W=function(t){function e(e,n){var o,r,i,a=this;t.call(this,e,n,"textArea"),null!==e&&(e.inputValueSource?(this.node.value=null!=(r=null!=(o=e.initialValue)?o:e.inputValueSource.value)?r:"",e.inputValueSource.unique().listen(function(t){return a.node.value=t})):this.node.value=null!=(i=e.initialValue)?i:"",this.bindProps(B,e),this.createEventHandlers(U,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(a.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),G=function(t){function e(e,n){t.call(this,e,n,"h1")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),J=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}(y),Q=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}(y),X=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}(y),Y=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}(y),Z=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}(y),$=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}(y),tt=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}(y),et=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}(y),nt=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}(y),ot=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}(y),rt=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}(y),it=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}(y),at=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}(y),ct=function(t){function e(e,n){t.call(this,e,n,"aside")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),st=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}(y),ut=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}(y),lt=function(t){function e(e,n){t.call(this,e,n,"iframe"),null!==e&&this.bindProps(["src","srcdoc","width","height","allow","allowFullscreen","allowPaymentRequest"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),pt=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}(y),ht=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}(y),dt={change:"onChange"},ft=function(t){function e(e,n){var o,r=this;t.call(this,e,n,"select"),null!==e&&(this.createEventHandlers(dt,e),this.initialSelection=e.initialSelection,e.selectedIndexSource?(this.selectedIndexSource=e.selectedIndexSource,e.selectedIndexSource.unique().listenAndRepeat(function(t){return r.node.selectedIndex=t})):this.node.selectedIndex=null!=(o=e.initialSelection)?o:-1,e.selectedIndexSource&&(this.needAttach=!0,this.node.addEventListener("change",function(){e.selectedIndexSource.update(r.node.selectedIndex)})))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleAttach=function(e){t.prototype.handleAttach.call(this,e),this.node.isConnected&&(this.selectedIndexSource?this.node.selectedIndex=this.selectedIndexSource.value:void 0!==this.initialSelection&&(this.node.selectedIndex=this.initialSelection))},e}(y),vt=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}(y),yt=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}(y),bt=function(t){function e(e,n){t.call(this,e,n,"video"),null!==e&&this.bindProps(["controls","autoplay","loop","muted","preload","src","poster","width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),_t=function(t){function e(e,n){t.call(this,e,n,"tbody")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),gt=function(t){function e(e,n){t.call(this,e,n,"tfoot")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),mt=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}(y),wt=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}(y),Ct=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}(y),Ot=function(t){function e(e,n){t.call(this,e,n,"sub")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),xt=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}(y),St=function(t){function e(e,n){t.call(this,e,n,"svg"),null!==e&&this.bindProps(["width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),At=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}(y),jt=function(t){function e(e,n){t.call(this,e,n,"time"),null!==e&&this.bindProps(["datetime"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),kt={button:g,div:_,input:C,li:O,span:x,style:S,ul:j,p:k,img:E,link:N,canvas:D,a:P,article:F,br:R,form:I,label:L,ol:q,pre:V,progress:M,table:T,td:K,tr:H,th:z,textarea:W,h1:G,h2:J,h3:Q,h4:X,h5:Y,h6:Z,header:$,footer:tt,nav:et,b:nt,i:ot,script:rt,abbr:it,area:at,aside:ct,audio:A,em:st,heading:ut,iframe:lt,noscript:pt,option:function(t){function e(e,n){t.call(this,e,n,"option")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),q:ht,select:ft,source:vt,title:yt,video:bt,tbody:_t,tfoot:gt,thead:mt,summary:wt,details:Ct,sub:Ot,sup:xt,svg:St,data:At,time:jt,template:function(t){function e(e,n){t.call(this,e,n,"template")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y)},Et=function(){};Et.attach=function(t,e){var n=v(t);if(e[l])throw new Error("This node is already managed by aurum and cannot be used");if(!(n instanceof y))throw new Error("Root node of aurum application must be a single dom node");e.appendChild(n.node),n.handleAttach(n),e[l]=n},Et.isAttached=function(t){return void 0!==t[l]},Et.detach=function(t){t[l]&&(t[l].node.remove(),t[l].handleDetach(),t[l]=void 0)},Et.factory=function(t,e){for(var n,o,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];if("string"==typeof t){var a=t;if(void 0===(t=kt[t]))throw new Error("Node "+a+" does not exist or is not supported")}return Object.getPrototypeOf(t)===y?((n={})[h]=!0,n.constructor=function(e,n){return new t(e,n)},n.props=e,n.innerNodes=r,n):((o={})[h]=!0,o.constructor=t,o.props=e,o.innerNodes=r,o)};var Nt=function(t){this.data=t};Nt.prototype.deleteNext=function(){if(this.next){var t=this.next.next;this.next.next=void 0,this.next.previous=void 0,this.next=t,this.next&&(this.next.previous=this)}},Nt.prototype.deletePrevious=function(){if(this.previous){var t=this.previous.previous;this.previous.next=void 0,this.previous.previous=void 0,this.previous=t,this.previous&&(this.previous.next=this)}};var Dt=function(t){var e=this;void 0===t&&(t=[]),this.length=0,t.forEach(function(t){return e.append(t)})};Dt.prototype.find=function(t){for(var e=this.rootNode;e&&!t(e);)e=e.next;return e},Dt.prototype.append=function(t){return this.rootNode||this.lastNode?(this.lastNode.next=new Nt(t),this.lastNode.next.previous=this.lastNode,this.lastNode=this.lastNode.next):this.rootNode=this.lastNode=new Nt(t),this.length++,t},Dt.prototype.forEach=function(t){this.find(function(e){return t(e.data),!1})},Dt.prototype.prepend=function(t){return this.rootNode||this.lastNode?(this.rootNode.previous=new Nt(t),this.rootNode.previous.next=this.rootNode,this.rootNode=this.rootNode.previous):this.rootNode=this.lastNode=new Nt(t),this.length++,t},Dt.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 Pt=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.cancelables=new Dt(t),this._isCancelled=!1},Ft={isCanceled:{configurable:!0}};Ft.isCanceled.get=function(){return this._isCancelled},Pt.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},Pt.prototype.removeCancelable=function(t){return this.throwIfCancelled("attempting to remove cancellable from token that is already cancelled"),this.cancelables.remove(t),this},Pt.prototype.addDisposable=function(t){return this.addCancelable(function(){return t.dispose()}),this},Pt.prototype.callIfNotCancelled=function(t){this.isCanceled||t()},Pt.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)},Pt.prototype.setInterval=function(t,e){var n=setInterval(t,e);this.addCancelable(function(){return clearInterval(n)})},Pt.prototype.requestAnimationFrame=function(t){var e=requestAnimationFrame(t);this.addCancelable(function(){return cancelAnimationFrame(e)})},Pt.prototype.animationLoop=function(t){var e=requestAnimationFrame(function n(o){t(o),e=requestAnimationFrame(n)});this.addCancelable(function(){return cancelAnimationFrame(e)})},Pt.prototype.throwIfCancelled=function(t){if(this.isCanceled)throw new Error(t||"cancellation token is cancelled")},Pt.prototype.chain=function(t,e){return void 0===e&&(e=!1),e&&t.chain(this,!1),this.addCancelable(function(){return t.cancel()}),this},Pt.prototype.registerDomEvent=function(t,e,n){return t.addEventListener(e,n),this.addCancelable(function(){return t.removeEventListener(e,n)}),this},Pt.prototype.cancel=function(){this.isCanceled||(this._isCancelled=!0,this.cancelables.forEach(function(t){return t()}),this.cancelables=void 0)},Object.defineProperties(Pt.prototype,Ft);var Rt=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}(y),It=Symbol("route");function Lt(){var t=location.hash.substring(1);return t.includes("?")?t.substring(0,t.indexOf("?")):t.includes("#")?t.substring(0,t.indexOf("#")):t}var qt=Symbol("switchCase");t.DataSource=o,t.ArrayDataSource=r,t.MappedArrayView=a,t.SortedArrayView=c,t.FilteredArrayView=s,t.ObjectDataSource=u,t.Aurum=Et,t.CancellationToken=Pt,t.Custom=Rt,t.AurumRouter=function(t,e){if((e=e.map(v)).some(function(t){return!t[It]}))throw new Error("Aurum Router only accepts Route and DefaultRoute instances as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default routes only 0 or 1 allowed");var n=new o(Lt());return window.addEventListener("hashchange",function(){n.update(Lt())}),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={})[It]=!0,n.content=e,n.default=!1,n.href=t.href,n},t.DefaultRoute=function(t,e){var n;return(n={})[It]=!0,n.content=e,n.default=!0,n.href=void 0,n},t.Suspense=function(t,e){var n=new o(t.fallback);return Promise.all(e).then(function(){n.update(e)}),n},t.Switch=function(t,e){if((e=e.map(v)).some(function(t){return!t[qt]}))throw new Error("Switch only accepts SwitchCase as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default switch cases only 0 or 1 allowed");return t.state.unique().map(function(t){return function(t,e){var n,o,r;return null!==(o=null===(n=e.find(function(e){return e.value===t}))||void 0===n?void 0:n.content)&&void 0!==o?o:null===(r=e.find(function(t){return t.default}))||void 0===r?void 0:r.content}(t,e)})},t.SwitchCase=function(t,e){var n;return(n={})[qt]=!0,n.content=e,n.default=!1,n.value=t.when,n},t.DefaultSwitchCase=function(t,e){var n;return(n={})[qt]=!0,n.content=e,n.default=!0,n.value=void 0,n},t.aurumElementModelIdentitiy=h,t.buildRenderableFromModel=v,t.AurumElement=y,t.AurumFragment=b});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.aurum={})}(this,function(t){var e=function(){this.subscribeChannel=[],this.onAfterFire=[]},n={subscriptions:{configurable:!0}};n.subscriptions.get=function(){return this.subscribeChannel.length},e.prototype.subscribe=function(t,e){return this.createSubscription(t,this.subscribeChannel,e).facade},e.prototype.hasSubscriptions=function(){return this.subscriptions>0},e.prototype.cancelAll=function(){var t=this;this.isFiring?this.onAfterFire.push(function(){return t.subscribeChannel.length=0}):this.subscribeChannel.length=0},e.prototype.fireFiltered=function(t,e){this.isFiring=!0;for(var n=this.subscribeChannel.length,o=0;o<n;o++)this.subscribeChannel[o].callback!==e&&this.subscribeChannel[o].callback(t);this.isFiring=!1,this.afterFire()},e.prototype.afterFire=function(){this.onAfterFire.length>0&&(this.onAfterFire.forEach(function(t){return t()}),this.onAfterFire.length=0)},e.prototype.fire=function(t){this.isFiring=!0;for(var e=this.subscribeChannel.length,n=0;n<e;n++)this.subscribeChannel[n].callback(t);this.isFiring=!1,this.afterFire()},e.prototype.createSubscription=function(t,e,n){var o=this,r={callback:t},i={cancel:function(){o.cancel(r,e)}};return void 0!==n&&n.addCancelable(function(){return o.cancel(r,e)}),e.push(r),{subscription:r,facade:i}},e.prototype.cancel=function(t,e){var n=this,o=e.indexOf(t);o>=0&&(this.isFiring?this.onAfterFire.push(function(){return n.cancel(t,e)}):e.splice(o,1))},Object.defineProperties(e.prototype,n);var o=function(t){this.value=t,this.updateEvent=new e};o.prototype.update=function(t){if(this.updating)throw new Error("Problem in datas source: Unstable value propagation, when updating a value the stream was updated back as a direct response. This can lead to infinite loops and is therefore not allowed");this.updating=!0,this.value=t,this.updateEvent.fire(t),this.updating=!1},o.prototype.backPropagate=function(t,e){this.value=e,this.updating=!0,this.updateEvent.fireFiltered(e,t),this.updating=!1},o.prototype.listenAndRepeat=function(t,e){return t(this.value),this.listen(t,e)},o.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},o.prototype.filter=function(t,e){var n=new o;return this.listen(function(e){t(e)&&n.update(e)},e),n},o.prototype.filterDuplex=function(t,e){var n=this,r=new o,i=function(e){t(e)&&r.backPropagate(a,e)},a=function(e){t(e)&&n.backPropagate(i,e)};return this.listen(i,e),r.listen(a,e),r},o.prototype.pipe=function(t,e){this.listen(function(e){return t.update(e)},e)},o.prototype.pipeDuplex=function(t,e){var n=this,o=function(e){return t.backPropagate(r,e)},r=function(t){return n.backPropagate(o,t)};this.listen(o,e),t.listen(r,e)},o.prototype.map=function(t,e){var n=new o(t(this.value));return this.listen(function(e){n.update(t(e))},e),n},o.prototype.mapDuplex=function(t,e,n){var r=this,i=new o(t(this.value)),a=function(e){return i.backPropagate(c,t(e))},c=function(t){return r.backPropagate(a,e(t))};return this.listen(a,n),i.listen(c,n),i},o.prototype.unique=function(t){var e=new o(this.value);return this.listen(function(t){t!==e.value&&e.update(t)},t),e},o.prototype.uniqueDuplex=function(t){var e=this,n=new o(this.value),r=function(t){t!==n.value&&n.backPropagate(i,t)},i=function(t){t!==e.value&&e.backPropagate(r,t)};return this.listen(r,t),n.listen(i,t),n},o.prototype.reduce=function(t,e,n){var r=new o(e);return this.listen(function(e){return r.update(t(r.value,e))},n),r},o.prototype.aggregate=function(t,e,n){var r=this,i=new o(e(this.value,t.value));return this.listen(function(){return i.update(e(r.value,t.value))},n),t.listen(function(){return i.update(e(r.value,t.value))},n),i},o.prototype.combine=function(t,e){var n=new o;return this.pipe(n,e),t.pipe(n,e),n},o.prototype.debounce=function(t,e){var n,r=new o(this.value);return this.listen(function(e){clearTimeout(n),n=setTimeout(function(){r.update(e)},t)},e),r},o.prototype.buffer=function(t,e){var n,r=new o,i=[];return this.listen(function(e){i.push(e),n||(n=setTimeout(function(){n=void 0,r.update(i),i=[]},t))},e),r},o.prototype.queue=function(t){var e=new r;return this.listen(function(t){e.push(t)},t),e},o.prototype.pick=function(t,e){var n,r=new o(null===(n=this.value)||void 0===n?void 0:n[t]);return this.listen(function(e){r.update(null!=e?e[t]:e)},e),r},o.prototype.cancelAll=function(){this.updateEvent.cancelAll()};var r=function(t){this.data=t?t.slice():[],this.lengthSource=new o(this.data.length).unique(),this.updateEvent=new e},i={length:{configurable:!0}};r.prototype.listenAndRepeat=function(t,e){return t({operation:"add",operationDetailed:"append",index:0,items:this.data,newState:this.data,count:this.data.length}),this.listen(t,e)},r.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},i.length.get=function(){return this.lengthSource},r.prototype.getData=function(){return this.data.slice()},r.prototype.get=function(t){return this.data[t]},r.prototype.set=function(t,e){var n=this.data[t];n!==e&&(this.data[t]=e,this.update({operation:"replace",operationDetailed:"replace",target:n,count:1,index:t,items:[e],newState:this.data}),this.lengthSource.update(this.data.length))},r.prototype.swap=function(t,e){if(t!==e){var n=this.data[t],o=this.data[e];this.data[e]=n,this.data[t]=o,this.update({operation:"swap",operationDetailed:"swap",index:t,index2:e,items:[n,o],newState:this.data}),this.lengthSource.update(this.data.length)}},r.prototype.swapItems=function(t,e){if(t!==e){var n=this.data.indexOf(t),o=this.data.indexOf(e);-1!==n&&-1!==o&&(this.data[o]=t,this.data[n]=e),this.update({operation:"swap",operationDetailed:"swap",index:n,index2:o,items:[t,e],newState:this.data}),this.lengthSource.update(this.data.length)}},r.prototype.appendArray=function(t){var e=this.data;this.data=new Array(e.length);var n=0;for(n=0;n<e.length;n++)this.data[n]=e[n];for(var o=0;o<t.length;o++)this.data[n+o]=t[o];this.update({operation:"add",operationDetailed:"append",count:t.length,index:this.data.length-t.length,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.push=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.appendArray(t),this.lengthSource.update(this.data.length)},r.prototype.unshift=function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];(t=this.data).unshift.apply(t,e),this.update({operation:"add",operationDetailed:"prepend",count:e.length,items:e,index:0,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.pop=function(){var t=this.data.pop();return this.update({operation:"remove",operationDetailed:"removeRight",count:1,index:this.data.length,items:[t],newState:this.data}),this.lengthSource.update(this.data.length),t},r.prototype.merge=function(t){for(var e=0;e<t.length;e++)this.data[e]!==t[e]&&(this.data.length>e?this.set(e,t[e]):this.push(t[e]));this.data.length>t.length&&this.removeRight(this.data.length-t.length),this.lengthSource.update(this.data.length)},r.prototype.removeRight=function(t){var e=this.data.length,n=this.data.splice(e-t,t);this.update({operation:"remove",operationDetailed:"removeRight",count:t,index:e-t,items:n,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.removeLeft=function(t){var e=this.data.splice(0,t);this.update({operation:"remove",operationDetailed:"removeLeft",count:t,index:0,items:e,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.remove=function(t){var e=this.data.indexOf(t);-1!==e&&(this.data.splice(e,1),this.update({operation:"remove",operationDetailed:"remove",count:1,index:e,items:[t],newState:this.data}),this.lengthSource.update(this.data.length))},r.prototype.clear=function(){var t=this.data;this.data=[],this.update({operation:"remove",operationDetailed:"clear",count:t.length,index:0,items:t,newState:this.data}),this.lengthSource.update(this.data.length)},r.prototype.shift=function(){var t=this.data.shift();return this.update({operation:"remove",operationDetailed:"removeLeft",items:[t],count:1,index:0,newState:this.data}),this.lengthSource.update(this.data.length),t},r.prototype.toArray=function(){return this.data.slice()},r.prototype.sort=function(t,e){return new c(this,t,e)},r.prototype.map=function(t,e){return new a(this,t,e)},r.prototype.filter=function(t,e){return new s(this,t,e)},r.prototype.forEach=function(t){return this.data.forEach(t)},r.prototype.toDataSource=function(){var t=new o(this.data);return this.listen(function(e){t.update(e.newState)}),t},r.prototype.update=function(t){this.updateEvent.fire(t)},Object.defineProperties(r.prototype,i);var a=function(t){function e(e,n,o){var r=this,i=e.getData().map(n);t.call(this,i),this.mapper=n,e.listen(function(t){var e;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(r.data[t.index]);break;case"clear":r.clear();break;case"prepend":(e=r).unshift.apply(e,t.items.map(r.mapper));break;case"append":r.appendArray(t.items.map(r.mapper));break;case"swap":r.swap(t.index,t.index2);break;case"replace":r.set(t.index,r.mapper(t.items[0]))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(r),c=function(t){function e(e,n,o){var r=this,i=e.getData().sort(n);t.call(this,i),this.comparator=n,e.listen(function(t){var e,n;switch(t.operationDetailed){case"removeLeft":r.removeLeft(t.count);break;case"removeRight":r.removeRight(t.count);break;case"remove":r.remove(t.items[0]);break;case"clear":r.data.length=0;break;case"prepend":(e=r).unshift.apply(e,t.items),r.data.sort(r.comparator);break;case"append":(n=r).push.apply(n,t.items),r.data.sort(r.comparator);break;case"swap":break;case"replace":r.set(t.index,t.items[0]),r.data.sort(r.comparator)}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(r),s=function(t){function e(e,n,o){var r=this;Array.isArray(e)&&(e=new t(e));var i=e.data.filter(n=null!=n?n:function(){return!0});t.call(this,i),this.parent=e,this.viewFilter=n,e.listen(function(t){var e,n,o;switch(t.operationDetailed){case"clear":r.clear();break;case"removeLeft":case"removeRight":case"remove":for(var i=0,a=t.items;i<a.length;i+=1)r.remove(a[i]);break;case"prepend":o=t.items.filter(r.viewFilter),(e=r).unshift.apply(e,o);break;case"append":o=t.items.filter(r.viewFilter),(n=r).push.apply(n,o);break;case"swap":var c=r.data.indexOf(t.items[0]),s=r.data.indexOf(t.items[1]);-1!==c&&-1!==s&&r.swap(c,s);break;case"replace":var u=r.data.indexOf(t.target);-1!==u&&(r.viewFilter(t.items[0])?r.set(u,t.items[0]):r.remove(t.target))}},o)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.updateFilter=function(t){if(this.viewFilter!==t)return this.viewFilter=t,this.refresh(),this.data.length},e.prototype.refresh=function(){var t;this.clear();var e=this.parent.data.filter(this.viewFilter);(t=this).push.apply(t,e)},e}(r),u=function(t){t&&(this.data=t),this.updateEvent=new e,this.updateEventOnKey=new Map};u.prototype.pick=function(t,e){var n,r=new o(null===(n=this.data)||void 0===n?void 0:n[t]);return this.listenOnKey(t,function(t){r.update(t.newValue)},e),r},u.prototype.listen=function(t,e){return this.updateEvent.subscribe(t,e).cancel},u.prototype.listenOnKeyAndRepeat=function(t,e,n){return e({key:t,newValue:this.data[t],oldValue:void 0}),this.listenOnKey(t,e,n)},u.prototype.listenOnKey=function(t,n,o){return this.updateEventOnKey.has(t)||this.updateEventOnKey.set(t,new e),this.updateEventOnKey.get(t).subscribe(n,o).cancel},u.prototype.get=function(t){return this.data[t]},u.prototype.set=function(t,e){if(this.data[t]!==e){var n=this.data[t];this.data[t]=e,this.updateEvent.fire({oldValue:n,key:t,newValue:this.data[t]}),this.updateEventOnKey.has(t)&&this.updateEventOnKey.get(t).fire({oldValue:n,key:t,newValue:this.data[t]})}},u.prototype.assign=function(t){for(var e=0,n=Object.keys(t);e<n.length;e+=1){var o=n[e];this.set(o,t[o])}},u.prototype.toObject=function(){return Object.assign({},this.data)},u.prototype.toDataSource=function(){var t=this,e=new o(this.data);return this.listen(function(n){e.update(t.data)}),e};var l=Symbol("owner"),p=function(t){var e=this;this.node=this.create(t),t instanceof o&&t.listen(function(t){e.node&&(e.node.textContent=t)})};p.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},p.prototype.create=function(t){var e=document.createTextNode(this.resolveStringSource(t));return e[l]=this,e},p.prototype.remove=function(){this.hasParent()&&this.node.parentElement[l].removeChild(this.node)},p.prototype.hasParent=function(){return!!this.node.parentElement};var h=Symbol("AurumElementModel"),d={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"},f=["id","name","draggable","tabindex","style","role","contentEditable"];function v(t){return t&&t[h]?v(t.constructor(t.props,t.innerNodes)):t}var y=function(t,e,n){var o,r;this.node=this.create(n),this.children=[],null!=t&&(t.onAttach&&(this.onAttach=t.onAttach,this.needAttach=!0),this.onDetach=t.onDetach,this.initialize(t),null===(r=(o=t).onCreate)||void 0===r||r.call(o,this.node)),e&&this.addChildren(e)};y.prototype.initialize=function(t){this.createEventHandlers(d,t);var e=Object.keys(t).filter(function(t){return t.includes("-")});this.bindProps(f,t,e),t.class&&this.handleClass(t.class)},y.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,c=n;a<c.length;a+=1){var s=c[a];e[s]&&this.assignStringSourceToAttribute(e[s],s)}},y.prototype.createEventHandlers=function(t,e){var n=this,r=function(r){e[t[r]]&&(e[t[r]]instanceof o?n.node.addEventListener(r,function(n){return e[t[r]].update(n)}):"function"==typeof e[t[r]]&&n.node.addEventListener(r,function(n){return e[t[r]](n)}))};for(var i in t)r(i)},y.prototype.render=function(){for(var t=0,e=0;e<this.children.length;e++,t++)this.children[e]instanceof b?t=this.renderFragment(this.children[e],t):this.renderChild(this.children[e],t);for(;this.node.childNodes.length>t;)this.node.removeChild(this.node.childNodes[this.node.childNodes.length-1])},y.prototype.renderFragment=function(t,e){for(var n=0;n<t.children.length;n++,e++)t.children[n]instanceof b?e=this.renderFragment(t.children[n],e):this.renderChild(t.children[n],e);return--e},y.prototype.renderChild=function(t,e){if(this.node.childNodes.length<=e)return this.addChildDom(t);if(this.node.childNodes[e][l]!==t){var n=this.getChildIndex(t.node);-1!==n?this.swapChildrenDom(e,n):this.addDomNodeAt(t.node,e)}},y.prototype.assignStringSourceToAttribute=function(t,e){var n=this;"string"==typeof t||"boolean"==typeof t?this.node.setAttribute(e,t):(t.value&&this.node.setAttribute(e,t.value),t.unique().listen(function(t){return n.node.setAttribute(e,t)}))},y.prototype.handleAttach=function(t){var e,n,o,r;if(this.needAttach)if(t.isConnected()){null===(e=this.onAttach)||void 0===e||e.call(this,this.node);for(var i=0,a=this.node.childNodes;i<a.length;i+=1)null===(r=null===(n=a[i][l])||void 0===n?void 0:(o=n).handleAttach)||void 0===r||r.call(o,this)}else t.needAttach=!0},y.prototype.handleDetach=function(){var t,e,n;if(!this.node.isConnected){null===(t=this.onDetach)||void 0===t||t.call(this,this.node);for(var o=0,r=this.node.childNodes;o<r.length;o+=1){var i=r[o];i[l]&&(null===(n=(e=i[l]).handleDetach)||void 0===n||n.call(e))}}},y.prototype.handleClass=function(t){var e=this;if("string"==typeof t)this.node.className=t;else if(t instanceof o)t.value&&(Array.isArray(t.value)?(this.node.className=t.value.join(" "),t.unique().listen(function(){e.node.className=t.value.join(" ")})):(this.node.className=t.value,t.unique().listen(function(){e.node.className=t.value}))),t.unique().listen(function(t){return e.node.className=t});else{var n=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");this.node.className=n;for(var r=0,i=t;r<i.length;r+=1){var a=i[r];a instanceof o&&a.unique().listen(function(n){var o=t.reduce(function(t,e){return"string"==typeof e?t+" "+e:e.value?t+" "+e.value:t},"");e.node.className=o})}}},y.prototype.resolveStringSource=function(t){return"string"==typeof t?t:t.value},y.prototype.create=function(t){var e=document.createElement(t);return e[l]=this,e},y.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},y.prototype.hasChild=function(t){for(var e=0,n=t.children;e<n.length;e+=1)if(n[e]===t)return!0;return!1},y.prototype.addChildDom=function(t){var e,n;this.node.appendChild(t.node),null===(n=(e=t).handleAttach)||void 0===n||n.call(e,this)},y.prototype.swapChildrenDom=function(t,e){if(t!==e){var n=this.node.children[t],o=this.node.children[e];n.remove(),o.remove(),t<e?(this.addDomNodeAt(o,t),this.addDomNodeAt(n,e)):(this.addDomNodeAt(n,e),this.addDomNodeAt(o,t))}},y.prototype.addDomNodeAt=function(t,e){var n,o,r,i;e>=this.node.childElementCount?(this.node.appendChild(t),null===(o=(n=t[l]).handleAttach)||void 0===o||o.call(n,this)):(this.node.insertBefore(t,this.node.children[e]),null===(i=(r=t[l]).handleAttach)||void 0===i||i.call(r,this))},y.prototype.remove=function(){this.hasParent()&&this.node.parentElement[l].removeChild(this.node)},y.prototype.hasParent=function(){return!!this.node.parentElement},y.prototype.isConnected=function(){return this.node.isConnected},y.prototype.removeChild=function(t){var e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1),this.render()},y.prototype.removeChildAt=function(t){this.children.splice(t,1),this.render()},y.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()}},y.prototype.clearChildren=function(){this.children.length=0,this.render()},y.prototype.addChild=function(t){if(null!=t&&(!t[h]||void 0!==(t=v(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()},y.prototype.childNodeToAurum=function(t){var e=this;if(t instanceof y)return t;if(t instanceof Promise){var n=new b({});return t.then(function(t){n.addChildren([t]),e.render()}),n}if(t instanceof r){var i=new b({repeatModel:t});return i.onChange.subscribe(function(){return e.render()}),i}if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return new p(t.toString());if(t instanceof o){var a=new b({},[t]);return a.onChange.subscribe(function(){return e.render()}),a}throw new Error("Unsupported child type")},y.prototype.addChildAt=function(t,e){this.children.splice(e,0,this.childNodeToAurum(t)),this.render()},y.prototype.addChildren=function(t){if(0!==t.length)for(var e=0,n=t;e<n.length;e+=1)this.addChild(n[e])};var b=function(t,n){this.onChange=new e,this.children=[],t.repeatModel?this.handleRepeat(t.repeatModel):n&&this.addChildren(n)};b.prototype.addChildren=function(t){for(var e=this,n=function(){var t=i[r],n=void 0;if((n=t[h]?v(t):t)instanceof y)e.children.push(n);else{if(!(n instanceof o))throw new Error("case not yet implemented");var a=void 0,c=void 0,s={ts:void 0};n.unique().listenAndRepeat(function(t){if(s.ts=Date.now(),null==t&&c)return e.children.length=0,e.onChange.fire(),void(c=!1);if(!Array.isArray(t)&&c&&(e.children.length=0,e.onChange.fire(),c=!1),Array.isArray(t)){c=!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,s,s.ts)}else a=e.handleSourceChild(t,a,n,s,s.ts)})}},r=0,i=t;r<i.length;r+=1)n()},b.prototype.handleSourceChild=function(t,e,n,i,a){var c=this;if(null!=t){if(t[h]&&(t=v(t)),"string"==typeof t||"bigint"==typeof t||"number"==typeof t||"boolean"==typeof t)if(e){if(e instanceof y){var s=new p(null!=n?n:t);this.children.splice(this.children.indexOf(e),1,s),e=s,this.onChange.fire()}}else{var u=new p(null!=n?n:t);this.children.push(u),e=u,this.onChange.fire()}else if(t instanceof y)t!==e&&(e?this.children.splice(this.children.indexOf(e),1,t):this.children.push(t),e=t,this.onChange.fire());else if(t instanceof Promise)t.then(function(t){i.ts===a&&(c.addChildren([t]),c.onChange.fire())});else if(t instanceof o)if(e){if(e!==t){var l=new b({},[t]);l.onChange.subscribe(function(){return c.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,l),e=l,this.onChange.fire()}}else{var d=new b({},[t]);e=d,this.children.push(d),d.onChange.subscribe(function(){return c.onChange.fire()}),this.onChange.fire()}else if(t instanceof r)if(e){if(e!==t){var f=new b({repeatModel:t});f.onChange.subscribe(function(){return c.onChange.fire()}),this.children.splice(this.children.indexOf(e),1,f),e=f,this.onChange.fire()}}else{var _=new b({repeatModel:t});e=_,this.children.push(_),_.onChange.subscribe(function(){return c.onChange.fire()}),this.onChange.fire()}return e}e&&(this.children.splice(this.children.indexOf(e),1),e=void 0,this.onChange.fire())},b.prototype.handleRepeat=function(t){var e=this;t.listenAndRepeat(function(t){var n;switch(t.operationDetailed){case"replace":e.children[t.index]=v(t.items[0]);break;case"swap":var o=e.children[t.index2];e.children[t.index2]=e.children[t.index],e.children[t.index]=o;break;case"append":e.children=e.children.concat(t.items.map(v));break;case"prepend":(n=e.children).unshift.apply(n,t.items.map(v));break;case"remove":case"removeLeft":case"removeRight":e.children.splice(t.index,t.count);break;case"clear":e.children=[];break;default:throw new Error("unhandled operation")}e.onChange.fire()})};var _=function(t){function e(e,n){t.call(this,e,n,"div")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),g=function(t){function e(e,n){t.call(this,e,n,"button"),null!==e&&this.bindProps(["disabled"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),m={input:"onInput",change:"onChange"},w=["placeholder","readonly","disabled","accept","alt","autocomplete","autofocus","checked","defaultChecked","formAction","formEnctype","formMethod","formNoValidate","formTarget","max","maxLength","min","minLength","pattern","multiple","required","type"],C=function(t){function e(e,n){var o,r=this;t.call(this,e,n,"input"),null!==e&&(e.inputValueSource?e.inputValueSource.unique().listenAndRepeat(function(t){return r.node.value=t}):this.node.value=null!=(o=e.initialValue)?o:"",this.bindProps(w,e),this.createEventHandlers(m,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(r.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),O=function(t){function e(e,n){t.call(this,e,n,"li")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),x=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}(y),S=function(t){function e(e,n){t.call(this,e,n,"style"),null!==e&&this.bindProps(["media"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),A=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}(y),j=function(t){function e(e,n){t.call(this,e,n,"ul")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),k=function(t){function e(e,n){t.call(this,e,n,"p")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),E=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}(y),N=function(t){function e(e,n){t.call(this,e,n,"link"),null!==e&&this.bindProps(["href","rel","media","as","disabled","type"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),D=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}(y),P=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}(y),F=function(t){function e(e,n){t.call(this,e,n,"article")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),R=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}(y),I=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}(y),L=function(t){function e(e,n){t.call(this,e,n,"label"),null!==e&&this.bindProps(["for"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),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}(y),V=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}(y),M=function(t){function e(e,n){t.call(this,e,n,"progress"),null!==e&&this.bindProps(["max","value"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),T=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}(y),K=function(t){function e(e,n){t.call(this,e,n,"td")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),H=function(t){function e(e,n){t.call(this,e,n,"tr")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),z=function(t){function e(e,n){t.call(this,e,n,"th")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),U={input:"onInput",change:"onChange"},B=["placeholder","readonly","disabled","rows","wrap","autocomplete","autofocus","max","maxLength","min","minLength","required","type"],W=function(t){function e(e,n){var o,r,i,a=this;t.call(this,e,n,"textArea"),null!==e&&(e.inputValueSource?(this.node.value=null!=(r=null!=(o=e.initialValue)?o:e.inputValueSource.value)?r:"",e.inputValueSource.unique().listen(function(t){return a.node.value=t})):this.node.value=null!=(i=e.initialValue)?i:"",this.bindProps(B,e),this.createEventHandlers(U,e),e.inputValueSource&&this.node.addEventListener("input",function(){e.inputValueSource.update(a.node.value)}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),G=function(t){function e(e,n){t.call(this,e,n,"h1")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),J=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}(y),Q=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}(y),X=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}(y),Y=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}(y),Z=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}(y),$=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}(y),tt=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}(y),et=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}(y),nt=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}(y),ot=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}(y),rt=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}(y),it=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}(y),at=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}(y),ct=function(t){function e(e,n){t.call(this,e,n,"aside")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),st=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}(y),ut=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}(y),lt=function(t){function e(e,n){t.call(this,e,n,"iframe"),null!==e&&this.bindProps(["src","srcdoc","width","height","allow","allowFullscreen","allowPaymentRequest"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),pt=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}(y),ht=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}(y),dt={change:"onChange"},ft=function(t){function e(e,n){var o,r=this;t.call(this,e,n,"select"),null!==e&&(this.createEventHandlers(dt,e),this.initialSelection=e.initialSelection,e.selectedIndexSource?(this.selectedIndexSource=e.selectedIndexSource,e.selectedIndexSource.unique().listenAndRepeat(function(t){return r.node.selectedIndex=t})):this.node.selectedIndex=null!=(o=e.initialSelection)?o:-1,e.selectedIndexSource&&(this.needAttach=!0,this.node.addEventListener("change",function(){e.selectedIndexSource.update(r.node.selectedIndex)})))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleAttach=function(e){t.prototype.handleAttach.call(this,e),this.node.isConnected&&(this.selectedIndexSource?this.node.selectedIndex=this.selectedIndexSource.value:void 0!==this.initialSelection&&(this.node.selectedIndex=this.initialSelection))},e}(y),vt=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}(y),yt=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}(y),bt=function(t){function e(e,n){t.call(this,e,n,"video"),null!==e&&this.bindProps(["controls","autoplay","loop","muted","preload","src","poster","width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),_t=function(t){function e(e,n){t.call(this,e,n,"tbody")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),gt=function(t){function e(e,n){t.call(this,e,n,"tfoot")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),mt=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}(y),wt=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}(y),Ct=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}(y),Ot=function(t){function e(e,n){t.call(this,e,n,"sub")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),xt=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}(y),St=function(t){function e(e,n){t.call(this,e,n,"svg"),null!==e&&this.bindProps(["width","height"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),At=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}(y),jt=function(t){function e(e,n){t.call(this,e,n,"time"),null!==e&&this.bindProps(["datetime"],e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),kt={button:g,div:_,input:C,li:O,span:x,style:S,ul:j,p:k,img:E,link:N,canvas:D,a:P,article:F,br:R,form:I,label:L,ol:q,pre:V,progress:M,table:T,td:K,tr:H,th:z,textarea:W,h1:G,h2:J,h3:Q,h4:X,h5:Y,h6:Z,header:$,footer:tt,nav:et,b:nt,i:ot,script:rt,abbr:it,area:at,aside:ct,audio:A,em:st,heading:ut,iframe:lt,noscript:pt,option:function(t){function e(e,n){t.call(this,e,n,"option")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y),q:ht,select:ft,source:vt,title:yt,video:bt,tbody:_t,tfoot:gt,thead:mt,summary:wt,details:Ct,sub:Ot,sup:xt,svg:St,data:At,time:jt,template:function(t){function e(e,n){t.call(this,e,n,"template")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(y)},Et=function(){};Et.attach=function(t,e){var n=v(t);if(e[l])throw new Error("This node is already managed by aurum and cannot be used");if(!(n instanceof y))throw new Error("Root node of aurum application must be a single dom node");e.appendChild(n.node),n.handleAttach(n),e[l]=n},Et.isAttached=function(t){return void 0!==t[l]},Et.detach=function(t){t[l]&&(t[l].node.remove(),t[l].handleDetach(),t[l]=void 0)},Et.factory=function(t,e){for(var n,o,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];if("string"==typeof t){var a=t;if(void 0===(t=kt[t]))throw new Error("Node "+a+" does not exist or is not supported")}return Object.getPrototypeOf(t)===y?((n={})[h]=!0,n.constructor=function(e,n){return new t(e,n)},n.props=e,n.innerNodes=r,n):((o={})[h]=!0,o.constructor=t,o.props=e,o.innerNodes=r,o)};var Nt=function(t){this.data=t};Nt.prototype.deleteNext=function(){if(this.next){var t=this.next.next;this.next.next=void 0,this.next.previous=void 0,this.next=t,this.next&&(this.next.previous=this)}},Nt.prototype.deletePrevious=function(){if(this.previous){var t=this.previous.previous;this.previous.next=void 0,this.previous.previous=void 0,this.previous=t,this.previous&&(this.previous.next=this)}};var Dt=function(t){var e=this;void 0===t&&(t=[]),this.length=0,t.forEach(function(t){return e.append(t)})};Dt.prototype.find=function(t){for(var e=this.rootNode;e&&!t(e);)e=e.next;return e},Dt.prototype.append=function(t){return this.rootNode||this.lastNode?(this.lastNode.next=new Nt(t),this.lastNode.next.previous=this.lastNode,this.lastNode=this.lastNode.next):this.rootNode=this.lastNode=new Nt(t),this.length++,t},Dt.prototype.forEach=function(t){this.find(function(e){return t(e.data),!1})},Dt.prototype.prepend=function(t){return this.rootNode||this.lastNode?(this.rootNode.previous=new Nt(t),this.rootNode.previous.next=this.rootNode,this.rootNode=this.rootNode.previous):this.rootNode=this.lastNode=new Nt(t),this.length++,t},Dt.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 Pt=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.cancelables=new Dt(t),this._isCancelled=!1},Ft={isCanceled:{configurable:!0}};Ft.isCanceled.get=function(){return this._isCancelled},Pt.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},Pt.prototype.removeCancelable=function(t){return this.throwIfCancelled("attempting to remove cancellable from token that is already cancelled"),this.cancelables.remove(t),this},Pt.prototype.addDisposable=function(t){return this.addCancelable(function(){return t.dispose()}),this},Pt.prototype.callIfNotCancelled=function(t){this.isCanceled||t()},Pt.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)},Pt.prototype.setInterval=function(t,e){var n=setInterval(t,e);this.addCancelable(function(){return clearInterval(n)})},Pt.prototype.requestAnimationFrame=function(t){var e=requestAnimationFrame(t);this.addCancelable(function(){return cancelAnimationFrame(e)})},Pt.prototype.animationLoop=function(t){var e=requestAnimationFrame(function n(o){t(o),e=requestAnimationFrame(n)});this.addCancelable(function(){return cancelAnimationFrame(e)})},Pt.prototype.throwIfCancelled=function(t){if(this.isCanceled)throw new Error(t||"cancellation token is cancelled")},Pt.prototype.chain=function(t,e){return void 0===e&&(e=!1),e&&t.chain(this,!1),this.addCancelable(function(){return t.cancel()}),this},Pt.prototype.registerDomEvent=function(t,e,n){return t.addEventListener(e,n),this.addCancelable(function(){return t.removeEventListener(e,n)}),this},Pt.prototype.cancel=function(){this.isCanceled||(this._isCancelled=!0,this.cancelables.forEach(function(t){return t()}),this.cancelables=void 0)},Object.defineProperties(Pt.prototype,Ft);var Rt=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}(y),It=Symbol("route");function Lt(){var t=location.hash.substring(1);return t.includes("?")?t.substring(0,t.indexOf("?")):t.includes("#")?t.substring(0,t.indexOf("#")):t}var qt=Symbol("switchCase");t.DataSource=o,t.ArrayDataSource=r,t.MappedArrayView=a,t.SortedArrayView=c,t.FilteredArrayView=s,t.ObjectDataSource=u,t.Aurum=Et,t.CancellationToken=Pt,t.Custom=Rt,t.AurumRouter=function(t,e){if((e=e.map(v)).some(function(t){return!t[It]}))throw new Error("Aurum Router only accepts Route and DefaultRoute instances as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default routes only 0 or 1 allowed");var n=new o(Lt());return window.addEventListener("hashchange",function(){n.update(Lt())}),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={})[It]=!0,n.content=e,n.default=!1,n.href=t.href,n},t.DefaultRoute=function(t,e){var n;return(n={})[It]=!0,n.content=e,n.default=!0,n.href=void 0,n},t.Suspense=function(t,e){var n=new o(t.fallback);return Promise.all(e.map(v)).then(function(){n.update(e)}),n},t.Switch=function(t,e){if((e=e.map(v)).some(function(t){return!t[qt]}))throw new Error("Switch only accepts SwitchCase as children");if(e.filter(function(t){return t.default}).length>1)throw new Error("Too many default switch cases only 0 or 1 allowed");return t.state.unique().map(function(t){return function(t,e){var n,o,r;return null!==(o=null===(n=e.find(function(e){return e.value===t}))||void 0===n?void 0:n.content)&&void 0!==o?o:null===(r=e.find(function(t){return t.default}))||void 0===r?void 0:r.content}(t,e)})},t.SwitchCase=function(t,e){var n;return(n={})[qt]=!0,n.content=e,n.default=!1,n.value=t.when,n},t.DefaultSwitchCase=function(t,e){var n;return(n={})[qt]=!0,n.content=e,n.default=!0,n.value=void 0,n},t.aurumElementModelIdentitiy=h,t.buildRenderableFromModel=v,t.AurumElement=y,t.AurumFragment=b});
//# sourceMappingURL=aurumjs.umd.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc