UNPKG

ractive

Version:

Next-generation DOM manipulation

2 lines 65.2 kB
!function(a){"use strict";var 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,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,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob="0.3.7",pb=a.document||null,qb={},rb={},sb={},tb={},ub={}.hasOwnProperty,vb=function(){},wb=a.console||{log:vb,warn:vb},xb="Missing Ractive.parse - cannot parse template. Either preparse or use the version that includes the parser",yb=1,zb=2,Ab=3,Bb=4,Cb=7,Db=8,Eb=15,Fb=30,Gb=pb?pb.createElement("div"):null,Hb={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};try{try{Object.defineProperty({},"test",{value:0}),Object.defineProperties({},{test:{value:0}})}catch(Ib){throw nb=!0,Ib}pb&&(Object.defineProperty(Gb,"test",{value:0}),Object.defineProperties(Gb,{test:{value:0}})),E=Object.defineProperty,F=Object.defineProperties}catch(Ib){E=function(a,b,c){a[b]=c.value},F=function(a,b){var c;for(c in b)b.hasOwnProperty(c)&&E(a,c,b[c])}}try{Object.create(null),G=Object.create,H=function(){return Object.create(null)}}catch(Ib){G=function(){var a=function(){};return function(b,c){var d;return a.prototype=b,d=new a,c&&Object.defineProperties(d,c),d}}(),H=function(){return{}}}var Jb,Kb,Lb,Mb=function(a){return a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()})};!function(){pb&&(void 0!==Gb.style.transition?(Kb="transition",Lb="transitionend",Jb=!0):void 0!==Gb.style.webkitTransition?(Kb="webkitTransition",Lb="webkitTransitionEnd",Jb=!0):Jb=!1)}(),a.Node&&!a.Node.prototype.contains&&a.HTMLElement&&a.HTMLElement.prototype.contains&&(a.Node.prototype.contains=a.HTMLElement.prototype.contains),function(){var a,b,c,d,e,f,g,h,i,j,k;P=function(){var b,d,e,f=this.parentNode;return this.fragment?(b=a(this))?(this.interpolator=b,this.keypath=b.keypath||b.descriptor.r,(d=c(this))?(f._ractive.binding=d,this.twoway=!0,e=this.root._twowayBindings[this.keypath]||(this.root._twowayBindings[this.keypath]=[]),e[e.length]=d,!0):!1):!1:!1},b=function(){this._ractive.binding.update()},a=function(a){var b;return 1!==a.fragment.items.length?null:(b=a.fragment.items[0],b.type!==zb?null:b.keypath||b.ref?b:null)},c=function(a){var b=a.parentNode;if("SELECT"===b.tagName)return b.multiple?new e(a,b):new f(a,b);if("checkbox"===b.type||"radio"===b.type){if("name"===a.propertyName){if("checkbox"===b.type)return new h(a,b);if("radio"===b.type)return new g(a,b)}return"checked"===a.propertyName?new i(a,b):null}return"value"!==a.propertyName&&wb.warn("This is... odd"),"file"===a.parentNode.type?new j(a,b):new k(a,b)},e=function(a,c){var e;d(this,a,c),c.addEventListener("change",b,!1),e=this.root.get(this.keypath),void 0===e&&this.update()},e.prototype={value:function(){var a,b,c,d;for(a=[],b=this.node.options,d=b.length,c=0;d>c;c+=1)b[c].selected&&(a[a.length]=b[c]._ractive.value);return a},update:function(){var a,b,c;a=this.attr,b=a.value,c=this.value(),void 0!==b&&Tb(c,b)||(a.receiving=!0,a.value=c,this.root.set(this.keypath,c),a.receiving=!1)},teardown:function(){this.node.removeEventListener("change",b,!1)}},f=function(a,c){var e;d(this,a,c),c.addEventListener("change",b,!1),e=this.root.get(this.keypath),void 0===e&&this.update()},f.prototype={value:function(){var a,b,c;for(a=this.node.options,c=a.length,b=0;c>b;b+=1)if(a[b].selected)return a[b]._ractive.value},update:function(){var a=this.value();this.attr.receiving=!0,this.attr.value=a,this.root.set(this.keypath,a),this.attr.receiving=!1},teardown:function(){this.node.removeEventListener("change",b,!1)}},g=function(a,c){var e;this.radioName=!0,d(this,a,c),c.name="{{"+a.keypath+"}}",c.addEventListener("change",b,!1),c.attachEvent&&c.addEventListener("click",b,!1),e=this.root.get(this.keypath),void 0!==e?c.checked=e===c._ractive.value:this.root._defRadios[this.root._defRadios.length]=this},g.prototype={value:function(){return this.node._ractive?this.node._ractive.value:this.node.value},update:function(){var a=this.node;a.checked&&(this.attr.receiving=!0,this.root.set(this.keypath,this.value()),this.attr.receiving=!1)},teardown:function(){this.node.removeEventListener("change",b,!1),this.node.removeEventListener("click",b,!1)}},h=function(a,c){var e,f;this.checkboxName=!0,d(this,a,c),c.name="{{"+this.keypath+"}}",c.addEventListener("change",b,!1),c.attachEvent&&c.addEventListener("click",b,!1),e=this.root.get(this.keypath),void 0!==e?(f=-1!==e.indexOf(c._ractive.value),c.checked=f):-1===this.root._defCheckboxes.indexOf(this.keypath)&&(this.root._defCheckboxes[this.root._defCheckboxes.length]=this.keypath)},h.prototype={changed:function(){return this.node.checked!==!!this.checked},update:function(){this.checked=this.node.checked,this.attr.receiving=!0,this.root.set(this.keypath,Ob(this.root,this.keypath)),this.attr.receiving=!1},teardown:function(){this.node.removeEventListener("change",b,!1),this.node.removeEventListener("click",b,!1)}},i=function(a,c){d(this,a,c),c.addEventListener("change",b,!1),c.attachEvent&&c.addEventListener("click",b,!1)},i.prototype={value:function(){return this.node.checked},update:function(){this.attr.receiving=!0,this.root.set(this.keypath,this.value()),this.attr.receiving=!1},teardown:function(){this.node.removeEventListener("change",b,!1),this.node.removeEventListener("click",b,!1)}},j=function(a,c){d(this,a,c),c.addEventListener("change",b,!1)},j.prototype={value:function(){return this.attr.parentNode.files},update:function(){this.attr.root.set(this.attr.keypath,this.value())},teardown:function(){this.node.removeEventListener("change",b,!1)}},k=function(a,c){d(this,a,c),c.addEventListener("change",b,!1),this.root.lazy||(c.addEventListener("input",b,!1),c.attachEvent&&c.addEventListener("keyup",b,!1))},k.prototype={value:function(){var a=this.attr.parentNode.value;return+a+""===a&&-1===a.indexOf("e")&&(a=+a),a},update:function(){var a=this.attr,b=this.value();a.receiving=!0,a.root.set(a.keypath,b),a.receiving=!1},teardown:function(){this.node.removeEventListener("change",b,!1),this.node.removeEventListener("input",b,!1),this.node.removeEventListener("keyup",b,!1)}},d=function(a,b,c){a.attr=b,a.node=c,a.root=b.root,a.keypath=b.keypath}}(),function(){var a,b,c,d,e,f,g,h;O=function(){var d;if(!this.ready)return this;if(d=this.parentNode,"SELECT"===d.tagName&&"value"===this.name)return this.update=b,this.deferredUpdate=c,this.update();if(this.isFileInputValue)return this.update=a,this;if(this.twoway&&"name"===this.name){if("radio"===d.type)return this.update=f,this.update();if("checkbox"===d.type)return this.update=g,this.update()}return this.update=h,this.update()},a=function(){return this},c=function(){this.deferredUpdate=this.parentNode.multiple?e:d,this.deferredUpdate()},b=function(){return this.root._defSelectValues.push(this),this},d=function(){var a,b,c,d=this.fragment.getValue();for(this.value=d,a=this.parentNode.options,c=a.length;c--;)if(b=a[c],b._ractive.value===d)return b.selected=!0,this;return this},e=function(){var a,b,c=this.fragment.getValue();for(r(c)||(c=[c]),a=this.parentNode.options,b=a.length;b--;)a[b].selected=-1!==c.indexOf(a[b]._ractive.value);return this.value=c,this},f=function(){var a,b;return a=this.parentNode,b=this.fragment.getValue(),a.checked=b===a._ractive.value,this},g=function(){var a,b;return a=this.parentNode,b=this.fragment.getValue(),r(b)?(a.checked=-1!==b.indexOf(a._ractive.value),this):(a.checked=b===a._ractive.value,this)},h=function(){var a,b;if(a=this.parentNode,b=this.fragment.getValue(),this.isValueAttribute&&(a._ractive.value=b),void 0===b&&(b=""),b!==this.value){if(this.useProperty)return this.receiving||(a[this.propertyName]=b),this.value=b,this;if(this.namespace)return a.setAttributeNS(this.namespace,this.name,b),this.value=b,this;"id"===this.name&&(void 0!==this.value&&(this.root.nodes[this.value]=void 0),this.root.nodes[b]=a),a.setAttribute(this.name,b),this.value=b}return this}}(),I=function(a,b){var c,d,e;for(d in b)if(ub.call(b,d))for(e=d.split("-"),c=e.length;c--;)J(a,e[c],b[d],a.parentFragment.contextStack)},function(){var a,c,d,e,f,g,h,i;J=function(b,c,d,e,f){var g,h;g=b.ractify().events,h=g[c]||(g[c]=new a(b,c,e,f)),h.add(d)},a=function(a,c,d){var e;this.element=a,this.root=a.root,this.node=a.node,this.name=c,this.contextStack=d,this.proxies=[],(e=this.root.eventDefinitions[c]||b.eventDefinitions[c])?this.custom=e(this.node,i(c)):this.node.addEventListener(c,h,!1)},a.prototype={add:function(a){this.proxies[this.proxies.length]=new c(this.element,this.root,a,this.contextStack)},teardown:function(){var a;for(this.custom?this.custom.teardown():this.node.removeEventListener(this.name,h,!1),a=this.proxies.length;a--;)this.proxies[a].teardown()},fire:function(a){for(var b=this.proxies.length;b--;)this.proxies[b].fire(a)}},c=function(a,b,c,g){var h;return this.root=b,h=c.n||c,this.n="string"==typeof h?h:new Z({descriptor:c.n,root:this.root,owner:a,contextStack:g}),c.a?(this.a=c.a,this.fire=e,void 0):c.d?(this.d=new Z({descriptor:c.d,root:this.root,owner:a,contextStack:g}),this.fire=f,void 0):(this.fire=d,void 0)},c.prototype={teardown:function(){this.n.teardown&&this.n.teardown(),this.d&&this.d.teardown()},bubble:vb},d=function(a){this.root.fire(this.n.toString(),a)},e=function(a){this.root.fire(this.n.toString(),a,this.a)},f=function(a){this.root.fire(this.n.toString(),a,this.d.toJSON())},h=function(a){var b=this._ractive;b.events[a.type].fire({node:this,original:a,index:b.index,keypath:b.keypath,context:b.root.get(b.keypath)})},g={},i=function(a){return g[a]?g[a]:g[a]=function(b){var c=b.node._ractive;b.index=c.index,b.keypath=c.keypath,b.context=c.root.get(c.keypath),c.events[a].fire(b)}}}(),K=function(a,b,c,d){"string"!=typeof c.f||b&&b.namespaceURI&&b.namespaceURI!==Hb.html?"style"===c.e&&void 0!==b.styleSheet?(a.fragment=new Z({descriptor:c.f,root:a.root,contextStack:a.parentFragment.contextStack,owner:a}),d&&(a.bubble=function(){b.styleSheet.cssText=a.fragment.toString()})):(a.fragment=new Q({descriptor:c.f,root:a.root,parentNode:b,contextStack:a.parentFragment.contextStack,owner:a}),d&&b.appendChild(a.fragment.docFrag)):(a.html=c.f,d&&(b.innerHTML=a.html))},L=function(a,b){switch(a.ractify(),a.descriptor.e){case"select":case"textarea":return b.value&&b.value.bind(),void 0;case"input":if("radio"===a.node.type||"checkbox"===a.node.type){if(b.name&&b.name.bind())return;if(b.checked&&b.checked.bind())return}if(b.value&&b.value.bind())return}},M=function(a,b){var c,d,e;a.attributes=[];for(c in b)ub.call(b,c)&&(d=b[c],e=new S({element:a,name:c,value:d,root:a.root,parentNode:a.node,contextStack:a.parentFragment.contextStack}),a.attributes[a.attributes.length]=e,("value"===c||"name"===c||"checked"===c)&&(a.attributes[c]=e),"name"!==c&&e.update());return a.attributes},N=function(a,b){return a.a&&a.a.xmlns?a.a.xmlns:"svg"===a.e.toLowerCase()?Hb.svg:b.namespaceURI},y=function(a,c,d,e,f){var g,h,i,j,k;c.transitionsEnabled&&("string"==typeof a?g=a:(g=a.n,a.a?h=a.a:a.d&&(i=new Z({descriptor:a.d,root:c,owner:d,contextStack:d.parentFragment.contextStack}),h=i.toJSON(),i.teardown())),k=c.transitions[g]||b.transitions[g],k&&(j=c._transitionManager,j.push(d.node),k.call(c,d.node,function(){j.pop(d.node)},h,f)))},A=function(a,b){return a.components[b]},function(){var a={};w=function(b,c,d){var e,f=[];for(e=a[c]||(a[c]=pb.createElement(c)),e.innerHTML=b;e.firstChild;)f[f.length]=e.firstChild,d.appendChild(e.firstChild);return f}}(),function(){var a,b,c;x=function(b,c,d,e,f){var g,h,i,j,k,l,m;for(i=c.descriptor.i,g=d;e>g;g+=1)h=c.fragments[g],j=g-f,k=g,l=c.keypath+"."+(g-f),m=c.keypath+"."+g,h.index+=f,a(h,i,j,k,f,l,m);p(b)},a=function(d,e,f,g,h,i,j){var k,l,m;for(d.indexRefs&&void 0!==d.indexRefs[e]&&(d.indexRefs[e]=g),k=d.contextStack.length;k--;)m=d.contextStack[k],m.substr(0,i.length)===i&&(d.contextStack[k]=m.replace(i,j));for(k=d.items.length;k--;)switch(l=d.items[k],l.type){case Cb:b(l,e,f,g,h,i,j);break;case Db:a(l.fragment,e,f,g,h,i,j);break;case Bb:case zb:case Ab:c(l,e,f,g,h,i,j)}},b=function(b,c,d,e,f,g,h){var i,j,k,l,m,n;for(i=b.attributes.length;i--;)j=b.attributes[i],j.fragment&&(a(j.fragment,c,d,e,f,g,h),j.twoway&&j.updateBindings());if(k=b.node._ractive){k.keypath.substr(0,g.length)===g&&(k.keypath=k.keypath.replace(g,h)),void 0!==c&&(k.index[c]=e);for(l in k.events)for(m=k.events[l].proxies,i=m.length;i--;)n=m[i],"object"==typeof n.n&&a(n.a,c,d,e,f,g,h),n.d&&a(n.d,c,d,e,f,g,h);k.binding&&k.binding.keypath.substr(0,g.length)===g&&(k.binding.keypath=k.binding.keypath.replace(g,h))}b.fragment&&a(b.fragment,c,d,e,f,g,h)},c=function(b,c,d,e,f,g,h){var i;if(b.descriptor.x&&(b.keypath&&k(b),b.expressionResolver&&b.expressionResolver.teardown(),b.expressionResolver=new bb(b)),b.keypath?b.keypath.substr(0,g.length)===g&&b.resolve(b.keypath.replace(g,h)):b.indexRef===c&&(b.value=e,b.render(e)),b.fragments)for(i=b.fragments.length;i--;)a(b.fragments[i],c,d,e,f,g,h)}}(),function(a){var b,c,d,e,f;cb=function(a,c,e,f,g){var h,i;for(this.root=a,this.keypath=c,this.priority=g,this.dependants=0,this.fn=d(e,f.length),this.values=[],this.refs=[],h=f.length;h--;)(i=f[h])?i[0]?this.values[h]=i[1]:this.refs[this.refs.length]=new b(a,i[1],this,h,g):this.values[h]=void 0;this.selfUpdating=this.refs.length<=1},cb.prototype={wake:function(){this.awake=!0,this.update()},sleep:function(){this.awake=!1},bubble:function(){this.awake&&(this.selfUpdating?this.update():this.deferred||(this.root._defEvals[this.root._defEvals.length]=this,this.deferred=!0))},update:function(){var a;if(this.evaluating)return this;this.evaluating=!0;try{a=this.fn.apply(null,this.values)}catch(b){if(this.root.debug)throw b;a=void 0}return u(a,this.value)||(i(this.root,this.keypath),this.root._cache[this.keypath]=a,l(this.root,this.keypath),this.value=a),this.evaluating=!1,this},teardown:function(){for(;this.refs.length;)this.refs.pop().teardown();i(this.root,this.keypath),this.root._evaluators[this.keypath]=null},refresh:function(){this.selfUpdating||(this.deferred=!0);for(var a=this.refs.length;a--;)this.refs[a].update();this.deferred&&(this.update(),this.deferred=!1)},updateSoftDependencies:function(a){var b,d,e;for(this.softRefs||(this.softRefs=[]),b=this.softRefs.length;b--;)e=this.softRefs[b],a[e.keypath]||(this.softRefs.splice(b,1),this.softRefs[e.keypath]=!1,e.teardown());for(b=a.length;b--;)d=a[b],this.softRefs[d]||(e=new c(this.root,d,this),this.softRefs[this.softRefs.length]=e,this.softRefs[d]=!0);this.selfUpdating=this.refs.length+this.softRefs.length<=1}},b=function(a,b,c,d,e){var g;this.evaluator=c,this.keypath=b,this.root=a,this.argNum=d,this.type=Fb,this.priority=e,g=a.get(b),"function"==typeof g&&(g=g._wrapped||f(g,a,c)),this.value=c.values[d]=g,j(this)},b.prototype={update:function(){var a=this.root.get(this.keypath);"function"!=typeof a||a._nowrap||(a=a["_"+this.root._guid]||f(a,this.root,this.evaluator)),u(a,this.value)||(this.evaluator.values[this.argNum]=a,this.evaluator.bubble(),this.value=a)},teardown:function(){k(this)}},c=function(a,b,c){this.root=a,this.keypath=b,this.priority=c.priority,this.evaluator=c,j(this)},c.prototype={update:function(){var a=this.root.get(this.keypath);u(a,this.value)||(this.evaluator.bubble(),this.value=a)},teardown:function(){k(this)}},d=function(b,c){var d,e;if(b=b.replace(/\$\{([0-9]+)\}/g,"_$1"),a[b])return a[b];for(e=[];c--;)e[c]="_"+c;return d=new Function(e.join(","),"return("+b+")"),a[b]=d,d},e=/this/,f=function(a,b,c){var d;if(!e.test(a.toString()))return E(a,"_nowrap",{value:!0}),a;E(a,"_"+b._guid,{value:function(){var d,e,f;return d=b.get,b.get=function(a){return f||(f=[]),f[a]||(f[f.length]=a,f[a]=!0),d.call(b,a)},e=a.apply(b,arguments),f&&c.updateSoftDependencies(f),b.get=d,e},writable:!0});for(d in a)ub.call(a,d)&&(a["_"+b._guid][d]=a[d]);return a["_"+b._guid]}}({}),function(){var a,b;bb=function(b){var c,d,e,f,g;if(this.root=b.root,this.mustache=b,this.args=[],this.scouts=[],c=b.descriptor.x,g=b.parentFragment.indexRefs,this.str=c.s,e=this.unresolved=this.args.length=c.r?c.r.length:0,!e)return this.resolved=this.ready=!0,this.bubble(),void 0;for(d=0;e>d;d+=1)f=c.r[d],g&&void 0!==g[f]?this.resolveRef(d,!0,g[f]):this.scouts[this.scouts.length]=new a(this,f,b.contextStack,d);this.ready=!0,this.bubble()},bb.prototype={bubble:function(){this.ready&&(this.keypath=b(this.str,this.args),this.createEvaluator(),this.mustache.resolve(this.keypath))},teardown:function(){for(;this.scouts.length;)this.scouts.pop().teardown()},resolveRef:function(a,b,c){this.args[a]=[b,c],this.bubble(),this.resolved=!--this.unresolved},createEvaluator:function(){this.root._evaluators[this.keypath]?this.root._evaluators[this.keypath].refresh():this.root._evaluators[this.keypath]=new cb(this.root,this.keypath,this.str,this.args,this.mustache.priority)}},a=function(a,b,c,d){var e,f;f=this.root=a.root,e=o(f,b,c),e?a.resolveRef(d,!1,e):(this.ref=b,this.argNum=d,this.resolver=a,this.contextStack=c,f._pendingResolution[f._pendingResolution.length]=this)},a.prototype={resolve:function(a){this.keypath=a,this.resolver.resolveRef(this.argNum,!1,a)},teardown:function(){this.keypath||h(this)}},b=function(a,b){var c;return c=a.replace(/\$\{([0-9]+)\}/g,function(a,c){return b[c]?b[c][1]:"undefined"}),"("+c.replace(/[\.\[\]]/g,"-")+")"}}(),function(){var a,c;z=function(d,e){var f,g;if(g=a(d,e))return g;if(g=a(b,e))return g;if(pb&&(f=pb.getElementById(e),f&&"SCRIPT"===f.tagName)){if(!b.parse)throw new Error(xb);b.partials[e]=b.parse(f.innerHTML)}return g=b.partials[e],g?c(g):(d.debug&&wb&&wb.warn&&wb.warn('Could not find descriptor for partial "'+e+'"'),[])},a=function(a,d){var e,f;if(a.partials[d]){if("string"==typeof a.partials[d]){if(!b.parse)throw new Error(xb);if(e=b.parse(a.partials[d],a.parseOptions),s(e)){a.partials[d]=e.main;for(f in e.partials)e.partials.hasOwnProperty(f)&&(a.partials[f]=e.partials[f])}else a.partials[d]=e}return c(a.partials[d])}},c=function(a){return 1===a.length&&"string"==typeof a[0]?a[0]:a}}(),ib=function(a,b){var c,d,e,f,g;if(a.owner=b.owner,e=a.owner.parentFragment,a.root=b.root,a.parentNode=b.parentNode,a.contextStack=b.contextStack||[],a.owner.type===Bb&&(a.index=b.index),e&&(f=e.indexRefs)){a.indexRefs=H();for(g in f)a.indexRefs[g]=f[g]}for(a.priority=e?e.priority+1:1,b.indexRef&&(a.indexRefs||(a.indexRefs={}),a.indexRefs[b.indexRef]=b.index),a.items=[],c=b.descriptor?b.descriptor.length:0,d=0;c>d;d+=1)a.items[a.items.length]=a.createItem({parentFragment:a,descriptor:b.descriptor[d],index:d})},B=function(a){var b,c,d;for(b=a.items.length;b--;)if(c=a.items[b],c.type!==yb){if(c.type!==zb)return!1;if(d)return!1;d=!0}return!0},fb=function(a,b){var c,d,e;e=a.parentFragment=b.parentFragment,a.root=e.root,a.contextStack=e.contextStack,a.descriptor=b.descriptor,a.index=b.index||0,a.priority=e.priority,e.parentNode&&(a.parentNode=e.parentNode),a.type=b.descriptor.t,b.descriptor.r&&(e.indexRefs&&void 0!==e.indexRefs[b.descriptor.r]?(d=e.indexRefs[b.descriptor.r],a.indexRef=b.descriptor.r,a.value=d,a.render(a.value)):(c=o(a.root,b.descriptor.r,a.contextStack),c?a.resolve(c):(a.ref=b.descriptor.r,a.root._pendingResolution[a.root._pendingResolution.length]=a,a.descriptor.n&&a.render(!1)))),b.descriptor.x&&(a.expressionResolver=new bb(a))},gb=function(){var a=this.root.get(this.keypath,!0);u(a,this.value)||(this.render(a),this.value=a)},hb=function(a){this.resolved&&k(this),this.keypath=a,j(this),this.update(),this.expressionResolver&&this.expressionResolver.resolved&&(this.expressionResolver=null),this.resolved=!0},function(){var a,b,c,d;jb=function(e,f){var g;return g={descriptor:e.descriptor.f,root:e.root,parentNode:e.parentNode,owner:e},e.descriptor.n?(d(e,f,!0,g),void 0):(r(f)?a(e,f,g):s(f)?e.descriptor.i?b(e,f,g):c(e,g):d(e,f,!1,g),void 0)},a=function(a,b,c){var d,e,f;if(e=b.length,e<a.length)for(f=a.fragments.splice(e,a.length-e);f.length;)f.pop().teardown(!0);else if(e>a.length)for(d=a.length;e>d;d+=1)c.contextStack=a.contextStack.concat(a.keypath+"."+d),c.index=d,a.descriptor.i&&(c.indexRef=a.descriptor.i),a.fragments[d]=a.createFragment(c);a.length=e},b=function(a,b,c){var d,e;e=a.fragmentsById||(a.fragmentsById=H());for(d in e)void 0===b[d]&&e[d]&&(e[d].teardown(!0),e[d]=null);for(d in b)void 0===b[d]||e[d]||(c.contextStack=a.contextStack.concat(a.keypath+"."+d),c.index=d,a.descriptor.i&&(c.indexRef=a.descriptor.i),e[d]=a.createFragment(c))},c=function(a,b){a.length||(b.contextStack=a.contextStack.concat(a.keypath),b.index=0,a.fragments[0]=a.createFragment(b),a.length=1)},d=function(a,b,c,d){var e,f,g;if(f=r(b)&&0===b.length,e=c?f||!b:b&&!f){if(a.length||(d.contextStack=a.contextStack,d.index=0,a.fragments[0]=a.createFragment(d),a.length=1),a.length>1)for(g=a.fragments.splice(1);g.length;)g.pop().teardown(!0)}else a.length&&(a.teardownFragments(!0),a.length=0)}}(),function(a){var b=function(a,b,c){var d;if("string"==typeof b&&t(c)){if(d=a.get(b),void 0===d&&(d=0),t(d))a.set(b,d+c);else if(a.debug)throw new Error("Cannot add to a non-numeric value")}else if(a.debug)throw new Error("Bad arguments")};a.add=function(a,c){b(this,a,void 0===c?1:c)},a.subtract=function(a,c){b(this,a,void 0===c?-1:-c)},a.toggle=function(a){var b;if("string"==typeof a)b=this.get(a),this.set(a,!b);else if(this.debug)throw new Error("Bad arguments")}}(qb),function(a){var c,d;a.animate=function(a,b,d){var e,f,g;if("object"==typeof a){d=b||{},g=[];for(e in a)ub.call(a,e)&&(g[g.length]=c(this,e,a[e],d));return{stop:function(){for(;g.length;)g.pop().stop()}}}return d=d||{},f=c(this,a,b,d),{stop:function(){f.stop()}}},d={stop:vb},c=function(a,c,e,f){var g,h,i,j,k;for(k=a.get(c),j=kb.animations.length;j--;)i=kb.animations[j],i.root===a&&i.keypath===c&&i.stop();return u(k,e)?(f.complete&&f.complete(1,f.to),d):(f.easing&&(g="function"==typeof f.easing?f.easing:a.easing&&a.easing[f.easing]?a.easing[f.easing]:b.easing[f.easing],"function"!=typeof g&&(g=null)),h=void 0===f.duration?400:f.duration,i=new db({keypath:c,from:k,to:e,root:a,duration:h,easing:g,step:f.step,complete:f.complete}),kb.push(i),a._animations[a._animations.length]=i,i)}}(qb),qb.cancelFullscreen=function(){b.cancelFullscreen(this.el)},qb.find=function(a){return this.el?this.el.querySelector(a):null},function(){var a,b;qb.findAll=function(c,d){var e;if(!this.el)return[];if(d){if(a.test(c))return this.el.getElementsByTagName(c);if(b.test(c))return this.el.getElementsByClassName(c.substring(1));if(e='Could not generate live nodelist from "'+c+'" selector',this.debug)throw new Error(e);wb&&wb.warn&&wb.warn(e)}return this.el.querySelectorAll(c)},a=/^[a-zA-Z][a-zA-Z0-9\-]*$/,b=/^\.[^\s]+$/g}(),qb.fire=function(a){var b,c,d,e=this._subs[a];if(e)for(b=Array.prototype.slice.call(arguments,1),c=0,d=e.length;d>c;c+=1)e[c].apply(this,b)},function(a){var c,d,e,f,g={};a.get=function(a){var b,d,e,g,h;return a=Ub(a||""),b=this._cache,void 0!==(d=b[a])?d:((g=this._wrapped[a])?e=g.value:a?e=(h=this._evaluators[a])?h.value:c(this,a):(f(this,"",this.data),e=this.data),b[a]=e,e)},c=function(a,c){var d,e,g,h,i,j,k,l;return d=c.split("."),e=d.pop(),g=d.join("."),h=a.get(g),(l=a._wrapped[g])&&(h=l.get()),null!==h&&void 0!==h?((i=a._cacheMap[g])?-1===i.indexOf(c)&&(i[i.length]=c):a._cacheMap[g]=[c],j=h[e],f(a,c,j)?j:(a.magic&&(a._wrapped[c]=b.adaptors.magic.wrap(a,j,c)),a.modifyArrays&&(k=b.adaptors.array,k.filter(a,j,c)&&(a._wrapped[c]=k.wrap(a,j,c))),a._cache[c]=j,j)):void 0},d=function(a,b){var c,d={};if(!b)return a;b+=".";for(c in a)ub.call(a,c)&&(d[b+c]=a[c]);return d},e=function(a){var b;return g[a]||(b=a?a+".":"",g[a]=function(c,e){var f;return"string"==typeof c?(f={},f[b+c]=e,f):"object"==typeof c?b?d(c,a):c:void 0}),g[a]},f=function(a,c,d){var f,g,h;for(f=a.adaptors.length;f--;){if(g=a.adaptors[f],"string"==typeof g){if(!b.adaptors[g])throw new Error('Missing adaptor "'+g+'"');g=a.adaptors[f]=b.adaptors[g]}if(g.filter(d,c,a))return h=a._wrapped[c]=g.wrap(a,d,c,e(c)),a._cache[c]=d,!0}}}(qb);var Nb=function(a){var b,c,d;for(b=a._pendingResolution.length;b--;)c=a._pendingResolution.splice(b,1)[0],d=o(a,c.ref,c.contextStack),void 0!==d?c.resolve(d):a._pendingResolution[a._pendingResolution.length]=c};i=function(a,b){var c,d;if((d=a._wrapped[b])&&d.teardown()!==!1&&(a._wrapped[b]=null),a._cache[b]=void 0,c=a._cacheMap[b])for(;c.length;)i(a,c.pop())};var Ob=function(a,b){var c,d,e,f,g,h;for(c=[],h=a.rendered?a.el:a.fragment.docFrag,d=h.querySelectorAll('input[type="checkbox"][name="{{'+b+'}}"]'),f=d.length,g=0;f>g;g+=1)e=d[g],(e.hasAttribute("checked")||e.checked)&&(c[c.length]=e._ractive.value);return c};l=function(a,b,c){var d;for(d=0;d<a._deps.length;d+=1)n(a,b,d,c)},n=function(a,b,c,d){var e,f,g,h;if(e=a._deps[c]){if(f=e[b])for(g=f.length;g--;)f[g].update();if(!d&&(h=a._depsMap[b]))for(g=h.length;g--;)n(a,h[g],c)}},m=function(a,b,c){var d,e,f;for(f=b.length,d=0;d<a._deps.length;d+=1)if(a._deps[d])for(e=f;e--;)n(a,b[e],d,c)},p=function(a){for(var b,c,d;a._defEvals.length;)b=a._defEvals.pop(),b.update().deferred=!1;for(;a._defAttrs.length;)c=a._defAttrs.pop(),c.update().deferred=!1;for(;a._defSelectValues.length;)a._defSelectValues.pop().deferredUpdate();for(;a._defCheckboxes.length;)d=a._defCheckboxes.pop(),a.set(d,Ob(a,d));for(;a._defRadios.length;)a._defRadios.pop().update();for(;a._defObservers.length;)a._defObservers.pop().update(!0)},j=function(a){var b,c,d,e,f,g,h,i,j;for(g=a.root,h=a.keypath,i=a.priority,b=g._deps[i]||(g._deps[i]={}),c=b[h]||(b[h]=[]),c[c.length]=a,(j=g._evaluators[h])&&(j.dependants||j.wake(),j.dependants+=1),d=h.split(".");d.length;)d.pop(),e=d.join("."),f=g._depsMap[e]||(g._depsMap[e]=[]),void 0===f[h]&&(f[h]=0,f[f.length]=h),f[h]+=1,h=e},eb=function(a,b){var c,d;c=b.el?v(b.el):a.el,c&&!b.append&&(c.innerHTML=""),a._transitionManager=d=C(a,b.complete),a.fragment=new Q({descriptor:a.template,root:a,owner:a,parentNode:c}),p(a),c&&c.appendChild(a.fragment.docFrag),a._transitionManager=null,d.ready(),a.rendered=!0},o=function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n;if(n='Could not resolve reference - too many "../" prefixes',"."===b)return c.length?c[c.length-1]:"";if("."===b.charAt(0)){if(m=c[c.length-1],f=m?m.split("."):[],"../"===b.substr(0,3)){for(;"../"===b.substr(0,3);){if(!f.length)throw new Error(n);f.pop(),b=b.substring(3)}return f.push(b),f.join(".")}return m?m+b:b.substring(1)}for(d=b.split("."),e=d.pop(),h=d.length?"."+d.join("."):"",c=c.concat();c.length;)if(g=c.pop(),i=g+h,j=a.get(i),(k=a._wrapped[i])&&(j=k.get()),"object"==typeof j&&null!==j&&ub.call(j,e)){l=g+"."+b;break}return l||void 0===a.get(b)||(l=b),l},h=function(a){if(a.keypath)k(a);else{var b=a.root._pendingResolution.indexOf(a);-1!==b&&a.root._pendingResolution.splice(b,1)}},k=function(a){var b,c,d,e,f,g,h,i;for(f=a.root,g=a.keypath,h=a.priority,b=f._deps[h][g],b.splice(b.indexOf(a),1),c=g.split("."),(i=f._evaluators[g])&&(i.dependants-=1,i.dependants||i.sleep());c.length;)c.pop(),d=c.join("."),e=f._depsMap[d],e[g]-=1,e[g]||(e.splice(e.indexOf(g),1),e[g]=void 0),g=d},qb.link=function(a){var b=this;return function(c){b.set(a,c)}},function(a){var b,c;a.observe=function(a,c,d){var e,f=[];if("object"==typeof a){d=c||{};for(e in a)ub.call(a,e)&&(c=a[e],f[f.length]=b(this,e,c,d));return{cancel:function(){for(;f.length;)f.pop().cancel()}}}return b(this,a,c,d||{})},b=function(a,b,d,e){var f;return f=new c(a,b,d,e),e.init!==!1&&f.update(),f.ready=!0,j(f),{cancel:function(){k(f)}}},c=function(a,b,c,d){this.root=a,this.keypath=b,this.callback=c,this.defer=d.defer,this.priority=0,this.context=d.context||a},c.prototype={update:function(a){var b;if(this.defer&&!a&&this.ready)return this.root._defObservers.push(this),void 0;if(!this.updating){if(this.updating=!0,b=this.root.get(this.keypath,!0),!u(b,this.value)||!this.ready){try{this.callback.call(this.context,b,this.value)}catch(c){if(this.root.debug)throw c}this.value=b}this.updating=!1}}}}(qb),qb.off=function(a,b){var c,d;b||(a?this._subs[a]=[]:this._subs={}),c=this._subs[a],c&&(d=c.indexOf(b),-1!==d&&c.splice(d,1))},qb.on=function(a,b){var c,d,e=this;if("object"==typeof a){c=[];for(d in a)ub.call(a,d)&&(c[c.length]=this.on(d,a[d]));return{cancel:function(){for(;c.length;)c.pop().cancel()}}}return this._subs[a]?this._subs[a].push(b):this._subs[a]=[b],{cancel:function(){e.off(a,b)}}},qb.renderHTML=function(){return this.fragment.toString()},qb.requestFullscreen=function(){b.requestFullscreen(this.el)},qb.reset=function(a,b){var c,d;if("function"==typeof a&&(b=a,a={}),void 0!==a&&"object"!=typeof a)throw new Error("The reset method takes either no arguments, or an object containing new data");d=this._transitionManager,this._transitionManager=c=C(this,b),this.data=a||{},this._pendingResolution.length&&Nb(this),i(this,""),l(this,""),this.fire("reset",a),this._transitionManager=d,c.ready()},function(a){var b,c,d;a.set=function(a,d,e){var f,g,h,i,j,k,l;if(g=[],s(a)&&(f=a,e=d),f)for(a in f)ub.call(f,a)&&(d=f[a],a=Ub(a),b(this,a,d,g));else a=Ub(a),b(this,a,d,g);if(g.length){if(i=this._transitionManager,this._transitionManager=j=C(this,e),h=c(g),h.length&&m(this,h,!0),m(this,g),this._pendingResolution.length&&Nb(this),p(this),this._transitionManager=i,j.ready(),!this.firingChangeEvent){for(this.firingChangeEvent=!0,l={},k=g.length;k--;)l[g[k]]=this.get(g[k]);this.fire("change",l),this.firingChangeEvent=!1}return this}},b=function(a,b,c,e){var f,g,h,j,k,l,m,n,o;if(!(o=a._wrapped[b])||!o.reset||d(a,b,c,o,e)===!1){if(f=a._cache[b],h=a.get(b),g=b.split("."),l=[],h!==c){for((o=a._wrapped[""])?(o.set&&o.set(g.join("."),c),k=o.get()):k=a.data;g.length>1;)j=l[l.length]=g.shift(),m=l.join("."),(o=a._wrapped[m])?(o.set&&o.set(g.join("."),c),k=o.get()):(k[j]||(n||(n=m),k[j]=/^\s*[0-9]+\s*$/.test(g[0])?[]:{}),k=k[j]);j=g[0],k[j]=c}else if(c===f&&"object"!=typeof c)return;i(a,n||b),e[e.length]=b}},c=function(a){var b,c,d,e,f=[""];for(b=a.length;b--;)for(c=a[b],d=c.split(".");d.length>1;)d.pop(),e=d.join("."),f[e]||(f[f.length]=e,f[e]=!0);return f},d=function(a,b,c,d,e){var f,g,h,j;if(f=d.get(),!u(f,c)&&d.reset(c)===!1)return!1;if(c=d.get(),g=a._cache[b],!u(g,c)){if(a._cache[b]=c,h=a._cacheMap[b])for(j=h.length;j--;)i(a,h[j]);e[e.length]=b}}}(qb),qb.teardown=function(a){var b,c,d;for(this.fire("teardown"),d=this._transitionManager,this._transitionManager=c=C(this,a),this.fragment.teardown(!0);this._animations[0];)this._animations[0].stop();for(b in this._cache)i(this,b);this._transitionManager=d,c.ready()},qb.toggleFullscreen=function(){b.isFullscreen(this.el)?this.cancelFullscreen():this.requestFullscreen()},qb.update=function(a,b){var c,d;return"function"==typeof a&&(b=a,a=""),Nb(this),d=this._transitionManager,this._transitionManager=c=C(this,b),i(this,a||""),l(this,a||""),p(this),this._transitionManager=d,c.ready(),"string"==typeof a?this.fire("update",a):this.fire("update"),this},function(a){var b;a.updateModel=function(a,c){var d,e,f;if("string"!=typeof a&&(a="",c=!0),b(this,a,d={},e=[],c),f=e.length)for(;f--;)a=e[f],d[a]=Ob(this,a);this.set(d)},b=function(a,c,d,e,f){var g,h,i,j,k,l;if(g=a._twowayBindings[c])for(i=g.length;i--;)j=g[i],(!j.radioName||j.node.checked)&&(j.checkboxName?j.changed()&&!e[c]&&(e[c]=!0,e[e.length]=c):(k=j.attr.value,l=j.value(),Tb(k,l)||u(k,l)||(d[c]=l)));if(f&&(h=a._depsMap[c]))for(i=h.length;i--;)b(a,h[i],d,e,f)}}(qb),function(){var a,b,c,d,e,f,g;rb.array={filter:function(a,b,c){return"("!==c.charAt(0)&&r(b)&&(!b._ractive||!b._ractive.setting)},wrap:function(a,c,d){return new b(a,c,d)}},b=function(a,b,c){this.root=a,this.value=b,this.keypath=c,lb(b,c,a)},b.prototype={get:function(){return this.value},teardown:function(){return this.value._ractive.setting?!1:(mb(this.value,this.keypath,this.root),void 0)}},lb=function(a,b,d){var e,f,g;a._ractive?(e=a._ractive.roots,f=a._ractive.keypathsByGuid,f[d._guid]||(e[e.length]=d,f[d._guid]=[]),g=f[d._guid],-1===g.indexOf(b)&&(g[g.length]=b)):(E(a,"_ractive",{value:{roots:[d],keypathsByGuid:{}},configurable:!0}),a._ractive.keypathsByGuid[d._guid]=[b],c(a))},mb=function(a,b,c){var e,f,g,h;if(!a._ractive)throw new Error("Attempted to remove keypath from non-wrapped array. This error is unexpected - please send a bug report to @rich_harris"); if(e=a._ractive.roots,f=a._ractive.keypathsByGuid,!f[c._guid])throw new Error("Ractive instance was not listed as a dependent of this array. This error is unexpected - please send a bug report to @rich_harris");if(g=f[c._guid],h=g.indexOf(b),-1===h)throw new Error("Attempted to unlink non-linked keypath from array. This error is unexpected - please send a bug report to @rich_harris");g.splice(h,1),g.length||(e.splice(e.indexOf(c),1),f[c._guid]=null),e.length||d(a)},a=function(a,b,c){var d,e,f,g,h,j;j=a._ractive.keypathsByGuid,d=function(a){for(var b=a.length;b--;)e(a[b])},e=function(a){var b,c=a._transitionManager;a._transitionManager=b=C(a,vb),f(a,j[a._guid]),a._transitionManager=c,b.ready()},f=function(a,b){for(var c=b.length;c--;)g(a,b[c])},g=function(d,e){var f,g,j,k,n,o,q,r,s,t,u,v;if("sort"===b||"reverse"===b)return d.set(e,a),void 0;for(i(d,e),n=[],o=[],q=0;q<d._deps.length;q+=1)if(f=d._deps[q],f&&(g=f[e])){for(h(d,e,g,n,o),p(d);n.length;)n.pop().smartUpdate(b,c);for(;o.length;)o.pop().update()}if("splice"===b&&c.length>2&&c[1])for(r=Math.min(c[1],c.length-2),s=c[0],t=s+r,c[1]===c.length-2&&(v=!0),q=s;t>q;q+=1)u=e+"."+q,l(d,u);for(p(d),k=[],j=e.split(".");j.length;)j.pop(),k[k.length]=j.join(".");m(d,k,!0),v||l(d,e+".length",!0)},h=function(a,b,c,d,e){var f,g;for(f=c.length;f--;)g=c[f],g.type===Fb?g.update():g.keypath===b&&g.type===Bb&&g.parentNode?d[d.length]=g:e[e.length]=g},d(a._ractive.roots)},e=[],g=["pop","push","reverse","shift","sort","splice","unshift"],g.forEach(function(b){var c=function(){var c=Array.prototype[b].apply(this,arguments);return this._ractive.setting=!0,a(this,b,arguments),this._ractive.setting=!1,c};E(e,b,{value:c})}),f={},f.__proto__?(c=function(a){a.__proto__=e},d=function(a){delete a._ractive,a.__proto__=Array.prototype}):(c=function(a){var b,c;for(b=g.length;b--;)c=g[b],E(a,c,{value:e[c],configurable:!0})},d=function(a){var b;for(b=g.length;b--;)delete a[g[b]];delete a._ractive})}(),function(){var a;rb.magic={wrap:function(b,c,d){return new a(b,c,d)}},a=function(a,b,c){var d,e,f,g,h,i,j,k,l,m=this;if(this.ractive=a,this.keypath=c,d=c.split("."),this.prop=d.pop(),f=d.join("."),this.obj=a.get(f),g=this.originalDescriptor=Object.getOwnPropertyDescriptor(this.obj,this.prop),g&&g.set&&(h=g.set._ractiveWrappers))return-1===h.indexOf(this)&&(h[h.length]=this),void 0;if(g&&!g.configurable)throw new Error('Cannot use magic mode with property "'+e+'" - object is not configurable');g&&(this.value=g.value,i=g.get,j=g.set),k=i||function(){return m.value},l=function(a){var b,c,d;for(j&&j(a),b=l._ractiveWrappers,d=b.length;d--;)c=b[d],c.resetting||c.ractive.set(c.keypath,a)},l._ractiveWrappers=[this],Object.defineProperty(this.obj,this.prop,{get:k,set:l,enumerable:!0,configurable:!0})},a.prototype={get:function(){return this.value},reset:function(a){this.resetting=!0,this.value=a,this.obj[this.prop]=a,this.resetting=!1},teardown:function(){var a,b,c,d;a=Object.getOwnPropertyDescriptor(this.obj,this.prop),b=a.set,d=b._ractiveWrappers,d.splice(d.indexOf(this),1),d.length||(c=this.obj[this.prop],Object.defineProperty(this.obj,this.prop,this.originalDescriptor),this.obj[this.prop]=c)}}}(),c={linear:function(a){return a},easeIn:function(a){return Math.pow(a,3)},easeOut:function(a){return Math.pow(a-1,3)+1},easeInOut:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)}},sb.hover=function(a,b){var c,d;return c=function(c){a.contains(c.relatedTarget)||b({node:a,original:c,hover:!0})},d=function(c){a.contains(c.relatedTarget)||b({node:a,original:c,hover:!1})},a.addEventListener("mouseover",c,!1),a.addEventListener("mouseout",d,!1),{teardown:function(){a.removeEventListener("mouseover",c,!1),a.removeEventListener("mouseout",d,!1)}}},function(){var a=function(a){return function(b,c){var d;return b.addEventListener("keydown",d=function(d){var e=d.which||d.keyCode;e===a&&(d.preventDefault(),c({node:b,original:d}))},!1),{teardown:function(){b.removeEventListener("keydown",d,!1)}}}};sb.enter=a(13),sb.tab=a(9),sb.escape=a(27),sb.space=a(32),sb.leftarrow=a(37),sb.rightarrow=a(39),sb.downarrow=a(40),sb.uparrow=a(38)}(),sb.tap=function(a,b){var c,d,e,f,g;return f=5,g=400,c=function(c){var d,e,h,i,j,k,l;(void 0===c.which||1===c.which)&&(e=c.clientX,h=c.clientY,d=this,i=c.pointerId,j=function(a){a.pointerId==i&&(b({node:d,original:a}),l())},k=function(a){a.pointerId==i&&(Math.abs(a.clientX-e)>=f||Math.abs(a.clientY-h)>=f)&&l()},l=function(){a.removeEventListener("MSPointerUp",j,!1),pb.removeEventListener("MSPointerMove",k,!1),pb.removeEventListener("MSPointerCancel",l,!1),a.removeEventListener("pointerup",j,!1),pb.removeEventListener("pointermove",k,!1),pb.removeEventListener("pointercancel",l,!1),a.removeEventListener("click",j,!1),pb.removeEventListener("mousemove",k,!1)},window.navigator.pointerEnabled?(a.addEventListener("pointerup",j,!1),pb.addEventListener("pointermove",k,!1),pb.addEventListener("pointercancel",l,!1)):window.navigator.msPointerEnabled?(a.addEventListener("MSPointerUp",j,!1),pb.addEventListener("MSPointerMove",k,!1),pb.addEventListener("MSPointerCancel",l,!1)):(a.addEventListener("click",j,!1),pb.addEventListener("mousemove",k,!1)),setTimeout(l,g))},window.navigator.pointerEnabled?a.addEventListener("pointerdown",c,!1):window.navigator.msPointerEnabled?a.addEventListener("MSPointerDown",c,!1):a.addEventListener("mousedown",c,!1),d=function(c){var d,e,h,i,j,k,l,m;1===c.touches.length&&(i=c.touches[0],e=i.clientX,h=i.clientY,d=this,j=i.identifier,l=function(a){var c;c=a.changedTouches[0],c.identifier!==j&&m(),a.preventDefault(),b({node:d,original:a}),m()},k=function(a){var b;(1!==a.touches.length||a.touches[0].identifier!==j)&&m(),b=a.touches[0],(Math.abs(b.clientX-e)>=f||Math.abs(b.clientY-h)>=f)&&m()},m=function(){a.removeEventListener("touchend",l,!1),window.removeEventListener("touchmove",k,!1),window.removeEventListener("touchcancel",m,!1)},a.addEventListener("touchend",l,!1),window.addEventListener("touchmove",k,!1),window.addEventListener("touchcancel",m,!1),setTimeout(m,g))},a.addEventListener("touchstart",d,!1),("BUTTON"===a.tagName||"button"===a.type)&&(e=function(){var c,d;d=function(c){32===c.which&&b({node:a,original:c})},c=function(){a.removeEventListener("keydown",d,!1),a.removeEventListener("blur",c,!1)},a.addEventListener("keydown",d,!1),a.addEventListener("blur",c,!1)},a.addEventListener("focus",e,!1)),{teardown:function(){a.removeEventListener("pointerdown",c,!1),a.removeEventListener("MSPointerDown",c,!1),a.removeEventListener("mousedown",c,!1),a.removeEventListener("touchstart",d,!1),a.removeEventListener("focus",e,!1)}}},function(){var a,c,e,f,g,h,i,j,k,l,m,n,o;d=function(a){var c,d=this;return c=function(a){l(this,c,a||{})},c.prototype=G(d.prototype),d!==b&&f(c,d),h(c,a),i(c),j(c,a),k(c),c.extend=d.extend,c},m=["data","partials","transitions","eventDefinitions","components"],n=["el","template","complete","modifyArrays","twoway","lazy","append","preserveWhitespace","sanitize","noIntro","transitionsEnabled"],o=m.concat(n),f=function(a,b){m.forEach(function(d){b[d]&&(a[d]=c(b[d]))}),n.forEach(function(c){void 0!==b[c]&&(a[c]=b[c])})},g=function(a,b){return/_super/.test(a)?function(){var c,d=this._super;return this._super=b,c=a.apply(this,arguments),this._super=d,c}:a},h=function(a,b){var c,d;m.forEach(function(c){var d=b[c];d&&(a[c]?e(a[c],d):a[c]=d)}),n.forEach(function(c){void 0!==b[c]&&(a[c]=b[c])});for(c in b)ub.call(b,c)&&!ub.call(a.prototype,c)&&-1===o.indexOf(c)&&(d=b[c],a.prototype[c]="function"==typeof d&&"function"==typeof a.prototype[c]?g(d,a.prototype[c]):d)},i=function(a){var c;if("string"==typeof a.template){if(!b.parse)throw new Error(xb);if("#"===a.template.charAt(0)&&pb){if(c=pb.getElementById(a.template.substring(1)),!c||"SCRIPT"!==c.tagName)throw new Error("Could not find template element ("+a.template+")");a.template=b.parse(c.innerHTML,a)}else a.template=b.parse(a.template,a)}},j=function(a,b){s(a.template)&&(a.partials||(a.partials={}),e(a.partials,a.template.partials),b.partials&&e(a.partials,b.partials),a.template=a.template.main)},k=function(a){var c,d;if(a.partials)for(c in a.partials)if(ub.call(a.partials,c)){if("string"==typeof a.partials[c]){if(!b.parse)throw new Error(xb);d=b.parse(a.partials[c],a)}else d=a.partials[c];a.partials[c]=d}},l=function(d,e,f){!f.template&&e.template&&(f.template=e.template),m.forEach(function(b){f[b]?a(f[b],e[b]):e[b]&&(f[b]=c(e[b]))}),n.forEach(function(a){void 0===f[a]&&void 0!==e[a]&&(f[a]=e[a])}),d.beforeInit&&d.beforeInit.call(d,f),b.call(d,f),d.init&&d.init.call(d,f)},a=function(a,b){var c;for(c in b)ub.call(b,c)&&!ub.call(a,c)&&(a[c]=b[c])},c=function(a){var b,c={};for(b in a)ub.call(a,b)&&(c[b]=a[b]);return c},e=function(a,b){var c;for(c in b)ub.call(b,c)&&(a[c]=b[c])}}(),f=function(a,c){return t(a)&&t(c)?b.interpolators.number(+a,+c):r(a)&&r(c)?b.interpolators.array(a,c):s(a)&&s(c)?b.interpolators.object(a,c):function(){return c}},g={number:function(a,b){var c=b-a;return c?function(b){return a+b*c}:function(){return a}},array:function(a,c){var d,e,f,g;for(d=[],e=[],g=f=Math.min(a.length,c.length);g--;)e[g]=b.interpolate(a[g],c[g]);for(g=f;g<a.length;g+=1)d[g]=a[g];for(g=f;g<c.length;g+=1)d[g]=c[g];return function(a){for(var b=f;b--;)d[b]=e[b](a);return d}},object:function(a,c){var d,e,f,g,h=[];f={},e={};for(g in a)ub.call(a,g)&&(ub.call(c,g)?(h[h.length]=g,e[g]=b.interpolate(a[g],c[g])):f[g]=a[g]);for(g in c)ub.call(c,g)&&!ub.call(a,g)&&(f[g]=c[g]);return d=h.length,function(a){for(var b,c=d;c--;)b=h[c],f[b]=e[b](a);return f}}};var Pb,Qb,Rb=H();Pb=function(){return{}},Qb=function(){return[]},F(Rb,{preserveWhitespace:{enumerable:!0,value:!1},append:{enumerable:!0,value:!1},twoway:{enumerable:!0,value:!0},modifyArrays:{enumerable:!0,value:!0},data:{enumerable:!0,value:Pb},lazy:{enumerable:!0,value:!1},debug:{enumerable:!0,value:!1},transitions:{enumerable:!0,value:Pb},eventDefinitions:{enumerable:!0,value:Pb},noIntro:{enumerable:!0,value:!1},transitionsEnabled:{enumerable:!0,value:!0},magic:{enumerable:!0,value:!1},adaptors:{enumerable:!0,value:Qb}}),b=function(a){var c,d,e,f;for(c in Rb)void 0===a[c]&&(a[c]="function"==typeof Rb[c]?Rb[c]():Rb[c]);if(F(this,{_guid:{value:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b,c;return b=0|16*Math.random(),c="x"==a?b:8|3&b,c.toString(16)})},_subs:{value:H()},_cache:{value:{}},_cacheMap:{value:H()},_deps:{value:[]},_depsMap:{value:H()},_pendingResolution:{value:[]},_defAttrs:{value:[]},_defEvals:{value:[]},_defSelectValues:{value:[]},_defCheckboxes:{value:[]},_defRadios:{value:[]},_defObservers:{value:[]},_evaluators:{value:H()},_twowayBindings:{value:{}},_transitionManager:{value:null,writable:!0},_animations:{value:[]},nodes:{value:{}},_wrapped:{value:H()}}),this.modifyArrays=a.modifyArrays,this.magic=a.magic,this.twoway=a.twoway,this.lazy=a.lazy,this.debug=a.debug,this.magic&&nb)throw new Error("Getters and setters (magic mode) are not supported in this browser");if(a.el&&(this.el=v(a.el),!this.el&&this.debug))throw new Error("Could not find container element");if(this.data=a.data,this.components=a.components||{},this.transitions=a.transitions,this.eventDefinitions=a.eventDefinitions,this.adaptors=a.adaptors,d=a.template,"string"==typeof d){if(!b.parse)throw new Error(xb);if("#"===d.charAt(0)&&pb){if(e=pb.getElementById(d.substring(1)),!e)throw new Error("Could not find template element ("+d+")");f=b.parse(e.innerHTML,a)}else f=b.parse(d,a)}else f=d;if(s(f)?(this.partials=f.partials,f=f.main):this.partials={},f&&1===f.length&&"string"==typeof f[0]&&(f=f[0]),this.template=f,a.partials)for(c in a.partials)ub.call(a.partials,c)&&(this.partials[c]=a.partials[c]);this.parseOptions={preserveWhitespace:a.preserveWhitespace,sanitize:a.sanitize},this.transitionsEnabled=a.noIntro?!1:a.transitionsEnabled,eb(this,{el:this.el,append:a.append,complete:a.complete}),this.transitionsEnabled=a.transitionsEnabled},function(){var a,b,d,e;pb&&(a=function(a,b){var c,d={};for(c=b.length;c--;)d[b[c]]=a[b[c]];return d},b=function(a,b,c,d){for(var e,f=b.length;f--;)e=b[f],a.style[e]=c&&c[e]?"function"==typeof c[e]?c[e](d):c[e]:0},d=function(a,b){var c;if(!b)return a;for(c in b)ub.call(b,c)&&(a[c]=b[c]);return a},Jb&&(e=function(e,f,g,h){return"string"==typeof e&&(e=[e]),function(i,j,k,l){var m,n,o,p,q,r,s,t,u,v,w;k=Sb(k),r=k.duration||f.duration,c=Mb(k.easing||f.easing),s=k.delay||0,t=l?g:h,u=l?h:g,n=window.getComputedStyle(i),q=i.getAttribute("style"),l?(v=i.style.position,w=i.style.visibility,i.style.position="absolute",i.style.visibility="hidden",setTimeout(function(){o=a(n,e),t=g,u=d(o,h),i.style.position=v,i.style.visibility=w,b(i,e,t,k),setTimeout(p,0)},s)):setTimeout(function(){o=a(n,e),t=d(o,h),u=g,b(i,e,t,k),setTimeout(p,0)},s),p=function(){i.style[Kb+"Duration"]=r/1e3+"s",i.style[Kb+"Properties"]=e.map(Mb).join(","),i.style[Kb+"TimingFunction"]=c,m=function(){i.removeEventListener(Lb,m,!1),l&&i.setAttribute("style",q||""),j()},i.addEventListener(Lb,m,!1),b(i,e,u,k)}}},tb.slide=e(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom","overflowY"],{duration:400,easing:"easeInOut"},{overflowY:"hidden"},{overflowY:"hidden"}),tb.fade=e("opacity",{duration:300,easing:"linear"}),tb.fly=e(["opacity","left","position"],{duration:400,easing:"easeOut"},{position:"relative",left:"-500px"},{position:"relative",left:0})))}();var Sb=function(a){return"fast"===a?{duration:200}:"slow"===a?{duration:600}:t(a)?{duration:+a}:a||{}};!function(a){var b,c,d;pb&&(c=function(a,b,e){var f,g;return 1===a.nodeType&&(a.style.display=a._display),3===a.nodeType?(d(a,b,e),void 0):(f=Array.prototype.slice.call(a.childNodes),g=function(){return f.length?(c(f.shift(),g,e),void 0):(1===a.nodeType&&a.setAttribute("style",a._style||""),b(),void 0)},g(),void 0)},d=function(a,b,c){var d,e,f,g;return d=a._hiddenData,(e=d.length)?(g=0,f=setInterval(function(){var c,h,i,j,k;c=d.substr(0,g),h=d.substring(g),i=/^\w+/.exec(h),j=i?i[0].length:0,k=new Array(j+1).join(" "),a.data=c+k,g===e&&(clearInterval(f),delete a._hiddenData,b()),g+=1},c),void 0):(b(),void 0)},b=function(a,b,d){var e,f,g,h;d=Sb(d),e=d.interval||(d.speed?1e3/d.speed:d.duration?a.textContent.length/d.duration:4),f=a.getAttribute("style"),g=window.getComputedStyle(a),a.style.visibility="hidden",setTimeout(function(){var i,j,k;j=g.width,i=g.height,k=g.visibility,h(a),setTimeout(function(){a.style.width=j,a.style.height=i,a.style.visibility="visible",c(a,function(){a.setAttribute("style",f||""),b()},e)},d.delay||0)}),h=function(a){var b,c;if(1===a.nodeType&&(a._style=a.getAttribute("style"),a._display=window.getComputedStyle(a).display,a.style.display="none"),3===a.nodeType)return a._hiddenData=""+a.data,a.data="",void 0;for(b=Array.prototype.slice.call(a.childNodes),c=b.length;c--;)h(b[c])}},a.typewriter=b)}(tb),function(a){var b,c,d;if(pb){if(a.fullscreenEnabled=pb.fullscreenEnabled||pb.mozFullScreenEnabled||pb.webkitFullscreenEnabled,!a.fullscreenEnabled)return a.requestFullscreen=a.cancelFullscreen=vb,a.isFullscreen=function(){return!1},void 0;Gb.requestFullscreen?b="requestFullscreen":Gb.mozRequestFullScreen?b="mozRequestFullScreen":Gb.webkitRequestFullscreen&&(b="webkitRequestFullscreen"),a.requestFullscreen=function(a){a[b]&&a[b]()},pb.cancelFullscreen?c="cancelFullscreen":pb.mozCancelFullScreen?c="mozCancelFullScreen":pb.webkitCancelFullScreen&&(c="webkitCancelFullScreen"),a.cancelFullscreen=function(){pb[c]()},void 0!==pb.fullscreenElement?d="fullscreenElement":void 0!==pb.mozFullScreenElement?d="mozFullScreenElement":void 0!==pb.webkitFullscreenElement&&(d="webkitFullscreenElement"),a.isFullscreen=function(a){return a===pb[d]}}}(b),db=function(a){var c;this.startTime=Date.now();for(c in a)ub.call(a,c)&&(this[c]=a[c]);this.interpolator=b.interpolate(this.from,this.to),this.running=!0},db.prototype={tick:function(){var a,b,c,d,e;return this.running?(d=Date.now(),a=d-this.startTime,a>=this.duration?(this.root.set(this.keypath,this.to),this.step&&this.step(1,this.to),this.complete&&this.complete(1,this.to),e=this.root._animations.indexOf(this),-1===e&&wb&&wb.warn&&wb.warn("Animation was not found"),this.root._animations.splice(e,1),this.running=!1,!1):(b=this.easing?this.easing(a/this.duration):a/this.duration,c=this.interpolator(b),this.root.set(this.keypath,c),this.step&&this.step(b,c),!0)):!1},stop:function(){var a;this.running=!1,a=this.root._animations.indexOf(this),-1===a&&wb&&wb.warn&&wb.warn("Animation was not found"),this.root._animations.splice(a,1)}},kb={animations:[],tick:function(){var a,b;for(a=0;a<this.animations.length;a+=1)b=this.animations[a],b.tick()||this.animations.splice(a--,1);this.animations.length?D(this.boundTick):this.running=!1},boundTick:function(){kb.tick()},push:function(a){this.animations[this.animations.length]=a,this.running||(this.running=!0,this.tick())}},function(a,b,c){var d,e;if(c.requestAnimationFrame)return D=c.requestAnimationFrame,void 0;for(d=0;d<a.length&&!D;++d)D=c[a[d]+"RequestAnimationFrame"];D||(e=c.setTimeout,D=function(a){var c,d,f;return c=Date.now(),d=Math.max(0,16-(c-b)),f=e(function(){a(c+d)},d),b=c+d,f})}(["ms","moz","webkit","o"],0,a);var Tb=function(a,b){var c;if(!r(a)||!r(b))return!1;if(a.length!==b.length)return!1;for(c=a.length;c--;)if(a[c]!==b[c])return!1;return!0};!function(){var a,b,c,d;a={"accept-charset":"acceptCharset",accesskey:"accessKey",bgcolor:"bgColor","class":"className",codebase:"codeBase",colspan:"colSpan",contenteditable:"contentEditable",datetime:"dateTime",dirname:"dirName","for":"htmlFor","http-equiv":"httpEquiv",ismap:"isMap",maxlength:"maxLength",novalidate:"noValidate",pubdate:"pubDate",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"},S=function(a){return this.element=a.element,b(this,a.name),null===a.value||"string"==typeof a.value?(c(this,a),void 0):(this.root=a.root,this.parentNode=a.parentNode,this.parentFragment=this.element.