(function(){function g(a){throw a;}var i=void 0,j=!0,k=null,m=!1,n,r=this;function aa(){}
function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function s(a){return a!==i}function u(a){return"array"==ba(a)}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function v(a){return"string"==typeof a}function da(a){return"number"==typeof a}function w(a){return"function"==ba(a)}function x(a){var b=typeof a;return"object"==b&&a!=k||"function"==b}function z(a){return a[ea]||(a[ea]=++fa)}
var ea="closure_uid_"+Math.floor(2147483648*Math.random()).toString(36),fa=0;function ga(a,b,c){return a.call.apply(a.bind,arguments)}function ha(a,b,c){a||g(Error());if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}
function A(a,b,c){A=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ga:ha;return A.apply(k,arguments)}var ia=Date.now||function(){return+new Date};function B(a,b){function c(){}c.prototype=b.prototype;a.d=b.prototype;a.prototype=new c;a.prototype.constructor=a};function C(){0!=ja&&(this.uc=Error().stack,ka[z(this)]=this)}var ja=0,ka={};C.prototype.rb=m;C.prototype.o=function(){if(!this.rb&&(this.rb=j,this.m(),0!=ja)){var a=z(this);delete ka[a]}};C.prototype.m=function(){this.Xb&&la.apply(k,this.Xb);if(this.yb)for(;this.yb.length;)this.yb.shift()()};function la(a){for(var b=0,c=arguments.length;b<c;++b){var d=arguments[b];ca(d)?la.apply(k,d):d&&"function"==typeof d.o&&d.o()}};function ma(a,b){for(var c=1;c<arguments.length;c++)var d=String(arguments[c]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a}function na(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}function pa(a){if(!qa.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(ra,"&amp;"));-1!=a.indexOf("<")&&(a=a.replace(sa,"&lt;"));-1!=a.indexOf(">")&&(a=a.replace(ta,"&gt;"));-1!=a.indexOf('"')&&(a=a.replace(ua,"&quot;"));return a}var ra=/&/g,sa=/</g,ta=/>/g,ua=/\"/g,qa=/[&<>\"]/;var E=Array.prototype,va=E.indexOf?function(a,b,c){return E.indexOf.call(a,b,c)}:function(a,b,c){c=c==k?0:0>c?Math.max(0,a.length+c):c;if(v(a))return!v(b)||1!=b.length?-1:a.indexOf(b,c);for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},F=E.forEach?function(a,b,c){E.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=v(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},wa=E.filter?function(a,b,c){return E.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,h=v(a)?a.split(""):
a,l=0;l<d;l++)if(l in h){var p=h[l];b.call(c,p,l,a)&&(e[f++]=p)}return e},G=E.map?function(a,b,c){return E.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=v(a)?a.split(""):a,h=0;h<d;h++)h in f&&(e[h]=b.call(c,f[h],h,a));return e};function xa(a,b,c,d){if(a.reduce)return d?a.reduce(A(b,d),c):a.reduce(b,c);var e=c;F(a,function(c,h){e=b.call(d,e,c,h,a)});return e}
var ya=E.some?function(a,b,c){return E.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=v(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return j;return m};function za(a,b,c){b=Aa(a,b,c);return 0>b?k:v(a)?a.charAt(b):a[b]}function Aa(a,b,c){for(var d=a.length,e=v(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return f;return-1}function H(a,b){return 0<=va(a,b)}function Ba(a){if(!u(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0}
function Ca(a,b){var c=va(a,b);0<=c&&E.splice.call(a,c,1)}function I(a,b){var c=Aa(a,b,i);return 0<=c?(E.splice.call(a,c,1),j):m}function J(a){return E.concat.apply(E,arguments)}function K(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]}function Da(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c],e;if(u(d)||(e=ca(d))&&d.hasOwnProperty("callee"))a.push.apply(a,d);else if(e)for(var f=a.length,h=d.length,l=0;l<h;l++)a[f+l]=d[l];else a.push(d)}}
function Ea(a,b,c,d){E.splice.apply(a,L(arguments,1))}function L(a,b,c){return 2>=arguments.length?E.slice.call(a,b):E.slice.call(a,b,c)}function Fa(a){for(var b={},c=0,d=0;d<a.length;){var e=a[d++],f=x(e)?"o"+z(e):(typeof e).charAt(0)+e;Object.prototype.hasOwnProperty.call(b,f)||(b[f]=j,a[c++]=e)}a.length=c}function Ga(a){for(var b=[],c=0;c<arguments.length;c++){var d=arguments[c];u(d)?b.push.apply(b,Ga.apply(k,d)):b.push(d)}return b};var Ha,Ia,Ja,Ka,La;function Ma(){return r.navigator?r.navigator.userAgent:k}function Na(){return r.navigator}Ka=Ja=Ia=Ha=m;var Oa;if(Oa=Ma()){var Pa=Na();Ha=0==Oa.indexOf("Opera");Ia=!Ha&&-1!=Oa.indexOf("MSIE");(Ja=!Ha&&-1!=Oa.indexOf("WebKit"))&&Oa.indexOf("Mobile");Ka=!Ha&&!Ja&&"Gecko"==Pa.product}var Qa=Ha,M=Ia,N=Ka,Ra=Ja,Sa,Ta=Na();Sa=Ta&&Ta.platform||"";La=-1!=Sa.indexOf("Mac");Sa.indexOf("Win");Sa.indexOf("Linux");Na()&&(Na().appVersion||"").indexOf("X11");var Ua;
a:{var Va="",Wa;if(Qa&&r.opera)var Xa=r.opera.version,Va="function"==typeof Xa?Xa():Xa;else if(N?Wa=/rv\:([^\);]+)(\)|;)/:M?Wa=/MSIE\s+([^\);]+)(\)|;)/:Ra&&(Wa=/WebKit\/(\S+)/),Wa)var Ya=Wa.exec(Ma()),Va=Ya?Ya[1]:"";if(M){var Za,$a=r.document;Za=$a?$a.documentMode:i;if(Za>parseFloat(Va)){Ua=String(Za);break a}}Ua=Va}var cb={};
function O(a){var b;if(!(b=cb[a])){b=0;for(var c=na(String(Ua)).split("."),d=na(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var h=c[f]||"",l=d[f]||"",p=RegExp("(\\d*)(\\D*)","g"),t=RegExp("(\\d*)(\\D*)","g");do{var q=p.exec(h)||["","",""],y=t.exec(l)||["","",""];if(0==q[0].length&&0==y[0].length)break;b=((0==q[1].length?0:parseInt(q[1],10))<(0==y[1].length?0:parseInt(y[1],10))?-1:(0==q[1].length?0:parseInt(q[1],10))>(0==y[1].length?0:parseInt(y[1],10))?1:0)||((0==q[2].length)<
(0==y[2].length)?-1:(0==q[2].length)>(0==y[2].length)?1:0)||(q[2]<y[2]?-1:q[2]>y[2]?1:0)}while(0==b)}b=cb[a]=0<=b}return b}var db={};function eb(a){return db[a]||(db[a]=M&&!!document.documentMode&&document.documentMode>=a)};!M||eb(9);var fb=!M||eb(9),gb=M&&!O("9");!Ra||O("528");N&&O("1.9b")||M&&O("8")||Qa&&O("9.5")||Ra&&O("528");N&&!O("8")||M&&O("9");function P(a,b){this.type=a;this.currentTarget=this.target=b}n=P.prototype;n.m=function(){};n.o=function(){};n.H=m;n.defaultPrevented=m;n.Ba=j;n.stopPropagation=function(){this.H=j};n.preventDefault=function(){this.defaultPrevented=j;this.Ba=m};function hb(a){hb[" "](a);return a}hb[" "]=aa;function ib(a,b){a&&this.ta(a,b)}B(ib,P);n=ib.prototype;n.target=k;n.relatedTarget=k;n.offsetX=0;n.offsetY=0;n.clientX=0;n.clientY=0;n.screenX=0;n.screenY=0;n.button=0;n.keyCode=0;n.charCode=0;n.ctrlKey=m;n.altKey=m;n.shiftKey=m;n.metaKey=m;n.kc=m;n.P=k;
n.ta=function(a,b){var c=this.type=a.type;P.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(N){var e;a:{try{hb(d.nodeName);e=j;break a}catch(f){}e=m}e||(d=k)}}else"mouseover"==c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;this.offsetX=Ra||a.offsetX!==i?a.offsetX:a.layerX;this.offsetY=Ra||a.offsetY!==i?a.offsetY:a.layerY;this.clientX=a.clientX!==i?a.clientX:a.pageX;this.clientY=a.clientY!==i?a.clientY:a.pageY;this.screenX=
a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.kc=La?a.metaKey:a.ctrlKey;this.state=a.state;this.P=a;a.defaultPrevented&&this.preventDefault();delete this.H};n.stopPropagation=function(){ib.d.stopPropagation.call(this);this.P.stopPropagation?this.P.stopPropagation():this.P.cancelBubble=j};
n.preventDefault=function(){ib.d.preventDefault.call(this);var a=this.P;if(a.preventDefault)a.preventDefault();else if(a.returnValue=m,gb)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};n.m=function(){};function jb(){}var kb=0;n=jb.prototype;n.key=0;n.V=m;n.nb=m;n.ta=function(a,b,c,d,e,f){w(a)?this.wb=j:a&&a.handleEvent&&w(a.handleEvent)?this.wb=m:g(Error("Invalid listener argument"));this.fa=a;this.Ab=b;this.src=c;this.type=d;this.capture=!!e;this.ba=f;this.nb=m;this.key=++kb;this.V=m};n.handleEvent=function(a){return this.wb?this.fa.call(this.ba||this.src,a):this.fa.handleEvent.call(this.fa,a)};function Q(a,b,c){for(var d in a)b.call(c,a[d],d,a)}function R(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}function lb(a,b){var c;(c=b in a)&&delete a[b];return c}function mb(a,b,c){b in a&&g(Error('The object already contains the key "'+b+'"'));a[b]=c}function nb(a){var b={},c;for(c in a)b[c]=a[c];return b}function ob(a){var b=ba(a);if("object"==b||"array"==b){if(a.Vb)return a.Vb();var b="array"==b?[]:{},c;for(c in a)b[c]=ob(a[c]);return b}return a}var pb="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
function qb(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<pb.length;f++)c=pb[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};var rb={},S={},T={},sb={};
function U(a,b,c,d,e){if(b){if(u(b)){for(var f=0;f<b.length;f++)U(a,b[f],c,d,e);return k}var d=!!d,h=S;b in h||(h[b]={u:0,s:0});h=h[b];d in h||(h[d]={u:0,s:0},h.u++);var h=h[d],l=z(a),p;h.s++;if(h[l]){p=h[l];for(f=0;f<p.length;f++)if(h=p[f],h.fa==c&&h.ba==e){if(h.V)break;return p[f].key}}else p=h[l]=[],h.u++;var t=tb,q=fb?function(a){return t.call(q.src,q.key,a)}:function(a){a=t.call(q.src,q.key,a);if(!a)return a},f=q;f.src=a;h=new jb;h.ta(c,f,a,b,d,e);c=h.key;f.key=c;p.push(h);rb[c]=h;T[l]||(T[l]=
[]);T[l].push(h);a.addEventListener?(a==r||!a.qb)&&a.addEventListener(b,f,d):a.attachEvent(b in sb?sb[b]:sb[b]="on"+b,f);return c}g(Error("Invalid event type"))}function ub(a,b,c,d,e){if(u(b))for(var f=0;f<b.length;f++)ub(a,b[f],c,d,e);else{d=!!d;a:{f=S;if(b in f&&(f=f[b],d in f&&(f=f[d],a=z(a),f[a]))){a=f[a];break a}a=k}if(a)for(f=0;f<a.length;f++)if(a[f].fa==c&&a[f].capture==d&&a[f].ba==e){vb(a[f].key);break}}}
function vb(a){if(!rb[a])return m;var b=rb[a];if(b.V)return m;var c=b.src,d=b.type,e=b.Ab,f=b.capture;c.removeEventListener?(c==r||!c.qb)&&c.removeEventListener(d,e,f):c.detachEvent&&c.detachEvent(d in sb?sb[d]:sb[d]="on"+d,e);c=z(c);T[c]&&(e=T[c],Ca(e,b),0==e.length&&delete T[c]);b.V=j;if(b=S[d][f][c])b.xb=j,wb(d,f,c,b);delete rb[a];return j}
function wb(a,b,c,d){if(!d.ua&&d.xb){for(var e=0,f=0;e<d.length;e++)d[e].V?d[e].Ab.src=k:(e!=f&&(d[f]=d[e]),f++);d.length=f;d.xb=m;0==f&&(delete S[a][b][c],S[a][b].u--,0==S[a][b].u&&(delete S[a][b],S[a].u--),0==S[a].u&&delete S[a])}}function xb(a,b,c,d,e){var f=1,b=z(b);if(a[b]){a.s--;a=a[b];a.ua?a.ua++:a.ua=1;try{for(var h=a.length,l=0;l<h;l++){var p=a[l];p&&!p.V&&(f&=yb(p,e)!==m)}}finally{a.ua--,wb(c,d,b,a)}}return Boolean(f)}function yb(a,b){a.nb&&vb(a.key);return a.handleEvent(b)}
function tb(a,b){if(!rb[a])return j;var c=rb[a],d=c.type,e=S;if(!(d in e))return j;var e=e[d],f,h;if(!fb){var l;if(!(l=b))a:{l=["window","event"];for(var p=r;f=l.shift();)if(p[f]!=k)p=p[f];else{l=k;break a}l=p}f=l;l=j in e;p=m in e;if(l){if(0>f.keyCode||f.returnValue!=i)return j;a:{var t=m;if(0==f.keyCode)try{f.keyCode=-1;break a}catch(q){t=j}if(t||f.returnValue==i)f.returnValue=j}}t=new ib;t.ta(f,this);f=j;try{if(l){for(var y=[],oa=t.currentTarget;oa;oa=oa.parentNode)y.push(oa);h=e[j];h.s=h.u;for(var D=
y.length-1;!t.H&&0<=D&&h.s;D--)t.currentTarget=y[D],f&=xb(h,y[D],d,j,t);if(p){h=e[m];h.s=h.u;for(D=0;!t.H&&D<y.length&&h.s;D++)t.currentTarget=y[D],f&=xb(h,y[D],d,m,t)}}else f=yb(c,t)}finally{y&&(y.length=0)}return f}d=new ib(b,this);return f=yb(c,d)};function V(){C.call(this)}B(V,C);n=V.prototype;n.qb=j;n.xa=k;n.gb=function(a){this.xa=a};n.addEventListener=function(a,b,c,d){U(this,a,b,c,d)};n.removeEventListener=function(a,b,c,d){ub(this,a,b,c,d)};
n.dispatchEvent=function(a){var b=a.type||a,c=S;if(b in c){if(v(a))a=new P(a,this);else if(a instanceof P)a.target=a.target||this;else{var d=a,a=new P(b,this);qb(a,d)}var d=1,e,c=c[b],b=j in c,f;if(b){e=[];for(f=this;f;f=f.xa)e.push(f);f=c[j];f.s=f.u;for(var h=e.length-1;!a.H&&0<=h&&f.s;h--)a.currentTarget=e[h],d&=xb(f,e[h],a.type,j,a)&&a.Ba!=m}if(m in c)if(f=c[m],f.s=f.u,b)for(h=0;!a.H&&h<e.length&&f.s;h++)a.currentTarget=e[h],d&=xb(f,e[h],a.type,m,a)&&a.Ba!=m;else for(e=this;!a.H&&e&&f.s;e=e.xa)a.currentTarget=
e,d&=xb(f,e,a.type,m,a)&&a.Ba!=m;a=Boolean(d)}else a=j;return a};n.m=function(){V.d.m.call(this);var a,b=0,c=a==k;a=!!a;if(this==k)Q(T,function(d){for(var f=d.length-1;0<=f;f--){var e=d[f];if(c||a==e.capture)vb(e.key),b++}});else{var d=z(this);if(T[d])for(var d=T[d],e=d.length-1;0<=e;e--){var f=d[e];if(c||a==f.capture)vb(f.key),b++}}this.xa=k};function zb(a,b){C.call(this);this.da=a||1;this.la=b||Ab;this.Ma=A(this.pc,this);this.Ua=ia()}B(zb,V);zb.prototype.enabled=m;var Ab=r.window;n=zb.prototype;n.k=k;n.setInterval=function(a){this.da=a;this.k&&this.enabled?(this.stop(),this.start()):this.k&&this.stop()};n.pc=function(){if(this.enabled){var a=ia()-this.Ua;0<a&&a<0.8*this.da?this.k=this.la.setTimeout(this.Ma,this.da-a):(this.dispatchEvent(Bb),this.enabled&&(this.k=this.la.setTimeout(this.Ma,this.da),this.Ua=ia()))}};
n.start=function(){this.enabled=j;this.k||(this.k=this.la.setTimeout(this.Ma,this.da),this.Ua=ia())};n.stop=function(){this.enabled=m;this.k&&(this.la.clearTimeout(this.k),this.k=k)};n.m=function(){zb.d.m.call(this);this.stop();delete this.la};var Bb="tick";var Cb,Db=!M||eb(9);!N&&!M||M&&eb(9)||N&&O("1.9.1");M&&O("9");function Eb(a){a=a.className;return v(a)&&a.match(/\S+/g)||[]}function Fb(a,b){for(var c=Eb(a),d=L(arguments,1),e=c.length+d.length,f=c,h=0;h<d.length;h++)H(f,d[h])||f.push(d[h]);a.className=c.join(" ");return c.length==e}function Gb(a,b){var c=Eb(a),d=L(arguments,1),c=wa(c,function(a){return!H(d,a)});a.className=c.join(" ")};function Jb(a){return a?new Lb(Mb(a)):Cb||(Cb=new Lb)}function Nb(a){return v(a)?document.getElementById(a):a}
function Ob(a,b,c){var d=document,c=c||d,a=a&&"*"!=a?a.toUpperCase():"";if(c.querySelectorAll&&c.querySelector&&(a||b))return c.querySelectorAll(a+(b?"."+b:""));if(b&&c.getElementsByClassName){c=c.getElementsByClassName(b);if(a){for(var d={},e=0,f=0,h;h=c[f];f++)a==h.nodeName&&(d[e++]=h);d.length=e;return d}return c}c=c.getElementsByTagName(a||"*");if(b){d={};for(f=e=0;h=c[f];f++)a=h.className,"function"==typeof a.split&&H(a.split(/\s+/),b)&&(d[e++]=h);d.length=e;return d}return c}
function Pb(a,b){Q(b,function(b,d){"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:d in Qb?a.setAttribute(Qb[d],b):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,b):a[d]=b})}var Qb={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};
function Rb(a,b,c,d){function e(c){c&&b.appendChild(v(c)?a.createTextNode(c):c)}for(;d<c.length;d++){var f=c[d];if(ca(f)&&!(x(f)&&0<f.nodeType)){var h;a:{if(f&&"number"==typeof f.length){if(x(f)){h="function"==typeof f.item||"string"==typeof f.item;break a}if(w(f)){h="function"==typeof f.item;break a}}h=m}F(h?K(f):f,e)}else e(f)}}function Sb(a,b){Rb(Mb(a),a,arguments,1)}function Tb(a){a&&a.parentNode&&a.parentNode.removeChild(a)}
function Ub(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}function Mb(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function Lb(a){this.O=a||r.document||document}n=Lb.prototype;n.v=function(a){return v(a)?this.O.getElementById(a):a};
n.N=function(a,b,c){var d=this.O,e=arguments,f=e[0],h=e[1];if(!Db&&h&&(h.name||h.type)){f=["<",f];h.name&&f.push(' name="',pa(h.name),'"');if(h.type){f.push(' type="',pa(h.type),'"');var l={};qb(l,h);delete l.type;h=l}f.push(">");f=f.join("")}f=d.createElement(f);h&&(v(h)?f.className=h:u(h)?Fb.apply(k,[f].concat(h)):Pb(f,h));2<e.length&&Rb(d,f,e,2);return f};n.createElement=function(a){return this.O.createElement(a)};n.createTextNode=function(a){return this.O.createTextNode(a)};
n.appendChild=function(a,b){a.appendChild(b)};n.contains=Ub;function Vb(a){C.call(this);this.$b=a;this.Ta=[]}B(Vb,C);var Wb=[];function Xb(a,b,c,d,e){u(c)||(Wb[0]=c,c=Wb);for(var f=0;f<c.length;f++){var h=U(b,c[f],d||a,e||m,a.$b||a);a.Ta.push(h)}return a}function Yb(a){F(a.Ta,vb);a.Ta.length=0}Vb.prototype.m=function(){Vb.d.m.call(this);Yb(this)};Vb.prototype.handleEvent=function(){g(Error("EventHandler.handleEvent not implemented"))};function Zb(a,b){P.call(this,"navigate");this.Cc=a;this.xc=b}B(Zb,P);function $b(a,b,c,d){C.call(this);a&&!b&&g(Error("Can't use invisible history without providing a blank page."));var e;c?e=c:(e="history_state"+ac,document.write(ma(bc,e,e)),e=Nb(e));this.ra=e;this.h=c?Mb(c)?Mb(c).parentWindow||Mb(c).defaultView:window:window;this.Ob=this.h.location.href.split("#")[0];this.sa=b;M&&!b&&(this.sa="https"==window.location.protocol?"https:///":'javascript:""');this.k=new zb(cc);this.X=!a;this.L=new Vb(this);if(a||dc)d?a=d:(a="history_iframe"+ac,b=this.sa?'src="'+pa(this.sa)+
'"':"",document.write(ma(ec,a,b)),a=Nb(a)),this.S=a,this.Jb=j;dc&&(Xb(this.L,this.h,"load",this.gc),this.Gb=this.Sa=m);this.X?fc(this,this.z(),j):gc(this,this.ra.value);ac++}B($b,V);$b.prototype.B=m;$b.prototype.T=m;$b.prototype.ea=k;var hc=M&&eb(8)||N&&O("1.9.2")||Ra&&O("532.1"),dc=M&&!eb(8),ic=dc;n=$b.prototype;n.ga=k;n.m=function(){$b.d.m.call(this);this.L.o();this.W(m)};
n.W=function(a){if(a!=this.B)if(dc&&!this.Sa)this.Gb=a;else if(a)if(Qa?Xb(this.L,this.h.document,jc,this.jc):N&&Xb(this.L,this.h,"pageshow",this.ic),hc&&this.X)Xb(this.L,this.h,"hashchange",this.hc),this.B=j,this.dispatchEvent(new Zb(this.z(),m));else{if(!M||this.Sa)Xb(this.L,this.k,Bb,A(this.Tb,this,j)),this.B=j,dc||(this.ea=this.z(),this.dispatchEvent(new Zb(this.z(),m))),this.k.start()}else this.B=m,Yb(this.L),this.k.stop()};n.gc=function(){this.Sa=j;this.ra.value&&gc(this,this.ra.value,j);this.W(this.Gb)};
n.ic=function(a){a.P.persisted&&(this.W(m),this.W(j))};n.hc=function(){var a=kc(this.h);a!=this.ea&&lc(this,a,j)};n.z=function(){return this.ga!=k?this.ga:this.X?kc(this.h):mc(this)||""};function kc(a){var a=a.location.href,b=a.indexOf("#");return 0>b?"":a.substring(b+1)}function fc(a,b,c){var d=a.h.location,a=a.Ob,e=-1!=d.href.indexOf("#");if(ic||e||b)a+="#"+b;a!=d.href&&(c?d.replace(a):d.href=a)}
function gc(a,b,c){if(a.Jb||b!=mc(a))if(a.Jb=m,b=encodeURIComponent(String(b)),M){var d=a.S.contentDocument||a.S.contentWindow.document;d.open("text/html",c?"replace":i);d.write(ma(nc,pa(a.h.document.title),b));d.close()}else if(b=a.sa+"#"+b,a=a.S.contentWindow)c?a.location.replace(b):a.location.href=b}
function mc(a){if(M)return a=a.S.contentDocument||a.S.contentWindow.document,a.body?decodeURIComponent(a.body.innerHTML.replace(/\+/g," ")):k;var b=a.S.contentWindow;if(b){var c;try{var d=kc(b);c=decodeURIComponent(d.replace(/\+/g," "))}catch(e){return a.T||(a.T!=j&&a.k.setInterval(oc),a.T=j),k}a.T&&(a.T!=m&&a.k.setInterval(cc),a.T=m);return c||k}return k}
n.Tb=function(a){if(this.X){var b=kc(this.h);b!=this.ea&&lc(this,b,a)}if(!this.X||dc)if(b=mc(this)||"",this.ga==k||b==this.ga)this.ga=k,b!=this.ea&&lc(this,b,a)};function lc(a,b,c){a.ea=a.ra.value=b;a.X?(dc&&gc(a,b),fc(a,b)):gc(a,b);a.dispatchEvent(new Zb(a.z(),c))}n.jc=function(){this.k.stop();this.k.start()};
var jc=["mousedown","keydown","mousemove"],nc="<title>%s</title><body>%s</body>",ec='<iframe id="%s" style="display:none" %s></iframe>',bc='<input type="text" name="%s" id="%s" style="display:none">',ac=0,cc=150,oc=1E4;function pc(a,b){C.call(this);this.h=a||window;this.Hb=b||k;U(this.h,"popstate",this.U,m,this);U(this.h,"hashchange",this.U,m,this)}B(pc,V);n=pc.prototype;n.B=m;n.Ea=j;n.zb="/";n.W=function(a){a!=this.B&&(this.B=a)&&this.dispatchEvent(new Zb(this.z(),m))};n.z=function(){if(this.Ea){var a=this.h.location.href,b=a.indexOf("#");return 0>b?"":a.substring(b+1)}return this.Hb?this.Hb.Bc(this.zb,this.h.location):this.h.location.pathname.substr(this.zb.length)};
n.m=function(){ub(this.h,"popstate",this.U,m,this);this.Ea&&ub(this.h,"hashchange",this.U,m,this)};n.Fb=function(a){this.Ea!=a&&(a?U(this.h,"hashchange",this.U,m,this):ub(this.h,"hashchange",this.U,m,this),this.Ea=a)};n.U=function(){this.B&&this.dispatchEvent(new Zb(this.z(),j))};function qc(a,b,c,d){var e=window;this.ca=e.history&&e.history.pushState?new pc:new $b(!(!b||!a),b,c,d);this.ca.Fb&&this.ca.Fb(!a);U(this.ca,"navigate",this.fc,m,this);this.Cb=[];this.Ra="";this.ca.W(j)}B(qc,V);
qc.prototype.ja=function(a,b,c){v(a)&&(a=RegExp("^"+String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08").replace(/\\:\w+/g,"(\\w+)").replace(/\\\*/g,"(.*)").replace(/\\\[/g,"(").replace(/\\\]/g,")?").replace(/\\\{/g,"(?:").replace(/\\\}/g,")?")+"$"));this.Cb.push({ja:a,Sb:b,Wb:c})};
qc.prototype.fc=function(){var a=this.ca.z();a!=this.Ra&&(this.dispatchEvent({type:"routeExpired",Ac:this.Ra,vc:a}),this.Ra=a,za(this.Cb||[],function(b){var c=b.ja.exec(a);c?(b.Sb.apply(b.Wb,c),b=j):b=m;return b},this))};function W(){}W.sb=function(){return W.vb?W.vb:W.vb=new W};W.prototype.dc=0;W.sb();function rc(a){C.call(this);this.aa=a||Jb();this.nc=sc}B(rc,V);rc.prototype.ac=W.sb();var sc=k;n=rc.prototype;n.R=k;n.g=m;n.f=k;n.nc=k;n.c=k;n.r=k;n.b=k;n.l=k;n.Kb=m;function tc(a){return a.R||(a.R=":"+(a.ac.dc++).toString(36))}n.v=function(){return this.f};n.eb=function(a){this.f=a};function uc(a,b){a==b&&g(Error("Unable to set parent component"));b&&(a.r&&a.R&&a.r.l&&a.R&&(a.R in a.r.l&&a.r.l[a.R])&&a.r!=b)&&g(Error("Unable to set parent component"));a.r=b;rc.d.gb.call(a,b)}n.getParent=function(){return this.r};
n.gb=function(a){this.r&&this.r!=a&&g(Error("Method not supported"));rc.d.gb.call(this,a)};n.N=function(){this.f=this.aa.createElement("div")};function vc(a,b,c){a.g&&g(Error("Component already rendered"));a.f||a.N();b?b.insertBefore(a.f,c||k):a.aa.O.body.appendChild(a.f);(!a.r||a.r.g)&&a.C()}n.C=function(){this.g=j;xc(this,function(a){!a.g&&a.v()&&a.C()})};function yc(a){xc(a,function(a){a.g&&yc(a)});a.Q&&Yb(a.Q);a.g=m}
n.m=function(){rc.d.m.call(this);this.g&&yc(this);this.Q&&(this.Q.o(),delete this.Q);xc(this,function(a){a.o()});!this.Kb&&this.f&&Tb(this.f);this.r=this.c=this.f=this.l=this.b=k};n.fb=function(a){this.c=a};
n.Z=function(a,b,c){a.g&&(c||!this.g)&&g(Error("Component already rendered"));(0>b||b>(this.b?this.b.length:0))&&g(Error("Child component index out of bounds"));if(!this.l||!this.b)this.l={},this.b=[];if(a.getParent()==this){var d=tc(a);this.l[d]=a;Ca(this.b,a)}else mb(this.l,tc(a),a);uc(a,this);Ea(this.b,b,0,a);a.g&&this.g&&a.getParent()==this?(c=this.D(),c.insertBefore(a.v(),c.childNodes[b]||k)):c?(this.f||this.N(),b=this.b?this.b[b+1]||k:k,vc(a,this.D(),b?b.f:k)):this.g&&(!a.g&&a.f&&a.f.parentNode)&&
a.C()};n.D=function(){return this.f};function xc(a,b){a.b&&F(a.b,b,i)}n.removeChild=function(a,b){if(a){var c=v(a)?a:tc(a),a=this.l&&c?(c in this.l?this.l[c]:i)||k:k;c&&a&&(lb(this.l,c),Ca(this.b,a),b&&(yc(a),a.f&&Tb(a.f)),uc(a,k))}a||g(Error("Child is not in parent component"));return a};function zc(){zc.d.constructor.apply(this,L(arguments,0));this.q={Va:{},F:{}}}B(zc,rc);n=zc.prototype;n.remove=function(){Tb(this.v());this.o()};n.Yb=function(a,b){if(this.q.F[a]){var c=b.target;F(this.q.F[a],function(a){b.target=c;if(!b.H&&(!a.Db.length||ya(a.Db,function(a){if(w(a))return a(b);if(a=za(X(this,a),function(a){return Ub(a,b.target)}))b.target=a;return a},this)))a.M.call(a.ba,b),a.stop&&b.stopPropagation()},this)}};
function Ac(a,b,c,d,e,f,h){var l=["blur","focus"];a.q||(a.q={Va:{},F:{}});a.q.F[b]||(a.q.F[b]=[]);a.q.Va[b]||(a.q.Va[b]=Xb(a.Q||(a.Q=new Vb(a)),a.v(),b,A(a.Yb,a,b),H(l,b)));s(d)||(d=[]);d={Db:u(d)?d:[d],M:c,uid:k,ba:e||a,lc:f||50,stop:h};d.uid=z(d);h=a.q.F[b];a:{for(var p=a.q.F[b],l=function(a){return a.lc<=(f||50)},t=v(p)?p.split(""):p,p=p.length-1;0<=p;p--)if(p in t&&l.call(i,t[p])){l=p;break a}l=-1}Ea(h,l+1,0,d);var q={j:A(function(a){var d=this.v();a&&(d=a);c.call(e||this,new P(b,d));return q},
a),id:d.uid,$a:A(a.$a,a,d.uid)};return q}n.click=function(a,b,c,d,e){return Ac(this,"click",a,b,c,d,e)};n.$a=function(a){x(a)&&a.id&&(a=a.id);Q(this.q.F,function(b){I(b,function(b){return b.uid==a})})};
function X(a,b){var c;c=c||a.v();if(!b)return[c];if(u(b))return c=Ga(G(b,function(a){return X(this,a)},a)),Fa(c),c;"-"==b.charAt(0)&&(b="."+b.substring(1));if("."==b.charAt(0)){var d=b.substring(1),e=c||document;c=(e.querySelectorAll&&e.querySelector?e.querySelectorAll("."+d):e.getElementsByClassName?e.getElementsByClassName(d):Ob("*",d,c))||[]}else"#"==b.charAt(0)?c=[Nb(b.substring(1))]:(d=na(b.replace(/\..*/,"")),e=0<b.indexOf(".")?b.replace(/.*\./,""):k,c=Ob(d,e,c),c=K(c));return c}
n.Z=function(a,b,c){if(M&&!O(9))zc.d.Z.call(this,a,b,c);else{a.g&&(c||!this.g)&&g(Error("Component already rendered"));(0>b||b>(this.b?this.b.length:0))&&g(Error("Child component index out of bounds"));if(!this.l||!this.b)this.l={},this.b=[];if(a.getParent()==this){var d=tc(a);this.l[d]=a;Ca(this.b,a)}else mb(this.l,tc(a),a);uc(a,this);Ea(this.b,b,0,a);if(c&&(!a.bc||!this.bc||a.getParent!=this))this.f||this.N(),d=this.b?this.b[b+1]||k:k,vc(a,this.D(),d?d.f:k);if(a.g&&this.g&&a.getParent()==this){var e=
this.D();this.ya?F(this.b,function(a,b){this.ya(e,a,b)},this):e.insertBefore(a.v(),e.childNodes[b]||k)}else!c&&(this.g&&!a.g&&a.f&&a.f.parentNode)&&a.C()}};n.removeChild=function(a,b){var c=zc.d.removeChild.call(this,a,b);this.ya&&F(this.b,function(a,b){this.ya(this.D(),a,b)},this);return c};n.ya=k;function Y(a){Y.d.constructor.apply(this,L(arguments,1));this.ia=[];this.na=[];this.fb(a);this.qa=k}B(Y,zc);n=Y.prototype;n.eb=function(a){Y.d.eb.call(this,a);this.qa||(this.qa=a)};n.D=function(){return this.qa||Y.d.D.call(this)};n.fb=function(a,b){this.c&&F(G(this.ia,function(a){return a.id}),this.Ib,this);Y.d.fb.call(this,a);F(this.ia,function(a){var d=a.M.apply(this,a.Lb);a.bound=d;a.j=d.j;a.a=A(this.a,this,d.id);a.id=d.id;!b&&!H([this.jb,this.lb,this.mb],a.M)&&a.j()},this)};
n.Nb=function(a,b){var c=this.c.p(),d=this.b||[],e=G(d,function(a){return a.c}),f=wa(d,function(a){return!H(c,a.c)});0===d.length?F(c,function(b){b=new a(b);this.Z(b,this.b?this.b.length:0,j)},this):(F(f,function(a){this.removeChild(a,j);a.o()},this),F(c,function(b,c){var f;H(e,b)?(f=za(d,function(a){return a.c==b}),(this.b?this.b[c]||k:k)!=f&&this.Z(f,c)):(f=new a(b),f.N(),this.Z(f,c,j))},this));b&&b.call(this,this.D())};
n.Mb=function(a,b){var c=L(arguments,2)[0];if(a.J){var d={};a.data&&Q(a.data,function(a,b){d[b]=w(a)?a(this):a},this);d.n=this.c.get(a.e);var e=a.J(d);F(X(this,b),function(a){if("INPUT"==a.tagName&&"checkbox"!=a.getAttribute("type"))a.value!=e&&(a.value=e);else if("SELECT"==a.tagName)F(a.options,function(a){a.selected=a.value==e});else{for(var b;b=a.firstChild;)a.removeChild(b);var c=e,d=document;b=d.createElement("div");M?(b.innerHTML="<br>"+c,b.removeChild(b.firstChild)):b.innerHTML=c;if(1==b.childNodes.length)b=
b.removeChild(b.firstChild);else{for(c=d.createDocumentFragment();b.firstChild;)c.appendChild(b.firstChild);b=c}Sb(a,b)}},this)}s(a.zc)||F(X(this,b),function(b){"INPUT"==b.tagName&&"checkbox"==b.getAttribute("type")&&(b.checked=!!this.c.get(a.e[0]))},this);if(s(a.wa)){var f=a.wa;F(X(this,b),function(b){var d=f;c&&0!==c.length?Fb(b,d):Gb(b,d);a.ec&&(d=a.ec,!c||0===c.length?Fb(b,d):Gb(b,d))})}a.I&&(u(a.I)?F(X(this,b),function(b){F(a.I,function(d){d==a.Pa(c)?Fb(b,d):Gb(b,d)},this)},this):F(X(this,b),
function(b){Q(a.I,function(d,f){f==a.Pa(c)?Fb(b,d):Gb(b,d)},this)},this));a.show&&F(X(this,b),function(b){var d=a.show(c);b.style.display=d?"":"none"});if(a.A){var h={};h[a.A]=this.c.get(a.e[0]);F(X(this,b),function(b){s(h[a.A])?Pb(b,h):b.removeAttribute(a.A)})}a.oc&&a.oc.apply(this,G(a.e,function(){return this.c.get("key")},this))};
function Z(a,b,c){v(c)&&(c={J:c});if(v(c.J)){var d=c.J,e=d.match(/\{\$([^}]*)\}/g)||[],e=G(e,function(a){return a.substring(2,a.length-1)});c.J=function(a){var b=d;Q(a.n,function(a,c){b=b.replace(RegExp("\\{\\$"+c+"\\}","g"),a)});return b};c.e=c.e||[];Da(c.e,e);Fa(c.e)}c.I&&(c.Pa||(c.Pa=function(a){return a}),v(c.I)&&(c.I=[c.I]));c.show&&(c.e||(c.e=[]),v(c.show)&&Ea(c.e,0,0,c.show),w(c.show)||(c.show=function(a){return a}));u(c.e)||(c.e=[c.e]);var f=[];s(c.yc)||f.push(Ac(a,"blur",function(a){"INPUT"==
a.target.tagName&&"text"==a.target.getAttribute("type")?this.c.set(c.e[0],a.target.value):"SELECT"==a.target.tagName&&this.c.set(c.e[0],a.target.options[a.target.selectedIndex].value)},b));s(c.Za)||f.push(a.click(function(a){c.wa?(this.c.set(c.e[0],!H(Eb(a.target),c.wa)),c.stop&&a.stopPropagation()):"INPUT"==a.target.tagName&&"checkbox"==a.target.getAttribute("type")&&(this.c.set(c.e[0],a.target.checked),c.stop&&a.stopPropagation())},b,a,30));e=a.bind(c.e,function(){this.Mb.apply(this,J([c,b],K(arguments)))}).j();
e={id:z(f),Rb:f,bound:e,j:e.j,a:A(function(){this.a(z(f))},a)};a.na.push(e)}n.bind=function(a,b,c){return Bc(this,this.Qb,L(arguments,0))};n.Qb=function(a,b,c){return this.c.bind(a,b,c||this)};n.Ja=function(a,b){return Bc(this,this.Pb,L(arguments,0))};n.Pb=function(a,b){return this.c.Ja(a,b||this)};n.ib=function(a,b){return Bc(this,this.jb,L(arguments,0))};n.jb=function(a,b){return this.c.ib(a,b||this)};n.kb=function(a,b){return Bc(this,this.lb,L(arguments,0))};
n.lb=function(a,b){return this.c.kb(a,b||this)};n.Ka=function(a,b){return Bc(this,this.mb,L(arguments,0))};n.mb=function(a,b){return this.c.Ka(a,b||this)};function Bc(a,b,c){var d=b.apply(a,c||[]),b={id:d.id,bound:d,j:d.j,a:A(a.a,a,d.id),M:b,Lb:c||[]};a.ia.push(b);return b}n.ma=function(a,b){return Bc(this,this.K,L(arguments,0))};n.K=function(a,b){return this.c.ma(a,b||this)};n.Wa=function(a,b){return Bc(this,this.G,L(arguments,0))};n.G=function(a,b){return this.c.Wa(a,b||this)};
n.a=function(a){I(this.ia,function(b){x(b)&&(b=b.id);return b==(a.id||a)});var b=za(this.na,function(b){return b.id==(a.id||a)});b&&(F(b.Rb,function(a){this.$a(a)},this),a=b.bound);Ca(this.na,b);return this.Ib(a)};n.Ib=function(a){return this.c.a(a)};n.m=function(){F(K(this.ia),function(a){a.a()},this);F(K(this.na),function(a){a.a()});Y.d.m.call(this);this.q=k};M&&O(8);var Cc={"\x00":"&#0;",'"':"&quot;","&":"&amp;","'":"&#39;","<":"&lt;",">":"&gt;","\t":"&#9;","\n":"&#10;","\x0B":"&#11;","\f":"&#12;","\r":"&#13;"," ":"&#32;","-":"&#45;","/":"&#47;","=":"&#61;","`":"&#96;","\u0085":"&#133;","\u00a0":"&#160;","\u2028":"&#8232;","\u2029":"&#8233;"};function Dc(a){return Cc[a]}var Ec=/[\x00\x22\x26\x27\x3c\x3e]/g;function Fc(a){return"<strong>"+("object"===typeof a.n.active&&a.n.active&&0===a.n.active.tc?a.n.active.content:String(a.n.active).replace(Ec,Dc))+"</strong> item"+(1!=a.n.active?"s":"")+" left"};function Gc(a){Y.call(this,a)}B(Gc,Y);Gc.prototype.N=function(){var a;a:if(a=(new Lb(k)||Jb()).createElement("DIV"),a.innerHTML='<li><div class="view"><input class="toggle" type="checkbox"><label></label><button class="destroy"></button></div><input class="edit" type="text"></li>',1==a.childNodes.length){var b=a.firstChild;if(1==b.nodeType){a=b;break a}}this.eb(a)};
Gc.prototype.C=function(){var a=this.c;Z(this,".toggle","{$completed}");Z(this,"",{e:["completed"],wa:"completed",Za:j});this.click(function(){a.o()},".destroy");Z(this,"label",{e:["title"],J:function(a){return a.title},data:{title:function(a){a=a.c.get("title");return pa(a)}}});var b=X(this,".edit")[0];Ac(this,"dblclick",function(){Fb(this.v(),"editing");b.focus()},".view");Ac(this,"keyup",function(a){13===a.keyCode&&a.target.blur()});Ac(this,"blur",function(){Gb(this.v(),"editing")});Z(this,".edit",
"{$title}")};function Hc(a){Y.call(this,a)}B(Hc,Y);
Hc.prototype.C=function(){Hc.d.C.call(this);var a=this.c;Ac(this,"keyup",this.Zb,".todo-entry");Z(this,"#clear-completed",{J:"Clear completed ({$completed})",Za:j,show:j});this.click(function(){F(a.p("completed"),function(a){a.o()})},".clear-completed");Z(this,".toggle-all",{e:"allDone"});Z(this,"ul",{e:"filter",I:["active","completed","none"]});Z(this,"#todo-count",{J:Fc,e:"active"});Z(this,["#main","footer"],{show:"total",Za:j});var b=Nb("todo-list");b&&(this.qa=b);b=this.Wa(A(this.Nb,this,Gc,i)).j().j;
this.bind("filter",b);this.ma(b)};Hc.prototype.Zb=function(a){var b=a.target;if(13===a.keyCode){var c=na(b.value);c&&(a=this.c,c=new a.Ya({title:c}),a.add(c,i,i),b.value="")}};function Ic(a){a=String(a);if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x10-\x1f\x80-\x9f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}g(Error("Invalid JSON string: "+a))}function Jc(){this.Aa=i}function Kc(a,b){var c=[];Lc(a,b,c);return c.join("")}
function Lc(a,b,c){switch(typeof b){case "string":Mc(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(b==k){c.push("null");break}if(u(b)){var d=b.length;c.push("[");for(var e="",f=0;f<d;f++)c.push(e),e=b[f],Lc(a,a.Aa?a.Aa.call(b,String(f),e):e,c),e=",";c.push("]");break}c.push("{");d="";for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&(e=b[f],"function"!=typeof e&&(c.push(d),Mc(f,c),c.push(":"),
Lc(a,a.Aa?a.Aa.call(b,f,e):e,c),d=","));c.push("}");break;case "function":break;default:g(Error("Unknown type: "+typeof b))}}var Nc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Oc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
function Mc(a,b){b.push('"',a.replace(Oc,function(a){if(a in Nc)return Nc[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return Nc[a]=e+b.toString(16)}),'"')};function $(a){var b={schema:{},sync:k,attr:{}};a||(a={});a.attr=a.attr||{};Q(a,function(c,d){s(b[d])||(a.attr[d]=c)});Q(b,function(c,d){b[d]=a[d]||b[d]});this.t={};this.wc={};this.za={};this.i=b.schema||{};this.ka=b.sync;this.oa=[];this.La={};this.ab=[];this.rc=k;this.tb=aa;this.sc=U(this,"change",this.Na,m,this);this.Ub=""+z(this);this.Oa=[m];this.Fa={};this.Y=[j];this.set(b.attr);this.dispatchEvent("load")}B($,V);
function Pc(a,b){if(x(a)){if(x(b)){var c=R(a),d=R(b),e;a:if(!ca(c)||!ca(d)||c.length!=d.length)e=m;else{e=c.length;for(var f=0;f<e;f++)if(c[f]!==d[f]){e=m;break a}e=j}if(!e)return m;for(e=0;e<c.length;e++)if(!Pc(a[c[e]],b[d[e]]))return m;return j}return m}return x(b)?m:a===b}n=$.prototype;n.hb=function(){function a(b){x(b)&&F(R(b),function(d){s(b[d])?x(b[d])&&a(b[d]):delete b[d]})}var b=nb(this.t);a(b);return b};
n.get=function(a,b){if(u(a))return xa(a,function(a,c){a[c]=this.get(c,b);return a},{},this);if(this.i[a]&&this.i[a].get){var c=this.i[a].get.apply(this,G(this.i[a].mc||[],function(c){if(c===a)return this.t[a];c=this.get(c);return s(c)?c:b},this));return s(c)?c:b}if(0>a.indexOf("."))return s(this.t[a])?this.t[a]:b;for(var c=a.split(".").reverse(),d=this.get(c.pop());c.length&&s(d);)d=d[c.pop()];return s(d)?d:b};
n.set=function(a,b,c){if(this.Oa[0])return v(a)?(this.Fa[a]=b,this.Y[0]=this.Y[0]&&c):(qb(this.Fa,a),this.Y[0]=this.Y[0]&&b),m;var d=m;if(v(a)){var e={};e[a]=b;a=e}else c=b;Q(a,function(a,b){try{if(this.i[b]&&this.i[b].set){var f;var e=this.i[b].set,q=e;if(v(e)){var y={number:da,string:v,array:ca};f=function(a){y[e.toLowerCase()](a)||g(new Qc);return a}}else q.exec?f=A(function(a,b){a.exec(b)===k&&g(new Qc);return b},this,e):(w(q)&&R(q.prototype).length&&(q=function(a){x(a)||g(new Qc);var b=Object.getPrototypeOf(a).constructor;
if(Object.getPrototypeOf(a).constructor==e)return a;for(;b.d;)if(b=b.d.constructor,b==e)return a;g(new Qc)}),f=q);var oa=f.call(this,a,c);this.t[b]=oa}else{for(var q=b.split(".").reverse(),D=this.t;1<q.length;){var Hb=q.pop();D[Hb]=D[Hb]||{};D=D[Hb]}D[q.pop()]=a}var Ib=this.i[b],ab=this.get(b),bb=Rc(this,b);if(s(Ib)&&w(Ib.pa)){var wc=Ib.pa;w(wc)&&!wc(ab,bb)&&(d=j)}else x(ab)||x(bb)?Pc(ab,bb)||(d=j):ab!==bb&&(d=j)}catch(Kb){Kb.cc?this.tb(Kb):g(Kb)}},this);if(d){if(!c){this.dispatchEvent("change");
this.za=ob(this.t);var a=this.t,b=function(a){return s(a)},e={},f;for(f in a)b.call(i,a[f])&&(e[f]=a[f]);this.t=e}return j}return m};n.$=function(){this.dispatchEvent("change")};function Rc(a,b){return a.i[b]&&a.i[b].get?a.i[b].get.apply(a,G(a.i[b].mc||[],function(a){return a===b?this.za[b]:Rc(this,a)},a)):a.za[b]}
function Sc(a,b,c,d){if(!x(b)&&!x(c))return b===c?[]:[d];var e=J(R(b),R(c));Fa(e);a=xa(e,function(a,e){return!x(b)?J(a,Sc(this,i,c[e],d+"."+e)):!x(c)?J(a,Sc(this,b[e],i,d+"."+e)):J(a,Sc(this,b[e],c[e],d+"."+e))},[],a);a.length&&a.push(d);return a}n.o=function(a,b){a&&(this.ka.Da.remove(this.get("id")),w(b)&&b.call(this,this));this.dispatchEvent("unload");F(K(this.ab),function(a){a(this)},this);$.d.o.call(this)};
n.save=function(a){this.ka&&(!s(this.get("id"))?this.ka.create(this,a):this.ka.update(this,a))};
n.Na=function(){this.Oa[0]=j;var a,b=this.i,c=J(R(b),R(this.t));Fa(c);a=xa(c,function(a,c){var d=Rc(this,c),e=this.get(c),t=b[c];return t&&s(t.pa)?(s(t.pa)&&!t.pa(d,e)&&a.push(c),a):J(a,Sc(this,e,d,c))},[],this);F(this.oa,function(b){ya(b.A,function(b){return H(a,b)})&&b.M.apply(b.ub,J(G(b.A,function(a){return this.get(a)},this)))},this);a.length&&Q(this.La,function(a){a(this)},this);this.za=ob(this.t);this.Oa[0]=m;var c=nb(this.Fa),d=this.Fa,e;for(e in d)delete d[e];e=this.Y[0];this.Y[0]=j;this.set(c,
e)};n.Ka=function(a,b){var a=A(a,b||this),c=z(a);this.ab.push(a);var d={j:function(){a();return d},id:c,a:A(this.a,this,c)};return d};n.bind=function(a,b,c){v(a)&&(a=[a]);var d={A:a,M:b,ub:c||this};d.Qa=z(d);this.oa.push(d);var e={j:A(function(){var d=G(a,function(a){return this.get(a)},this);d.push(this);b.apply(c||this,d);return e},this),id:d.Qa,a:A(this.a,this,d.Qa)};return e};
n.a=function(a){x(a)&&a.id&&(a=a.id);return I(this.oa,function(b){return b.Qa==a})||lb(this.La,a)||I(this.ab,function(b){return z(b)==a})};n.Ja=function(a,b){var c=A(a,b||this),d=z(c);this.La[""+d]=c;var a=A(a,b||this,this),e={j:function(){a();return e},id:d,a:A(this.a,this,d)};return e};function Qc(){this.cc=j}B(Qc,Error);function Tc(a){var a=a||{},b={comparator:a.comparator||k,modelType:a.modelType||$,models:a.models||[]};lb(a,"comparator");lb(a,"modelType");lb(a,"models");this.w=[];this.ob=[b.comparator&&A(b.comparator,this)];this.Xa=[];this.Ia=[];this.Ha=[];this.Ga=[];this.cb=[];this.bb=[];this.G=[m];this.K=[m];this.Ya=b.modelType;$.call(this,a);F(b.models,function(a){this.add(a,i,j)},this)}B(Tc,$);n=Tc.prototype;
n.sort=function(a){var b=m;if(this.ob[0]){var c=this.ob[0];this.w.sort(function(a,e){var f=c(a.n,e.n);0<f&&(b=j);return f});this.G[0]=this.G[0]||b}a||this.dispatchEvent("change")};
n.add=function(a,b,c){da(b)&&0>b&&(b=this.w.length+b);var d=0,e=m;u(a)||(a=[a]);F(a,function(c){c instanceof $||(c=new this.Ya(c));if(!za(this.w,function(a){return a.n==c})){e=j;this.G[0]=j;this.K[0]=j;var h=c.Ja(A(function(){this.K[0]=j;this.sort()},this)),l=c.Ka(function(){this.remove(a)},this);Ea(this.w,da(b)?b+d:this.w.length,0,{n:c,qc:l,$:h});d+=1;h=this.Ha;l=c;H(h,l)||h.push(l)}},this);this.length=this.w.length;this.sort(j);e&&!c&&this.$();return e};
n.remove=function(a,b){u(a)||(a=[a]);var c=m;F(a,function(a){var b=za(this.w,function(b){return b.n==a});if(b){this.G[0]=j;this.K[0]=j;a.a(b.qc);a.a(b.$);Ca(this.w,b);c=j;var b=this.cb,f={n:a,id:a.get("id")||a.Ub};H(b,f)||b.push(f)}},this);this.length=this.w.length;c&&this.sort(j);c&&!b&&this.$();return c};n.p=function(a){if(v(a))var b=a,a=function(a){return a.get(b)};var c=G(this.w,function(a){return a.n});return a?wa(c,a):c};n.indexOf=function(a){return va(this.p(),a)};
n.Wa=function(a,b){var c=A(a,b||this);this.Xa.push(c);var c=z(c),a=A(a,b||this,this),d={j:function(){a();return d},id:c,a:A(this.a,this,c)};return d};n.ma=function(a,b){var c=A(a,b||this);this.Ia.push(c);var c=z(c),a=A(a,b||this,this),d={j:function(){a();return d},id:c,a:A(this.a,this,c)};return d};n.ib=function(a,b){var c=A(a,b||this);this.Ga.push(c);var c=z(c),a=A(a,b||this,this),d={j:function(){a();return d},id:c,a:A(this.a,this,c)};return d};
n.kb=function(a,b){var c=A(a,b||this);this.bb.push(c);var c=z(c),a=A(a,b||this,this),d={j:function(){a();return d},id:c,a:A(this.a,this,c)};return d};n.a=function(a){x(a)&&a.id&&(a=a.id);return I(this.Xa,function(b){return z(b)==a})||I(this.Ia,function(b){return z(b)==a})||I(this.bb,function(b){return z(b)==a})||I(this.Ga,function(b){return z(b)==a})||Tc.d.a.call(this,a)};
n.Na=function(){Tc.d.Na.call(this);this.G[0]&&(F(K(this.Xa),function(a){a(this)},this),this.G[0]=m);this.K[0]&&(F(K(this.Ia),function(a){a(this)},this),this.i&&Q(this.i,function(a,b){a.va&&F(this.oa,function(a){H(a.A,b)&&a.M.apply(a.ub,J(G(a.A,function(a){return this.get(a)},this)))},this)},this),this.K[0]=m);F(this.bb,function(a){F(this.cb,function(b){a(b.n,b.id)})},this);Ba(this.cb);F(this.Ga,function(a){F(this.Ha,function(b){a(b)})},this);Ba(this.Ha)};function Uc(){};function Vc(a){this.ha=a;this.Eb=new Jc}n=Vc.prototype;n.ha=k;n.Eb=k;n.set=function(a,b){s(b)?this.ha.set(a,Kc(this.Eb,b)):this.ha.remove(a)};n.get=function(a){a=this.ha.get(a);if(a!==k)try{return Ic(a)}catch(b){g("Storage: Invalid value was encountered")}};n.remove=function(a){this.ha.remove(a)};function Wc(){}B(Wc,Uc);function Xc(a){this.Ca=a}B(Xc,Wc);Xc.prototype.set=function(a,b){try{this.Ca.setItem(a,b)}catch(c){g("Storage mechanism: Quota exceeded")}};Xc.prototype.get=function(a){a=this.Ca.getItem(a);!v(a)&&a!==k&&g("Storage mechanism: Invalid value was encountered");return a};Xc.prototype.remove=function(a){this.Ca.removeItem(a)};function Yc(){var a=k;try{a=window.localStorage||k}catch(b){}this.Ca=a}B(Yc,Xc);function Zc(){this.Da=new Vc(new Yc)}Zc.prototype.create=function(a,b){var c;this.pb=this.pb||0;c=this.pb++ +"|"+parseInt((new Date).getTime(),36);a.set("id",c);w(b)&&b.call(a,a)};Zc.prototype.Bb=function(a,b){a.set(this.Da.get(a.get("id")));w(b)&&b.call(a,a)};Zc.prototype.update=function(a,b){this.Da.set(a.get("id"),a.hb());w(b)&&b.call(a,a)};function $c(){Zc.call(this)}B($c,Zc);$c.prototype.Bb=function(a){var b=a.get("id"),b=this.Da.get(b)||[];F(b,function(b){b=new a.Ya(b);a.add(b,i,j)});a.$()};function ad(a){$.call(this,a);this.i.title=this.i.title||{};this.i.title.set=A(function(a){a=na(a);a.length||g(new Qc);return a},this);this.tb=function(){this.o()}}B(ad,$);function bd(){Tc.call(this,{id:"todos-plastronjs",sync:new $c,schema:{completed:{get:function(){return this.p("completed").length},va:j},allDone:{get:function(){return this.p().length===this.p("completed").length},set:function(a){F(this.p("none"),function(b){b.set("completed",a)})},va:j},active:{get:function(){return this.p().length-this.p("completed").length},va:j},total:{get:function(){return this.p().length},va:j}},modelType:ad});this.ka.Bb(this,i);this.ma(this.save)}B(bd,Tc);
var cd={none:function(){return j},active:function(a){return!a.get("completed")},completed:function(a){return a.get("completed")}};bd.prototype.p=function(a){return bd.d.p.call(this,cd[a||this.get("filter")])};bd.prototype.hb=function(){return G(this.p("none"),function(a){return a.hb()})};var dd=new bd,ed=new Hc(dd),fd=Nb("todoapp");ed.g&&g(Error("Component already rendered"));if(fd){ed.Kb=j;var gd;if(!(gd=!ed.aa))gd=ed.aa.O!=Mb(fd);gd&&(ed.aa=Jb(fd));ed.f=fd;ed.C()}else g(Error("Invalid element to decorate"));var hd=new qc;hd.ja("{/}",function(){dd.set("filter","none")});hd.ja("/active",function(){dd.set("filter","active")});hd.ja("/completed",function(){dd.set("filter","completed")});})();