(function(){var a,b=[].slice,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};a=function(a,c){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb,cb;if(U={},L=0,K=function(){return L+=1},O=function(a,b){var c;if(!(b in a))throw new Error("object has no key "+b);return c=a[b],delete a[b],c},M=function(a,b,c){var d,e,f,g;for(d=f=0,g=a.length;g>f;d=++f)if(e=a[d],c(e)&&(b-=1)<0)return[e,d];return[null,-1]},E=function(a,b){return M(a,0,b)},I=function(b){var c,d,e,f,g,h;if(null==b&&(b=[]),d=null!=Object.create?Object.create(null):{},a.isArray(b))for(f=0,g=b.length;g>f;f++)h=b[f],c=h[0],e=h[1],d[c]=e;else for(c in b)e=b[c],d[c]=e;return d},Z=function(a){var b,c,d,e;for(b=0,d=0,e=a.length;e>d;d++)c=a[d],b+=c;return b},h=U.DepMgr=function(){function a(){this.uid2src={},this.buffering=0,this.buffer=[]}return a.prototype.sub=function(a,b){return this.uid2src[a]=b},a.prototype.unsub=function(a){return O(this.uid2src,a)},a.prototype.transaction=function(a){var b,c,d,e,f;this.buffering+=1;try{c=a()}finally{if(this.buffering-=1,0===this.buffering){for(f=this.buffer,d=0,e=f.length;e>d;d++)(b=f[d])();this.buffer=[]}}return c},a}(),U._depMgr=B=new h,i=U.Ev=function(){function a(a){this.inits=a,this.subs=I()}return a.prototype.sub=function(a){var b,c,d,e,f;if(c=K(),null!=this.inits)for(f=this.inits(),d=0,e=f.length;e>d;d++)b=f[d],a(b);return this.subs[c]=a,B.sub(c,this),c},a.prototype.pub=function(a){var b,c,d,e;if(B.buffering)return B.buffer.push(function(b){return function(){return b.pub(a)}}(this));d=this.subs,e=[];for(c in d)b=d[c],e.push(b(a));return e},a.prototype.unsub=function(a){return O(this.subs,a),B.unsub(a,this)},a.prototype.scoped=function(a,b){var c;c=this.sub(a);try{return b()}finally{this.unsub(c)}},a}(),U.skipFirst=function(a){var c;return c=!0,function(){var d;return d=1<=arguments.length?b.call(arguments,0):[],c?c=!1:a.apply(null,d)}},u=U.Recorder=function(){function b(){this.stack=[],this.isMutating=!1,this.isIgnoring=!1,this.onMutationWarning=new i}return b.prototype.record=function(b,c){var d,e;this.stack.length>0&&!this.isMutating&&a(this.stack).last().addNestedBind(b),this.stack.push(b),e=this.isMutating,this.isMutating=!1,d=this.isIgnoring,this.isIgnoring=!1;try{return c()}finally{this.isIgnoring=d,this.isMutating=e,this.stack.pop()}},b.prototype.sub=function(b){var c,d;return this.stack.length>0&&!this.isIgnoring?(d=a(this.stack).last(),c=b(d)):void 0},b.prototype.addCleanup=function(b){return this.stack.length>0?a(this.stack).last().addCleanup(b):void 0},b.prototype.mutating=function(a){var b;this.stack.length>0&&(console.warn("Mutation to observable detected during a bind context"),this.onMutationWarning.pub(null)),b=this.isMutating,this.isMutating=!0;try{return a()}finally{this.isMutating=b}},b.prototype.ignoring=function(a){var b;b=this.isIgnoring,this.isIgnoring=!0;try{return a()}finally{this.isIgnoring=b}},b}(),U._recorder=T=new u,U.asyncBind=z=function(a,b){var c;return c=new f(b,a),c.refresh(),c},U.bind=A=function(a){return z(null,function(){return this.done(this.record(a))})},U.lagBind=G=function(a,b,c){var d;return d=null,z(b,function(){return null!=d&&clearTimeout(d),d=setTimeout(function(a){return function(){return a.done(a.record(c))}}(this),a)})},U.postLagBind=P=function(a,b){var c;return c=null,z(a,function(){var a,d,e;return e=this.record(b),d=e.val,a=e.ms,null!=c&&clearTimeout(c),c=setTimeout(function(a){return function(){return a.done(d)}}(this),a)})},U.snap=function(a){return T.ignoring(a)},U.onDispose=function(a){return T.addCleanup(a)},U.autoSub=function(a,b){var c;return c=a.sub(b),U.onDispose(function(){return a.unsub(c)}),c},q=U.ObsCell=function(){function a(a){var b;this.x=a,this.x=null!=(b=this.x)?b:null,this.onSet=new i(function(a){return function(){return[[null,a.x]]}}(this))}return a.prototype.get=function(){return T.sub(function(a){return function(b){return U.autoSub(a.onSet,function(){return b.refresh()})}}(this)),this.x},a}(),w=U.SrcCell=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return d(b,a),b.prototype.set=function(a){return T.mutating(function(b){return function(){var c;return b.x!==a?(c=b.x,b.x=a,b.onSet.pub([c,a]),c):void 0}}(this))},b}(q),f=U.DepCell=function(a){function b(a,c){this.body=a,b.__super__.constructor.call(this,null!=c?c:null),this.refreshing=!1,this.nestedBinds=[],this.cleanups=[]}return d(b,a),b.prototype.refresh=function(){var a,b,c,d,e;return this.refreshing?void 0:(c=this.x,d=function(a){return function(b){return a.x=b,a.onSet.pub([c,a.x])}}(this),e=null,b=!1,a={record:function(c){return function(f){var g,h;if(!c.refreshing){if(c.disconnect(),g)throw new Error("this refresh has already recorded its dependencies");c.refreshing=!0,g=!0;try{h=T.record(c,function(){return f.call(a)})}finally{c.refreshing=!1}return b&&d(e),h}}}(this),done:function(a){return function(f){return c!==f?a.refreshing?(b=!0,e=f):d(f):void 0}}(this)},this.body.call(a))},b.prototype.disconnect=function(){var a,b,c,d,e,f,g,h;for(g=this.cleanups,c=0,e=g.length;e>c;c++)(a=g[c])();for(h=this.nestedBinds,d=0,f=h.length;f>d;d++)b=h[d],b.disconnect();return this.nestedBinds=[],this.cleanups=[]},b.prototype.addNestedBind=function(a){return this.nestedBinds.push(a)},b.prototype.addCleanup=function(a){return this.cleanups.push(a)},b}(q),p=U.ObsArray=function(){function b(a,b){this.xs=null!=a?a:[],this.diff=null!=b?b:U.basicDiff(),this.onChange=new i(function(a){return function(){return[[0,[],a.xs]]}}(this)),this.indexed_=null}return b.prototype.all=function(){return T.sub(function(a){return function(b){return U.autoSub(a.onChange,function(){return b.refresh()})}}(this)),a.clone(this.xs)},b.prototype.raw=function(){return T.sub(function(a){return function(b){return U.autoSub(a.onChange,function(){return b.refresh()})}}(this)),this.xs},b.prototype.at=function(a){return T.sub(function(b){return function(c){return U.autoSub(b.onChange,function(b){var d,e,f;return e=b[0],f=b[1],d=b[2],e===a?c.refresh():void 0})}}(this)),this.xs[a]},b.prototype.length=function(){return T.sub(function(a){return function(b){return U.autoSub(a.onChange,function(a){var c,d,e;return d=a[0],e=a[1],c=a[2],e.length!==c.length?b.refresh():void 0})}}(this)),this.xs.length},b.prototype.map=function(a){var b;return b=new o,U.autoSub(this.onChange,function(c){var d,e,f;return e=c[0],f=c[1],d=c[2],b.realSplice(e,f.length,d.map(a))}),b},b.prototype.indexed=function(){return null==this.indexed_&&(this.indexed_=new m,U.autoSub(this.onChange,function(a){return function(b){var c,d,e;return d=b[0],e=b[1],c=b[2],a.indexed_.realSplice(d,e.length,c)}}(this))),this.indexed_},b.prototype.concat=function(a){return U.concat(this,a)},b.prototype.realSplice=function(a,b,c){var d;return d=this.xs.splice.apply(this.xs,[a,b].concat(c)),this.onChange.pub([a,d,c])},b.prototype._update=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n;for(null==b&&(b=this.diff),g=this.xs,e=[0,g.length,a],j=null,i=null!=b&&null!=(m=N(g.length,a,b(g,a)))?m:[e],n=[],k=0,l=i.length;l>k;k++)h=i[k],f=h[0],d=h[1],c=h[2],n.push(this.realSplice(f,d,c));return n},b}(),v=U.SrcArray=function(c){function e(){return e.__super__.constructor.apply(this,arguments)}return d(e,c),e.prototype.spliceArray=function(a,b,c){return T.mutating(function(d){return function(){return d.realSplice(a,b,c)}}(this))},e.prototype.splice=function(){var a,c,d;return d=arguments[0],c=arguments[1],a=3<=arguments.length?b.call(arguments,2):[],this.spliceArray(d,c,a)},e.prototype.insert=function(a,b){return this.splice(b,0,a)},e.prototype.remove=function(b){var c;return c=a(this.raw()).indexOf(b),c>=0?this.removeAt(c):void 0},e.prototype.removeAt=function(a){return this.splice(a,1)},e.prototype.push=function(a){return this.splice(this.length(),0,a)},e.prototype.put=function(a,b){return this.splice(a,1,b)},e.prototype.replace=function(a){return this.spliceArray(0,this.length(),a)},e.prototype.update=function(a){return T.mutating(function(b){return function(){return b._update(a)}}(this))},e}(p),o=U.MappedDepArray=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return d(b,a),b}(p),m=U.IndexedDepArray=function(c){function e(b,c){var d,f;null==b&&(b=[]),e.__super__.constructor.call(this,b,c),this.is=function(){var a,b,c,e;for(c=this.xs,e=[],d=a=0,b=c.length;b>a;d=++a)f=c[d],e.push(U.cell(d));return e}.call(this),this.onChange=new i(function(b){return function(){return[[0,[],a.zip(b.xs,b.is)]]}}(this))}return d(e,c),e.prototype.map=function(a){var b;return b=new n,U.autoSub(this.onChange,function(c){var d,e,f,g,h;return g=c[0],h=c[1],e=c[2],b.realSplice(g,h.length,function(){var b,c,g,h;for(h=[],b=0,c=e.length;c>b;b++)g=e[b],d=g[0],f=g[1],h.push(a(d,f));return h}())}),b},e.prototype.realSplice=function(c,d,e){var f,g,h,i,j,k,l,m,n;for(i=(l=this.xs).splice.apply(l,[c,d].concat(b.call(e))),m=this.is.slice(c+d),h=j=0,k=m.length;k>j;h=++j)f=m[h],f.set(c+e.length+h);return g=function(){var a,b,d;for(d=[],f=a=0,b=e.length;b>=0?b>a:a>b;f=b>=0?++a:--a)d.push(U.cell(c+f));return d}(),(n=this.is).splice.apply(n,[c,d].concat(b.call(g))),this.onChange.pub([c,i,a.zip(e,g)])},e}(p),n=U.IndexedMappedDepArray=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return d(b,a),b}(m),e=U.DepArray=function(a){function b(a,c){this.f=a,b.__super__.constructor.call(this,[],c),U.autoSub(A(function(a){return function(){return a.f()}}(this)).onSet,function(a){return function(b){var c,d;return c=b[0],d=b[1],a._update(d)}}(this))}return d(b,a),b}(p),l=U.IndexedArray=function(a){function b(a){this.xs=a}return d(b,a),b.prototype.map=function(a){var b;return b=new o,U.autoSub(this.xs.onChange,function(c){var d,e,f;return e=c[0],f=c[1],d=c[2],b.realSplice(e,f.length,d.map(a))}),b},b}(e),U.concat=function(){var a,c,d,e;return d=1<=arguments.length?b.call(arguments,0):[],e=new o,a=function(){var a,b,e;for(e=[],a=0,b=d.length;b>a;a++)c=d[a],e.push(0);return e}(),d.map(function(b,c){return U.autoSub(b.onChange,function(b){var d,f,g,h;return f=b[0],g=b[1],d=b[2],h=Z(a.slice(0,c)),a[c]+=d.length-g.length,e.realSplice(h+f,g.length,d)})}),e},k=U.FakeSrcCell=function(a){function b(a,b){this._getter=a,this._setter=b}return d(b,a),b.prototype.get=function(){return this._getter()},b.prototype.set=function(a){return this._setter(a)},b}(w),j=U.FakeObsCell=function(a){function b(a){this._getter=a}return d(b,a),b.prototype.get=function(){return this._getter()},b}(q),y=U.MapEntryCell=function(a){function b(a,b){this._map=a,this._key=b}return d(b,a),b.prototype.get=function(){return this._map.get(this._key)},b.prototype.set=function(a){return this._map.put(this._key,a)},b}(k),s=U.ObsMapEntryCell=function(a){function b(a,b){this._map=a,this._key=b}return d(b,a),b.prototype.get=function(){return this._map.get(this._key)},b}(j),r=U.ObsMap=function(){function b(a){this.x=null!=a?a:{},this.onAdd=new i(function(){var b,c,d;d=[];for(b in a)c=a[b],d.push([b,c]);return d}),this.onRemove=new i,this.onChange=new i}return b.prototype.get=function(a){return T.sub(function(b){return function(c){return U.autoSub(b.onAdd,function(b){var d,e;return d=b[0],e=b[1],a===d?c.refresh():void 0})}}(this)),T.sub(function(b){return function(c){return U.autoSub(b.onChange,function(b){var d,e,f;return e=b[0],d=b[1],f=b[2],a===e?c.refresh():void 0})}}(this)),T.sub(function(b){return function(c){return U.autoSub(b.onRemove,function(b){var d,e;return e=b[0],d=b[1],a===e?c.refresh():void 0})}}(this)),this.x[a]},b.prototype.all=function(){return T.sub(function(a){return function(b){return U.autoSub(a.onAdd,function(){return b.refresh()})}}(this)),T.sub(function(a){return function(b){return U.autoSub(a.onChange,function(){return b.refresh()})}}(this)),T.sub(function(a){return function(b){return U.autoSub(a.onRemove,function(){return b.refresh()})}}(this)),a.clone(this.x)},b.prototype.realPut=function(a,b){var c;return a in this.x?(c=this.x[a],this.x[a]=b,this.onChange.pub([a,c,b]),c):(this.x[a]=b,void this.onAdd.pub([a,b]))},b.prototype.realRemove=function(a){var b;return b=O(this.x,a),this.onRemove.pub([a,b]),b},b.prototype.cell=function(a){return new s(this,a)},b}(),x=U.SrcMap=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return d(c,b),c.prototype.put=function(a,b){return T.mutating(function(c){return function(){return c.realPut(a,b)}}(this))},c.prototype.remove=function(a){return T.mutating(function(b){return function(){return b.realRemove(a)}}(this))},c.prototype.cell=function(a){return new y(this,a)},c.prototype.update=function(b){return T.mutating(function(c){return function(){var d,e,f,g,h,i;for(h=a.difference(a.keys(c.x),a.keys(b)),f=0,g=h.length;g>f;f++)d=h[f],c.realRemove(d);i=[];for(d in b)e=b[d],d in c.x&&c.x[d]===e||i.push(c.realPut(d,e));return i}}(this))},c}(r),g=U.DepMap=function(a){function b(a){this.f=a,b.__super__.constructor.call(this),U.autoSub(new f(this.f).onSet,function(a){var b,c,d,e,f;c=a[0],e=a[1];for(b in c)d=c[b],b in e||this.realRemove(b);f=[];for(b in e)d=e[b],f.push(this.x[b]!==d?this.realPut(b,d):void 0);return f})}return d(b,a),b}(r),U.liftSpec=function(b){var c,d,e;return a.object(function(){var f,g,h,i;for(h=Object.getOwnPropertyNames(b),i=[],f=0,g=h.length;g>f;f++)c=h[f],e=b[c],null!=e&&(e instanceof U.ObsMap||e instanceof U.ObsCell||e instanceof U.ObsArray)||(d=a.isFunction(e)?null:a.isArray(e)?"array":"cell",i.push([c,{type:d,val:e}]));return i}())},U.lift=function(b,c){var d,e,f;null==c&&(c=U.liftSpec(b));for(e in c)f=c[e],a.some(function(){var a,c,f,g;for(f=[q,p,r],g=[],a=0,c=f.length;c>a;a++)d=f[a],g.push(b[e]instanceof d);return g}())||(b[e]=function(){switch(f.type){case"cell":return U.cell(b[e]);case"array":return U.array(b[e]);case"map":return U.map(b[e]);default:return b[e]}}());return b},U.unlift=function(b){var c,d;return a.object(function(){var a;a=[];for(c in b)d=b[c],a.push([c,d instanceof U.ObsCell?d.get():d instanceof U.ObsArray?d.all():d]);return a}())},U.reactify=function(c,d){var e,f,g,h;return a.isArray(c)?(e=U.array(a.clone(c)),Object.defineProperties(c,a.object(function(){var d,g,h,i;for(h=a.functions(e),i=[],d=0,g=h.length;g>d;d++)f=h[d],"length"!==f&&i.push(function(a){var d,f,g;return d=c[a],f=function(){var f,g,h;return f=1<=arguments.length?b.call(arguments,0):[],null!=d&&(g=d.call.apply(d,[c].concat(b.call(f)))),(h=e[a]).call.apply(h,[e].concat(b.call(f))),g},g={configurable:!0,enumerable:!1,value:f,writable:!0},[a,g]}(f));return i}())),c):Object.defineProperties(c,a.object(function(){var a;a=[];for(g in d)h=d[g],a.push(function(a,c){var d,e,f,g,h;switch(d=null,c.type){case"cell":e=U.cell(null!=(g=c.val)?g:null),d={configurable:!0,enumerable:!0,get:function(){return e.get()},set:function(a){return e.set(a)}};break;case"array":f=U.reactify(null!=(h=c.val)?h:[]),d={configurable:!0,enumerable:!0,get:function(){return f.raw(),f},set:function(a){return f.splice.apply(f,[0,f.length].concat(b.call(a))),f}};break;default:throw new Error("Unknown observable type: "+type)}return[a,d]}(g,h));return a}()))},U.autoReactify=function(b){var c,d,e;return U.reactify(b,a.object(function(){var f,g,h,i;for(h=Object.getOwnPropertyNames(b),i=[],f=0,g=h.length;g>f;f++)c=h[f],e=b[c],e instanceof r||e instanceof q||e instanceof p||(d=a.isFunction(e)?null:a.isArray(e)?"array":"cell",i.push([c,{type:d,val:e}]));return i}()))},a.extend(U,{cell:function(a){return new w(a)},array:function(a,b){return new v(a,b)},map:function(a){return new x(a)}}),U.flatten=function(b){return new e(function(){var c;return a(function(){var a,d,e;for(e=[],a=0,d=b.length;d>a;a++)c=b[a],e.push(c instanceof p?c.raw():c instanceof q?c.get():c);return e}()).chain().flatten(!0).filter(function(a){return null!=a}).value()})},F=function(b){var c;return c=a.flatten(b),U.cellToArray(A(function(){return a.flatten(b)}))},U.cellToArray=function(a,b){return new e(function(){return a.get()},b)},U.basicDiff=function(a){return null==a&&(a=U.smartUidify),function(b,c){var d,e,f,g,h,i,j;for(e=I(function(){var c,e,g;for(g=[],d=c=0,e=b.length;e>c;d=++c)f=b[d],g.push([a(f),d]);return g}()),j=[],g=0,h=c.length;h>g;g++)f=c[g],j.push(null!=(i=e[a(f)])?i:-1);return j}},U.uidify=function(a){var b;return null!=(b=a.__rxUid)?b:Object.defineProperty(a,"__rxUid",{enumerable:!1,value:K()}).__rxUid},U.smartUidify=function(b){return a.isObject(b)?U.uidify(b):JSON.stringify(b)},N=function(b,c,d){var e,f,g,h,i,j;if(h=function(){var a,b,c;for(c=[],a=0,b=d.length;b>a;a++)f=d[a],f>=0&&c.push(f);return c}(),a.some(function(){var a,b,c;for(c=[],f=a=0,b=h.length-1;b>=0?b>a:a>b;f=b>=0?++a:--a)c.push(h[f+1]-h[f]<=0);return c}()))return null;for(j=[],g=-1,f=0;f<d.length;){for(;f<d.length&&d[f]===g+1;)g+=1,f+=1;for(i={index:f,count:0,additions:[]};f<d.length&&-1===d[f];)i.additions.push(c[f]),f+=1;e=f===d.length?b:d[f],i.count=e-(g+1),(i.count>0||i.additions.length>0)&&j.push([i.index,i.count,i.additions]),g=e,f+=1}return j},U.transaction=function(a){return B.transaction(a)},null!=c){c.fn.rx=function(a){var b,c,d,e;return d=this.data("rx-map"),null==d&&this.data("rx-map",d=I()),a in d?d[a]:d[a]=function(){switch(a){case"focused":return c=U.cell(this.is(":focus")),this.focus(function(){return c.set(!0)}),this.blur(function(){return c.set(!1)}),c;case"val":return e=U.cell(this.val()),this.change(function(a){return function(){return e.set(a.val())}}(this)),this.on("input",function(a){return function(){return e.set(a.val())}}(this)),e;case"checked":return b=U.cell(this.is(":checked")),this.change(function(a){return function(){return b.set(a.is(":checked"))}}(this)),b;default:throw new Error("Unknown reactive property type")}}.call(this)},V={},t=V.RawHtml=function(){function a(a){this.html=a}return a}(),D=["blur","change","click","dblclick","error","focus","focusin","focusout","hover","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","ready","resize","scroll","select","submit","toggle","unload"],Y=V.specialAttrs={init:function(a,b){return b.call(a)}},ab=function(a){return Y[a]=function(b,c){return b[a](function(a){return c.call(b,a)})}};for(bb=0,cb=D.length;cb>bb;bb++)C=D[bb],ab(C);S=["async","autofocus","checked","location","multiple","readOnly","selected","selectedIndex","tagName","nodeName","nodeType","ownerDocument","defaultChecked","defaultSelected"],R=a.object(function(){var a,b,c;for(c=[],a=0,b=S.length;b>a;a++)Q=S[a],c.push([Q,null]);return c}()),X=function(a,b,c){return"value"===b?a.val(c):b in R?a.prop(b,c):a.attr(b,c)},W=function(b,c,d,e){return null==e&&(e=a.identity),d instanceof q?U.autoSub(d.onSet,function(a){var d,f;return f=a[0],d=a[1],X(b,c,e(d))}):X(b,c,e(d))},V.mkAtts=H=function(a){return function(b){var c,d,e;return e=a.match(/[#](\w+)/),e&&(b.id=e[1]),c=a.match(/\.\w+/g),c&&(b["class"]=function(){var a,b,e;for(e=[],a=0,b=c.length;b>a;a++)d=c[a],e.push(d.replace(/^\./,""));return e}().join(" ")),b}({})},V.mktag=J=function(b){return function(d,e){var f,g,h,i,j,k,l,m,n,o;n=null==d&&null==e?[{},null]:d instanceof Object&&null!=e?[d,e]:a.isString(d)&&null!=e?[H(d),e]:null==e&&a.isString(d)||a.isNumber(d)||d instanceof Element||d instanceof t||d instanceof c||a.isArray(d)||d instanceof q||d instanceof p?[{},d]:[d,null],f=n[0],g=n[1],h=c("<"+b+"/>"),o=a.omit(f,a.keys(Y));for(j in o)m=o[j],W(h,j,m);null!=g&&(k=function(b){var d,e,f,g,h;for(h=[],f=0,g=b.length;g>f;f++)if(d=b[f],null!=d)if(a.isString(d)||a.isNumber(d))h.push(document.createTextNode(d));else if(d instanceof Element)h.push(d);else if(d instanceof t){if(e=c(d.html),1!==e.length)throw new Error("RawHtml must wrap a single element");h.push(e[0])}else{if(!(d instanceof c))throw new Error("Unknown element type in array: "+d.constructor.name+" (must be string, number, Element, RawHtml, or jQuery objects)");if(1!==d.length)throw new Error("jQuery object must wrap a single element");h.push(d[0])}else h.push(void 0);return h},l=function(b){var d;if(h.html(""),!a.isArray(b)){if(a.isString(b)||a.isNumber(b)||b instanceof Element||b instanceof t||b instanceof c)return l([b]);throw new Error("Unknown type for element contents: "+b.constructor.name+" (accepted types: string, number, Element, RawHtml, jQuery object of single element, or array of the aforementioned)")}d=k(b),h.append(d)},g instanceof p?U.autoSub(g.onChange,function(a){var b,c,d,e;return c=a[0],d=a[1],b=a[2],h.contents().slice(c,c+d.length).remove(),e=k(b),c===h.contents().length?h.append(e):h.contents().eq(c).before(e)}):g instanceof q?U.autoSub(g.onSet,function(a){var b,c;return b=a[0],c=a[1],l(c)}):l(g));for(i in f)i in Y&&Y[i](h,f[i],f,g);return h}},_=["html","head","title","base","link","meta","style","script","noscript","body","body","section","nav","article","aside","h1","h2","h3","h4","h5","h6","h1","h6","header","footer","address","main","main","p","hr","pre","blockquote","ol","ul","li","dl","dt","dd","dd","figure","figcaption","div","a","em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","ruby","rt","rp","bdi","bdo","span","br","wbr","ins","del","img","iframe","embed","object","param","object","video","audio","source","video","audio","track","video","audio","canvas","map","area","area","map","svg","math","table","caption","colgroup","col","tbody","thead","tfoot","tr","td","th","form","fieldset","legend","fieldset","label","input","button","select","datalist","optgroup","option","select","datalist","textarea","keygen","output","progress","meter","details","summary","details","menuitem","menu"],V.tags=a.object(function(){var a,b,c;for(c=[],a=0,b=_.length;b>a;a++)$=_[a],c.push([$,V.mktag($)]);return c}()),V.rawHtml=function(a){return new t(a)},V.importTags=function(b){return function(c){return a(null!=c?c:b).extend(V.tags)}}(this),V.cast=function(b,c){var d,e,f;if(null==c&&(c="cell"),!a.isString(c))return e=b,f=c,a.object(function(){var a;a=[];for(d in e)b=e[d],a.push([d,f[d]?V.cast(b,f[d]):b]);return a}());switch(c){case"array":if(b instanceof U.ObsArray)return b;if(a.isArray(b))return new U.DepArray(function(){return b});if(b instanceof U.ObsCell)return new U.DepArray(function(){return b.get()});throw new Error("Cannot cast to array: "+b.constructor.name);case"cell":return b instanceof U.ObsCell?b:A(function(){return b});default:return b}},V.trim=c.trim,V.dasherize=function(a){return V.trim(a).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},V.cssify=function(b){var c,d;return function(){var e;e=[];for(c in b)d=b[c],null!=d&&e.push(""+V.dasherize(c)+": "+(a.isNumber(d)?d+"px":d)+";");return e}().join(" ")},Y.style=function(b,c){return W(b,"style",c,function(b){return a.isString(b)?b:V.cssify(b)})},V.smushClasses=function(b){return a(b).chain().flatten().compact().value().join(" ").replace(/\s+/," ").trim()},Y["class"]=function(b,c){return W(b,"class",c,function(b){return a.isString(b)?b:V.smushClasses(b)})}}return U.rxt=V,U},function(a,b,c){var d,e;if(null!=("undefined"!=typeof define&&null!==define?define.amd:void 0))return define(c,b);if(null!=("undefined"!=typeof module&&null!==module?module.exports:void 0))return e=require("underscore"),d=b(e),module.exports=d;if(null!=a._&&null!=a.$)return a.rx=b(a._,a.$);throw"Dependencies are not met for reactive: _ and $ not found"}(this,a,["underscore","jquery"])}).call(this);