18 lines
555 KiB
JavaScript
18 lines
555 KiB
JavaScript
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){(function(a){!function(){function c(a){var b=!1;return function(){if(b)throw new Error("Callback was already called.");b=!0,a.apply(d,arguments)}}var d,e,f={};d=this,null!=d&&(e=d.async),f.noConflict=function(){return d.async=e,f};var g=Object.prototype.toString,h=Array.isArray||function(a){return"[object Array]"===g.call(a)},i=function(a,b){if(a.forEach)return a.forEach(b);for(var c=0;c<a.length;c+=1)b(a[c],c,a)},j=function(a,b){if(a.map)return a.map(b);var c=[];return i(a,function(a,d,e){c.push(b(a,d,e))}),c},k=function(a,b,c){return a.reduce?a.reduce(b,c):(i(a,function(a,d,e){c=b(c,a,d,e)}),c)},l=function(a){if(Object.keys)return Object.keys(a);var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b};"undefined"!=typeof a&&a.nextTick?(f.nextTick=a.nextTick,f.setImmediate="undefined"!=typeof setImmediate?function(a){setImmediate(a)}:f.nextTick):"function"==typeof setImmediate?(f.nextTick=function(a){setImmediate(a)},f.setImmediate=f.nextTick):(f.nextTick=function(a){setTimeout(a,0)},f.setImmediate=f.nextTick),f.each=function(a,b,d){function e(b){b?(d(b),d=function(){}):(f+=1,f>=a.length&&d())}if(d=d||function(){},!a.length)return d();var f=0;i(a,function(a){b(a,c(e))})},f.forEach=f.each,f.eachSeries=function(a,b,c){if(c=c||function(){},!a.length)return c();var d=0,e=function(){b(a[d],function(b){b?(c(b),c=function(){}):(d+=1,d>=a.length?c():e())})};e()},f.forEachSeries=f.eachSeries,f.eachLimit=function(a,b,c,d){var e=m(b);e.apply(null,[a,c,d])},f.forEachLimit=f.eachLimit;var m=function(a){return function(b,c,d){if(d=d||function(){},!b.length||0>=a)return d();var e=0,f=0,g=0;!function h(){if(e>=b.length)return d();for(;a>g&&f<b.length;)f+=1,g+=1,c(b[f-1],function(a){a?(d(a),d=function(){}):(e+=1,g-=1,e>=b.length?d():h())})}()}},n=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[f.each].concat(b))}},o=function(a,b){return function(){var c=Array.prototype.slice.call(arguments);return b.apply(null,[m(a)].concat(c))}},p=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[f.eachSeries].concat(b))}},q=function(a,b,c,d){if(b=j(b,function(a,b){return{index:b,value:a}}),d){var e=[];a(b,function(a,b){c(a.value,function(c,d){e[a.index]=d,b(c)})},function(a){d(a,e)})}else a(b,function(a,b){c(a.value,function(a){b(a)})})};f.map=n(q),f.mapSeries=p(q),f.mapLimit=function(a,b,c,d){return r(b)(a,c,d)};var r=function(a){return o(a,q)};f.reduce=function(a,b,c,d){f.eachSeries(a,function(a,d){c(b,a,function(a,c){b=c,d(a)})},function(a){d(a,b)})},f.inject=f.reduce,f.foldl=f.reduce,f.reduceRight=function(a,b,c,d){var e=j(a,function(a){return a}).reverse();f.reduce(e,b,c,d)},f.foldr=f.reduceRight;var s=function(a,b,c,d){var e=[];b=j(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c){c&&e.push(a),b()})},function(){d(j(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};f.filter=n(s),f.filterSeries=p(s),f.select=f.filter,f.selectSeries=f.filterSeries;var t=function(a,b,c,d){var e=[];b=j(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c){c||e.push(a),b()})},function(){d(j(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};f.reject=n(t),f.rejectSeries=p(t);var u=function(a,b,c,d){a(b,function(a,b){c(a,function(c){c?(d(a),d=function(){}):b()})},function(){d()})};f.detect=n(u),f.detectSeries=p(u),f.some=function(a,b,c){f.each(a,function(a,d){b(a,function(a){a&&(c(!0),c=function(){}),d()})},function(){c(!1)})},f.any=f.some,f.every=function(a,b,c){f.each(a,function(a,d){b(a,function(a){a||(c(!1),c=function(){}),d()})},function(){c(!0)})},f.all=f.every,f.sortBy=function(a,b,c){f.map(a,function(a,c){b(a,function(b,d){b?c(b):c(null,{value:a,criteria:d})})},function(a,b){if(a)return c(a);var d=function(a,b){var c=a.criteria,d=b.criteria;return d>c?-1:c>d?1:0};c(null,j(b.sort(d),function(a){return a.value}))})},f.auto=function(a,b){b=b||function(){};var c=l(a),d=c.length;if(!d)return b();var e={},g=[],j=function(a){g.unshift(a)},m=function(a){for(var b=0;b<g.length;b+=1)if(g[b]===a)return void g.splice(b,1)},n=function(){d--,i(g.slice(0),function(a){a()})};j(function(){if(!d){var a=b;b=function(){},a(null,e)}}),i(c,function(c){var d=h(a[c])?a[c]:[a[c]],g=function(a){var d=Array.prototype.slice.call(arguments,1);if(d.length<=1&&(d=d[0]),a){var g={};i(l(e),function(a){g[a]=e[a]}),g[c]=d,b(a,g),b=function(){}}else e[c]=d,f.setImmediate(n)},o=d.slice(0,Math.abs(d.length-1))||[],p=function(){return k(o,function(a,b){return a&&e.hasOwnProperty(b)},!0)&&!e.hasOwnProperty(c)};if(p())d[d.length-1](g,e);else{var q=function(){p()&&(m(q),d[d.length-1](g,e))};j(q)}})},f.retry=function(a,b,c){var d=5,e=[];"function"==typeof a&&(c=b,b=a,a=d),a=parseInt(a,10)||d;var g=function(d,g){for(var h=function(a,b){return function(c){a(function(a,d){c(!a||b,{err:a,result:d})},g)}};a;)e.push(h(b,!(a-=1)));f.series(e,function(a,b){b=b[b.length-1],(d||c)(b.err,b.result)})};return c?g():g},f.waterfall=function(a,b){if(b=b||function(){},!h(a)){var c=new Error("First argument to waterfall must be an array of functions");return b(c)}if(!a.length)return b();var d=function(a){return function(c){if(c)b.apply(null,arguments),b=function(){};else{var e=Array.prototype.slice.call(arguments,1),g=a.next();e.push(g?d(g):b),f.setImmediate(function(){a.apply(null,e)})}}};d(f.iterator(a))()};var v=function(a,b,c){if(c=c||function(){},h(b))a.map(b,function(a,b){a&&a(function(a){var c=Array.prototype.slice.call(arguments,1);c.length<=1&&(c=c[0]),b.call(null,a,c)})},c);else{var d={};a.each(l(b),function(a,c){b[a](function(b){var e=Array.prototype.slice.call(arguments,1);e.length<=1&&(e=e[0]),d[a]=e,c(b)})},function(a){c(a,d)})}};f.parallel=function(a,b){v({map:f.map,each:f.each},a,b)},f.parallelLimit=function(a,b,c){v({map:r(b),each:m(b)},a,c)},f.series=function(a,b){if(b=b||function(){},h(a))f.mapSeries(a,function(a,b){a&&a(function(a){var c=Array.prototype.slice.call(arguments,1);c.length<=1&&(c=c[0]),b.call(null,a,c)})},b);else{var c={};f.eachSeries(l(a),function(b,d){a[b](function(a){var e=Array.prototype.slice.call(arguments,1);e.length<=1&&(e=e[0]),c[b]=e,d(a)})},function(a){b(a,c)})}},f.iterator=function(a){var b=function(c){var d=function(){return a.length&&a[c].apply(null,arguments),d.next()};return d.next=function(){return c<a.length-1?b(c+1):null},d};return b(0)},f.apply=function(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b.concat(Array.prototype.slice.call(arguments)))}};var w=function(a,b,c,d){var e=[];a(b,function(a,b){c(a,function(a,c){e=e.concat(c||[]),b(a)})},function(a){d(a,e)})};f.concat=n(w),f.concatSeries=p(w),f.whilst=function(a,b,c){a()?b(function(d){return d?c(d):void f.whilst(a,b,c)}):c()},f.doWhilst=function(a,b,c){a(function(d){if(d)return c(d);var e=Array.prototype.slice.call(arguments,1);b.apply(null,e)?f.doWhilst(a,b,c):c()})},f.until=function(a,b,c){a()?c():b(function(d){return d?c(d):void f.until(a,b,c)})},f.doUntil=function(a,b,c){a(function(d){if(d)return c(d);var e=Array.prototype.slice.call(arguments,1);b.apply(null,e)?c():f.doUntil(a,b,c)})},f.queue=function(a,b){function d(a,b,c,d){return a.started||(a.started=!0),h(b)||(b=[b]),0==b.length?f.setImmediate(function(){a.drain&&a.drain()}):void i(b,function(b){var e={data:b,callback:"function"==typeof d?d:null};c?a.tasks.unshift(e):a.tasks.push(e),a.saturated&&a.tasks.length===a.concurrency&&a.saturated(),f.setImmediate(a.process)})}void 0===b&&(b=1);var e=0,g={tasks:[],concurrency:b,saturated:null,empty:null,drain:null,started:!1,paused:!1,push:function(a,b){d(g,a,!1,b)},kill:function(){g.drain=null,g.tasks=[]},unshift:function(a,b){d(g,a,!0,b)},process:function(){if(!g.paused&&e<g.concurrency&&g.tasks.length){var b=g.tasks.shift();g.empty&&0===g.tasks.length&&g.empty(),e+=1;var d=function(){e-=1,b.callback&&b.callback.apply(b,arguments),g.drain&&g.tasks.length+e===0&&g.drain(),g.process()},f=c(d);a(b.data,f)}},length:function(){return g.tasks.length},running:function(){return e},idle:function(){return g.tasks.length+e===0},pause:function(){g.paused!==!0&&(g.paused=!0,g.process())},resume:function(){g.paused!==!1&&(g.paused=!1,g.process())}};return g},f.priorityQueue=function(a,b){function c(a,b){return a.priority-b.priority}function d(a,b,c){for(var d=-1,e=a.length-1;e>d;){var f=d+(e-d+1>>>1);c(b,a[f])>=0?d=f:e=f-1}return d}function e(a,b,e,g){return a.started||(a.started=!0),h(b)||(b=[b]),0==b.length?f.setImmediate(function(){a.drain&&a.drain()}):void i(b,function(b){var h={data:b,priority:e,callback:"function"==typeof g?g:null};a.tasks.splice(d(a.tasks,h,c)+1,0,h),a.saturated&&a.tasks.length===a.concurrency&&a.saturated(),f.setImmediate(a.process)})}var g=f.queue(a,b);return g.push=function(a,b,c){e(g,a,b,c)},delete g.unshift,g},f.cargo=function(a,b){var c=!1,d=[],e={tasks:d,payload:b,saturated:null,empty:null,drain:null,drained:!0,push:function(a,c){h(a)||(a=[a]),i(a,function(a){d.push({data:a,callback:"function"==typeof c?c:null}),e.drained=!1,e.saturated&&d.length===b&&e.saturated()}),f.setImmediate(e.process)},process:function g(){if(!c){if(0===d.length)return e.drain&&!e.drained&&e.drain(),void(e.drained=!0);var f="number"==typeof b?d.splice(0,b):d.splice(0,d.length),h=j(f,function(a){return a.data});e.empty&&e.empty(),c=!0,a(h,function(){c=!1;var a=arguments;i(f,function(b){b.callback&&b.callback.apply(null,a)}),g()})}},length:function(){return d.length},running:function(){return c}};return e};var x=function(a){return function(b){var c=Array.prototype.slice.call(arguments,1);b.apply(null,c.concat([function(b){var c=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(b?console.error&&console.error(b):console[a]&&i(c,function(b){console[a](b)}))}]))}};f.log=x("log"),f.dir=x("dir"),f.memoize=function(a,b){var c={},d={};b=b||function(a){return a};var e=function(){var e=Array.prototype.slice.call(arguments),g=e.pop(),h=b.apply(null,e);h in c?f.nextTick(function(){g.apply(null,c[h])}):h in d?d[h].push(g):(d[h]=[g],a.apply(null,e.concat([function(){c[h]=arguments;var a=d[h];delete d[h];for(var b=0,e=a.length;e>b;b++)a[b].apply(null,arguments)}])))};return e.memo=c,e.unmemoized=a,e},f.unmemoize=function(a){return function(){return(a.unmemoized||a).apply(null,arguments)}},f.times=function(a,b,c){for(var d=[],e=0;a>e;e++)d.push(e);return f.map(d,b,c)},f.timesSeries=function(a,b,c){for(var d=[],e=0;a>e;e++)d.push(e);return f.mapSeries(d,b,c)},f.seq=function(){var a=arguments;return function(){var b=this,c=Array.prototype.slice.call(arguments),d=c.pop();f.reduce(a,c,function(a,c,d){c.apply(b,a.concat([function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);d(a,b)}]))},function(a,c){d.apply(b,[a].concat(c))})}},f.compose=function(){return f.seq.apply(null,Array.prototype.reverse.call(arguments))};var y=function(a,b){var c=function(){var c=this,d=Array.prototype.slice.call(arguments),e=d.pop();return a(b,function(a,b){a.apply(c,d.concat([b]))},e)};if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return c.apply(this,d)}return c};f.applyEach=n(y),f.applyEachSeries=p(y),f.forever=function(a,b){function c(d){if(d){if(b)return b(d);throw d}a(c)}c()},"undefined"!=typeof b&&b.exports?b.exports=f:"undefined"!=typeof define&&define.amd?define([],function(){return f}):d.async=f}()}).call(this,a("_process"))},{_process:2}],2:[function(a,b){function c(){}var d=b.exports={};d.nextTick=function(){var a="undefined"!=typeof window&&window.setImmediate,b="undefined"!=typeof window&&window.MutationObserver,c="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(a)return function(a){return window.setImmediate(a)};var d=[];if(b){var e=document.createElement("div"),f=new MutationObserver(function(){var a=d.slice();d.length=0,a.forEach(function(a){a()})});return f.observe(e,{attributes:!0}),function(a){d.length||e.setAttribute("yes","no"),d.push(a)}}return c?(window.addEventListener("message",function(a){var b=a.source;if((b===window||null===b)&&"process-tick"===a.data&&(a.stopPropagation(),d.length>0)){var c=d.shift();c()}},!0),function(a){d.push(a),window.postMessage("process-tick","*")}):function(a){setTimeout(a,0)}}(),d.title="browser",d.browser=!0,d.env={},d.argv=[],d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(){throw new Error("process.chdir is not supported")}},{}],3:[function(a,b){!function(a,c){"function"==typeof define&&define.amd?define(["d3"],c):"object"==typeof b&&b.exports?b.exports=function(a){return a.tip=c(a),a.tip}:a.d3.tip=c(a.d3)}(this,function(a){return function(){function b(a){u=o(a),v=u.createSVGPoint(),document.body.appendChild(t)}function c(){return"n"}function d(){return[0,0]}function e(){return" "}function f(){var a=p();return{top:a.n.y-t.offsetHeight,left:a.n.x-t.offsetWidth/2}}function g(){var a=p();return{top:a.s.y,left:a.s.x-t.offsetWidth/2}}function h(){var a=p();return{top:a.e.y-t.offsetHeight/2,left:a.e.x}}function i(){var a=p();return{top:a.w.y-t.offsetHeight/2,left:a.w.x-t.offsetWidth}}function j(){var a=p();return{top:a.nw.y-t.offsetHeight,left:a.nw.x-t.offsetWidth}}function k(){var a=p();return{top:a.ne.y-t.offsetHeight,left:a.ne.x}}function l(){var a=p();return{top:a.sw.y,left:a.sw.x-t.offsetWidth}}function m(){var a=p();return{top:a.se.y,left:a.e.x}}function n(){var b=a.select(document.createElement("div"));return b.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),b.node()}function o(a){return a=a.node(),"svg"===a.tagName.toLowerCase()?a:a.ownerSVGElement}function p(){for(var b=w||a.event.target;"undefined"==typeof b.getScreenCTM&&"undefined"===b.parentNode;)b=b.parentNode;var c={},d=b.getScreenCTM(),e=b.getBBox(),f=e.width,g=e.height,h=e.x,i=e.y;return v.x=h,v.y=i,c.nw=v.matrixTransform(d),v.x+=f,c.ne=v.matrixTransform(d),v.y+=g,c.se=v.matrixTransform(d),v.x-=f,c.sw=v.matrixTransform(d),v.y-=g/2,c.w=v.matrixTransform(d),v.x+=f,c.e=v.matrixTransform(d),v.x-=f/2,v.y-=g/2,c.n=v.matrixTransform(d),v.y+=g,c.s=v.matrixTransform(d),c}var q=c,r=d,s=e,t=n(),u=null,v=null,w=null;b.show=function(){var c=Array.prototype.slice.call(arguments);c[c.length-1]instanceof SVGElement&&(w=c.pop());var d,e=s.apply(this,c),f=r.apply(this,c),g=q.apply(this,c),h=a.select(t),i=y.length,j=document.documentElement.scrollTop||document.body.scrollTop,k=document.documentElement.scrollLeft||document.body.scrollLeft;for(h.html(e).style({opacity:1,"pointer-events":"all"});i--;)h.classed(y[i],!1);return d=x.get(g).apply(this),h.classed(g,!0).style({top:d.top+f[0]+j+"px",left:d.left+f[1]+k+"px"}),b},b.hide=function(){var c=a.select(t);return c.style({opacity:0,"pointer-events":"none"}),b},b.attr=function(c){if(arguments.length<2&&"string"==typeof c)return a.select(t).attr(c);var d=Array.prototype.slice.call(arguments);return a.selection.prototype.attr.apply(a.select(t),d),b},b.style=function(c){if(arguments.length<2&&"string"==typeof c)return a.select(t).style(c);var d=Array.prototype.slice.call(arguments);return a.selection.prototype.style.apply(a.select(t),d),b},b.direction=function(c){return arguments.length?(q=null==c?c:a.functor(c),b):q},b.offset=function(c){return arguments.length?(r=null==c?c:a.functor(c),b):r},b.html=function(c){return arguments.length?(s=null==c?c:a.functor(c),b):s};var x=a.map({n:f,s:g,e:h,w:i,nw:j,ne:k,sw:l,se:m}),y=x.keys();return b}})},{}],4:[function(a,b){!function(){function a(a,b){return b>a?-1:a>b?1:a>=b?0:0/0}function c(a){return null===a?0/0:+a}function d(a){return!isNaN(a)}function e(a){return{left:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;a(b[f],c)<0?d=f+1:e=f}return d},right:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;a(b[f],c)>0?e=f:d=f+1}return d}}}function f(a){return a.length}function g(a){for(var b=1;a*b%1;)b*=10;return b}function h(a,b){for(var c in b)Object.defineProperty(a.prototype,c,{value:b[c],enumerable:!1})}function i(){this._=Object.create(null)}function j(a){return(a+="")===kh||a[0]===lh?lh+a:a}function k(a){return(a+="")[0]===lh?a.slice(1):a}function l(a){return j(a)in this._}function m(a){return(a=j(a))in this._&&delete this._[a]}function n(){var a=[];for(var b in this._)a.push(k(b));return a}function o(){var a=0;for(var b in this._)++a;return a}function p(){for(var a in this._)return!1;return!0}function q(){this._=Object.create(null)}function r(a,b,c){return function(){var d=c.apply(b,arguments);return d===b?a:d}}function s(a,b){if(b in a)return b;b=b.charAt(0).toUpperCase()+b.slice(1);for(var c=0,d=mh.length;d>c;++c){var e=mh[c]+b;if(e in a)return e}}function t(){}function u(){}function v(a){function b(){for(var b,d=c,e=-1,f=d.length;++e<f;)(b=d[e].on)&&b.apply(this,arguments);return a}var c=[],d=new i;return b.on=function(b,e){var f,g=d.get(b);return arguments.length<2?g&&g.on:(g&&(g.on=null,c=c.slice(0,f=c.indexOf(g)).concat(c.slice(f+1)),d.remove(b)),e&&c.push(d.set(b,{on:e})),a)},b}function w(){Xg.event.preventDefault()}function x(){for(var a,b=Xg.event;a=b.sourceEvent;)b=a;return b}function y(a){for(var b=new u,c=0,d=arguments.length;++c<d;)b[arguments[c]]=v(b);return b.of=function(c,d){return function(e){try{var f=e.sourceEvent=Xg.event;e.target=a,Xg.event=e,b[e.type].apply(c,d)}finally{Xg.event=f}}},b}function z(a){return oh(a,th),a}function A(a){return"function"==typeof a?a:function(){return ph(a,this)}}function B(a){return"function"==typeof a?a:function(){return qh(a,this)}}function C(a,b){function c(){this.removeAttribute(a)}function d(){this.removeAttributeNS(a.space,a.local)}function e(){this.setAttribute(a,b)}function f(){this.setAttributeNS(a.space,a.local,b)}function g(){var c=b.apply(this,arguments);null==c?this.removeAttribute(a):this.setAttribute(a,c)}function h(){var c=b.apply(this,arguments);null==c?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}return a=Xg.ns.qualify(a),null==b?a.local?d:c:"function"==typeof b?a.local?h:g:a.local?f:e}function D(a){return a.trim().replace(/\s+/g," ")}function E(a){return new RegExp("(?:^|\\s+)"+Xg.requote(a)+"(?:\\s+|$)","g")}function F(a){return(a+"").trim().split(/^|\s+/)}function G(a,b){function c(){for(var c=-1;++c<e;)a[c](this,b)}function d(){for(var c=-1,d=b.apply(this,arguments);++c<e;)a[c](this,d)}a=F(a).map(H);var e=a.length;return"function"==typeof b?d:c}function H(a){var b=E(a);return function(c,d){if(e=c.classList)return d?e.add(a):e.remove(a);var e=c.getAttribute("class")||"";d?(b.lastIndex=0,b.test(e)||c.setAttribute("class",D(e+" "+a))):c.setAttribute("class",D(e.replace(b," ")))}}function I(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);null==d?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return null==b?d:"function"==typeof b?f:e}function J(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}return null==b?c:"function"==typeof b?e:d}function K(a){return"function"==typeof a?a:(a=Xg.ns.qualify(a)).local?function(){return this.ownerDocument.createElementNS(a.space,a.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,a)}}function L(a){return{__data__:a}}function M(a){return function(){return sh(this,a)}}function N(b){return arguments.length||(b=a),function(a,c){return a&&c?b(a.__data__,c.__data__):!a-!c}}function O(a,b){for(var c=0,d=a.length;d>c;c++)for(var e,f=a[c],g=0,h=f.length;h>g;g++)(e=f[g])&&b(e,g,c);return a}function P(a){return oh(a,vh),a}function Q(a){var b,c;return function(d,e,f){var g,h=a[f].update,i=h.length;for(f!=c&&(c=f,b=0),e>=b&&(b=e+1);!(g=h[b])&&++b<i;);return g}}function R(){var a=this.__transition__;a&&++a.active}function S(a,b,c){function d(){var b=this[g];b&&(this.removeEventListener(a,b,b.$),delete this[g])}function e(){var e=i(b,Zg(arguments));d.call(this),this.addEventListener(a,this[g]=e,e.$=c),e._=b}function f(){var b,c=new RegExp("^__on([^.]+)"+Xg.requote(a)+"$");for(var d in this)if(b=d.match(c)){var e=this[d];this.removeEventListener(b[1],e,e.$),delete this[d]}}var g="__on"+a,h=a.indexOf("."),i=T;h>0&&(a=a.slice(0,h));var j=xh.get(a);return j&&(a=j,i=U),h?b?e:d:b?t:f}function T(a,b){return function(c){var d=Xg.event;Xg.event=c,b[0]=this.__data__;try{a.apply(this,b)}finally{Xg.event=d}}}function U(a,b){var c=T(a,b);return function(a){var b=this,d=a.relatedTarget;d&&(d===b||8&d.compareDocumentPosition(b))||c.call(b,a)}}function V(){var a=".dragsuppress-"+ ++zh,b="click"+a,c=Xg.select(ah).on("touchmove"+a,w).on("dragstart"+a,w).on("selectstart"+a,w);if(yh){var d=_g.style,e=d[yh];d[yh]="none"}return function(f){function g(){c.on(b,null)}c.on(a,null),yh&&(d[yh]=e),f&&(c.on(b,function(){w(),g()},!0),setTimeout(g,0))}}function W(a,b){b.changedTouches&&(b=b.changedTouches[0]);var c=a.ownerSVGElement||a;if(c.createSVGPoint){var d=c.createSVGPoint();if(0>Ah&&(ah.scrollX||ah.scrollY)){c=Xg.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var e=c[0][0].getScreenCTM();Ah=!(e.f||e.e),c.remove()}return Ah?(d.x=b.pageX,d.y=b.pageY):(d.x=b.clientX,d.y=b.clientY),d=d.matrixTransform(a.getScreenCTM().inverse()),[d.x,d.y]}var f=a.getBoundingClientRect();return[b.clientX-f.left-a.clientLeft,b.clientY-f.top-a.clientTop]}function X(){return Xg.event.changedTouches[0].identifier}function Y(){return Xg.event.target}function Z(){return ah}function $(a){return a>0?1:0>a?-1:0}function _(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(b[1]-a[1])*(c[0]-a[0])}function ab(a){return a>1?0:-1>a?Bh:Math.acos(a)}function bb(a){return a>1?Dh:-1>a?-Dh:Math.asin(a)}function cb(a){return((a=Math.exp(a))-1/a)/2}function db(a){return((a=Math.exp(a))+1/a)/2}function eb(a){return((a=Math.exp(2*a))-1)/(a+1)}function fb(a){return(a=Math.sin(a/2))*a}function gb(){}function hb(a,b,c){return this instanceof hb?(this.h=+a,this.s=+b,void(this.l=+c)):arguments.length<2?a instanceof hb?new hb(a.h,a.s,a.l):vb(""+a,wb,hb):new hb(a,b,c)}function ib(a,b,c){function d(a){return a>360?a-=360:0>a&&(a+=360),60>a?f+(g-f)*a/60:180>a?g:240>a?f+(g-f)*(240-a)/60:f}function e(a){return Math.round(255*d(a))}var f,g;return a=isNaN(a)?0:(a%=360)<0?a+360:a,b=isNaN(b)?0:0>b?0:b>1?1:b,c=0>c?0:c>1?1:c,g=.5>=c?c*(1+b):c+b-c*b,f=2*c-g,new rb(e(a+120),e(a),e(a-120))}function jb(a,b,c){return this instanceof jb?(this.h=+a,this.c=+b,void(this.l=+c)):arguments.length<2?a instanceof jb?new jb(a.h,a.c,a.l):a instanceof lb?nb(a.l,a.a,a.b):nb((a=xb((a=Xg.rgb(a)).r,a.g,a.b)).l,a.a,a.b):new jb(a,b,c)}function kb(a,b,c){return isNaN(a)&&(a=0),isNaN(b)&&(b=0),new lb(c,Math.cos(a*=Gh)*b,Math.sin(a)*b)}function lb(a,b,c){return this instanceof lb?(this.l=+a,this.a=+b,void(this.b=+c)):arguments.length<2?a instanceof lb?new lb(a.l,a.a,a.b):a instanceof jb?kb(a.h,a.c,a.l):xb((a=rb(a)).r,a.g,a.b):new lb(a,b,c)}function mb(a,b,c){var d=(a+16)/116,e=d+b/500,f=d-c/200;return e=ob(e)*Rh,d=ob(d)*Sh,f=ob(f)*Th,new rb(qb(3.2404542*e-1.5371385*d-.4985314*f),qb(-.969266*e+1.8760108*d+.041556*f),qb(.0556434*e-.2040259*d+1.0572252*f))}function nb(a,b,c){return a>0?new jb(Math.atan2(c,b)*Hh,Math.sqrt(b*b+c*c),a):new jb(0/0,0/0,a)}function ob(a){return a>.206893034?a*a*a:(a-4/29)/7.787037}function pb(a){return a>.008856?Math.pow(a,1/3):7.787037*a+4/29}function qb(a){return Math.round(255*(.00304>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055))}function rb(a,b,c){return this instanceof rb?(this.r=~~a,this.g=~~b,void(this.b=~~c)):arguments.length<2?a instanceof rb?new rb(a.r,a.g,a.b):vb(""+a,rb,ib):new rb(a,b,c)}function sb(a){return new rb(a>>16,a>>8&255,255&a)}function tb(a){return sb(a)+""}function ub(a){return 16>a?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function vb(a,b,c){var d,e,f,g=0,h=0,i=0;if(d=/([a-z]+)\((.*)\)/i.exec(a))switch(e=d[2].split(","),d[1]){case"hsl":return c(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100);case"rgb":return b(zb(e[0]),zb(e[1]),zb(e[2]))}return(f=Wh.get(a))?b(f.r,f.g,f.b):(null==a||"#"!==a.charAt(0)||isNaN(f=parseInt(a.slice(1),16))||(4===a.length?(g=(3840&f)>>4,g=g>>4|g,h=240&f,h=h>>4|h,i=15&f,i=i<<4|i):7===a.length&&(g=(16711680&f)>>16,h=(65280&f)>>8,i=255&f)),b(g,h,i))}function wb(a,b,c){var d,e,f=Math.min(a/=255,b/=255,c/=255),g=Math.max(a,b,c),h=g-f,i=(g+f)/2;return h?(e=.5>i?h/(g+f):h/(2-g-f),d=a==g?(b-c)/h+(c>b?6:0):b==g?(c-a)/h+2:(a-b)/h+4,d*=60):(d=0/0,e=i>0&&1>i?0:d),new hb(d,e,i)}function xb(a,b,c){a=yb(a),b=yb(b),c=yb(c);var d=pb((.4124564*a+.3575761*b+.1804375*c)/Rh),e=pb((.2126729*a+.7151522*b+.072175*c)/Sh),f=pb((.0193339*a+.119192*b+.9503041*c)/Th);return lb(116*e-16,500*(d-e),200*(e-f))}function yb(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function zb(a){var b=parseFloat(a);return"%"===a.charAt(a.length-1)?Math.round(2.55*b):b}function Ab(a){return"function"==typeof a?a:function(){return a}}function Bb(a){return a}function Cb(a){return function(b,c,d){return 2===arguments.length&&"function"==typeof c&&(d=c,c=null),Db(b,c,a,d)}}function Db(a,b,c,d){function e(){var a,b=i.status;if(!b&&Fb(i)||b>=200&&300>b||304===b){try{a=c.call(f,i)}catch(d){return void g.error.call(f,d)}g.load.call(f,a)}else g.error.call(f,i)}var f={},g=Xg.dispatch("beforesend","progress","load","error"),h={},i=new XMLHttpRequest,j=null;return!ah.XDomainRequest||"withCredentials"in i||!/^(http(s)?:)?\/\//.test(a)||(i=new XDomainRequest),"onload"in i?i.onload=i.onerror=e:i.onreadystatechange=function(){i.readyState>3&&e()},i.onprogress=function(a){var b=Xg.event;Xg.event=a;try{g.progress.call(f,i)}finally{Xg.event=b}},f.header=function(a,b){return a=(a+"").toLowerCase(),arguments.length<2?h[a]:(null==b?delete h[a]:h[a]=b+"",f)},f.mimeType=function(a){return arguments.length?(b=null==a?null:a+"",f):b},f.responseType=function(a){return arguments.length?(j=a,f):j},f.response=function(a){return c=a,f},["get","post"].forEach(function(a){f[a]=function(){return f.send.apply(f,[a].concat(Zg(arguments)))}}),f.send=function(c,d,e){if(2===arguments.length&&"function"==typeof d&&(e=d,d=null),i.open(c,a,!0),null==b||"accept"in h||(h.accept=b+",*/*"),i.setRequestHeader)for(var k in h)i.setRequestHeader(k,h[k]);return null!=b&&i.overrideMimeType&&i.overrideMimeType(b),null!=j&&(i.responseType=j),null!=e&&f.on("error",e).on("load",function(a){e(null,a)}),g.beforesend.call(f,i),i.send(null==d?null:d),f},f.abort=function(){return i.abort(),f},Xg.rebind(f,g,"on"),null==d?f:f.get(Eb(d))}function Eb(a){return 1===a.length?function(b,c){a(null==b?c:null)}:a}function Fb(a){var b=a.responseType;return b&&"text"!==b?a.response:a.responseText}function Gb(){var a=Hb(),b=Ib()-a;b>24?(isFinite(b)&&(clearTimeout($h),$h=setTimeout(Gb,b)),Zh=0):(Zh=1,ai(Gb))}function Hb(){var a=Date.now();for(_h=Xh;_h;)a>=_h.t&&(_h.f=_h.c(a-_h.t)),_h=_h.n;return a}function Ib(){for(var a,b=Xh,c=1/0;b;)b.f?b=a?a.n=b.n:Xh=b.n:(b.t<c&&(c=b.t),b=(a=b).n);return Yh=a,c}function Jb(a,b){return b-(a?Math.ceil(Math.log(a)/Math.LN10):1)}function Kb(a,b){var c=Math.pow(10,3*jh(8-b));return{scale:b>8?function(a){return a/c}:function(a){return a*c},symbol:a}}function Lb(a){var b=a.decimal,c=a.thousands,d=a.grouping,e=a.currency,f=d&&c?function(a,b){for(var e=a.length,f=[],g=0,h=d[0],i=0;e>0&&h>0&&(i+h+1>b&&(h=Math.max(1,b-i)),f.push(a.substring(e-=h,e+h)),!((i+=h+1)>b));)h=d[g=(g+1)%d.length];return f.reverse().join(c)}:Bb;return function(a){var c=ci.exec(a),d=c[1]||" ",g=c[2]||">",h=c[3]||"-",i=c[4]||"",j=c[5],k=+c[6],l=c[7],m=c[8],n=c[9],o=1,p="",q="",r=!1,s=!0;switch(m&&(m=+m.substring(1)),(j||"0"===d&&"="===g)&&(j=d="0",g="="),n){case"n":l=!0,n="g";break;case"%":o=100,q="%",n="f";break;case"p":o=100,q="%",n="r";break;case"b":case"o":case"x":case"X":"#"===i&&(p="0"+n.toLowerCase());case"c":s=!1;case"d":r=!0,m=0;break;case"s":o=-1,n="r"}"$"===i&&(p=e[0],q=e[1]),"r"!=n||m||(n="g"),null!=m&&("g"==n?m=Math.max(1,Math.min(21,m)):("e"==n||"f"==n)&&(m=Math.max(0,Math.min(20,m)))),n=di.get(n)||Mb;var t=j&&l;return function(a){var c=q;if(r&&a%1)return"";var e=0>a||0===a&&0>1/a?(a=-a,"-"):"-"===h?"":h;if(0>o){var i=Xg.formatPrefix(a,m);a=i.scale(a),c=i.symbol+q}else a*=o;a=n(a,m);var u,v,w=a.lastIndexOf(".");if(0>w){var x=s?a.lastIndexOf("e"):-1;0>x?(u=a,v=""):(u=a.substring(0,x),v=a.substring(x))}else u=a.substring(0,w),v=b+a.substring(w+1);!j&&l&&(u=f(u,1/0));var y=p.length+u.length+v.length+(t?0:e.length),z=k>y?new Array(y=k-y+1).join(d):"";return t&&(u=f(z+u,z.length?k-v.length:1/0)),e+=p,a=u+v,("<"===g?e+a+z:">"===g?z+e+a:"^"===g?z.substring(0,y>>=1)+e+a+z.substring(y):e+(t?a:z+a))+c}}}function Mb(a){return a+""}function Nb(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ob(a,b,c){function d(b){var c=a(b),d=f(c,1);return d-b>b-c?c:d}function e(c){return b(c=a(new fi(c-1)),1),c}function f(a,c){return b(a=new fi(+a),c),a}function g(a,d,f){var g=e(a),h=[];if(f>1)for(;d>g;)c(g)%f||h.push(new Date(+g)),b(g,1);else for(;d>g;)h.push(new Date(+g)),b(g,1);return h}function h(a,b,c){try{fi=Nb;var d=new Nb;return d._=a,g(d,b,c)}finally{fi=Date}}a.floor=a,a.round=d,a.ceil=e,a.offset=f,a.range=g;var i=a.utc=Pb(a);return i.floor=i,i.round=Pb(d),i.ceil=Pb(e),i.offset=Pb(f),i.range=h,a}function Pb(a){return function(b,c){try{fi=Nb;var d=new Nb;return d._=b,a(d,c)._}finally{fi=Date}}}function Qb(a){function b(a){function b(b){for(var c,e,f,g=[],h=-1,i=0;++h<d;)37===a.charCodeAt(h)&&(g.push(a.slice(i,h)),null!=(e=hi[c=a.charAt(++h)])&&(c=a.charAt(++h)),(f=C[c])&&(c=f(b,null==e?"e"===c?" ":"0":e)),g.push(c),i=h+1);return g.push(a.slice(i,h)),g.join("")}var d=a.length;return b.parse=function(b){var d={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},e=c(d,a,b,0);if(e!=b.length)return null;"p"in d&&(d.H=d.H%12+12*d.p);var f=null!=d.Z&&fi!==Nb,g=new(f?Nb:fi);return"j"in d?g.setFullYear(d.y,0,d.j):"w"in d&&("W"in d||"U"in d)?(g.setFullYear(d.y,0,1),g.setFullYear(d.y,0,"W"in d?(d.w+6)%7+7*d.W-(g.getDay()+5)%7:d.w+7*d.U-(g.getDay()+6)%7)):g.setFullYear(d.y,d.m,d.d),g.setHours(d.H+(d.Z/100|0),d.M+d.Z%100,d.S,d.L),f?g._:g},b.toString=function(){return a},b}function c(a,b,c,d){for(var e,f,g,h=0,i=b.length,j=c.length;i>h;){if(d>=j)return-1;if(e=b.charCodeAt(h++),37===e){if(g=b.charAt(h++),f=D[g in hi?b.charAt(h++):g],!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function d(a,b,c){w.lastIndex=0;var d=w.exec(b.slice(c));return d?(a.w=x.get(d[0].toLowerCase()),c+d[0].length):-1}function e(a,b,c){u.lastIndex=0;var d=u.exec(b.slice(c));return d?(a.w=v.get(d[0].toLowerCase()),c+d[0].length):-1}function f(a,b,c){A.lastIndex=0;var d=A.exec(b.slice(c));return d?(a.m=B.get(d[0].toLowerCase()),c+d[0].length):-1}function g(a,b,c){y.lastIndex=0;var d=y.exec(b.slice(c));return d?(a.m=z.get(d[0].toLowerCase()),c+d[0].length):-1}function h(a,b,d){return c(a,C.c.toString(),b,d)}function i(a,b,d){return c(a,C.x.toString(),b,d)}function j(a,b,d){return c(a,C.X.toString(),b,d)}function k(a,b,c){var d=t.get(b.slice(c,c+=2).toLowerCase());return null==d?-1:(a.p=d,c)}var l=a.dateTime,m=a.date,n=a.time,o=a.periods,p=a.days,q=a.shortDays,r=a.months,s=a.shortMonths;b.utc=function(a){function c(a){try{fi=Nb;var b=new fi;return b._=a,d(b)}finally{fi=Date}}var d=b(a);return c.parse=function(a){try{fi=Nb;var b=d.parse(a);return b&&b._}finally{fi=Date}},c.toString=d.toString,c
|
||
},b.multi=b.utc.multi=ic;var t=Xg.map(),u=Sb(p),v=Tb(p),w=Sb(q),x=Tb(q),y=Sb(r),z=Tb(r),A=Sb(s),B=Tb(s);o.forEach(function(a,b){t.set(a.toLowerCase(),b)});var C={a:function(a){return q[a.getDay()]},A:function(a){return p[a.getDay()]},b:function(a){return s[a.getMonth()]},B:function(a){return r[a.getMonth()]},c:b(l),d:function(a,b){return Rb(a.getDate(),b,2)},e:function(a,b){return Rb(a.getDate(),b,2)},H:function(a,b){return Rb(a.getHours(),b,2)},I:function(a,b){return Rb(a.getHours()%12||12,b,2)},j:function(a,b){return Rb(1+ei.dayOfYear(a),b,3)},L:function(a,b){return Rb(a.getMilliseconds(),b,3)},m:function(a,b){return Rb(a.getMonth()+1,b,2)},M:function(a,b){return Rb(a.getMinutes(),b,2)},p:function(a){return o[+(a.getHours()>=12)]},S:function(a,b){return Rb(a.getSeconds(),b,2)},U:function(a,b){return Rb(ei.sundayOfYear(a),b,2)},w:function(a){return a.getDay()},W:function(a,b){return Rb(ei.mondayOfYear(a),b,2)},x:b(m),X:b(n),y:function(a,b){return Rb(a.getFullYear()%100,b,2)},Y:function(a,b){return Rb(a.getFullYear()%1e4,b,4)},Z:gc,"%":function(){return"%"}},D={a:d,A:e,b:f,B:g,c:h,d:ac,e:ac,H:cc,I:cc,j:bc,L:fc,m:_b,M:dc,p:k,S:ec,U:Vb,w:Ub,W:Wb,x:i,X:j,y:Yb,Y:Xb,Z:Zb,"%":hc};return b}function Rb(a,b,c){var d=0>a?"-":"",e=(d?-a:a)+"",f=e.length;return d+(c>f?new Array(c-f+1).join(b)+e:e)}function Sb(a){return new RegExp("^(?:"+a.map(Xg.requote).join("|")+")","i")}function Tb(a){for(var b=new i,c=-1,d=a.length;++c<d;)b.set(a[c].toLowerCase(),c);return b}function Ub(a,b,c){ii.lastIndex=0;var d=ii.exec(b.slice(c,c+1));return d?(a.w=+d[0],c+d[0].length):-1}function Vb(a,b,c){ii.lastIndex=0;var d=ii.exec(b.slice(c));return d?(a.U=+d[0],c+d[0].length):-1}function Wb(a,b,c){ii.lastIndex=0;var d=ii.exec(b.slice(c));return d?(a.W=+d[0],c+d[0].length):-1}function Xb(a,b,c){ii.lastIndex=0;var d=ii.exec(b.slice(c,c+4));return d?(a.y=+d[0],c+d[0].length):-1}function Yb(a,b,c){ii.lastIndex=0;var d=ii.exec(b.slice(c,c+2));return d?(a.y=$b(+d[0]),c+d[0].length):-1}function Zb(a,b,c){return/^[+-]\d{4}$/.test(b=b.slice(c,c+5))?(a.Z=-b,c+5):-1}function $b(a){return a+(a>68?1900:2e3)}function _b(a,b,c){ii.lastIndex=0;var d=ii.exec(b.slice(c,c+2));return d?(a.m=d[0]-1,c+d[0].length):-1}function ac(a,b,c){ii.lastIndex=0;var d=ii.exec(b.slice(c,c+2));return d?(a.d=+d[0],c+d[0].length):-1}function bc(a,b,c){ii.lastIndex=0;var d=ii.exec(b.slice(c,c+3));return d?(a.j=+d[0],c+d[0].length):-1}function cc(a,b,c){ii.lastIndex=0;var d=ii.exec(b.slice(c,c+2));return d?(a.H=+d[0],c+d[0].length):-1}function dc(a,b,c){ii.lastIndex=0;var d=ii.exec(b.slice(c,c+2));return d?(a.M=+d[0],c+d[0].length):-1}function ec(a,b,c){ii.lastIndex=0;var d=ii.exec(b.slice(c,c+2));return d?(a.S=+d[0],c+d[0].length):-1}function fc(a,b,c){ii.lastIndex=0;var d=ii.exec(b.slice(c,c+3));return d?(a.L=+d[0],c+d[0].length):-1}function gc(a){var b=a.getTimezoneOffset(),c=b>0?"-":"+",d=jh(b)/60|0,e=jh(b)%60;return c+Rb(d,"0",2)+Rb(e,"0",2)}function hc(a,b,c){ji.lastIndex=0;var d=ji.exec(b.slice(c,c+1));return d?c+d[0].length:-1}function ic(a){for(var b=a.length,c=-1;++c<b;)a[c][0]=this(a[c][0]);return function(b){for(var c=0,d=a[c];!d[1](b);)d=a[++c];return d[0](b)}}function jc(){}function kc(a,b,c){var d=c.s=a+b,e=d-a,f=d-e;c.t=a-f+(b-e)}function lc(a,b){a&&ni.hasOwnProperty(a.type)&&ni[a.type](a,b)}function mc(a,b,c){var d,e=-1,f=a.length-c;for(b.lineStart();++e<f;)d=a[e],b.point(d[0],d[1],d[2]);b.lineEnd()}function nc(a,b){var c=-1,d=a.length;for(b.polygonStart();++c<d;)mc(a[c],b,1);b.polygonEnd()}function oc(){function a(a,b){a*=Gh,b=b*Gh/2+Bh/4;var c=a-d,g=c>=0?1:-1,h=g*c,i=Math.cos(b),j=Math.sin(b),k=f*j,l=e*i+k*Math.cos(h),m=k*g*Math.sin(h);pi.add(Math.atan2(m,l)),d=a,e=i,f=j}var b,c,d,e,f;qi.point=function(g,h){qi.point=a,d=(b=g)*Gh,e=Math.cos(h=(c=h)*Gh/2+Bh/4),f=Math.sin(h)},qi.lineEnd=function(){a(b,c)}}function pc(a){var b=a[0],c=a[1],d=Math.cos(c);return[d*Math.cos(b),d*Math.sin(b),Math.sin(c)]}function qc(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function rc(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function sc(a,b){a[0]+=b[0],a[1]+=b[1],a[2]+=b[2]}function tc(a,b){return[a[0]*b,a[1]*b,a[2]*b]}function uc(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);a[0]/=b,a[1]/=b,a[2]/=b}function vc(a){return[Math.atan2(a[1],a[0]),bb(a[2])]}function wc(a,b){return jh(a[0]-b[0])<Eh&&jh(a[1]-b[1])<Eh}function xc(a,b){a*=Gh;var c=Math.cos(b*=Gh);yc(c*Math.cos(a),c*Math.sin(a),Math.sin(b))}function yc(a,b,c){++ri,ti+=(a-ti)/ri,ui+=(b-ui)/ri,vi+=(c-vi)/ri}function zc(){function a(a,e){a*=Gh;var f=Math.cos(e*=Gh),g=f*Math.cos(a),h=f*Math.sin(a),i=Math.sin(e),j=Math.atan2(Math.sqrt((j=c*i-d*h)*j+(j=d*g-b*i)*j+(j=b*h-c*g)*j),b*g+c*h+d*i);si+=j,wi+=j*(b+(b=g)),xi+=j*(c+(c=h)),yi+=j*(d+(d=i)),yc(b,c,d)}var b,c,d;Ci.point=function(e,f){e*=Gh;var g=Math.cos(f*=Gh);b=g*Math.cos(e),c=g*Math.sin(e),d=Math.sin(f),Ci.point=a,yc(b,c,d)}}function Ac(){Ci.point=xc}function Bc(){function a(a,b){a*=Gh;var c=Math.cos(b*=Gh),g=c*Math.cos(a),h=c*Math.sin(a),i=Math.sin(b),j=e*i-f*h,k=f*g-d*i,l=d*h-e*g,m=Math.sqrt(j*j+k*k+l*l),n=d*g+e*h+f*i,o=m&&-ab(n)/m,p=Math.atan2(m,n);zi+=o*j,Ai+=o*k,Bi+=o*l,si+=p,wi+=p*(d+(d=g)),xi+=p*(e+(e=h)),yi+=p*(f+(f=i)),yc(d,e,f)}var b,c,d,e,f;Ci.point=function(g,h){b=g,c=h,Ci.point=a,g*=Gh;var i=Math.cos(h*=Gh);d=i*Math.cos(g),e=i*Math.sin(g),f=Math.sin(h),yc(d,e,f)},Ci.lineEnd=function(){a(b,c),Ci.lineEnd=Ac,Ci.point=xc}}function Cc(){return!0}function Dc(a,b,c,d,e){var f=[],g=[];if(a.forEach(function(a){if(!((b=a.length-1)<=0)){var b,c=a[0],d=a[b];if(wc(c,d)){e.lineStart();for(var h=0;b>h;++h)e.point((c=a[h])[0],c[1]);return void e.lineEnd()}var i=new Fc(c,a,null,!0),j=new Fc(c,null,i,!1);i.o=j,f.push(i),g.push(j),i=new Fc(d,a,null,!1),j=new Fc(d,null,i,!0),i.o=j,f.push(i),g.push(j)}}),g.sort(b),Ec(f),Ec(g),f.length){for(var h=0,i=c,j=g.length;j>h;++h)g[h].e=i=!i;for(var k,l,m=f[0];;){for(var n=m,o=!0;n.v;)if((n=n.n)===m)return;k=n.z,e.lineStart();do{if(n.v=n.o.v=!0,n.e){if(o)for(var h=0,j=k.length;j>h;++h)e.point((l=k[h])[0],l[1]);else d(n.x,n.n.x,1,e);n=n.n}else{if(o){k=n.p.z;for(var h=k.length-1;h>=0;--h)e.point((l=k[h])[0],l[1])}else d(n.x,n.p.x,-1,e);n=n.p}n=n.o,k=n.z,o=!o}while(!n.v);e.lineEnd()}}}function Ec(a){if(b=a.length){for(var b,c,d=0,e=a[0];++d<b;)e.n=c=a[d],c.p=e,e=c;e.n=c=a[0],c.p=e}}function Fc(a,b,c,d){this.x=a,this.z=b,this.o=c,this.e=d,this.v=!1,this.n=this.p=null}function Gc(a,b,c,d){return function(e,f){function g(b,c){var d=e(b,c);a(b=d[0],c=d[1])&&f.point(b,c)}function h(a,b){var c=e(a,b);q.point(c[0],c[1])}function i(){s.point=h,q.lineStart()}function j(){s.point=g,q.lineEnd()}function k(a,b){p.push([a,b]);var c=e(a,b);u.point(c[0],c[1])}function l(){u.lineStart(),p=[]}function m(){k(p[0][0],p[0][1]),u.lineEnd();var a,b=u.clean(),c=t.buffer(),d=c.length;if(p.pop(),o.push(p),p=null,d)if(1&b){a=c[0];var e,d=a.length-1,g=-1;if(d>0){for(v||(f.polygonStart(),v=!0),f.lineStart();++g<d;)f.point((e=a[g])[0],e[1]);f.lineEnd()}}else d>1&&2&b&&c.push(c.pop().concat(c.shift())),n.push(c.filter(Hc))}var n,o,p,q=b(f),r=e.invert(d[0],d[1]),s={point:g,lineStart:i,lineEnd:j,polygonStart:function(){s.point=k,s.lineStart=l,s.lineEnd=m,n=[],o=[]},polygonEnd:function(){s.point=g,s.lineStart=i,s.lineEnd=j,n=Xg.merge(n);var a=Nc(r,o);n.length?(v||(f.polygonStart(),v=!0),Dc(n,Jc,a,c,f)):a&&(v||(f.polygonStart(),v=!0),f.lineStart(),c(null,null,1,f),f.lineEnd()),v&&(f.polygonEnd(),v=!1),n=o=null},sphere:function(){f.polygonStart(),f.lineStart(),c(null,null,1,f),f.lineEnd(),f.polygonEnd()}},t=Ic(),u=b(t),v=!1;return s}}function Hc(a){return a.length>1}function Ic(){var a,b=[];return{lineStart:function(){b.push(a=[])},point:function(b,c){a.push([b,c])},lineEnd:t,buffer:function(){var c=b;return b=[],a=null,c},rejoin:function(){b.length>1&&b.push(b.pop().concat(b.shift()))}}}function Jc(a,b){return((a=a.x)[0]<0?a[1]-Dh-Eh:Dh-a[1])-((b=b.x)[0]<0?b[1]-Dh-Eh:Dh-b[1])}function Kc(a){var b,c=0/0,d=0/0,e=0/0;return{lineStart:function(){a.lineStart(),b=1},point:function(f,g){var h=f>0?Bh:-Bh,i=jh(f-c);jh(i-Bh)<Eh?(a.point(c,d=(d+g)/2>0?Dh:-Dh),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),a.point(f,d),b=0):e!==h&&i>=Bh&&(jh(c-e)<Eh&&(c-=e*Eh),jh(f-h)<Eh&&(f-=h*Eh),d=Lc(c,d,f,g),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),b=0),a.point(c=f,d=g),e=h},lineEnd:function(){a.lineEnd(),c=d=0/0},clean:function(){return 2-b}}}function Lc(a,b,c,d){var e,f,g=Math.sin(a-c);return jh(g)>Eh?Math.atan((Math.sin(b)*(f=Math.cos(d))*Math.sin(c)-Math.sin(d)*(e=Math.cos(b))*Math.sin(a))/(e*f*g)):(b+d)/2}function Mc(a,b,c,d){var e;if(null==a)e=c*Dh,d.point(-Bh,e),d.point(0,e),d.point(Bh,e),d.point(Bh,0),d.point(Bh,-e),d.point(0,-e),d.point(-Bh,-e),d.point(-Bh,0),d.point(-Bh,e);else if(jh(a[0]-b[0])>Eh){var f=a[0]<b[0]?Bh:-Bh;e=c*f/2,d.point(-f,e),d.point(0,e),d.point(f,e)}else d.point(b[0],b[1])}function Nc(a,b){var c=a[0],d=a[1],e=[Math.sin(c),-Math.cos(c),0],f=0,g=0;pi.reset();for(var h=0,i=b.length;i>h;++h){var j=b[h],k=j.length;if(k)for(var l=j[0],m=l[0],n=l[1]/2+Bh/4,o=Math.sin(n),p=Math.cos(n),q=1;;){q===k&&(q=0),a=j[q];var r=a[0],s=a[1]/2+Bh/4,t=Math.sin(s),u=Math.cos(s),v=r-m,w=v>=0?1:-1,x=w*v,y=x>Bh,z=o*t;if(pi.add(Math.atan2(z*w*Math.sin(x),p*u+z*Math.cos(x))),f+=y?v+w*Ch:v,y^m>=c^r>=c){var A=rc(pc(l),pc(a));uc(A);var B=rc(e,A);uc(B);var C=(y^v>=0?-1:1)*bb(B[2]);(d>C||d===C&&(A[0]||A[1]))&&(g+=y^v>=0?1:-1)}if(!q++)break;m=r,o=t,p=u,l=a}}return(-Eh>f||Eh>f&&0>pi)^1&g}function Oc(a){function b(a,b){return Math.cos(a)*Math.cos(b)>f}function c(a){var c,f,i,j,k;return{lineStart:function(){j=i=!1,k=1},point:function(l,m){var n,o=[l,m],p=b(l,m),q=g?p?0:e(l,m):p?e(l+(0>l?Bh:-Bh),m):0;if(!c&&(j=i=p)&&a.lineStart(),p!==i&&(n=d(c,o),(wc(c,n)||wc(o,n))&&(o[0]+=Eh,o[1]+=Eh,p=b(o[0],o[1]))),p!==i)k=0,p?(a.lineStart(),n=d(o,c),a.point(n[0],n[1])):(n=d(c,o),a.point(n[0],n[1]),a.lineEnd()),c=n;else if(h&&c&&g^p){var r;q&f||!(r=d(o,c,!0))||(k=0,g?(a.lineStart(),a.point(r[0][0],r[0][1]),a.point(r[1][0],r[1][1]),a.lineEnd()):(a.point(r[1][0],r[1][1]),a.lineEnd(),a.lineStart(),a.point(r[0][0],r[0][1])))}!p||c&&wc(c,o)||a.point(o[0],o[1]),c=o,i=p,f=q},lineEnd:function(){i&&a.lineEnd(),c=null},clean:function(){return k|(j&&i)<<1}}}function d(a,b,c){var d=pc(a),e=pc(b),g=[1,0,0],h=rc(d,e),i=qc(h,h),j=h[0],k=i-j*j;if(!k)return!c&&a;var l=f*i/k,m=-f*j/k,n=rc(g,h),o=tc(g,l),p=tc(h,m);sc(o,p);var q=n,r=qc(o,q),s=qc(q,q),t=r*r-s*(qc(o,o)-1);if(!(0>t)){var u=Math.sqrt(t),v=tc(q,(-r-u)/s);if(sc(v,o),v=vc(v),!c)return v;var w,x=a[0],y=b[0],z=a[1],A=b[1];x>y&&(w=x,x=y,y=w);var B=y-x,C=jh(B-Bh)<Eh,D=C||Eh>B;if(!C&&z>A&&(w=z,z=A,A=w),D?C?z+A>0^v[1]<(jh(v[0]-x)<Eh?z:A):z<=v[1]&&v[1]<=A:B>Bh^(x<=v[0]&&v[0]<=y)){var E=tc(q,(-r+u)/s);return sc(E,o),[v,vc(E)]}}}function e(b,c){var d=g?a:Bh-a,e=0;return-d>b?e|=1:b>d&&(e|=2),-d>c?e|=4:c>d&&(e|=8),e}var f=Math.cos(a),g=f>0,h=jh(f)>Eh,i=od(a,6*Gh);return Gc(b,c,i,g?[0,-a]:[-Bh,a-Bh])}function Pc(a,b,c,d){return function(e){var f,g=e.a,h=e.b,i=g.x,j=g.y,k=h.x,l=h.y,m=0,n=1,o=k-i,p=l-j;if(f=a-i,o||!(f>0)){if(f/=o,0>o){if(m>f)return;n>f&&(n=f)}else if(o>0){if(f>n)return;f>m&&(m=f)}if(f=c-i,o||!(0>f)){if(f/=o,0>o){if(f>n)return;f>m&&(m=f)}else if(o>0){if(m>f)return;n>f&&(n=f)}if(f=b-j,p||!(f>0)){if(f/=p,0>p){if(m>f)return;n>f&&(n=f)}else if(p>0){if(f>n)return;f>m&&(m=f)}if(f=d-j,p||!(0>f)){if(f/=p,0>p){if(f>n)return;f>m&&(m=f)}else if(p>0){if(m>f)return;n>f&&(n=f)}return m>0&&(e.a={x:i+m*o,y:j+m*p}),1>n&&(e.b={x:i+n*o,y:j+n*p}),e}}}}}}function Qc(a,b,c,d){function e(d,e){return jh(d[0]-a)<Eh?e>0?0:3:jh(d[0]-c)<Eh?e>0?2:1:jh(d[1]-b)<Eh?e>0?1:0:e>0?3:2}function f(a,b){return g(a.x,b.x)}function g(a,b){var c=e(a,1),d=e(b,1);return c!==d?c-d:0===c?b[1]-a[1]:1===c?a[0]-b[0]:2===c?a[1]-b[1]:b[0]-a[0]}return function(h){function i(a){for(var b=0,c=q.length,d=a[1],e=0;c>e;++e)for(var f,g=1,h=q[e],i=h.length,j=h[0];i>g;++g)f=h[g],j[1]<=d?f[1]>d&&_(j,f,a)>0&&++b:f[1]<=d&&_(j,f,a)<0&&--b,j=f;return 0!==b}function j(f,h,i,j){var k=0,l=0;if(null==f||(k=e(f,i))!==(l=e(h,i))||g(f,h)<0^i>0){do j.point(0===k||3===k?a:c,k>1?d:b);while((k=(k+i+4)%4)!==l)}else j.point(h[0],h[1])}function k(e,f){return e>=a&&c>=e&&f>=b&&d>=f}function l(a,b){k(a,b)&&h.point(a,b)}function m(){D.point=o,q&&q.push(r=[]),y=!0,x=!1,v=w=0/0}function n(){p&&(o(s,t),u&&x&&B.rejoin(),p.push(B.buffer())),D.point=l,x&&h.lineEnd()}function o(a,b){a=Math.max(-Ei,Math.min(Ei,a)),b=Math.max(-Ei,Math.min(Ei,b));var c=k(a,b);if(q&&r.push([a,b]),y)s=a,t=b,u=c,y=!1,c&&(h.lineStart(),h.point(a,b));else if(c&&x)h.point(a,b);else{var d={a:{x:v,y:w},b:{x:a,y:b}};C(d)?(x||(h.lineStart(),h.point(d.a.x,d.a.y)),h.point(d.b.x,d.b.y),c||h.lineEnd(),z=!1):c&&(h.lineStart(),h.point(a,b),z=!1)}v=a,w=b,x=c}var p,q,r,s,t,u,v,w,x,y,z,A=h,B=Ic(),C=Pc(a,b,c,d),D={point:l,lineStart:m,lineEnd:n,polygonStart:function(){h=B,p=[],q=[],z=!0},polygonEnd:function(){h=A,p=Xg.merge(p);var b=i([a,d]),c=z&&b,e=p.length;(c||e)&&(h.polygonStart(),c&&(h.lineStart(),j(null,null,1,h),h.lineEnd()),e&&Dc(p,f,b,j,h),h.polygonEnd()),p=q=r=null}};return D}}function Rc(a,b){function c(c,d){return c=a(c,d),b(c[0],c[1])}return a.invert&&b.invert&&(c.invert=function(c,d){return c=b.invert(c,d),c&&a.invert(c[0],c[1])}),c}function Sc(a){var b=0,c=Bh/3,d=gd(a),e=d(b,c);return e.parallels=function(a){return arguments.length?d(b=a[0]*Bh/180,c=a[1]*Bh/180):[b/Bh*180,c/Bh*180]},e}function Tc(a,b){function c(a,b){var c=Math.sqrt(f-2*e*Math.sin(b))/e;return[c*Math.sin(a*=e),g-c*Math.cos(a)]}var d=Math.sin(a),e=(d+Math.sin(b))/2,f=1+d*(2*e-d),g=Math.sqrt(f)/e;return c.invert=function(a,b){var c=g-b;return[Math.atan2(a,c)/e,bb((f-(a*a+c*c)*e*e)/(2*e))]},c}function Uc(){function a(a,b){Gi+=e*a-d*b,d=a,e=b}var b,c,d,e;Li.point=function(f,g){Li.point=a,b=d=f,c=e=g},Li.lineEnd=function(){a(b,c)}}function Vc(a,b){Hi>a&&(Hi=a),a>Ji&&(Ji=a),Ii>b&&(Ii=b),b>Ki&&(Ki=b)}function Wc(){function a(a,b){g.push("M",a,",",b,f)}function b(a,b){g.push("M",a,",",b),h.point=c}function c(a,b){g.push("L",a,",",b)}function d(){h.point=a}function e(){g.push("Z")}var f=Xc(4.5),g=[],h={point:a,lineStart:function(){h.point=b},lineEnd:d,polygonStart:function(){h.lineEnd=e},polygonEnd:function(){h.lineEnd=d,h.point=a},pointRadius:function(a){return f=Xc(a),h},result:function(){if(g.length){var a=g.join("");return g=[],a}}};return h}function Xc(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+-2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function Yc(a,b){ti+=a,ui+=b,++vi}function Zc(){function a(a,d){var e=a-b,f=d-c,g=Math.sqrt(e*e+f*f);wi+=g*(b+a)/2,xi+=g*(c+d)/2,yi+=g,Yc(b=a,c=d)}var b,c;Ni.point=function(d,e){Ni.point=a,Yc(b=d,c=e)}}function $c(){Ni.point=Yc}function _c(){function a(a,b){var c=a-d,f=b-e,g=Math.sqrt(c*c+f*f);wi+=g*(d+a)/2,xi+=g*(e+b)/2,yi+=g,g=e*a-d*b,zi+=g*(d+a),Ai+=g*(e+b),Bi+=3*g,Yc(d=a,e=b)}var b,c,d,e;Ni.point=function(f,g){Ni.point=a,Yc(b=d=f,c=e=g)},Ni.lineEnd=function(){a(b,c)}}function ad(a){function b(b,c){a.moveTo(b,c),a.arc(b,c,g,0,Ch)}function c(b,c){a.moveTo(b,c),h.point=d}function d(b,c){a.lineTo(b,c)}function e(){h.point=b}function f(){a.closePath()}var g=4.5,h={point:b,lineStart:function(){h.point=c},lineEnd:e,polygonStart:function(){h.lineEnd=f},polygonEnd:function(){h.lineEnd=e,h.point=b},pointRadius:function(a){return g=a,h},result:t};return h}function bd(a){function b(a){return(h?d:c)(a)}function c(b){return ed(b,function(c,d){c=a(c,d),b.point(c[0],c[1])})}function d(b){function c(c,d){c=a(c,d),b.point(c[0],c[1])}function d(){t=0/0,y.point=f,b.lineStart()}function f(c,d){var f=pc([c,d]),g=a(c,d);e(t,u,s,v,w,x,t=g[0],u=g[1],s=c,v=f[0],w=f[1],x=f[2],h,b),b.point(t,u)}function g(){y.point=c,b.lineEnd()}function i(){d(),y.point=j,y.lineEnd=k}function j(a,b){f(l=a,m=b),n=t,o=u,p=v,q=w,r=x,y.point=f}function k(){e(t,u,s,v,w,x,n,o,l,p,q,r,h,b),y.lineEnd=g,g()}var l,m,n,o,p,q,r,s,t,u,v,w,x,y={point:c,lineStart:d,lineEnd:g,polygonStart:function(){b.polygonStart(),y.lineStart=i},polygonEnd:function(){b.polygonEnd(),y.lineStart=d}};return y}function e(b,c,d,h,i,j,k,l,m,n,o,p,q,r){var s=k-b,t=l-c,u=s*s+t*t;if(u>4*f&&q--){var v=h+n,w=i+o,x=j+p,y=Math.sqrt(v*v+w*w+x*x),z=Math.asin(x/=y),A=jh(jh(x)-1)<Eh||jh(d-m)<Eh?(d+m)/2:Math.atan2(w,v),B=a(A,z),C=B[0],D=B[1],E=C-b,F=D-c,G=t*E-s*F;(G*G/u>f||jh((s*E+t*F)/u-.5)>.3||g>h*n+i*o+j*p)&&(e(b,c,d,h,i,j,C,D,A,v/=y,w/=y,x,q,r),r.point(C,D),e(C,D,A,v,w,x,k,l,m,n,o,p,q,r))}}var f=.5,g=Math.cos(30*Gh),h=16;return b.precision=function(a){return arguments.length?(h=(f=a*a)>0&&16,b):Math.sqrt(f)},b}function cd(a){var b=bd(function(b,c){return a([b*Hh,c*Hh])});return function(a){return hd(b(a))}}function dd(a){this.stream=a}function ed(a,b){return{point:b,sphere:function(){a.sphere()},lineStart:function(){a.lineStart()},lineEnd:function(){a.lineEnd()},polygonStart:function(){a.polygonStart()},polygonEnd:function(){a.polygonEnd()}}}function fd(a){return gd(function(){return a})()}function gd(a){function b(a){return a=h(a[0]*Gh,a[1]*Gh),[a[0]*m+i,j-a[1]*m]}function c(a){return a=h.invert((a[0]-i)/m,(j-a[1])/m),a&&[a[0]*Hh,a[1]*Hh]}function d(){h=Rc(g=kd(r,s,t),f);var a=f(p,q);return i=n-a[0]*m,j=o+a[1]*m,e()}function e(){return k&&(k.valid=!1,k=null),b}var f,g,h,i,j,k,l=bd(function(a,b){return a=f(a,b),[a[0]*m+i,j-a[1]*m]}),m=150,n=480,o=250,p=0,q=0,r=0,s=0,t=0,u=Di,v=Bb,w=null,x=null;return b.stream=function(a){return k&&(k.valid=!1),k=hd(u(g,l(v(a)))),k.valid=!0,k},b.clipAngle=function(a){return arguments.length?(u=null==a?(w=a,Di):Oc((w=+a)*Gh),e()):w},b.clipExtent=function(a){return arguments.length?(x=a,v=a?Qc(a[0][0],a[0][1],a[1][0],a[1][1]):Bb,e()):x},b.scale=function(a){return arguments.length?(m=+a,d()):m},b.translate=function(a){return arguments.length?(n=+a[0],o=+a[1],d()):[n,o]},b.center=function(a){return arguments.length?(p=a[0]%360*Gh,q=a[1]%360*Gh,d()):[p*Hh,q*Hh]},b.rotate=function(a){return arguments.length?(r=a[0]%360*Gh,s=a[1]%360*Gh,t=a.length>2?a[2]%360*Gh:0,d()):[r*Hh,s*Hh,t*Hh]},Xg.rebind(b,l,"precision"),function(){return f=a.apply(this,arguments),b.invert=f.invert&&c,d()}}function hd(a){return ed(a,function(b,c){a.point(b*Gh,c*Gh)})}function id(a,b){return[a,b]}function jd(a,b){return[a>Bh?a-Ch:-Bh>a?a+Ch:a,b]}function kd(a,b,c){return a?b||c?Rc(md(a),nd(b,c)):md(a):b||c?nd(b,c):jd}function ld(a){return function(b,c){return b+=a,[b>Bh?b-Ch:-Bh>b?b+Ch:b,c]}}function md(a){var b=ld(a);return b.invert=ld(-a),b}function nd(a,b){function c(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*d+h*e;return[Math.atan2(i*f-k*g,h*d-j*e),bb(k*f+i*g)]}var d=Math.cos(a),e=Math.sin(a),f=Math.cos(b),g=Math.sin(b);return c.invert=function(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*f-i*g;return[Math.atan2(i*f+j*g,h*d+k*e),bb(k*d-h*e)]},c}function od(a,b){var c=Math.cos(a),d=Math.sin(a);return function(e,f,g,h){var i=g*b;null!=e?(e=pd(c,e),f=pd(c,f),(g>0?f>e:e>f)&&(e+=g*Ch)):(e=a+g*Ch,f=a-.5*i);for(var j,k=e;g>0?k>f:f>k;k-=i)h.point((j=vc([c,-d*Math.cos(k),-d*Math.sin(k)]))[0],j[1])}}function pd(a,b){var c=pc(b);c[0]-=a,uc(c);var d=ab(-c[1]);return((-c[2]<0?-d:d)+2*Math.PI-Eh)%(2*Math.PI)}function qd(a,b,c){var d=Xg.range(a,b-Eh,c).concat(b);return function(a){return d.map(function(b){return[a,b]})}}function rd(a,b,c){var d=Xg.range(a,b-Eh,c).concat(b);return function(a){return d.map(function(b){return[b,a]})}}function sd(a){return a.source}function td(a){return a.target}function ud(a,b,c,d){var e=Math.cos(b),f=Math.sin(b),g=Math.cos(d),h=Math.sin(d),i=e*Math.cos(a),j=e*Math.sin(a),k=g*Math.cos(c),l=g*Math.sin(c),m=2*Math.asin(Math.sqrt(fb(d-b)+e*g*fb(c-a))),n=1/Math.sin(m),o=m?function(a){var b=Math.sin(a*=m)*n,c=Math.sin(m-a)*n,d=c*i+b*k,e=c*j+b*l,g=c*f+b*h;return[Math.atan2(e,d)*Hh,Math.atan2(g,Math.sqrt(d*d+e*e))*Hh]}:function(){return[a*Hh,b*Hh]};return o.distance=m,o}function vd(){function a(a,e){var f=Math.sin(e*=Gh),g=Math.cos(e),h=jh((a*=Gh)-b),i=Math.cos(h);Oi+=Math.atan2(Math.sqrt((h=g*Math.sin(h))*h+(h=d*f-c*g*i)*h),c*f+d*g*i),b=a,c=f,d=g}var b,c,d;Pi.point=function(e,f){b=e*Gh,c=Math.sin(f*=Gh),d=Math.cos(f),Pi.point=a},Pi.lineEnd=function(){Pi.point=Pi.lineEnd=t}}function wd(a,b){function c(b,c){var d=Math.cos(b),e=Math.cos(c),f=a(d*e);return[f*e*Math.sin(b),f*Math.sin(c)]}return c.invert=function(a,c){var d=Math.sqrt(a*a+c*c),e=b(d),f=Math.sin(e),g=Math.cos(e);return[Math.atan2(a*f,d*g),Math.asin(d&&c*f/d)]},c}function xd(a,b){function c(a,b){g>0?-Dh+Eh>b&&(b=-Dh+Eh):b>Dh-Eh&&(b=Dh-Eh);var c=g/Math.pow(e(b),f);return[c*Math.sin(f*a),g-c*Math.cos(f*a)]}var d=Math.cos(a),e=function(a){return Math.tan(Bh/4+a/2)},f=a===b?Math.sin(a):Math.log(d/Math.cos(b))/Math.log(e(b)/e(a)),g=d*Math.pow(e(a),f)/f;return f?(c.invert=function(a,b){var c=g-b,d=$(f)*Math.sqrt(a*a+c*c);return[Math.atan2(a,c)/f,2*Math.atan(Math.pow(g/d,1/f))-Dh]},c):zd}function yd(a,b){function c(a,b){var c=f-b;return[c*Math.sin(e*a),f-c*Math.cos(e*a)]}var d=Math.cos(a),e=a===b?Math.sin(a):(d-Math.cos(b))/(b-a),f=d/e+a;return jh(e)<Eh?id:(c.invert=function(a,b){var c=f-b;return[Math.atan2(a,c)/e,f-$(e)*Math.sqrt(a*a+c*c)]},c)}function zd(a,b){return[a,Math.log(Math.tan(Bh/4+b/2))]}function Ad(a){var b,c=fd(a),d=c.scale,e=c.translate,f=c.clipExtent;return c.scale=function(){var a=d.apply(c,arguments);return a===c?b?c.clipExtent(null):c:a},c.translate=function(){var a=e.apply(c,arguments);return a===c?b?c.clipExtent(null):c:a},c.clipExtent=function(a){var g=f.apply(c,arguments);if(g===c){if(b=null==a){var h=Bh*d(),i=e();f([[i[0]-h,i[1]-h],[i[0]+h,i[1]+h]])}}else b&&(g=null);return g},c.clipExtent(null)}function Bd(a,b){return[Math.log(Math.tan(Bh/4+b/2)),-a]}function Cd(a){return a[0]}function Dd(a){return a[1]}function Ed(a){for(var b=a.length,c=[0,1],d=2,e=2;b>e;e++){for(;d>1&&_(a[c[d-2]],a[c[d-1]],a[e])<=0;)--d;c[d++]=e}return c.slice(0,d)}function Fd(a,b){return a[0]-b[0]||a[1]-b[1]}function Gd(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function Hd(a,b,c,d){var e=a[0],f=c[0],g=b[0]-e,h=d[0]-f,i=a[1],j=c[1],k=b[1]-i,l=d[1]-j,m=(h*(i-j)-l*(e-f))/(l*g-h*k);return[e+m*g,i+m*k]}function Id(a){var b=a[0],c=a[a.length-1];return!(b[0]-c[0]||b[1]-c[1])}function Jd(){ce(this),this.edge=this.site=this.circle=null}function Kd(a){var b=_i.pop()||new Jd;return b.site=a,b}function Ld(a){Vd(a),Yi.remove(a),_i.push(a),ce(a)}function Md(a){var b=a.circle,c=b.x,d=b.cy,e={x:c,y:d},f=a.P,g=a.N,h=[a];Ld(a);for(var i=f;i.circle&&jh(c-i.circle.x)<Eh&&jh(d-i.circle.cy)<Eh;)f=i.P,h.unshift(i),Ld(i),i=f;h.unshift(i),Vd(i);for(var j=g;j.circle&&jh(c-j.circle.x)<Eh&&jh(d-j.circle.cy)<Eh;)g=j.N,h.push(j),Ld(j),j=g;h.push(j),Vd(j);var k,l=h.length;for(k=1;l>k;++k)j=h[k],i=h[k-1],_d(j.edge,i.site,j.site,e);i=h[0],j=h[l-1],j.edge=Zd(i.site,j.site,null,e),Ud(i),Ud(j)}function Nd(a){for(var b,c,d,e,f=a.x,g=a.y,h=Yi._;h;)if(d=Od(h,g)-f,d>Eh)h=h.L;else{if(e=f-Pd(h,g),!(e>Eh)){d>-Eh?(b=h.P,c=h):e>-Eh?(b=h,c=h.N):b=c=h;break}if(!h.R){b=h;break}h=h.R}var i=Kd(a);if(Yi.insert(b,i),b||c){if(b===c)return Vd(b),c=Kd(b.site),Yi.insert(i,c),i.edge=c.edge=Zd(b.site,i.site),Ud(b),void Ud(c);if(!c)return void(i.edge=Zd(b.site,i.site));Vd(b),Vd(c);var j=b.site,k=j.x,l=j.y,m=a.x-k,n=a.y-l,o=c.site,p=o.x-k,q=o.y-l,r=2*(m*q-n*p),s=m*m+n*n,t=p*p+q*q,u={x:(q*s-n*t)/r+k,y:(m*t-p*s)/r+l};_d(c.edge,j,o,u),i.edge=Zd(j,a,null,u),c.edge=Zd(a,o,null,u),Ud(b),Ud(c)}}function Od(a,b){var c=a.site,d=c.x,e=c.y,f=e-b;if(!f)return d;var g=a.P;if(!g)return-1/0;c=g.site;var h=c.x,i=c.y,j=i-b;if(!j)return h;var k=h-d,l=1/f-1/j,m=k/j;return l?(-m+Math.sqrt(m*m-2*l*(k*k/(-2*j)-i+j/2+e-f/2)))/l+d:(d+h)/2}function Pd(a,b){var c=a.N;if(c)return Od(c,b);var d=a.site;return d.y===b?d.x:1/0}function Qd(a){this.site=a,this.edges=[]}function Rd(a){for(var b,c,d,e,f,g,h,i,j,k,l=a[0][0],m=a[1][0],n=a[0][1],o=a[1][1],p=Xi,q=p.length;q--;)if(f=p[q],f&&f.prepare())for(h=f.edges,i=h.length,g=0;i>g;)k=h[g].end(),d=k.x,e=k.y,j=h[++g%i].start(),b=j.x,c=j.y,(jh(d-b)>Eh||jh(e-c)>Eh)&&(h.splice(g,0,new ae($d(f.site,k,jh(d-l)<Eh&&o-e>Eh?{x:l,y:jh(b-l)<Eh?c:o}:jh(e-o)<Eh&&m-d>Eh?{x:jh(c-o)<Eh?b:m,y:o}:jh(d-m)<Eh&&e-n>Eh?{x:m,y:jh(b-m)<Eh?c:n}:jh(e-n)<Eh&&d-l>Eh?{x:jh(c-n)<Eh?b:l,y:n}:null),f.site,null)),++i)}function Sd(a,b){return b.angle-a.angle}function Td(){ce(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ud(a){var b=a.P,c=a.N;if(b&&c){var d=b.site,e=a.site,f=c.site;if(d!==f){var g=e.x,h=e.y,i=d.x-g,j=d.y-h,k=f.x-g,l=f.y-h,m=2*(i*l-j*k);if(!(m>=-Fh)){var n=i*i+j*j,o=k*k+l*l,p=(l*n-j*o)/m,q=(i*o-k*n)/m,l=q+h,r=aj.pop()||new Td;r.arc=a,r.site=e,r.x=p+g,r.y=l+Math.sqrt(p*p+q*q),r.cy=l,a.circle=r;for(var s=null,t=$i._;t;)if(r.y<t.y||r.y===t.y&&r.x<=t.x){if(!t.L){s=t.P;break}t=t.L}else{if(!t.R){s=t;break}t=t.R}$i.insert(s,r),s||(Zi=r)}}}}function Vd(a){var b=a.circle;b&&(b.P||(Zi=b.N),$i.remove(b),aj.push(b),ce(b),a.circle=null)}function Wd(a){for(var b,c=Wi,d=Pc(a[0][0],a[0][1],a[1][0],a[1][1]),e=c.length;e--;)b=c[e],(!Xd(b,a)||!d(b)||jh(b.a.x-b.b.x)<Eh&&jh(b.a.y-b.b.y)<Eh)&&(b.a=b.b=null,c.splice(e,1))}function Xd(a,b){var c=a.b;if(c)return!0;var d,e,f=a.a,g=b[0][0],h=b[1][0],i=b[0][1],j=b[1][1],k=a.l,l=a.r,m=k.x,n=k.y,o=l.x,p=l.y,q=(m+o)/2,r=(n+p)/2;if(p===n){if(g>q||q>=h)return;if(m>o){if(f){if(f.y>=j)return}else f={x:q,y:i};c={x:q,y:j}}else{if(f){if(f.y<i)return}else f={x:q,y:j};c={x:q,y:i}}}else if(d=(m-o)/(p-n),e=r-d*q,-1>d||d>1)if(m>o){if(f){if(f.y>=j)return}else f={x:(i-e)/d,y:i};c={x:(j-e)/d,y:j}}else{if(f){if(f.y<i)return}else f={x:(j-e)/d,y:j};c={x:(i-e)/d,y:i}}else if(p>n){if(f){if(f.x>=h)return}else f={x:g,y:d*g+e};c={x:h,y:d*h+e}}else{if(f){if(f.x<g)return}else f={x:h,y:d*h+e};c={x:g,y:d*g+e}}return a.a=f,a.b=c,!0}function Yd(a,b){this.l=a,this.r=b,this.a=this.b=null}function Zd(a,b,c,d){var e=new Yd(a,b);return Wi.push(e),c&&_d(e,a,b,c),d&&_d(e,b,a,d),Xi[a.i].edges.push(new ae(e,a,b)),Xi[b.i].edges.push(new ae(e,b,a)),e}function $d(a,b,c){var d=new Yd(a,null);return d.a=b,d.b=c,Wi.push(d),d}function _d(a,b,c,d){a.a||a.b?a.l===c?a.b=d:a.a=d:(a.a=d,a.l=b,a.r=c)}function ae(a,b,c){var d=a.a,e=a.b;this.edge=a,this.site=b,this.angle=c?Math.atan2(c.y-b.y,c.x-b.x):a.l===b?Math.atan2(e.x-d.x,d.y-e.y):Math.atan2(d.x-e.x,e.y-d.y)}function be(){this._=null}function ce(a){a.U=a.C=a.L=a.R=a.P=a.N=null}function de(a,b){var c=b,d=b.R,e=c.U;e?e.L===c?e.L=d:e.R=d:a._=d,d.U=e,c.U=d,c.R=d.L,c.R&&(c.R.U=c),d.L=c}function ee(a,b){var c=b,d=b.L,e=c.U;e?e.L===c?e.L=d:e.R=d:a._=d,d.U=e,c.U=d,c.L=d.R,c.L&&(c.L.U=c),d.R=c}function fe(a){for(;a.L;)a=a.L;return a}function ge(a,b){var c,d,e,f=a.sort(he).pop();for(Wi=[],Xi=new Array(a.length),Yi=new be,$i=new be;;)if(e=Zi,f&&(!e||f.y<e.y||f.y===e.y&&f.x<e.x))(f.x!==c||f.y!==d)&&(Xi[f.i]=new Qd(f),Nd(f),c=f.x,d=f.y),f=a.pop();else{if(!e)break;Md(e.arc)}b&&(Wd(b),Rd(b));var g={cells:Xi,edges:Wi};return Yi=$i=Wi=Xi=null,g}function he(a,b){return b.y-a.y||b.x-a.x}function ie(a,b,c){return(a.x-c.x)*(b.y-a.y)-(a.x-b.x)*(c.y-a.y)}function je(a){return a.x}function ke(a){return a.y}function le(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function me(a,b,c,d,e,f){if(!a(b,c,d,e,f)){var g=.5*(c+e),h=.5*(d+f),i=b.nodes;i[0]&&me(a,i[0],c,d,g,h),i[1]&&me(a,i[1],g,d,e,h),i[2]&&me(a,i[2],c,h,g,f),i[3]&&me(a,i[3],g,h,e,f)}}function ne(a,b){a=Xg.rgb(a),b=Xg.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+ub(Math.round(c+f*a))+ub(Math.round(d+g*a))+ub(Math.round(e+h*a))}}function oe(a,b){var c,d={},e={};for(c in a)c in b?d[c]=re(a[c],b[c]):e[c]=a[c];for(c in b)c in a||(e[c]=b[c]);return function(a){for(c in d)e[c]=d[c](a);return e}}function pe(a,b){return a=+a,b=+b,function(c){return a*(1-c)+b*c}}function qe(a,b){var c,d,e,f=cj.lastIndex=dj.lastIndex=0,g=-1,h=[],i=[];for(a+="",b+="";(c=cj.exec(a))&&(d=dj.exec(b));)(e=d.index)>f&&(e=b.slice(f,e),h[g]?h[g]+=e:h[++g]=e),(c=c[0])===(d=d[0])?h[g]?h[g]+=d:h[++g]=d:(h[++g]=null,i.push({i:g,x:pe(c,d)})),f=dj.lastIndex;return f<b.length&&(e=b.slice(f),h[g]?h[g]+=e:h[++g]=e),h.length<2?i[0]?(b=i[0].x,function(a){return b(a)+""}):function(){return b}:(b=i.length,function(a){for(var c,d=0;b>d;++d)h[(c=i[d]).i]=c.x(a);return h.join("")})}function re(a,b){for(var c,d=Xg.interpolators.length;--d>=0&&!(c=Xg.interpolators[d](a,b)););return c}function se(a,b){var c,d=[],e=[],f=a.length,g=b.length,h=Math.min(a.length,b.length);for(c=0;h>c;++c)d.push(re(a[c],b[c]));for(;f>c;++c)e[c]=a[c];for(;g>c;++c)e[c]=b[c];return function(a){for(c=0;h>c;++c)e[c]=d[c](a);return e}}function te(a){return function(b){return 0>=b?0:b>=1?1:a(b)}}function ue(a){return function(b){return 1-a(1-b)}}function ve(a){return function(b){return.5*(.5>b?a(2*b):2-a(2-2*b))}}function we(a){return a*a}function xe(a){return a*a*a}function ye(a){if(0>=a)return 0;if(a>=1)return 1;var b=a*a,c=b*a;return 4*(.5>a?c:3*(a-b)+c-.75)}function ze(a){return function(b){return Math.pow(b,a)}}function Ae(a){return 1-Math.cos(a*Dh)}function Be(a){return Math.pow(2,10*(a-1))}function Ce(a){return 1-Math.sqrt(1-a*a)}function De(a,b){var c;return arguments.length<2&&(b=.45),arguments.length?c=b/Ch*Math.asin(1/a):(a=1,c=b/4),function(d){return 1+a*Math.pow(2,-10*d)*Math.sin((d-c)*Ch/b)}}function Ee(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function Fe(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function Ge(a,b){a=Xg.hcl(a),b=Xg.hcl(b);var c=a.h,d=a.c,e=a.l,f=b.h-c,g=b.c-d,h=b.l-e;return isNaN(g)&&(g=0,d=isNaN(d)?b.c:d),isNaN(f)?(f=0,c=isNaN(c)?b.h:c):f>180?f-=360:-180>f&&(f+=360),function(a){return kb(c+f*a,d+g*a,e+h*a)+""}}function He(a,b){a=Xg.hsl(a),b=Xg.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return isNaN(g)&&(g=0,d=isNaN(d)?b.s:d),isNaN(f)?(f=0,c=isNaN(c)?b.h:c):f>180?f-=360:-180>f&&(f+=360),function(a){return ib(c+f*a,d+g*a,e+h*a)+""}}function Ie(a,b){a=Xg.lab(a),b=Xg.lab(b);var c=a.l,d=a.a,e=a.b,f=b.l-c,g=b.a-d,h=b.b-e;return function(a){return mb(c+f*a,d+g*a,e+h*a)+""}}function Je(a,b){return b-=a,function(c){return Math.round(a+b*c)}}function Ke(a){var b=[a.a,a.b],c=[a.c,a.d],d=Me(b),e=Le(b,c),f=Me(Ne(c,b,-e))||0;b[0]*c[1]<c[0]*b[1]&&(b[0]*=-1,b[1]*=-1,d*=-1,e*=-1),this.rotate=(d?Math.atan2(b[1],b[0]):Math.atan2(-c[0],c[1]))*Hh,this.translate=[a.e,a.f],this.scale=[d,f],this.skew=f?Math.atan2(e,f)*Hh:0}function Le(a,b){return a[0]*b[0]+a[1]*b[1]}function Me(a){var b=Math.sqrt(Le(a,a));return b&&(a[0]/=b,a[1]/=b),b}function Ne(a,b,c){return a[0]+=c*b[0],a[1]+=c*b[1],a}function Oe(a,b){var c,d=[],e=[],f=Xg.transform(a),g=Xg.transform(b),h=f.translate,i=g.translate,j=f.rotate,k=g.rotate,l=f.skew,m=g.skew,n=f.scale,o=g.scale;return h[0]!=i[0]||h[1]!=i[1]?(d.push("translate(",null,",",null,")"),e.push({i:1,x:pe(h[0],i[0])},{i:3,x:pe(h[1],i[1])})):d.push(i[0]||i[1]?"translate("+i+")":""),j!=k?(j-k>180?k+=360:k-j>180&&(j+=360),e.push({i:d.push(d.pop()+"rotate(",null,")")-2,x:pe(j,k)})):k&&d.push(d.pop()+"rotate("+k+")"),l!=m?e.push({i:d.push(d.pop()+"skewX(",null,")")-2,x:pe(l,m)}):m&&d.push(d.pop()+"skewX("+m+")"),n[0]!=o[0]||n[1]!=o[1]?(c=d.push(d.pop()+"scale(",null,",",null,")"),e.push({i:c-4,x:pe(n[0],o[0])},{i:c-2,x:pe(n[1],o[1])})):(1!=o[0]||1!=o[1])&&d.push(d.pop()+"scale("+o+")"),c=e.length,function(a){for(var b,f=-1;++f<c;)d[(b=e[f]).i]=b.x(a);return d.join("")}}function Pe(a,b){return b=(b-=a=+a)||1/b,function(c){return(c-a)/b}}function Qe(a,b){return b=(b-=a=+a)||1/b,function(c){return Math.max(0,Math.min(1,(c-a)/b))}}function Re(a){for(var b=a.source,c=a.target,d=Te(b,c),e=[b];b!==d;)b=b.parent,e.push(b);for(var f=e.length;c!==d;)e.splice(f,0,c),c=c.parent;return e}function Se(a){for(var b=[],c=a.parent;null!=c;)b.push(a),a=c,c=c.parent;return b.push(a),b}function Te(a,b){if(a===b)return a;for(var c=Se(a),d=Se(b),e=c.pop(),f=d.pop(),g=null;e===f;)g=e,e=c.pop(),f=d.pop();return g}function Ue(a){a.fixed|=2}function Ve(a){a.fixed&=-7}function We(a){a.fixed|=4,a.px=a.x,a.py=a.y}function Xe(a){a.fixed&=-5}function Ye(a,b,c){var d=0,e=0;if(a.charge=0,!a.leaf)for(var f,g=a.nodes,h=g.length,i=-1;++i<h;)f=g[i],null!=f&&(Ye(f,b,c),a.charge+=f.charge,d+=f.charge*f.cx,e+=f.charge*f.cy);if(a.point){a.leaf||(a.point.x+=Math.random()-.5,a.point.y+=Math.random()-.5);var j=b*c[a.point.index];
|
||
a.charge+=a.pointCharge=j,d+=j*a.point.x,e+=j*a.point.y}a.cx=d/a.charge,a.cy=e/a.charge}function Ze(a,b){return Xg.rebind(a,b,"sort","children","value"),a.nodes=a,a.links=df,a}function $e(a,b){for(var c=[a];null!=(a=c.pop());)if(b(a),(e=a.children)&&(d=e.length))for(var d,e;--d>=0;)c.push(e[d])}function _e(a,b){for(var c=[a],d=[];null!=(a=c.pop());)if(d.push(a),(f=a.children)&&(e=f.length))for(var e,f,g=-1;++g<e;)c.push(f[g]);for(;null!=(a=d.pop());)b(a)}function af(a){return a.children}function bf(a){return a.value}function cf(a,b){return b.value-a.value}function df(a){return Xg.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function ef(a){return a.x}function ff(a){return a.y}function gf(a,b,c){a.y0=b,a.y=c}function hf(a){return Xg.range(a.length)}function jf(a){for(var b=-1,c=a[0].length,d=[];++b<c;)d[b]=0;return d}function kf(a){for(var b,c=1,d=0,e=a[0][1],f=a.length;f>c;++c)(b=a[c][1])>e&&(d=c,e=b);return d}function lf(a){return a.reduce(mf,0)}function mf(a,b){return a+b[1]}function nf(a,b){return of(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function of(a,b){for(var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];++c<=b;)f[c]=e*c+d;return f}function pf(a){return[Xg.min(a),Xg.max(a)]}function qf(a,b){return a.value-b.value}function rf(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function sf(a,b){a._pack_next=b,b._pack_prev=a}function tf(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+b.r;return.999*e*e>c*c+d*d}function uf(a){function b(a){k=Math.min(a.x-a.r,k),l=Math.max(a.x+a.r,l),m=Math.min(a.y-a.r,m),n=Math.max(a.y+a.r,n)}if((c=a.children)&&(j=c.length)){var c,d,e,f,g,h,i,j,k=1/0,l=-1/0,m=1/0,n=-1/0;if(c.forEach(vf),d=c[0],d.x=-d.r,d.y=0,b(d),j>1&&(e=c[1],e.x=e.r,e.y=0,b(e),j>2))for(f=c[2],yf(d,e,f),b(f),rf(d,f),d._pack_prev=f,rf(f,e),e=d._pack_next,g=3;j>g;g++){yf(d,e,f=c[g]);var o=0,p=1,q=1;for(h=e._pack_next;h!==e;h=h._pack_next,p++)if(tf(h,f)){o=1;break}if(1==o)for(i=d._pack_prev;i!==h._pack_prev&&!tf(i,f);i=i._pack_prev,q++);o?(q>p||p==q&&e.r<d.r?sf(d,e=h):sf(d=i,e),g--):(rf(d,f),e=f,b(f))}var r=(k+l)/2,s=(m+n)/2,t=0;for(g=0;j>g;g++)f=c[g],f.x-=r,f.y-=s,t=Math.max(t,f.r+Math.sqrt(f.x*f.x+f.y*f.y));a.r=t,c.forEach(wf)}}function vf(a){a._pack_next=a._pack_prev=a}function wf(a){delete a._pack_next,delete a._pack_prev}function xf(a,b,c,d){var e=a.children;if(a.x=b+=d*a.x,a.y=c+=d*a.y,a.r*=d,e)for(var f=-1,g=e.length;++f<g;)xf(e[f],b,c,d)}function yf(a,b,c){var d=a.r+c.r,e=b.x-a.x,f=b.y-a.y;if(d&&(e||f)){var g=b.r+c.r,h=e*e+f*f;g*=g,d*=d;var i=.5+(d-g)/(2*h),j=Math.sqrt(Math.max(0,2*g*(d+h)-(d-=h)*d-g*g))/(2*h);c.x=a.x+i*e+j*f,c.y=a.y+i*f-j*e}else c.x=a.x+d,c.y=a.y}function zf(a,b){return a.parent==b.parent?1:2}function Af(a){var b=a.children;return b.length?b[0]:a.t}function Bf(a){var b,c=a.children;return(b=c.length)?c[b-1]:a.t}function Cf(a,b,c){var d=c/(b.i-a.i);b.c-=d,b.s+=c,a.c+=d,b.z+=c,b.m+=c}function Df(a){for(var b,c=0,d=0,e=a.children,f=e.length;--f>=0;)b=e[f],b.z+=c,b.m+=c,c+=b.s+(d+=b.c)}function Ef(a,b,c){return a.a.parent===b.parent?a.a:c}function Ff(a){return 1+Xg.max(a,function(a){return a.y})}function Gf(a){return a.reduce(function(a,b){return a+b.x},0)/a.length}function Hf(a){var b=a.children;return b&&b.length?Hf(b[0]):a}function If(a){var b,c=a.children;return c&&(b=c.length)?If(c[b-1]):a}function Jf(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function Kf(a,b){var c=a.x+b[3],d=a.y+b[0],e=a.dx-b[1]-b[3],f=a.dy-b[0]-b[2];return 0>e&&(c+=e/2,e=0),0>f&&(d+=f/2,f=0),{x:c,y:d,dx:e,dy:f}}function Lf(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function Mf(a){return a.rangeExtent?a.rangeExtent():Lf(a.range())}function Nf(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function Of(a,b){var c,d=0,e=a.length-1,f=a[d],g=a[e];return f>g&&(c=d,d=e,e=c,c=f,f=g,g=c),a[d]=b.floor(f),a[e]=b.ceil(g),a}function Pf(a){return a?{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}:oj}function Qf(a,b,c,d){var e=[],f=[],g=0,h=Math.min(a.length,b.length)-1;for(a[h]<a[0]&&(a=a.slice().reverse(),b=b.slice().reverse());++g<=h;)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=Xg.bisect(a,b,1,h)-1;return f[c](e[c](b))}}function Rf(a,b,c,d){function e(){var e=Math.min(a.length,b.length)>2?Qf:Nf,i=d?Qe:Pe;return g=e(a,b,i,c),h=e(b,a,i,re),f}function f(a){return g(a)}var g,h;return f.invert=function(a){return h(a)},f.domain=function(b){return arguments.length?(a=b.map(Number),e()):a},f.range=function(a){return arguments.length?(b=a,e()):b},f.rangeRound=function(a){return f.range(a).interpolate(Je)},f.clamp=function(a){return arguments.length?(d=a,e()):d},f.interpolate=function(a){return arguments.length?(c=a,e()):c},f.ticks=function(b){return Vf(a,b)},f.tickFormat=function(b,c){return Wf(a,b,c)},f.nice=function(b){return Tf(a,b),e()},f.copy=function(){return Rf(a,b,c,d)},e()}function Sf(a,b){return Xg.rebind(a,b,"range","rangeRound","interpolate","clamp")}function Tf(a,b){return Of(a,Pf(Uf(a,b)[2]))}function Uf(a,b){null==b&&(b=10);var c=Lf(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return.15>=f?e*=10:.35>=f?e*=5:.75>=f&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+.5*e,c[2]=e,c}function Vf(a,b){return Xg.range.apply(Xg,Uf(a,b))}function Wf(a,b,c){var d=Uf(a,b);if(c){var e=ci.exec(c);if(e.shift(),"s"===e[8]){var f=Xg.formatPrefix(Math.max(jh(d[0]),jh(d[1])));return e[7]||(e[7]="."+Xf(f.scale(d[2]))),e[8]="f",c=Xg.format(e.join("")),function(a){return c(f.scale(a))+f.symbol}}e[7]||(e[7]="."+Yf(e[8],d)),c=e.join("")}else c=",."+Xf(d[2])+"f";return Xg.format(c)}function Xf(a){return-Math.floor(Math.log(a)/Math.LN10+.01)}function Yf(a,b){var c=Xf(b[2]);return a in pj?Math.abs(c-Xf(Math.max(jh(b[0]),jh(b[1]))))+ +("e"!==a):c-2*("%"===a)}function Zf(a,b,c,d){function e(a){return(c?Math.log(0>a?0:a):-Math.log(a>0?0:-a))/Math.log(b)}function f(a){return c?Math.pow(b,a):-Math.pow(b,-a)}function g(b){return a(e(b))}return g.invert=function(b){return f(a.invert(b))},g.domain=function(b){return arguments.length?(c=b[0]>=0,a.domain((d=b.map(Number)).map(e)),g):d},g.base=function(c){return arguments.length?(b=+c,a.domain(d.map(e)),g):b},g.nice=function(){var b=Of(d.map(e),c?Math:rj);return a.domain(b),d=b.map(f),g},g.ticks=function(){var a=Lf(d),g=[],h=a[0],i=a[1],j=Math.floor(e(h)),k=Math.ceil(e(i)),l=b%1?2:b;if(isFinite(k-j)){if(c){for(;k>j;j++)for(var m=1;l>m;m++)g.push(f(j)*m);g.push(f(j))}else for(g.push(f(j));j++<k;)for(var m=l-1;m>0;m--)g.push(f(j)*m);for(j=0;g[j]<h;j++);for(k=g.length;g[k-1]>i;k--);g=g.slice(j,k)}return g},g.tickFormat=function(a,b){if(!arguments.length)return qj;arguments.length<2?b=qj:"function"!=typeof b&&(b=Xg.format(b));var d,h=Math.max(.1,a/g.ticks().length),i=c?(d=1e-12,Math.ceil):(d=-1e-12,Math.floor);return function(a){return a/f(i(e(a)+d))<=h?b(a):""}},g.copy=function(){return Zf(a.copy(),b,c,d)},Sf(g,a)}function $f(a,b,c){function d(b){return a(e(b))}var e=_f(b),f=_f(1/b);return d.invert=function(b){return f(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain((c=b.map(Number)).map(e)),d):c},d.ticks=function(a){return Vf(c,a)},d.tickFormat=function(a,b){return Wf(c,a,b)},d.nice=function(a){return d.domain(Tf(c,a))},d.exponent=function(g){return arguments.length?(e=_f(b=g),f=_f(1/b),a.domain(c.map(e)),d):b},d.copy=function(){return $f(a.copy(),b,c)},Sf(d,a)}function _f(a){return function(b){return 0>b?-Math.pow(-b,a):Math.pow(b,a)}}function ag(a,b){function c(c){return f[((e.get(c)||("range"===b.t?e.set(c,a.push(c)):0/0))-1)%f.length]}function d(b,c){return Xg.range(a.length).map(function(a){return b+c*a})}var e,f,g;return c.domain=function(d){if(!arguments.length)return a;a=[],e=new i;for(var f,g=-1,h=d.length;++g<h;)e.has(f=d[g])||e.set(f,a.push(f));return c[b.t].apply(c,b.a)},c.range=function(a){return arguments.length?(f=a,g=0,b={t:"range",a:arguments},c):f},c.rangePoints=function(e,h){arguments.length<2&&(h=0);var i=e[0],j=e[1],k=(j-i)/(Math.max(1,a.length-1)+h);return f=d(a.length<2?(i+j)/2:i+k*h/2,k),g=0,b={t:"rangePoints",a:arguments},c},c.rangeBands=function(e,h,i){arguments.length<2&&(h=0),arguments.length<3&&(i=h);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=(l-k)/(a.length-h+2*i);return f=d(k+m*i,m),j&&f.reverse(),g=m*(1-h),b={t:"rangeBands",a:arguments},c},c.rangeRoundBands=function(e,h,i){arguments.length<2&&(h=0),arguments.length<3&&(i=h);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=Math.floor((l-k)/(a.length-h+2*i)),n=l-k-(a.length-h)*m;return f=d(k+Math.round(n/2),m),j&&f.reverse(),g=Math.round(m*(1-h)),b={t:"rangeRoundBands",a:arguments},c},c.rangeBand=function(){return g},c.rangeExtent=function(){return Lf(b.a[0])},c.copy=function(){return ag(a,b)},c.domain(a)}function bg(b,e){function f(){var a=0,c=e.length;for(h=[];++a<c;)h[a-1]=Xg.quantile(b,a/c);return g}function g(a){return isNaN(a=+a)?void 0:e[Xg.bisect(h,a)]}var h;return g.domain=function(e){return arguments.length?(b=e.map(c).filter(d).sort(a),f()):b},g.range=function(a){return arguments.length?(e=a,f()):e},g.quantiles=function(){return h},g.invertExtent=function(a){return a=e.indexOf(a),0>a?[0/0,0/0]:[a>0?h[a-1]:b[0],a<h.length?h[a]:b[b.length-1]]},g.copy=function(){return bg(b,e)},f()}function cg(a,b,c){function d(b){return c[Math.max(0,Math.min(g,Math.floor(f*(b-a))))]}function e(){return f=c.length/(b-a),g=c.length-1,d}var f,g;return d.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],e()):[a,b]},d.range=function(a){return arguments.length?(c=a,e()):c},d.invertExtent=function(b){return b=c.indexOf(b),b=0>b?0/0:b/f+a,[b,b+1/f]},d.copy=function(){return cg(a,b,c)},e()}function dg(a,b){function c(c){return c>=c?b[Xg.bisect(a,c)]:void 0}return c.domain=function(b){return arguments.length?(a=b,c):a},c.range=function(a){return arguments.length?(b=a,c):b},c.invertExtent=function(c){return c=b.indexOf(c),[a[c-1],a[c]]},c.copy=function(){return dg(a,b)},c}function eg(a){function b(a){return+a}return b.invert=b,b.domain=b.range=function(c){return arguments.length?(a=c.map(b),b):a},b.ticks=function(b){return Vf(a,b)},b.tickFormat=function(b,c){return Wf(a,b,c)},b.copy=function(){return eg(a)},b}function fg(a){return a.innerRadius}function gg(a){return a.outerRadius}function hg(a){return a.startAngle}function ig(a){return a.endAngle}function jg(a){function b(b){function g(){j.push("M",f(a(k),h))}for(var i,j=[],k=[],l=-1,m=b.length,n=Ab(c),o=Ab(d);++l<m;)e.call(this,i=b[l],l)?k.push([+n.call(this,i,l),+o.call(this,i,l)]):k.length&&(g(),k=[]);return k.length&&g(),j.length?j.join(""):null}var c=Cd,d=Dd,e=Cc,f=kg,g=f.key,h=.7;return b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b.defined=function(a){return arguments.length?(e=a,b):e},b.interpolate=function(a){return arguments.length?(g="function"==typeof a?f=a:(f=yj.get(a)||kg).key,b):g},b.tension=function(a){return arguments.length?(h=a,b):h},b}function kg(a){return a.join("L")}function lg(a){return kg(a)+"Z"}function mg(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("H",(d[0]+(d=a[b])[0])/2,"V",d[1]);return c>1&&e.push("H",d[0]),e.join("")}function ng(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function og(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function pg(a,b){return a.length<4?kg(a):a[1]+sg(a.slice(1,a.length-1),tg(a,b))}function qg(a,b){return a.length<3?kg(a):a[0]+sg((a.push(a[0]),a),tg([a[a.length-2]].concat(a,[a[1]]),b))}function rg(a,b){return a.length<3?kg(a):a[0]+sg(a,tg(a,b))}function sg(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return kg(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;if(c&&(d+="Q"+(f[0]-2*g[0]/3)+","+(f[1]-2*g[1]/3)+","+f[0]+","+f[1],e=a[1],i=2),b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+2*h[0]/3)+","+(f[1]+2*h[1]/3)+","+k[0]+","+k[1]}return d}function tg(a,b){for(var c,d=[],e=(1-b)/2,f=a[0],g=a[1],h=1,i=a.length;++h<i;)c=f,f=g,g=a[h],d.push([e*(g[0]-c[0]),e*(g[1]-c[1])]);return d}function ug(a){if(a.length<3)return kg(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f,"L",yg(Bj,g),",",yg(Bj,h)];for(a.push(a[c-1]);++b<=c;)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),zg(i,g,h);return a.pop(),i.push("L",d),i.join("")}function vg(a){if(a.length<4)return kg(a);for(var b,c=[],d=-1,e=a.length,f=[0],g=[0];++d<3;)b=a[d],f.push(b[0]),g.push(b[1]);for(c.push(yg(Bj,f)+","+yg(Bj,g)),--d;++d<e;)b=a[d],f.shift(),f.push(b[0]),g.shift(),g.push(b[1]),zg(c,f,g);return c.join("")}function wg(a){for(var b,c,d=-1,e=a.length,f=e+4,g=[],h=[];++d<4;)c=a[d%e],g.push(c[0]),h.push(c[1]);for(b=[yg(Bj,g),",",yg(Bj,h)],--d;++d<f;)c=a[d%e],g.shift(),g.push(c[0]),h.shift(),h.push(c[1]),zg(b,g,h);return b.join("")}function xg(a,b){var c=a.length-1;if(c)for(var d,e,f=a[0][0],g=a[0][1],h=a[c][0]-f,i=a[c][1]-g,j=-1;++j<=c;)d=a[j],e=j/c,d[0]=b*d[0]+(1-b)*(f+e*h),d[1]=b*d[1]+(1-b)*(g+e*i);return ug(a)}function yg(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function zg(a,b,c){a.push("C",yg(zj,b),",",yg(zj,c),",",yg(Aj,b),",",yg(Aj,c),",",yg(Bj,b),",",yg(Bj,c))}function Ag(a,b){return(b[1]-a[1])/(b[0]-a[0])}function Bg(a){for(var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=Ag(e,f);++b<c;)d[b]=(g+(g=Ag(e=f,f=a[b+1])))/2;return d[b]=g,d}function Cg(a){for(var b,c,d,e,f=[],g=Bg(a),h=-1,i=a.length-1;++h<i;)b=Ag(a[h],a[h+1]),jh(b)<Eh?g[h]=g[h+1]=0:(c=g[h]/b,d=g[h+1]/b,e=c*c+d*d,e>9&&(e=3*b/Math.sqrt(e),g[h]=e*c,g[h+1]=e*d));for(h=-1;++h<=i;)e=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),f.push([e||0,g[h]*e||0]);return f}function Dg(a){return a.length<3?kg(a):a[0]+sg(a,Cg(a))}function Eg(a){for(var b,c,d,e=-1,f=a.length;++e<f;)b=a[e],c=b[0],d=b[1]+wj,b[0]=c*Math.cos(d),b[1]=c*Math.sin(d);return a}function Fg(a){function b(b){function i(){p.push("M",h(a(r),l),k,j(a(q.reverse()),l),"Z")}for(var m,n,o,p=[],q=[],r=[],s=-1,t=b.length,u=Ab(c),v=Ab(e),w=c===d?function(){return n}:Ab(d),x=e===f?function(){return o}:Ab(f);++s<t;)g.call(this,m=b[s],s)?(q.push([n=+u.call(this,m,s),o=+v.call(this,m,s)]),r.push([+w.call(this,m,s),+x.call(this,m,s)])):q.length&&(i(),q=[],r=[]);return q.length&&i(),p.length?p.join(""):null}var c=Cd,d=Cd,e=0,f=Dd,g=Cc,h=kg,i=h.key,j=h,k="L",l=.7;return b.x=function(a){return arguments.length?(c=d=a,b):d},b.x0=function(a){return arguments.length?(c=a,b):c},b.x1=function(a){return arguments.length?(d=a,b):d},b.y=function(a){return arguments.length?(e=f=a,b):f},b.y0=function(a){return arguments.length?(e=a,b):e},b.y1=function(a){return arguments.length?(f=a,b):f},b.defined=function(a){return arguments.length?(g=a,b):g},b.interpolate=function(a){return arguments.length?(i="function"==typeof a?h=a:(h=yj.get(a)||kg).key,j=h.reverse||h,k=h.closed?"M":"L",b):i},b.tension=function(a){return arguments.length?(l=a,b):l},b}function Gg(a){return a.radius}function Hg(a){return[a.x,a.y]}function Ig(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+wj;return[c*Math.cos(d),c*Math.sin(d)]}}function Jg(){return 64}function Kg(){return"circle"}function Lg(a){var b=Math.sqrt(a/Bh);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+-b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"}function Mg(a,b){return oh(a,Hj),a.id=b,a}function Ng(a,b,c,d){var e=a.id;return O(a,"function"==typeof c?function(a,f,g){a.__transition__[e].tween.set(b,d(c.call(a,a.__data__,f,g)))}:(c=d(c),function(a){a.__transition__[e].tween.set(b,c)}))}function Og(a){return null==a&&(a=""),function(){this.textContent=a}}function Pg(a,b,c,d){var e=a.__transition__||(a.__transition__={active:0,count:0}),f=e[c];if(!f){var g=d.time;f=e[c]={tween:new i,time:g,ease:d.ease,delay:d.delay,duration:d.duration},++e.count,Xg.timer(function(d){function h(d){return e.active>c?j():(e.active=c,f.event&&f.event.start.call(a,k,b),f.tween.forEach(function(c,d){(d=d.call(a,k,b))&&p.push(d)}),void Xg.timer(function(){return o.c=i(d||1)?Cc:i,1},0,g))}function i(d){if(e.active!==c)return j();for(var g=d/n,h=l(g),i=p.length;i>0;)p[--i].call(a,h);return g>=1?(f.event&&f.event.end.call(a,k,b),j()):void 0}function j(){return--e.count?delete e[c]:delete a.__transition__,1}var k=a.__data__,l=f.ease,m=f.delay,n=f.duration,o=_h,p=[];return o.t=m+g,d>=m?h(d-m):void(o.c=h)},0,g)}}function Qg(a,b,c){a.attr("transform",function(a){var d=b(a);return"translate("+(isFinite(d)?d:c(a))+",0)"})}function Rg(a,b,c){a.attr("transform",function(a){var d=b(a);return"translate(0,"+(isFinite(d)?d:c(a))+")"})}function Sg(a){return a.toISOString()}function Tg(a,b,c){function d(b){return a(b)}function e(a,c){var d=a[1]-a[0],e=d/c,f=Xg.bisect(Qj,e);return f==Qj.length?[b.year,Uf(a.map(function(a){return a/31536e6}),c)[2]]:f?b[e/Qj[f-1]<Qj[f]/e?f-1:f]:[Tj,Uf(a,c)[2]]}return d.invert=function(b){return Ug(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain(b),d):a.domain().map(Ug)},d.nice=function(a,b){function c(c){return!isNaN(c)&&!a.range(c,Ug(+c+1),b).length}var f=d.domain(),g=Lf(f),h=null==a?e(g,10):"number"==typeof a&&e(g,a);return h&&(a=h[0],b=h[1]),d.domain(Of(f,b>1?{floor:function(b){for(;c(b=a.floor(b));)b=Ug(b-1);return b},ceil:function(b){for(;c(b=a.ceil(b));)b=Ug(+b+1);return b}}:a))},d.ticks=function(a,b){var c=Lf(d.domain()),f=null==a?e(c,10):"number"==typeof a?e(c,a):!a.range&&[{range:a},b];return f&&(a=f[0],b=f[1]),a.range(c[0],Ug(+c[1]+1),1>b?1:b)},d.tickFormat=function(){return c},d.copy=function(){return Tg(a.copy(),b,c)},Sf(d,a)}function Ug(a){return new Date(a)}function Vg(a){return JSON.parse(a.responseText)}function Wg(a){var b=$g.createRange();return b.selectNode($g.body),b.createContextualFragment(a.responseText)}var Xg={version:"3.4.13"};Date.now||(Date.now=function(){return+new Date});var Yg=[].slice,Zg=function(a){return Yg.call(a)},$g=document,_g=$g.documentElement,ah=window;try{Zg(_g.childNodes)[0].nodeType}catch(bh){Zg=function(a){for(var b=a.length,c=new Array(b);b--;)c[b]=a[b];return c}}try{$g.createElement("div").style.setProperty("opacity",0,"")}catch(ch){var dh=ah.Element.prototype,eh=dh.setAttribute,fh=dh.setAttributeNS,gh=ah.CSSStyleDeclaration.prototype,hh=gh.setProperty;dh.setAttribute=function(a,b){eh.call(this,a,b+"")},dh.setAttributeNS=function(a,b,c){fh.call(this,a,b,c+"")},gh.setProperty=function(a,b,c){hh.call(this,a,b+"",c)}}Xg.ascending=a,Xg.descending=function(a,b){return a>b?-1:b>a?1:b>=a?0:0/0},Xg.min=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e<f&&!(null!=(c=a[e])&&c>=c);)c=void 0;for(;++e<f;)null!=(d=a[e])&&c>d&&(c=d)}else{for(;++e<f&&!(null!=(c=b.call(a,a[e],e))&&c>=c);)c=void 0;for(;++e<f;)null!=(d=b.call(a,a[e],e))&&c>d&&(c=d)}return c},Xg.max=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e<f&&!(null!=(c=a[e])&&c>=c);)c=void 0;for(;++e<f;)null!=(d=a[e])&&d>c&&(c=d)}else{for(;++e<f&&!(null!=(c=b.call(a,a[e],e))&&c>=c);)c=void 0;for(;++e<f;)null!=(d=b.call(a,a[e],e))&&d>c&&(c=d)}return c},Xg.extent=function(a,b){var c,d,e,f=-1,g=a.length;if(1===arguments.length){for(;++f<g&&!(null!=(c=e=a[f])&&c>=c);)c=e=void 0;for(;++f<g;)null!=(d=a[f])&&(c>d&&(c=d),d>e&&(e=d))}else{for(;++f<g&&!(null!=(c=e=b.call(a,a[f],f))&&c>=c);)c=void 0;for(;++f<g;)null!=(d=b.call(a,a[f],f))&&(c>d&&(c=d),d>e&&(e=d))}return[c,e]},Xg.sum=function(a,b){var c,e=0,f=a.length,g=-1;if(1===arguments.length)for(;++g<f;)d(c=+a[g])&&(e+=c);else for(;++g<f;)d(c=+b.call(a,a[g],g))&&(e+=c);return e},Xg.mean=function(a,b){var e,f=0,g=a.length,h=-1,i=g;if(1===arguments.length)for(;++h<g;)d(e=c(a[h]))?f+=e:--i;else for(;++h<g;)d(e=c(b.call(a,a[h],h)))?f+=e:--i;return i?f/i:void 0},Xg.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=+a[d-1],f=c-d;return f?e+f*(a[d]-e):e},Xg.median=function(b,e){var f,g=[],h=b.length,i=-1;if(1===arguments.length)for(;++i<h;)d(f=c(b[i]))&&g.push(f);else for(;++i<h;)d(f=c(e.call(b,b[i],i)))&&g.push(f);return g.length?Xg.quantile(g.sort(a),.5):void 0};var ih=e(a);Xg.bisectLeft=ih.left,Xg.bisect=Xg.bisectRight=ih.right,Xg.bisector=function(b){return e(1===b.length?function(c,d){return a(b(c),d)}:b)},Xg.shuffle=function(a){for(var b,c,d=a.length;d;)c=Math.random()*d--|0,b=a[d],a[d]=a[c],a[c]=b;return a},Xg.permute=function(a,b){for(var c=b.length,d=new Array(c);c--;)d[c]=a[b[c]];return d},Xg.pairs=function(a){for(var b,c=0,d=a.length-1,e=a[0],f=new Array(0>d?0:d);d>c;)f[c]=[b=e,e=a[++c]];return f},Xg.zip=function(){if(!(d=arguments.length))return[];for(var a=-1,b=Xg.min(arguments,f),c=new Array(b);++a<b;)for(var d,e=-1,g=c[a]=new Array(d);++e<d;)g[e]=arguments[e][a];return c},Xg.transpose=function(a){return Xg.zip.apply(Xg,a)},Xg.keys=function(a){var b=[];for(var c in a)b.push(c);return b},Xg.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},Xg.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},Xg.merge=function(a){for(var b,c,d,e=a.length,f=-1,g=0;++f<e;)g+=a[f].length;for(c=new Array(g);--e>=0;)for(d=a[e],b=d.length;--b>=0;)c[--g]=d[b];return c};var jh=Math.abs;Xg.range=function(a,b,c){if(arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0)),(b-a)/c===1/0)throw new Error("infinite range");var d,e=[],f=g(jh(c)),h=-1;if(a*=f,b*=f,c*=f,0>c)for(;(d=a+c*++h)>b;)e.push(d/f);else for(;(d=a+c*++h)<b;)e.push(d/f);return e},Xg.map=function(a){var b=new i;if(a instanceof i)a.forEach(function(a,c){b.set(a,c)});else for(var c in a)b.set(c,a[c]);return b};var kh="__proto__",lh="\x00";h(i,{has:l,get:function(a){return this._[j(a)]},set:function(a,b){return this._[j(a)]=b},remove:m,keys:n,values:function(){var a=[];for(var b in this._)a.push(this._[b]);return a},entries:function(){var a=[];for(var b in this._)a.push({key:k(b),value:this._[b]});return a},size:o,empty:p,forEach:function(a){for(var b in this._)a.call(this,k(b),this._[b])}}),Xg.nest=function(){function a(b,g,h){if(h>=f.length)return d?d.call(e,g):c?g.sort(c):g;for(var j,k,l,m,n=-1,o=g.length,p=f[h++],q=new i;++n<o;)(m=q.get(j=p(k=g[n])))?m.push(k):q.set(j,[k]);return b?(k=b(),l=function(c,d){k.set(c,a(b,d,h))}):(k={},l=function(c,d){k[c]=a(b,d,h)}),q.forEach(l),k}function b(a,c){if(c>=f.length)return a;var d=[],e=g[c++];return a.forEach(function(a,e){d.push({key:a,values:b(e,c)})}),e?d.sort(function(a,b){return e(a.key,b.key)}):d}var c,d,e={},f=[],g=[];return e.map=function(b,c){return a(c,b,0)},e.entries=function(c){return b(a(Xg.map,c,0),0)},e.key=function(a){return f.push(a),e},e.sortKeys=function(a){return g[f.length-1]=a,e},e.sortValues=function(a){return c=a,e},e.rollup=function(a){return d=a,e},e},Xg.set=function(a){var b=new q;if(a)for(var c=0,d=a.length;d>c;++c)b.add(a[c]);return b},h(q,{has:l,add:function(a){return this._[j(a+="")]=!0,a},remove:m,values:n,size:o,empty:p,forEach:function(a){for(var b in this._)a.call(this,k(b))}}),Xg.behavior={},Xg.rebind=function(a,b){for(var c,d=1,e=arguments.length;++d<e;)a[c=arguments[d]]=r(a,b,b[c]);return a};var mh=["webkit","ms","moz","Moz","o","O"];Xg.dispatch=function(){for(var a=new u,b=-1,c=arguments.length;++b<c;)a[arguments[b]]=v(a);return a},u.prototype.on=function(a,b){var c=a.indexOf("."),d="";if(c>=0&&(d=a.slice(c+1),a=a.slice(0,c)),a)return arguments.length<2?this[a].on(d):this[a].on(d,b);if(2===arguments.length){if(null==b)for(a in this)this.hasOwnProperty(a)&&this[a].on(d,null);return this}},Xg.event=null,Xg.requote=function(a){return a.replace(nh,"\\$&")};var nh=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,oh={}.__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]},ph=function(a,b){return b.querySelector(a)},qh=function(a,b){return b.querySelectorAll(a)},rh=_g.matches||_g[s(_g,"matchesSelector")],sh=function(a,b){return rh.call(a,b)};"function"==typeof Sizzle&&(ph=function(a,b){return Sizzle(a,b)[0]||null},qh=Sizzle,sh=Sizzle.matchesSelector),Xg.selection=function(){return wh};var th=Xg.selection.prototype=[];th.select=function(a){var b,c,d,e,f=[];a=A(a);for(var g=-1,h=this.length;++g<h;){f.push(b=[]),b.parentNode=(d=this[g]).parentNode;for(var i=-1,j=d.length;++i<j;)(e=d[i])?(b.push(c=a.call(e,e.__data__,i,g)),c&&"__data__"in e&&(c.__data__=e.__data__)):b.push(null)}return z(f)},th.selectAll=function(a){var b,c,d=[];a=B(a);for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)(c=g[h])&&(d.push(b=Zg(a.call(c,c.__data__,h,e))),b.parentNode=c);return z(d)};var uh={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};Xg.ns={prefix:uh,qualify:function(a){var b=a.indexOf(":"),c=a;return b>=0&&(c=a.slice(0,b),a=a.slice(b+1)),uh.hasOwnProperty(c)?{space:uh[c],local:a}:a}},th.attr=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node();return a=Xg.ns.qualify(a),a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}for(b in a)this.each(C(b,a[b]));return this}return this.each(C(a,b))},th.classed=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node(),d=(a=F(a)).length,e=-1;if(b=c.classList){for(;++e<d;)if(!b.contains(a[e]))return!1}else for(b=c.getAttribute("class");++e<d;)if(!E(a[e]).test(b))return!1;return!0}for(b in a)this.each(G(b,a[b]));return this}return this.each(G(a,b))},th.style=function(a,b,c){var d=arguments.length;if(3>d){if("string"!=typeof a){2>d&&(b="");for(c in a)this.each(I(c,a[c],b));return this}if(2>d)return ah.getComputedStyle(this.node(),null).getPropertyValue(a);c=""}return this.each(I(a,b,c))},th.property=function(a,b){if(arguments.length<2){if("string"==typeof a)return this.node()[a];for(b in a)this.each(J(b,a[b]));return this}return this.each(J(a,b))},th.text=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.textContent=null==b?"":b}:null==a?function(){this.textContent=""}:function(){this.textContent=a}):this.node().textContent},th.html=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.innerHTML=null==b?"":b}:null==a?function(){this.innerHTML=""}:function(){this.innerHTML=a}):this.node().innerHTML},th.append=function(a){return a=K(a),this.select(function(){return this.appendChild(a.apply(this,arguments))})},th.insert=function(a,b){return a=K(a),b=A(b),this.select(function(){return this.insertBefore(a.apply(this,arguments),b.apply(this,arguments)||null)})},th.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},th.data=function(a,b){function c(a,c){var d,e,f,g=a.length,l=c.length,m=Math.min(g,l),n=new Array(l),o=new Array(l),p=new Array(g);if(b){var q,r=new i,s=new Array(g);for(d=-1;++d<g;)r.has(q=b.call(e=a[d],e.__data__,d))?p[d]=e:r.set(q,e),s[d]=q;for(d=-1;++d<l;)(e=r.get(q=b.call(c,f=c[d],d)))?e!==!0&&(n[d]=e,e.__data__=f):o[d]=L(f),r.set(q,!0);for(d=-1;++d<g;)r.get(s[d])!==!0&&(p[d]=a[d])}else{for(d=-1;++d<m;)e=a[d],f=c[d],e?(e.__data__=f,n[d]=e):o[d]=L(f);for(;l>d;++d)o[d]=L(c[d]);for(;g>d;++d)p[d]=a[d]}o.update=n,o.parentNode=n.parentNode=p.parentNode=a.parentNode,h.push(o),j.push(n),k.push(p)}var d,e,f=-1,g=this.length;if(!arguments.length){for(a=new Array(g=(d=this[0]).length);++f<g;)(e=d[f])&&(a[f]=e.__data__);return a}var h=P([]),j=z([]),k=z([]);if("function"==typeof a)for(;++f<g;)c(d=this[f],a.call(d,d.parentNode.__data__,f));else for(;++f<g;)c(d=this[f],a);return j.enter=function(){return h},j.exit=function(){return k},j},th.datum=function(a){return arguments.length?this.property("__data__",a):this.property("__data__")},th.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=M(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]),b.parentNode=(c=this[f]).parentNode;for(var h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return z(e)},th.order=function(){for(var a=-1,b=this.length;++a<b;)for(var c,d=this[a],e=d.length-1,f=d[e];--e>=0;)(c=d[e])&&(f&&f!==c.nextSibling&&f.parentNode.insertBefore(c,f),f=c);return this},th.sort=function(a){a=N.apply(this,arguments);for(var b=-1,c=this.length;++b<c;)this[b].sort(a);return this.order()},th.each=function(a){return O(this,function(b,c,d){a.call(b,b.__data__,c,d)})},th.call=function(a){var b=Zg(arguments);return a.apply(b[0]=this,b),this},th.empty=function(){return!this.node()},th.node=function(){for(var a=0,b=this.length;b>a;a++)for(var c=this[a],d=0,e=c.length;e>d;d++){var f=c[d];if(f)return f}return null},th.size=function(){var a=0;return O(this,function(){++a}),a};var vh=[];Xg.selection.enter=P,Xg.selection.enter.prototype=vh,vh.append=th.append,vh.empty=th.empty,vh.node=th.node,vh.call=th.call,vh.size=th.size,vh.select=function(a){for(var b,c,d,e,f,g=[],h=-1,i=this.length;++h<i;){d=(e=this[h]).update,g.push(b=[]),b.parentNode=e.parentNode;for(var j=-1,k=e.length;++j<k;)(f=e[j])?(b.push(d[j]=c=a.call(e.parentNode,f.__data__,j,h)),c.__data__=f.__data__):b.push(null)}return z(g)},vh.insert=function(a,b){return arguments.length<2&&(b=Q(this)),th.insert.call(this,a,b)},th.transition=function(){for(var a,b,c=Dj||++Ij,d=[],e=Ej||{time:Date.now(),ease:ye,delay:0,duration:250},f=-1,g=this.length;++f<g;){d.push(a=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(b=h[i])&&Pg(b,i,c,e),a.push(b)}return Mg(d,c)},th.interrupt=function(){return this.each(R)},Xg.select=function(a){var b=["string"==typeof a?ph(a,$g):a];return b.parentNode=_g,z([b])},Xg.selectAll=function(a){var b=Zg("string"==typeof a?qh(a,$g):a);return b.parentNode=_g,z([b])};var wh=Xg.select(_g);th.on=function(a,b,c){var d=arguments.length;if(3>d){if("string"!=typeof a){2>d&&(b=!1);for(c in a)this.each(S(c,a[c],b));return this}if(2>d)return(d=this.node()["__on"+a])&&d._;c=!1}return this.each(S(a,b,c))};var xh=Xg.map({mouseenter:"mouseover",mouseleave:"mouseout"});xh.forEach(function(a){"on"+a in $g&&xh.remove(a)});var yh="onselectstart"in $g?null:s(_g.style,"userSelect"),zh=0;Xg.mouse=function(a){return W(a,x())};var Ah=/WebKit/.test(ah.navigator.userAgent)?-1:0;Xg.touch=function(a,b,c){if(arguments.length<3&&(c=b,b=x().changedTouches),b)for(var d,e=0,f=b.length;f>e;++e)if((d=b[e]).identifier===c)return W(a,d)},Xg.behavior.drag=function(){function a(){this.on("mousedown.drag",e).on("touchstart.drag",f)}function b(a,b,e,f,g){return function(){function h(){var a,c,d=b(m,p);d&&(a=d[0]-t[0],c=d[1]-t[1],o|=a|c,t=d,n({type:"drag",x:d[0]+j[0],y:d[1]+j[1],dx:a,dy:c}))}function i(){b(m,p)&&(r.on(f+q,null).on(g+q,null),s(o&&Xg.event.target===l),n({type:"dragend"}))}var j,k=this,l=Xg.event.target,m=k.parentNode,n=c.of(k,arguments),o=0,p=a(),q=".drag"+(null==p?"":"-"+p),r=Xg.select(e()).on(f+q,h).on(g+q,i),s=V(),t=b(m,p);d?(j=d.apply(k,arguments),j=[j.x-t[0],j.y-t[1]]):j=[0,0],n({type:"dragstart"})}}var c=y(a,"drag","dragstart","dragend"),d=null,e=b(t,Xg.mouse,Z,"mousemove","mouseup"),f=b(X,Xg.touch,Y,"touchmove","touchend");return a.origin=function(b){return arguments.length?(d=b,a):d},Xg.rebind(a,c,"on")},Xg.touches=function(a,b){return arguments.length<2&&(b=x().touches),b?Zg(b).map(function(b){var c=W(a,b);return c.identifier=b.identifier,c}):[]};var Bh=Math.PI,Ch=2*Bh,Dh=Bh/2,Eh=1e-6,Fh=Eh*Eh,Gh=Bh/180,Hh=180/Bh,Ih=Math.SQRT2,Jh=2,Kh=4;Xg.interpolateZoom=function(a,b){function c(a){var b=a*s;if(r){var c=db(p),g=f/(Jh*m)*(c*eb(Ih*b+p)-cb(p));return[d+g*j,e+g*k,f*c/db(Ih*b+p)]}return[d+a*j,e+a*k,f*Math.exp(Ih*b)]}var d=a[0],e=a[1],f=a[2],g=b[0],h=b[1],i=b[2],j=g-d,k=h-e,l=j*j+k*k,m=Math.sqrt(l),n=(i*i-f*f+Kh*l)/(2*f*Jh*m),o=(i*i-f*f-Kh*l)/(2*i*Jh*m),p=Math.log(Math.sqrt(n*n+1)-n),q=Math.log(Math.sqrt(o*o+1)-o),r=q-p,s=(r||Math.log(i/f))/Ih;return c.duration=1e3*s,c},Xg.behavior.zoom=function(){function a(a){a.on(B,j).on(Nh+".zoom",l).on("dblclick.zoom",m).on(E,k)}function b(a){return[(a[0]-x.x)/x.k,(a[1]-x.y)/x.k]}function c(a){return[a[0]*x.k+x.x,a[1]*x.k+x.y]}function d(a){x.k=Math.max(A[0],Math.min(A[1],a))
|
||
}function e(a,b){b=c(b),x.x+=a[0]-b[0],x.y+=a[1]-b[1]}function f(){t&&t.domain(s.range().map(function(a){return(a-x.x)/x.k}).map(s.invert)),v&&v.domain(u.range().map(function(a){return(a-x.y)/x.k}).map(u.invert))}function g(a){a({type:"zoomstart"})}function h(a){f(),a({type:"zoom",scale:x.k,translate:[x.x,x.y]})}function i(a){a({type:"zoomend"})}function j(){function a(){k=1,e(Xg.mouse(d),m),h(j)}function c(){l.on(C,null).on(D,null),n(k&&Xg.event.target===f),i(j)}var d=this,f=Xg.event.target,j=F.of(d,arguments),k=0,l=Xg.select(ah).on(C,a).on(D,c),m=b(Xg.mouse(d)),n=V();R.call(d),g(j)}function k(){function a(){var a=Xg.touches(n);return m=x.k,a.forEach(function(a){a.identifier in p&&(p[a.identifier]=b(a))}),a}function c(){var b=Xg.event.target;Xg.select(b).on(t,f).on(u,l),v.push(b);for(var c=Xg.event.changedTouches,g=0,i=c.length;i>g;++g)p[c[g].identifier]=null;var j=a(),k=Date.now();if(1===j.length){if(500>k-r){var m=j[0],n=p[m.identifier];d(2*x.k),e(m,n),w(),h(o)}r=k}else if(j.length>1){var m=j[0],s=j[1],y=m[0]-s[0],z=m[1]-s[1];q=y*y+z*z}}function f(){for(var a,b,c,f,g=Xg.touches(n),i=0,j=g.length;j>i;++i,f=null)if(c=g[i],f=p[c.identifier]){if(b)break;a=c,b=f}if(f){var k=(k=c[0]-a[0])*k+(k=c[1]-a[1])*k,l=q&&Math.sqrt(k/q);a=[(a[0]+c[0])/2,(a[1]+c[1])/2],b=[(b[0]+f[0])/2,(b[1]+f[1])/2],d(l*m)}r=null,e(a,b),h(o)}function l(){if(Xg.event.touches.length){for(var b=Xg.event.changedTouches,c=0,d=b.length;d>c;++c)delete p[b[c].identifier];for(var e in p)return void a()}Xg.selectAll(v).on(s,null),y.on(B,j).on(E,k),z(),i(o)}var m,n=this,o=F.of(n,arguments),p={},q=0,s=".zoom-"+Xg.event.changedTouches[0].identifier,t="touchmove"+s,u="touchend"+s,v=[],y=Xg.select(n),z=V();R.call(n),c(),g(o),y.on(B,null).on(E,c)}function l(){var a=F.of(this,arguments);q?clearTimeout(q):(n=b(o=p||Xg.mouse(this)),R.call(this),g(a)),q=setTimeout(function(){q=null,i(a)},50),w(),d(Math.pow(2,.002*Lh())*x.k),e(o,n),h(a)}function m(){var a=F.of(this,arguments),c=Xg.mouse(this),f=b(c),j=Math.log(x.k)/Math.LN2;g(a),d(Math.pow(2,Xg.event.shiftKey?Math.ceil(j)-1:Math.floor(j)+1)),e(c,f),h(a),i(a)}var n,o,p,q,r,s,t,u,v,x={x:0,y:0,k:1},z=[960,500],A=Mh,B="mousedown.zoom",C="mousemove.zoom",D="mouseup.zoom",E="touchstart.zoom",F=y(a,"zoomstart","zoom","zoomend");return a.event=function(a){a.each(function(){var a=F.of(this,arguments),b=x;Dj?Xg.select(this).transition().each("start.zoom",function(){x=this.__chart__||{x:0,y:0,k:1},g(a)}).tween("zoom:zoom",function(){var c=z[0],d=z[1],e=c/2,f=d/2,g=Xg.interpolateZoom([(e-x.x)/x.k,(f-x.y)/x.k,c/x.k],[(e-b.x)/b.k,(f-b.y)/b.k,c/b.k]);return function(b){var d=g(b),i=c/d[2];this.__chart__=x={x:e-d[0]*i,y:f-d[1]*i,k:i},h(a)}}).each("end.zoom",function(){i(a)}):(this.__chart__=x,g(a),h(a),i(a))})},a.translate=function(b){return arguments.length?(x={x:+b[0],y:+b[1],k:x.k},f(),a):[x.x,x.y]},a.scale=function(b){return arguments.length?(x={x:x.x,y:x.y,k:+b},f(),a):x.k},a.scaleExtent=function(b){return arguments.length?(A=null==b?Mh:[+b[0],+b[1]],a):A},a.center=function(b){return arguments.length?(p=b&&[+b[0],+b[1]],a):p},a.size=function(b){return arguments.length?(z=b&&[+b[0],+b[1]],a):z},a.x=function(b){return arguments.length?(t=b,s=b.copy(),x={x:0,y:0,k:1},a):t},a.y=function(b){return arguments.length?(v=b,u=b.copy(),x={x:0,y:0,k:1},a):v},Xg.rebind(a,F,"on")};var Lh,Mh=[0,1/0],Nh="onwheel"in $g?(Lh=function(){return-Xg.event.deltaY*(Xg.event.deltaMode?120:1)},"wheel"):"onmousewheel"in $g?(Lh=function(){return Xg.event.wheelDelta},"mousewheel"):(Lh=function(){return-Xg.event.detail},"MozMousePixelScroll");Xg.color=gb,gb.prototype.toString=function(){return this.rgb()+""},Xg.hsl=hb;var Oh=hb.prototype=new gb;Oh.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),new hb(this.h,this.s,this.l/a)},Oh.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),new hb(this.h,this.s,a*this.l)},Oh.rgb=function(){return ib(this.h,this.s,this.l)},Xg.hcl=jb;var Ph=jb.prototype=new gb;Ph.brighter=function(a){return new jb(this.h,this.c,Math.min(100,this.l+Qh*(arguments.length?a:1)))},Ph.darker=function(a){return new jb(this.h,this.c,Math.max(0,this.l-Qh*(arguments.length?a:1)))},Ph.rgb=function(){return kb(this.h,this.c,this.l).rgb()},Xg.lab=lb;var Qh=18,Rh=.95047,Sh=1,Th=1.08883,Uh=lb.prototype=new gb;Uh.brighter=function(a){return new lb(Math.min(100,this.l+Qh*(arguments.length?a:1)),this.a,this.b)},Uh.darker=function(a){return new lb(Math.max(0,this.l-Qh*(arguments.length?a:1)),this.a,this.b)},Uh.rgb=function(){return mb(this.l,this.a,this.b)},Xg.rgb=rb;var Vh=rb.prototype=new gb;Vh.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return b||c||d?(b&&e>b&&(b=e),c&&e>c&&(c=e),d&&e>d&&(d=e),new rb(Math.min(255,b/a),Math.min(255,c/a),Math.min(255,d/a))):new rb(e,e,e)},Vh.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),new rb(a*this.r,a*this.g,a*this.b)},Vh.hsl=function(){return wb(this.r,this.g,this.b)},Vh.toString=function(){return"#"+ub(this.r)+ub(this.g)+ub(this.b)};var Wh=Xg.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Wh.forEach(function(a,b){Wh.set(a,sb(b))}),Xg.functor=Ab,Xg.xhr=Cb(Bb),Xg.dsv=function(a,b){function c(a,c,f){arguments.length<3&&(f=c,c=null);var g=Db(a,b,null==c?d:e(c),f);return g.row=function(a){return arguments.length?g.response(null==(c=a)?d:e(a)):c},g}function d(a){return c.parse(a.responseText)}function e(a){return function(b){return c.parse(b.responseText,a)}}function f(b){return b.map(g).join(a)}function g(a){return h.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}var h=new RegExp('["'+a+"\n]"),i=a.charCodeAt(0);return c.parse=function(a,b){var d;return c.parseRows(a,function(a,c){if(d)return d(a,c-1);var e=new Function("d","return {"+a.map(function(a,b){return JSON.stringify(a)+": d["+b+"]"}).join(",")+"}");d=b?function(a,c){return b(e(a),c)}:e})},c.parseRows=function(a,b){function c(){if(k>=j)return g;if(e)return e=!1,f;var b=k;if(34===a.charCodeAt(b)){for(var c=b;c++<j;)if(34===a.charCodeAt(c)){if(34!==a.charCodeAt(c+1))break;++c}k=c+2;var d=a.charCodeAt(c+1);return 13===d?(e=!0,10===a.charCodeAt(c+2)&&++k):10===d&&(e=!0),a.slice(b+1,c).replace(/""/g,'"')}for(;j>k;){var d=a.charCodeAt(k++),h=1;if(10===d)e=!0;else if(13===d)e=!0,10===a.charCodeAt(k)&&(++k,++h);else if(d!==i)continue;return a.slice(b,k-h)}return a.slice(b)}for(var d,e,f={},g={},h=[],j=a.length,k=0,l=0;(d=c())!==g;){for(var m=[];d!==f&&d!==g;)m.push(d),d=c();b&&null==(m=b(m,l++))||h.push(m)}return h},c.format=function(b){if(Array.isArray(b[0]))return c.formatRows(b);var d=new q,e=[];return b.forEach(function(a){for(var b in a)d.has(b)||e.push(d.add(b))}),[e.map(g).join(a)].concat(b.map(function(b){return e.map(function(a){return g(b[a])}).join(a)})).join("\n")},c.formatRows=function(a){return a.map(f).join("\n")},c},Xg.csv=Xg.dsv(",","text/csv"),Xg.tsv=Xg.dsv(" ","text/tab-separated-values");var Xh,Yh,Zh,$h,_h,ai=ah[s(ah,"requestAnimationFrame")]||function(a){setTimeout(a,17)};Xg.timer=function(a,b,c){var d=arguments.length;2>d&&(b=0),3>d&&(c=Date.now());var e=c+b,f={c:a,t:e,f:!1,n:null};Yh?Yh.n=f:Xh=f,Yh=f,Zh||($h=clearTimeout($h),Zh=1,ai(Gb))},Xg.timer.flush=function(){Hb(),Ib()},Xg.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)};var bi=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Kb);Xg.formatPrefix=function(a,b){var c=0;return a&&(0>a&&(a*=-1),b&&(a=Xg.round(a,Jb(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,3*Math.floor((c-1)/3)))),bi[8+c/3]};var ci=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,di=Xg.map({b:function(a){return a.toString(2)},c:function(a){return String.fromCharCode(a)},o:function(a){return a.toString(8)},x:function(a){return a.toString(16)},X:function(a){return a.toString(16).toUpperCase()},g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return(a=Xg.round(a,Jb(a,b))).toFixed(Math.max(0,Math.min(20,Jb(a*(1+1e-15),b))))}}),ei=Xg.time={},fi=Date;Nb.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){gi.setUTCDate.apply(this._,arguments)},setDay:function(){gi.setUTCDay.apply(this._,arguments)},setFullYear:function(){gi.setUTCFullYear.apply(this._,arguments)},setHours:function(){gi.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){gi.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){gi.setUTCMinutes.apply(this._,arguments)},setMonth:function(){gi.setUTCMonth.apply(this._,arguments)},setSeconds:function(){gi.setUTCSeconds.apply(this._,arguments)},setTime:function(){gi.setTime.apply(this._,arguments)}};var gi=Date.prototype;ei.year=Ob(function(a){return a=ei.day(a),a.setMonth(0,1),a},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a){return a.getFullYear()}),ei.years=ei.year.range,ei.years.utc=ei.year.utc.range,ei.day=Ob(function(a){var b=new fi(2e3,0);return b.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),b},function(a,b){a.setDate(a.getDate()+b)},function(a){return a.getDate()-1}),ei.days=ei.day.range,ei.days.utc=ei.day.utc.range,ei.dayOfYear=function(a){var b=ei.year(a);return Math.floor((a-b-6e4*(a.getTimezoneOffset()-b.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(a,b){b=7-b;var c=ei[a]=Ob(function(a){return(a=ei.day(a)).setDate(a.getDate()-(a.getDay()+b)%7),a},function(a,b){a.setDate(a.getDate()+7*Math.floor(b))},function(a){var c=ei.year(a).getDay();return Math.floor((ei.dayOfYear(a)+(c+b)%7)/7)-(c!==b)});ei[a+"s"]=c.range,ei[a+"s"].utc=c.utc.range,ei[a+"OfYear"]=function(a){var c=ei.year(a).getDay();return Math.floor((ei.dayOfYear(a)+(c+b)%7)/7)}}),ei.week=ei.sunday,ei.weeks=ei.sunday.range,ei.weeks.utc=ei.sunday.utc.range,ei.weekOfYear=ei.sundayOfYear;var hi={"-":"",_:" ",0:"0"},ii=/^\s*\d+/,ji=/^%/;Xg.locale=function(a){return{numberFormat:Lb(a),timeFormat:Qb(a)}};var ki=Xg.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Xg.format=ki.numberFormat,Xg.geo={},jc.prototype={s:0,t:0,add:function(a){kc(a,this.t,li),kc(li.s,this.s,this),this.s?this.t+=li.t:this.s=li.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var li=new jc;Xg.geo.stream=function(a,b){a&&mi.hasOwnProperty(a.type)?mi[a.type](a,b):lc(a,b)};var mi={Feature:function(a,b){lc(a.geometry,b)},FeatureCollection:function(a,b){for(var c=a.features,d=-1,e=c.length;++d<e;)lc(c[d].geometry,b)}},ni={Sphere:function(a,b){b.sphere()},Point:function(a,b){a=a.coordinates,b.point(a[0],a[1],a[2])},MultiPoint:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)a=c[d],b.point(a[0],a[1],a[2])},LineString:function(a,b){mc(a.coordinates,b,0)},MultiLineString:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)mc(c[d],b,0)},Polygon:function(a,b){nc(a.coordinates,b)},MultiPolygon:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)nc(c[d],b)},GeometryCollection:function(a,b){for(var c=a.geometries,d=-1,e=c.length;++d<e;)lc(c[d],b)}};Xg.geo.area=function(a){return oi=0,Xg.geo.stream(a,qi),oi};var oi,pi=new jc,qi={sphere:function(){oi+=4*Bh},point:t,lineStart:t,lineEnd:t,polygonStart:function(){pi.reset(),qi.lineStart=oc},polygonEnd:function(){var a=2*pi;oi+=0>a?4*Bh+a:a,qi.lineStart=qi.lineEnd=qi.point=t}};Xg.geo.bounds=function(){function a(a,b){t.push(u=[k=a,m=a]),l>b&&(l=b),b>n&&(n=b)}function b(b,c){var d=pc([b*Gh,c*Gh]);if(r){var e=rc(r,d),f=[e[1],-e[0],0],g=rc(f,e);uc(g),g=vc(g);var i=b-o,j=i>0?1:-1,p=g[0]*Hh*j,q=jh(i)>180;if(q^(p>j*o&&j*b>p)){var s=g[1]*Hh;s>n&&(n=s)}else if(p=(p+360)%360-180,q^(p>j*o&&j*b>p)){var s=-g[1]*Hh;l>s&&(l=s)}else l>c&&(l=c),c>n&&(n=c);q?o>b?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b):m>=k?(k>b&&(k=b),b>m&&(m=b)):b>o?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b)}else a(b,c);r=d,o=b}function c(){v.point=b}function d(){u[0]=k,u[1]=m,v.point=a,r=null}function e(a,c){if(r){var d=a-o;s+=jh(d)>180?d+(d>0?360:-360):d}else p=a,q=c;qi.point(a,c),b(a,c)}function f(){qi.lineStart()}function g(){e(p,q),qi.lineEnd(),jh(s)>Eh&&(k=-(m=180)),u[0]=k,u[1]=m,r=null}function h(a,b){return(b-=a)<0?b+360:b}function i(a,b){return a[0]-b[0]}function j(a,b){return b[0]<=b[1]?b[0]<=a&&a<=b[1]:a<b[0]||b[1]<a}var k,l,m,n,o,p,q,r,s,t,u,v={point:a,lineStart:c,lineEnd:d,polygonStart:function(){v.point=e,v.lineStart=f,v.lineEnd=g,s=0,qi.polygonStart()},polygonEnd:function(){qi.polygonEnd(),v.point=a,v.lineStart=c,v.lineEnd=d,0>pi?(k=-(m=180),l=-(n=90)):s>Eh?n=90:-Eh>s&&(l=-90),u[0]=k,u[1]=m}};return function(a){n=m=-(k=l=1/0),t=[],Xg.geo.stream(a,v);var b=t.length;if(b){t.sort(i);for(var c,d=1,e=t[0],f=[e];b>d;++d)c=t[d],j(c[0],e)||j(c[1],e)?(h(e[0],c[1])>h(e[0],e[1])&&(e[1]=c[1]),h(c[0],e[1])>h(e[0],e[1])&&(e[0]=c[0])):f.push(e=c);for(var g,c,o=-1/0,b=f.length-1,d=0,e=f[b];b>=d;e=c,++d)c=f[d],(g=h(e[1],c[0]))>o&&(o=g,k=c[0],m=e[1])}return t=u=null,1/0===k||1/0===l?[[0/0,0/0],[0/0,0/0]]:[[k,l],[m,n]]}}(),Xg.geo.centroid=function(a){ri=si=ti=ui=vi=wi=xi=yi=zi=Ai=Bi=0,Xg.geo.stream(a,Ci);var b=zi,c=Ai,d=Bi,e=b*b+c*c+d*d;return Fh>e&&(b=wi,c=xi,d=yi,Eh>si&&(b=ti,c=ui,d=vi),e=b*b+c*c+d*d,Fh>e)?[0/0,0/0]:[Math.atan2(c,b)*Hh,bb(d/Math.sqrt(e))*Hh]};var ri,si,ti,ui,vi,wi,xi,yi,zi,Ai,Bi,Ci={sphere:t,point:xc,lineStart:zc,lineEnd:Ac,polygonStart:function(){Ci.lineStart=Bc},polygonEnd:function(){Ci.lineStart=zc}},Di=Gc(Cc,Kc,Mc,[-Bh,-Bh/2]),Ei=1e9;Xg.geo.clipExtent=function(){var a,b,c,d,e,f,g={stream:function(a){return e&&(e.valid=!1),e=f(a),e.valid=!0,e},extent:function(h){return arguments.length?(f=Qc(a=+h[0][0],b=+h[0][1],c=+h[1][0],d=+h[1][1]),e&&(e.valid=!1,e=null),g):[[a,b],[c,d]]}};return g.extent([[0,0],[960,500]])},(Xg.geo.conicEqualArea=function(){return Sc(Tc)}).raw=Tc,Xg.geo.albers=function(){return Xg.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Xg.geo.albersUsa=function(){function a(a){var f=a[0],g=a[1];return b=null,c(f,g),b||(d(f,g),b)||e(f,g),b}var b,c,d,e,f=Xg.geo.albers(),g=Xg.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),h=Xg.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),i={point:function(a,c){b=[a,c]}};return a.invert=function(a){var b=f.scale(),c=f.translate(),d=(a[0]-c[0])/b,e=(a[1]-c[1])/b;return(e>=.12&&.234>e&&d>=-.425&&-.214>d?g:e>=.166&&.234>e&&d>=-.214&&-.115>d?h:f).invert(a)},a.stream=function(a){var b=f.stream(a),c=g.stream(a),d=h.stream(a);return{point:function(a,e){b.point(a,e),c.point(a,e),d.point(a,e)},sphere:function(){b.sphere(),c.sphere(),d.sphere()},lineStart:function(){b.lineStart(),c.lineStart(),d.lineStart()},lineEnd:function(){b.lineEnd(),c.lineEnd(),d.lineEnd()},polygonStart:function(){b.polygonStart(),c.polygonStart(),d.polygonStart()},polygonEnd:function(){b.polygonEnd(),c.polygonEnd(),d.polygonEnd()}}},a.precision=function(b){return arguments.length?(f.precision(b),g.precision(b),h.precision(b),a):f.precision()},a.scale=function(b){return arguments.length?(f.scale(b),g.scale(.35*b),h.scale(b),a.translate(f.translate())):f.scale()},a.translate=function(b){if(!arguments.length)return f.translate();var j=f.scale(),k=+b[0],l=+b[1];return c=f.translate(b).clipExtent([[k-.455*j,l-.238*j],[k+.455*j,l+.238*j]]).stream(i).point,d=g.translate([k-.307*j,l+.201*j]).clipExtent([[k-.425*j+Eh,l+.12*j+Eh],[k-.214*j-Eh,l+.234*j-Eh]]).stream(i).point,e=h.translate([k-.205*j,l+.212*j]).clipExtent([[k-.214*j+Eh,l+.166*j+Eh],[k-.115*j-Eh,l+.234*j-Eh]]).stream(i).point,a},a.scale(1070)};var Fi,Gi,Hi,Ii,Ji,Ki,Li={point:t,lineStart:t,lineEnd:t,polygonStart:function(){Gi=0,Li.lineStart=Uc},polygonEnd:function(){Li.lineStart=Li.lineEnd=Li.point=t,Fi+=jh(Gi/2)}},Mi={point:Vc,lineStart:t,lineEnd:t,polygonStart:t,polygonEnd:t},Ni={point:Yc,lineStart:Zc,lineEnd:$c,polygonStart:function(){Ni.lineStart=_c},polygonEnd:function(){Ni.point=Yc,Ni.lineStart=Zc,Ni.lineEnd=$c}};Xg.geo.path=function(){function a(a){return a&&("function"==typeof h&&f.pointRadius(+h.apply(this,arguments)),g&&g.valid||(g=e(f)),Xg.geo.stream(a,g)),f.result()}function b(){return g=null,a}var c,d,e,f,g,h=4.5;return a.area=function(a){return Fi=0,Xg.geo.stream(a,e(Li)),Fi},a.centroid=function(a){return ti=ui=vi=wi=xi=yi=zi=Ai=Bi=0,Xg.geo.stream(a,e(Ni)),Bi?[zi/Bi,Ai/Bi]:yi?[wi/yi,xi/yi]:vi?[ti/vi,ui/vi]:[0/0,0/0]},a.bounds=function(a){return Ji=Ki=-(Hi=Ii=1/0),Xg.geo.stream(a,e(Mi)),[[Hi,Ii],[Ji,Ki]]},a.projection=function(a){return arguments.length?(e=(c=a)?a.stream||cd(a):Bb,b()):c},a.context=function(a){return arguments.length?(f=null==(d=a)?new Wc:new ad(a),"function"!=typeof h&&f.pointRadius(h),b()):d},a.pointRadius=function(b){return arguments.length?(h="function"==typeof b?b:(f.pointRadius(+b),+b),a):h},a.projection(Xg.geo.albersUsa()).context(null)},Xg.geo.transform=function(a){return{stream:function(b){var c=new dd(b);for(var d in a)c[d]=a[d];return c}}},dd.prototype={point:function(a,b){this.stream.point(a,b)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Xg.geo.projection=fd,Xg.geo.projectionMutator=gd,(Xg.geo.equirectangular=function(){return fd(id)}).raw=id.invert=id,Xg.geo.rotation=function(a){function b(b){return b=a(b[0]*Gh,b[1]*Gh),b[0]*=Hh,b[1]*=Hh,b}return a=kd(a[0]%360*Gh,a[1]*Gh,a.length>2?a[2]*Gh:0),b.invert=function(b){return b=a.invert(b[0]*Gh,b[1]*Gh),b[0]*=Hh,b[1]*=Hh,b},b},jd.invert=id,Xg.geo.circle=function(){function a(){var a="function"==typeof d?d.apply(this,arguments):d,b=kd(-a[0]*Gh,-a[1]*Gh,0).invert,e=[];return c(null,null,1,{point:function(a,c){e.push(a=b(a,c)),a[0]*=Hh,a[1]*=Hh}}),{type:"Polygon",coordinates:[e]}}var b,c,d=[0,0],e=6;return a.origin=function(b){return arguments.length?(d=b,a):d},a.angle=function(d){return arguments.length?(c=od((b=+d)*Gh,e*Gh),a):b},a.precision=function(d){return arguments.length?(c=od(b*Gh,(e=+d)*Gh),a):e},a.angle(90)},Xg.geo.distance=function(a,b){var c,d=(b[0]-a[0])*Gh,e=a[1]*Gh,f=b[1]*Gh,g=Math.sin(d),h=Math.cos(d),i=Math.sin(e),j=Math.cos(e),k=Math.sin(f),l=Math.cos(f);return Math.atan2(Math.sqrt((c=l*g)*c+(c=j*k-i*l*h)*c),i*k+j*l*h)},Xg.geo.graticule=function(){function a(){return{type:"MultiLineString",coordinates:b()}}function b(){return Xg.range(Math.ceil(f/q)*q,e,q).map(m).concat(Xg.range(Math.ceil(j/r)*r,i,r).map(n)).concat(Xg.range(Math.ceil(d/o)*o,c,o).filter(function(a){return jh(a%q)>Eh}).map(k)).concat(Xg.range(Math.ceil(h/p)*p,g,p).filter(function(a){return jh(a%r)>Eh}).map(l))}var c,d,e,f,g,h,i,j,k,l,m,n,o=10,p=o,q=90,r=360,s=2.5;return a.lines=function(){return b().map(function(a){return{type:"LineString",coordinates:a}})},a.outline=function(){return{type:"Polygon",coordinates:[m(f).concat(n(i).slice(1),m(e).reverse().slice(1),n(j).reverse().slice(1))]}},a.extent=function(b){return arguments.length?a.majorExtent(b).minorExtent(b):a.minorExtent()},a.majorExtent=function(b){return arguments.length?(f=+b[0][0],e=+b[1][0],j=+b[0][1],i=+b[1][1],f>e&&(b=f,f=e,e=b),j>i&&(b=j,j=i,i=b),a.precision(s)):[[f,j],[e,i]]},a.minorExtent=function(b){return arguments.length?(d=+b[0][0],c=+b[1][0],h=+b[0][1],g=+b[1][1],d>c&&(b=d,d=c,c=b),h>g&&(b=h,h=g,g=b),a.precision(s)):[[d,h],[c,g]]},a.step=function(b){return arguments.length?a.majorStep(b).minorStep(b):a.minorStep()},a.majorStep=function(b){return arguments.length?(q=+b[0],r=+b[1],a):[q,r]},a.minorStep=function(b){return arguments.length?(o=+b[0],p=+b[1],a):[o,p]},a.precision=function(b){return arguments.length?(s=+b,k=qd(h,g,90),l=rd(d,c,s),m=qd(j,i,90),n=rd(f,e,s),a):s},a.majorExtent([[-180,-90+Eh],[180,90-Eh]]).minorExtent([[-180,-80-Eh],[180,80+Eh]])},Xg.geo.greatArc=function(){function a(){return{type:"LineString",coordinates:[b||d.apply(this,arguments),c||e.apply(this,arguments)]}}var b,c,d=sd,e=td;return a.distance=function(){return Xg.geo.distance(b||d.apply(this,arguments),c||e.apply(this,arguments))},a.source=function(c){return arguments.length?(d=c,b="function"==typeof c?null:c,a):d},a.target=function(b){return arguments.length?(e=b,c="function"==typeof b?null:b,a):e},a.precision=function(){return arguments.length?a:0},a},Xg.geo.interpolate=function(a,b){return ud(a[0]*Gh,a[1]*Gh,b[0]*Gh,b[1]*Gh)},Xg.geo.length=function(a){return Oi=0,Xg.geo.stream(a,Pi),Oi};var Oi,Pi={sphere:t,point:t,lineStart:vd,lineEnd:t,polygonStart:t,polygonEnd:t},Qi=wd(function(a){return Math.sqrt(2/(1+a))},function(a){return 2*Math.asin(a/2)});(Xg.geo.azimuthalEqualArea=function(){return fd(Qi)}).raw=Qi;var Ri=wd(function(a){var b=Math.acos(a);return b&&b/Math.sin(b)},Bb);(Xg.geo.azimuthalEquidistant=function(){return fd(Ri)}).raw=Ri,(Xg.geo.conicConformal=function(){return Sc(xd)}).raw=xd,(Xg.geo.conicEquidistant=function(){return Sc(yd)}).raw=yd;var Si=wd(function(a){return 1/a},Math.atan);(Xg.geo.gnomonic=function(){return fd(Si)}).raw=Si,zd.invert=function(a,b){return[a,2*Math.atan(Math.exp(b))-Dh]},(Xg.geo.mercator=function(){return Ad(zd)}).raw=zd;var Ti=wd(function(){return 1},Math.asin);(Xg.geo.orthographic=function(){return fd(Ti)}).raw=Ti;var Ui=wd(function(a){return 1/(1+a)},function(a){return 2*Math.atan(a)});(Xg.geo.stereographic=function(){return fd(Ui)}).raw=Ui,Bd.invert=function(a,b){return[-b,2*Math.atan(Math.exp(a))-Dh]},(Xg.geo.transverseMercator=function(){var a=Ad(Bd),b=a.center,c=a.rotate;return a.center=function(a){return a?b([-a[1],a[0]]):(a=b(),[a[1],-a[0]])},a.rotate=function(a){return a?c([a[0],a[1],a.length>2?a[2]+90:90]):(a=c(),[a[0],a[1],a[2]-90])},c([0,0,90])}).raw=Bd,Xg.geom={},Xg.geom.hull=function(a){function b(a){if(a.length<3)return[];var b,e=Ab(c),f=Ab(d),g=a.length,h=[],i=[];for(b=0;g>b;b++)h.push([+e.call(this,a[b],b),+f.call(this,a[b],b),b]);for(h.sort(Fd),b=0;g>b;b++)i.push([h[b][0],-h[b][1]]);var j=Ed(h),k=Ed(i),l=k[0]===j[0],m=k[k.length-1]===j[j.length-1],n=[];for(b=j.length-1;b>=0;--b)n.push(a[h[j[b]][2]]);for(b=+l;b<k.length-m;++b)n.push(a[h[k[b]][2]]);return n}var c=Cd,d=Dd;return arguments.length?b(a):(b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b)},Xg.geom.polygon=function(a){return oh(a,Vi),a};var Vi=Xg.geom.polygon.prototype=[];Vi.area=function(){for(var a,b=-1,c=this.length,d=this[c-1],e=0;++b<c;)a=d,d=this[b],e+=a[1]*d[0]-a[0]*d[1];return.5*e},Vi.centroid=function(a){var b,c,d=-1,e=this.length,f=0,g=0,h=this[e-1];for(arguments.length||(a=-1/(6*this.area()));++d<e;)b=h,h=this[d],c=b[0]*h[1]-h[0]*b[1],f+=(b[0]+h[0])*c,g+=(b[1]+h[1])*c;return[f*a,g*a]},Vi.clip=function(a){for(var b,c,d,e,f,g,h=Id(a),i=-1,j=this.length-Id(this),k=this[j-1];++i<j;){for(b=a.slice(),a.length=0,e=this[i],f=b[(d=b.length-h)-1],c=-1;++c<d;)g=b[c],Gd(g,k,e)?(Gd(f,k,e)||a.push(Hd(f,g,k,e)),a.push(g)):Gd(f,k,e)&&a.push(Hd(f,g,k,e)),f=g;h&&a.push(a[0]),k=e}return a};var Wi,Xi,Yi,Zi,$i,_i=[],aj=[];Qd.prototype.prepare=function(){for(var a,b=this.edges,c=b.length;c--;)a=b[c].edge,a.b&&a.a||b.splice(c,1);return b.sort(Sd),b.length},ae.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},be.prototype={insert:function(a,b){var c,d,e;if(a){if(b.P=a,b.N=a.N,a.N&&(a.N.P=b),a.N=b,a.R){for(a=a.R;a.L;)a=a.L;a.L=b}else a.R=b;c=a}else this._?(a=fe(this._),b.P=null,b.N=a,a.P=a.L=b,c=a):(b.P=b.N=null,this._=b,c=null);for(b.L=b.R=null,b.U=c,b.C=!0,a=b;c&&c.C;)d=c.U,c===d.L?(e=d.R,e&&e.C?(c.C=e.C=!1,d.C=!0,a=d):(a===c.R&&(de(this,c),a=c,c=a.U),c.C=!1,d.C=!0,ee(this,d))):(e=d.L,e&&e.C?(c.C=e.C=!1,d.C=!0,a=d):(a===c.L&&(ee(this,c),a=c,c=a.U),c.C=!1,d.C=!0,de(this,d))),c=a.U;this._.C=!1},remove:function(a){a.N&&(a.N.P=a.P),a.P&&(a.P.N=a.N),a.N=a.P=null;var b,c,d,e=a.U,f=a.L,g=a.R;if(c=f?g?fe(g):f:g,e?e.L===a?e.L=c:e.R=c:this._=c,f&&g?(d=c.C,c.C=a.C,c.L=f,f.U=c,c!==g?(e=c.U,c.U=a.U,a=c.R,e.L=a,c.R=g,g.U=c):(c.U=e,e=c,a=c.R)):(d=a.C,a=c),a&&(a.U=e),!d){if(a&&a.C)return void(a.C=!1);do{if(a===this._)break;if(a===e.L){if(b=e.R,b.C&&(b.C=!1,e.C=!0,de(this,e),b=e.R),b.L&&b.L.C||b.R&&b.R.C){b.R&&b.R.C||(b.L.C=!1,b.C=!0,ee(this,b),b=e.R),b.C=e.C,e.C=b.R.C=!1,de(this,e),a=this._;break}}else if(b=e.L,b.C&&(b.C=!1,e.C=!0,ee(this,e),b=e.L),b.L&&b.L.C||b.R&&b.R.C){b.L&&b.L.C||(b.R.C=!1,b.C=!0,de(this,b),b=e.L),b.C=e.C,e.C=b.L.C=!1,ee(this,e),a=this._;break}b.C=!0,a=e,e=e.U}while(!a.C);a&&(a.C=!1)}}},Xg.geom.voronoi=function(a){function b(a){var b=new Array(a.length),d=h[0][0],e=h[0][1],f=h[1][0],g=h[1][1];return ge(c(a),h).cells.forEach(function(c,h){var i=c.edges,j=c.site,k=b[h]=i.length?i.map(function(a){var b=a.start();return[b.x,b.y]}):j.x>=d&&j.x<=f&&j.y>=e&&j.y<=g?[[d,g],[f,g],[f,e],[d,e]]:[];k.point=a[h]}),b}function c(a){return a.map(function(a,b){return{x:Math.round(f(a,b)/Eh)*Eh,y:Math.round(g(a,b)/Eh)*Eh,i:b}})}var d=Cd,e=Dd,f=d,g=e,h=bj;return a?b(a):(b.links=function(a){return ge(c(a)).edges.filter(function(a){return a.l&&a.r}).map(function(b){return{source:a[b.l.i],target:a[b.r.i]}})},b.triangles=function(a){var b=[];return ge(c(a)).cells.forEach(function(c,d){for(var e,f,g=c.site,h=c.edges.sort(Sd),i=-1,j=h.length,k=h[j-1].edge,l=k.l===g?k.r:k.l;++i<j;)e=k,f=l,k=h[i].edge,l=k.l===g?k.r:k.l,d<f.i&&d<l.i&&ie(g,f,l)<0&&b.push([a[d],a[f.i],a[l.i]])}),b},b.x=function(a){return arguments.length?(f=Ab(d=a),b):d},b.y=function(a){return arguments.length?(g=Ab(e=a),b):e},b.clipExtent=function(a){return arguments.length?(h=null==a?bj:a,b):h===bj?null:h},b.size=function(a){return arguments.length?b.clipExtent(a&&[[0,0],a]):h===bj?null:h&&h[1]},b)};var bj=[[-1e6,-1e6],[1e6,1e6]];Xg.geom.delaunay=function(a){return Xg.geom.voronoi().triangles(a)},Xg.geom.quadtree=function(a,b,c,d,e){function f(a){function f(a,b,c,d,e,f,g,h){if(!isNaN(c)&&!isNaN(d))if(a.leaf){var i=a.x,k=a.y;if(null!=i)if(jh(i-c)+jh(k-d)<.01)j(a,b,c,d,e,f,g,h);else{var l=a.point;a.x=a.y=a.point=null,j(a,l,i,k,e,f,g,h),j(a,b,c,d,e,f,g,h)}else a.x=c,a.y=d,a.point=b}else j(a,b,c,d,e,f,g,h)}function j(a,b,c,d,e,g,h,i){var j=.5*(e+h),k=.5*(g+i),l=c>=j,m=d>=k,n=(m<<1)+l;a.leaf=!1,a=a.nodes[n]||(a.nodes[n]=le()),l?e=j:h=j,m?g=k:i=k,f(a,b,c,d,e,g,h,i)}var k,l,m,n,o,p,q,r,s,t=Ab(h),u=Ab(i);if(null!=b)p=b,q=c,r=d,s=e;else if(r=s=-(p=q=1/0),l=[],m=[],o=a.length,g)for(n=0;o>n;++n)k=a[n],k.x<p&&(p=k.x),k.y<q&&(q=k.y),k.x>r&&(r=k.x),k.y>s&&(s=k.y),l.push(k.x),m.push(k.y);else for(n=0;o>n;++n){var v=+t(k=a[n],n),w=+u(k,n);p>v&&(p=v),q>w&&(q=w),v>r&&(r=v),w>s&&(s=w),l.push(v),m.push(w)}var x=r-p,y=s-q;x>y?s=q+x:r=p+y;var z=le();if(z.add=function(a){f(z,a,+t(a,++n),+u(a,n),p,q,r,s)},z.visit=function(a){me(a,z,p,q,r,s)},n=-1,null==b){for(;++n<o;)f(z,a[n],l[n],m[n],p,q,r,s);--n}else a.forEach(z.add);return l=m=a=k=null,z}var g,h=Cd,i=Dd;return(g=arguments.length)?(h=je,i=ke,3===g&&(e=c,d=b,c=b=0),f(a)):(f.x=function(a){return arguments.length?(h=a,f):h},f.y=function(a){return arguments.length?(i=a,f):i},f.extent=function(a){return arguments.length?(null==a?b=c=d=e=null:(b=+a[0][0],c=+a[0][1],d=+a[1][0],e=+a[1][1]),f):null==b?null:[[b,c],[d,e]]},f.size=function(a){return arguments.length?(null==a?b=c=d=e=null:(b=c=0,d=+a[0],e=+a[1]),f):null==b?null:[d-b,e-c]},f)},Xg.interpolateRgb=ne,Xg.interpolateObject=oe,Xg.interpolateNumber=pe,Xg.interpolateString=qe;var cj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dj=new RegExp(cj.source,"g");Xg.interpolate=re,Xg.interpolators=[function(a,b){var c=typeof b;return("string"===c?Wh.has(b)||/^(#|rgb\(|hsl\()/.test(b)?ne:qe:b instanceof gb?ne:Array.isArray(b)?se:"object"===c&&isNaN(b)?oe:pe)(a,b)}],Xg.interpolateArray=se;var ej=function(){return Bb},fj=Xg.map({linear:ej,poly:ze,quad:function(){return we},cubic:function(){return xe},sin:function(){return Ae},exp:function(){return Be},circle:function(){return Ce},elastic:De,back:Ee,bounce:function(){return Fe}}),gj=Xg.map({"in":Bb,out:ue,"in-out":ve,"out-in":function(a){return ve(ue(a))}});Xg.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.slice(0,b):a,d=b>=0?a.slice(b+1):"in";return c=fj.get(c)||ej,d=gj.get(d)||Bb,te(d(c.apply(null,Yg.call(arguments,1))))},Xg.interpolateHcl=Ge,Xg.interpolateHsl=He,Xg.interpolateLab=Ie,Xg.interpolateRound=Je,Xg.transform=function(a){var b=$g.createElementNS(Xg.ns.prefix.svg,"g");return(Xg.transform=function(a){if(null!=a){b.setAttribute("transform",a);var c=b.transform.baseVal.consolidate()}return new Ke(c?c.matrix:hj)})(a)},Ke.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"
|
||
};var hj={a:1,b:0,c:0,d:1,e:0,f:0};Xg.interpolateTransform=Oe,Xg.layout={},Xg.layout.bundle=function(){return function(a){for(var b=[],c=-1,d=a.length;++c<d;)b.push(Re(a[c]));return b}},Xg.layout.chord=function(){function a(){var a,j,l,m,n,o={},p=[],q=Xg.range(f),r=[];for(c=[],d=[],a=0,m=-1;++m<f;){for(j=0,n=-1;++n<f;)j+=e[m][n];p.push(j),r.push(Xg.range(f)),a+=j}for(g&&q.sort(function(a,b){return g(p[a],p[b])}),h&&r.forEach(function(a,b){a.sort(function(a,c){return h(e[b][a],e[b][c])})}),a=(Ch-k*f)/a,j=0,m=-1;++m<f;){for(l=j,n=-1;++n<f;){var s=q[m],t=r[s][n],u=e[s][t],v=j,w=j+=u*a;o[s+"-"+t]={index:s,subindex:t,startAngle:v,endAngle:w,value:u}}d[s]={index:s,startAngle:l,endAngle:j,value:(j-l)/a},j+=k}for(m=-1;++m<f;)for(n=m-1;++n<f;){var x=o[m+"-"+n],y=o[n+"-"+m];(x.value||y.value)&&c.push(x.value<y.value?{source:y,target:x}:{source:x,target:y})}i&&b()}function b(){c.sort(function(a,b){return i((a.source.value+a.target.value)/2,(b.source.value+b.target.value)/2)})}var c,d,e,f,g,h,i,j={},k=0;return j.matrix=function(a){return arguments.length?(f=(e=a)&&e.length,c=d=null,j):e},j.padding=function(a){return arguments.length?(k=a,c=d=null,j):k},j.sortGroups=function(a){return arguments.length?(g=a,c=d=null,j):g},j.sortSubgroups=function(a){return arguments.length?(h=a,c=null,j):h},j.sortChords=function(a){return arguments.length?(i=a,c&&b(),j):i},j.chords=function(){return c||a(),c},j.groups=function(){return d||a(),d},j},Xg.layout.force=function(){function a(a){return function(b,c,d,e){if(b.point!==a){var f=b.cx-a.x,g=b.cy-a.y,h=e-c,i=f*f+g*g;if(i>h*h/q){if(o>i){var j=b.charge/i;a.px-=f*j,a.py-=g*j}return!0}if(b.point&&i&&o>i){var j=b.pointCharge/i;a.px-=f*j,a.py-=g*j}}return!b.charge}}function b(a){a.px=Xg.event.x,a.py=Xg.event.y,h.resume()}var c,d,e,f,g,h={},i=Xg.dispatch("start","tick","end"),j=[1,1],k=.9,l=ij,m=jj,n=-30,o=kj,p=.1,q=.64,r=[],s=[];return h.tick=function(){if((d*=.99)<.005)return i.end({type:"end",alpha:d=0}),!0;var b,c,h,l,m,o,q,t,u,v=r.length,w=s.length;for(c=0;w>c;++c)h=s[c],l=h.source,m=h.target,t=m.x-l.x,u=m.y-l.y,(o=t*t+u*u)&&(o=d*f[c]*((o=Math.sqrt(o))-e[c])/o,t*=o,u*=o,m.x-=t*(q=l.weight/(m.weight+l.weight)),m.y-=u*q,l.x+=t*(q=1-q),l.y+=u*q);if((q=d*p)&&(t=j[0]/2,u=j[1]/2,c=-1,q))for(;++c<v;)h=r[c],h.x+=(t-h.x)*q,h.y+=(u-h.y)*q;if(n)for(Ye(b=Xg.geom.quadtree(r),d,g),c=-1;++c<v;)(h=r[c]).fixed||b.visit(a(h));for(c=-1;++c<v;)h=r[c],h.fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*k,h.y-=(h.py-(h.py=h.y))*k);i.tick({type:"tick",alpha:d})},h.nodes=function(a){return arguments.length?(r=a,h):r},h.links=function(a){return arguments.length?(s=a,h):s},h.size=function(a){return arguments.length?(j=a,h):j},h.linkDistance=function(a){return arguments.length?(l="function"==typeof a?a:+a,h):l},h.distance=h.linkDistance,h.linkStrength=function(a){return arguments.length?(m="function"==typeof a?a:+a,h):m},h.friction=function(a){return arguments.length?(k=+a,h):k},h.charge=function(a){return arguments.length?(n="function"==typeof a?a:+a,h):n},h.chargeDistance=function(a){return arguments.length?(o=a*a,h):Math.sqrt(o)},h.gravity=function(a){return arguments.length?(p=+a,h):p},h.theta=function(a){return arguments.length?(q=a*a,h):Math.sqrt(q)},h.alpha=function(a){return arguments.length?(a=+a,d?d=a>0?a:0:a>0&&(i.start({type:"start",alpha:d=a}),Xg.timer(h.tick)),h):d},h.start=function(){function a(a,d){if(!c){for(c=new Array(i),h=0;i>h;++h)c[h]=[];for(h=0;j>h;++h){var e=s[h];c[e.source.index].push(e.target),c[e.target.index].push(e.source)}}for(var f,g=c[b],h=-1,j=g.length;++h<j;)if(!isNaN(f=g[h][a]))return f;return Math.random()*d}var b,c,d,i=r.length,k=s.length,o=j[0],p=j[1];for(b=0;i>b;++b)(d=r[b]).index=b,d.weight=0;for(b=0;k>b;++b)d=s[b],"number"==typeof d.source&&(d.source=r[d.source]),"number"==typeof d.target&&(d.target=r[d.target]),++d.source.weight,++d.target.weight;for(b=0;i>b;++b)d=r[b],isNaN(d.x)&&(d.x=a("x",o)),isNaN(d.y)&&(d.y=a("y",p)),isNaN(d.px)&&(d.px=d.x),isNaN(d.py)&&(d.py=d.y);if(e=[],"function"==typeof l)for(b=0;k>b;++b)e[b]=+l.call(this,s[b],b);else for(b=0;k>b;++b)e[b]=l;if(f=[],"function"==typeof m)for(b=0;k>b;++b)f[b]=+m.call(this,s[b],b);else for(b=0;k>b;++b)f[b]=m;if(g=[],"function"==typeof n)for(b=0;i>b;++b)g[b]=+n.call(this,r[b],b);else for(b=0;i>b;++b)g[b]=n;return h.resume()},h.resume=function(){return h.alpha(.1)},h.stop=function(){return h.alpha(0)},h.drag=function(){return c||(c=Xg.behavior.drag().origin(Bb).on("dragstart.force",Ue).on("drag.force",b).on("dragend.force",Ve)),arguments.length?void this.on("mouseover.force",We).on("mouseout.force",Xe).call(c):c},Xg.rebind(h,i,"on")};var ij=20,jj=1,kj=1/0;Xg.layout.hierarchy=function(){function a(e){var f,g=[e],h=[];for(e.depth=0;null!=(f=g.pop());)if(h.push(f),(j=c.call(a,f,f.depth))&&(i=j.length)){for(var i,j,k;--i>=0;)g.push(k=j[i]),k.parent=f,k.depth=f.depth+1;d&&(f.value=0),f.children=j}else d&&(f.value=+d.call(a,f,f.depth)||0),delete f.children;return _e(e,function(a){var c,e;b&&(c=a.children)&&c.sort(b),d&&(e=a.parent)&&(e.value+=a.value)}),h}var b=cf,c=af,d=bf;return a.sort=function(c){return arguments.length?(b=c,a):b},a.children=function(b){return arguments.length?(c=b,a):c},a.value=function(b){return arguments.length?(d=b,a):d},a.revalue=function(b){return d&&($e(b,function(a){a.children&&(a.value=0)}),_e(b,function(b){var c;b.children||(b.value=+d.call(a,b,b.depth)||0),(c=b.parent)&&(c.value+=b.value)})),b},a},Xg.layout.partition=function(){function a(b,c,d,e){var f=b.children;if(b.x=c,b.y=b.depth*e,b.dx=d,b.dy=e,f&&(g=f.length)){var g,h,i,j=-1;for(d=b.value?d/b.value:0;++j<g;)a(h=f[j],c,i=h.value*d,e),c+=i}}function b(a){var c=a.children,d=0;if(c&&(e=c.length))for(var e,f=-1;++f<e;)d=Math.max(d,b(c[f]));return 1+d}function c(c,f){var g=d.call(this,c,f);return a(g[0],0,e[0],e[1]/b(g[0])),g}var d=Xg.layout.hierarchy(),e=[1,1];return c.size=function(a){return arguments.length?(e=a,c):e},Ze(c,d)},Xg.layout.pie=function(){function a(f){var g=f.map(function(c,d){return+b.call(a,c,d)}),h=+("function"==typeof d?d.apply(this,arguments):d),i=(("function"==typeof e?e.apply(this,arguments):e)-h)/Xg.sum(g),j=Xg.range(f.length);null!=c&&j.sort(c===lj?function(a,b){return g[b]-g[a]}:function(a,b){return c(f[a],f[b])});var k=[];return j.forEach(function(a){var b;k[a]={data:f[a],value:b=g[a],startAngle:h,endAngle:h+=b*i}}),k}var b=Number,c=lj,d=0,e=Ch;return a.value=function(c){return arguments.length?(b=c,a):b},a.sort=function(b){return arguments.length?(c=b,a):c},a.startAngle=function(b){return arguments.length?(d=b,a):d},a.endAngle=function(b){return arguments.length?(e=b,a):e},a};var lj={};Xg.layout.stack=function(){function a(h,i){if(!(m=h.length))return h;var j=h.map(function(c,d){return b.call(a,c,d)}),k=j.map(function(b){return b.map(function(b,c){return[f.call(a,b,c),g.call(a,b,c)]})}),l=c.call(a,k,i);j=Xg.permute(j,l),k=Xg.permute(k,l);var m,n,o,p,q=d.call(a,k,i),r=j[0].length;for(o=0;r>o;++o)for(e.call(a,j[0][o],p=q[o],k[0][o][1]),n=1;m>n;++n)e.call(a,j[n][o],p+=k[n-1][o][1],k[n][o][1]);return h}var b=Bb,c=hf,d=jf,e=gf,f=ef,g=ff;return a.values=function(c){return arguments.length?(b=c,a):b},a.order=function(b){return arguments.length?(c="function"==typeof b?b:mj.get(b)||hf,a):c},a.offset=function(b){return arguments.length?(d="function"==typeof b?b:nj.get(b)||jf,a):d},a.x=function(b){return arguments.length?(f=b,a):f},a.y=function(b){return arguments.length?(g=b,a):g},a.out=function(b){return arguments.length?(e=b,a):e},a};var mj=Xg.map({"inside-out":function(a){var b,c,d=a.length,e=a.map(kf),f=a.map(lf),g=Xg.range(d).sort(function(a,b){return e[a]-e[b]}),h=0,i=0,j=[],k=[];for(b=0;d>b;++b)c=g[b],i>h?(h+=f[c],j.push(c)):(i+=f[c],k.push(c));return k.reverse().concat(j)},reverse:function(a){return Xg.range(a.length).reverse()},"default":hf}),nj=Xg.map({silhouette:function(a){var b,c,d,e=a.length,f=a[0].length,g=[],h=0,i=[];for(c=0;f>c;++c){for(b=0,d=0;e>b;b++)d+=a[b][c][1];d>h&&(h=d),g.push(d)}for(c=0;f>c;++c)i[c]=(h-g[c])/2;return i},wiggle:function(a){var b,c,d,e,f,g,h,i,j,k=a.length,l=a[0],m=l.length,n=[];for(n[0]=i=j=0,c=1;m>c;++c){for(b=0,e=0;k>b;++b)e+=a[b][c][1];for(b=0,f=0,h=l[c][0]-l[c-1][0];k>b;++b){for(d=0,g=(a[b][c][1]-a[b][c-1][1])/(2*h);b>d;++d)g+=(a[d][c][1]-a[d][c-1][1])/h;f+=g*a[b][c][1]}n[c]=i-=e?f/e*h:0,j>i&&(j=i)}for(c=0;m>c;++c)n[c]-=j;return n},expand:function(a){var b,c,d,e=a.length,f=a[0].length,g=1/e,h=[];for(c=0;f>c;++c){for(b=0,d=0;e>b;b++)d+=a[b][c][1];if(d)for(b=0;e>b;b++)a[b][c][1]/=d;else for(b=0;e>b;b++)a[b][c][1]=g}for(c=0;f>c;++c)h[c]=0;return h},zero:jf});Xg.layout.histogram=function(){function a(a,f){for(var g,h,i=[],j=a.map(c,this),k=d.call(this,j,f),l=e.call(this,k,j,f),f=-1,m=j.length,n=l.length-1,o=b?1:1/m;++f<n;)g=i[f]=[],g.dx=l[f+1]-(g.x=l[f]),g.y=0;if(n>0)for(f=-1;++f<m;)h=j[f],h>=k[0]&&h<=k[1]&&(g=i[Xg.bisect(l,h,1,n)-1],g.y+=o,g.push(a[f]));return i}var b=!0,c=Number,d=pf,e=nf;return a.value=function(b){return arguments.length?(c=b,a):c},a.range=function(b){return arguments.length?(d=Ab(b),a):d},a.bins=function(b){return arguments.length?(e="number"==typeof b?function(a){return of(a,b)}:Ab(b),a):e},a.frequency=function(c){return arguments.length?(b=!!c,a):b},a},Xg.layout.pack=function(){function a(a,f){var g=c.call(this,a,f),h=g[0],i=e[0],j=e[1],k=null==b?Math.sqrt:"function"==typeof b?b:function(){return b};if(h.x=h.y=0,_e(h,function(a){a.r=+k(a.value)}),_e(h,uf),d){var l=d*(b?1:Math.max(2*h.r/i,2*h.r/j))/2;_e(h,function(a){a.r+=l}),_e(h,uf),_e(h,function(a){a.r-=l})}return xf(h,i/2,j/2,b?1:1/Math.max(2*h.r/i,2*h.r/j)),g}var b,c=Xg.layout.hierarchy().sort(qf),d=0,e=[1,1];return a.size=function(b){return arguments.length?(e=b,a):e},a.radius=function(c){return arguments.length?(b=null==c||"function"==typeof c?c:+c,a):b},a.padding=function(b){return arguments.length?(d=+b,a):d},Ze(a,c)},Xg.layout.tree=function(){function a(a,e){var k=g.call(this,a,e),l=k[0],m=b(l);if(_e(m,c),m.parent.m=-m.z,$e(m,d),j)$e(l,f);else{var n=l,o=l,p=l;$e(l,function(a){a.x<n.x&&(n=a),a.x>o.x&&(o=a),a.depth>p.depth&&(p=a)});var q=h(n,o)/2-n.x,r=i[0]/(o.x+h(o,n)/2+q),s=i[1]/(p.depth||1);$e(l,function(a){a.x=(a.x+q)*r,a.y=a.depth*s})}return k}function b(a){for(var b,c={A:null,children:[a]},d=[c];null!=(b=d.pop());)for(var e,f=b.children,g=0,h=f.length;h>g;++g)d.push((f[g]=e={_:f[g],parent:b,children:(e=f[g].children)&&e.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:g}).a=e);return c.children[0]}function c(a){var b=a.children,c=a.parent.children,d=a.i?c[a.i-1]:null;if(b.length){Df(a);var f=(b[0].z+b[b.length-1].z)/2;d?(a.z=d.z+h(a._,d._),a.m=a.z-f):a.z=f}else d&&(a.z=d.z+h(a._,d._));a.parent.A=e(a,d,a.parent.A||c[0])}function d(a){a._.x=a.z+a.parent.m,a.m+=a.parent.m}function e(a,b,c){if(b){for(var d,e=a,f=a,g=b,i=e.parent.children[0],j=e.m,k=f.m,l=g.m,m=i.m;g=Bf(g),e=Af(e),g&&e;)i=Af(i),f=Bf(f),f.a=a,d=g.z+l-e.z-j+h(g._,e._),d>0&&(Cf(Ef(g,a,c),a,d),j+=d,k+=d),l+=g.m,j+=e.m,m+=i.m,k+=f.m;g&&!Bf(f)&&(f.t=g,f.m+=l-k),e&&!Af(i)&&(i.t=e,i.m+=j-m,c=a)}return c}function f(a){a.x*=i[0],a.y=a.depth*i[1]}var g=Xg.layout.hierarchy().sort(null).value(null),h=zf,i=[1,1],j=null;return a.separation=function(b){return arguments.length?(h=b,a):h},a.size=function(b){return arguments.length?(j=null==(i=b)?f:null,a):j?null:i},a.nodeSize=function(b){return arguments.length?(j=null==(i=b)?null:f,a):j?i:null},Ze(a,g)},Xg.layout.cluster=function(){function a(a,f){var g,h=b.call(this,a,f),i=h[0],j=0;_e(i,function(a){var b=a.children;b&&b.length?(a.x=Gf(b),a.y=Ff(b)):(a.x=g?j+=c(a,g):0,a.y=0,g=a)});var k=Hf(i),l=If(i),m=k.x-c(k,l)/2,n=l.x+c(l,k)/2;return _e(i,e?function(a){a.x=(a.x-i.x)*d[0],a.y=(i.y-a.y)*d[1]}:function(a){a.x=(a.x-m)/(n-m)*d[0],a.y=(1-(i.y?a.y/i.y:1))*d[1]}),h}var b=Xg.layout.hierarchy().sort(null).value(null),c=zf,d=[1,1],e=!1;return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(e=null==(d=b),a):e?null:d},a.nodeSize=function(b){return arguments.length?(e=null!=(d=b),a):e?d:null},Ze(a,b)},Xg.layout.treemap=function(){function a(a,b){for(var c,d,e=-1,f=a.length;++e<f;)d=(c=a[e]).value*(0>b?0:b),c.area=isNaN(d)||0>=d?0:d}function b(c){var f=c.children;if(f&&f.length){var g,h,i,j=l(c),k=[],m=f.slice(),o=1/0,p="slice"===n?j.dx:"dice"===n?j.dy:"slice-dice"===n?1&c.depth?j.dy:j.dx:Math.min(j.dx,j.dy);for(a(m,j.dx*j.dy/c.value),k.area=0;(i=m.length)>0;)k.push(g=m[i-1]),k.area+=g.area,"squarify"!==n||(h=d(k,p))<=o?(m.pop(),o=h):(k.area-=k.pop().area,e(k,p,j,!1),p=Math.min(j.dx,j.dy),k.length=k.area=0,o=1/0);k.length&&(e(k,p,j,!0),k.length=k.area=0),f.forEach(b)}}function c(b){var d=b.children;if(d&&d.length){var f,g=l(b),h=d.slice(),i=[];for(a(h,g.dx*g.dy/b.value),i.area=0;f=h.pop();)i.push(f),i.area+=f.area,null!=f.z&&(e(i,f.z?g.dx:g.dy,g,!h.length),i.length=i.area=0);d.forEach(c)}}function d(a,b){for(var c,d=a.area,e=0,f=1/0,g=-1,h=a.length;++g<h;)(c=a[g].area)&&(f>c&&(f=c),c>e&&(e=c));return d*=d,b*=b,d?Math.max(b*e*o/d,d/(b*f*o)):1/0}function e(a,b,c,d){var e,f=-1,g=a.length,h=c.x,j=c.y,k=b?i(a.area/b):0;if(b==c.dx){for((d||k>c.dy)&&(k=c.dy);++f<g;)e=a[f],e.x=h,e.y=j,e.dy=k,h+=e.dx=Math.min(c.x+c.dx-h,k?i(e.area/k):0);e.z=!0,e.dx+=c.x+c.dx-h,c.y+=k,c.dy-=k}else{for((d||k>c.dx)&&(k=c.dx);++f<g;)e=a[f],e.x=h,e.y=j,e.dx=k,j+=e.dy=Math.min(c.y+c.dy-j,k?i(e.area/k):0);e.z=!1,e.dy+=c.y+c.dy-j,c.x+=k,c.dx-=k}}function f(d){var e=g||h(d),f=e[0];return f.x=0,f.y=0,f.dx=j[0],f.dy=j[1],g&&h.revalue(f),a([f],f.dx*f.dy/f.value),(g?c:b)(f),m&&(g=e),e}var g,h=Xg.layout.hierarchy(),i=Math.round,j=[1,1],k=null,l=Jf,m=!1,n="squarify",o=.5*(1+Math.sqrt(5));return f.size=function(a){return arguments.length?(j=a,f):j},f.padding=function(a){function b(b){var c=a.call(f,b,b.depth);return null==c?Jf(b):Kf(b,"number"==typeof c?[c,c,c,c]:c)}function c(b){return Kf(b,a)}if(!arguments.length)return k;var d;return l=null==(k=a)?Jf:"function"==(d=typeof a)?b:"number"===d?(a=[a,a,a,a],c):c,f},f.round=function(a){return arguments.length?(i=a?Math.round:Number,f):i!=Number},f.sticky=function(a){return arguments.length?(m=a,g=null,f):m},f.ratio=function(a){return arguments.length?(o=a,f):o},f.mode=function(a){return arguments.length?(n=a+"",f):n},Ze(f,h)},Xg.random={normal:function(a,b){var c=arguments.length;return 2>c&&(b=1),1>c&&(a=0),function(){var c,d,e;do c=2*Math.random()-1,d=2*Math.random()-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(){var a=Xg.random.normal.apply(Xg,arguments);return function(){return Math.exp(a())}},bates:function(a){var b=Xg.random.irwinHall(a);return function(){return b()/a}},irwinHall:function(a){return function(){for(var b=0,c=0;a>c;c++)b+=Math.random();return b}}},Xg.scale={};var oj={floor:Bb,ceil:Bb};Xg.scale.linear=function(){return Rf([0,1],[0,1],re,!1)};var pj={s:1,g:1,p:1,r:1,e:1};Xg.scale.log=function(){return Zf(Xg.scale.linear().domain([0,1]),10,!0,[1,10])};var qj=Xg.format(".0e"),rj={floor:function(a){return-Math.ceil(-a)},ceil:function(a){return-Math.floor(-a)}};Xg.scale.pow=function(){return $f(Xg.scale.linear(),1,[0,1])},Xg.scale.sqrt=function(){return Xg.scale.pow().exponent(.5)},Xg.scale.ordinal=function(){return ag([],{t:"range",a:[[]]})},Xg.scale.category10=function(){return Xg.scale.ordinal().range(sj)},Xg.scale.category20=function(){return Xg.scale.ordinal().range(tj)},Xg.scale.category20b=function(){return Xg.scale.ordinal().range(uj)},Xg.scale.category20c=function(){return Xg.scale.ordinal().range(vj)};var sj=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(tb),tj=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(tb),uj=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(tb),vj=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(tb);Xg.scale.quantile=function(){return bg([],[])},Xg.scale.quantize=function(){return cg(0,1,[0,1])},Xg.scale.threshold=function(){return dg([.5],[0,1])},Xg.scale.identity=function(){return eg([0,1])},Xg.svg={},Xg.svg.arc=function(){function a(){var a=b.apply(this,arguments),f=c.apply(this,arguments),g=d.apply(this,arguments)+wj,h=e.apply(this,arguments)+wj,i=(g>h&&(i=g,g=h,h=i),h-g),j=Bh>i?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=xj?a?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+a+"A"+a+","+a+" 0 1,0 0,"+-a+"A"+a+","+a+" 0 1,0 0,"+a+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":a?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+a*m+","+a*n+"A"+a+","+a+" 0 "+j+",0 "+a*k+","+a*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0Z"}var b=fg,c=gg,d=hg,e=ig;return a.innerRadius=function(c){return arguments.length?(b=Ab(c),a):b},a.outerRadius=function(b){return arguments.length?(c=Ab(b),a):c},a.startAngle=function(b){return arguments.length?(d=Ab(b),a):d},a.endAngle=function(b){return arguments.length?(e=Ab(b),a):e},a.centroid=function(){var a=(b.apply(this,arguments)+c.apply(this,arguments))/2,f=(d.apply(this,arguments)+e.apply(this,arguments))/2+wj;return[Math.cos(f)*a,Math.sin(f)*a]},a};var wj=-Dh,xj=Ch-Eh;Xg.svg.line=function(){return jg(Bb)};var yj=Xg.map({linear:kg,"linear-closed":lg,step:mg,"step-before":ng,"step-after":og,basis:ug,"basis-open":vg,"basis-closed":wg,bundle:xg,cardinal:rg,"cardinal-open":pg,"cardinal-closed":qg,monotone:Dg});yj.forEach(function(a,b){b.key=a,b.closed=/-closed$/.test(a)});var zj=[0,2/3,1/3,0],Aj=[0,1/3,2/3,0],Bj=[0,1/6,2/3,1/6];Xg.svg.line.radial=function(){var a=jg(Eg);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},ng.reverse=og,og.reverse=ng,Xg.svg.area=function(){return Fg(Bb)},Xg.svg.area.radial=function(){var a=Fg(Eg);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},Xg.svg.chord=function(){function a(a,h){var i=b(this,f,a,h),j=b(this,g,a,h);return"M"+i.p0+d(i.r,i.p1,i.a1-i.a0)+(c(i,j)?e(i.r,i.p1,i.r,i.p0):e(i.r,i.p1,j.r,j.p0)+d(j.r,j.p1,j.a1-j.a0)+e(j.r,j.p1,i.r,i.p0))+"Z"}function b(a,b,c,d){var e=b.call(a,c,d),f=h.call(a,e,d),g=i.call(a,e,d)+wj,k=j.call(a,e,d)+wj;return{r:f,a0:g,a1:k,p0:[f*Math.cos(g),f*Math.sin(g)],p1:[f*Math.cos(k),f*Math.sin(k)]}}function c(a,b){return a.a0==b.a0&&a.a1==b.a1}function d(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Bh)+",1 "+b}function e(a,b,c,d){return"Q 0,0 "+d}var f=sd,g=td,h=Gg,i=hg,j=ig;return a.radius=function(b){return arguments.length?(h=Ab(b),a):h},a.source=function(b){return arguments.length?(f=Ab(b),a):f},a.target=function(b){return arguments.length?(g=Ab(b),a):g},a.startAngle=function(b){return arguments.length?(i=Ab(b),a):i},a.endAngle=function(b){return arguments.length?(j=Ab(b),a):j},a},Xg.svg.diagonal=function(){function a(a,e){var f=b.call(this,a,e),g=c.call(this,a,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(d),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var b=sd,c=td,d=Hg;return a.source=function(c){return arguments.length?(b=Ab(c),a):b},a.target=function(b){return arguments.length?(c=Ab(b),a):c},a.projection=function(b){return arguments.length?(d=b,a):d},a},Xg.svg.diagonal.radial=function(){var a=Xg.svg.diagonal(),b=Hg,c=a.projection;return a.projection=function(a){return arguments.length?c(Ig(b=a)):b},a},Xg.svg.symbol=function(){function a(a,d){return(Cj.get(b.call(this,a,d))||Lg)(c.call(this,a,d))}var b=Kg,c=Jg;return a.type=function(c){return arguments.length?(b=Ab(c),a):b},a.size=function(b){return arguments.length?(c=Ab(b),a):c},a};var Cj=Xg.map({circle:Lg,cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+-3*b+","+-b+"H"+-b+"V"+-3*b+"H"+b+"V"+-b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+-b+"V"+b+"H"+-3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*Gj)),c=b*Gj;return"M0,"+-b+"L"+c+",0 0,"+b+" "+-c+",0Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+-b+","+-b+"L"+b+","+-b+" "+b+","+b+" "+-b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/Fj),c=b*Fj/2;return"M0,"+c+"L"+b+","+-c+" "+-b+","+-c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/Fj),c=b*Fj/2;return"M0,"+-c+"L"+b+","+c+" "+-b+","+c+"Z"}});Xg.svg.symbolTypes=Cj.keys();var Dj,Ej,Fj=Math.sqrt(3),Gj=Math.tan(30*Gh),Hj=[],Ij=0;Hj.call=th.call,Hj.empty=th.empty,Hj.node=th.node,Hj.size=th.size,Xg.transition=function(a){return arguments.length?Dj?a.transition():a:wh.transition()},Xg.transition.prototype=Hj,Hj.select=function(a){var b,c,d,e=this.id,f=[];a=A(a);for(var g=-1,h=this.length;++g<h;){f.push(b=[]);for(var i=this[g],j=-1,k=i.length;++j<k;)(d=i[j])&&(c=a.call(d,d.__data__,j,g))?("__data__"in d&&(c.__data__=d.__data__),Pg(c,j,e,d.__transition__[e]),b.push(c)):b.push(null)}return Mg(f,e)},Hj.selectAll=function(a){var b,c,d,e,f,g=this.id,h=[];a=B(a);for(var i=-1,j=this.length;++i<j;)for(var k=this[i],l=-1,m=k.length;++l<m;)if(d=k[l]){f=d.__transition__[g],c=a.call(d,d.__data__,l,i),h.push(b=[]);for(var n=-1,o=c.length;++n<o;)(e=c[n])&&Pg(e,n,g,f),b.push(e)}return Mg(h,g)},Hj.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=M(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]);for(var c=this[f],h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return Mg(e,this.id)},Hj.tween=function(a,b){var c=this.id;return arguments.length<2?this.node().__transition__[c].tween.get(a):O(this,null==b?function(b){b.__transition__[c].tween.remove(a)}:function(d){d.__transition__[c].tween.set(a,b)})},Hj.attr=function(a,b){function c(){this.removeAttribute(h)}function d(){this.removeAttributeNS(h.space,h.local)}function e(a){return null==a?c:(a+="",function(){var b,c=this.getAttribute(h);return c!==a&&(b=g(c,a),function(a){this.setAttribute(h,b(a))})})}function f(a){return null==a?d:(a+="",function(){var b,c=this.getAttributeNS(h.space,h.local);return c!==a&&(b=g(c,a),function(a){this.setAttributeNS(h.space,h.local,b(a))})})}if(arguments.length<2){for(b in a)this.attr(b,a[b]);return this}var g="transform"==a?Oe:re,h=Xg.ns.qualify(a);return Ng(this,"attr."+a,b,h.local?f:e)},Hj.attrTween=function(a,b){function c(a,c){var d=b.call(this,a,c,this.getAttribute(e));return d&&function(a){this.setAttribute(e,d(a))}}function d(a,c){var d=b.call(this,a,c,this.getAttributeNS(e.space,e.local));return d&&function(a){this.setAttributeNS(e.space,e.local,d(a))}}var e=Xg.ns.qualify(a);return this.tween("attr."+a,e.local?d:c)},Hj.style=function(a,b,c){function d(){this.style.removeProperty(a)}function e(b){return null==b?d:(b+="",function(){var d,e=ah.getComputedStyle(this,null).getPropertyValue(a);return e!==b&&(d=re(e,b),function(b){this.style.setProperty(a,d(b),c)})})}var f=arguments.length;if(3>f){if("string"!=typeof a){2>f&&(b="");for(c in a)this.style(c,a[c],b);return this}c=""}return Ng(this,"style."+a,b,e)},Hj.styleTween=function(a,b,c){function d(d,e){var f=b.call(this,d,e,ah.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),c)}}return arguments.length<3&&(c=""),this.tween("style."+a,d)},Hj.text=function(a){return Ng(this,"text",a,Og)},Hj.remove=function(){return this.each("end.transition",function(){var a;this.__transition__.count<2&&(a=this.parentNode)&&a.removeChild(this)})},Hj.ease=function(a){var b=this.id;return arguments.length<1?this.node().__transition__[b].ease:("function"!=typeof a&&(a=Xg.ease.apply(Xg,arguments)),O(this,function(c){c.__transition__[b].ease=a}))},Hj.delay=function(a){var b=this.id;return arguments.length<1?this.node().__transition__[b].delay:O(this,"function"==typeof a?function(c,d,e){c.__transition__[b].delay=+a.call(c,c.__data__,d,e)}:(a=+a,function(c){c.__transition__[b].delay=a}))},Hj.duration=function(a){var b=this.id;return arguments.length<1?this.node().__transition__[b].duration:O(this,"function"==typeof a?function(c,d,e){c.__transition__[b].duration=Math.max(1,a.call(c,c.__data__,d,e))}:(a=Math.max(1,a),function(c){c.__transition__[b].duration=a}))},Hj.each=function(a,b){var c=this.id;if(arguments.length<2){var d=Ej,e=Dj;Dj=c,O(this,function(b,d,e){Ej=b.__transition__[c],a.call(b,b.__data__,d,e)}),Ej=d,Dj=e}else O(this,function(d){var e=d.__transition__[c];(e.event||(e.event=Xg.dispatch("start","end"))).on(a,b)});return this},Hj.transition=function(){for(var a,b,c,d,e=this.id,f=++Ij,g=[],h=0,i=this.length;i>h;h++){g.push(a=[]);for(var b=this[h],j=0,k=b.length;k>j;j++)(c=b[j])&&(d=Object.create(c.__transition__[e]),d.delay+=d.duration,Pg(c,j,f,d)),a.push(c)}return Mg(g,f)},Xg.svg.axis=function(){function a(a){a.each(function(){var a,j=Xg.select(this),k=this.__chart__||c,l=this.__chart__=c.copy(),m=null==i?l.ticks?l.ticks.apply(l,h):l.domain():i,n=null==b?l.tickFormat?l.tickFormat.apply(l,h):Bb:b,o=j.selectAll(".tick").data(m,l),p=o.enter().insert("g",".domain").attr("class","tick").style("opacity",Eh),q=Xg.transition(o.exit()).style("opacity",Eh).remove(),r=Xg.transition(o.order()).style("opacity",1),s=Math.max(e,0)+g,t=Mf(l),u=j.selectAll(".domain").data([0]),v=(u.enter().append("path").attr("class","domain"),Xg.transition(u));p.append("line"),p.append("text");var w,x,y,z,A=p.select("line"),B=r.select("line"),C=o.select("text").text(n),D=p.select("text"),E=r.select("text"),F="top"===d||"left"===d?-1:1;if("bottom"===d||"top"===d?(a=Qg,w="x",y="y",x="x2",z="y2",C.attr("dy",0>F?"0em":".71em").style("text-anchor","middle"),v.attr("d","M"+t[0]+","+F*f+"V0H"+t[1]+"V"+F*f)):(a=Rg,w="y",y="x",x="y2",z="x2",C.attr("dy",".32em").style("text-anchor",0>F?"end":"start"),v.attr("d","M"+F*f+","+t[0]+"H0V"+t[1]+"H"+F*f)),A.attr(z,F*e),D.attr(y,F*s),B.attr(x,0).attr(z,F*e),E.attr(w,0).attr(y,F*s),l.rangeBand){var G=l,H=G.rangeBand()/2;k=l=function(a){return G(a)+H}}else k.rangeBand?k=l:q.call(a,l,k);p.call(a,k,l),r.call(a,l,l)})}var b,c=Xg.scale.linear(),d=Jj,e=6,f=6,g=3,h=[10],i=null;return a.scale=function(b){return arguments.length?(c=b,a):c},a.orient=function(b){return arguments.length?(d=b in Kj?b+"":Jj,a):d},a.ticks=function(){return arguments.length?(h=arguments,a):h},a.tickValues=function(b){return arguments.length?(i=b,a):i},a.tickFormat=function(c){return arguments.length?(b=c,a):b},a.tickSize=function(b){var c=arguments.length;return c?(e=+b,f=+arguments[c-1],a):e},a.innerTickSize=function(b){return arguments.length?(e=+b,a):e},a.outerTickSize=function(b){return arguments.length?(f=+b,a):f},a.tickPadding=function(b){return arguments.length?(g=+b,a):g},a.tickSubdivide=function(){return arguments.length&&a},a};var Jj="bottom",Kj={top:1,right:1,bottom:1,left:1};Xg.svg.brush=function(){function a(f){f.each(function(){var f=Xg.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",e).on("touchstart.brush",e),g=f.selectAll(".background").data([0]);g.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),f.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var h=f.selectAll(".resize").data(o,Bb);h.exit().remove(),h.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return Lj[a]}).append("rect").attr("x",function(a){return/[ew]$/.test(a)?-3:null}).attr("y",function(a){return/^[ns]/.test(a)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",a.empty()?"none":null);var k,l=Xg.transition(f),m=Xg.transition(g);i&&(k=Mf(i),m.attr("x",k[0]).attr("width",k[1]-k[0]),c(l)),j&&(k=Mf(j),m.attr("y",k[0]).attr("height",k[1]-k[0]),d(l)),b(l)})}function b(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+k[+/e$/.test(a)]+","+l[+/^s/.test(a)]+")"})}function c(a){a.select(".extent").attr("x",k[0]),a.selectAll(".extent,.n>rect,.s>rect").attr("width",k[1]-k[0])}function d(a){a.select(".extent").attr("y",l[0]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function e(){function e(){32==Xg.event.keyCode&&(C||(s=null,E[0]-=k[1],E[1]-=l[1],C=2),w())}function o(){32==Xg.event.keyCode&&2==C&&(E[0]+=k[1],E[1]+=l[1],C=0,w())}function p(){var a=Xg.mouse(u),e=!1;t&&(a[0]+=t[0],a[1]+=t[1]),C||(Xg.event.altKey?(s||(s=[(k[0]+k[1])/2,(l[0]+l[1])/2]),E[0]=k[+(a[0]<s[0])],E[1]=l[+(a[1]<s[1])]):s=null),A&&q(a,i,0)&&(c(y),e=!0),B&&q(a,j,1)&&(d(y),e=!0),e&&(b(y),x({type:"brush",mode:C?"move":"resize"}))}function q(a,b,c){var d,e,h=Mf(b),i=h[0],j=h[1],o=E[c],p=c?l:k,q=p[1]-p[0];return C&&(i-=o,j-=q+o),d=(c?n:m)?Math.max(i,Math.min(j,a[c])):a[c],C?e=(d+=o)+q:(s&&(o=Math.max(i,Math.min(j,2*s[c]-d))),d>o?(e=d,d=o):e=o),p[0]!=d||p[1]!=e?(c?g=null:f=null,p[0]=d,p[1]=e,!0):void 0}function r(){p(),y.style("pointer-events","all").selectAll(".resize").style("display",a.empty()?"none":null),Xg.select("body").style("cursor",null),F.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),D(),x({type:"brushend"})}var s,t,u=this,v=Xg.select(Xg.event.target),x=h.of(u,arguments),y=Xg.select(u),z=v.datum(),A=!/^(n|s)$/.test(z)&&i,B=!/^(e|w)$/.test(z)&&j,C=v.classed("extent"),D=V(),E=Xg.mouse(u),F=Xg.select(ah).on("keydown.brush",e).on("keyup.brush",o);if(Xg.event.changedTouches?F.on("touchmove.brush",p).on("touchend.brush",r):F.on("mousemove.brush",p).on("mouseup.brush",r),y.interrupt().selectAll("*").interrupt(),C)E[0]=k[0]-E[0],E[1]=l[0]-E[1];else if(z){var G=+/w$/.test(z),H=+/^n/.test(z);t=[k[1-G]-E[0],l[1-H]-E[1]],E[0]=k[G],E[1]=l[H]}else Xg.event.altKey&&(s=E.slice());y.style("pointer-events","none").selectAll(".resize").style("display",null),Xg.select("body").style("cursor",v.style("cursor")),x({type:"brushstart"}),p()}var f,g,h=y(a,"brushstart","brush","brushend"),i=null,j=null,k=[0,0],l=[0,0],m=!0,n=!0,o=Mj[0];return a.event=function(a){a.each(function(){var a=h.of(this,arguments),b={x:k,y:l,i:f,j:g},c=this.__chart__||b;this.__chart__=b,Dj?Xg.select(this).transition().each("start.brush",function(){f=c.i,g=c.j,k=c.x,l=c.y,a({type:"brushstart"})}).tween("brush:brush",function(){var c=se(k,b.x),d=se(l,b.y);return f=g=null,function(e){k=b.x=c(e),l=b.y=d(e),a({type:"brush",mode:"resize"})}}).each("end.brush",function(){f=b.i,g=b.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})}):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))})},a.x=function(b){return arguments.length?(i=b,o=Mj[!i<<1|!j],a):i},a.y=function(b){return arguments.length?(j=b,o=Mj[!i<<1|!j],a):j},a.clamp=function(b){return arguments.length?(i&&j?(m=!!b[0],n=!!b[1]):i?m=!!b:j&&(n=!!b),a):i&&j?[m,n]:i?m:j?n:null},a.extent=function(b){var c,d,e,h,m;return arguments.length?(i&&(c=b[0],d=b[1],j&&(c=c[0],d=d[0]),f=[c,d],i.invert&&(c=i(c),d=i(d)),c>d&&(m=c,c=d,d=m),(c!=k[0]||d!=k[1])&&(k=[c,d])),j&&(e=b[0],h=b[1],i&&(e=e[1],h=h[1]),g=[e,h],j.invert&&(e=j(e),h=j(h)),e>h&&(m=e,e=h,h=m),(e!=l[0]||h!=l[1])&&(l=[e,h])),a):(i&&(f?(c=f[0],d=f[1]):(c=k[0],d=k[1],i.invert&&(c=i.invert(c),d=i.invert(d)),c>d&&(m=c,c=d,d=m))),j&&(g?(e=g[0],h=g[1]):(e=l[0],h=l[1],j.invert&&(e=j.invert(e),h=j.invert(h)),e>h&&(m=e,e=h,h=m))),i&&j?[[c,e],[d,h]]:i?[c,d]:j&&[e,h])},a.clear=function(){return a.empty()||(k=[0,0],l=[0,0],f=g=null),a},a.empty=function(){return!!i&&k[0]==k[1]||!!j&&l[0]==l[1]},Xg.rebind(a,h,"on")};var Lj={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Mj=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Nj=ei.format=ki.timeFormat,Oj=Nj.utc,Pj=Oj("%Y-%m-%dT%H:%M:%S.%LZ");Nj.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Sg:Pj,Sg.parse=function(a){var b=new Date(a);return isNaN(b)?null:b},Sg.toString=Pj.toString,ei.second=Ob(function(a){return new fi(1e3*Math.floor(a/1e3))},function(a,b){a.setTime(a.getTime()+1e3*Math.floor(b))},function(a){return a.getSeconds()
|
||
}),ei.seconds=ei.second.range,ei.seconds.utc=ei.second.utc.range,ei.minute=Ob(function(a){return new fi(6e4*Math.floor(a/6e4))},function(a,b){a.setTime(a.getTime()+6e4*Math.floor(b))},function(a){return a.getMinutes()}),ei.minutes=ei.minute.range,ei.minutes.utc=ei.minute.utc.range,ei.hour=Ob(function(a){var b=a.getTimezoneOffset()/60;return new fi(36e5*(Math.floor(a/36e5-b)+b))},function(a,b){a.setTime(a.getTime()+36e5*Math.floor(b))},function(a){return a.getHours()}),ei.hours=ei.hour.range,ei.hours.utc=ei.hour.utc.range,ei.month=Ob(function(a){return a=ei.day(a),a.setDate(1),a},function(a,b){a.setMonth(a.getMonth()+b)},function(a){return a.getMonth()}),ei.months=ei.month.range,ei.months.utc=ei.month.utc.range;var Qj=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Rj=[[ei.second,1],[ei.second,5],[ei.second,15],[ei.second,30],[ei.minute,1],[ei.minute,5],[ei.minute,15],[ei.minute,30],[ei.hour,1],[ei.hour,3],[ei.hour,6],[ei.hour,12],[ei.day,1],[ei.day,2],[ei.week,1],[ei.month,1],[ei.month,3],[ei.year,1]],Sj=Nj.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%a %d",function(a){return a.getDay()&&1!=a.getDate()}],["%b %d",function(a){return 1!=a.getDate()}],["%B",function(a){return a.getMonth()}],["%Y",Cc]]),Tj={range:function(a,b,c){return Xg.range(Math.ceil(a/c)*c,+b,c).map(Ug)},floor:Bb,ceil:Bb};Rj.year=ei.year,ei.scale=function(){return Tg(Xg.scale.linear(),Rj,Sj)};var Uj=Rj.map(function(a){return[a[0].utc,a[1]]}),Vj=Oj.multi([[".%L",function(a){return a.getUTCMilliseconds()}],[":%S",function(a){return a.getUTCSeconds()}],["%I:%M",function(a){return a.getUTCMinutes()}],["%I %p",function(a){return a.getUTCHours()}],["%a %d",function(a){return a.getUTCDay()&&1!=a.getUTCDate()}],["%b %d",function(a){return 1!=a.getUTCDate()}],["%B",function(a){return a.getUTCMonth()}],["%Y",Cc]]);Uj.year=ei.year.utc,ei.scale.utc=function(){return Tg(Xg.scale.linear(),Uj,Vj)},Xg.text=Cb(function(a){return a.responseText}),Xg.json=function(a,b){return Db(a,"application/json",Vg,b)},Xg.html=function(a,b){return Db(a,"text/html",Wg,b)},Xg.xml=Cb(function(a){return a.responseXML}),"function"==typeof define&&define.amd?define(Xg):"object"==typeof b&&b.exports&&(b.exports=Xg),this.d3=Xg}()},{}],5:[function(a,b,c){!function(a){function b(){return""===i.hash||"#"===i.hash}function c(a,b){for(var c=0;c<a.length;c+=1)if(b(a[c],c,a)===!1)return}function d(a){for(var b=[],c=0,d=a.length;d>c;c++)b=b.concat(a[c]);return b}function e(a,b,c){if(!a.length)return c();var d=0;!function e(){b(a[d],function(b){b||b===!1?(c(b),c=function(){}):(d+=1,d===a.length?c():e())})}()}function f(a,b,c){c=a;for(var d in b)if(b.hasOwnProperty(d)&&(c=b[d](a),c!==a))break;return c===a?"([._a-zA-Z0-9-]+)":c}function g(a,b){for(var c,d=0,e="";c=a.substr(d).match(/[^\w\d\- %@&]*\*[^\w\d\- %@&]*/);)d=c.index+c[0].length,c[0]=c[0].replace(/^\*/,"([_.()!\\ %@&a-zA-Z0-9-]+)"),e+=a.substr(0,c.index)+c[0];a=e+=a.substr(d);var g,h,i=a.match(/:([^\/]+)/gi);if(i){h=i.length;for(var j=0;h>j;j++)g=i[j],a="::"===g.slice(0,2)?g.slice(1):a.replace(g,f(g,b))}return a}function h(a,b,c,d){var e,f=0,g=0,h=0,c=(c||"(").toString(),d=(d||")").toString();for(e=0;e<a.length;e++){var i=a[e];if(i.indexOf(c,f)>i.indexOf(d,f)||~i.indexOf(c,f)&&!~i.indexOf(d,f)||!~i.indexOf(c,f)&&~i.indexOf(d,f)){if(g=i.indexOf(c,f),h=i.indexOf(d,f),~g&&!~h||!~g&&~h){var j=a.slice(0,(e||1)+1).join(b);a=[j].concat(a.slice((e||1)+1))}f=(h>g?h:g)+1,e=0}else f=0}return a}Array.prototype.filter||(Array.prototype.filter=function(a,b){for(var c,d=[],e=0,f=this.length;f>e;e++)e in this&&a.call(b,c=this[e],e,this)&&d.push(c);return d}),Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});var i=document.location,j={mode:"modern",hash:i.hash,history:!1,check:function(){var a=i.hash;a!=this.hash&&(this.hash=a,this.onHashChanged())},fire:function(){"modern"===this.mode?this.history===!0?window.onpopstate():window.onhashchange():this.onHashChanged()},init:function(a,b){function c(a){for(var b=0,c=k.listeners.length;c>b;b++)k.listeners[b](a)}var d=this;if(this.history=b,k.listeners||(k.listeners=[]),"onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7))this.history===!0?setTimeout(function(){window.onpopstate=c},500):window.onhashchange=c,this.mode="modern";else{var e=document.createElement("iframe");e.id="state-frame",e.style.display="none",document.body.appendChild(e),this.writeFrame(""),"onpropertychange"in document&&"attachEvent"in document&&document.attachEvent("onpropertychange",function(){"location"===event.propertyName&&d.check()}),window.setInterval(function(){d.check()},50),this.onHashChanged=c,this.mode="legacy"}return k.listeners.push(a),this.mode},destroy:function(a){if(k&&k.listeners)for(var b=k.listeners,c=b.length-1;c>=0;c--)b[c]===a&&b.splice(c,1)},setHash:function(a){return"legacy"===this.mode&&this.writeFrame(a),this.history===!0?(window.history.pushState({},document.title,a),this.fire()):i.hash="/"===a[0]?a:"/"+a,this},writeFrame:function(a){var b=document.getElementById("state-frame"),c=b.contentDocument||b.contentWindow.document;c.open(),c.write("<script>_hash = '"+a+"'; onload = parent.listener.syncHash;<script>"),c.close()},syncHash:function(){var a=this._hash;return a!=i.hash&&(i.hash=a),this},onHashChanged:function(){}},k=a.Router=function(a){return this instanceof k?(this.params={},this.routes={},this.methods=["on","once","after","before"],this.scope=[],this._methods={},this._insert=this.insert,this.insert=this.insertEx,this.historySupport=null!=(null!=window.history?window.history.pushState:null),this.configure(),void this.mount(a||{})):new k(a)};k.prototype.init=function(a){var c=this;if(this.handler=function(a){var b=a&&a.newURL||window.location.hash,d=c.history===!0?c.getPath():b.replace(/.*#/,"");c.dispatch("on","/"===d.charAt(0)?d:"/"+d)},j.init(this.handler,this.history),this.history===!1)b()&&a?i.hash=a:b()||c.dispatch("on","/"+i.hash.replace(/^(#\/|#|\/)/,""));else{var d=b()&&a?a:b()?null:i.hash.replace(/^#/,"");d&&window.history.replaceState({},document.title,d),(d||this.run_in_init===!0)&&this.handler()}return this},k.prototype.explode=function(){var a=this.history===!0?this.getPath():i.hash;return"/"===a.charAt(1)&&(a=a.slice(1)),a.slice(1,a.length).split("/")},k.prototype.setRoute=function(a,b,c){var d=this.explode();return"number"==typeof a&&"string"==typeof b?d[a]=b:"string"==typeof c?d.splice(a,b,s):d=[a],j.setHash(d.join("/")),d},k.prototype.insertEx=function(a,b,c,d){return"once"===a&&(a="on",c=function(a){var b=!1;return function(){return b?void 0:(b=!0,a.apply(this,arguments))}}(c)),this._insert(a,b,c,d)},k.prototype.getRoute=function(a){var b=a;if("number"==typeof a)b=this.explode()[a];else if("string"==typeof a){var c=this.explode();b=c.indexOf(a)}else b=this.explode();return b},k.prototype.destroy=function(){return j.destroy(this.handler),this},k.prototype.getPath=function(){var a=window.location.pathname;return"/"!==a.substr(0,1)&&(a="/"+a),a},k.prototype.configure=function(a){a=a||{};for(var b=0;b<this.methods.length;b++)this._methods[this.methods[b]]=!0;return this.recurse=a.recurse||this.recurse||!1,this.async=a.async||!1,this.delimiter=a.delimiter||"/",this.strict="undefined"==typeof a.strict?!0:a.strict,this.notfound=a.notfound,this.resource=a.resource,this.history=a.html5history&&this.historySupport||!1,this.run_in_init=this.history===!0&&a.run_handler_in_init!==!1,this.every={after:a.after||null,before:a.before||null,on:a.on||null},this},k.prototype.param=function(a,b){":"!==a[0]&&(a=":"+a);var c=new RegExp(a,"g");this.params[a]=function(a){return a.replace(c,b.source||b)}},k.prototype.on=k.prototype.route=function(a,b,c){var d=this;return c||"function"!=typeof b||(c=b,b=a,a="on"),Array.isArray(b)?b.forEach(function(b){d.on(a,b,c)}):(b.source&&(b=b.source.replace(/\\\//gi,"/")),Array.isArray(a)?a.forEach(function(a){d.on(a.toLowerCase(),b,c)}):(b=b.split(new RegExp(this.delimiter)),b=h(b,this.delimiter),void this.insert(a,this.scope.concat(b),c)))},k.prototype.dispatch=function(a,b,c){function d(){f.last=g.after,f.invoke(f.runlist(g),f,c)}var e,f=this,g=this.traverse(a,b,this.routes,""),h=this._invoked;return this._invoked=!0,g&&0!==g.length?("forward"===this.recurse&&(g=g.reverse()),e=this.every&&this.every.after?[this.every.after].concat(this.last):[this.last],e&&e.length>0&&h?(this.async?this.invoke(e,this,d):(this.invoke(e,this),d()),!0):(d(),!0)):(this.last=[],"function"==typeof this.notfound&&this.invoke([this.notfound],{method:a,path:b},c),!1)},k.prototype.invoke=function(a,b,d){var f,g=this;this.async?(f=function(c,d){return Array.isArray(c)?e(c,f,d):void("function"==typeof c&&c.apply(b,a.captures.concat(d)))},e(a,f,function(){d&&d.apply(b,arguments)})):(f=function(d){return Array.isArray(d)?c(d,f):"function"==typeof d?d.apply(b,a.captures||[]):void("string"==typeof d&&g.resource&&g.resource[d].apply(b,a.captures||[]))},c(a,f))},k.prototype.traverse=function(a,b,c,d,e){function f(a){function b(a){for(var c=[],d=0;d<a.length;d++)c[d]=Array.isArray(a[d])?b(a[d]):a[d];return c}function c(a){for(var b=a.length-1;b>=0;b--)Array.isArray(a[b])?(c(a[b]),0===a[b].length&&a.splice(b,1)):e(a[b])||a.splice(b,1)}if(!e)return a;var d=b(a);return d.matched=a.matched,d.captures=a.captures,d.after=a.after.filter(e),c(d),d}var g,h,i,j,k=[];if(b===this.delimiter&&c[a])return j=[[c.before,c[a]].filter(Boolean)],j.after=[c.after].filter(Boolean),j.matched=!0,j.captures=[],f(j);for(var l in c)if(c.hasOwnProperty(l)&&(!this._methods[l]||this._methods[l]&&"object"==typeof c[l]&&!Array.isArray(c[l]))){if(g=h=d+this.delimiter+l,this.strict||(h+="["+this.delimiter+"]?"),i=b.match(new RegExp("^"+h)),!i)continue;if(i[0]&&i[0]==b&&c[l][a])return j=[[c[l].before,c[l][a]].filter(Boolean)],j.after=[c[l].after].filter(Boolean),j.matched=!0,j.captures=i.slice(1),this.recurse&&c===this.routes&&(j.push([c.before,c.on].filter(Boolean)),j.after=j.after.concat([c.after].filter(Boolean))),f(j);if(j=this.traverse(a,b,c[l],g),j.matched)return j.length>0&&(k=k.concat(j)),this.recurse&&(k.push([c[l].before,c[l].on].filter(Boolean)),j.after=j.after.concat([c[l].after].filter(Boolean)),c===this.routes&&(k.push([c.before,c.on].filter(Boolean)),j.after=j.after.concat([c.after].filter(Boolean)))),k.matched=!0,k.captures=j.captures,k.after=j.after,f(k)}return!1},k.prototype.insert=function(a,b,c,d){var e,f,h,i,j;if(b=b.filter(function(a){return a&&a.length>0}),d=d||this.routes,j=b.shift(),/\:|\*/.test(j)&&!/\\d|\\w/.test(j)&&(j=g(j,this.params)),b.length>0)return d[j]=d[j]||{},this.insert(a,b,c,d[j]);if(j||b.length||d!==this.routes){if(f=typeof d[j],h=Array.isArray(d[j]),d[j]&&!h&&"object"==f)switch(e=typeof d[j][a]){case"function":return void(d[j][a]=[d[j][a],c]);case"object":return void d[j][a].push(c);case"undefined":return void(d[j][a]=c)}else if("undefined"==f)return i={},i[a]=c,void(d[j]=i);throw new Error("Invalid route context: "+f)}switch(e=typeof d[a]){case"function":return void(d[a]=[d[a],c]);case"object":return void d[a].push(c);case"undefined":return void(d[a]=c)}},k.prototype.extend=function(a){function b(a){d._methods[a]=!0,d[a]=function(){var b=1===arguments.length?[a,""]:[a];d.on.apply(d,b.concat(Array.prototype.slice.call(arguments)))}}var c,d=this,e=a.length;for(c=0;e>c;c++)b(a[c])},k.prototype.runlist=function(a){var b=this.every&&this.every.before?[this.every.before].concat(d(a)):d(a);return this.every&&this.every.on&&b.push(this.every.on),b.captures=a.captures,b.source=a.source,b},k.prototype.mount=function(a,b){function c(b,c){var e=b,f=b.split(d.delimiter),g=typeof a[b],i=""===f[0]||!d._methods[f[0]],j=i?"on":e;return i&&(e=e.slice((e.match(new RegExp("^"+d.delimiter))||[""])[0].length),f.shift()),i&&"object"===g&&!Array.isArray(a[b])?(c=c.concat(f),void d.mount(a[b],c)):(i&&(c=c.concat(e.split(d.delimiter)),c=h(c,d.delimiter)),void d.insert(j,c,a[b]))}if(a&&"object"==typeof a&&!Array.isArray(a)){var d=this;b=b||[],Array.isArray(b)||(b=b.split(d.delimiter));for(var e in a)a.hasOwnProperty(e)&&c(e,b.slice(0))}}}("object"==typeof c?c:window)},{}],6:[function(require,module,exports){!function(){function l(a){return void 0!==a}function ca(){}function da(a){a.ib=function(){return a.Ld?a.Ld:a.Ld=new a}}function ea(a){var b=typeof a;if("object"==b){if(!a)return"null";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 if("function"==b&&"undefined"==typeof a.call)return"object";return b}function fa(a){return"array"==ea(a)}function ga(a){var b=ea(a);return"array"==b||"object"==b&&"number"==typeof a.length}function p(a){return"string"==typeof a}function ha(a){return"number"==typeof a}function ia(a){return"function"==ea(a)}function ja(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ka(a){return a.call.apply(a.bind,arguments)}function la(a,b){if(!a)throw Error();if(2<arguments.length){var c=Array.prototype.slice.call(arguments,2);return function(){var d=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(d,c),a.apply(b,d)}}return function(){return a.apply(b,arguments)}}function r(){return r=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ka:la,r.apply(null,arguments)}function na(a,b){var c=a.split("."),d=ba;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&l(b)?d[e]=b:d=d[e]?d[e]:d[e]={}}function oa(a,b){function c(){}c.prototype=b.prototype,a.df=b.prototype,a.prototype=new c,a.$e=function(a,c){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}}function pa(a){if(a=String(a),/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a)}function qa(){this.Ec=void 0}function ra(a,b,c){switch(typeof b){case"string":sa(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(null==b){c.push("null");break}if(fa(b)){var d=b.length;c.push("[");for(var e="",f=0;d>f;f++)c.push(e),e=b[f],ra(a,a.Ec?a.Ec.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),sa(f,c),c.push(":"),ra(a,a.Ec?a.Ec.call(b,f,e):e,c),d=","));c.push("}");break;case"function":break;default:throw Error("Unknown type: "+typeof b)}}function sa(a,b){b.push('"',a.replace(ua,function(a){if(a in ta)return ta[a];var b=a.charCodeAt(0),c="\\u";return 16>b?c+="000":256>b?c+="00":4096>b&&(c+="0"),ta[a]=c+b.toString(16)}),'"')}function va(a){return"undefined"!=typeof JSON&&l(JSON.parse)?JSON.parse(a):pa(a)}function u(a){if("undefined"!=typeof JSON&&l(JSON.stringify))a=JSON.stringify(a);else{var b=[];ra(new qa,a,b),a=b.join("")}return a}function wa(a){for(var b=[],c=0,d=0;d<a.length;d++){var e=a.charCodeAt(d);e>=55296&&56319>=e&&(e-=55296,d++,v(d<a.length,"Surrogate pair missing trail surrogate."),e=65536+(e<<10)+(a.charCodeAt(d)-56320)),128>e?b[c++]=e:(2048>e?b[c++]=e>>6|192:(65536>e?b[c++]=e>>12|224:(b[c++]=e>>18|240,b[c++]=e>>12&63|128),b[c++]=e>>6&63|128),b[c++]=63&e|128)}return b}function x(a,b,c,d){var e;if(b>d?e="at least "+b:d>c&&(e=0===c?"none":"no more than "+c),e)throw Error(a+" failed: Was called with "+d+(1===d?" argument.":" arguments.")+" Expects "+e+".")}function y(a,b,c){var d="";switch(b){case 1:d=c?"first":"First";break;case 2:d=c?"second":"Second";break;case 3:d=c?"third":"Third";break;case 4:d=c?"fourth":"Fourth";break;default:ya.assert(!1,"errorPrefix_ called with argumentNumber > 4. Need to update it?")}return a=a+" failed: "+(d+" argument ")}function z(a,b,c,d){if((!d||l(c))&&!ia(c))throw Error(y(a,b,d)+"must be a valid function.")}function za(a,b,c){if(l(c)&&(!ja(c)||null===c))throw Error(y(a,b,!0)+"must be a valid context object.")}function A(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function B(a,b){return Object.prototype.hasOwnProperty.call(a,b)?a[b]:void 0}function Aa(a,b){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&b(c,a[c])}function Ba(a){var b={};return Aa(a,function(a,c){b[a]=c}),b}function Ea(a){return p(a)&&0!==a.length&&!Ca.test(a)}function Fa(a,b,c){c&&!l(b)||Ga(y(a,1,c),b)}function Ga(a,b,c,d){if(c||(c=0),d=d||[],!l(b))throw Error(a+"contains undefined"+Ha(d));if(ia(b))throw Error(a+"contains a function"+Ha(d)+" with contents: "+b.toString());if(Ia(b))throw Error(a+"contains "+b.toString()+Ha(d));if(c>1e3)throw new TypeError(a+"contains a cyclic object value ("+d.slice(0,100).join(".")+"...)");if(p(b)&&b.length>10485760/3&&10485760<wa(b).length)throw Error(a+"contains a string greater than 10485760 utf8 bytes"+Ha(d)+" ('"+b.substring(0,50)+"...')");if(ja(b))for(var e in b)if(A(b,e)){var f=b[e];if(".priority"!==e&&".value"!==e&&".sv"!==e&&!Ea(e))throw Error(a+" contains an invalid key ("+e+")"+Ha(d)+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');d.push(e),Ga(a,f,c+1,d),d.pop()}}function Ha(a){return 0==a.length?"":" in property '"+a.join(".")+"'"}function Ja(a,b){if(!ja(b)||fa(b))throw Error(y(a,1,!1)+" must be an Object containing the children to replace.");Fa(a,b,!1)}function Ka(a,b,c,d){if(!d||l(c)){if(Ia(c))throw Error(y(a,b,d)+"is "+c.toString()+", but must be a valid Firebase priority (a string, finite number, or null).");if(!(null===c||ha(c)||p(c)||ja(c)&&A(c,".sv")))throw Error(y(a,b,d)+"must be a valid Firebase priority (a string, finite number, or null).")}}function La(a,b,c){if(!c||l(b))switch(b){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw Error(y(a,1,c)+'must be a valid event type: "value", "child_added", "child_removed", "child_changed", or "child_moved".')}}function Ma(a,b){if(l(b)&&!Ea(b))throw Error(y(a,2,!0)+'was an invalid key: "'+b+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')}function Na(a,b){if(!p(b)||0===b.length||Da.test(b))throw Error(y(a,1,!1)+'was an invalid path: "'+b+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')}function C(a,b){if(".info"===D(b))throw Error(a+" failed: Can't modify data under /.info/")}function Oa(a,b){if(!p(b))throw Error(y(a,1,!1)+"must be a valid credential (a string).")}function Pa(a,b,c){if(!p(c))throw Error(y(a,b,!1)+"must be a valid string.")}function E(a,b,c,d){if(!(d&&!l(c)||ja(c)&&null!==c))throw Error(y(a,b,d)+"must be a valid object.")}function Qa(a,b,c){if(!ja(b)||null===b||!A(b,c))throw Error(y(a,1,!1)+'must contain the key "'+c+'"');if(!p(B(b,c)))throw Error(y(a,1,!1)+'must contain the key "'+c+'" with type "string"')}function F(a,b,c,d,e,f,g){if(this.i=a,this.path=b,this.Ga=c,this.fa=d,this.za=e,this.Ea=f,this.fb=g,l(this.fa)&&l(this.Ea)&&l(this.Ga))throw"Query: Can't combine startAt(), endAt(), and limit()."}function Sa(a){var b={};return l(a.fa)&&(b.sp=a.fa),l(a.za)&&(b.sn=a.za),l(a.Ea)&&(b.ep=a.Ea),l(a.fb)&&(b.en=a.fb),l(a.Ga)&&(b.l=a.Ga),l(a.fa)&&l(a.za)&&null===a.fa&&null===a.za&&(b.vf="l"),b}function Ra(a,b,c){var d={};if(b&&c)d.cancel=b,z(a,3,d.cancel,!0),d.$=c,za(a,4,d.$);else if(b)if("object"==typeof b&&null!==b)d.$=b;else{if("function"!=typeof b)throw Error(xa.af(a,3,!0)+"must either be a cancel callback or a context object.");d.cancel=b}return d}function H(a,b){if(1==arguments.length){this.u=a.split("/");for(var c=0,d=0;d<this.u.length;d++)0<this.u[d].length&&(this.u[c]=this.u[d],c++);this.u.length=c,this.W=0}else this.u=a,this.W=b}function D(a){return a.W>=a.u.length?null:a.u[a.W]}function Ua(a){var b=a.W;return b<a.u.length&&b++,new H(a.u,b)}function Va(a){return a.W<a.u.length?a.u[a.u.length-1]:null}function Wa(a,b){var c=D(a);if(null===c)return b;if(c===D(b))return Wa(Ua(a),Ua(b));throw"INTERNAL ERROR: innerPath ("+b+") is not within outerPath ("+a+")"}function Xa(){this.children={},this.gc=0,this.value=null}function Ya(a,b,c){this.Ha=a?a:"",this.Qb=b?b:null,this.A=c?c:new Xa}function I(a,b){for(var c,d=b instanceof H?b:new H(b),e=a;null!==(c=D(d));)e=new Ya(c,e,B(e.A.children,c)||new Xa),d=Ua(d);return e}function Za(a,b){v("undefined"!=typeof b,"Cannot set value to undefined"),a.A.value=b,$a(a)}function ab(a,b,c,d){c&&!d&&b(a),a.B(function(a){ab(a,b,!0,d)}),c&&d&&b(a)}function bb(a,b,c){for(a=c?a:a.parent();null!==a;){if(b(a))return!0;a=a.parent()}return!1}function $a(a){if(null!==a.Qb){var b=a.Qb,c=a.Ha,d=a.f(),e=A(b.A.children,c);d&&e?(delete b.A.children[c],b.A.gc--,$a(b)):d||e||(b.A.children[c]=a.A,b.A.gc++,$a(b))}}function cb(a,b){this.ab=a?a:db,this.ea=b?b:eb}function db(a,b){return b>a?-1:a>b?1:0}function gb(a,b){for(var c,d=a.ea,e=null;!d.f();){if(c=a.ab(b,d.key),0===c){if(d.left.f())return e?e.key:null;for(d=d.left;!d.right.f();)d=d.right;return d.key}0>c?d=d.left:c>0&&(e=d,d=d.right)}throw Error("Attempted to find predecessor key for a nonexistent key. What gives?")}function hb(a,b){for(this.Wd=b,this.pc=[];!a.f();)this.pc.push(a),a=a.left}function ib(a){if(0===a.pc.length)return null;var b,c=a.pc.pop();for(b=a.Wd?a.Wd(c.key,c.value):{key:c.key,value:c.value},c=c.right;!c.f();)a.pc.push(c),c=c.left;return b}function jb(a,b,c,d,e){this.key=a,this.value=b,this.color=null!=c?c:!0,this.left=null!=d?d:eb,this.right=null!=e?e:eb}function kb(a){return a.left.f()?a:kb(a.left)}function mb(a){return a.left.f()?eb:(a.left.R()||a.left.left.R()||(a=nb(a)),a=a.M(null,null,null,mb(a.left),null),lb(a))}function lb(a){return a.right.R()&&!a.left.R()&&(a=qb(a)),a.left.R()&&a.left.left.R()&&(a=ob(a)),a.left.R()&&a.right.R()&&(a=pb(a)),a}function nb(a){return a=pb(a),a.right.left.R()&&(a=a.M(null,null,null,null,ob(a.right)),a=qb(a),a=pb(a)),a}function qb(a){return a.right.M(null,null,a.color,a.M(null,null,!0,null,a.right.left),null)}function ob(a){return a.left.M(null,null,a.color,null,a.M(null,null,!0,a.left.right,null))}function pb(a){return a.M(null,null,!a.color,a.left.M(null,null,!a.left.color,null,null),a.right.M(null,null,!a.right.color,null,null))}function rb(){}function sb(a){this.Cb=a,this.zc="firebase:"}function tb(){this.yb={}}function wb(a){try{if("undefined"!=typeof window&&"undefined"!=typeof window[a]){var b=window[a];return b.setItem("firebase:sentinel","cache"),b.removeItem("firebase:sentinel"),new sb(b)}}catch(c){}return new tb}function yb(a,b,c,d,e){this.host=a.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.Ya=b,this.Ta=c,this.Ye=d,this.yc=e||"",this.ia=xb.get("host:"+a)||this.host}function zb(a,b){b!==a.ia&&(a.ia=b,"s-"===a.ia.substr(0,2)&&xb.set("host:"+a.host,a.ia))}function Ab(){this.ra=-1}function Bb(){this.ra=-1,this.ra=64,this.F=[],this.Sc=[],this.ge=[],this.vc=[],this.vc[0]=128;for(var a=1;a<this.ra;++a)this.vc[a]=0;this.Kc=this.kb=0,this.reset()}function Cb(a,b,c){c||(c=0);var d=a.ge;if(p(b))for(var e=0;16>e;e++)d[e]=b.charCodeAt(c)<<24|b.charCodeAt(c+1)<<16|b.charCodeAt(c+2)<<8|b.charCodeAt(c+3),c+=4;else for(e=0;16>e;e++)d[e]=b[c]<<24|b[c+1]<<16|b[c+2]<<8|b[c+3],c+=4;for(e=16;80>e;e++){var f=d[e-3]^d[e-8]^d[e-14]^d[e-16];d[e]=4294967295&(f<<1|f>>>31)}b=a.F[0],c=a.F[1];for(var g,h=a.F[2],i=a.F[3],j=a.F[4],e=0;80>e;e++)40>e?20>e?(f=i^c&(h^i),g=1518500249):(f=c^h^i,g=1859775393):60>e?(f=c&h|i&(c|h),g=2400959708):(f=c^h^i,g=3395469782),f=(b<<5|b>>>27)+f+j+g+d[e]&4294967295,j=i,i=h,h=4294967295&(c<<30|c>>>2),c=b,b=f;a.F[0]=a.F[0]+b&4294967295,a.F[1]=a.F[1]+c&4294967295,a.F[2]=a.F[2]+h&4294967295,a.F[3]=a.F[3]+i&4294967295,a.F[4]=a.F[4]+j&4294967295}function Db(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^ma()).toString(36)}function Kb(a,b){var c;a:{c=a.length;for(var d=p(a)?a.split(""):a,e=0;c>e;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:p(a)?a.charAt(c):a[c]}function Lb(a,b){a.sort(b||Mb)}function Mb(a,b){return a>b?1:b>a?-1:0}function Qb(a){return-1!=Nb.indexOf(a)}function Xb(a,b){if(!ga(a))throw Error("encodeByteArray takes an array as a parameter");if(!Vb){Vb={},Wb={};for(var c=0;65>c;c++)Vb[c]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c),Wb[c]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(c)}for(var c=b?Wb:Vb,d=[],e=0;e<a.length;e+=3){var f=a[e],g=e+1<a.length,h=g?a[e+1]:0,i=e+2<a.length,j=i?a[e+2]:0,k=f>>2,f=(3&f)<<4|h>>4,h=(15&h)<<2|j>>6,j=63&j;i||(j=64,g||(h=64)),d.push(c[k],c[f],c[h],c[j])}return d.join("")}function v(a,b){if(!a)throw Error("Firebase INTERNAL ASSERT FAILED:"+b)}function Zb(a){try{if("undefined"!=typeof atob)return atob(a)}catch(b){M("base64DecodeIfNativeSupport failed: ",b)}return null}function $b(a){var b=wa(a);a=new Bb,a.update(b);var b=[],c=8*a.Kc;56>a.kb?a.update(a.vc,56-a.kb):a.update(a.vc,a.ra-(a.kb-56));for(var d=a.ra-1;d>=56;d--)a.Sc[d]=255&c,c/=256;for(Cb(a,a.Sc),d=c=0;5>d;d++)for(var e=24;e>=0;e-=8)b[c]=a.F[d]>>e&255,++c;return Xb(b)}function ac(){for(var a="",b=0;b<arguments.length;b++)a=ga(arguments[b])?a+ac.apply(null,arguments[b]):"object"==typeof arguments[b]?a+u(arguments[b]):a+arguments[b],a+=" ";return a}function M(){if(!0===cc&&(cc=!1,null===bc&&!0===J.get("logging_enabled")&&dc(!0)),bc){var a=ac.apply(null,arguments);bc(a)}}function ec(a){return function(){M(a,arguments)}}function fc(){if("undefined"!=typeof console){var a="FIREBASE INTERNAL ERROR: "+ac.apply(null,arguments);"undefined"!=typeof console.error?console.error(a):console.log(a)}}function gc(){var a=ac.apply(null,arguments);throw Error("FIREBASE FATAL ERROR: "+a)}function O(){if("undefined"!=typeof console){var a="FIREBASE WARNING: "+ac.apply(null,arguments);"undefined"!=typeof console.warn?console.warn(a):console.log(a)}}function hc(a){var b="",c="",d="",e=!0,f="https",g="";if(p(a)){var h=a.indexOf("//");h>=0&&(f=a.substring(0,h-1),a=a.substring(h+2)),h=a.indexOf("/"),-1===h&&(h=a.length),b=a.substring(0,h),a=a.substring(h+1);var i=b.split(".");if(3===i.length){for(h=i[2].indexOf(":"),e=h>=0?"https"===f||"wss"===f:!0,c=i[1],d=i[0],g="",a=("/"+a).split("/"),h=0;h<a.length;h++)if(0<a[h].length){i=a[h];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(j){}g+="/"+i}d=d.toLowerCase()}else 2===i.length&&(c=i[0])}return{host:b,domain:c,Ve:d,Ya:e,scheme:f,Rb:g}}function Ia(a){return ha(a)&&(a!=a||a==Number.POSITIVE_INFINITY||a==Number.NEGATIVE_INFINITY)}function ic(a){if("complete"===document.readyState)a();else{var b=!1,c=function(){document.body?b||(b=!0,a()):setTimeout(c,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",c,!1),window.addEventListener("load",c,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&c()}),window.attachEvent("onload",c))}}function jc(a,b){return a!==b?null===a?-1:null===b?1:typeof a!=typeof b?"number"==typeof a?-1:1:a>b?1:-1:0}function kc(a,b){if(a===b)return 0;var c=lc(a),d=lc(b);return null!==c?null!==d?0==c-d?a.length-b.length:c-d:-1:null!==d?1:b>a?-1:1}function mc(a,b){if(b&&a in b)return b[a];throw Error("Missing required key ("+a+") in object: "+u(b))}function Ta(a){if("object"!=typeof a||null===a)return u(a);var b,c=[];for(b in a)c.push(b);c.sort(),b="{";for(var d=0;d<c.length;d++)0!==d&&(b+=","),b+=u(c[d]),b+=":",b+=Ta(a[c[d]]);return b+"}"}function nc(a,b){if(a.length<=b)return[a];for(var c=[],d=0;d<a.length;d+=b)c.push(d+b>a?a.substring(d,a.length):a.substring(d,d+b));return c}function oc(a,b){if(fa(a))for(var c=0;c<a.length;++c)b(c,a[c]);else pc(a,b)}function qc(a,b){return b?r(a,b):a}function rc(a){v(!Ia(a),"Invalid JSON number");var b,c,d,e;for(0===a?(d=c=0,b=-1/0===1/a?1:0):(b=0>a,a=Math.abs(a),a>=Math.pow(2,-1022)?(d=Math.min(Math.floor(Math.log(a)/Math.LN2),1023),c=d+1023,d=Math.round(a*Math.pow(2,52-d)-Math.pow(2,52))):(c=0,d=Math.round(a/Math.pow(2,-1074)))),e=[],a=52;a;a-=1)e.push(d%2?1:0),d=Math.floor(d/2);for(a=11;a;a-=1)e.push(c%2?1:0),c=Math.floor(c/2);for(e.push(b?1:0),e.reverse(),b=e.join(""),c="",a=0;64>a;a+=8)d=parseInt(b.substr(a,8),2).toString(16),1===d.length&&(d="0"+d),c+=d;return c.toLowerCase()}function sc(a){var b="Unknown Error";return"too_big"===a?b="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"==a?b="Client doesn't have permission to access the desired data.":"unavailable"==a&&(b="The service is unavailable"),b=Error(a+": "+b),b.code=a.toUpperCase(),b}function lc(a){return tc.test(a)&&(a=Number(a),a>=-2147483648&&2147483647>=a)?a:null}function uc(a){try{a()}catch(b){setTimeout(function(){throw b},Math.floor(0))}}function P(a){if(ia(a)){var b=Array.prototype.slice.call(arguments,1).slice();uc(function(){a.apply(null,b)})}}function vc(a,b){this.H=a,v(null!==this.H,"LeafNode shouldn't be created with null value."),this.pb="undefined"!=typeof b?b:null}function xc(a,b){return jc(a.la,b.la)||kc(a.name,b.name)}function yc(a,b){return kc(a.name,b.name)}function zc(a,b){return kc(a,b)}function R(a,b){this.o=a||new cb(zc),this.pb="undefined"!=typeof b?b:null}function Ac(a,b,c){R.call(this,a,c),null===b&&(b=new cb(xc),a.Fa(function(a,c){b=b.ta({name:a,la:c.m()},c)})),this.ya=b}function S(a,b){if(null===a)return Q;var c=null;if("object"==typeof a&&".priority"in a?c=a[".priority"]:"undefined"!=typeof b&&(c=b),v(null===c||"string"==typeof c||"number"==typeof c||"object"==typeof c&&".sv"in c,"Invalid priority type found: "+typeof c),"object"==typeof a&&".value"in a&&null!==a[".value"]&&(a=a[".value"]),"object"!=typeof a||".sv"in a)return new vc(a,c);if(a instanceof Array){var d=Q,e=a;return pc(e,function(a,b){if(A(e,b)&&"."!==b.substring(0,1)){var c=S(a);(c.Q()||!c.f())&&(d=d.K(b,c))}}),d.La(c)}var f=[],g={},h=!1,i=a;oc(i,function(a,b){if("string"!=typeof b||"."!==b.substring(0,1)){var c=S(i[b]);c.f()||(h=h||null!==c.m(),f.push({name:b,la:c.m()}),g[b]=c)}});var j=Cc(f,g,!1);if(h){var k=Cc(f,g,!0);return new Ac(j,k,c)}return new R(j,c)}function Ec(a){this.count=parseInt(Math.log(a+1)/Dc,10),this.Fd=this.count-1,this.pe=a+1&parseInt(Array(this.count+1).join("1"),2)}function Fc(a){var b=!(a.pe&1<<a.Fd);return a.Fd--,b}function Cc(a,b,c){function d(e,f){var g=f-e;if(0==g)return null;if(1==g){var g=a[e].name,h=c?a[e]:g;return new jb(h,b[g],!1,null,null)}var h=parseInt(g/2,10)+e,i=d(e,h),j=d(h+1,f),g=a[h].name,h=c?a[h]:g;return new jb(h,b[g],!1,i,j)}var e=c?xc:yc;a.sort(e);var f=function(e){function f(e,f){var j=i-e,k=i;i-=e;var l=a[j].name,j=new jb(c?a[j]:l,b[l],f,null,d(j+1,k));g?g.left=j:h=j,g=j}for(var g=null,h=null,i=a.length,j=0;j<e.count;++j){var k=Fc(e),l=Math.pow(2,e.count-(j+1));k?f(l,!1):(f(l,!1),f(l,!0))}return h}(new Ec(a.length)),e=c?xc:zc;return null!==f?new cb(e,f):new cb(e)}function wc(a){return"number"==typeof a?"number:"+rc(a):"string:"+a}function T(a,b){this.A=a,this.Cc=b}function Gc(a){v(fa(a)&&0<a.length,"Requires a non-empty array"),this.he=a,this.Jb={}}function Hc(a,b){v(Kb(a.he,function(a){return a===b}),"Unknown event: "+b)}function Ic(){Gc.call(this,["visible"]);var a,b;if("undefined"!=typeof document&&"undefined"!=typeof document.addEventListener&&("undefined"!=typeof document.hidden?(b="visibilitychange",a="hidden"):"undefined"!=typeof document.mozHidden?(b="mozvisibilitychange",a="mozHidden"):"undefined"!=typeof document.msHidden?(b="msvisibilitychange",a="msHidden"):"undefined"!=typeof document.webkitHidden&&(b="webkitvisibilitychange",a="webkitHidden")),this.xb=!0,b){var c=this;
|
||
document.addEventListener(b,function(){var b=!document[a];b!==c.xb&&(c.xb=b,c.Mc("visible",b))},!1)}}function Jc(){if(Gc.call(this,["online"]),this.Ob=!0,"undefined"!=typeof window&&"undefined"!=typeof window.addEventListener){var a=this;window.addEventListener("online",function(){a.Ob||a.Mc("online",!0),a.Ob=!0},!1),window.addEventListener("offline",function(){a.Ob&&a.Mc("online",!1),a.Ob=!1},!1)}}function pc(a,b){for(var c in a)b.call(void 0,a[c],c,a)}function Kc(a){var b,c=[],d=0;for(b in a)c[d++]=b;return c}function Lc(a){for(var b in a)return!1;return!0}function Mc(a){var b,c={};for(b in a)c[b]=a[b];return c}function Pc(a){for(var b,c,d=1;d<arguments.length;d++){c=arguments[d];for(b in c)a[b]=c[b];for(var e=0;e<Nc.length;e++)b=Nc[e],Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])}}function Qc(){this.Bb={}}function Rc(a,b,c){l(c)||(c=1),A(a.Bb,b)||(a.Bb[b]=0),a.Bb[b]+=c}function Sc(a){this.qe=a,this.mc=null}function Tc(a,b){this.yd={},this.Hc=new Sc(a),this.n=b;var c=1e4+2e4*Math.random();setTimeout(r(this.Ud,this),Math.floor(c))}function Wc(a){return a=a.toString(),Uc[a]||(Uc[a]=new Qc),Uc[a]}function Xc(a,b){var c=a.toString();return Vc[c]||(Vc[c]=b()),Vc[c]}function Zc(a,b,c){this.Wc=a,this.e=ec(this.Wc),this.frames=this.Hb=null,this.Na=this.Oa=this.Ad=0,this.ga=Wc(b),this.Ca=(b.Ya?"wss://":"ws://")+b.ia+"/.ws?v=5","undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(this.Ca+="&r=f"),b.host!==b.ia&&(this.Ca=this.Ca+"&ns="+b.Ta),c&&(this.Ca=this.Ca+"&s="+c)}function bd(a,b){if(a.frames.push(b),a.frames.length==a.Ad){var c=a.frames.join("");a.frames=null,c=va(c),a.Ge(c)}}function ad(a){clearInterval(a.Hb),a.Hb=setInterval(function(){a.Y&&a.Y.send("0"),ad(a)},Math.floor(45e3))}function cd(a){this.ob=a,this.xc=[],this.eb=0,this.Vc=-1,this.Va=null}function dd(a,b,c){a.Vc=b,a.Va=c,a.Vc<a.eb&&(a.Va(),a.Va=null)}function ed(a,b,c){for(a.xc[b]=c;a.xc[a.eb];){var d=a.xc[a.eb];delete a.xc[a.eb];for(var e=0;e<d.length;++e)if(d[e]){var f=a;uc(function(){f.ob(d[e])})}if(a.eb===a.Vc){a.Va&&(clearTimeout(a.Va),a.Va(),a.Va=null);break}a.eb++}}function fd(){this.set={}}function gd(a,b){pc(a.set,function(a,c){b(c,a)})}function hd(a,b,c){this.Wc=a,this.e=ec(a),this.Na=this.Oa=0,this.ga=Wc(b),this.Gc=c,this.Db=!1,this.dc=function(a){b.host!==b.ia&&(a.ns=b.Ta);var c,d=[];for(c in a)a.hasOwnProperty(c)&&d.push(c+"="+a[c]);return(b.Ya?"https://":"http://")+b.ia+"/.lp?"+d.join("&")}}function ld(a,b){var c=u(b).length;a.Na+=c,Rc(a.ga,"bytes_received",c)}function kd(a,b,c,d){if(this.dc=d,this.ka=c,this.od=new fd,this.Tb=[],this.Yc=Math.floor(1e8*Math.random()),this.Fc=!0,this.Nc=Yb(),window["pLPCommand"+this.Nc]=a,window["pRTLPCB"+this.Nc]=b,a=document.createElement("iframe"),a.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(a);try{a.contentWindow.document||M("No IE domain setting required")}catch(e){a.src="javascript:void((function(){document.open();document.domain='"+document.domain+"';document.close();})())"}a.contentDocument?a.Da=a.contentDocument:a.contentWindow?a.Da=a.contentWindow.document:a.document&&(a.Da=a.document),this.aa=a,a="",this.aa.src&&"javascript:"===this.aa.src.substr(0,11)&&(a='<script>document.domain="'+document.domain+'";</script>'),a="<html><body>"+a+"</body></html>";try{this.aa.Da.open(),this.aa.Da.write(a),this.aa.Da.close()}catch(f){M("frame writing exception"),f.stack&&M(f.stack),M(f)}}function nd(a){if(a.Qc&&a.Fc&&a.od.count()<(0<a.Tb.length?2:1)){a.Yc++;var b={};b.id=a.Be,b.pw=a.Ce,b.ser=a.Yc;for(var b=a.dc(b),c="",d=0;0<a.Tb.length&&1870>=a.Tb[0].Gd.length+30+c.length;){var e=a.Tb.shift(),c=c+"&seg"+d+"="+e.Pe+"&ts"+d+"="+e.We+"&d"+d+"="+e.Gd;d++}return od(a,b+c,a.Yc),!0}return!1}function od(a,b,c){function d(){a.od.remove(c),nd(a)}a.od.add(c);var e=setTimeout(d,Math.floor(25e3));md(a,b,function(){clearTimeout(e),d()})}function md(a,b,c){setTimeout(function(){try{if(a.Fc){var d=a.aa.Da.createElement("script");d.type="text/javascript",d.async=!0,d.src=b,d.onload=d.onreadystatechange=function(){var a=d.readyState;a&&"loaded"!==a&&"complete"!==a||(d.onload=d.onreadystatechange=null,d.parentNode&&d.parentNode.removeChild(d),c())},d.onerror=function(){M("Long-poll script failed to load: "+b),a.Fc=!1,a.close()},a.aa.Da.body.appendChild(d)}}catch(e){}},Math.floor(1))}function pd(a){qd(this,a)}function qd(a,b){var c=Zc&&Zc.isAvailable(),d=c&&!(xb.Nd||!0===xb.get("previous_websocket_failure"));if(b.Ye&&(c||O("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),d=!0),d)a.bc=[Zc];else{var e=a.bc=[];oc(rd,function(a,b){b&&b.isAvailable()&&e.push(b)})}}function sd(a){if(0<a.bc.length)return a.bc[0];throw Error("No transports available")}function td(a,b,c,d,e,f){this.id=a,this.e=ec("c:"+this.id+":"),this.ob=c,this.Nb=d,this.U=e,this.md=f,this.D=b,this.wc=[],this.Dd=0,this.ce=new pd(b),this.oa=0,this.e("Connection created"),ud(this)}function ud(a){var b=sd(a.ce);a.C=new b("c:"+a.id+":"+a.Dd++,a.D),a.qd=b.responsesRequiredToBeHealthy||0;var c=vd(a,a.C),d=wd(a,a.C);a.cc=a.C,a.$b=a.C,a.w=null,a.Sa=!1,setTimeout(function(){a.C&&a.C.open(c,d)},Math.floor(0)),b=b.healthyTimeout||0,b>0&&(a.kc=setTimeout(function(){a.kc=null,a.Sa||(a.C&&102400<a.C.Na?(a.e("Connection exceeded healthy timeout but has received "+a.C.Na+" bytes. Marking connection healthy."),a.Sa=!0,a.C.nc()):a.C&&10240<a.C.Oa?a.e("Connection exceeded healthy timeout but has sent "+a.C.Oa+" bytes. Leaving connection alive."):(a.e("Closing unhealthy connection after timeout."),a.close()))},Math.floor(b)))}function wd(a,b){return function(c){b===a.C?(a.C=null,c||0!==a.oa?1===a.oa&&a.e("Realtime connection lost."):(a.e("Realtime connection failed."),"s-"===a.D.ia.substr(0,2)&&(xb.remove("host:"+a.D.host),a.D.ia=a.D.host)),a.close()):b===a.w?(a.e("Secondary connection lost."),c=a.w,a.w=null,a.cc!==c&&a.$b!==c||a.close()):a.e("closing an old connection")}}function vd(a,b){return function(c){if(2!=a.oa)if(b===a.$b){var d=mc("t",c);if(c=mc("d",c),"c"==d){if(d=mc("t",c),"d"in c)if(c=c.d,"h"===d){var d=c.ts,e=c.v,f=c.h;a.Gc=c.s,zb(a.D,f),0==a.oa&&(a.C.start(),xd(a,a.C,d),"5"!==e&&O("Protocol version mismatch detected"),c=a.ce,(c=1<c.bc.length?c.bc[1]:null)&&yd(a,c))}else if("n"===d){for(a.e("recvd end transmission on primary"),a.$b=a.w,c=0;c<a.wc.length;++c)a.tc(a.wc[c]);a.wc=[],zd(a)}else"s"===d?(a.e("Connection shutdown command received. Shutting down..."),a.md&&(a.md(c),a.md=null),a.U=null,a.close()):"r"===d?(a.e("Reset packet received. New host: "+c),zb(a.D,c),1===a.oa?a.close():(Ad(a),ud(a))):"e"===d?fc("Server Error: "+c):"o"===d?(a.e("got pong on primary."),Dd(a),Ed(a)):fc("Unknown control packet command: "+d)}else"d"==d&&a.tc(c)}else if(b===a.w)if(d=mc("t",c),c=mc("d",c),"c"==d)"t"in c&&(c=c.t,"a"===c?Fd(a):"r"===c?(a.e("Got a reset on secondary, closing it"),a.w.close(),a.cc!==a.w&&a.$b!==a.w||a.close()):"o"===c&&(a.e("got pong on secondary."),a.Yd--,Fd(a)));else{if("d"!=d)throw Error("Unknown protocol layer: "+d);a.wc.push(c)}else a.e("message on old connection")}}function zd(a){a.cc===a.w&&a.$b===a.w&&(a.e("cleaning up and promoting a connection: "+a.w.Wc),a.C=a.w,a.w=null)}function Fd(a){0>=a.Yd?(a.e("Secondary connection is healthy."),a.Sa=!0,a.w.nc(),a.w.start(),a.e("sending client ack on secondary"),a.w.send({t:"c",d:{t:"a",d:{}}}),a.e("Ending transmission on primary"),a.C.send({t:"c",d:{t:"n",d:{}}}),a.cc=a.w,zd(a)):(a.e("sending ping on secondary."),a.w.send({t:"c",d:{t:"p",d:{}}}))}function Dd(a){a.Sa||(a.qd--,0>=a.qd&&(a.e("Primary connection is healthy."),a.Sa=!0,a.C.nc()))}function yd(a,b){a.w=new b("c:"+a.id+":"+a.Dd++,a.D,a.Gc),a.Yd=b.responsesRequiredToBeHealthy||0,a.w.open(vd(a,a.w),wd(a,a.w)),setTimeout(function(){a.w&&(a.e("Timed out trying to upgrade."),a.w.close())},Math.floor(6e4))}function xd(a,b,c){a.e("Realtime connection established."),a.C=b,a.oa=1,a.Nb&&(a.Nb(c),a.Nb=null),0===a.qd?(a.e("Primary connection is healthy."),a.Sa=!0):setTimeout(function(){Ed(a)},Math.floor(5e3))}function Ed(a){a.Sa||1!==a.oa||(a.e("sending ping on primary."),Gd(a,{t:"c",d:{t:"p",d:{}}}))}function Gd(a,b){if(1!==a.oa)throw"Connection is not connected";a.cc.send(b)}function Ad(a){a.e("Shutting down all connections"),a.C&&(a.C.close(),a.C=null),a.w&&(a.w.close(),a.w=null),a.kc&&(clearTimeout(a.kc),a.kc=null)}function Hd(a){var b={},c={},d={},e="";try{var f=a.split("."),b=va(Zb(f[0])||""),c=va(Zb(f[1])||""),e=f[2],d=c.d||{};delete c.d}catch(g){}return{cf:b,Uc:c,data:d,Ue:e}}function Id(a){return a=Hd(a).Uc,"object"==typeof a&&a.hasOwnProperty("iat")?B(a,"iat"):null}function Jd(a){a=Hd(a);var b=a.Uc;return!!a.Ue&&!!b&&"object"==typeof b&&b.hasOwnProperty("iat")}function Kd(a,b,c,d,e){this.id=Ld++,this.e=ec("p:"+this.id+":"),this.Za=!0,this.ja={},this.V=[],this.Pb=0,this.Mb=[],this.T=!1,this.va=1e3,this.oc=3e5,this.uc=b||ca,this.sc=c||ca,this.nd=d||ca,this.dd=e||ca,this.D=a,this.ud=null,this.Xb={},this.Oe=0,this.Ib=this.hd=null,Md(this,0),Ic.ib().Ua("visible",this.Je,this),-1===a.host.indexOf("fblocal")&&Jc.ib().Ua("online",this.He,this)}function Od(a,b,c){var d=b.toString(),e=b.path().toString();a.ja[e]=a.ja[e]||{},v(!a.ja[e][d],"listen() called twice for same path/queryId."),a.ja[e][d]={qb:b.qb(),G:c},a.T&&Pd(a,e,d,b.qb(),c)}function Pd(a,b,c,d,e){a.e("Listen on "+b+" for "+c);var f={p:b};d=Hb(d,function(a){return Sa(a)}),"{}"!==c&&(f.q=d),f.h=a.dd(b),a.Ja("l",f,function(d){a.e("listen response",d),d=d.s,"ok"!==d&&Qd(a,b,c),e&&e(d)})}function Rd(a){var b=a.bb;a.T&&b&&a.Ja("auth",{cred:b.re},function(c){var d=c.s;c=c.d||"error","ok"!==d&&a.bb===b&&delete a.bb,b.Id?"ok"!==d&&b.fc&&b.fc(d,c):(b.Id=!0,b.ca&&b.ca(d,c))})}function Sd(a,b,c,d){b=b.toString(),Qd(a,b,c)&&a.T&&Td(a,b,c,d)}function Td(a,b,c,d){a.e("Unlisten on "+b+" for "+c),b={p:b},d=Hb(d,function(a){return Sa(a)}),"{}"!==c&&(b.q=d),a.Ja("u",b)}function Ud(a,b,c,d){a.T?Vd(a,"o",b,c,d):a.Mb.push({Rb:b,action:"o",data:c,G:d})}function Wd(a,b,c,d){a.T?Vd(a,"om",b,c,d):a.Mb.push({Rb:b,action:"om",data:c,G:d})}function Vd(a,b,c,d,e){c={p:c,d:d},a.e("onDisconnect "+b,c),a.Ja(b,c,function(a){e&&setTimeout(function(){e(a.s,a.d)},Math.floor(0))})}function Yd(a,b,c,d){Xd(a,"m",b,c,d,void 0)}function Xd(a,b,c,d,e,f){c={p:c,d:d},l(f)&&(c.h=f),a.V.push({action:b,Vd:c,G:e}),a.Pb++,b=a.V.length-1,a.T&&Zd(a,b)}function Zd(a,b){var c=a.V[b].action,d=a.V[b].Vd,e=a.V[b].G;a.V[b].Le=a.T,a.Ja(c,d,function(d){a.e(c+" response",d),delete a.V[b],a.Pb--,0===a.Pb&&(a.V=[]),e&&e(d.s,d.d)})}function Md(a,b){v(!a.ma,"Scheduling a connect when we're already connected/ing?"),a.gb&&clearTimeout(a.gb),a.gb=setTimeout(function(){a.gb=null,ae(a)},Math.floor(b))}function ae(a){if(a.Za){a.e("Making a connection attempt"),a.hd=(new Date).getTime(),a.Ib=null;var b=r(a.tc,a),c=r(a.Nb,a),d=r(a.Qd,a),e=a.id+":"+Nd++;a.ma=new td(e,a.D,b,c,d,function(b){O(b+" ("+a.D.toString()+")"),a.Za=!1})}}function $d(a,b,c){c=c?Hb(c,function(a){return Ta(a)}).join("$"):"{}",(a=Qd(a,b,c))&&a.G&&a.G("permission_denied")}function Qd(a,b,c){b=new H(b).toString(),c||(c="{}");var d=a.ja[b][c];return delete a.ja[b][c],d}function be(){this.o=this.H=null}function ce(a,b){if(b.f())return a.H=null,a.o=null,!0;if(null!==a.H){if(a.H.Q())return!1;var c=a.H;return a.H=null,c.B(function(b,c){a.rb(new H(b),c)}),ce(a,b)}return null!==a.o?(c=D(b),b=Ua(b),a.o.contains(c)&&ce(a.o.get(c),b)&&a.o.remove(c),a.o.f()?(a.o=null,!0):!1):!0}function de(a,b,c){null!==a.H?c(b,a.H):a.B(function(a,d){var e=new H(b.toString()+"/"+a);de(d,e,c)})}function ee(){this.ba=Q}function U(a,b){return a.ba.N(b)}function V(a,b,c){a.ba=a.ba.Ba(b,c)}function fe(){this.wa=new ee,this.O=new ee,this.qa=new ee,this.Sb=new Ya}function ge(a,b,c){return V(a.wa,b,c),he(a,b)}function he(a,b){for(var c=U(a.wa,b),d=U(a.O,b),e=I(a.Sb,b),f=!1,g=e;null!==g;){if(null!==g.k()){f=!0;break}g=g.parent()}return f?!1:(c=ie(c,d,e),c!==d?(V(a.O,b,c),!0):!1)}function ie(a,b,c){return c.f()?a:null!==c.k()?b:(a=a||Q,c.B(function(d){d=d.name();var e=a.P(d),f=b.P(d),g=I(c,d),e=ie(e,f,g);a=a.K(d,e)}),a)}function je(a,b){Fb(b,function(b){var c=b.Re;b=I(a.Sb,b.path);var d=b.k();v(null!==d,"pendingPut should not be null."),d===c&&Za(b,null)})}function ke(a,b){return a&&"object"==typeof a?(v(".sv"in a,"Unexpected leaf node or priority contents"),b[a[".sv"]]):a}function le(a,b){var c=new be;return de(a,new H(""),function(a,d){c.rb(a,me(d,b))}),c}function me(a,b){var c,d=ke(a.m(),b);if(a.Q()){var e=ke(a.k(),b);return e!==a.k()||d!==a.m()?new vc(e,d):a}return c=a,d!==a.m()&&(c=c.La(d)),a.B(function(a,d){var e=me(d,b);e!==d&&(c=c.K(a,e))}),c}function oe(a,b,c){this.hc=a||{},this.Lc=b||{},this.ub=c||{},this.hc.remember||(this.hc.remember="default")}function qe(a){var b={},c={};return Aa(a||{},function(a,d){0<=Eb(pe,a)?b[a]=d:c[a]=d}),new oe(b,{},c)}function W(a){var b=Error(B(re,a),a);return b.code=a,b}function se(){var a,b=window.opener.frames;for(a=b.length-1;a>=0;a--)try{if(b[a].location.protocol===window.location.protocol&&b[a].location.host===window.location.host&&"__winchan_relay_frame"===b[a].name)return b[a]}catch(c){}return null}function te(a,b,c){a.attachEvent?a.attachEvent("on"+b,c):a.addEventListener&&a.addEventListener(b,c,!1)}function ue(a,b,c){a.detachEvent?a.detachEvent("on"+b,c):a.removeEventListener&&a.removeEventListener(b,c,!1)}function ve(a){/^https?:\/\//.test(a)||(a=window.location.href);var b=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(a);return b?b[1]:a}function we(a){var b="";try{a=a.replace("#","");var c={},d=a.replace(/^\?/,"").split("&");for(a=0;a<d.length;a++)if(d[a]){var e=d[a].split("=");c[e[0]]=e[1]}c&&A(c,"__firebase_request_key")&&(b=B(c,"__firebase_request_key"))}catch(f){}return b}function xe(a){var b,c=[];for(b in a)if(A(a,b)){var d=B(a,b);if(fa(d))for(var e=0;e<d.length;e++)c.push(encodeURIComponent(b)+"="+encodeURIComponent(d[e]));else c.push(encodeURIComponent(b)+"="+encodeURIComponent(B(a,b)))}return c.join("&")}function ye(){var a=hc(ne);return a.scheme+"://"+a.host+"/v2"}function ze(){return!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(navigator.userAgent)}function Ae(){var a=navigator.userAgent;if("Microsoft Internet Explorer"===navigator.appName){if((a=a.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/))&&1<a.length)return 8<=parseFloat(a[1])}else if(-1<a.indexOf("Trident")&&(a=a.match(/rv:([0-9]{2,2}[\.0-9]{0,})/))&&1<a.length)return 8<=parseFloat(a[1]);return!1}function Be(a){a=a||{},a.method||(a.method="GET"),a.headers||(a.headers={}),a.headers.content_type||(a.headers.content_type="application/json"),a.headers.content_type=a.headers.content_type.toLowerCase(),this.options=a}function Ce(a){a=a||{},this.Yb=Db()+Db()+Db(),this.Rd=a||{}}function De(a){a=a||{},(!a.window_features||-1!==navigator.userAgent.indexOf("Fennec/")||-1!==navigator.userAgent.indexOf("Firefox/")&&-1!==navigator.userAgent.indexOf("Android"))&&(a.window_features=void 0),a.window_name||(a.window_name="_blank"),a.relay_url||(a.relay_url=ye()+"/auth/channel"),this.options=a}function Ee(a){a=a||{},a.callback_parameter||(a.callback_parameter="callback"),this.options=a,window.__firebase_auth_jsonp=window.__firebase_auth_jsonp||{}}function Fe(a,b,c){setTimeout(function(){try{var d=document.createElement("script");d.type="text/javascript",d.id=a,d.async=!0,d.src=b,d.onerror=function(){var b=document.getElementById(a);null!==b&&b.parentNode.removeChild(b),c&&c(W("NETWORK_ERROR"))};var e=document.getElementsByTagName("head");(e&&0!=e.length?e[0]:document.documentElement).appendChild(d)}catch(f){c&&c(W("NETWORK_ERROR"))}},0)}function Ge(a,b){this.pd=["session",a.yc,a.Ta].join(":"),this.Ic=b}function He(a){a=a||{},this.Yb=Db()+Db()+Db(),this.Rd=a||{}}function Ie(a,b,c,d){Gc.call(this,["auth_status"]),this.D=a,this.Cd=b,this.Xe=c,this.jd=d,this.vb=new Ge(a,[xb,J]),this.Ma=null,Je(this)}function Je(a){J.get("redirect_request_id")&&Ke(a);var b=a.vb.get();b&&b.token?(Le(a,b),a.Cd(b.token,function(c,d){Me(a,c,d,!1,b.token,b)},function(b,c){Ne(a,"resumeSession()",b,c)})):Le(a,null)}function Oe(a,b,c,d,e,f){"firebaseio-demo.com"===a.D.domain&&O("FirebaseRef.auth() not supported on demo Firebases (*.firebaseio-demo.com). Please use on production Firebases only (*.firebaseio.com)."),a.Cd(b,function(f,g){Me(a,f,g,!0,b,c,d||{},e)},function(b,c){Ne(a,"auth()",b,c,f)})}function Pe(a,b){a.vb.clear(),Le(a,null),a.Xe(function(a,c){if("ok"===a)P(b);else{var d=(a||"error").toUpperCase(),e=d;c&&(e+=": "+c),e=Error(e),e.code=d,P(b,e)}})}function Me(a,b,c,d,e,f,g,h){"ok"===b?(d&&(b=c.auth,f.auth=b,f.expires=c.expires,f.token=Jd(e)?e:"",c=null,b&&A(b,"uid")?c=B(b,"uid"):A(f,"uid")&&(c=B(f,"uid")),f.uid=c,c="custom",b&&A(b,"provider")?c=B(b,"provider"):A(f,"provider")&&(c=B(f,"provider")),f.provider=c,a.vb.clear(),Jd(e)&&(g=g||{},c=xb,"sessionOnly"===g.remember&&(c=J),"none"!==g.remember&&a.vb.set(f,c)),Le(a,f)),P(h,null,f)):(a.vb.clear(),Le(a,null),f=a=(b||"error").toUpperCase(),c&&(f+=": "+c),f=Error(f),f.code=a,P(h,f))}function Ne(a,b,c,d,e){O(b+" was canceled: "+d),a.vb.clear(),Le(a,null),a=Error(d),a.code=c.toUpperCase(),P(e,a)}function Qe(a,b,c,d){Re(a);var e=[Be,Ee];c=qe(c),Se(a,e,"/auth/"+b,c,d)}function Te(a,b,c,d){Re(a);var e=[De,Ce];c=qe(c),"anonymous"===b||"password"===b?setTimeout(function(){P(d,W("TRANSPORT_UNAVAILABLE"))},0):(c.Lc.window_features="menubar=yes,modal=yes,alwaysRaised=yeslocation=yes,resizable=yes,scrollbars=yes,status=yes,height=625,width=625,top="+("object"==typeof screen?.5*(screen.height-625):0)+",left="+("object"==typeof screen?.5*(screen.width-625):0),c.Lc.relay_url=ye()+"/"+a.D.Ta+"/auth/channel",c.Lc.requestWithCredential=r(a.Zb,a),Se(a,e,"/auth/"+b,c,d))}function Ke(a){var b=J.get("redirect_request_id");if(b){var c=J.get("redirect_client_options");J.remove("redirect_request_id"),J.remove("redirect_client_options");var d=[Be,Ee],b={requestId:b,requestKey:we(document.location.hash)},c=new oe(c,{},b);try{document.location.hash=document.location.hash.replace(/&__firebase_request_key=([a-zA-z0-9]*)/,"")}catch(e){}Se(a,d,"/auth/session",c)}}function Se(a,b,c,d,e){Ue(a,b,c,d,function(b,c){!b&&c&&c.token&&c.uid?Oe(a,c.token,c,d.hc,function(a,b){a?P(e,a):P(e,null,b)}):P(e,b||W("UNKNOWN_ERROR"))})}function Ue(a,b,c,d,e){b=Gb(b,function(a){return"function"==typeof a.isAvailable&&a.isAvailable()}),0===b.length?setTimeout(function(){P(e,W("TRANSPORT_UNAVAILABLE"))},0):(b=new(b.shift())(d.Lc),d=Ba(d.ub),d.v="js-1.1.2",d.transport=b.Ab(),d.suppress_status_codes=!0,a=ye()+"/"+a.D.Ta+c,b.open(a,d,function(a,b){if(a)P(e,a);else if(b&&b.error){var c=Error(b.error.message);c.code=b.error.code,c.details=b.error.details,P(e,c)}else P(e,null,b)}))}function Le(a,b){var c=null!==a.Ma||null!==b;a.Ma=b,c&&a.Mc("auth_status",b),a.jd(null!==b)}function Re(a){var b=a.D;if("firebaseio.com"!==b.domain&&"firebaseio-demo.com"!==b.domain&&"auth.firebase.com"===ne)throw Error("This custom Firebase server ('"+a.D.domain+"') does not support delegated login.")}function Ve(){this.hb=[]}function We(a,b){if(0!==b.length)for(var c=0;c<b.length;c++)a.hb.push(b[c])}function Xe(a){var b=a.ca,c=a.$d,d=a.Ub;uc(function(){b(c,d)})}function X(a,b,c,d){this.type=a,this.xa=b,this.da=c,this.Ub=d}function Ye(a){this.S=a,this.sa=[],this.Zc=new Ve}function Ze(a,b,c,d,e){a.sa.push({type:b,ca:c,cancel:d,$:e}),d=[];var f=$e(a.j);a.Gb&&f.push(new X("value",a.j));for(var g=0;g<f.length;g++)if(f[g].type===b){var h=new G(a.S.i,a.S.path);f[g].da&&(h=h.J(f[g].da)),d.push({ca:qc(c,e),$d:new T(f[g].xa,h),Ub:f[g].Ub})}We(a.Zc,d)}function af(a,b){for(var c=[],d=0;d<b.length;d++){var e=b[d],f=e.type,g=new G(a.S.i,a.S.path);for(b[d].da&&(g=g.J(b[d].da)),g=new T(b[d].xa,g),"value"!==e.type||g.Fb()?"value"!==e.type&&(f+=" "+g.name()):f+="("+g.X()+")",M(a.S.i.n.id+": event:"+a.S.path+":"+a.S.Wa()+":"+f),f=0;f<a.sa.length;f++){var h=a.sa[f];b[d].type===h.type&&c.push({ca:qc(h.ca,h.$),$d:g,Ub:e.Ub})}}We(a.Zc,c)}function $e(a){var b=[];if(!a.Q()){var c=null;a.B(function(a,d){b.push(new X("child_added",d,a,c)),c=a})}return b}function bf(a){a.Gb||(a.Gb=!0,af(a,[new X("value",a.j)]))}function cf(a,b){Ye.call(this,a),this.j=b}function df(a,b){this.jc=a,this.kd=b}function ef(a,b,c,d,e){var f=a.N(c),g=b.N(c);if(d=new df(d,e),e=ff(d,c,f,g),g=!f.f()&&!g.f()&&f.m()!==g.m(),e||g)for(f=c,c=e;null!==f.parent();){var h=a.N(f);e=b.N(f);var i=f.parent();if(!d.jc||I(d.jc,i).k()){var j=b.N(i),k=[],f=Va(f);h.f()?(h=j.ha(f,e),k.push(new X("child_added",e,f,h))):e.f()?k.push(new X("child_removed",h,f)):(h=j.ha(f,e),g&&k.push(new X("child_moved",e,f,h)),c&&k.push(new X("child_changed",e,f,h))),d.kd(i,j,k)}g&&(g=!1,c=!0),f=i}}function ff(a,b,c,d){var e,f=[];return c===d?e=!1:c.Q()&&d.Q()?e=c.k()!==d.k():c.Q()?(gf(a,b,Q,d,f),e=!0):d.Q()?(gf(a,b,c,Q,f),e=!0):e=gf(a,b,c,d,f),e?a.kd(b,d,f):c.m()!==d.m()&&a.kd(b,d,null),e}function gf(a,b,c,d,e){var f,g,h,i,j=!1,k=!a.jc||!I(a.jc,b).f(),m=[],n=[],o=[],p=[],q={},r={};for(f=c.jb(),h=ib(f),g=d.jb(),i=ib(g);null!==h||null!==i;)if(c=i,c=null===h?1:null===c?-1:h.key===c.key?0:xc({name:h.key,la:h.value.m()},{name:c.key,la:c.value.m()}),0>c?(j=B(q,h.key),l(j)?(o.push({ad:h,zd:m[j]}),m[j]=null):(r[h.key]=n.length,n.push(h)),j=!0,h=ib(f)):(c>0?(j=B(r,i.key),l(j)?(o.push({ad:n[j],zd:i}),n[j]=null):(q[i.key]=m.length,m.push(i)),j=!0):(c=b.J(i.key),(c=ff(a,c,h.value,i.value))&&(p.push(i),j=!0),h.value.m()!==i.value.m()&&(o.push({ad:h,zd:i}),j=!0),h=ib(f)),i=ib(g)),!k&&j)return!0;for(k=0;k<n.length;k++)(q=n[k])&&(c=b.J(q.key),ff(a,c,q.value,Q),e.push(new X("child_removed",q.value,q.key)));for(k=0;k<m.length;k++)(q=m[k])&&(c=b.J(q.key),n=d.ha(q.key,q.value),ff(a,c,Q,q.value),e.push(new X("child_added",q.value,q.key,n)));for(k=0;k<o.length;k++)q=o[k].ad,m=o[k].zd,c=b.J(m.key),n=d.ha(m.key,m.value),e.push(new X("child_moved",m.value,m.key,n)),(c=ff(a,c,q.value,m.value))&&p.push(m);for(k=0;k<p.length;k++)a=p[k],n=d.ha(a.key,a.value),e.push(new X("child_changed",a.value,a.key,n));return j}function hf(){this.Z=this.Aa=null,this.set={}}function jf(a,b,c){a.add(b,c),a.Z||(a.Z=c.S.path)}function kf(a){var b=a.Aa;return a.Aa=null,b}function lf(a){return a.contains("default")}function mf(a){return null!=a.Aa&&lf(a)}function nf(a,b){Ye.call(this,a),this.j=Q,this.Bc(b,$e(b))}function of(a,b,c,d){if(a.Q())return null;var e=null;return(d?a.$c:a.B).call(a,function(a,d){return pf(b,a,d)&&(e=a,c--,0===c)?!0:void 0}),e}function pf(a,b,c){for(var d=0;d<a.length;d++)if(!a[d](b,c.m()))return!1;return!0}function qf(a,b){this.n=a,this.g=b,this.rc=b.ba,this.pa=new Ya}function tf(a,b,c,d,e){var f,g=a.get(b);if(f=g){f=!1;for(var h=g.sa.length-1;h>=0;h--){var i=g.sa[h];if(!(c&&i.type!==c||d&&i.ca!==d||e&&i.$!==e)&&(g.sa.splice(h,1),f=!0,c&&d))break}}return(c=f&&!(0<g.sa.length))&&a.remove(b),c}function uf(a,b,c,d,e){b=b?b.Wa():null;var f=[];return b&&"default"!==b?tf(a,b,c,d,e)&&f.push(b):Fb(a.keys(),function(b){tf(a,b,c,d,e)&&f.push(b)}),f}function vf(a,b,c,d,e,f){var g=b.path(),g=I(a.pa,g);if(c=uf(b,c,d,e,f),b.f()&&Za(g,null),d=wf(g),0<c.length&&!d){for(d=g,e=g.parent(),c=!1;!c&&e;){if(f=e.k()){v(!mf(f));var h=d.name(),i=!1;gd(f,function(a,b){i=b.ed(h)||i}),i&&(c=!0)}d=e,e=e.parent()}return d=null,mf(b)||(b=kf(b),d=xf(a,g),b&&b()),c?null:d}return null}function yf(a,b,c){ab(I(a.pa,b),function(a){(a=a.k())&&gd(a,function(a,b){bf(b)})},c,!0)}function zf(a,b,c){function d(a){do{if(g[a.toString()])return!0;a=a.parent()}while(null!==a);return!1}var e=a.rc,f=a.g.ba;a.rc=f;for(var g={},h=0;h<c.length;h++)g[c[h].toString()]=!0;ef(e,f,b,a.pa,function(c,e,f){if(b.contains(c)){var g=d(c);g&&yf(a,c,!1),a.Ac(c,e,f),g&&yf(a,c,!0)}else a.Ac(c,e,f)}),d(b)&&yf(a,b,!0),Af(a,b)}function Af(a,b){var c=I(a.pa,b);ab(c,function(a){(a=a.k())&&gd(a,function(a,b){b.Vb()})},!0,!0),bb(c,function(a){(a=a.k())&&gd(a,function(a,b){b.Vb()})},!1)}function wf(a){return bb(a,function(a){return a.k()&&mf(a.k())})}function sf(a,b,c,d,e){if(mf(c)||wf(b))jf(c,d,e);else{var f,g;c.f()||(f=c.toString(),g=c.qb()),jf(c,d,e),c.setActive(Bf(a,c)),f&&g&&Sd(a.n,c.path(),f,g)}mf(c)&&ab(b,function(a){(a=a.k())&&(a.Aa&&a.Aa(),a.Aa=null)})}function xf(a,b){function c(b){var e=b.k();if(e&&lf(e))d.push(e.path()),null==e.Aa&&e.setActive(Bf(a,e));else{if(e){null!=e.Aa||e.setActive(Bf(a,e));var f={};gd(e,function(a,b){b.j.B(function(a){A(f,a)||(f[a]=!0,a=e.path().J(a),d.push(a))})})}b.B(c)}}var d=[];return c(b),d}function Bf(a,b){if(a.n){var c,d=a.n,e=b.path(),f=b.toString(),g=b.qb(),h=b.keys(),i=lf(b);return Od(a.n,b,function(d){"ok"!==d?(d=sc(d),O("on() or once() for "+b.path().toString()+" failed: "+d.toString()),Cf(a,b,d)):c||(i?yf(a,b.path(),!0):Fb(h,function(a){(a=b.get(a))&&bf(a)}),Af(a,b.path()))}),function(){c=!0,Sd(d,e,f,g)}}return ca}function Cf(a,b,c){b&&(gd(b,function(a,b){for(var d=0;d<b.sa.length;d++){var e=b.sa[d];e.cancel&&qc(e.cancel,e.$)(c)}}),vf(a,b))}function rf(a,b){return"default"===a.Wa()?new cf(a,b):new nf(a,b)}function Df(a,b,c,d,e){var f=b.path();b=a.Eb(f,b,d,e);var g=Q,h=[];return pc(b,function(b,i){var j=new H(i);3===b||1===b?g=g.K(i,d.N(j)):(2===b&&h.push({path:f.J(i),ua:Q}),h=h.concat(Ef(a,d.N(j),I(c,j),e)))}),[{path:f,ua:g}].concat(h)}function Ff(a,b,c,d){var e;a:{var f=I(a.pa,b);e=f.parent();for(var g=[];null!==e;){var h=e.k();if(null!==h){if(lf(h)){e=[{path:b,ua:c}];break a}if(h=a.Eb(b,h,c,d),f=B(h,f.name()),3===f||1===f){e=[{path:b,ua:c}];break a}2===f&&g.push({path:b,ua:Q})}f=e,e=e.parent()}e=g}return 1!=e.length||e[0].ua.f()&&!c.f()?(g=I(a.pa,b),f=g.k(),null!==f?lf(f)?e.push({path:b,ua:c}):e=e.concat(Df(a,f,g,c,d)):e=e.concat(Ef(a,c,g,d)),e):e}function Ef(a,b,c,d){var e=c.k();if(null!==e)return lf(e)?[{path:c.path(),ua:b}]:Df(a,e,c,b,d);var f=[];return c.B(function(c){var e=b.Q()?Q:b.P(c.name());c=Ef(a,e,c,d),f=f.concat(c)}),f}function Gf(a){this.D=a,this.ga=Wc(a),this.n=new Kd(this.D,r(this.uc,this),r(this.sc,this),r(this.nd,this),r(this.dd,this)),this.be=Xc(a,r(function(){return new Tc(this.ga,this.n)},this)),this.$a=new Ya,this.Ka=new ee,this.g=new fe,this.L=new qf(this.n,this.g.qa),this.fd=new ee,this.gd=new qf(null,this.fd),Hf(this,"connected",!1),this.U=new be,this.I=new Ie(a,r(this.n.I,this.n),r(this.n.Bd,this.n),r(this.jd,this)),this.ic=0}function If(a){return a=U(a.fd,new H(".info/serverTimeOffset")).X()||0,(new Date).getTime()+a}function Jf(a){return a=a={timestamp:If(a)},a.timestamp=a.timestamp||(new Date).getTime(),a}function Hf(a,b,c){b=new H("/.info/"+b),V(a.fd,b,S(c)),zf(a.gd,b,[b])}function Lf(a){a.e("onDisconnectEvents");var b=[],c=Jf(a);de(le(a.U,c),new H(""),function(c,d){var e=Ff(a.L,c,d,a.g.O);b.push.apply(b,a.g.set(c,e)),e=Nf(a,c),Kf(a,e),zf(a.L,e,[c])}),je(a.g,b),a.U=new be}function Of(a,b,c,d){var e=S(c);Ud(a.n,b.toString(),e.X(!0),function(c,f){"ok"===c&&a.U.rb(b,e),Mf(d,c,f)})}function Pf(a,b,c,d,e){var f=S(c,d);Ud(a.n,b.toString(),f.X(!0),function(c,d){"ok"===c&&a.U.rb(b,f),Mf(e,c,d)})}function Qf(a,b,c,d){var e,f=!0;for(e in c)f=!1;f?(M("onDisconnect().update() called with empty data. Don't do anything."),Mf(d,"ok")):Wd(a.n,b.toString(),c,function(e,f){if("ok"===e)for(var g in c){var h=S(c[g]);a.U.rb(b.J(g),h)}Mf(d,e,f)})}function Rf(a){Rc(a.ga,"deprecated_on_disconnect"),a.be.yd.deprecated_on_disconnect=!0}function Mf(a,b,c){a&&uc(function(){if("ok"==b)a(null,c);else{var d=(b||"error").toUpperCase(),e=d;c&&(e+=": "+c),e=Error(e),e.code=d,a(e)}})}function Sf(a,b,c,d,e){function f(){}a.e("transaction on "+b);var g=new G(a,b);if(g.Ua("value",f),c={path:b,update:c,G:d,status:null,Sd:Yb(),Rc:e,Xd:0,Oc:function(){g.nb("value",f)},Pc:null},a.Ka.ba=Tf(a,a.Ka.ba,a.g.O.ba,a.$a),d=c.update(U(a.Ka,b).X()),l(d)){Ga("transaction failed: Data returned ",d),c.status=1,e=I(a.$a,b);var h=e.k()||[];h.push(c),Za(e,h),h="object"==typeof d&&null!==d&&A(d,".priority")?d[".priority"]:U(a.g.O,b).m(),e=Jf(a),d=S(d,h),d=me(d,e),V(a.Ka,b,d),c.Rc&&(V(a.g.qa,b,d),zf(a.L,b,[b])),Uf(a)}else c.Oc(),c.G&&(a=Vf(a,b),c.G(null,!1,a))}function Uf(a,b){var c=b||a.$a;if(b||Wf(a,c),null!==c.k()){var d=Xf(a,c);v(0<d.length),Jb(d,function(a){return 1===a.status})&&Yf(a,c.path(),d)}else c.Fb()&&c.B(function(b){Uf(a,b)})}function Yf(a,b,c){for(var d=0;d<c.length;d++)v(1===c[d].status,"tryToSendTransactionQueue_: items in queue should all be run."),c[d].status=2,c[d].Xd++;var e=U(a.g.O,b).hash();V(a.g.O,b,U(a.g.qa,b));for(var f=U(a.Ka,b).X(!0),g=Yb(),h=Zf(c),d=0;d<h.length;d++)Za(I(a.g.Sb,h[d]),g);a.n.put(b.toString(),f,function(e){for(a.e("transaction put response",{path:b.toString(),status:e}),d=0;d<h.length;d++){var f=I(a.g.Sb,h[d]),i=f.k();v(null!==i,"sendTransactionQueue_: pendingPut should not be null."),i===g&&(Za(f,null),V(a.g.O,h[d],U(a.g.wa,h[d])))}if("ok"===e){for(e=[],d=0;d<c.length;d++)c[d].status=3,c[d].G&&(f=Vf(a,c[d].path),e.push(r(c[d].G,null,null,!0,f))),c[d].Oc();for(Wf(a,I(a.$a,b)),Uf(a),d=0;d<e.length;d++)uc(e[d])}else{if("datastale"===e)for(d=0;d<c.length;d++)c[d].status=4===c[d].status?5:1;else for(O("transaction at "+b+" failed: "+e),d=0;d<c.length;d++)c[d].status=5,c[d].Pc=e;e=Kf(a,b),zf(a.L,e,[b])}},e)}function Zf(a){for(var b={},c=0;c<a.length;c++)a[c].Rc&&(b[a[c].path.toString()]=a[c].path);a=[];for(var d in b)a.push(b[d]);return a}function Kf(a,b){var c=$f(a,b),d=c.path(),c=Xf(a,c);if(V(a.g.qa,d,U(a.g.O,d)),V(a.Ka,d,U(a.g.O,d)),0!==c.length){for(var e=U(a.g.qa,d),f=e,g=[],h=0;h<c.length;h++){var i,j=Wa(d,c[h].path),k=!1;if(v(null!==j,"rerunTransactionsUnderNode_: relativePath should not be null."),5===c[h].status)k=!0,i=c[h].Pc;else if(1===c[h].status)if(25<=c[h].Xd)k=!0,i="maxretry";else{var m=e.N(j),n=c[h].update(m.X());if(l(n)){Ga("transaction failed: Data returned ",n);var o=S(n);"object"==typeof n&&null!=n&&A(n,".priority")||(o=o.La(m.m())),e=e.Ba(j,o),c[h].Rc&&(f=f.Ba(j,o))}else k=!0,i="nodata"}k&&(c[h].status=3,setTimeout(c[h].Oc,Math.floor(0)),c[h].G&&(k=new G(a,c[h].path),j=new T(e.N(j),k),g.push("nodata"===i?r(c[h].G,null,null,!1,j):r(c[h].G,null,Error(i),!1,j))))}for(V(a.Ka,d,e),V(a.g.qa,d,f),Wf(a,a.$a),h=0;h<g.length;h++)uc(g[h]);Uf(a)}return d}function $f(a,b){for(var c,d=a.$a;null!==(c=D(b))&&null===d.k();)d=I(d,c),b=Ua(b);return d}function Xf(a,b){var c=[];return ag(a,b,c),c.sort(function(a,b){return a.Sd-b.Sd}),c}function ag(a,b,c){var d=b.k();if(null!==d)for(var e=0;e<d.length;e++)c.push(d[e]);b.B(function(b){ag(a,b,c)})}function Wf(a,b){var c=b.k();if(c){for(var d=0,e=0;e<c.length;e++)3!==c[e].status&&(c[d]=c[e],d++);c.length=d,Za(b,0<c.length?c:null)}b.B(function(b){Wf(a,b)})}function Nf(a,b){var c=$f(a,b).path(),d=I(a.$a,b);return bb(d,function(a){bg(a)}),bg(d),ab(d,function(a){bg(a)}),c}function bg(a){var b=a.k();if(null!==b){for(var c=[],d=-1,e=0;e<b.length;e++)4!==b[e].status&&(2===b[e].status?(v(d===e-1,"All SENT items should be at beginning of queue."),d=e,b[e].status=4,b[e].Pc="set"):(v(1===b[e].status),b[e].Oc(),b[e].G&&c.push(r(b[e].G,null,Error("set"),!1,null))));for(-1===d?Za(a,null):b.length=d+1,e=0;e<c.length;e++)uc(c[e])}}function Vf(a,b){var c=new G(a,b);return new T(U(a.Ka,b),c)}function Tf(a,b,c,d){if(d.f())return c;if(null!=d.k())return b;var e=c;return d.B(function(d){var f=d.name(),g=new H(f);d=Tf(a,b.N(g),c.N(g),d),e=e.K(f,d)}),e}function Y(){this.sb={}}function cg(a){var b=this;if(this.zb=a,this.Jc="*",Ae()?this.Kb=this.lc=se():(this.Kb=window.opener,this.lc=window),!b.Kb)throw"Unable to find relay frame";te(this.lc,"message",r(this.ob,this)),te(this.lc,"message",r(this.Pd,this));try{dg(this,{a:"ready"})}catch(c){te(this.Kb,"load",function(){dg(b,{a:"ready"})})}te(window,"unload",r(this.Ie,this))}function dg(a,b){b=u(b),Ae()?a.Kb.doPost(b,a.Jc):a.Kb.postMessage(b,a.Jc)}function $(a,b,c){this.Wb=a,this.Z=b,this.Ha=c}function G(a,b){var c,d,e;if(a instanceof Gf)c=a,d=b;else{x("new Firebase",1,2,arguments.length),d=hc(arguments[0]),c=d.Ve,"firebase"===d.domain&&gc(d.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),c||gc("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),d.Ya||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&O("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."),c=new yb(d.host,d.Ya,c,"ws"===d.scheme||"wss"===d.scheme),d=new H(d.Rb),e=d.toString();
|
||
var f;if(!(f=!p(c.host)||0===c.host.length||!Ea(c.Ta))&&(f=0!==e.length)&&(e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),f=!(p(e)&&0!==e.length&&!Da.test(e))),f)throw Error(y("new Firebase",1,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".');if(b)if(b instanceof Y)e=b;else{if(!p(b))throw Error("Expected a valid Firebase.Context for second argument to new Firebase()");e=Y.ib(),c.yc=b}else e=Y.ib();f=c.toString();var g=B(e.sb,f);g||(g=new Gf(c),e.sb[f]=g),c=g}F.call(this,c,d)}function dc(a,b){v(!b||!0===a||!1===a,"Can't turn on custom loggers persistently."),!0===a?("undefined"!=typeof console&&("function"==typeof console.log?bc=r(console.log,console):"object"==typeof console.log&&(bc=function(a){console.log(a)})),b&&J.set("logging_enabled",!0)):a?bc=a:(bc=null,J.remove("logging_enabled"))}var k,ba=this,ma=Date.now||function(){return+new Date},ta={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","":"\\u000b"},ua=/\uffff/.test("")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,xa={},ya={},Ca=/[\[\].#$\/\u0000-\u001F\u007F]/,Da=/[\[\].#$\u0000-\u001F\u007F]/;F.prototype.rd=function(){return x("Query.ref",0,0,arguments.length),new G(this.i,this.path)},F.prototype.ref=F.prototype.rd,F.prototype.Ua=function(a,b){x("Query.on",2,4,arguments.length),La("Query.on",a,!1),z("Query.on",2,b,!1);var c=Ra("Query.on",arguments[2],arguments[3]);return this.i.ec(this,a,b,c.cancel,c.$),b},F.prototype.on=F.prototype.Ua,F.prototype.nb=function(a,b,c){x("Query.off",0,3,arguments.length),La("Query.off",a,!0),z("Query.off",2,b,!0),za("Query.off",3,c),this.i.Dc(this,a,b,c)},F.prototype.off=F.prototype.nb,F.prototype.Ke=function(a,b){function c(g){f&&(f=!1,e.nb(a,c),b.call(d.$,g))}x("Query.once",2,4,arguments.length),La("Query.once",a,!1),z("Query.once",2,b,!1);var d=Ra("Query.once",arguments[2],arguments[3]),e=this,f=!0;this.Ua(a,c,function(b){e.nb(a,c),d.cancel&&d.cancel.call(d.$,b)})},F.prototype.once=F.prototype.Ke,F.prototype.ze=function(a){if(x("Query.limit",1,1,arguments.length),!ha(a)||Math.floor(a)!==a||0>=a)throw"Query.limit: First argument must be a positive integer.";return new F(this.i,this.path,a,this.fa,this.za,this.Ea,this.fb)},F.prototype.limit=F.prototype.ze,F.prototype.ae=function(a,b){return x("Query.startAt",0,2,arguments.length),Ka("Query.startAt",1,a,!0),Ma("Query.startAt",b),l(a)||(b=a=null),new F(this.i,this.path,this.Ga,a,b,this.Ea,this.fb)},F.prototype.startAt=F.prototype.ae,F.prototype.Hd=function(a,b){return x("Query.endAt",0,2,arguments.length),Ka("Query.endAt",1,a,!0),Ma("Query.endAt",b),new F(this.i,this.path,this.Ga,this.fa,this.za,a,b)},F.prototype.endAt=F.prototype.Hd,F.prototype.se=function(a,b){return x("Query.equalTo",1,2,arguments.length),Ka("Query.equalTo",1,a,!1),Ma("Query.equalTo",b),this.ae(a,b).Hd(a,b)},F.prototype.equalTo=F.prototype.se,F.prototype.Wa=function(){var a=Ta(Sa(this));return"{}"===a?"default":a},k=H.prototype,k.toString=function(){for(var a="",b=this.W;b<this.u.length;b++)""!==this.u[b]&&(a+="/"+this.u[b]);return a||"/"},k.parent=function(){if(this.W>=this.u.length)return null;for(var a=[],b=this.W;b<this.u.length-1;b++)a.push(this.u[b]);return new H(a,0)},k.J=function(a){for(var b=[],c=this.W;c<this.u.length;c++)b.push(this.u[c]);if(a instanceof H)for(c=a.W;c<a.u.length;c++)b.push(a.u[c]);else for(a=a.split("/"),c=0;c<a.length;c++)0<a[c].length&&b.push(a[c]);return new H(b,0)},k.f=function(){return this.W>=this.u.length},k.length=function(){return this.u.length-this.W},k.contains=function(a){var b=this.W,c=a.W;if(this.length()>a.length())return!1;for(;b<this.u.length;){if(this.u[b]!==a.u[c])return!1;++b,++c}return!0},k=Ya.prototype,k.k=function(){return this.A.value},k.clear=function(){this.A.value=null,this.A.children={},this.A.gc=0,$a(this)},k.Fb=function(){return 0<this.A.gc},k.f=function(){return null===this.k()&&!this.Fb()},k.B=function(a){for(var b in this.A.children)a(new Ya(b,this,this.A.children[b]))},k.path=function(){return new H(null===this.Qb?this.Ha:this.Qb.path()+"/"+this.Ha)},k.name=function(){return this.Ha},k.parent=function(){return this.Qb},k=cb.prototype,k.ta=function(a,b){return new cb(this.ab,this.ea.ta(a,b,this.ab).M(null,null,!1,null,null))},k.remove=function(a){return new cb(this.ab,this.ea.remove(a,this.ab).M(null,null,!1,null,null))},k.get=function(a){for(var b,c=this.ea;!c.f();){if(b=this.ab(a,c.key),0===b)return c.value;0>b?c=c.left:b>0&&(c=c.right)}return null},k.f=function(){return this.ea.f()},k.count=function(){return this.ea.count()},k.Lb=function(){return this.ea.Lb()},k.lb=function(){return this.ea.lb()},k.Fa=function(a){return this.ea.Fa(a)},k.Xa=function(a){return this.ea.Xa(a)},k.jb=function(a){return new hb(this.ea,a)},k=jb.prototype,k.M=function(a,b,c,d,e){return new jb(null!=a?a:this.key,null!=b?b:this.value,null!=c?c:this.color,null!=d?d:this.left,null!=e?e:this.right)},k.count=function(){return this.left.count()+1+this.right.count()},k.f=function(){return!1},k.Fa=function(a){return this.left.Fa(a)||a(this.key,this.value)||this.right.Fa(a)},k.Xa=function(a){return this.right.Xa(a)||a(this.key,this.value)||this.left.Xa(a)},k.Lb=function(){return kb(this).key},k.lb=function(){return this.right.f()?this.key:this.right.lb()},k.ta=function(a,b,c){var d,e;return e=this,d=c(a,e.key),e=0>d?e.M(null,null,null,e.left.ta(a,b,c),null):0===d?e.M(null,b,null,null,null):e.M(null,null,null,null,e.right.ta(a,b,c)),lb(e)},k.remove=function(a,b){var c,d;if(c=this,0>b(a,c.key))c.left.f()||c.left.R()||c.left.left.R()||(c=nb(c)),c=c.M(null,null,null,c.left.remove(a,b),null);else{if(c.left.R()&&(c=ob(c)),c.right.f()||c.right.R()||c.right.left.R()||(c=pb(c),c.left.left.R()&&(c=ob(c),c=pb(c))),0===b(a,c.key)){if(c.right.f())return eb;d=kb(c.right),c=c.M(d.key,d.value,null,null,mb(c.right))}c=c.M(null,null,null,null,c.right.remove(a,b))}return lb(c)},k.R=function(){return this.color},k=rb.prototype,k.M=function(){return this},k.ta=function(a,b){return new jb(a,b,null)},k.remove=function(){return this},k.count=function(){return 0},k.f=function(){return!0},k.Fa=function(){return!1},k.Xa=function(){return!1},k.Lb=function(){return null},k.lb=function(){return null},k.R=function(){return!1};var eb=new rb;k=sb.prototype,k.set=function(a,b){null==b?this.Cb.removeItem(this.zc+a):this.Cb.setItem(this.zc+a,u(b))},k.get=function(a){return a=this.Cb.getItem(this.zc+a),null==a?null:va(a)},k.remove=function(a){this.Cb.removeItem(this.zc+a)},k.Nd=!1,k.toString=function(){return this.Cb.toString()},tb.prototype.set=function(a,b){null==b?delete this.yb[a]:this.yb[a]=b},tb.prototype.get=function(a){return A(this.yb,a)?this.yb[a]:null},tb.prototype.remove=function(a){delete this.yb[a]},tb.prototype.Nd=!0;var xb=wb("localStorage"),J=wb("sessionStorage");yb.prototype.toString=function(){var a=(this.Ya?"https://":"http://")+this.host;return this.yc&&(a+="<"+this.yc+">"),a},oa(Bb,Ab),Bb.prototype.reset=function(){this.F[0]=1732584193,this.F[1]=4023233417,this.F[2]=2562383102,this.F[3]=271733878,this.F[4]=3285377520,this.Kc=this.kb=0},Bb.prototype.update=function(a,b){l(b)||(b=a.length);for(var c=b-this.ra,d=0,e=this.Sc,f=this.kb;b>d;){if(0==f)for(;c>=d;)Cb(this,a,d),d+=this.ra;if(p(a)){for(;b>d;)if(e[f]=a.charCodeAt(d),++f,++d,f==this.ra){Cb(this,e),f=0;break}}else for(;b>d;)if(e[f]=a[d],++f,++d,f==this.ra){Cb(this,e),f=0;break}}this.kb=f,this.Kc+=b};var L=Array.prototype,Eb=L.indexOf?function(a,b,c){return L.indexOf.call(a,b,c)}:function(a,b,c){if(c=null==c?0:0>c?Math.max(0,a.length+c):c,p(a))return p(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},Fb=L.forEach?function(a,b,c){L.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;d>f;f++)f in e&&b.call(c,e[f],f,a)},Gb=L.filter?function(a,b,c){return L.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,g=p(a)?a.split(""):a,h=0;d>h;h++)if(h in g){var i=g[h];b.call(c,i,h,a)&&(e[f++]=i)}return e},Hb=L.map?function(a,b,c){return L.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=p(a)?a.split(""):a,g=0;d>g;g++)g in f&&(e[g]=b.call(c,f[g],g,a));return e},Ib=L.reduce?function(a,b,c,d){return d&&(b=r(b,d)),L.reduce.call(a,b,c)}:function(a,b,c,d){var e=c;return Fb(a,function(c,f){e=b.call(d,e,c,f,a)}),e},Jb=L.every?function(a,b,c){return L.every.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;d>f;f++)if(f in e&&!b.call(c,e[f],f,a))return!1;return!0},Nb;a:{var Ob=ba.navigator;if(Ob){var Pb=Ob.userAgent;if(Pb){Nb=Pb;break a}}Nb=""}var Rb=Qb("Opera")||Qb("OPR"),Sb=Qb("Trident")||Qb("MSIE"),Tb=Qb("Gecko")&&-1==Nb.toLowerCase().indexOf("webkit")&&!(Qb("Trident")||Qb("MSIE")),Ub=-1!=Nb.toLowerCase().indexOf("webkit");!function(){var a,b="";return Rb&&ba.opera?(b=ba.opera.version,ia(b)?b():b):(Tb?a=/rv\:([^\);]+)(\)|;)/:Sb?a=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:Ub&&(a=/WebKit\/(\S+)/),a&&(b=(b=a.exec(Nb))?b[1]:""),Sb&&(a=(a=ba.document)?a.documentMode:void 0,a>parseFloat(b))?String(a):b)}();var Vb=null,Wb=null,Yb=function(){var a=1;return function(){return a++}}(),bc=null,cc=!0,tc=/^-?\d{1,10}$/;k=vc.prototype,k.Q=function(){return!0},k.m=function(){return this.pb},k.La=function(a){return new vc(this.H,a)},k.P=function(){return Q},k.N=function(a){return null===D(a)?this:Q},k.ha=function(){return null},k.K=function(a,b){return(new R).K(a,b).La(this.pb)},k.Ba=function(a,b){var c=D(a);return null===c?b:this.K(c,Q.Ba(Ua(a),b))},k.f=function(){return!1},k.qc=function(){return 0},k.X=function(a){return a&&null!==this.m()?{".value":this.k(),".priority":this.m()}:this.k()},k.hash=function(){var a="";null!==this.m()&&(a+="priority:"+wc(this.m())+":");var b=typeof this.H,a=a+(b+":"),a="number"===b?a+rc(this.H):a+this.H;return $b(a)},k.k=function(){return this.H},k.toString=function(){return"string"==typeof this.H?this.H:'"'+this.H+'"'},k=R.prototype,k.Q=function(){return!1},k.m=function(){return this.pb},k.La=function(a){return new R(this.o,a)},k.K=function(a,b){var c=this.o.remove(a);return b&&b.f()&&(b=null),null!==b&&(c=c.ta(a,b)),b&&null!==b.m()?new Ac(c,null,this.pb):new R(c,this.pb)},k.Ba=function(a,b){var c=D(a);if(null===c)return b;var d=this.P(c).Ba(Ua(a),b);return this.K(c,d)},k.f=function(){return this.o.f()},k.qc=function(){return this.o.count()};var Bc=/^(0|[1-9]\d*)$/;k=R.prototype,k.X=function(a){if(this.f())return null;var b={},c=0,d=0,e=!0;if(this.B(function(f,g){b[f]=g.X(a),c++,e&&Bc.test(f)?d=Math.max(d,Number(f)):e=!1}),!a&&e&&2*c>d){var f,g=[];for(f in b)g[f]=b[f];return g}return a&&null!==this.m()&&(b[".priority"]=this.m()),b},k.hash=function(){var a="";return null!==this.m()&&(a+="priority:"+wc(this.m())+":"),this.B(function(b,c){var d=c.hash();""!==d&&(a+=":"+b+":"+d)}),""===a?"":$b(a)},k.P=function(a){return a=this.o.get(a),null===a?Q:a},k.N=function(a){var b=D(a);return null===b?this:this.P(b).N(Ua(a))},k.ha=function(a){return gb(this.o,a)},k.Jd=function(){return this.o.Lb()},k.Kd=function(){return this.o.lb()},k.B=function(a){return this.o.Fa(a)},k.$c=function(a){return this.o.Xa(a)},k.jb=function(){return this.o.jb()},k.toString=function(){var a="{",b=!0;return this.B(function(c,d){b?b=!1:a+=", ",a+='"'+c+'" : '+d.toString()}),a+="}"};var Q=new R;oa(Ac,R),k=Ac.prototype,k.K=function(a,b){var c=this.P(a),d=this.o,e=this.ya;return null!==c&&(d=d.remove(a),e=e.remove({name:a,la:c.m()})),b&&b.f()&&(b=null),null!==b&&(d=d.ta(a,b),e=e.ta({name:a,la:b.m()},b)),new Ac(d,e,this.m())},k.ha=function(a,b){var c=gb(this.ya,{name:a,la:b.m()});return c?c.name:null},k.B=function(a){return this.ya.Fa(function(b,c){return a(b.name,c)})},k.$c=function(a){return this.ya.Xa(function(b,c){return a(b.name,c)})},k.jb=function(){return this.ya.jb(function(a,b){return{key:a.name,value:b}})},k.Jd=function(){return this.ya.f()?null:this.ya.Lb().name},k.Kd=function(){return this.ya.f()?null:this.ya.lb().name};var Dc=Math.log(2);T.prototype.X=function(){return x("Firebase.DataSnapshot.val",0,0,arguments.length),this.A.X()},T.prototype.val=T.prototype.X,T.prototype.te=function(){return x("Firebase.DataSnapshot.exportVal",0,0,arguments.length),this.A.X(!0)},T.prototype.exportVal=T.prototype.te,T.prototype.J=function(a){x("Firebase.DataSnapshot.child",0,1,arguments.length),ha(a)&&(a=String(a)),Na("Firebase.DataSnapshot.child",a);var b=new H(a),c=this.Cc.J(b);return new T(this.A.N(b),c)},T.prototype.child=T.prototype.J,T.prototype.ed=function(a){x("Firebase.DataSnapshot.hasChild",1,1,arguments.length),Na("Firebase.DataSnapshot.hasChild",a);var b=new H(a);return!this.A.N(b).f()},T.prototype.hasChild=T.prototype.ed,T.prototype.m=function(){return x("Firebase.DataSnapshot.getPriority",0,0,arguments.length),this.A.m()},T.prototype.getPriority=T.prototype.m,T.prototype.forEach=function(a){if(x("Firebase.DataSnapshot.forEach",1,1,arguments.length),z("Firebase.DataSnapshot.forEach",1,a,!1),this.A.Q())return!1;var b=this;return this.A.B(function(c,d){return a(new T(d,b.Cc.J(c)))})},T.prototype.forEach=T.prototype.forEach,T.prototype.Fb=function(){return x("Firebase.DataSnapshot.hasChildren",0,0,arguments.length),this.A.Q()?!1:!this.A.f()},T.prototype.hasChildren=T.prototype.Fb,T.prototype.name=function(){return x("Firebase.DataSnapshot.name",0,0,arguments.length),this.Cc.name()},T.prototype.name=T.prototype.name,T.prototype.qc=function(){return x("Firebase.DataSnapshot.numChildren",0,0,arguments.length),this.A.qc()},T.prototype.numChildren=T.prototype.qc,T.prototype.rd=function(){return x("Firebase.DataSnapshot.ref",0,0,arguments.length),this.Cc},T.prototype.ref=T.prototype.rd,Gc.prototype.Mc=function(a){for(var b=this.Jb[a]||[],c=0;c<b.length;c++)b[c].ca.apply(b[c].$,Array.prototype.slice.call(arguments,1))},Gc.prototype.Ua=function(a,b,c){Hc(this,a),this.Jb[a]=this.Jb[a]||[],this.Jb[a].push({ca:b,$:c}),(a=this.cd(a))&&b.apply(c,a)},Gc.prototype.nb=function(a,b,c){Hc(this,a),a=this.Jb[a]||[];for(var d=0;d<a.length;d++)if(a[d].ca===b&&(!c||c===a[d].$)){a.splice(d,1);break}},oa(Ic,Gc),da(Ic),Ic.prototype.cd=function(a){return v("visible"===a,"Unknown event type: "+a),[this.xb]},oa(Jc,Gc),da(Jc),Jc.prototype.cd=function(a){return v("online"===a,"Unknown event type: "+a),[this.Ob]};var Nc="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");Qc.prototype.get=function(){return Mc(this.Bb)},Sc.prototype.get=function(){var a=this.qe.get(),b=Mc(a);if(this.mc)for(var c in this.mc)b[c]-=this.mc[c];return this.mc=a,b},Tc.prototype.Ud=function(){var a,b=this.Hc.get(),c={},d=!1;for(a in b)0<b[a]&&A(this.yd,a)&&(c[a]=b[a],d=!0);d&&(b=this.n,b.T&&(c={c:c},b.e("reportStats",c),b.Ja("s",c))),setTimeout(r(this.Ud,this),Math.floor(6e5*Math.random()))};var Uc={},Vc={},Yc=null;"undefined"!=typeof MozWebSocket?Yc=MozWebSocket:"undefined"!=typeof WebSocket&&(Yc=WebSocket);var $c;Zc.prototype.open=function(a,b){this.ka=b,this.Ge=a,this.e("Websocket connecting to "+this.Ca),this.Db=!1,xb.set("previous_websocket_failure",!0);try{this.Y=new Yc(this.Ca)}catch(c){this.e("Error instantiating WebSocket.");var d=c.message||c.data;return d&&this.e(d),void this.Ia()}var e=this;this.Y.onopen=function(){e.e("Websocket connected."),e.Db=!0},this.Y.onclose=function(){e.e("Websocket connection was disconnected."),e.Y=null,e.Ia()},this.Y.onmessage=function(a){if(null!==e.Y)if(a=a.data,e.Na+=a.length,Rc(e.ga,"bytes_received",a.length),ad(e),null!==e.frames)bd(e,a);else{a:{if(v(null===e.frames,"We already have a frame buffer"),6>=a.length){var b=Number(a);if(!isNaN(b)){e.Ad=b,e.frames=[],a=null;break a}}e.Ad=1,e.frames=[]}null!==a&&bd(e,a)}},this.Y.onerror=function(a){e.e("WebSocket error. Closing connection."),(a=a.message||a.data)&&e.e(a),e.Ia()}},Zc.prototype.start=function(){},Zc.isAvailable=function(){var a=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var b=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);b&&1<b.length&&4.4>parseFloat(b[1])&&(a=!0)}return!a&&null!==Yc&&!$c},Zc.responsesRequiredToBeHealthy=2,Zc.healthyTimeout=3e4,k=Zc.prototype,k.nc=function(){xb.remove("previous_websocket_failure")},k.send=function(a){ad(this),a=u(a),this.Oa+=a.length,Rc(this.ga,"bytes_sent",a.length),a=nc(a,16384),1<a.length&&this.Y.send(String(a.length));for(var b=0;b<a.length;b++)this.Y.send(a[b])},k.ac=function(){this.Ra=!0,this.Hb&&(clearInterval(this.Hb),this.Hb=null),this.Y&&(this.Y.close(),this.Y=null)},k.Ia=function(){this.Ra||(this.e("WebSocket is closing itself"),this.ac(),this.ka&&(this.ka(this.Db),this.ka=null))},k.close=function(){this.Ra||(this.e("WebSocket is being closed"),this.ac())},k=fd.prototype,k.add=function(a,b){this.set[a]=null!==b?b:!0},k.contains=function(a){return A(this.set,a)},k.get=function(a){return this.contains(a)?this.set[a]:void 0},k.remove=function(a){delete this.set[a]},k.clear=function(){this.set={}},k.f=function(){return Lc(this.set)},k.count=function(){var a,b=this.set,c=0;for(a in b)c++;return c},k.keys=function(){var a=[];return pc(this.set,function(b,c){a.push(c)}),a};var id,jd;hd.prototype.open=function(a,b){this.Ed=0,this.U=b,this.Od=new cd(a),this.Ra=!1;var c=this;this.Pa=setTimeout(function(){c.e("Timed out trying to connect."),c.Ia(),c.Pa=null},Math.floor(3e4)),ic(function(){if(!c.Ra){c.na=new kd(function(a,b,d){if(ld(c,arguments),c.na)if(c.Pa&&(clearTimeout(c.Pa),c.Pa=null),c.Db=!0,"start"==a)c.id=b,c.Td=d;else{if("close"!==a)throw Error("Unrecognized command received: "+a);b?(c.na.Fc=!1,dd(c.Od,b,function(){c.Ia()})):c.Ia()}},function(a,b){ld(c,arguments),ed(c.Od,a,b)},function(){c.Ia()},c.dc);var a={start:"t"};a.ser=Math.floor(1e8*Math.random()),c.na.Nc&&(a.cb=c.na.Nc),a.v="5",c.Gc&&(a.s=c.Gc),"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(a.r="f"),a=c.dc(a),c.e("Connecting via long-poll to "+a),md(c.na,a,function(){})}})},hd.prototype.start=function(){var a=this.na,b=this.Td;for(a.Be=this.id,a.Ce=b,a.Qc=!0;nd(a););a=this.id,b=this.Td,this.mb=document.createElement("iframe");var c={dframe:"t"};c.id=a,c.pw=b,this.mb.src=this.dc(c),this.mb.style.display="none",document.body.appendChild(this.mb)},hd.isAvailable=function(){return!(jd||"object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href)||"object"==typeof Windows&&"object"==typeof Windows.Ze)},k=hd.prototype,k.nc=function(){},k.ac=function(){this.Ra=!0,this.na&&(this.na.close(),this.na=null),this.mb&&(document.body.removeChild(this.mb),this.mb=null),this.Pa&&(clearTimeout(this.Pa),this.Pa=null)},k.Ia=function(){this.Ra||(this.e("Longpoll is closing itself"),this.ac(),this.U&&(this.U(this.Db),this.U=null))},k.close=function(){this.Ra||(this.e("Longpoll is being closed."),this.ac())},k.send=function(a){a=u(a),this.Oa+=a.length,Rc(this.ga,"bytes_sent",a.length),a=wa(a),a=Xb(a,!0),a=nc(a,1840);for(var b=0;b<a.length;b++){var c=this.na;c.Tb.push({Pe:this.Ed,We:a.length,Gd:a[b]}),c.Qc&&nd(c),this.Ed++}},kd.prototype.close=function(){if(this.Qc=!1,this.aa){this.aa.Da.body.innerHTML="";var a=this;setTimeout(function(){null!==a.aa&&(document.body.removeChild(a.aa),a.aa=null)},Math.floor(0))}var b=this.ka;b&&(this.ka=null,b())};var rd=[hd,Zc];td.prototype.Zd=function(a){Gd(this,{t:"d",d:a})},td.prototype.tc=function(a){Dd(this),this.ob(a)},td.prototype.close=function(){2!==this.oa&&(this.e("Closing realtime connection."),this.oa=2,Ad(this),this.U&&(this.U(),this.U=null))};var Ld=0,Nd=0;k=Kd.prototype,k.Ja=function(a,b,c){var d=++this.Oe;a={r:d,a:a,b:b},this.e(u(a)),v(this.T,"sendRequest_ call when we're not connected not allowed."),this.ma.Zd(a),c&&(this.Xb[d]=c)},k.I=function(a,b,c){this.bb={re:a,Id:!1,ca:b,fc:c},this.e("Authenticating using credential: "+a),Rd(this),(b=40==a.length)||(a=Hd(a).Uc,b="object"==typeof a&&!0===B(a,"admin")),b&&(this.e("Admin auth credential detected. Reducing max reconnect time."),this.oc=3e4)},k.Bd=function(a){delete this.bb,this.T&&this.Ja("unauth",{},function(b){a(b.s,b.d)})},k.ld=function(a,b){this.T?Vd(this,"oc",a,null,b):this.Mb.push({Rb:a,action:"oc",data:null,G:b})},k.put=function(a,b,c,d){Xd(this,"p",a,b,c,d)},k.tc=function(a){if("r"in a){this.e("from server: "+u(a));var b=a.r,c=this.Xb[b];c&&(delete this.Xb[b],c(a.b))}else{if("error"in a)throw"A server-side error has occurred: "+a.error;"a"in a&&(b=a.a,c=a.b,this.e("handleServerMessage",b,c),"d"===b?this.uc(c.p,c.d,!1):"m"===b?this.uc(c.p,c.d,!0):"c"===b?$d(this,c.p,c.q):"ac"===b?(a=c.s,b=c.d,c=this.bb,delete this.bb,c&&c.fc&&c.fc(a,b)):"sd"===b?this.ud?this.ud(c):"msg"in c&&"undefined"!=typeof console&&console.log("FIREBASE: "+c.msg.replace("\n","\nFIREBASE: ")):fc("Unrecognized action received from server: "+u(b)+"\nAre you using the latest client?"))}},k.Nb=function(a){this.e("connection ready"),this.T=!0,this.Ib=(new Date).getTime(),this.nd({serverTimeOffset:a-(new Date).getTime()}),Rd(this);for(var b in this.ja)for(var c in this.ja[b])a=this.ja[b][c],Pd(this,b,c,a.qb,a.G);for(b=0;b<this.V.length;b++)this.V[b]&&Zd(this,b);for(;this.Mb.length;)b=this.Mb.shift(),Vd(this,b.action,b.Rb,b.data,b.G);this.sc(!0)},k.Je=function(a){a&&!this.xb&&this.va===this.oc&&(this.e("Window became visible. Reducing delay."),this.va=1e3,this.ma||Md(this,0)),this.xb=a},k.He=function(a){a?(this.e("Browser went online. Reconnecting."),this.va=1e3,this.Za=!0,this.ma||Md(this,0)):(this.e("Browser went offline. Killing connection; don't reconnect."),this.Za=!1,this.ma&&this.ma.close())},k.Qd=function(){this.e("data client disconnected"),this.T=!1,this.ma=null;for(var a=0;a<this.V.length;a++){var b=this.V[a];b&&"h"in b.Vd&&b.Le&&(b.G&&b.G("disconnect"),delete this.V[a],this.Pb--)}if(0===this.Pb&&(this.V=[]),this.Za)this.xb?this.Ib&&(3e4<(new Date).getTime()-this.Ib&&(this.va=1e3),this.Ib=null):(this.e("Window isn't visible. Delaying reconnect."),this.va=this.oc,this.hd=(new Date).getTime()),a=Math.max(0,this.va-((new Date).getTime()-this.hd)),a*=Math.random(),this.e("Trying to reconnect in "+a+"ms"),Md(this,a),this.va=Math.min(this.oc,1.3*this.va);else for(var c in this.Xb)delete this.Xb[c];this.sc(!1)},k.Qa=function(){this.Za=!1,this.ma?this.ma.close():(this.gb&&(clearTimeout(this.gb),this.gb=null),this.T&&this.Qd())},k.tb=function(){this.Za=!0,this.va=1e3,this.T||Md(this,0)},be.prototype.rb=function(a,b){if(a.f())this.H=b,this.o=null;else if(null!==this.H)this.H=this.H.Ba(a,b);else{null==this.o&&(this.o=new fd);var c=D(a);this.o.contains(c)||this.o.add(c,new be),c=this.o.get(c),a=Ua(a),c.rb(a,b)}},be.prototype.B=function(a){null!==this.o&&gd(this.o,function(b,c){a(b,c)})},ee.prototype.toString=function(){return this.ba.toString()},fe.prototype.set=function(a,b){var c=this,d=[];return Fb(b,function(a){var b=a.path;a=a.ua;var e=Yb();Za(I(c.Sb,b),e),V(c.O,b,a),d.push({path:b,Re:e})}),d};var ne="auth.firebase.com",pe=["remember","redirectTo"],re={NETWORK_ERROR:"Unable to contact the Firebase server.",SERVER_ERROR:"An unknown server error occurred.",TRANSPORT_UNAVAILABLE:"There are no login transports available for the requested method.",REQUEST_INTERRUPTED:"The browser redirected the page before the login request could complete.",USER_CANCELLED:"The user cancelled authentication."};Be.prototype.open=function(a,b,c){function d(){c&&(c(W("REQUEST_INTERRUPTED")),c=null)}var e,f=new XMLHttpRequest,g=this.options.method.toUpperCase();if(te(window,"beforeunload",d),f.onreadystatechange=function(){if(c&&4===f.readyState){var a;if(200<=f.status&&300>f.status){try{a=va(f.responseText)}catch(b){}c(null,a)}else c(500<=f.status&&600>f.status?W("SERVER_ERROR"):W("NETWORK_ERROR"));c=null,ue(window,"beforeunload",d)}},"GET"===g)a+=(/\?/.test(a)?"":"?")+xe(b),e=null;else{var h=this.options.headers.content_type;"application/json"===h&&(e=u(b)),"application/x-www-form-urlencoded"===h&&(e=xe(b))}f.open(g,a,!0),a={"X-Requested-With":"XMLHttpRequest",Accept:"application/json;text/plain"},Pc(a,this.options.headers);for(var i in a)f.setRequestHeader(i,a[i]);f.send(e)},Be.isAvailable=function(){return!!window.XMLHttpRequest&&"string"==typeof(new XMLHttpRequest).responseType&&(!(navigator.userAgent.match(/MSIE/)||navigator.userAgent.match(/Trident/))||Ae())},Be.prototype.Ab=function(){return"json"},Ce.prototype.open=function(a,b,c){function d(){c&&(c(W("USER_CANCELLED")),c=null)}var e,f=this,g=hc(ne);b.requestId=this.Yb,b.redirectTo=g.scheme+"://"+g.host+"/blank/page.html",a+=/\?/.test(a)?"":"?",a+=xe(b),(e=window.open(a,"_blank","location=no"))&&ia(e.addEventListener)?(e.addEventListener("loadstart",function(a){var b;if(b=a&&a.url)a:{var g=a.url;try{var h=document.createElement("a");h.href=g,b=h.host===hc(ne).host&&"/blank/page.html"===h.pathname;break a}catch(i){}b=!1}b&&(a=we(a.url),e.removeEventListener("exit",d),e.close(),a=new oe(null,null,{requestId:f.Yb,requestKey:a}),f.Rd.requestWithCredential("/auth/session",a,c),c=null)}),e.addEventListener("exit",d)):c(W("TRANSPORT_UNAVAILABLE"))},na("fb.login.transports.CordovaInAppBrowser.prototype.open",Ce.prototype.open),Ce.isAvailable=function(){return ze()},Ce.prototype.Ab=function(){return"redirect"},De.prototype.open=function(a,b,c){function d(a){if(f&&(document.body.removeChild(f),f=void 0),k&&(k=clearInterval(k)),ue(window,"message",e),ue(window,"unload",d),j&&!a)try{j.close()}catch(b){g.postMessage("die",i)}j=g=void 0}function e(a){if(a.origin===i)try{var b=va(a.data);"ready"===b.a?g.postMessage(l,i):"error"===b.a?(d(!1),c&&(c(b.d),c=null)):"response"===b.a&&(d(b.bf),c&&(c(null,b.d),c=null))}catch(e){}}var f,g,h=Ae(),i=ve(a);if(i!==ve(this.options.relay_url))c&&setTimeout(function(){c(Error("invalid arguments: origin of url and relay_url must match"))},0);else{h&&(f=document.createElement("iframe"),f.setAttribute("src",this.options.relay_url),f.style.display="none",f.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(f),g=f.contentWindow),a+=(/\?/.test(a)?"":"?")+xe(b);var j=window.open(a,this.options.window_name,this.options.window_features);g||(g=j);var k=setInterval(function(){j&&j.closed&&(d(!1),c&&(c(W("USER_CANCELLED")),c=null))},500),l=u({a:"request",d:b});te(window,"unload",d),te(window,"message",e)}},na("fb.login.transports.Popup.prototype.open",De.prototype.open),De.isAvailable=function(){return"postMessage"in window&&!/^file:\//.test(location.href)&&!(ze()||navigator.userAgent.match(/Windows Phone/)||window.Windows&&/^ms-appx:/.test(location.href)||navigator.userAgent.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i)||navigator.userAgent.match(/CriOS/)||navigator.userAgent.match(/Twitter for iPhone/)||navigator.userAgent.match(/FBAN\/FBIOS/)||window.navigator.standalone)&&!navigator.userAgent.match(/PhantomJS/)},De.prototype.Ab=function(){return"popup"},Ee.prototype.open=function(a,b,c){function d(){c&&(c(W("REQUEST_INTERRUPTED")),c=null)}function e(){setTimeout(function(){delete window.__firebase_auth_jsonp[f],Lc(window.__firebase_auth_jsonp)&&delete window.__firebase_auth_jsonp;try{var a=document.getElementById(f);a&&a.parentNode.removeChild(a)}catch(b){}},1),ue(window,"beforeunload",d)}var f="fn"+(new Date).getTime()+Math.floor(99999*Math.random());b[this.options.callback_parameter]="__firebase_auth_jsonp."+f,a+=(/\?/.test(a)?"":"?")+xe(b),te(window,"beforeunload",d),window.__firebase_auth_jsonp[f]=function(a){c&&(c(null,a),c=null),e()},Fe(f,a,c)},Ee.isAvailable=function(){return!ze()},Ee.prototype.Ab=function(){return"json"},Ge.prototype.set=function(a,b){if(!b){if(!this.Ic.length)throw Error("fb.login.SessionManager : No storage options available!");b=this.Ic[0]}b.set(this.pd,a)},Ge.prototype.get=function(){var a=Hb(this.Ic,r(this.we,this)),a=Gb(a,function(a){return null!==a});return Lb(a,function(a,b){return Id(b.token)-Id(a.token)}),0<a.length?a.shift():null},Ge.prototype.we=function(a){try{var b=a.get(this.pd);if(b&&b.token)return b}catch(c){}return null},Ge.prototype.clear=function(){var a=this;Fb(this.Ic,function(b){b.remove(a.pd)})},He.prototype.open=function(a,b){J.set("redirect_request_id",this.Yb),b.requestId=this.Yb,b.redirectTo=b.redirectTo||window.location.href,a+=(/\?/.test(a)?"":"?")+xe(b),window.location=a},na("fb.login.transports.Redirect.prototype.open",He.prototype.open),He.isAvailable=function(){return!/^file:\//.test(location.href)&&!ze()},He.prototype.Ab=function(){return"redirect"},oa(Ie,Gc),k=Ie.prototype,k.bd=function(){return this.Ma||null},k.Xc=function(a,b){Re(this);var c=qe(a);c.ub._method="POST",this.Zb("/users",c,function(a){P(b,a)})},k.sd=function(a,b){var c=this;Re(this);var d="/users/"+encodeURIComponent(a.email),e=qe(a);e.ub._method="DELETE",this.Zb(d,e,function(a,d){!a&&d&&d.uid&&c.Ma&&c.Ma.uid&&c.Ma.uid===d.uid&&Pe(c),P(b,a)})},k.Tc=function(a,b){Re(this);var c="/users/"+encodeURIComponent(a.email)+"/password",d=qe(a);d.ub._method="PUT",d.ub.password=a.newPassword,this.Zb(c,d,function(a){P(b,a)})},k.td=function(a,b){Re(this);var c="/users/"+encodeURIComponent(a.email)+"/password",d=qe(a);d.ub._method="POST",this.Zb(c,d,function(a){P(b,a)})},k.Zb=function(a,b,c){Ue(this,[Be,Ee],a,b,c)},k.cd=function(a){return v("auth_status"===a,'initial event must be of type "auth_status"'),[this.Ma]},Ve.prototype.Vb=function(){for(var a=0;a<this.hb.length;a++)if(this.hb[a]){var b=this.hb[a];this.hb[a]=null,Xe(b)}this.hb=[]},Ye.prototype.Ac=function(a,b){b=this.Bc(a,b),null!=b&&af(this,b)},Ye.prototype.Vb=function(){this.Zc.Vb()},oa(cf,Ye),cf.prototype.Bc=function(a,b){return this.j=a,this.Gb&&null!=b&&b.push(new X("value",this.j)),b},cf.prototype.Eb=function(){return{}},oa(hf,fd),k=hf.prototype,k.setActive=function(a){this.Aa=a},k.defaultView=function(){return lf(this)?this.get("default"):null},k.path=function(){return this.Z},k.toString=function(){return Hb(this.keys(),function(a){return"default"===a?"{}":a}).join("$")},k.qb=function(){var a=[];return gd(this,function(b,c){a.push(c.S)}),a},oa(nf,Ye),nf.prototype.Bc=function(a,b){if(null===b)return b;var c=[],d=this.S;l(d.fa)&&c.push(l(d.za)&&null!=d.za?function(a,b){var c=jc(b,d.fa);return c>0||0===c&&0<=kc(a,d.za)}:function(a,b){return 0<=jc(b,d.fa)}),l(d.Ea)&&c.push(l(d.fb)?function(a,b){var c=jc(b,d.Ea);return 0>c||0===c&&0>=kc(a,d.fb)}:function(a,b){return 0>=jc(b,d.Ea)});var e=null,f=null;if(l(this.S.Ga))if(l(this.S.fa)){if(e=of(a,c,this.S.Ga,!1)){var g=a.P(e).m();c.push(function(a,b){var c=jc(b,g);return 0>c||0===c&&0>=kc(a,e)})}}else if(f=of(a,c,this.S.Ga,!0)){var h=a.P(f).m();c.push(function(a,b){var c=jc(b,h);return c>0||0===c&&0<=kc(a,f)})}for(var i=[],j=[],k=[],m=[],n=0;n<b.length;n++){var o=b[n].da,p=b[n].xa;switch(b[n].type){case"child_added":pf(c,o,p)&&(this.j=this.j.K(o,p),j.push(b[n]));break;case"child_removed":this.j.P(o).f()||(this.j=this.j.K(o,null),i.push(b[n]));break;case"child_changed":!this.j.P(o).f()&&pf(c,o,p)&&(this.j=this.j.K(o,p),m.push(b[n]));break;case"child_moved":var q=!this.j.P(o).f(),r=pf(c,o,p);q?r?(this.j=this.j.K(o,p),k.push(b[n])):(i.push(new X("child_removed",this.j.P(o),o)),this.j=this.j.K(o,null)):r&&(this.j=this.j.K(o,p),j.push(b[n]))}}var s=e||f;if(s){var t=(n=null!==f)?this.j.Jd():this.j.Kd(),u=!1,v=!1,w=this;(n?a.$c:a.B).call(a,function(a,b){return v||null!==t||(v=!0),v&&u?!0:(u?(i.push(new X("child_removed",w.j.P(a),a)),w.j=w.j.K(a,null)):v&&(j.push(new X("child_added",b,a)),w.j=w.j.K(a,b)),t===a&&(v=!0),void(a===s&&(u=!0)))})}for(n=0;n<j.length;n++)c=j[n],o=this.j.ha(c.da,c.xa),i.push(new X("child_added",c.xa,c.da,o));for(n=0;n<k.length;n++)c=k[n],o=this.j.ha(c.da,c.xa),i.push(new X("child_moved",c.xa,c.da,o));for(n=0;n<m.length;n++)c=m[n],o=this.j.ha(c.da,c.xa),i.push(new X("child_changed",c.xa,c.da,o));return this.Gb&&0<i.length&&i.push(new X("value",this.j)),i},nf.prototype.ed=function(a){return this.j.P(a)!==Q},nf.prototype.Eb=function(a,b,c){var d={};this.j.Q()||this.j.B(function(a){d[a]=3});var e=this.j;c=U(c,new H(""));var f=new Ya;Za(I(f,this.S.path),!0),b=Q.Ba(a,b);var g=this;return ef(c,b,a,f,function(a,b,c){null!==c&&a.toString()===g.S.path.toString()&&g.Bc(b,c)}),this.j.Q()?pc(d,function(a,b){d[b]=2}):(this.j.B(function(a){A(d,a)||(d[a]=1)}),pc(d,function(a,b){g.j.P(b).f()&&(d[b]=2)
|
||
})),this.j=e,d},qf.prototype.ec=function(a,b,c,d,e){var f=a.path,g=I(this.pa,f),h=g.k();null===h?(h=new hf,Za(g,h)):v(!h.f(),"We shouldn't be storing empty QueryMaps");var i=a.Wa();if(h.contains(i))a=h.get(i),Ze(a,b,c,d,e);else{var j=this.g.ba.N(f);a=rf(a,j),sf(this,g,h,i,a),Ze(a,b,c,d,e),(b=(b=bb(I(this.pa,f),function(a){var b;return(b=a.k()&&a.k().defaultView())&&(b=a.k().defaultView().Gb),b?!0:void 0},!0))||null===this.n&&!U(this.g,f).f())&&bf(a)}a.Vb()},qf.prototype.Dc=function(a,b,c,d){var e=I(this.pa,a.path).k();return null===e?null:vf(this,e,a,b,c,d)},qf.prototype.Ac=function(a,b,c){a=I(this.pa,a).k(),null!==a&&gd(a,function(a,d){d.Ac(b,c)})},qf.prototype.Eb=function(a,b,c,d){function e(a){pc(a,function(a,b){f[b]=3===a?3:(B(f,b)||a)===a?a:3})}var f={};return gd(b,function(b,f){e(f.Eb(a,c,d))}),c.Q()||c.B(function(a){A(f,a)||(f[a]=4)}),f},k=Gf.prototype,k.toString=function(){return(this.D.Ya?"https://":"http://")+this.D.host},k.name=function(){return this.D.Ta},k.uc=function(a,b,c){this.ic++,this.Md&&(b=this.Md(a,b));var d,e,f=[];for(9<=a.length&&a.lastIndexOf(".priority")===a.length-9?(d=new H(a.substring(0,a.length-9)),e=U(this.g.wa,d).La(b),f.push(d)):c?(d=new H(a),e=U(this.g.wa,d),pc(b,function(a,b){var c=new H(b);".priority"===b?e=e.La(a):(e=e.Ba(c,S(a)),f.push(d.J(b)))})):(d=new H(a),e=S(b),f.push(d)),a=Ff(this.L,d,e,this.g.O),b=!1,c=0;c<a.length;++c){var g=a[c];b=ge(this.g,g.path,g.ua)||b}b&&(d=Kf(this,d)),zf(this.L,d,f)},k.sc=function(a){Hf(this,"connected",a),!1===a&&Lf(this)},k.nd=function(a){var b=this;oc(a,function(a,c){Hf(b,c,a)})},k.dd=function(a){return a=new H(a),U(this.g.wa,a).hash()},k.jd=function(a){Hf(this,"authenticated",a)},k.wb=function(a,b,c,d){this.e("set",{path:a.toString(),value:b,la:c});var e=Jf(this);b=S(b,c);var e=me(b,e),e=Ff(this.L,a,e,this.g.O),f=this.g.set(a,e),g=this;this.n.put(a.toString(),b.X(!0),function(b,c){"ok"!==b&&O("set at "+a+" failed: "+b),je(g.g,f),he(g.g,a);var e=Kf(g,a);zf(g.L,e,[]),Mf(d,b,c)}),e=Nf(this,a),Kf(this,e),zf(this.L,e,[a])},k.update=function(a,b,c){this.e("update",{path:a.toString(),value:b});var d,e=U(this.g.qa,a),f=!0,g=[],h=Jf(this),i=[];for(d in b){var f=!1,j=S(b[d]),j=me(j,h),e=e.K(d,j),k=a.J(d);g.push(k),j=Ff(this.L,k,j,this.g.O),i=i.concat(this.g.set(a,j))}if(f)M("update() called with empty data. Don't do anything."),Mf(c,"ok");else{var l=this;Yd(this.n,a.toString(),b,function(b,d){"ok"!==b&&O("update at "+a+" failed: "+b),je(l.g,i),he(l.g,a);var e=Kf(l,a);zf(l.L,e,[]),Mf(c,b,d)}),b=Nf(this,a),Kf(this,b),zf(l.L,b,g)}},k.vd=function(a,b,c){this.e("setPriority",{path:a.toString(),la:b});var d=Jf(this),d=ke(b,d),d=U(this.g.O,a).La(d),d=Ff(this.L,a,d,this.g.O),e=this.g.set(a,d),f=this;this.n.put(a.toString()+"/.priority",b,function(b,d){"permission_denied"===b&&O("setPriority at "+a+" failed: "+b),je(f.g,e),he(f.g,a);var g=Kf(f,a);zf(f.L,g,[]),Mf(c,b,d)}),b=Kf(this,a),zf(f.L,b,[])},k.ld=function(a,b){var c=this;this.n.ld(a.toString(),function(d,e){"ok"===d&&ce(c.U,a),Mf(b,d,e)})},k.ec=function(a,b,c,d,e){".info"===D(a.path)?this.gd.ec(a,b,c,d,e):this.L.ec(a,b,c,d,e)},k.Dc=function(a,b,c,d){if(".info"===D(a.path))this.gd.Dc(a,b,c,d);else{if(b=this.L.Dc(a,b,c,d),c=null!==b){c=this.g,d=a.path;for(var e=[],f=0;f<b.length;++f)e[f]=U(c.wa,b[f]);for(V(c.wa,d,Q),f=0;f<b.length;++f)V(c.wa,b[f],e[f]);c=he(c,d)}c&&(v(this.g.qa.ba===this.L.rc,"We should have raised any outstanding events by now. Else, we'll blow them away."),V(this.g.qa,a.path,U(this.g.O,a.path)),this.L.rc=this.g.qa.ba)}},k.Qa=function(){this.n.Qa()},k.tb=function(){this.n.tb()},k.wd=function(a){if("undefined"!=typeof console){a?(this.Hc||(this.Hc=new Sc(this.ga)),a=this.Hc.get()):a=this.ga.get();var b,c=Ib(Kc(a),function(a,b){return Math.max(b.length,a)},0);for(b in a){for(var d=a[b],e=b.length;c+2>e;e++)b+=" ";console.log(b+d)}}},k.xd=function(a){Rc(this.ga,a),this.be.yd[a]=!0},k.e=function(){M("r:"+this.n.id+":",arguments)},da(Y),Y.prototype.Qa=function(){for(var a in this.sb)this.sb[a].Qa()},Y.prototype.interrupt=Y.prototype.Qa,Y.prototype.tb=function(){for(var a in this.sb)this.sb[a].tb()},Y.prototype.resume=Y.prototype.tb,cg.prototype.ob=function(a){var b,c=this;try{b=va(a.data)}catch(d){}b&&"request"===b.a&&(ue(window,"message",this.ob),this.Jc=a.origin,this.zb&&setTimeout(function(){c.zb(c.Jc,b.d,function(a,b){c.oe=!b,c.zb=void 0,dg(c,{a:"response",d:a,forceKeepWindowOpen:b})})},0))},cg.prototype.Ie=function(){try{ue(this.lc,"message",this.Pd)}catch(a){}this.zb&&(dg(this,{a:"error",d:"unknown closed window"}),this.zb=void 0);try{window.close()}catch(b){}},cg.prototype.Pd=function(a){if(this.oe&&"die"===a.data)try{window.close()}catch(b){}};var Z={xe:function(a){var b=R.prototype.hash;R.prototype.hash=a;var c=vc.prototype.hash;return vc.prototype.hash=a,function(){R.prototype.hash=b,vc.prototype.hash=c}}};Z.hijackHash=Z.xe,Z.Wa=function(a){return a.Wa()},Z.queryIdentifier=Z.Wa,Z.Ae=function(a){return a.i.n.ja},Z.listens=Z.Ae,Z.Me=function(a){return a.i.n.ma},Z.refConnection=Z.Me,Z.ee=Kd,Z.DataConnection=Z.ee,Kd.prototype.sendRequest=Kd.prototype.Ja,Kd.prototype.interrupt=Kd.prototype.Qa,Z.fe=td,Z.RealTimeConnection=Z.fe,td.prototype.sendRequest=td.prototype.Zd,td.prototype.close=td.prototype.close,Z.de=yb,Z.ConnectionTarget=Z.de,Z.ue=function(){id=$c=!0},Z.forceLongPolling=Z.ue,Z.ve=function(){jd=!0},Z.forceWebSockets=Z.ve,Z.Te=function(a,b){a.i.n.ud=b},Z.setSecurityDebugCallback=Z.Te,Z.wd=function(a,b){a.i.wd(b)},Z.stats=Z.wd,Z.xd=function(a,b){a.i.xd(b)},Z.statsIncrementCounter=Z.xd,Z.ic=function(a){return a.i.ic},Z.dataUpdateCount=Z.ic,Z.ye=function(a,b){a.i.Md=b},Z.interceptServerData=Z.ye,Z.Fe=function(a){new cg(a)},Z.onPopupOpen=Z.Fe,Z.Qe=function(a){ne=a},Z.setAuthenticationServer=Z.Qe,$.prototype.cancel=function(a){x("Firebase.onDisconnect().cancel",0,1,arguments.length),z("Firebase.onDisconnect().cancel",1,a,!0),this.Wb.ld(this.Z,a)},$.prototype.cancel=$.prototype.cancel,$.prototype.remove=function(a){x("Firebase.onDisconnect().remove",0,1,arguments.length),C("Firebase.onDisconnect().remove",this.Z),z("Firebase.onDisconnect().remove",1,a,!0),Of(this.Wb,this.Z,null,a)},$.prototype.remove=$.prototype.remove,$.prototype.set=function(a,b){x("Firebase.onDisconnect().set",1,2,arguments.length),C("Firebase.onDisconnect().set",this.Z),Fa("Firebase.onDisconnect().set",a,!1),z("Firebase.onDisconnect().set",2,b,!0),Of(this.Wb,this.Z,a,b)},$.prototype.set=$.prototype.set,$.prototype.wb=function(a,b,c){if(x("Firebase.onDisconnect().setWithPriority",2,3,arguments.length),C("Firebase.onDisconnect().setWithPriority",this.Z),Fa("Firebase.onDisconnect().setWithPriority",a,!1),Ka("Firebase.onDisconnect().setWithPriority",2,b,!1),z("Firebase.onDisconnect().setWithPriority",3,c,!0),".length"===this.Ha||".keys"===this.Ha)throw"Firebase.onDisconnect().setWithPriority failed: "+this.Ha+" is a read-only object.";Pf(this.Wb,this.Z,a,b,c)},$.prototype.setWithPriority=$.prototype.wb,$.prototype.update=function(a,b){if(x("Firebase.onDisconnect().update",1,2,arguments.length),C("Firebase.onDisconnect().update",this.Z),fa(a)){for(var c={},d=0;d<a.length;++d)c[""+d]=a[d];a=c,O("Passing an Array to Firebase.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}Ja("Firebase.onDisconnect().update",a),z("Firebase.onDisconnect().update",2,b,!0),Qf(this.Wb,this.Z,a,b)},$.prototype.update=$.prototype.update;var eg=function(){var a=0,b=[];return function(c){var d=c===a;a=c;for(var e=Array(8),f=7;f>=0;f--)e[f]="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(c%64),c=Math.floor(c/64);if(v(0===c,"Cannot push at time == 0"),c=e.join(""),d){for(f=11;f>=0&&63===b[f];f--)b[f]=0;b[f]++}else for(f=0;12>f;f++)b[f]=Math.floor(64*Math.random());for(f=0;12>f;f++)c+="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(b[f]);return v(20===c.length,"NextPushId: Length should be 20."),c}}();oa(G,F),na("Firebase",G),G.prototype.name=function(){return x("Firebase.name",0,0,arguments.length),this.path.f()?null:Va(this.path)},G.prototype.name=G.prototype.name,G.prototype.J=function(a){if(x("Firebase.child",1,1,arguments.length),ha(a))a=String(a);else if(!(a instanceof H))if(null===D(this.path)){var b=a;b&&(b=b.replace(/^\/*\.info(\/|$)/,"/")),Na("Firebase.child",b)}else Na("Firebase.child",a);return new G(this.i,this.path.J(a))},G.prototype.child=G.prototype.J,G.prototype.parent=function(){x("Firebase.parent",0,0,arguments.length);var a=this.path.parent();return null===a?null:new G(this.i,a)},G.prototype.parent=G.prototype.parent,G.prototype.root=function(){x("Firebase.ref",0,0,arguments.length);for(var a=this;null!==a.parent();)a=a.parent();return a},G.prototype.root=G.prototype.root,G.prototype.toString=function(){x("Firebase.toString",0,0,arguments.length);var a;if(null===this.parent())a=this.i.toString();else{a=this.parent().toString()+"/";var b=this.name();a+=encodeURIComponent(String(b))}return a},G.prototype.toString=G.prototype.toString,G.prototype.set=function(a,b){x("Firebase.set",1,2,arguments.length),C("Firebase.set",this.path),Fa("Firebase.set",a,!1),z("Firebase.set",2,b,!0),this.i.wb(this.path,a,null,b)},G.prototype.set=G.prototype.set,G.prototype.update=function(a,b){if(x("Firebase.update",1,2,arguments.length),C("Firebase.update",this.path),fa(a)){for(var c={},d=0;d<a.length;++d)c[""+d]=a[d];a=c,O("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}if(Ja("Firebase.update",a),z("Firebase.update",2,b,!0),A(a,".priority"))throw Error("update() does not currently support updating .priority.");this.i.update(this.path,a,b)},G.prototype.update=G.prototype.update,G.prototype.wb=function(a,b,c){if(x("Firebase.setWithPriority",2,3,arguments.length),C("Firebase.setWithPriority",this.path),Fa("Firebase.setWithPriority",a,!1),Ka("Firebase.setWithPriority",2,b,!1),z("Firebase.setWithPriority",3,c,!0),".length"===this.name()||".keys"===this.name())throw"Firebase.setWithPriority failed: "+this.name()+" is a read-only object.";this.i.wb(this.path,a,b,c)},G.prototype.setWithPriority=G.prototype.wb,G.prototype.remove=function(a){x("Firebase.remove",0,1,arguments.length),C("Firebase.remove",this.path),z("Firebase.remove",1,a,!0),this.set(null,a)},G.prototype.remove=G.prototype.remove,G.prototype.transaction=function(a,b,c){if(x("Firebase.transaction",1,3,arguments.length),C("Firebase.transaction",this.path),z("Firebase.transaction",1,a,!1),z("Firebase.transaction",2,b,!0),l(c)&&"boolean"!=typeof c)throw Error(y("Firebase.transaction",3,!0)+"must be a boolean.");if(".length"===this.name()||".keys"===this.name())throw"Firebase.transaction failed: "+this.name()+" is a read-only object.";"undefined"==typeof c&&(c=!0),Sf(this.i,this.path,a,b,c)},G.prototype.transaction=G.prototype.transaction,G.prototype.vd=function(a,b){x("Firebase.setPriority",1,2,arguments.length),C("Firebase.setPriority",this.path),Ka("Firebase.setPriority",1,a,!1),z("Firebase.setPriority",2,b,!0),this.i.vd(this.path,a,b)},G.prototype.setPriority=G.prototype.vd,G.prototype.push=function(a,b){x("Firebase.push",0,2,arguments.length),C("Firebase.push",this.path),Fa("Firebase.push",a,!0),z("Firebase.push",2,b,!0);var c=If(this.i),c=eg(c),c=this.J(c);return"undefined"!=typeof a&&null!==a&&c.set(a,b),c},G.prototype.push=G.prototype.push,G.prototype.ka=function(){return new $(this.i,this.path,this.name())},G.prototype.onDisconnect=G.prototype.ka,G.prototype.Ne=function(){O("FirebaseRef.removeOnDisconnect() being deprecated. Please use FirebaseRef.onDisconnect().remove() instead."),this.ka().remove(),Rf(this.i)},G.prototype.removeOnDisconnect=G.prototype.Ne,G.prototype.Se=function(a){O("FirebaseRef.setOnDisconnect(value) being deprecated. Please use FirebaseRef.onDisconnect().set(value) instead."),this.ka().set(a),Rf(this.i)},G.prototype.setOnDisconnect=G.prototype.Se,G.prototype.I=function(a,b,c){O("FirebaseRef.auth() being deprecated. Please use FirebaseRef.authWithCustomToken() instead."),x("Firebase.auth",1,3,arguments.length),Oa("Firebase.auth",a),z("Firebase.auth",2,b,!0),z("Firebase.auth",3,b,!0),Oe(this.i.I,a,{},{remember:"none"},b,c)},G.prototype.auth=G.prototype.I,G.prototype.Bd=function(a){x("Firebase.unauth",0,1,arguments.length),z("Firebase.unauth",1,a,!0),Pe(this.i.I,a)},G.prototype.unauth=G.prototype.Bd,G.prototype.bd=function(){return x("Firebase.getAuth",0,0,arguments.length),this.i.I.bd()},G.prototype.getAuth=G.prototype.bd,G.prototype.Ee=function(a,b){x("Firebase.onAuth",1,2,arguments.length),z("Firebase.onAuth",1,a,!1),za("Firebase.onAuth",2,b),this.i.I.Ua("auth_status",a,b)},G.prototype.onAuth=G.prototype.Ee,G.prototype.De=function(a,b){x("Firebase.offAuth",1,2,arguments.length),z("Firebase.offAuth",1,a,!1),za("Firebase.offAuth",2,b),this.i.I.nb("auth_status",a,b)},G.prototype.offAuth=G.prototype.De,G.prototype.je=function(a,b,c){x("Firebase.authWithCustomToken",2,3,arguments.length),Oa("Firebase.authWithCustomToken",a),z("Firebase.authWithCustomToken",2,b,!1),E("Firebase.authWithCustomToken",3,c,!0),Oe(this.i.I,a,{},c||{},b)},G.prototype.authWithCustomToken=G.prototype.je,G.prototype.ke=function(a,b,c){x("Firebase.authWithOAuthPopup",2,3,arguments.length),Pa("Firebase.authWithOAuthPopup",1,a),z("Firebase.authWithOAuthPopup",2,b,!1),E("Firebase.authWithOAuthPopup",3,c,!0),Te(this.i.I,a,c,b)},G.prototype.authWithOAuthPopup=G.prototype.ke,G.prototype.le=function(a,b,c){x("Firebase.authWithOAuthRedirect",2,3,arguments.length),Pa("Firebase.authWithOAuthRedirect",1,a),z("Firebase.authWithOAuthRedirect",2,b,!1),E("Firebase.authWithOAuthRedirect",3,c,!0);var d=this.i.I;Re(d);var e=[He],f=qe(c);"anonymous"===a||"firebase"===a?P(b,W("TRANSPORT_UNAVAILABLE")):(J.set("redirect_client_options",f.hc),Se(d,e,"/auth/"+a,f,b))},G.prototype.authWithOAuthRedirect=G.prototype.le,G.prototype.me=function(a,b,c,d){x("Firebase.authWithOAuthToken",3,4,arguments.length),Pa("Firebase.authWithOAuthToken",1,a),z("Firebase.authWithOAuthToken",3,c,!1),E("Firebase.authWithOAuthToken",4,d,!0),p(b)?(Pa("Firebase.authWithOAuthToken",2,b),Qe(this.i.I,a+"/token",{access_token:b},c)):(E("Firebase.authWithOAuthToken",2,b,!1),Qe(this.i.I,a+"/token",b,c))},G.prototype.authWithOAuthToken=G.prototype.me,G.prototype.ie=function(a,b){x("Firebase.authAnonymously",1,2,arguments.length),z("Firebase.authAnonymously",1,a,!1),E("Firebase.authAnonymously",2,b,!0),Qe(this.i.I,"anonymous",{},a)},G.prototype.authAnonymously=G.prototype.ie,G.prototype.ne=function(a,b,c){x("Firebase.authWithPassword",2,3,arguments.length),E("Firebase.authWithPassword",1,a,!1),Qa("Firebase.authWithPassword",a,"email"),Qa("Firebase.authWithPassword",a,"password"),z("Firebase.authAnonymously",2,b,!1),E("Firebase.authAnonymously",3,c,!0),Qe(this.i.I,"password",a,b)},G.prototype.authWithPassword=G.prototype.ne,G.prototype.Xc=function(a,b){x("Firebase.createUser",2,2,arguments.length),E("Firebase.createUser",1,a,!1),Qa("Firebase.createUser",a,"email"),Qa("Firebase.createUser",a,"password"),z("Firebase.createUser",2,b,!1),this.i.I.Xc(a,b)},G.prototype.createUser=G.prototype.Xc,G.prototype.sd=function(a,b){x("Firebase.removeUser",2,2,arguments.length),E("Firebase.removeUser",1,a,!1),Qa("Firebase.removeUser",a,"email"),Qa("Firebase.removeUser",a,"password"),z("Firebase.removeUser",2,b,!1),this.i.I.sd(a,b)},G.prototype.removeUser=G.prototype.sd,G.prototype.Tc=function(a,b){x("Firebase.changePassword",2,2,arguments.length),E("Firebase.changePassword",1,a,!1),Qa("Firebase.changePassword",a,"email"),Qa("Firebase.changePassword",a,"oldPassword"),Qa("Firebase.changePassword",a,"newPassword"),z("Firebase.changePassword",2,b,!1),this.i.I.Tc(a,b)},G.prototype.changePassword=G.prototype.Tc,G.prototype.td=function(a,b){x("Firebase.resetPassword",2,2,arguments.length),E("Firebase.resetPassword",1,a,!1),Qa("Firebase.resetPassword",a,"email"),z("Firebase.resetPassword",2,b,!1),this.i.I.td(a,b)},G.prototype.resetPassword=G.prototype.td,G.goOffline=function(){x("Firebase.goOffline",0,0,arguments.length),Y.ib().Qa()},G.goOnline=function(){x("Firebase.goOnline",0,0,arguments.length),Y.ib().tb()},G.enableLogging=dc,G.ServerValue={TIMESTAMP:{".sv":"timestamp"}},G.SDK_VERSION="1.1.2",G.INTERNAL=Z,G.Context=Y}(),module.exports=Firebase},{}],7:[function(a,b,c){(function(a){(function(){function d(a,b,c){for(var d=(c||0)-1,e=a?a.length:0;++d<e;)if(a[d]===b)return d;return-1}function e(a,b){var c=typeof b;if(a=a.cache,"boolean"==c||null==b)return a[b]?0:-1;"number"!=c&&"string"!=c&&(c="object");var e="number"==c?b:u+b;return a=(a=a[c])&&a[e],"object"==c?a&&d(a,b)>-1?0:-1:a?0:-1}function f(a){var b=this.cache,c=typeof a;if("boolean"==c||null==a)b[a]=!0;else{"number"!=c&&"string"!=c&&(c="object");var d="number"==c?a:u+a,e=b[c]||(b[c]={});"object"==c?(e[d]||(e[d]=[])).push(a):e[d]=!0}}function g(a){return a.charCodeAt(0)}function h(a,b){for(var c=a.criteria,d=b.criteria,e=-1,f=c.length;++e<f;){var g=c[e],h=d[e];if(g!==h){if(g>h||"undefined"==typeof g)return 1;if(h>g||"undefined"==typeof h)return-1}}return a.index-b.index}function i(a){var b=-1,c=a.length,d=a[0],e=a[c/2|0],g=a[c-1];if(d&&"object"==typeof d&&e&&"object"==typeof e&&g&&"object"==typeof g)return!1;var h=l();h["false"]=h["null"]=h["true"]=h.undefined=!1;var i=l();for(i.array=a,i.cache=h,i.push=f;++b<c;)i.push(a[b]);return i}function j(a){return"\\"+Y[a]}function k(){return r.pop()||[]}function l(){return s.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function m(a){a.length=0,r.length<w&&r.push(a)}function n(a){var b=a.cache;b&&n(b),a.array=a.cache=a.criteria=a.object=a.number=a.string=a.value=null,s.length<w&&s.push(a)}function o(a,b,c){b||(b=0),"undefined"==typeof c&&(c=a?a.length:0);for(var d=-1,e=c-b||0,f=Array(0>e?0:e);++d<e;)f[d]=a[b+d];return f}function p(a){function b(a){return a&&"object"==typeof a&&!Zd(a)&&Hd.call(a,"__wrapped__")?a:new c(a)}function c(a,b){this.__chain__=!!b,this.__wrapped__=a}function f(a){function b(){if(d){var a=o(d);Id.apply(a,arguments)}if(this instanceof b){var f=s(c.prototype),g=c.apply(f,a||arguments);return Eb(g)?g:f}return c.apply(e,a||arguments)}var c=a[0],d=a[2],e=a[4];return Yd(b,a),b}function r(a,b,c,d,e){if(c){var f=c(a);if("undefined"!=typeof f)return f}var g=Eb(a);if(!g)return a;var h=Ad.call(a);if(!U[h])return a;var i=Wd[h];switch(h){case N:case O:return new i(+a);case Q:case T:return new i(a);case S:return f=i(a.source,C.exec(a)),f.lastIndex=a.lastIndex,f}var j=Zd(a);if(b){var l=!d;d||(d=k()),e||(e=k());for(var n=d.length;n--;)if(d[n]==a)return e[n];f=j?i(a.length):{}}else f=j?o(a):ee({},a);return j&&(Hd.call(a,"index")&&(f.index=a.index),Hd.call(a,"input")&&(f.input=a.input)),b?(d.push(a),e.push(f),(j?Yb:he)(a,function(a,g){f[g]=r(a,b,c,d,e)}),l&&(m(d),m(e)),f):f}function s(a){return Eb(a)?Nd(a):{}}function w(a,b,c){if("function"!=typeof a)return Zc;if("undefined"==typeof b||!("prototype"in a))return a;var d=a.__bindData__;if("undefined"==typeof d&&(Xd.funcNames&&(d=!a.name),d=d||!Xd.funcDecomp,!d)){var e=Fd.call(a);Xd.funcNames||(d=!D.test(e)),d||(d=H.test(e),Yd(a,d))}if(d===!1||d!==!0&&1&d[1])return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return Ic(a,b)}function Y(a){function b(){var a=i?g:this;if(e){var n=o(e);Id.apply(n,arguments)}if((f||k)&&(n||(n=o(arguments)),f&&Id.apply(n,f),k&&n.length<h))return d|=16,Y([c,l?d:-4&d,n,null,g,h]);if(n||(n=arguments),j&&(c=a[m]),this instanceof b){a=s(c.prototype);var p=c.apply(a,n);return Eb(p)?p:a}return c.apply(a,n)}var c=a[0],d=a[1],e=a[2],f=a[3],g=a[4],h=a[5],i=1&d,j=2&d,k=4&d,l=8&d,m=c;return Yd(b,a),b}function $(a,b){var c=-1,f=ib(),g=a?a.length:0,h=g>=v&&f===d,j=[];if(h){var k=i(b);k?(f=e,b=k):h=!1}for(;++c<g;){var l=a[c];f(b,l)<0&&j.push(l)}return h&&n(b),j}function _(a,b,c,d){for(var e=(d||0)-1,f=a?a.length:0,g=[];++e<f;){var h=a[e];if(h&&"object"==typeof h&&"number"==typeof h.length&&(Zd(h)||mb(h))){b||(h=_(h,b,c));var i=-1,j=h.length,k=g.length;for(g.length+=j;++i<j;)g[k++]=h[i]}else c||g.push(h)}return g}function ab(a,b,c,d,e,f){if(c){var g=c(a,b);if("undefined"!=typeof g)return!!g}if(a===b)return 0!==a||1/a==1/b;var h=typeof a,i=typeof b;if(!(a!==a||a&&X[h]||b&&X[i]))return!1;if(null==a||null==b)return a===b;var j=Ad.call(a),l=Ad.call(b);if(j==L&&(j=R),l==L&&(l=R),j!=l)return!1;switch(j){case N:case O:return+a==+b;case Q:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case S:case T:return a==vd(b)}var n=j==M;if(!n){var o=Hd.call(a,"__wrapped__"),p=Hd.call(b,"__wrapped__");if(o||p)return ab(o?a.__wrapped__:a,p?b.__wrapped__:b,c,d,e,f);if(j!=R)return!1;var q=a.constructor,r=b.constructor;if(q!=r&&!(Db(q)&&q instanceof q&&Db(r)&&r instanceof r)&&"constructor"in a&&"constructor"in b)return!1}var s=!e;e||(e=k()),f||(f=k());for(var t=e.length;t--;)if(e[t]==a)return f[t]==b;var u=0;if(g=!0,e.push(a),f.push(b),n){if(t=a.length,u=b.length,g=u==t,g||d)for(;u--;){var v=t,w=b[u];if(d)for(;v--&&!(g=ab(a[v],w,c,d,e,f)););else if(!(g=ab(a[u],w,c,d,e,f)))break}}else ge(b,function(b,h,i){return Hd.call(i,h)?(u++,g=Hd.call(a,h)&&ab(a[h],b,c,d,e,f)):void 0}),g&&!d&&ge(a,function(a,b,c){return Hd.call(c,b)?g=--u>-1:void 0});return e.pop(),f.pop(),s&&(m(e),m(f)),g}function bb(a,b,c,d,e){(Zd(b)?Yb:he)(b,function(b,f){var g,h,i=b,j=a[f];if(b&&((h=Zd(b))||ie(b))){for(var k=d.length;k--;)if(g=d[k]==b){j=e[k];break}if(!g){var l;c&&(i=c(j,b),(l="undefined"!=typeof i)&&(j=i)),l||(j=h?Zd(j)?j:[]:ie(j)?j:{}),d.push(b),e.push(j),l||bb(j,b,c,d,e)}}else c&&(i=c(j,b),"undefined"==typeof i&&(i=b)),"undefined"!=typeof i&&(j=i);a[f]=j})}function db(a,b){return a+Ed(Vd()*(b-a+1))}function eb(a,b,c){var f=-1,g=ib(),h=a?a.length:0,j=[],l=!b&&h>=v&&g===d,o=c||l?k():j;if(l){var p=i(o);g=e,o=p}for(;++f<h;){var q=a[f],r=c?c(q,f,a):q;(b?!f||o[o.length-1]!==r:g(o,r)<0)&&((c||l)&&o.push(r),j.push(q))}return l?(m(o.array),n(o)):c&&m(o),j}function fb(a){return function(c,d,e){var f={};d=b.createCallback(d,e,3);var g=-1,h=c?c.length:0;if("number"==typeof h)for(;++g<h;){var i=c[g];a(f,i,d(i,g,c),c)}else he(c,function(b,c,e){a(f,b,d(b,c,e),e)});return f}}function gb(a,b,c,d,e,g){var h=1&b,i=2&b,j=4&b,k=16&b,l=32&b;if(!i&&!Db(a))throw new wd;k&&!c.length&&(b&=-17,k=c=!1),l&&!d.length&&(b&=-33,l=d=!1);var m=a&&a.__bindData__;if(m&&m!==!0)return m=o(m),m[2]&&(m[2]=o(m[2])),m[3]&&(m[3]=o(m[3])),!h||1&m[1]||(m[4]=e),!h&&1&m[1]&&(b|=8),!j||4&m[1]||(m[5]=g),k&&Id.apply(m[2]||(m[2]=[]),c),l&&Ld.apply(m[3]||(m[3]=[]),d),m[1]|=b,gb.apply(null,m);var n=1==b||17===b?f:Y;return n([a,b,c,d,e,g])}function hb(a){return ae[a]}function ib(){var a=(a=b.indexOf)===rc?d:a;return a}function jb(a){return"function"==typeof a&&Bd.test(a)}function kb(a){var b,c;return a&&Ad.call(a)==R&&(b=a.constructor,!Db(b)||b instanceof b)?(ge(a,function(a,b){c=b}),"undefined"==typeof c||Hd.call(a,c)):!1}function lb(a){return be[a]}function mb(a){return a&&"object"==typeof a&&"number"==typeof a.length&&Ad.call(a)==L||!1}function nb(a,b,c,d){return"boolean"!=typeof b&&null!=b&&(d=c,c=b,b=!1),r(a,b,"function"==typeof c&&w(c,d,1))}function ob(a,b,c){return r(a,!0,"function"==typeof b&&w(b,c,1))}function pb(a,b){var c=s(a);return b?ee(c,b):c}function qb(a,c,d){var e;return c=b.createCallback(c,d,3),he(a,function(a,b,d){return c(a,b,d)?(e=b,!1):void 0}),e}function rb(a,c,d){var e;return c=b.createCallback(c,d,3),tb(a,function(a,b,d){return c(a,b,d)?(e=b,!1):void 0}),e}function sb(a,b,c){var d=[];ge(a,function(a,b){d.push(b,a)});var e=d.length;for(b=w(b,c,3);e--&&b(d[e--],d[e],a)!==!1;);return a}function tb(a,b,c){var d=_d(a),e=d.length;for(b=w(b,c,3);e--;){var f=d[e];if(b(a[f],f,a)===!1)break}return a}function ub(a){var b=[];return ge(a,function(a,c){Db(a)&&b.push(c)}),b.sort()}function vb(a,b){return a?Hd.call(a,b):!1}function wb(a){for(var b=-1,c=_d(a),d=c.length,e={};++b<d;){var f=c[b];e[a[f]]=f}return e}function xb(a){return a===!0||a===!1||a&&"object"==typeof a&&Ad.call(a)==N||!1}function yb(a){return a&&"object"==typeof a&&Ad.call(a)==O||!1}function zb(a){return a&&1===a.nodeType||!1}function Ab(a){var b=!0;if(!a)return b;var c=Ad.call(a),d=a.length;return c==M||c==T||c==L||c==R&&"number"==typeof d&&Db(a.splice)?!d:(he(a,function(){return b=!1}),b)}function Bb(a,b,c,d){return ab(a,b,"function"==typeof c&&w(c,d,2))}function Cb(a){return Pd(a)&&!Qd(parseFloat(a))}function Db(a){return"function"==typeof a}function Eb(a){return!(!a||!X[typeof a])}function Fb(a){return Hb(a)&&a!=+a}function Gb(a){return null===a}function Hb(a){return"number"==typeof a||a&&"object"==typeof a&&Ad.call(a)==Q||!1}function Ib(a){return a&&"object"==typeof a&&Ad.call(a)==S||!1}function Jb(a){return"string"==typeof a||a&&"object"==typeof a&&Ad.call(a)==T||!1}function Kb(a){return"undefined"==typeof a}function Lb(a,c,d){var e={};return c=b.createCallback(c,d,3),he(a,function(a,b,d){e[b]=c(a,b,d)}),e}function Mb(a){var b=arguments,c=2;if(!Eb(a))return a;if("number"!=typeof b[2]&&(c=b.length),c>3&&"function"==typeof b[c-2])var d=w(b[--c-1],b[c--],2);else c>2&&"function"==typeof b[c-1]&&(d=b[--c]);for(var e=o(arguments,1,c),f=-1,g=k(),h=k();++f<c;)bb(a,e[f],d,g,h);return m(g),m(h),a}function Nb(a,c,d){var e={};if("function"!=typeof c){var f=[];ge(a,function(a,b){f.push(b)}),f=$(f,_(arguments,!0,!1,1));for(var g=-1,h=f.length;++g<h;){var i=f[g];e[i]=a[i]}}else c=b.createCallback(c,d,3),ge(a,function(a,b,d){c(a,b,d)||(e[b]=a)});return e}function Ob(a){for(var b=-1,c=_d(a),d=c.length,e=nd(d);++b<d;){var f=c[b];e[b]=[f,a[f]]}return e}function Pb(a,c,d){var e={};if("function"!=typeof c)for(var f=-1,g=_(arguments,!0,!1,1),h=Eb(a)?g.length:0;++f<h;){var i=g[f];i in a&&(e[i]=a[i])}else c=b.createCallback(c,d,3),ge(a,function(a,b,d){c(a,b,d)&&(e[b]=a)});return e}function Qb(a,c,d,e){var f=Zd(a);if(null==d)if(f)d=[];else{var g=a&&a.constructor,h=g&&g.prototype;d=s(h)}return c&&(c=b.createCallback(c,e,4),(f?Yb:he)(a,function(a,b,e){return c(d,a,b,e)})),d}function Rb(a){for(var b=-1,c=_d(a),d=c.length,e=nd(d);++b<d;)e[b]=a[c[b]];return e}function Sb(a){for(var b=arguments,c=-1,d=_(b,!0,!1,1),e=b[2]&&b[2][b[1]]===a?1:d.length,f=nd(e);++c<e;)f[c]=a[d[c]];return f}function Tb(a,b,c){var d=-1,e=ib(),f=a?a.length:0,g=!1;return c=(0>c?Sd(0,f+c):c)||0,Zd(a)?g=e(a,b,c)>-1:"number"==typeof f?g=(Jb(a)?a.indexOf(b,c):e(a,b,c))>-1:he(a,function(a){return++d>=c?!(g=a===b):void 0}),g}function Ub(a,c,d){var e=!0;c=b.createCallback(c,d,3);var f=-1,g=a?a.length:0;if("number"==typeof g)for(;++f<g&&(e=!!c(a[f],f,a)););else he(a,function(a,b,d){return e=!!c(a,b,d)});return e}function Vb(a,c,d){var e=[];c=b.createCallback(c,d,3);var f=-1,g=a?a.length:0;if("number"==typeof g)for(;++f<g;){var h=a[f];c(h,f,a)&&e.push(h)}else he(a,function(a,b,d){c(a,b,d)&&e.push(a)});return e}function Wb(a,c,d){c=b.createCallback(c,d,3);var e=-1,f=a?a.length:0;if("number"!=typeof f){var g;return he(a,function(a,b,d){return c(a,b,d)?(g=a,!1):void 0}),g}for(;++e<f;){var h=a[e];if(c(h,e,a))return h}}function Xb(a,c,d){var e;return c=b.createCallback(c,d,3),Zb(a,function(a,b,d){return c(a,b,d)?(e=a,!1):void 0}),e}function Yb(a,b,c){var d=-1,e=a?a.length:0;if(b=b&&"undefined"==typeof c?b:w(b,c,3),"number"==typeof e)for(;++d<e&&b(a[d],d,a)!==!1;);else he(a,b);return a}function Zb(a,b,c){var d=a?a.length:0;if(b=b&&"undefined"==typeof c?b:w(b,c,3),"number"==typeof d)for(;d--&&b(a[d],d,a)!==!1;);else{var e=_d(a);d=e.length,he(a,function(a,c,f){return c=e?e[--d]:--d,b(f[c],c,f)})}return a}function $b(a,b){var c=o(arguments,2),d=-1,e="function"==typeof b,f=a?a.length:0,g=nd("number"==typeof f?f:0);return Yb(a,function(a){g[++d]=(e?b:a[b]).apply(a,c)}),g}function _b(a,c,d){var e=-1,f=a?a.length:0;if(c=b.createCallback(c,d,3),"number"==typeof f)for(var g=nd(f);++e<f;)g[e]=c(a[e],e,a);else g=[],he(a,function(a,b,d){g[++e]=c(a,b,d)});return g}function ac(a,c,d){var e=-1/0,f=e;if("function"!=typeof c&&d&&d[c]===a&&(c=null),null==c&&Zd(a))for(var h=-1,i=a.length;++h<i;){var j=a[h];j>f&&(f=j)}else c=null==c&&Jb(a)?g:b.createCallback(c,d,3),Yb(a,function(a,b,d){var g=c(a,b,d);g>e&&(e=g,f=a)});return f}function bc(a,c,d){var e=1/0,f=e;if("function"!=typeof c&&d&&d[c]===a&&(c=null),null==c&&Zd(a))for(var h=-1,i=a.length;++h<i;){var j=a[h];f>j&&(f=j)}else c=null==c&&Jb(a)?g:b.createCallback(c,d,3),Yb(a,function(a,b,d){var g=c(a,b,d);e>g&&(e=g,f=a)});return f}function cc(a,c,d,e){if(!a)return d;var f=arguments.length<3;c=b.createCallback(c,e,4);var g=-1,h=a.length;if("number"==typeof h)for(f&&(d=a[++g]);++g<h;)d=c(d,a[g],g,a);else he(a,function(a,b,e){d=f?(f=!1,a):c(d,a,b,e)});return d}function dc(a,c,d,e){var f=arguments.length<3;return c=b.createCallback(c,e,4),Zb(a,function(a,b,e){d=f?(f=!1,a):c(d,a,b,e)}),d}function ec(a,c,d){return c=b.createCallback(c,d,3),Vb(a,function(a,b,d){return!c(a,b,d)})}function fc(a,b,c){if(a&&"number"!=typeof a.length&&(a=Rb(a)),null==b||c)return a?a[db(0,a.length-1)]:q;var d=gc(a);return d.length=Td(Sd(0,b),d.length),d}function gc(a){var b=-1,c=a?a.length:0,d=nd("number"==typeof c?c:0);return Yb(a,function(a){var c=db(0,++b);d[b]=d[c],d[c]=a}),d}function hc(a){var b=a?a.length:0;return"number"==typeof b?b:_d(a).length}function ic(a,c,d){var e;c=b.createCallback(c,d,3);var f=-1,g=a?a.length:0;if("number"==typeof g)for(;++f<g&&!(e=c(a[f],f,a)););else he(a,function(a,b,d){return!(e=c(a,b,d))});return!!e}function jc(a,c,d){var e=-1,f=Zd(c),g=a?a.length:0,i=nd("number"==typeof g?g:0);for(f||(c=b.createCallback(c,d,3)),Yb(a,function(a,b,d){var g=i[++e]=l();f?g.criteria=_b(c,function(b){return a[b]}):(g.criteria=k())[0]=c(a,b,d),g.index=e,g.value=a}),g=i.length,i.sort(h);g--;){var j=i[g];i[g]=j.value,f||m(j.criteria),n(j)}return i}function kc(a){return a&&"number"==typeof a.length?o(a):Rb(a)}function lc(a){for(var b=-1,c=a?a.length:0,d=[];++b<c;){var e=a[b];e&&d.push(e)}return d}function mc(a){return $(a,_(arguments,!0,!0,1))}function nc(a,c,d){var e=-1,f=a?a.length:0;for(c=b.createCallback(c,d,3);++e<f;)if(c(a[e],e,a))return e;return-1}function oc(a,c,d){var e=a?a.length:0;for(c=b.createCallback(c,d,3);e--;)if(c(a[e],e,a))return e;return-1}function pc(a,c,d){var e=0,f=a?a.length:0;if("number"!=typeof c&&null!=c){var g=-1;for(c=b.createCallback(c,d,3);++g<f&&c(a[g],g,a);)e++}else if(e=c,null==e||d)return a?a[0]:q;return o(a,0,Td(Sd(0,e),f))}function qc(a,b,c,d){return"boolean"!=typeof b&&null!=b&&(d=c,c="function"!=typeof b&&d&&d[b]===a?null:b,b=!1),null!=c&&(a=_b(a,c,d)),_(a,b)}function rc(a,b,c){if("number"==typeof c){var e=a?a.length:0;c=0>c?Sd(0,e+c):c||0}else if(c){var f=Ac(a,b);return a[f]===b?f:-1}return d(a,b,c)}function sc(a,c,d){var e=0,f=a?a.length:0;if("number"!=typeof c&&null!=c){var g=f;for(c=b.createCallback(c,d,3);g--&&c(a[g],g,a);)e++}else e=null==c||d?1:c||e;return o(a,0,Td(Sd(0,f-e),f))}function tc(){for(var a=[],b=-1,c=arguments.length,f=k(),g=ib(),h=g===d,j=k();++b<c;){var l=arguments[b];(Zd(l)||mb(l))&&(a.push(l),f.push(h&&l.length>=v&&i(b?a[b]:j)))}var o=a[0],p=-1,q=o?o.length:0,r=[];a:for(;++p<q;){var s=f[0];if(l=o[p],(s?e(s,l):g(j,l))<0){for(b=c,(s||j).push(l);--b;)if(s=f[b],(s?e(s,l):g(a[b],l))<0)continue a;r.push(l)}}for(;c--;)s=f[c],s&&n(s);return m(f),m(j),r}function uc(a,c,d){var e=0,f=a?a.length:0;if("number"!=typeof c&&null!=c){var g=f;for(c=b.createCallback(c,d,3);g--&&c(a[g],g,a);)e++}else if(e=c,null==e||d)return a?a[f-1]:q;return o(a,Sd(0,f-e))}function vc(a,b,c){var d=a?a.length:0;for("number"==typeof c&&(d=(0>c?Sd(0,d+c):Td(c,d-1))+1);d--;)if(a[d]===b)return d;return-1}function wc(a){for(var b=arguments,c=0,d=b.length,e=a?a.length:0;++c<d;)for(var f=-1,g=b[c];++f<e;)a[f]===g&&(Kd.call(a,f--,1),e--);return a}function xc(a,b,c){a=+a||0,c="number"==typeof c?c:+c||1,null==b&&(b=a,a=0);for(var d=-1,e=Sd(0,Cd((b-a)/(c||1))),f=nd(e);++d<e;)f[d]=a,a+=c;
|
||
return f}function yc(a,c,d){var e=-1,f=a?a.length:0,g=[];for(c=b.createCallback(c,d,3);++e<f;){var h=a[e];c(h,e,a)&&(g.push(h),Kd.call(a,e--,1),f--)}return g}function zc(a,c,d){if("number"!=typeof c&&null!=c){var e=0,f=-1,g=a?a.length:0;for(c=b.createCallback(c,d,3);++f<g&&c(a[f],f,a);)e++}else e=null==c||d?1:Sd(0,c);return o(a,e)}function Ac(a,c,d,e){var f=0,g=a?a.length:f;for(d=d?b.createCallback(d,e,1):Zc,c=d(c);g>f;){var h=f+g>>>1;d(a[h])<c?f=h+1:g=h}return f}function Bc(){return eb(_(arguments,!0,!0))}function Cc(a,c,d,e){return"boolean"!=typeof c&&null!=c&&(e=d,d="function"!=typeof c&&e&&e[c]===a?null:c,c=!1),null!=d&&(d=b.createCallback(d,e,3)),eb(a,c,d)}function Dc(a){return $(a,o(arguments,1))}function Ec(){for(var a=-1,b=arguments.length;++a<b;){var c=arguments[a];if(Zd(c)||mb(c))var d=d?eb($(d,c).concat($(c,d))):c}return d||[]}function Fc(){for(var a=arguments.length>1?arguments:arguments[0],b=-1,c=a?ac(me(a,"length")):0,d=nd(0>c?0:c);++b<c;)d[b]=me(a,b);return d}function Gc(a,b){var c=-1,d=a?a.length:0,e={};for(b||!d||Zd(a[0])||(b=[]);++c<d;){var f=a[c];b?e[f]=b[c]:f&&(e[f[0]]=f[1])}return e}function Hc(a,b){if(!Db(b))throw new wd;return function(){return--a<1?b.apply(this,arguments):void 0}}function Ic(a,b){return arguments.length>2?gb(a,17,o(arguments,2),null,b):gb(a,1,null,null,b)}function Jc(a){for(var b=arguments.length>1?_(arguments,!0,!1,1):ub(a),c=-1,d=b.length;++c<d;){var e=b[c];a[e]=gb(a[e],1,null,null,a)}return a}function Kc(a,b){return arguments.length>2?gb(b,19,o(arguments,2),null,a):gb(b,3,null,null,a)}function Lc(){for(var a=arguments,b=a.length;b--;)if(!Db(a[b]))throw new wd;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}}function Mc(a,b){return b="number"==typeof b?b:+b||a.length,gb(a,4,null,null,null,b)}function Nc(a,b,c){var d,e,f,g,h,i,j,k=0,l=!1,m=!0;if(!Db(a))throw new wd;if(b=Sd(0,b)||0,c===!0){var n=!0;m=!1}else Eb(c)&&(n=c.leading,l="maxWait"in c&&(Sd(b,c.maxWait)||0),m="trailing"in c?c.trailing:m);var o=function(){var c=b-(oe()-g);if(0>=c){e&&Dd(e);var l=j;e=i=j=q,l&&(k=oe(),f=a.apply(h,d),i||e||(d=h=null))}else i=Jd(o,c)},p=function(){i&&Dd(i),e=i=j=q,(m||l!==b)&&(k=oe(),f=a.apply(h,d),i||e||(d=h=null))};return function(){if(d=arguments,g=oe(),h=this,j=m&&(i||!n),l===!1)var c=n&&!i;else{e||n||(k=g);var q=l-(g-k),r=0>=q;r?(e&&(e=Dd(e)),k=g,f=a.apply(h,d)):e||(e=Jd(p,q))}return r&&i?i=Dd(i):i||b===l||(i=Jd(o,b)),c&&(r=!0,f=a.apply(h,d)),!r||i||e||(d=h=null),f}}function Oc(a){if(!Db(a))throw new wd;var b=o(arguments,1);return Jd(function(){a.apply(q,b)},1)}function Pc(a,b){if(!Db(a))throw new wd;var c=o(arguments,2);return Jd(function(){a.apply(q,c)},b)}function Qc(a,b){if(!Db(a))throw new wd;var c=function(){var d=c.cache,e=b?b.apply(this,arguments):u+arguments[0];return Hd.call(d,e)?d[e]:d[e]=a.apply(this,arguments)};return c.cache={},c}function Rc(a){var b,c;if(!Db(a))throw new wd;return function(){return b?c:(b=!0,c=a.apply(this,arguments),a=null,c)}}function Sc(a){return gb(a,16,o(arguments,1))}function Tc(a){return gb(a,32,null,o(arguments,1))}function Uc(a,b,c){var d=!0,e=!0;if(!Db(a))throw new wd;return c===!1?d=!1:Eb(c)&&(d="leading"in c?c.leading:d,e="trailing"in c?c.trailing:e),V.leading=d,V.maxWait=b,V.trailing=e,Nc(a,b,V)}function Vc(a,b){return gb(b,16,[a])}function Wc(a){return function(){return a}}function Xc(a,b,c){var d=typeof a;if(null==a||"function"==d)return w(a,b,c);if("object"!=d)return bd(a);var e=_d(a),f=e[0],g=a[f];return 1!=e.length||g!==g||Eb(g)?function(b){for(var c=e.length,d=!1;c--&&(d=ab(b[e[c]],a[e[c]],null,!0)););return d}:function(a){var b=a[f];return g===b&&(0!==g||1/g==1/b)}}function Yc(a){return null==a?"":vd(a).replace(de,hb)}function Zc(a){return a}function $c(a,d,e){var f=!0,g=d&&ub(d);d&&(e||g.length)||(null==e&&(e=d),h=c,d=a,a=b,g=ub(d)),e===!1?f=!1:Eb(e)&&"chain"in e&&(f=e.chain);var h=a,i=Db(h);Yb(g,function(b){var c=a[b]=d[b];i&&(h.prototype[b]=function(){var b=this.__chain__,d=this.__wrapped__,e=[d];Id.apply(e,arguments);var g=c.apply(a,e);if(f||b){if(d===g&&Eb(g))return this;g=new h(g),g.__chain__=b}return g})})}function _c(){return a._=zd,this}function ad(){}function bd(a){return function(b){return b[a]}}function cd(a,b,c){var d=null==a,e=null==b;if(null==c&&("boolean"==typeof a&&e?(c=a,a=1):e||"boolean"!=typeof b||(c=b,e=!0)),d&&e&&(b=1),a=+a||0,e?(b=a,a=0):b=+b||0,c||a%1||b%1){var f=Vd();return Td(a+f*(b-a+parseFloat("1e-"+((f+"").length-1))),b)}return db(a,b)}function dd(a,b){if(a){var c=a[b];return Db(c)?a[b]():c}}function ed(a,c,d){var e=b.templateSettings;a=vd(a||""),d=fe({},d,e);var f,g=fe({},d.imports,e.imports),h=_d(g),i=Rb(g),k=0,l=d.interpolate||G,m="__p += '",n=ud((d.escape||G).source+"|"+l.source+"|"+(l===E?B:G).source+"|"+(d.evaluate||G).source+"|$","g");a.replace(n,function(b,c,d,e,g,h){return d||(d=e),m+=a.slice(k,h).replace(I,j),c&&(m+="' +\n__e("+c+") +\n'"),g&&(f=!0,m+="';\n"+g+";\n__p += '"),d&&(m+="' +\n((__t = ("+d+")) == null ? '' : __t) +\n'"),k=h+b.length,b}),m+="';\n";var o=d.variable,p=o;p||(o="obj",m="with ("+o+") {\n"+m+"\n}\n"),m=(f?m.replace(y,""):m).replace(z,"$1").replace(A,"$1;"),m="function("+o+") {\n"+(p?"":o+" || ("+o+" = {});\n")+"var __t, __p = '', __e = _.escape"+(f?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+m+"return __p\n}";var r="\n/*\n//# sourceURL="+(d.sourceURL||"/lodash/template/source["+K++ +"]")+"\n*/";try{var s=qd(h,"return "+m+r).apply(q,i)}catch(t){throw t.source=m,t}return c?s(c):(s.source=m,s)}function fd(a,b,c){a=(a=+a)>-1?a:0;var d=-1,e=nd(a);for(b=w(b,c,1);++d<a;)e[d]=b(d);return e}function gd(a){return null==a?"":vd(a).replace(ce,lb)}function hd(a){var b=++t;return vd(null==a?"":a)+b}function id(a){return a=new c(a),a.__chain__=!0,a}function jd(a,b){return b(a),a}function kd(){return this.__chain__=!0,this}function ld(){return vd(this.__wrapped__)}function md(){return this.__wrapped__}a=a?cb.defaults(Z.Object(),a,cb.pick(Z,J)):Z;var nd=a.Array,od=a.Boolean,pd=a.Date,qd=a.Function,rd=a.Math,sd=a.Number,td=a.Object,ud=a.RegExp,vd=a.String,wd=a.TypeError,xd=[],yd=td.prototype,zd=a._,Ad=yd.toString,Bd=ud("^"+vd(Ad).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Cd=rd.ceil,Dd=a.clearTimeout,Ed=rd.floor,Fd=qd.prototype.toString,Gd=jb(Gd=td.getPrototypeOf)&&Gd,Hd=yd.hasOwnProperty,Id=xd.push,Jd=a.setTimeout,Kd=xd.splice,Ld=xd.unshift,Md=function(){try{var a={},b=jb(b=td.defineProperty)&&b,c=b(a,a,a)&&b}catch(d){}return c}(),Nd=jb(Nd=td.create)&&Nd,Od=jb(Od=nd.isArray)&&Od,Pd=a.isFinite,Qd=a.isNaN,Rd=jb(Rd=td.keys)&&Rd,Sd=rd.max,Td=rd.min,Ud=a.parseInt,Vd=rd.random,Wd={};Wd[M]=nd,Wd[N]=od,Wd[O]=pd,Wd[P]=qd,Wd[R]=td,Wd[Q]=sd,Wd[S]=ud,Wd[T]=vd,c.prototype=b.prototype;var Xd=b.support={};Xd.funcDecomp=!jb(a.WinRTError)&&H.test(p),Xd.funcNames="string"==typeof qd.name,b.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:E,variable:"",imports:{_:b}},Nd||(s=function(){function b(){}return function(c){if(Eb(c)){b.prototype=c;var d=new b;b.prototype=null}return d||a.Object()}}());var Yd=Md?function(a,b){W.value=b,Md(a,"__bindData__",W)}:ad,Zd=Od||function(a){return a&&"object"==typeof a&&"number"==typeof a.length&&Ad.call(a)==M||!1},$d=function(a){var b,c=a,d=[];if(!c)return d;if(!X[typeof a])return d;for(b in c)Hd.call(c,b)&&d.push(b);return d},_d=Rd?function(a){return Eb(a)?Rd(a):[]}:$d,ae={"&":"&","<":"<",">":">",'"':""","'":"'"},be=wb(ae),ce=ud("("+_d(be).join("|")+")","g"),de=ud("["+_d(ae).join("")+"]","g"),ee=function(a,b,c){var d,e=a,f=e;if(!e)return f;var g=arguments,h=0,i="number"==typeof c?2:g.length;if(i>3&&"function"==typeof g[i-2])var j=w(g[--i-1],g[i--],2);else i>2&&"function"==typeof g[i-1]&&(j=g[--i]);for(;++h<i;)if(e=g[h],e&&X[typeof e])for(var k=-1,l=X[typeof e]&&_d(e),m=l?l.length:0;++k<m;)d=l[k],f[d]=j?j(f[d],e[d]):e[d];return f},fe=function(a,b,c){var d,e=a,f=e;if(!e)return f;for(var g=arguments,h=0,i="number"==typeof c?2:g.length;++h<i;)if(e=g[h],e&&X[typeof e])for(var j=-1,k=X[typeof e]&&_d(e),l=k?k.length:0;++j<l;)d=k[j],"undefined"==typeof f[d]&&(f[d]=e[d]);return f},ge=function(a,b,c){var d,e=a,f=e;if(!e)return f;if(!X[typeof e])return f;b=b&&"undefined"==typeof c?b:w(b,c,3);for(d in e)if(b(e[d],d,a)===!1)return f;return f},he=function(a,b,c){var d,e=a,f=e;if(!e)return f;if(!X[typeof e])return f;b=b&&"undefined"==typeof c?b:w(b,c,3);for(var g=-1,h=X[typeof e]&&_d(e),i=h?h.length:0;++g<i;)if(d=h[g],b(e[d],d,a)===!1)return f;return f},ie=Gd?function(a){if(!a||Ad.call(a)!=R)return!1;var b=a.valueOf,c=jb(b)&&(c=Gd(b))&&Gd(c);return c?a==c||Gd(a)==c:kb(a)}:kb,je=fb(function(a,b,c){Hd.call(a,c)?a[c]++:a[c]=1}),ke=fb(function(a,b,c){(Hd.call(a,c)?a[c]:a[c]=[]).push(b)}),le=fb(function(a,b,c){a[c]=b}),me=_b,ne=Vb,oe=jb(oe=pd.now)&&oe||function(){return(new pd).getTime()},pe=8==Ud(x+"08")?Ud:function(a,b){return Ud(Jb(a)?a.replace(F,""):a,b||0)};return b.after=Hc,b.assign=ee,b.at=Sb,b.bind=Ic,b.bindAll=Jc,b.bindKey=Kc,b.chain=id,b.compact=lc,b.compose=Lc,b.constant=Wc,b.countBy=je,b.create=pb,b.createCallback=Xc,b.curry=Mc,b.debounce=Nc,b.defaults=fe,b.defer=Oc,b.delay=Pc,b.difference=mc,b.filter=Vb,b.flatten=qc,b.forEach=Yb,b.forEachRight=Zb,b.forIn=ge,b.forInRight=sb,b.forOwn=he,b.forOwnRight=tb,b.functions=ub,b.groupBy=ke,b.indexBy=le,b.initial=sc,b.intersection=tc,b.invert=wb,b.invoke=$b,b.keys=_d,b.map=_b,b.mapValues=Lb,b.max=ac,b.memoize=Qc,b.merge=Mb,b.min=bc,b.omit=Nb,b.once=Rc,b.pairs=Ob,b.partial=Sc,b.partialRight=Tc,b.pick=Pb,b.pluck=me,b.property=bd,b.pull=wc,b.range=xc,b.reject=ec,b.remove=yc,b.rest=zc,b.shuffle=gc,b.sortBy=jc,b.tap=jd,b.throttle=Uc,b.times=fd,b.toArray=kc,b.transform=Qb,b.union=Bc,b.uniq=Cc,b.values=Rb,b.where=ne,b.without=Dc,b.wrap=Vc,b.xor=Ec,b.zip=Fc,b.zipObject=Gc,b.collect=_b,b.drop=zc,b.each=Yb,b.eachRight=Zb,b.extend=ee,b.methods=ub,b.object=Gc,b.select=Vb,b.tail=zc,b.unique=Cc,b.unzip=Fc,$c(b),b.clone=nb,b.cloneDeep=ob,b.contains=Tb,b.escape=Yc,b.every=Ub,b.find=Wb,b.findIndex=nc,b.findKey=qb,b.findLast=Xb,b.findLastIndex=oc,b.findLastKey=rb,b.has=vb,b.identity=Zc,b.indexOf=rc,b.isArguments=mb,b.isArray=Zd,b.isBoolean=xb,b.isDate=yb,b.isElement=zb,b.isEmpty=Ab,b.isEqual=Bb,b.isFinite=Cb,b.isFunction=Db,b.isNaN=Fb,b.isNull=Gb,b.isNumber=Hb,b.isObject=Eb,b.isPlainObject=ie,b.isRegExp=Ib,b.isString=Jb,b.isUndefined=Kb,b.lastIndexOf=vc,b.mixin=$c,b.noConflict=_c,b.noop=ad,b.now=oe,b.parseInt=pe,b.random=cd,b.reduce=cc,b.reduceRight=dc,b.result=dd,b.runInContext=p,b.size=hc,b.some=ic,b.sortedIndex=Ac,b.template=ed,b.unescape=gd,b.uniqueId=hd,b.all=Ub,b.any=ic,b.detect=Wb,b.findWhere=Wb,b.foldl=cc,b.foldr=dc,b.include=Tb,b.inject=cc,$c(function(){var a={};return he(b,function(c,d){b.prototype[d]||(a[d]=c)}),a}(),!1),b.first=pc,b.last=uc,b.sample=fc,b.take=pc,b.head=pc,he(b,function(a,d){var e="sample"!==d;b.prototype[d]||(b.prototype[d]=function(b,d){var f=this.__chain__,g=a(this.__wrapped__,b,d);return f||null!=b&&(!d||e&&"function"==typeof b)?new c(g,f):g})}),b.VERSION="2.4.1",b.prototype.chain=kd,b.prototype.toString=ld,b.prototype.value=md,b.prototype.valueOf=md,Yb(["join","pop","shift"],function(a){var d=xd[a];b.prototype[a]=function(){var a=this.__chain__,b=d.apply(this.__wrapped__,arguments);return a?new c(b,a):b}}),Yb(["push","reverse","sort","unshift"],function(a){var c=xd[a];b.prototype[a]=function(){return c.apply(this.__wrapped__,arguments),this}}),Yb(["concat","slice","splice"],function(a){var d=xd[a];b.prototype[a]=function(){return new c(d.apply(this.__wrapped__,arguments),this.__chain__)}}),b}var q,r=[],s=[],t=0,u=+new Date+"",v=75,w=40,x=" \f \n\r\u2028\u2029 ",y=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,A=/(__e\(.*?\)|\b__t\)) \+\n'';/g,B=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,C=/\w*$/,D=/^\s*function[ \n\r\t]+\w/,E=/<%=([\s\S]+?)%>/g,F=RegExp("^["+x+"]*0+(?=.$)"),G=/($^)/,H=/\bthis\b/,I=/['\n\r\t\u2028\u2029\\]/g,J=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],K=0,L="[object Arguments]",M="[object Array]",N="[object Boolean]",O="[object Date]",P="[object Function]",Q="[object Number]",R="[object Object]",S="[object RegExp]",T="[object String]",U={};U[P]=!1,U[L]=U[M]=U[N]=U[O]=U[Q]=U[R]=U[S]=U[T]=!0;var V={leading:!1,maxWait:0,trailing:!1},W={configurable:!1,enumerable:!1,value:null,writable:!1},X={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Y={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&window||this,$=X[typeof c]&&c&&!c.nodeType&&c,_=X[typeof b]&&b&&!b.nodeType&&b,ab=_&&_.exports===$&&$,bb=X[typeof a]&&a;!bb||bb.global!==bb&&bb.window!==bb||(Z=bb);var cb=p();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Z._=cb,define(function(){return cb})):$&&_?ab?(_.exports=cb)._=cb:$._=cb:Z._=cb}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(a,b){!function(a,c){"function"==typeof define&&define.amd?define([],c):"undefined"!=typeof b&&b.exports?b.exports=c():a.lscache=c()}(this,function(){function a(){var a="__lscachetest__",b=a;if(void 0!==i)return i;try{f(a,b),g(a),i=!0}catch(c){i=!1}return i}function b(){return void 0===j&&(j=null!=window.JSON),j}function c(a){return a+l}function d(){return Math.floor((new Date).getTime()/n)}function e(a){return localStorage.getItem(k+p+a)}function f(a,b){localStorage.removeItem(k+p+a),localStorage.setItem(k+p+a,b)}function g(a){localStorage.removeItem(k+p+a)}function h(a,b){q&&"console"in window&&"function"==typeof window.console.warn&&(window.console.warn("lscache - "+a),b&&window.console.warn("lscache - The error was: "+b.message))}var i,j,k="lscache-",l="-cacheexpiration",m=10,n=6e4,o=Math.floor(864e13/n),p="",q=!1,r={set:function(i,j,n){if(a()){if("string"!=typeof j){if(!b())return;try{j=JSON.stringify(j)}catch(q){return}}try{f(i,j)}catch(q){if("QUOTA_EXCEEDED_ERR"!==q.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==q.name&&"QuotaExceededError"!==q.name)return void h("Could not add item with key '"+i+"'",q);for(var r,s=[],t=0;t<localStorage.length;t++)if(r=localStorage.key(t),0===r.indexOf(k+p)&&r.indexOf(l)<0){var u=r.substr((k+p).length),v=c(u),w=e(v);w=w?parseInt(w,m):o,s.push({key:u,size:(e(u)||"").length,expiration:w})}s.sort(function(a,b){return b.expiration-a.expiration});for(var x=(j||"").length;s.length&&x>0;)r=s.pop(),h("Cache is full, removing item with key '"+i+"'"),g(r.key),g(c(r.key)),x-=r.size;try{f(i,j)}catch(q){return void h("Could not add item with key '"+i+"', perhaps it's too big?",q)}}n?f(c(i),(d()+n).toString(m)):g(c(i))}},get:function(f){if(!a())return null;var h=c(f),i=e(h);if(i){var j=parseInt(i,m);if(d()>=j)return g(f),g(h),null}var k=e(f);if(!k||!b())return k;try{return JSON.parse(k)}catch(l){return k}},remove:function(b){return a()?(g(b),void g(c(b))):null},supported:function(){return a()},flush:function(){if(a())for(var b=localStorage.length-1;b>=0;--b){var c=localStorage.key(b);0===c.indexOf(k+p)&&localStorage.removeItem(c)}},setBucket:function(a){p=a},resetBucket:function(){p=""},enableWarnings:function(a){q=a}};return r})},{}],9:[function(a,b,c){(function(a){(function(){function a(a){this.tokens=[],this.tokens.links={},this.options=a||l.defaults,this.rules=m.normal,this.options.gfm&&(this.rules=this.options.tables?m.tables:m.gfm)}function d(a,b){if(this.options=b||l.defaults,this.links=a,this.rules=n.normal,this.renderer=this.options.renderer||new e,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?n.breaks:n.gfm:this.options.pedantic&&(this.rules=n.pedantic)}function e(a){this.options=a||{}}function f(a){this.tokens=[],this.token=null,this.options=a||l.defaults,this.options.renderer=this.options.renderer||new e,this.renderer=this.options.renderer,this.renderer.options=this.options}function g(a,b){return a.replace(b?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(a){return a.replace(/&([#\w]+);/g,function(a,b){return b=b.toLowerCase(),"colon"===b?":":"#"===b.charAt(0)?String.fromCharCode("x"===b.charAt(1)?parseInt(b.substring(2),16):+b.substring(1)):""})}function i(a,b){return a=a.source,b=b||"",function c(d,e){return d?(e=e.source||e,e=e.replace(/(^|[^\[])\^/g,"$1"),a=a.replace(d,e),c):new RegExp(a,b)}}function j(){}function k(a){for(var b,c,d=1;d<arguments.length;d++){b=arguments[d];for(c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}return a}function l(b,c,d){if(d||"function"==typeof c){d||(d=c,c=null),c=k({},l.defaults,c||{});var e,h,i=c.highlight,j=0;try{e=a.lex(b,c)}catch(m){return d(m)}h=e.length;var n=function(){var a,b;try{a=f.parse(e,c)}catch(g){b=g}return c.highlight=i,b?d(b):d(null,a)};if(!i||i.length<3)return n();if(delete c.highlight,!h)return n();for(;j<e.length;j++)!function(a){return"code"!==a.type?--h||n():i(a.text,a.lang,function(b,c){return null==c||c===a.text?--h||n():(a.text=c,a.escaped=!0,void(--h||n()))})}(e[j])}else try{return c&&(c=k({},l.defaults,c)),f.parse(a.lex(b,c),c)}catch(m){if(m.message+="\nPlease report this to https://github.com/chjj/marked.",(c||l.defaults).silent)return"<p>An error occured:</p><pre>"+g(m.message+"",!0)+"</pre>";throw m}}var m={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:j,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:j,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:j,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};m.bullet=/(?:[*+-]|\d+\.)/,m.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,m.item=i(m.item,"gm")(/bull/g,m.bullet)(),m.list=i(m.list)(/bull/g,m.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+m.def.source+")")(),m.blockquote=i(m.blockquote)("def",m.def)(),m._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",m.html=i(m.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,m._tag)(),m.paragraph=i(m.paragraph)("hr",m.hr)("heading",m.heading)("lheading",m.lheading)("blockquote",m.blockquote)("tag","<"+m._tag)("def",m.def)(),m.normal=k({},m),m.gfm=k({},m.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/}),m.gfm.paragraph=i(m.paragraph)("(?!","(?!"+m.gfm.fences.source.replace("\\1","\\2")+"|"+m.list.source.replace("\\1","\\3")+"|")(),m.tables=k({},m.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),a.rules=m,a.lex=function(b,c){var d=new a(c);return d.lex(b)},a.prototype.lex=function(a){return a=a.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(a,!0)},a.prototype.token=function(a,b,c){for(var d,e,f,g,h,i,j,k,l,a=a.replace(/^ +$/gm,"");a;)if((f=this.rules.newline.exec(a))&&(a=a.substring(f[0].length),f[0].length>1&&this.tokens.push({type:"space"})),f=this.rules.code.exec(a))a=a.substring(f[0].length),f=f[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?f:f.replace(/\n+$/,"")});else if(f=this.rules.fences.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"code",lang:f[2],text:f[3]});else if(f=this.rules.heading.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"heading",depth:f[1].length,text:f[2]});else if(b&&(f=this.rules.nptable.exec(a))){for(a=a.substring(f[0].length),i={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/\n$/,"").split("\n")},k=0;k<i.align.length;k++)i.align[k]=/^ *-+: *$/.test(i.align[k])?"right":/^ *:-+: *$/.test(i.align[k])?"center":/^ *:-+ *$/.test(i.align[k])?"left":null;for(k=0;k<i.cells.length;k++)i.cells[k]=i.cells[k].split(/ *\| */);this.tokens.push(i)}else if(f=this.rules.lheading.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"heading",depth:"="===f[2]?1:2,text:f[1]});else if(f=this.rules.hr.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"hr"});else if(f=this.rules.blockquote.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"blockquote_start"}),f=f[0].replace(/^ *> ?/gm,""),this.token(f,b,!0),this.tokens.push({type:"blockquote_end"});else if(f=this.rules.list.exec(a)){for(a=a.substring(f[0].length),g=f[2],this.tokens.push({type:"list_start",ordered:g.length>1}),f=f[0].match(this.rules.item),d=!1,l=f.length,k=0;l>k;k++)i=f[k],j=i.length,i=i.replace(/^ *([*+-]|\d+\.) +/,""),~i.indexOf("\n ")&&(j-=i.length,i=this.options.pedantic?i.replace(/^ {1,4}/gm,""):i.replace(new RegExp("^ {1,"+j+"}","gm"),"")),this.options.smartLists&&k!==l-1&&(h=m.bullet.exec(f[k+1])[0],g===h||g.length>1&&h.length>1||(a=f.slice(k+1).join("\n")+a,k=l-1)),e=d||/\n\n(?!\s*$)/.test(i),k!==l-1&&(d="\n"===i.charAt(i.length-1),e||(e=d)),this.tokens.push({type:e?"loose_item_start":"list_item_start"}),this.token(i,!1,c),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(f=this.rules.html.exec(a))a=a.substring(f[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===f[1]||"script"===f[1]||"style"===f[1],text:f[0]});else if(!c&&b&&(f=this.rules.def.exec(a)))a=a.substring(f[0].length),this.tokens.links[f[1].toLowerCase()]={href:f[2],title:f[3]};else if(b&&(f=this.rules.table.exec(a))){for(a=a.substring(f[0].length),i={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/(?: *\| *)?\n$/,"").split("\n")},k=0;k<i.align.length;k++)i.align[k]=/^ *-+: *$/.test(i.align[k])?"right":/^ *:-+: *$/.test(i.align[k])?"center":/^ *:-+ *$/.test(i.align[k])?"left":null;for(k=0;k<i.cells.length;k++)i.cells[k]=i.cells[k].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(i)}else if(b&&(f=this.rules.paragraph.exec(a)))a=a.substring(f[0].length),this.tokens.push({type:"paragraph",text:"\n"===f[1].charAt(f[1].length-1)?f[1].slice(0,-1):f[1]});else if(f=this.rules.text.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"text",text:f[0]});else if(a)throw new Error("Infinite loop on byte: "+a.charCodeAt(0));return this.tokens};var n={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:j,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:j,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};n._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,n._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,n.link=i(n.link)("inside",n._inside)("href",n._href)(),n.reflink=i(n.reflink)("inside",n._inside)(),n.normal=k({},n),n.pedantic=k({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),n.gfm=k({},n.normal,{escape:i(n.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:i(n.text)("]|","~]|")("|","|https?://|")()}),n.breaks=k({},n.gfm,{br:i(n.br)("{2,}","*")(),text:i(n.gfm.text)("{2,}","*")()}),d.rules=n,d.output=function(a,b,c){var e=new d(b,c);return e.output(a)},d.prototype.output=function(a){for(var b,c,d,e,f="";a;)if(e=this.rules.escape.exec(a))a=a.substring(e[0].length),f+=e[1];else if(e=this.rules.autolink.exec(a))a=a.substring(e[0].length),"@"===e[2]?(c=this.mangle(":"===e[1].charAt(6)?e[1].substring(7):e[1]),d=this.mangle("mailto:")+c):(c=g(e[1]),d=c),f+=this.renderer.link(d,null,c);else if(this.inLink||!(e=this.rules.url.exec(a))){if(e=this.rules.tag.exec(a))!this.inLink&&/^<a /i.test(e[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(e[0])&&(this.inLink=!1),a=a.substring(e[0].length),f+=this.options.sanitize?g(e[0]):e[0];else if(e=this.rules.link.exec(a))a=a.substring(e[0].length),this.inLink=!0,f+=this.outputLink(e,{href:e[2],title:e[3]}),this.inLink=!1;else if((e=this.rules.reflink.exec(a))||(e=this.rules.nolink.exec(a))){if(a=a.substring(e[0].length),b=(e[2]||e[1]).replace(/\s+/g," "),b=this.links[b.toLowerCase()],!b||!b.href){f+=e[0].charAt(0),a=e[0].substring(1)+a;continue}this.inLink=!0,f+=this.outputLink(e,b),this.inLink=!1}else if(e=this.rules.strong.exec(a))a=a.substring(e[0].length),f+=this.renderer.strong(this.output(e[2]||e[1]));else if(e=this.rules.em.exec(a))a=a.substring(e[0].length),f+=this.renderer.em(this.output(e[2]||e[1]));else if(e=this.rules.code.exec(a))a=a.substring(e[0].length),f+=this.renderer.codespan(g(e[2],!0));else if(e=this.rules.br.exec(a))a=a.substring(e[0].length),f+=this.renderer.br();else if(e=this.rules.del.exec(a))a=a.substring(e[0].length),f+=this.renderer.del(this.output(e[1]));else if(e=this.rules.text.exec(a))a=a.substring(e[0].length),f+=g(this.smartypants(e[0]));else if(a)throw new Error("Infinite loop on byte: "+a.charCodeAt(0))}else a=a.substring(e[0].length),c=g(e[1]),d=c,f+=this.renderer.link(d,null,c);return f},d.prototype.outputLink=function(a,b){var c=g(b.href),d=b.title?g(b.title):null;return"!"!==a[0].charAt(0)?this.renderer.link(c,d,this.output(a[1])):this.renderer.image(c,d,g(a[1]))},d.prototype.smartypants=function(a){return this.options.smartypants?a.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):a},d.prototype.mangle=function(a){for(var b,c="",d=a.length,e=0;d>e;e++)b=a.charCodeAt(e),Math.random()>.5&&(b="x"+b.toString(16)),c+="&#"+b+";";return c},e.prototype.code=function(a,b,c){if(this.options.highlight){var d=this.options.highlight(a,b);null!=d&&d!==a&&(c=!0,a=d)}return b?'<pre><code class="'+this.options.langPrefix+g(b,!0)+'">'+(c?a:g(a,!0))+"\n</code></pre>\n":"<pre><code>"+(c?a:g(a,!0))+"\n</code></pre>"},e.prototype.blockquote=function(a){return"<blockquote>\n"+a+"</blockquote>\n"},e.prototype.html=function(a){return a},e.prototype.heading=function(a,b,c){return"<h"+b+' id="'+this.options.headerPrefix+c.toLowerCase().replace(/[^\w]+/g,"-")+'">'+a+"</h"+b+">\n"},e.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},e.prototype.list=function(a,b){var c=b?"ol":"ul";return"<"+c+">\n"+a+"</"+c+">\n"},e.prototype.listitem=function(a){return"<li>"+a+"</li>\n"},e.prototype.paragraph=function(a){return"<p>"+a+"</p>\n"},e.prototype.table=function(a,b){return"<table>\n<thead>\n"+a+"</thead>\n<tbody>\n"+b+"</tbody>\n</table>\n"},e.prototype.tablerow=function(a){return"<tr>\n"+a+"</tr>\n"},e.prototype.tablecell=function(a,b){var c=b.header?"th":"td",d=b.align?"<"+c+' style="text-align:'+b.align+'">':"<"+c+">";return d+a+"</"+c+">\n"},e.prototype.strong=function(a){return"<strong>"+a+"</strong>"},e.prototype.em=function(a){return"<em>"+a+"</em>"},e.prototype.codespan=function(a){return"<code>"+a+"</code>"},e.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},e.prototype.del=function(a){return"<del>"+a+"</del>"},e.prototype.link=function(a,b,c){if(this.options.sanitize){try{var d=decodeURIComponent(h(a)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===d.indexOf("javascript:"))return""}var f='<a href="'+a+'"';return b&&(f+=' title="'+b+'"'),f+=">"+c+"</a>"},e.prototype.image=function(a,b,c){var d='<img src="'+a+'" alt="'+c+'"';return b&&(d+=' title="'+b+'"'),d+=this.options.xhtml?"/>":">"},f.parse=function(a,b,c){var d=new f(b,c);return d.parse(a)},f.prototype.parse=function(a){this.inline=new d(a.links,this.options,this.renderer),this.tokens=a.reverse();for(var b="";this.next();)b+=this.tok();return b},f.prototype.next=function(){return this.token=this.tokens.pop()},f.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},f.prototype.parseText=function(){for(var a=this.token.text;"text"===this.peek().type;)a+="\n"+this.next().text;return this.inline.output(a)},f.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var a,b,c,d,e,f="",g="";for(c="",a=0;a<this.token.header.length;a++)d={header:!0,align:this.token.align[a]},c+=this.renderer.tablecell(this.inline.output(this.token.header[a]),{header:!0,align:this.token.align[a]});for(f+=this.renderer.tablerow(c),a=0;a<this.token.cells.length;a++){for(b=this.token.cells[a],c="",e=0;e<b.length;e++)c+=this.renderer.tablecell(this.inline.output(b[e]),{header:!1,align:this.token.align[e]});g+=this.renderer.tablerow(c)}return this.renderer.table(f,g);case"blockquote_start":for(var g="";"blockquote_end"!==this.next().type;)g+=this.tok();return this.renderer.blockquote(g);case"list_start":for(var g="",h=this.token.ordered;"list_end"!==this.next().type;)g+=this.tok();return this.renderer.list(g,h);case"list_item_start":for(var g="";"list_item_end"!==this.next().type;)g+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(g);case"loose_item_start":for(var g="";"list_item_end"!==this.next().type;)g+=this.tok();return this.renderer.listitem(g);case"html":var i=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(i);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},j.exec=j,l.options=l.setOptions=function(a){return k(l.defaults,a),l},l.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new e,xhtml:!1},l.Parser=f,l.parser=f.parse,l.Renderer=e,l.Lexer=a,l.lexer=a.lex,l.InlineLexer=d,l.inlineLexer=d.output,l.parse=l,"object"==typeof c?b.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):this.marked=l}).call(function(){return this||("undefined"!=typeof window?window:a)}())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],10:[function(a,b){(function(c){(function(d){function e(a,b,c){switch(arguments.length){case 2:return null!=a?a:b;case 3:return null!=a?a:null!=b?b:c;default:throw new Error("Implement me")}}function f(a,b){return Cb.call(a,b)}function g(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function h(a){wb.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+a)}function i(a,b){var c=!0;return p(function(){return c&&(h(a),c=!1),b.apply(this,arguments)},b)}function j(a,b){tc[a]||(h(b),tc[a]=!0)}function k(a,b){return function(c){return s(a.call(this,c),b)}}function l(a,b){return function(c){return this.localeData().ordinal(a.call(this,c),b)}}function m(){}function n(a,b){b!==!1&&I(a),q(this,a),this._d=new Date(+a._d)}function o(a){var b=B(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=wb.localeData(),this._bubble()
|
||
}function p(a,b){for(var c in b)f(b,c)&&(a[c]=b[c]);return f(b,"toString")&&(a.toString=b.toString),f(b,"valueOf")&&(a.valueOf=b.valueOf),a}function q(a,b){var c,d,e;if("undefined"!=typeof b._isAMomentObject&&(a._isAMomentObject=b._isAMomentObject),"undefined"!=typeof b._i&&(a._i=b._i),"undefined"!=typeof b._f&&(a._f=b._f),"undefined"!=typeof b._l&&(a._l=b._l),"undefined"!=typeof b._strict&&(a._strict=b._strict),"undefined"!=typeof b._tzm&&(a._tzm=b._tzm),"undefined"!=typeof b._isUTC&&(a._isUTC=b._isUTC),"undefined"!=typeof b._offset&&(a._offset=b._offset),"undefined"!=typeof b._pf&&(a._pf=b._pf),"undefined"!=typeof b._locale&&(a._locale=b._locale),Lb.length>0)for(c in Lb)d=Lb[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function r(a){return 0>a?Math.ceil(a):Math.floor(a)}function s(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.length<b;)d="0"+d;return(e?c?"+":"":"-")+d}function t(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function u(a,b){var c;return b=N(b,a),a.isBefore(b)?c=t(a,b):(c=t(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function v(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(j(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=wb.duration(c,d),w(this,e,a),this}}function w(a,b,c,d){var e=b._milliseconds,f=b._days,g=b._months;d=null==d?!0:d,e&&a._d.setTime(+a._d+e*c),f&&qb(a,"Date",pb(a,"Date")+f*c),g&&ob(a,pb(a,"Month")+g*c),d&&wb.updateOffset(a,f||g)}function x(a){return"[object Array]"===Object.prototype.toString.call(a)}function y(a){return"[object Date]"===Object.prototype.toString.call(a)||a instanceof Date}function z(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&D(a[d])!==D(b[d]))&&g++;return g+f}function A(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=mc[a]||nc[b]||b}return a}function B(a){var b,c,d={};for(c in a)f(a,c)&&(b=A(c),b&&(d[b]=a[c]));return d}function C(a){var b,c;if(0===a.indexOf("week"))b=7,c="day";else{if(0!==a.indexOf("month"))return;b=12,c="month"}wb[a]=function(e,f){var g,h,i=wb._locale[a],j=[];if("number"==typeof e&&(f=e,e=d),h=function(a){var b=wb().utc().set(c,a);return i.call(wb._locale,b,e||"")},null!=f)return h(f);for(g=0;b>g;g++)j.push(h(g));return j}}function D(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function E(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function F(a,b,c){return kb(wb([a,11,31+b-c]),b,c).week}function G(a){return H(a)?366:365}function H(a){return a%4===0&&a%100!==0||a%400===0}function I(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[Eb]<0||a._a[Eb]>11?Eb:a._a[Fb]<1||a._a[Fb]>E(a._a[Db],a._a[Eb])?Fb:a._a[Gb]<0||a._a[Gb]>23?Gb:a._a[Hb]<0||a._a[Hb]>59?Hb:a._a[Ib]<0||a._a[Ib]>59?Ib:a._a[Jb]<0||a._a[Jb]>999?Jb:-1,a._pf._overflowDayOfYear&&(Db>b||b>Fb)&&(b=Fb),a._pf.overflow=b)}function J(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&a._pf.overflow<0&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function K(a){return a?a.toLowerCase().replace("_","-"):a}function L(a){for(var b,c,d,e,f=0;f<a.length;){for(e=K(a[f]).split("-"),b=e.length,c=K(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=M(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&z(e,c,!0)>=b-1)break;b--}f++}return null}function M(b){var c=null;if(!Kb[b]&&Mb)try{c=wb.locale(),a("./locale/"+b),wb.locale(c)}catch(d){}return Kb[b]}function N(a,b){return b._isUTC?wb(a).zone(b._offset||0):wb(a).local()}function O(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function P(a){var b,c,d=a.match(Qb);for(b=0,c=d.length;c>b;b++)d[b]=sc[d[b]]?sc[d[b]]:O(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function Q(a,b){return a.isValid()?(b=R(b,a.localeData()),oc[b]||(oc[b]=P(b)),oc[b](a)):a.localeData().invalidDate()}function R(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Rb.lastIndex=0;d>=0&&Rb.test(a);)a=a.replace(Rb,c),Rb.lastIndex=0,d-=1;return a}function S(a,b){var c,d=b._strict;switch(a){case"Q":return ac;case"DDDD":return cc;case"YYYY":case"GGGG":case"gggg":return d?dc:Ub;case"Y":case"G":case"g":return fc;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?ec:Vb;case"S":if(d)return ac;case"SS":if(d)return bc;case"SSS":if(d)return cc;case"DDD":return Tb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Xb;case"a":case"A":return b._locale._meridiemParse;case"X":return $b;case"Z":case"ZZ":return Yb;case"T":return Zb;case"SSSS":return Wb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?bc:Sb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Sb;case"Do":return _b;default:return c=new RegExp(_($(a.replace("\\","")),"i"))}}function T(a){a=a||"";var b=a.match(Yb)||[],c=b[b.length-1]||[],d=(c+"").match(kc)||["-",0,0],e=+(60*d[1])+D(d[2]);return"+"===d[0]?-e:e}function U(a,b,c){var d,e=c._a;switch(a){case"Q":null!=b&&(e[Eb]=3*(D(b)-1));break;case"M":case"MM":null!=b&&(e[Eb]=D(b)-1);break;case"MMM":case"MMMM":d=c._locale.monthsParse(b),null!=d?e[Eb]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[Fb]=D(b));break;case"Do":null!=b&&(e[Fb]=D(parseInt(b,10)));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=D(b));break;case"YY":e[Db]=wb.parseTwoDigitYear(b);break;case"YYYY":case"YYYYY":case"YYYYYY":e[Db]=D(b);break;case"a":case"A":c._isPm=c._locale.isPM(b);break;case"H":case"HH":case"h":case"hh":e[Gb]=D(b);break;case"m":case"mm":e[Hb]=D(b);break;case"s":case"ss":e[Ib]=D(b);break;case"S":case"SS":case"SSS":case"SSSS":e[Jb]=D(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=T(b);break;case"dd":case"ddd":case"dddd":d=c._locale.weekdaysParse(b),null!=d?(c._w=c._w||{},c._w.d=d):c._pf.invalidWeekday=b;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":a=a.substr(0,1);case"gggg":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=D(b));break;case"gg":case"GG":c._w=c._w||{},c._w[a]=wb.parseTwoDigitYear(b)}}function V(a){var b,c,d,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(g=1,h=4,c=e(b.GG,a._a[Db],kb(wb(),1,4).year),d=e(b.W,1),f=e(b.E,1)):(g=a._locale._week.dow,h=a._locale._week.doy,c=e(b.gg,a._a[Db],kb(wb(),g,h).year),d=e(b.w,1),null!=b.d?(f=b.d,g>f&&++d):f=null!=b.e?b.e+g:g),i=lb(c,d,f,h,g),a._a[Db]=i.year,a._dayOfYear=i.dayOfYear}function W(a){var b,c,d,f,g=[];if(!a._d){for(d=Y(a),a._w&&null==a._a[Fb]&&null==a._a[Eb]&&V(a),a._dayOfYear&&(f=e(a._a[Db],d[Db]),a._dayOfYear>G(f)&&(a._pf._overflowDayOfYear=!0),c=gb(f,0,a._dayOfYear),a._a[Eb]=c.getUTCMonth(),a._a[Fb]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=g[b]=d[b];for(;7>b;b++)a._a[b]=g[b]=null==a._a[b]?2===b?1:0:a._a[b];a._d=(a._useUTC?gb:fb).apply(null,g),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()+a._tzm)}}function X(a){var b;a._d||(b=B(a._i),a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond],W(a))}function Y(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function Z(a){if(a._f===wb.ISO_8601)return void bb(a);a._a=[],a._pf.empty=!0;var b,c,d,e,f,g=""+a._i,h=g.length,i=0;for(d=R(a._f,a._locale).match(Qb)||[],b=0;b<d.length;b++)e=d[b],c=(g.match(S(e,a))||[])[0],c&&(f=g.substr(0,g.indexOf(c)),f.length>0&&a._pf.unusedInput.push(f),g=g.slice(g.indexOf(c)+c.length),i+=c.length),sc[e]?(c?a._pf.empty=!1:a._pf.unusedTokens.push(e),U(e,c,a)):a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=h-i,g.length>0&&a._pf.unusedInput.push(g),a._isPm&&a._a[Gb]<12&&(a._a[Gb]+=12),a._isPm===!1&&12===a._a[Gb]&&(a._a[Gb]=0),W(a),I(a)}function $(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function _(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ab(a){var b,c,d,e,f;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(e=0;e<a._f.length;e++)f=0,b=q({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._pf=g(),b._f=a._f[e],Z(b),J(b)&&(f+=b._pf.charsLeftOver,f+=10*b._pf.unusedTokens.length,b._pf.score=f,(null==d||d>f)&&(d=f,c=b));p(a,c||b)}function bb(a){var b,c,d=a._i,e=gc.exec(d);if(e){for(a._pf.iso=!0,b=0,c=ic.length;c>b;b++)if(ic[b][1].exec(d)){a._f=ic[b][0]+(e[6]||" ");break}for(b=0,c=jc.length;c>b;b++)if(jc[b][1].exec(d)){a._f+=jc[b][0];break}d.match(Yb)&&(a._f+="Z"),Z(a)}else a._isValid=!1}function cb(a){bb(a),a._isValid===!1&&(delete a._isValid,wb.createFromInputFallback(a))}function db(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function eb(a){var b,c=a._i;c===d?a._d=new Date:y(c)?a._d=new Date(+c):null!==(b=Nb.exec(c))?a._d=new Date(+b[1]):"string"==typeof c?cb(a):x(c)?(a._a=db(c.slice(0),function(a){return parseInt(a,10)}),W(a)):"object"==typeof c?X(a):"number"==typeof c?a._d=new Date(c):wb.createFromInputFallback(a)}function fb(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function gb(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function hb(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function ib(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function jb(a,b,c){var d=wb.duration(a).abs(),e=Bb(d.as("s")),f=Bb(d.as("m")),g=Bb(d.as("h")),h=Bb(d.as("d")),i=Bb(d.as("M")),j=Bb(d.as("y")),k=e<pc.s&&["s",e]||1===f&&["m"]||f<pc.m&&["mm",f]||1===g&&["h"]||g<pc.h&&["hh",g]||1===h&&["d"]||h<pc.d&&["dd",h]||1===i&&["M"]||i<pc.M&&["MM",i]||1===j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,ib.apply({},k)}function kb(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=wb(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function lb(a,b,c,d,e){var f,g,h=gb(a,0,1).getUTCDay();return h=0===h?7:h,c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:G(a-1)+g}}function mb(a){var b=a._i,c=a._f;return a._locale=a._locale||wb.localeData(a._l),null===b||c===d&&""===b?wb.invalid({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),wb.isMoment(b)?new n(b,!0):(c?x(c)?ab(a):Z(a):eb(a),new n(a)))}function nb(a,b){var c,d;if(1===b.length&&x(b[0])&&(b=b[0]),!b.length)return wb();for(c=b[0],d=1;d<b.length;++d)b[d][a](c)&&(c=b[d]);return c}function ob(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),E(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function pb(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function qb(a,b,c){return"Month"===b?ob(a,c):a._d["set"+(a._isUTC?"UTC":"")+b](c)}function rb(a,b){return function(c){return null!=c?(qb(this,a,c),wb.updateOffset(this,b),this):pb(this,a)}}function sb(a){return 400*a/146097}function tb(a){return 146097*a/400}function ub(a){wb.duration.fn[a]=function(){return this._data[a]}}function vb(a){"undefined"==typeof ender&&(xb=Ab.moment,Ab.moment=a?i("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",wb):wb)}for(var wb,xb,yb,zb="2.8.3",Ab="undefined"!=typeof c?c:this,Bb=Math.round,Cb=Object.prototype.hasOwnProperty,Db=0,Eb=1,Fb=2,Gb=3,Hb=4,Ib=5,Jb=6,Kb={},Lb=[],Mb="undefined"!=typeof b&&b.exports,Nb=/^\/?Date\((\-?\d+)/i,Ob=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Pb=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Qb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,Rb=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,Sb=/\d\d?/,Tb=/\d{1,3}/,Ub=/\d{1,4}/,Vb=/[+\-]?\d{1,6}/,Wb=/\d+/,Xb=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Yb=/Z|[\+\-]\d\d:?\d\d/gi,Zb=/T/i,$b=/[\+\-]?\d+(\.\d{1,3})?/,_b=/\d{1,2}/,ac=/\d/,bc=/\d\d/,cc=/\d{3}/,dc=/\d{4}/,ec=/[+-]?\d{6}/,fc=/[+-]?\d+/,gc=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,hc="YYYY-MM-DDTHH:mm:ssZ",ic=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],jc=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],kc=/([\+\-]|\d\d)/gi,lc=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),mc={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},nc={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},oc={},pc={s:45,m:45,h:22,d:26,M:11},qc="DDD w W M D d".split(" "),rc="M D H h m s w W".split(" "),sc={M:function(){return this.month()+1},MMM:function(a){return this.localeData().monthsShort(this,a)},MMMM:function(a){return this.localeData().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.localeData().weekdaysMin(this,a)},ddd:function(a){return this.localeData().weekdaysShort(this,a)},dddd:function(a){return this.localeData().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return s(this.year()%100,2)},YYYY:function(){return s(this.year(),4)},YYYYY:function(){return s(this.year(),5)},YYYYYY:function(){var a=this.year(),b=a>=0?"+":"-";return b+s(Math.abs(a),6)},gg:function(){return s(this.weekYear()%100,2)},gggg:function(){return s(this.weekYear(),4)},ggggg:function(){return s(this.weekYear(),5)},GG:function(){return s(this.isoWeekYear()%100,2)},GGGG:function(){return s(this.isoWeekYear(),4)},GGGGG:function(){return s(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return D(this.milliseconds()/100)},SS:function(){return s(D(this.milliseconds()/10),2)},SSS:function(){return s(this.milliseconds(),3)},SSSS:function(){return s(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+s(D(a/60),2)+":"+s(D(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+s(D(a/60),2)+s(D(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},tc={},uc=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];qc.length;)yb=qc.pop(),sc[yb+"o"]=l(sc[yb],yb);for(;rc.length;)yb=rc.pop(),sc[yb+yb]=k(sc[yb],2);sc.DDDD=k(sc.DDD,3),p(m.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=wb.utc([2e3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=wb([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return kb(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),wb=function(a,b,c,e){var f;return"boolean"==typeof c&&(e=c,c=d),f={},f._isAMomentObject=!0,f._i=a,f._f=b,f._l=c,f._strict=e,f._isUTC=!1,f._pf=g(),mb(f)},wb.suppressDeprecationWarnings=!1,wb.createFromInputFallback=i("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i)}),wb.min=function(){var a=[].slice.call(arguments,0);return nb("isBefore",a)},wb.max=function(){var a=[].slice.call(arguments,0);return nb("isAfter",a)},wb.utc=function(a,b,c,e){var f;return"boolean"==typeof c&&(e=c,c=d),f={},f._isAMomentObject=!0,f._useUTC=!0,f._isUTC=!0,f._l=c,f._i=a,f._f=b,f._strict=e,f._pf=g(),mb(f).utc()},wb.unix=function(a){return wb(1e3*a)},wb.duration=function(a,b){var c,d,e,g,h=a,i=null;return wb.isDuration(a)?h={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(h={},b?h[b]=a:h.milliseconds=a):(i=Ob.exec(a))?(c="-"===i[1]?-1:1,h={y:0,d:D(i[Fb])*c,h:D(i[Gb])*c,m:D(i[Hb])*c,s:D(i[Ib])*c,ms:D(i[Jb])*c}):(i=Pb.exec(a))?(c="-"===i[1]?-1:1,e=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*c},h={y:e(i[2]),M:e(i[3]),d:e(i[4]),h:e(i[5]),m:e(i[6]),s:e(i[7]),w:e(i[8])}):"object"==typeof h&&("from"in h||"to"in h)&&(g=u(wb(h.from),wb(h.to)),h={},h.ms=g.milliseconds,h.M=g.months),d=new o(h),wb.isDuration(a)&&f(a,"_locale")&&(d._locale=a._locale),d},wb.version=zb,wb.defaultFormat=hc,wb.ISO_8601=function(){},wb.momentProperties=Lb,wb.updateOffset=function(){},wb.relativeTimeThreshold=function(a,b){return pc[a]===d?!1:b===d?pc[a]:(pc[a]=b,!0)},wb.lang=i("moment.lang is deprecated. Use moment.locale instead.",function(a,b){return wb.locale(a,b)}),wb.locale=function(a,b){var c;return a&&(c="undefined"!=typeof b?wb.defineLocale(a,b):wb.localeData(a),c&&(wb.duration._locale=wb._locale=c)),wb._locale._abbr},wb.defineLocale=function(a,b){return null!==b?(b.abbr=a,Kb[a]||(Kb[a]=new m),Kb[a].set(b),wb.locale(a),Kb[a]):(delete Kb[a],null)},wb.langData=i("moment.langData is deprecated. Use moment.localeData instead.",function(a){return wb.localeData(a)}),wb.localeData=function(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return wb._locale;if(!x(a)){if(b=M(a))return b;a=[a]}return L(a)},wb.isMoment=function(a){return a instanceof n||null!=a&&f(a,"_isAMomentObject")},wb.isDuration=function(a){return a instanceof o};for(yb=uc.length-1;yb>=0;--yb)C(uc[yb]);wb.normalizeUnits=function(a){return A(a)},wb.invalid=function(a){var b=wb.utc(0/0);return null!=a?p(b._pf,a):b._pf.userInvalidated=!0,b},wb.parseZone=function(){return wb.apply(null,arguments).parseZone()},wb.parseTwoDigitYear=function(a){return D(a)+(D(a)>68?1900:2e3)},p(wb.fn=n.prototype,{clone:function(){return wb(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=wb(this).utc();return 0<a.year()&&a.year()<=9999?Q(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):Q(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds()]},isValid:function(){return J(this)},isDSTShifted:function(){return this._a?this.isValid()&&z(this._a,(this._isUTC?wb.utc(this._a):wb(this._a)).toArray())>0:!1},parsingFlags:function(){return p({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(a){return this.zone(0,a)},local:function(a){return this._isUTC&&(this.zone(0,a),this._isUTC=!1,a&&this.add(this._dateTzOffset(),"m")),this},format:function(a){var b=Q(this,a||wb.defaultFormat);return this.localeData().postformat(b)},add:v(1,"add"),subtract:v(-1,"subtract"),diff:function(a,b,c){var d,e,f,g=N(a,this),h=6e4*(this.zone()-g.zone());return b=A(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+g.daysInMonth()),e=12*(this.year()-g.year())+(this.month()-g.month()),f=this-wb(this).startOf("month")-(g-wb(g).startOf("month")),f-=6e4*(this.zone()-wb(this).startOf("month").zone()-(g.zone()-wb(g).startOf("month").zone())),e+=f/d,"year"===b&&(e/=12)):(d=this-g,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-h)/864e5:"week"===b?(d-h)/6048e5:d),c?e:r(e)},from:function(a,b){return wb.duration({to:this,from:a}).locale(this.locale()).humanize(!b)},fromNow:function(a){return this.from(wb(),a)},calendar:function(a){var b=a||wb(),c=N(b,this).startOf("day"),d=this.diff(c,"days",!0),e=-6>d?"sameElse":-1>d?"lastWeek":0>d?"lastDay":1>d?"sameDay":2>d?"nextDay":7>d?"nextWeek":"sameElse";return this.format(this.localeData().calendar(e,this))},isLeapYear:function(){return H(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=hb(a,this.localeData()),this.add(a-b,"d")):b},month:rb("Month",!0),startOf:function(a){switch(a=A(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(a){return a=A(a),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms")},isAfter:function(a,b){return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=wb.isMoment(a)?a:wb(a),+this>+a):+this.clone().startOf(b)>+wb(a).startOf(b)},isBefore:function(a,b){return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=wb.isMoment(a)?a:wb(a),+a>+this):+this.clone().startOf(b)<+wb(a).startOf(b)},isSame:function(a,b){return b=A(b||"millisecond"),"millisecond"===b?(a=wb.isMoment(a)?a:wb(a),+this===+a):+this.clone().startOf(b)===+N(a,this).startOf(b)},min:i("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(a){return a=wb.apply(null,arguments),this>a?this:a}),max:i("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(a){return a=wb.apply(null,arguments),a>this?this:a}),zone:function(a,b){var c,d=this._offset||0;return null==a?this._isUTC?d:this._dateTzOffset():("string"==typeof a&&(a=T(a)),Math.abs(a)<16&&(a=60*a),!this._isUTC&&b&&(c=this._dateTzOffset()),this._offset=a,this._isUTC=!0,null!=c&&this.subtract(c,"m"),d!==a&&(!b||this._changeInProgress?w(this,wb.duration(d-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,wb.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?wb(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return E(this.year(),this.month())},dayOfYear:function(a){var b=Bb((wb(this).startOf("day")-wb(this).startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")},quarter:function(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)},weekYear:function(a){var b=kb(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")},isoWeekYear:function(a){var b=kb(this,1,4).year;return null==a?b:this.add(a-b,"y")},week:function(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")},isoWeek:function(a){var b=kb(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")},weekday:function(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return F(this.year(),1,4)},weeksInYear:function(){var a=this.localeData()._week;return F(this.year(),a.dow,a.doy)},get:function(a){return a=A(a),this[a]()},set:function(a,b){return a=A(a),"function"==typeof this[a]&&this[a](b),this},locale:function(a){var b;return a===d?this._locale._abbr:(b=wb.localeData(a),null!=b&&(this._locale=b),this)},lang:i("moment().lang() is deprecated. Use moment().localeData() instead.",function(a){return a===d?this.localeData():this.locale(a)}),localeData:function(){return this._locale},_dateTzOffset:function(){return 15*Math.round(this._d.getTimezoneOffset()/15)}}),wb.fn.millisecond=wb.fn.milliseconds=rb("Milliseconds",!1),wb.fn.second=wb.fn.seconds=rb("Seconds",!1),wb.fn.minute=wb.fn.minutes=rb("Minutes",!1),wb.fn.hour=wb.fn.hours=rb("Hours",!0),wb.fn.date=rb("Date",!0),wb.fn.dates=i("dates accessor is deprecated. Use date instead.",rb("Date",!0)),wb.fn.year=rb("FullYear",!0),wb.fn.years=i("years accessor is deprecated. Use year instead.",rb("FullYear",!0)),wb.fn.days=wb.fn.day,wb.fn.months=wb.fn.month,wb.fn.weeks=wb.fn.week,wb.fn.isoWeeks=wb.fn.isoWeek,wb.fn.quarters=wb.fn.quarter,wb.fn.toJSON=wb.fn.toISOString,p(wb.duration.fn=o.prototype,{_bubble:function(){var a,b,c,d=this._milliseconds,e=this._days,f=this._months,g=this._data,h=0;g.milliseconds=d%1e3,a=r(d/1e3),g.seconds=a%60,b=r(a/60),g.minutes=b%60,c=r(b/60),g.hours=c%24,e+=r(c/24),h=r(sb(e)),e-=r(tb(h)),f+=r(e/30),e%=30,h+=r(f/12),f%=12,g.days=e,g.months=f,g.years=h},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return r(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*D(this._months/12)},humanize:function(a){var b=jb(this,!a,this.localeData());return a&&(b=this.localeData().pastFuture(+this,b)),this.localeData().postformat(b)},add:function(a,b){var c=wb.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=wb.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=A(a),this[a.toLowerCase()+"s"]()},as:function(a){var b,c;if(a=A(a),"month"===a||"year"===a)return b=this._days+this._milliseconds/864e5,c=this._months+12*sb(b),"month"===a?c:c/12;switch(b=this._days+tb(this._months/12),a){case"week":return b/7+this._milliseconds/6048e5;case"day":return b+this._milliseconds/864e5;case"hour":return 24*b+this._milliseconds/36e5;case"minute":return 24*b*60+this._milliseconds/6e4;case"second":return 24*b*60*60+this._milliseconds/1e3;case"millisecond":return Math.floor(24*b*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+a)}},lang:wb.fn.lang,locale:wb.fn.locale,toIsoString:i("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"},localeData:function(){return this._locale}}),wb.duration.fn.toString=wb.duration.fn.toISOString;for(yb in lc)f(lc,yb)&&ub(yb.toLowerCase());wb.duration.fn.asMilliseconds=function(){return this.as("ms")},wb.duration.fn.asSeconds=function(){return this.as("s")},wb.duration.fn.asMinutes=function(){return this.as("m")},wb.duration.fn.asHours=function(){return this.as("h")},wb.duration.fn.asDays=function(){return this.as("d")},wb.duration.fn.asWeeks=function(){return this.as("weeks")},wb.duration.fn.asMonths=function(){return this.as("M")},wb.duration.fn.asYears=function(){return this.as("y")},wb.locale("en",{ordinal:function(a){var b=a%10,c=1===D(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),Mb?b.exports=wb:"function"==typeof define&&define.amd?(define("moment",function(a,b,c){return c.config&&c.config()&&c.config().noGlobal===!0&&(Ab.moment=xb),wb}),vb(!0)):vb()}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(a,b,c){!function(d,e){"function"==typeof define&&define.amd?define(["ractive"],e):"object"==typeof c?b.exports=e(a("ractive")):e(d.Ractive)}(this,function(a){function b(b,c,d){return b instanceof a?d&&d._ractiveWraps&&d._ractiveWraps[c]?!1:!0:!1}function c(a,b){if(!g[a])try{return g[a]=!0,b()}finally{delete g[a]}}function d(a,b,d,g){function h(){n(),o(),a.set(g(k())),b.on("change",j),f.fireWrapEvents&&(b.fire("wrap",a,d),a.fire("wrapchild",b,d))}function i(){delete a._ractiveWraps[d],b.off("change",j),f.fireWrapEvents&&(b.fire("unwrap",a,d),a.fire("unwrapchild",b,d))}function j(f){e(f,function(e,f){c(b._guid+f,function(){a.set(d+"."+f,e)})})}function k(){if(!b.computed)return b.get();var a={};return e(b.get(),function(b,c){a[c]=b}),e(b.computed,function(c,d){"undefined"==typeof a[d]&&(a[d]=b.get(d))
|
||
}),a}function l(a,d){c(b._guid+a,function(){b.set(a,d)})}function m(a){return a&&a.constructor===Object?void b.set(a):!1}function n(){if(d&&d.length>f.maxKeyLength)throw new Error("Keypath too long (possible circular dependency)")}function o(){a._ractiveWraps||(a._ractiveWraps={}),a._ractiveWraps[d]=b}return h(),{get:k,set:l,reset:m,teardown:i}}function e(a,b){for(var c in a)a.hasOwnProperty(c)&&b(a[c],c)}var f=a.adaptors.Ractive={filter:b,wrap:d};f.fireWrapEvents=!0,f.maxKeyLength=2048;var g=f.locked={}})},{ractive:13}],12:[function(a,b){!function(c,d){"use strict";if("undefined"!=typeof b&&b.exports&&"function"==typeof a)d(a("ractive"));else if("function"==typeof define&&define.amd)define(["ractive"],d);else{if(!c.Ractive)throw new Error("Could not find Ractive! It must be loaded before the ractive-transitions-fade plugin");d(c.Ractive)}}("undefined"!=typeof window?window:this,function(a){"use strict";var b,c;c={delay:0,duration:300,easing:"linear"},b=function(a,b){var d;b=a.processParams(b,c),a.isIntro?(d=a.getStyle("opacity"),a.setStyle("opacity",0)):d=0,a.animateStyle("opacity",d,b).then(a.complete)},a.transitions.fade=b})},{ractive:13}],13:[function(a,b){!function(a){"use strict";var c=a.Ractive,d=function(){var a={el:void 0,append:!1,template:{v:1,t:[]},"yield":null,preserveWhitespace:!1,sanitize:!1,stripComments:!0,data:{},computed:{},magic:!1,modifyArrays:!0,adapt:[],isolated:!1,twoway:!0,lazy:!1,noIntro:!1,transitionsEnabled:!0,complete:void 0,noCssTransform:!1,debug:!1};return a}(),e={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)}},f=[],g=Object.prototype.hasOwnProperty,h=function(){var a=Object.prototype.toString;return function(b){return"[object Array]"===a.call(b)}}(),i=function(){var a=Object.prototype.toString;return function(b){return b&&"[object Object]"===a.call(b)}}(),j=function(a){return!isNaN(parseFloat(a))&&isFinite(a)},k=function(a,b,c,d,e){var f,g,h;return a.push(function(){g=a.interpolate}),h=/^([+-]?[0-9]+\.?(?:[0-9]+)?)(px|em|ex|%|in|cm|mm|pt|pc)$/,f={number:function(a,b){var c;return e(a)&&e(b)?(a=+a,b=+b,c=b-a,c?function(b){return a+b*c}:function(){return a}):null},array:function(a,b){var d,e,f,h;if(!c(a)||!c(b))return null;for(d=[],e=[],h=f=Math.min(a.length,b.length);h--;)e[h]=g(a[h],b[h]);for(h=f;h<a.length;h+=1)d[h]=a[h];for(h=f;h<b.length;h+=1)d[h]=b[h];return function(a){for(var b=f;b--;)d[b]=e[b](a);return d}},object:function(a,c){var e,f,h,i,j;if(!d(a)||!d(c))return null;e=[],i={},h={};for(j in a)b.call(a,j)&&(b.call(c,j)?(e.push(j),h[j]=g(a[j],c[j])):i[j]=a[j]);for(j in c)b.call(c,j)&&!b.call(a,j)&&(i[j]=c[j]);return f=e.length,function(a){for(var b,c=f;c--;)b=e[c],i[b]=h[b](a);return i}}}}(f,g,h,i,j),l=function(){var a;return a="undefined"==typeof document?!1:document&&document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}(),m=function(){var a,b={};return a="undefined"!=typeof console&&"function"==typeof console.warn&&"function"==typeof console.warn.apply?function(a,c){if(!c){if(b[a])return;b[a]=!0}console.warn("%cRactive.js: %c"+a,"color: rgb(114, 157, 52);","color: rgb(85, 85, 85);")}:function(){}}(),n={missingParser:"Missing Ractive.parse - cannot parse template. Either preparse or use the version that includes the parser",mergeComparisonFail:"Merge operation: comparison failed. Falling back to identity checking",noComponentEventArguments:"Components currently only support simple events - you cannot include arguments. Sorry!",noTemplateForPartial:'Could not find template for partial "{name}"',noNestedPartials:"Partials ({{>{name}}}) cannot contain nested inline partials",evaluationError:'Error evaluating "{uniqueString}": {err}',badArguments:"Bad arguments \"{arguments}\". I'm not allowed to argue unless you've paid.",failedComputation:'Failed to compute "{key}": {err}',missingPlugin:'Missing "{name}" {plugin} plugin. You may need to download a {plugin} via http://docs.ractivejs.org/latest/plugins#{plugin}s',badRadioInputBinding:"A radio input can have two-way binding on its name attribute, or its checked attribute - not both",noRegistryFunctionReturn:'A function was specified for "{name}" {registry}, but no {registry} was returned',defaultElSpecified:"The <{name}/> component has a default `el` property; it has been disregarded",noElementProxyEventWildcards:'Only component proxy-events may contain "*" wildcards, <{element} on-{event}/> is not valid.',methodDeprecated:'The method "{deprecated}" has been deprecated in favor of "{replacement}" and will likely be removed in a future release. See http://docs.ractivejs.org/latest/migrating for more information.'},o=function(a,b){function c(a){var c=b[a.message]||a.message||"";return d(c,a.args)}function d(a,b){return a.replace(/{([^{}]*)}/g,function(a,c){return b[c]})}var e={warn:function(a,b){(a.debug||b)&&this.warnAlways(a)},warnAlways:function(a){this.logger(c(a),a.allowDuplicates)},error:function(a){this.errorOnly(a),a.debug||this.warn(a,!0)},errorOnly:function(a){a.debug&&this.critical(a)},critical:function(a){var b=a.err||new Error(c(a));this.thrower(b)},logger:a,thrower:function(a){throw a}};return e}(m,n),p=function(a){function b(a){this.event=a,this.method="on"+a,this.deprecate=c[a]}var c={construct:{deprecated:"beforeInit",replacement:"onconstruct"},render:{deprecated:"init",message:'The "init" method has been deprecated and will likely be removed in a future release. You can either use the "oninit" method which will fire only once prior to, and regardless of, any eventual ractive instance being rendered, or if you need to access the rendered DOM, use "onrender" instead. See http://docs.ractivejs.org/latest/migrating for more information.'},complete:{deprecated:"complete",replacement:"oncomplete"}};return b.prototype.fire=function(b,c){function d(a){return b[a]?(c?b[a](c):b[a](),!0):void 0}d(this.method),!b[this.method]&&this.deprecate&&d(this.deprecate.deprecated)&&a.warnAlways({debug:b.debug,message:this.deprecate.message||"methodDeprecated",args:this.deprecate}),c?b.fire(this.event,c):b.fire(this.event)},b}(o),q=function(a,b){var c=a.indexOf(b);-1!==c&&a.splice(c,1)},r=function(){function a(a){setTimeout(a,0)}function b(a,b){return function(){for(var c;c=a.shift();)c(b)}}function c(a,b,d,f){var g;if(b===a)throw new TypeError("A promise's fulfillment handler cannot return the same promise");if(b instanceof e)b.then(d,f);else if(!b||"object"!=typeof b&&"function"!=typeof b)d(b);else{try{g=b.then}catch(h){return void f(h)}if("function"==typeof g){var i,j,k;j=function(b){i||(i=!0,c(a,b,d,f))},k=function(a){i||(i=!0,f(a))};try{g.call(b,j,k)}catch(h){if(!i)return f(h),void(i=!0)}}else d(b)}}var d,e,f={},g={},h={};return"function"==typeof r?e=r:(e=function(d){var i,j,k,l,m,n,o=[],p=[],q=f;k=function(c){return function(d){q===f&&(i=d,q=c,j=b(q===g?o:p,i),a(j))}},l=k(g),m=k(h);try{d(l,m)}catch(r){m(r)}return n={then:function(b,d){var g=new e(function(e,h){var i=function(a,b,d){b.push("function"==typeof a?function(b){var d;try{d=a(b),c(g,d,e,h)}catch(f){h(f)}}:d)};i(b,o,e),i(d,p,h),q!==f&&a(j)});return g}},n["catch"]=function(a){return this.then(null,a)},n},e.all=function(a){return new e(function(b,c){var d,e,f,g=[];if(!a.length)return void b(g);for(f=function(e){a[e].then(function(a){g[e]=a,--d||b(g)},c)},d=e=a.length;e--;)f(e)})},e.resolve=function(a){return new e(function(b){b(a)})},e.reject=function(a){return new e(function(b,c){c(a)})}),d=e}(),s=function(){var a=/\[\s*(\*|[0-9]|[1-9][0-9]+)\s*\]/g;return function(b){return(b||"").replace(a,".$1")}}(),t=function(a){do if(void 0!==a.context)return a.context;while(a=a.parent);return""},u=function(a,b){return null===a&&null===b?!0:"object"==typeof a||"object"==typeof b?!1:a===b},v=function(a,b){function c(a,b){var c=a.computations[b];return!c||c.setter}var d;a.push(function(){return d=a.runloop});var e=function(a,b,c,d){var e=this;this.root=a,this.keypath=b,this.otherInstance=c,this.otherKeypath=d,this.lock=function(){return e.updating=!0},this.unlock=function(){return e.updating=!1},this.bind(),this.value=this.root.viewmodel.get(this.keypath)};return e.prototype={isLocked:function(){return this.updating||this.counterpart&&this.counterpart.updating},shuffle:function(a,b){this.propagateChange(b,a)},setValue:function(a){this.propagateChange(a)},propagateChange:function(a,e){var f;return this.isLocked()?void(this.value=a):void(b(a,this.value)||(this.lock(),d.addViewmodel(f=this.otherInstance.viewmodel)||this.counterpart.value===a||d.scheduleTask(function(){return d.addViewmodel(f)}),e?f.smartUpdate(this.otherKeypath,a,e):c(f,this.otherKeypath)&&f.set(this.otherKeypath,a),this.value=a,d.scheduleTask(this.unlock)))},refineValue:function(a){var b,c=this;this.isLocked()||(this.lock(),d.addViewmodel(b=this.otherInstance.viewmodel),a.map(function(a){return c.otherKeypath+a.substr(c.keypath.length)}).forEach(function(a){return b.mark(a)}),d.scheduleTask(this.unlock))},bind:function(){this.root.viewmodel.register(this.keypath,this)},rebind:function(a){this.unbind(),this.keypath=a,this.counterpart.otherKeypath=a,this.bind()},unbind:function(){this.root.viewmodel.unregister(this.keypath,this)}},function(a,b,c,d){var f,g,h,i,j;f=c+"="+d,h=a.bindings,h[f]||(g=a.instance,i=new e(b,c,g,d),h.push(i),g.twoway&&(j=new e(g,d,b,c),h.push(j),i.counterpart=j,j.counterpart=i),h[f]=i)}}(f,u),w=function(a,b,c){function d(a,b){var c;if("."===b)return a;if(c=a?a.split("."):[],"../"===b.substr(0,3)){for(;"../"===b.substr(0,3);){if(!c.length)throw new Error(f);c.pop(),b=b.substring(3)}return c.push(b),c.join(".")}return a?a+b.replace(/^\.\//,"."):b.replace(/^\.\/?/,"")}var e,f,g;return f='Could not resolve reference - too many "../" prefixes',g={evaluateWrapped:!0},e=function h(e,f,i,j){var k,l,m,n,o,p,q,r,s,t;if(f=a(f),"~/"===f.substr(0,2))return f.substring(2);if("."===f.charAt(0))return d(b(i),f);l=f.split(".")[0],i=i||{};do if(k=i.context,k&&(p=!0,o=e.viewmodel.get(k,g),o&&("object"==typeof o||"function"==typeof o)&&l in o))return k+"."+f;while(i=i.parent);if(l in e.data||l in e.viewmodel.computations)return f;if(e._parent&&!e.isolated){if(p=!0,i=e.component.parentFragment,i.indexRefs&&void 0!==(m=i.indexRefs[f]))return e.component.indexRefBindings[f]=f,void e.viewmodel.set(f,m,!0);if(n=h(e._parent,f,i,!0)){for(q=n.split("."),r=f.split(".");q.length>1&&r.length>1&&q[q.length-1]===r[r.length-1];)q.pop(),r.pop();return s=q.join("."),t=r.join("."),e.viewmodel.set(t,e._parent.viewmodel.get(s),!0),c(e.component,e._parent,s,t),f}}return j||p?void 0!==e.viewmodel.get(f)?f:void 0:(e.viewmodel.set(f,void 0),f)}}(s,t,v),x=function(a){function b(a){a.detach()}function c(a){a.detachNodes()}function d(a){!a.ready||a.outros.length||a.outroChildren||(a.outrosComplete||(a.parent?a.parent.decrementOutros(a):a.detachNodes(),a.outrosComplete=!0),a.intros.length||a.totalChildren||("function"==typeof a.callback&&a.callback(),a.parent&&a.parent.decrementTotal()))}var e=function(a,b){this.callback=a,this.parent=b,this.intros=[],this.outros=[],this.children=[],this.totalChildren=this.outroChildren=0,this.detachQueue=[],this.outrosComplete=!1,b&&b.addChild(this)};return e.prototype={addChild:function(a){this.children.push(a),this.totalChildren+=1,this.outroChildren+=1},decrementOutros:function(){this.outroChildren-=1,d(this)},decrementTotal:function(){this.totalChildren-=1,d(this)},add:function(a){var b=a.isIntro?this.intros:this.outros;b.push(a)},remove:function(b){var c=b.isIntro?this.intros:this.outros;a(c,b),d(this)},init:function(){this.ready=!0,d(this)},detachNodes:function(){this.detachQueue.forEach(b),this.children.forEach(c)}},e}(q),y=function(a,b,c,d,e,f){function g(){var a,b,c;for(a=0;a<k.viewmodels.length;a+=1)b=k.viewmodels[a],c=b.applyChanges(),c&&n.fire(b.ractive,c);for(k.viewmodels.length=0,h(),a=0;a<k.views.length;a+=1)k.views[a].update();for(k.views.length=0,a=0;a<k.tasks.length;a+=1)k.tasks[a]();return k.tasks.length=0,k.viewmodels.length?g():void 0}function h(){var a,b,c,d;for(a=m.length;a--;)b=m[a],b.keypath&&m.splice(a,1),(c=e(b.root,b.ref,b.parentFragment))&&((d||(d=[])).push({item:b,keypath:c}),m.splice(a,1));d&&d.forEach(i)}function i(a){a.item.resolve(a.keypath)}var j,k,l,m=[],n=new b("change");return l={start:function(a,b){var c,e;return b&&(c=new d(function(a){return e=a})),k={previousBatch:k,transitionManager:new f(e,k&&k.transitionManager),views:[],tasks:[],viewmodels:[],instance:a},a&&k.viewmodels.push(a.viewmodel),c},end:function(){g(),k.transitionManager.init(),!k.previousBatch&&k.instance&&(k.instance.viewmodel.changes=[]),k=k.previousBatch},addViewmodel:function(a){return k?-1===k.viewmodels.indexOf(a)?(k.viewmodels.push(a),!0):!1:(a.applyChanges(),!1)},registerTransition:function(a){a._manager=k.transitionManager,k.transitionManager.add(a)},addView:function(a){k.views.push(a)},addUnresolved:function(a){m.push(a)},removeUnresolved:function(a){c(m,a)},detachWhenReady:function(a){k.transitionManager.detachQueue.push(a)},scheduleTask:function(a,b){var c;if(k){for(c=k;b&&c.previousBatch;)c=c.previousBatch;c.tasks.push(a)}else a()}},a.runloop=l,j=l}(f,p,q,r,w,x),z=function(){var a=/^\s*[0-9]+\s*$/;return function(b){return a.test(b)?[]:{}}}(),A=function(a,b,c){function d(b,c,d){function e(b){var d,e;b.value=c,b.updating||(e=b.ractive,d=b.keypath,b.updating=!0,a.start(e),e.viewmodel.mark(d),a.end(),b.updating=!1)}var f,g,h,i,j,k;if(f=b.obj,g=b.prop,d&&!d.configurable){if("length"===g)return;throw new Error('Cannot use magic mode with property "'+g+'" - object is not configurable')}d&&(h=d.get,i=d.set),j=h||function(){return c},k=function(a){i&&i(a),c=h?h():a,k._ractiveWrappers.forEach(e)},k._ractiveWrappers=[b],Object.defineProperty(f,g,{get:j,set:k,enumerable:!0,configurable:!0})}var e,f,g;try{Object.defineProperty({},"test",{value:0}),f={filter:function(a,b,d){var e,f,g,h,i;return b?(e=b.split("."),f=e.pop(),g=e.join("."),(h=d.viewmodel.wrapped[g])&&!h.magic?!1:(i=d.get(g),c(i)&&/^[0-9]+$/.test(f)?!1:i&&("object"==typeof i||"function"==typeof i))):!1},wrap:function(a,b,c){return new g(a,b,c)}},g=function(a,b,c){var e,f,g,h;return this.magic=!0,this.ractive=a,this.keypath=c,this.value=b,e=c.split("."),this.prop=e.pop(),f=e.join("."),this.obj=f?a.get(f):a.data,g=this.originalDescriptor=Object.getOwnPropertyDescriptor(this.obj,this.prop),g&&g.set&&(h=g.set._ractiveWrappers)?void(-1===h.indexOf(this)&&h.push(this)):void d(this,b,g)},g.prototype={get:function(){return this.value},reset:function(b){this.updating||(this.updating=!0,this.obj[this.prop]=b,a.addViewmodel(this.ractive.viewmodel),this.ractive.viewmodel.mark(this.keypath),this.updating=!1)},set:function(a,c){this.updating||(this.obj[this.prop]||(this.updating=!0,this.obj[this.prop]=b(a),this.updating=!1),this.obj[this.prop][a]=c)},teardown:function(){var a,b,c,d,e;return this.updating?!1:(a=Object.getOwnPropertyDescriptor(this.obj,this.prop),b=a&&a.set,void(b&&(d=b._ractiveWrappers,e=d.indexOf(this),-1!==e&&d.splice(e,1),d.length||(c=this.obj[this.prop],Object.defineProperty(this.obj,this.prop,this.originalDescriptor||{writable:!0,enumerable:!0,configurable:!0}),this.obj[this.prop]=c))))}}}catch(h){f=!1}return e=f}(y,z,h),B=function(a){return!!a}(A),C={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/"},D=function(a,b){var c;return c=a?function(a,c){return c&&c!==b.html?document.createElementNS(c,a):document.createElement(a)}:function(a,c){if(c&&c!==b.html)throw"This browser does not support namespaces other than http://www.w3.org/1999/xhtml. The most likely cause of this error is that you're trying to render SVG in an older browser. See http://docs.ractivejs.org/latest/svg-and-older-browsers for more information";return document.createElement(a)}}(l,C),E=function(){var a="object"==typeof document;return a}(),F=function(a){var b;try{Object.defineProperty({},"test",{value:0}),a&&Object.defineProperty(document.createElement("div"),"test",{value:0}),b=Object.defineProperty}catch(c){b=function(a,b,c){a[b]=c.value}}return b}(E),G=function(a,b,c){var d;try{try{Object.defineProperties({},{test:{value:0}})}catch(e){throw e}c&&Object.defineProperties(a("div"),{test:{value:0}}),d=Object.defineProperties}catch(e){d=function(a,c){var d;for(d in c)c.hasOwnProperty(d)&&b(a,d,c[d])}}return d}(D,F,E),H=function(a){return function(b,c,d){var e;if("string"!=typeof c||!a(d))throw new Error("Bad arguments");if(e=+b.get(c)||0,!a(e))throw new Error("Cannot add to a non-numeric value");return b.set(c,e+d)}}(j),I=function(a){return function(b,c){return a(this,b,void 0===c?1:+c)}}(H),J=function(a){var b=/^\.+/;return function(c){return a(c).replace(b,"")}}(s),K=["o","ms","moz","webkit"],L=function(a){var b;return"undefined"==typeof window?b=null:(!function(a,b,c){var d,e;if(!c.requestAnimationFrame){for(d=0;d<a.length&&!c.requestAnimationFrame;++d)c.requestAnimationFrame=c[a[d]+"RequestAnimationFrame"];c.requestAnimationFrame||(e=c.setTimeout,c.requestAnimationFrame=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})}}(a,0,window),b=window.requestAnimationFrame),b}(K),M=function(){var a;return a="undefined"!=typeof window&&window.performance&&"function"==typeof window.performance.now?function(){return window.performance.now()}:function(){return Date.now()}}(),N=function(a,b,c){var d=[],e={tick:function(){var f,g,h;for(h=b(),c.start(),f=0;f<d.length;f+=1)g=d[f],g.tick(h)||d.splice(f--,1);c.end(),d.length?a(e.tick):e.running=!1},add:function(b){d.push(b),e.running||(e.running=!0,a(e.tick))},abort:function(a,b){for(var c,e=d.length;e--;)c=d[e],c.root===b&&c.keypath===a&&c.stop()}};return e}(L,M,y),O=function(){function a(a){return a.trim?a.trim():a.replace(/^\s+/,"").replace(/\s+$/,"")}function b(a){return a.str}var c,d=/(?:^|\})?\s*([^\{\}]+)\s*\{/g,e=/\/\*.*?\*\//g,f=/((?:(?:\[[^\]+]\])|(?:[^\s\+\>\~:]))+)((?::[^\s\+\>\~]+)?\s*[\s\+\>\~]?)\s*/g,g=/^@media/,h=/\[data-rvcguid="[a-z0-9-]+"]/g;return c=function(c,i){var j,k;return k=function(a){var c,d,e,g,h,j,k,l,m=[];for(c=[];d=f.exec(a);)c.push({str:d[0],base:d[1],modifiers:d[2]});for(g='[data-rvcguid="'+i+'"]',h=c.map(b),l=c.length;l--;)k=h.slice(),e=c[l],k[l]=e.base+g+e.modifiers||"",j=h.slice(),j[l]=g+" "+j[l],m.push(k.join(" "),j.join(" "));return m.join(", ")},j=h.test(c)?c.replace(h,'[data-rvcguid="'+i+'"]'):c.replace(e,"").replace(d,function(b,c){var d,e;return g.test(c)?b:(d=c.split(",").map(a),e=d.map(k).join(", ")+" ",b.replace(c,e))})}}(),P=function(a){function b(a,b,d){var e,f=b.constructor._guid;(e=c(d.css,d,f)||c(a.css,a,f))&&(b.constructor.css=e)}function c(b,c,d){return b?c.noCssTransform?b:a(b,d):void 0}var d={name:"css",extend:b,init:function(){}};return d}(O),Q=function(){function a(a,b){return"function"==typeof b&&/_super/.test(a)}var b;return b=function(b,c,d){return d||a(b,c)?function(){var a,d="_super"in this,e=this._super;return this._super=c,a=b.apply(this,arguments),d&&(this._super=e),a}:b}}(),R=function(a){function b(a,b,c){var d=c.data||{},e=f(a.prototype.data);if("object"!=typeof d&&"function"!=typeof d)throw new TypeError('data option must be an object or a function, "'+d+'" is not valid');return g(e,d)}function c(a,c,d){c.data=b(a,c,d)}function d(a,c,d){var e=d.data,f=b(a,c,d);return"function"==typeof f&&(f=f.call(c,e)||e),c.data=f||{}}function e(a){var b=this.init(a.constructor,a,a);return b?(a.data=b,!0):void 0}function f(a){if("function"!=typeof a||!Object.keys(a).length)return a;var b={};return h(a,b),g(a,b)}function g(a,b){return"function"==typeof b?k(b,a):"function"==typeof a?j(b,a):i(b,a)}function h(a,b,c){for(var d in a)c&&d in b||(b[d]=a[d])}function i(a,b){return a=a||{},b?(h(b,a,!0),a):a}function j(a,b){return function(c){var d;if(a){d=[];for(var e in a)c&&e in c||d.push(e)}return c=b.call(this,c)||c,d&&d.length&&(c=c||{},d.forEach(function(b){c[b]=a[b]})),c}}function k(b,c){var d;return d="function"!=typeof c?function(a){i(a,c)}:function(b){return c=a(c,function(){},!0),c.call(this,b)||b},a(b,d)}var l,m={name:"data",extend:c,init:d,reset:e};return l=m}(Q),S={TEXT:1,INTERPOLATOR:2,TRIPLE:3,SECTION:4,INVERTED:5,CLOSING:6,ELEMENT:7,PARTIAL:8,COMMENT:9,DELIMCHANGE:10,MUSTACHE:11,TAG:12,ATTRIBUTE:13,CLOSING_TAG:14,COMPONENT:15,NUMBER_LITERAL:20,STRING_LITERAL:21,ARRAY_LITERAL:22,OBJECT_LITERAL:23,BOOLEAN_LITERAL:24,GLOBAL:26,KEY_VALUE_PAIR:27,REFERENCE:30,REFINEMENT:31,MEMBER:32,PREFIX_OPERATOR:33,BRACKETED:34,CONDITIONAL:35,INFIX_OPERATOR:36,INVOCATION:40,SECTION_IF:50,SECTION_UNLESS:51,SECTION_EACH:52,SECTION_WITH:53,SECTION_IF_WITH:54},T=function(){var a;try{Object.create(null),a=Object.create}catch(b){a=function(){var a=function(){};return function(b,c){var d;return null===b?{}:(a.prototype=b,d=new a,c&&Object.defineProperties(d,c),d)}}()}return a}(),U={expectedExpression:"Expected a JavaScript expression",expectedParen:"Expected closing paren"},V=function(a){var b=/^(?:[+-]?)(?:(?:(?:0|[1-9]\d*)?\.\d+)|(?:(?:0|[1-9]\d*)\.)|(?:0|[1-9]\d*))(?:[eE][+-]?\d+)?/;return function(c){var d;return(d=c.matchPattern(b))?{t:a.NUMBER_LITERAL,v:d}:null}}(S),W=function(a){return function(b){var c=b.remaining();return"true"===c.substr(0,4)?(b.pos+=4,{t:a.BOOLEAN_LITERAL,v:"true"}):"false"===c.substr(0,5)?(b.pos+=5,{t:a.BOOLEAN_LITERAL,v:"false"}):null}}(S),X=function(){var a,b,c;return a=/^(?=.)[^"'\\]+?(?:(?!.)|(?=["'\\]))/,b=/^\\(?:['"\\bfnrt]|0(?![0-9])|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|(?=.)[^ux0-9])/,c=/^\\(?:\r\n|[\u000A\u000D\u2028\u2029])/,function(d){return function(e){var f,g,h,i;for(f=e.pos,g='"',h=!1;!h;)i=e.matchPattern(a)||e.matchPattern(b)||e.matchString(d),i?g+='"'===i?'\\"':"\\'"===i?"'":i:(i=e.matchPattern(c),i?g+="\\u"+("000"+i.charCodeAt(1).toString(16)).slice(-4):h=!0);return g+='"',JSON.parse(g)}}}(),Y=function(a){return a('"')}(X),Z=function(a){return a("'")}(X),$=function(a,b,c){return function(d){var e,f;return e=d.pos,d.matchString('"')?(f=c(d),d.matchString('"')?{t:a.STRING_LITERAL,v:f}:(d.pos=e,null)):d.matchString("'")?(f=b(d),d.matchString("'")?{t:a.STRING_LITERAL,v:f}:(d.pos=e,null)):null}}(S,Y,Z),_={name:/^[a-zA-Z_$][a-zA-Z_$0-9]*/},ab=function(a,b,c){var d=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;return function(e){var f;return(f=a(e))?d.test(f.v)?f.v:'"'+f.v.replace(/"/g,'\\"')+'"':(f=b(e))?f.v:(f=e.matchPattern(c.name))?f:void 0}}($,V,_),bb=function(a,b){return function(c){var d,e,f;return d=c.pos,c.allowWhitespace(),e=b(c),null===e?(c.pos=d,null):(c.allowWhitespace(),c.matchString(":")?(c.allowWhitespace(),f=c.readExpression(),null===f?(c.pos=d,null):{t:a.KEY_VALUE_PAIR,k:e,v:f}):(c.pos=d,null))}}(S,ab),cb=function(a){return function b(c){var d,e,f,g;return d=c.pos,f=a(c),null===f?null:(e=[f],c.matchString(",")?(g=b(c),g?e.concat(g):(c.pos=d,null)):e)}}(bb),db=function(a,b){return function(c){var d,e;return d=c.pos,c.allowWhitespace(),c.matchString("{")?(e=b(c),c.allowWhitespace(),c.matchString("}")?{t:a.OBJECT_LITERAL,m:e}:(c.pos=d,null)):(c.pos=d,null)}}(S,cb),eb=function(a){return function b(c){function d(a){f.push(a)}var e,f,g,h;return e=c.pos,c.allowWhitespace(),g=c.readExpression(),null===g?null:(f=[g],c.allowWhitespace(),c.matchString(",")&&(h=b(c),null===h&&c.error(a.expectedExpression),h.forEach(d)),f)}}(U),fb=function(a,b){return function(c){var d,e;return d=c.pos,c.allowWhitespace(),c.matchString("[")?(e=b(c),c.matchString("]")?{t:a.ARRAY_LITERAL,m:e}:(c.pos=d,null)):(c.pos=d,null)}}(S,eb),gb=function(a,b,c,d,e){return function(f){var g=a(f)||b(f)||c(f)||d(f)||e(f);return g}}(V,W,$,db,fb),hb=function(a,b){var c,d,e,f,g;return c=/^\.[a-zA-Z_$0-9]+/,e=function(a){var b=a.matchPattern(d);return b?"."+b:null},d=/^\[(0|[1-9][0-9]*)\]/,f=/^(?:Array|console|Date|RegExp|decodeURIComponent|decodeURI|encodeURIComponent|encodeURI|isFinite|isNaN|parseFloat|parseInt|JSON|Math|NaN|undefined|null)$/,g=/^(?:break|case|catch|continue|debugger|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|void|while|with)$/,function(d){var h,i,j,k,l,m,n;if(h=d.pos,d.matchString("~/"))i="~/";else for(i="";d.matchString("../");)i+="../";if(i||(k=d.matchString("./")||d.matchString(".")||""),j=d.matchPattern(/^@(?:keypath|index|key)/)||d.matchPattern(b.name)||"",g.test(j))return d.pos=h,null;if(!i&&!k&&f.test(j))return{t:a.GLOBAL,v:j};if(l=(i||k)+j,!l)return null;for(;m=d.matchPattern(c)||e(d);)l+=m;return d.matchString("(")&&(n=l.lastIndexOf("."),-1!==n?(l=l.substr(0,n),d.pos=h+l.length):d.pos-=1),{t:a.REFERENCE,n:l.replace(/^this\./,"./").replace(/^this$/,".")}}}(S,_),ib=function(a,b){return function(c){var d,e;return d=c.pos,c.matchString("(")?(c.allowWhitespace(),e=c.readExpression(),e||c.error(b.expectedExpression),c.allowWhitespace(),c.matchString(")")||c.error(b.expectedParen),{t:a.BRACKETED,x:e}):null}}(S,U),jb=function(a,b,c){return function(d){return a(d)||b(d)||c(d)}}(gb,hb,ib),kb=function(a,b,c){return function(d){var e,f,g;if(e=d.pos,d.allowWhitespace(),d.matchString(".")){if(d.allowWhitespace(),f=d.matchPattern(c.name))return{t:a.REFINEMENT,n:f};d.error("Expected a property name")}return d.matchString("[")?(d.allowWhitespace(),g=d.readExpression(),g||d.error(b.expectedExpression),d.allowWhitespace(),d.matchString("]")||d.error("Expected ']'"),{t:a.REFINEMENT,x:g}):null}}(S,U,_),lb=function(a,b,c,d,e){return function(f){var g,h,i,j;if(h=b(f),!h)return null;for(;h;)if(g=f.pos,i=d(f))h={t:a.MEMBER,x:h,r:i};else{if(!f.matchString("("))break;f.allowWhitespace(),j=c(f),f.allowWhitespace(),f.matchString(")")||f.error(e.expectedParen),h={t:a.INVOCATION,x:h},j&&(h.o=j)}return h}}(S,jb,eb,kb,U),mb=function(a,b,c){var d,e;return e=function(c,d){return function(e){var f;return(f=d(e))?f:e.matchString(c)?(e.allowWhitespace(),f=e.readExpression(),f||e.error(b.expectedExpression),{s:c,o:f,t:a.PREFIX_OPERATOR}):null}},function(){var a,b,f,g,h;for(g="! ~ + - typeof".split(" "),h=c,a=0,b=g.length;b>a;a+=1)f=e(g[a],h),h=f;d=h}(),d}(S,U,lb),nb=function(a,b){var c,d;return d=function(b,c){return function(d){var e,f,g;if(f=c(d),!f)return null;for(;;){if(e=d.pos,d.allowWhitespace(),!d.matchString(b))return d.pos=e,f;if("in"===b&&/[a-zA-Z_$0-9]/.test(d.remaining().charAt(0)))return d.pos=e,f;if(d.allowWhitespace(),g=c(d),!g)return d.pos=e,f;f={t:a.INFIX_OPERATOR,s:b,o:[f,g]}}}},function(){var a,e,f,g,h;for(g="* / % + - << >> >>> < <= > >= in instanceof == != === !== & ^ | && ||".split(" "),h=b,a=0,e=g.length;e>a;a+=1)f=d(g[a],h),h=f;c=h}(),c}(S,mb),ob=function(a,b,c){return function(d){var e,f,g,h;return(f=b(d))?(e=d.pos,d.allowWhitespace(),d.matchString("?")?(d.allowWhitespace(),g=d.readExpression(),g||d.error(c.expectedExpression),d.allowWhitespace(),d.matchString(":")||d.error('Expected ":"'),d.allowWhitespace(),h=d.readExpression(),h||d.error(c.expectedExpression),{t:a.CONDITIONAL,o:[f,g,h]}):(d.pos=e,f)):null}}(S,nb,U),pb=function(a,b){function c(a){return JSON.stringify(String(a))}function d(c,e){var f,g;if(c.t===a.REFERENCE&&-1===e.indexOf(c.n)&&e.unshift(c.n),g=c.o||c.m)if(b(g))d(g,e);else for(f=g.length;f--;)d(g[f],e);c.x&&d(c.x,e),c.r&&d(c.r,e),c.v&&d(c.v,e)}function e(b,d,f){var g=function(a){return e(b,a,f)};switch(d.t){case a.BOOLEAN_LITERAL:case a.GLOBAL:case a.NUMBER_LITERAL:return d.v;case a.STRING_LITERAL:return c(d.v);case a.ARRAY_LITERAL:return"["+(d.m?d.m.map(g).join(","):"")+"]";case a.OBJECT_LITERAL:return"{"+(d.m?d.m.map(g).join(","):"")+"}";case a.KEY_VALUE_PAIR:return d.k+":"+e(b,d.v,f);case a.PREFIX_OPERATOR:return("typeof"===d.s?"typeof ":d.s)+e(b,d.o,f);case a.INFIX_OPERATOR:return e(b,d.o[0],f)+("in"===d.s.substr(0,2)?" "+d.s+" ":d.s)+e(b,d.o[1],f);case a.INVOCATION:return e(b,d.x,f)+"("+(d.o?d.o.map(g).join(","):"")+")";case a.BRACKETED:return"("+e(b,d.x,f)+")";case a.MEMBER:return e(b,d.x,f)+e(b,d.r,f);case a.REFINEMENT:return d.n?"."+d.n:"["+e(b,d.x,f)+"]";case a.CONDITIONAL:return e(b,d.o[0],f)+"?"+e(b,d.o[1],f)+":"+e(b,d.o[2],f);case a.REFERENCE:return"_"+f.indexOf(d.n);default:b.error("Expected legal JavaScript")}}var f;return f=function(a){var b,c=[];return d(a,c),b={r:c,s:e(this,a,c)}}}(S,i),qb=function(a,b,c,d,e){var f,g,h=/^\s+/;return g=function(a){this.name="ParseError",this.message=a;try{throw new Error(a)}catch(b){this.stack=b.stack}},g.prototype=Error.prototype,f=function(a,b){var c,d,e=0;for(this.str=a,this.options=b||{},this.pos=0,this.lines=this.str.split("\n"),this.lineEnds=this.lines.map(function(a){var b=e+a.length+1;return e=b,b},0),this.init&&this.init(a,b),c=[];this.pos<this.str.length&&(d=this.read());)c.push(d);this.leftover=this.remaining(),this.result=this.postProcess?this.postProcess(c,b):c},f.prototype={read:function(a){var b,c,d,e;for(a||(a=this.converters),b=this.pos,d=a.length,c=0;d>c;c+=1)if(this.pos=b,e=a[c](this))return e;return null},readExpression:function(){return d(this)},flattenExpression:e,getLinePos:function(a){for(var b,c=0,d=0;a>=this.lineEnds[c];)d=this.lineEnds[c],c+=1;return b=a-d,[c+1,b+1,a]},error:function(a){var b,c,d,e,f,h;throw b=this.getLinePos(this.pos),c=b[0],d=b[1],e=this.lines[b[0]-1],f=e+"\n"+new Array(b[1]).join(" ")+"^----",h=new g(a+" at line "+c+" character "+d+":\n"+f),h.line=b[0],h.character=b[1],h.shortMessage=a,h},matchString:function(a){return this.str.substr(this.pos,a.length)===a?(this.pos+=a.length,a):void 0},matchPattern:function(a){var b;return(b=a.exec(this.remaining()))?(this.pos+=b[0].length,b[1]||b[0]):void 0},allowWhitespace:function(){this.matchPattern(h)},remaining:function(){return this.str.substring(this.pos)},nextChar:function(){return this.str.charAt(this.pos)}},f.extend=function(a){var d,e,g=this;d=function(a,b){f.call(this,a,b)},d.prototype=b(g.prototype);for(e in a)c.call(a,e)&&(d.prototype[e]=a[e]);return d.extend=f.extend,d},a.Parser=f,f}(f,T,g,ob,pb),rb=function(){var a=/^[^\s=]+/,b=/^\s+/;return function(c){var d,e,f;return c.matchString("=")?(d=c.pos,c.allowWhitespace(),(e=c.matchPattern(a))?c.matchPattern(b)?(f=c.matchPattern(a))?(c.allowWhitespace(),c.matchString("=")?[e,f]:(c.pos=d,null)):(c.pos=d,null):null:(c.pos=d,null)):null}}(),sb=[{delimiters:"delimiters",isTriple:!1,isStatic:!1},{delimiters:"tripleDelimiters",isTriple:!0,isStatic:!1},{delimiters:"staticDelimiters",isTriple:!1,isStatic:!0},{delimiters:"staticTripleDelimiters",isTriple:!0,isStatic:!0}],tb=function(a){var b={"#":a.SECTION,"^":a.INVERTED,"/":a.CLOSING,">":a.PARTIAL,"!":a.COMMENT,"&":a.TRIPLE};return function(a){var c=b[a.str.charAt(a.pos)];return c?(a.pos+=1,c):null}}(S),ub=function(a){return{each:a.SECTION_EACH,"if":a.SECTION_IF,"if-with":a.SECTION_IF_WITH,"with":a.SECTION_WITH,unless:a.SECTION_UNLESS}}(S),vb=null,wb=function(a,b,c){function d(b,c,d){var f;if(c){for(;c.t===a.BRACKETED&&c.x;)c=c.x;return c.t===a.REFERENCE?d.r=c.n:c.t===a.NUMBER_LITERAL&&i.test(c.v)?d.r=c.v:(f=e(b,c))?d.rx=f:d.x=b.flattenExpression(c),d}}function e(b,c){for(var d,e=[];c.t===a.MEMBER&&c.r.t===a.REFINEMENT;)d=c.r,e.unshift(d.x?d.x.t===a.REFERENCE?d.x:b.flattenExpression(d.x):d.n),c=c.x;return c.t!==a.REFERENCE?null:{r:c.n,m:e}}var f,g,h=/^\s*:\s*([a-zA-Z_$][a-zA-Z_$0-9]*)/,i=/^[0-9][1-9]*$/,j=new RegExp("^("+Object.keys(c).join("|")+")\\b");return g=/^[a-zA-Z$_0-9]+(?:(\.[a-zA-Z$_0-9]+)|(\[[a-zA-Z$_0-9]+\]))*$/,f=function(c,e){var f,i,k,l,m,n,o,p,q,r;if(f=c.pos,k={},r=c[e.delimiters],e.isStatic&&(k.s=!0),e.isTriple)k.t=a.TRIPLE;else{if("!"===c.remaining()[0]){try{n=c.readExpression(),c.allowWhitespace(),c.remaining().indexOf(r[1])?n=null:k.t=a.INTERPOLATOR}catch(s){}if(!n)return q=c.remaining().indexOf(r[1]),~q?c.pos+=q:c.error("Expected closing delimiter ('"+r[1]+"')"),{t:a.COMMENT}}if(!n)if(l=b(c),k.t=l||a.INTERPOLATOR,l===a.SECTION)(m=c.matchPattern(j))&&(k.n=m),c.allowWhitespace();else if((l===a.COMMENT||l===a.CLOSING)&&(p=c.remaining(),q=p.indexOf(r[1]),-1!==q))return k.r=p.substr(0,q).split(" ")[0],c.pos+=q,k}if(!n){c.allowWhitespace(),n=c.readExpression();
|
||
var t;if(k.t===a.PARTIAL&&n&&(t=c.readExpression())&&(k={contextPartialExpression:n},n=t),p=c.remaining(),p.substr(0,r[1].length)!==r[1]&&":"!==p.charAt(0)){if(i=c.pos,c.pos=f,p=c.remaining(),q=p.indexOf(r[1]),-1!==q)return k.r=p.substr(0,q).trim(),g.test(k.r)||c.error("Expected a legal Mustache reference"),c.pos+=q,k;c.pos=i}}return d(c,n,k),k.contextPartialExpression&&(k.contextPartialExpression=[d(c,k.contextPartialExpression,{t:a.PARTIAL})]),(o=c.matchPattern(h))&&(k.i=o),k}}(S,tb,ub,vb),xb=function(a,b,c,d,e){function f(a){var b;return a.interpolate[a.inside]===!1?null:(b=c.slice().sort(function(b,c){return a[c.delimiters][0].length-a[b.delimiters][0].length}),function d(c){return c?g(a,c)||d(b.shift()):null}(b.shift()))}function g(c,f){var g,i,k,l,m,n,o,p;if(g=c.pos,k=c[f.delimiters],!c.matchString(k[0]))return null;if(i=b(c))return c.matchString(k[1])?(c[f.delimiters]=i,j):null;if(c.allowWhitespace(),i=d(c,f),null===i)return c.pos=g,null;if(c.allowWhitespace(),c.matchString(k[1])||c.error("Expected closing delimiter '"+k[1]+"' after reference"),i.t===a.COMMENT&&(i.exclude=!0),i.t===a.CLOSING&&(c.sectionDepth-=1,c.sectionDepth<0&&(c.pos=g,c.error("Attempted to close a section that wasn't open"))),i.contextPartialExpression)i.f=i.contextPartialExpression,i.t=a.SECTION,i.n="with",delete i.contextPartialExpression;else if(h(i)){for(c.sectionDepth+=1,l=[],o=l,m=i.n;p=c.read();){if(p.t===a.CLOSING){m&&p.r!==m&&c.error("Expected {{/"+m+"}}");break}if(p.t===a.INTERPOLATOR&&"else"===p.r){if("unless"!==i.n){o=n=[];continue}c.error("{{else}} not allowed in {{#unless}}")}o.push(p)}l.length&&(i.f=l),n&&n.length&&(i.l=n,"with"===i.n&&(i.n="if-with"))}return c.includeLinePositions&&(i.p=c.getLinePos(g)),i.n?i.n=e[i.n]:i.t===a.INVERTED&&(i.t=a.SECTION,i.n=a.SECTION_UNLESS),i}function h(b){return b.t===a.SECTION||b.t===a.INVERTED}var i,j={t:a.DELIMCHANGE,exclude:!0};return i=f}(S,rb,sb,wb,ub),yb=function(a){var b="<!--",c="-->";return function(d){var e,f,g,h,i;return e=d.pos,d.matchString(b)?(g=d.remaining(),h=g.indexOf(c),-1===h&&d.error("Illegal HTML - expected closing comment sequence ('-->')"),f=g.substr(0,h),d.pos+=h+3,i={t:a.COMMENT,c:f},d.includeLinePositions&&(i.p=d.getLinePos(e)),i):null}}(S),zb=function(){var a=/^(?:area|base|br|col|command|doctype|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/i;return a}(),Ab=function(a,b){var c,d,e;for(c=b.length;c--;){if(d=a.indexOf(b[c]),!d)return 0;-1!==d&&(!e||e>d)&&(e=d)}return e||-1},Bb=function(){function a(a){return a?10===a?32:128>a?a:159>=a?d[a-128]:55296>a?a:57343>=a?65533:65535>=a?a:65533:65533}var b,c,d,e;return c={quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},d=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376],e=new RegExp("&(#?(?:x[\\w\\d]+|\\d+|"+Object.keys(c).join("|")+"));?","g"),b=function(b){return b.replace(e,function(b,d){var e;return e="#"!==d[0]?c[d]:"x"===d[1]?parseInt(d.substring(2),16):parseInt(d.substring(1),10),e?String.fromCharCode(a(e)):b})}}(vb),Cb=function(a,b){return function(c){var d,e,f,g;return e=c.remaining(),g=c.inside?"</"+c.inside:"<",c.inside&&!c.interpolate[c.inside]?d=e.indexOf(g):(f=[c.delimiters[0],c.tripleDelimiters[0],c.staticDelimiters[0],c.staticTripleDelimiters[0]],c.inAttribute===!0?f.push('"',"'","=","<",">","`"):f.push(c.inAttribute?c.inAttribute:g),d=a(e,f)),d?(-1===d&&(d=e.length),c.pos+=d,c.inside?e.substr(0,d):b(e.substr(0,d))):null}}(Ab,Bb),Db=function(a){var b=/^([a-zA-Z]{1,}:?[a-zA-Z0-9\-]*)\s*\>/;return function(c){var d;return c.matchString("</")?(d=c.matchPattern(b))?{t:a.CLOSING_TAG,e:d}:(c.pos-=2,void c.error("Illegal closing tag")):null}}(S),Eb=function(a,b,c){function d(a){var b,c,d;return a.allowWhitespace(),(c=a.matchPattern(k))?(b={name:c},d=e(a),d&&(b.value=d),b):null}function e(a){var b,d,e,f;return b=a.pos,a.allowWhitespace(),a.matchString("=")?(a.allowWhitespace(),d=a.pos,e=a.sectionDepth,f=h(a,"'")||h(a,'"')||g(a),a.sectionDepth!==e&&(a.pos=d,a.error("An attribute value must contain as many opening section tags as closing section tags")),null===f?(a.pos=b,null):f.length?1===f.length&&"string"==typeof f[0]?c(f[0]):f:null):(a.pos=b,null)}function f(b){var c,d,e,f,g;return c=b.pos,(d=b.matchPattern(l))?(e=d,f=[b.delimiters[0],b.tripleDelimiters[0],b.staticDelimiters[0],b.staticTripleDelimiters[0]],-1!==(g=a(e,f))&&(d=d.substr(0,g),b.pos=c+d.length),d):null}function g(a){var c,d;for(a.inAttribute=!0,c=[],d=b(a)||f(a);null!==d;)c.push(d),d=b(a)||f(a);return c.length?(a.inAttribute=!1,c):null}function h(a,c){var d,e,f;if(d=a.pos,!a.matchString(c))return null;for(a.inAttribute=c,e=[],f=b(a)||i(a,c);null!==f;)e.push(f),f=b(a)||i(a,c);return a.matchString(c)?(a.inAttribute=!1,e):(a.pos=d,null)}function i(b,c){var d,e,f,g;return d=b.pos,f=b.remaining(),g=[c,b.delimiters[0],b.tripleDelimiters[0],b.staticDelimiters[0],b.staticTripleDelimiters[0]],e=a(f,g),-1===e&&b.error("Quoted attribute value must have a closing quote"),e?(b.pos+=e,f.substr(0,e)):null}var j,k=/^[^\s"'>\/=]+/,l=/^[^\s"'=<>`]+/;return j=d}(Ab,xb,Bb),Fb=function(a,b,c){function d(a){var b,d,e;return a.allowWhitespace(),(b=c(a))?(e={key:b},a.allowWhitespace(),a.matchString(":")?(a.allowWhitespace(),(d=a.read())?(e.value=d.v,e):null):null):null}var e,f,g,h,i,j,k;return f={"true":!0,"false":!1,undefined:void 0,"null":null},g=new RegExp("^(?:"+Object.keys(f).join("|")+")"),h=/^(?:[+-]?)(?:(?:(?:0|[1-9]\d*)?\.\d+)|(?:(?:0|[1-9]\d*)\.)|(?:0|[1-9]\d*))(?:[eE][+-]?\d+)?/,i=/\$\{([^\}]+)\}/g,j=/^\$\{([^\}]+)\}/,k=/^\s*$/,e=a.extend({init:function(a,b){this.values=b.values,this.allowWhitespace()},postProcess:function(a){return 1===a.length&&k.test(this.leftover)?{value:a[0].v}:null},converters:[function(a){var b;return a.values?(b=a.matchPattern(j),b&&a.values.hasOwnProperty(b)?{v:a.values[b]}:void 0):null},function(a){var b;return(b=a.matchPattern(g))?{v:f[b]}:void 0},function(a){var b;return(b=a.matchPattern(h))?{v:+b}:void 0},function(a){var c,d=b(a);return d&&(c=a.values)?{v:d.v.replace(i,function(a,b){return b in c?c[b]:b})}:d},function(a){var b,c;if(!a.matchString("{"))return null;if(b={},a.allowWhitespace(),a.matchString("}"))return{v:b};for(;c=d(a);){if(b[c.key]=c.value,a.allowWhitespace(),a.matchString("}"))return{v:b};if(!a.matchString(","))return null}return null},function(a){var b,c;if(!a.matchString("["))return null;if(b=[],a.allowWhitespace(),a.matchString("]"))return{v:b};for(;c=a.read();){if(b.push(c.v),a.allowWhitespace(),a.matchString("]"))return{v:b};if(!a.matchString(","))return null;a.allowWhitespace()}return null}]}),function(a,b){var c=new e(a,{values:b});return c.result}}(qb,$,ab),Gb=function(a,b,c,d){var e,f=/^([a-zA-Z_$][a-zA-Z_$0-9]*)\(/;return e=a.extend({converters:[b]}),function(a){var b,g,h,i,j,k,l,m,n;if("string"==typeof a){if(g=f.exec(a))return b={m:g[1]},i="["+a.slice(b.m.length+1,-1)+"]",h=new e(i),b.a=c(h.result[0]),b;if(-1===a.indexOf(":"))return a.trim();a=[a]}if(b={},l=[],m=[],a){for(;a.length;)if(j=a.shift(),"string"==typeof j){if(k=j.indexOf(":"),-1!==k){k&&l.push(j.substr(0,k)),j.length>k+1&&(m[0]=j.substring(k+1));break}l.push(j)}else l.push(j);m=m.concat(a)}return l.length?m.length||"string"!=typeof l?(b={n:1===l.length&&"string"==typeof l[0]?l[0]:l},1===m.length&&"string"==typeof m[0]?(n=d("["+m[0]+"]"),b.a=n?n.value:m[0].trim()):b.d=m):b=l:b="",b}}(qb,ob,pb,Fb),Hb=function(a,b,c,d,e,f,g,h){function i(d){var e,f,i,k,m,u,v,w,x,y,z;if(e=d.pos,d.inside||d.inAttribute)return null;if(!d.matchString("<"))return null;if("/"===d.nextChar())return null;if(f={t:a.ELEMENT},d.includeLinePositions&&(f.p=d.getLinePos(e)),d.matchString("!")&&(f.y=1),f.e=d.matchPattern(n),!f.e)return null;for(o.test(d.nextChar())||d.error("Illegal tag name"),u=function(a,b){var c=b.n||b;r.test(c)&&(d.pos-=c.length,d.error("Cannot use reserved event names (change, reset, teardown, update, construct, config, init, render, unrender, detach, insert)")),f.v[a]=b},d.allowWhitespace();v=c(d)||g(d);)v.name?(k=s[v.name])?f[k]=h(v.value):(m=q.exec(v.name))?(f.v||(f.v={}),w=h(v.value),u(m[1],w)):d.sanitizeEventAttributes&&p.test(v.name)||(f.a||(f.a={}),f.a[v.name]=v.value||0):(f.m||(f.m=[]),f.m.push(v)),d.allowWhitespace();if(d.allowWhitespace(),d.matchString("/")&&(x=!0),!d.matchString(">"))return null;if(i=f.e.toLowerCase(),!x&&!b.test(f.e)){for(("script"===i||"style"===i)&&(d.inside=i),y=[];j(i,d.remaining())&&(z=d.read(l))&&z.t!==a.CLOSING&&z.t!==a.CLOSING_TAG;)y.push(z);y.length&&(f.f=y)}return d.inside=null,d.sanitizeElements&&-1!==d.sanitizeElements.indexOf(i)?t:f}function j(a,b){var c,d;return c=/^<([a-zA-Z][a-zA-Z0-9]*)/.exec(b),d=m[a],c&&d?!~d.indexOf(c[1].toLowerCase()):!0}var k,l,m,n=/^[a-zA-Z]{1,}:?[a-zA-Z0-9\-]*/,o=/^[\s\n\/>]/,p=/^on/,q=/^on-([a-zA-Z\\*\\.$_][a-zA-Z\\*\\.$_0-9\-]+)$/,r=/^(?:change|reset|teardown|update|construct|config|init|render|unrender|detach|insert)$/,s={"intro-outro":"t0",intro:"t1",outro:"t2",decorator:"o"},t={exclude:!0};return l=[c,d,i,e,f],m={li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul".split(" "),rt:["rt","rp"],rp:["rt","rp"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tfoot:["tbody"],tr:["tr","tbody"],td:["td","th","tr"],th:["td","th","tr"]},k=i}(S,zb,xb,yb,Cb,Db,Eb,Gb),Ib=function(){var a=/^[ \t\f\r\n]+/,b=/[ \t\f\r\n]+$/;return function(c,d,e){var f;d&&(f=c[0],"string"==typeof f&&(f=f.replace(a,""),f?c[0]=f:c.shift())),e&&(f=c[c.length-1],"string"==typeof f&&(f=f.replace(b,""),f?c[c.length-1]=f:c.pop()))}}(),Jb=function(a){function b(a){return"string"==typeof a}function c(b){return b.t===a.COMMENT||b.t===a.DELIMCHANGE}function d(b){return(b.t===a.SECTION||b.t===a.INVERTED)&&b.f}var e,f=/^\s*\r?\n/,g=/\r?\n\s*$/;return e=function(a){var e,h,i,j,k;for(e=1;e<a.length;e+=1)h=a[e],i=a[e-1],j=a[e-2],b(h)&&c(i)&&b(j)&&g.test(j)&&f.test(h)&&(a[e-2]=j.replace(g,"\n"),a[e]=h.replace(f,"")),d(h)&&b(i)&&g.test(i)&&b(h.f[0])&&f.test(h.f[0])&&(a[e-1]=i.replace(g,"\n"),h.f[0]=h.f[0].replace(f,"")),b(h)&&d(i)&&(k=i.f[i.f.length-1],b(k)&&g.test(k)&&f.test(h)&&(i.f[i.f.length-1]=k.replace(g,"\n"),a[e]=h.replace(f,"")));return a}}(S),Kb=function(){var a=/[-/\\^$*+?.()|[\]{}]/g;return function(b){return b.replace(a,"\\$&")}}(),Lb=function(a,b,c,d,e,f,g,h,i){function j(b,c,d,e,f,i){var k,l,m,n,s,t,u,v,w;for(h(b),k=b.length;k--;)l=b[k],l.exclude?b.splice(k,1):c&&l.t===a.COMMENT&&b.splice(k,1);for(g(b,e,f),k=b.length;k--;)if(l=b[k],l.f&&(s=d||l.t===a.ELEMENT&&p.test(l.e),s||(m=b[k-1],n=b[k+1],(!m||"string"==typeof m&&r.test(m))&&(t=!0),(!n||"string"==typeof n&&q.test(n))&&(u=!0)),j(l.f,c,s,t,u,i)),l.l&&(j(l.l,c,d,t,u,i),i&&(v={t:4,n:a.SECTION_UNLESS,f:l.l},l.r&&(v.r=l.r),l.x&&(v.x=l.x),l.rx&&(v.rx=l.rx),b.splice(k+1,0,v),delete l.l)),l.a)for(w in l.a)l.a.hasOwnProperty(w)&&"string"!=typeof l.a[w]&&j(l.a[w],c,d,t,u,i);for(k=b.length;k--;)"string"==typeof b[k]&&("string"==typeof b[k+1]&&(b[k]=b[k]+b[k+1],b.splice(k+1,1)),d||(b[k]=b[k].replace(o," ")),""===b[k]&&b.splice(k,1))}function k(a){var b=arguments[1];void 0===b&&(b=a),b.delimiters=a.delimiters||["{{","}}"],b.tripleDelimiters=a.tripleDelimiters||["{{{","}}}"],b.staticDelimiters=a.staticDelimiters||["[[","]]"],b.staticTripleDelimiters=a.staticTripleDelimiters||["[[[","]]]"]}var l,m,n,o=/[ \t\f\r\n]+/g,p=/^(?:pre|script|style|textarea)$/i,q=/^\s+/,r=/\s+$/;return m=b.extend({init:function(a,b){k(b,this),this.sectionDepth=0,this.interpolate={script:!b.interpolate||b.interpolate.script!==!1,style:!b.interpolate||b.interpolate.style!==!1},b.sanitize===!0&&(b.sanitize={elements:"applet base basefont body frame frameset head html isindex link meta noframes noscript object param script style title".split(" "),eventAttributes:!0}),this.sanitizeElements=b.sanitize&&b.sanitize.elements,this.sanitizeEventAttributes=b.sanitize&&b.sanitize.eventAttributes,this.includeLinePositions=b.includeLinePositions},postProcess:function(a,b){return this.sectionDepth>0&&this.error("A section was left open"),j(a,b.stripComments!==!1,b.preserveWhitespace,!b.preserveWhitespace,!b.preserveWhitespace,b.rewriteElse!==!1),a},converters:[c,d,e,f]}),n=function(a){var b=arguments[1];void 0===b&&(b={});var c,d,e,f,g,h,j,l;if(k(b),j=new RegExp("<!--\\s*"+i(b.delimiters[0])+"\\s*>\\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\\s*"+i(b.delimiters[1])+"\\s*-->"),l=new RegExp("<!--\\s*"+i(b.delimiters[0])+"\\s*\\/\\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\\s*"+i(b.delimiters[1])+"\\s*-->"),c={v:1},j.test(a)){for(d=a,a="";g=j.exec(d);){if(f=g[1],a+=d.substr(0,g.index),d=d.substring(g.index+g[0].length),h=l.exec(d),!h||h[1]!==f)throw new Error('Inline partials must have a closing delimiter, and cannot be nested. Expected closing for "'+f+'", but '+(h?'instead found "'+h[1]+'"':" no closing found"));(e||(e={}))[f]=new m(d.substr(0,h.index),b).result,d=d.substring(h.index+h[0].length)}a+=d,c.p=e}return c.t=new m(a,b).result,c},l=n}(S,qb,xb,yb,Hb,Cb,Ib,Jb,Kb),Mb=function(){return function(a,b){var c=a.map(b);return a.forEach(function(a,b){c[a]=c[b]}),c}}(vb),Nb=function(a){var b,c;return b=["preserveWhitespace","sanitize","stripComments","delimiters","tripleDelimiters","interpolate"],c=a(b,function(a){return a})}(Mb),Ob=function(a,b,c,d,e){function f(a){var b=d(l);return b.parse=function(b,c){return g(b,c||a)},b}function g(b,d){if(!c)throw new Error(a.missingParser);return c(b,d||this.options)}function h(a,c){var d;if(!b){if(c&&c.noThrow)return;throw new Error("Cannot retrieve template #"+a+" as Ractive is not running in a browser.")}if(i(a)&&(a=a.substring(1)),!(d=document.getElementById(a))){if(c&&c.noThrow)return;throw new Error("Could not find template element with id #"+a)}if("SCRIPT"!==d.tagName.toUpperCase()){if(c&&c.noThrow)return;throw new Error("Template element with id #"+a+", must be a <script> element")}return d.innerHTML}function i(a){return a&&"#"===a.charAt(0)}function j(a){return!("string"==typeof a)}function k(a){return a.defaults&&(a=a.defaults),e.reduce(function(b,c){return b[c]=a[c],b},{})}var l={parse:g,fromId:h,isHashedId:i,isParsed:j,getParseOptions:k,createHelper:f};return l}(n,E,Lb,T,Nb),Pb=function(a,b){function c(a){var b,c=a._config.template;if(c&&c.fn)return b=d(a,c.fn),b!==c.result?(c.result=b,b=e(b,a)):void 0}function d(b,c){var d=a.createHelper(a.getParseOptions(b));return c.call(b,b.data,d)}function e(c,d){if("string"==typeof c)"#"===c[0]&&(c=a.fromId(c)),c=b(c,a.getParseOptions(d));else if(1!==c.v)throw new Error("Mismatched template version! Please ensure you are using the latest version of Ractive.js in your build process as well as in your app");return c}function f(a,b,c){if(b)for(var d in b)(c||!a.hasOwnProperty(d))&&(a[d]=b[d])}var g={name:"template",extend:function(a,b,c){var d;"template"in c&&(d=c.template,b.template="function"==typeof d?d:e(d,b))},init:function(a,b,c){var g,h;g="template"in c?c.template:a.prototype.template,"function"==typeof g&&(h=g,g=d(b,h),b._config.template={fn:h,result:g}),g=e(g,b),b.template=g.t,g.p&&f(b.partials,g.p)},reset:function(a){var b,d=c(a);return d?(b=e(d,a),a.template=b.t,f(a.partials,b.p,!0),!0):void 0}};return g}(Ob,Lb),Qb=function(a){function b(a,b){this.name=a,this.useDefaults=b}function c(a,b){var d,e;return(d=b(a))?d:!a.isolated&&(e=a._parent)?c(e,b):void 0}return b.prototype={constructor:b,extend:function(a,b,c){this.configure(this.useDefaults?a.defaults:a,this.useDefaults?b:b.constructor,c)},init:function(a,b,c){this.configure(this.useDefaults?a.defaults:a,b,c)},configure:function(b,c,d){var e,f=this.name,g=d[f];e=a(b[f]);for(var h in g)e[h]=g[h];c[f]=e},reset:function(a){var b=a[this.name],c=!1;return Object.keys(b).forEach(function(a){var d=b[a];d._fn&&(d._fn.isOwner?b[a]=d._fn:delete b[a],c=!0)}),c},findOwner:function(a,b){return a[this.name].hasOwnProperty(b)?a:this.findConstructor(a.constructor,b)},findConstructor:function(a,b){return a?a[this.name].hasOwnProperty(b)?a:this.findConstructor(a._parent,b):void 0},find:function(a,b){var d=this;return c(a,function(a){return a[d.name][b]})},findInstance:function(a,b){var d=this;return c(a,function(a){return a[d.name][b]?a:void 0})}},b}(T,vb),Rb=function(a,b){var c=["adaptors","components","computed","decorators","easing","events","interpolators","partials","transitions"],d=a(c,function(a){return new b(a,"computed"===a)});return d}(Mb,Qb),Sb=function(){},Tb=function(a){function b(b,c){var d;if(c in b){var e=b[c];d="function"==typeof e?e:function(){return e}}else d=a;return d}var c;return c=function(a,c,d){if(!/_super/.test(d))return d;var e=function(){var a,f=b(e._parent,c),g="_super"in this,h=this._super;return this._super=f,a=d.apply(this,arguments),g?this._super=h:delete this._super,a};return e._parent=a,e._method=d,e}}(Sb),Ub=function(a,b){function c(b,c,e){if(c in b){if(e in b)throw new Error(d(c,e,!0));a(d(c,e)),b[e]=b[c]}}function d(a,b,c){return"options."+a+" has been deprecated in favour of options."+b+"."+(c?" You cannot specify both options, please use options."+b+".":"")}function e(a){c(a,"eventDefinitions","events")}function f(a){b(a.adaptors)&&c(a,"adaptors","adapt")}return function(a){c(a,"beforeInit","onconstruct"),c(a,"init","onrender"),c(a,"complete","oncomplete"),e(a),f(a)}}(m,h),Vb=function(a,b,c,d,e,f,g,h){function i(a,b,c,d,e){m[b][a](c,d,e)}function j(a){return a in c&&!(a in o.parseOptions)&&!(a in m)}function k(a,b,c,d){h(d),i(a,"data",b,c,d),o.parseOptions.forEach(function(a){a in d&&(c[a]=d[a])});for(var e in d)if(j(e)){var f=d[e];c[e]="function"==typeof f?g(b.prototype,e,f):f}o.registries.forEach(function(e){e[a](b,c,d)}),i(a,"template",b,c,d),i(a,"css",b,c,d),l(b.prototype,c,d)}function l(a,b,c){for(var d in c)if(!(d in p)&&c.hasOwnProperty(d)){var e=c[d];"function"==typeof e&&(e=g(a,d,e)),b[d]=e}}var m,n,o,p;p={_parent:!0,_component:!0},m={data:b,template:d,css:a},n=Object.keys(c).filter(function(a){return!f[a]&&!m[a]&&!e[a]}),o=[].concat(m.data,e,n,f,m.template,m.css);for(var q in m)o[q]=m[q];return o.keys=Object.keys(c).concat(f.map(function(a){return a.name})).concat(["css"]),o.keys.forEach(function(a){return p[a]=!0}),o.parseOptions=e,o.registries=f,o.extend=function(a,b,c){k("extend",a,b,c)},o.init=function(a,b,c){k("init",a,b,c)},o.reset=function(a){return o.filter(function(b){return b.reset&&b.reset(a)}).map(function(a){return a.name})},o.getConstructTarget=function(a,b){return b.onconstruct?{onconstruct:g(a,"onconstruct",b.onconstruct).bind(a),fire:a.fire.bind(a)}:a},o}(P,R,d,Pb,Nb,Rb,Tb,Ub),Wb=function(a,b,c,d){function e(a){return function(){return a}}var f,g=function(a,f,g,h){if(a===f)return e(f);if(h){var i=d.registries.interpolators.find(g,h);if(i)return i(a,f)||e(f);b('Missing "'+h+'" interpolator. You may need to download a plugin from [TODO]')}return c.number(a,f)||c.array(a,f)||c.object(a,f)||e(f)};return a.interpolate=g,f=g}(f,m,k,Vb),Xb=function(a,b,c){var d=function(a){var b;this.startTime=Date.now();for(b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);this.interpolator=c(this.from,this.to,this.root,this.interpolator),this.running=!0,this.tick()};return d.prototype={tick:function(){var c,d,e,f,g,h;return h=this.keypath,this.running?(f=Date.now(),c=f-this.startTime,c>=this.duration?(null!==h&&(b.start(this.root),this.root.viewmodel.set(h,this.to),b.end()),this.step&&this.step(1,this.to),this.complete(this.to),g=this.root._animations.indexOf(this),-1===g&&a("Animation was not found"),this.root._animations.splice(g,1),this.running=!1,!1):(d=this.easing?this.easing(c/this.duration):c/this.duration,null!==h&&(e=this.interpolator(d),b.start(this.root),this.root.viewmodel.set(h,e),b.end()),this.step&&this.step(d,e),!0)):!1},stop:function(){var b;this.running=!1,b=this.root._animations.indexOf(this),-1===b&&a("Animation was not found"),this.root._animations.splice(b,1)}},d}(m,y,Wb),Yb=function(a,b,c,d,e){function f(b,f,g,h){var j,k,l,m;return f&&(f=c(f)),null!==f&&(m=b.viewmodel.get(f)),d.abort(f,b),a(m,g)?(h.complete&&h.complete(h.to),i):(h.easing&&(j="function"==typeof h.easing?h.easing:b.easing[h.easing],"function"!=typeof j&&(j=null)),k=void 0===h.duration?400:h.duration,l=new e({keypath:f,from:m,to:g,root:b,duration:k,easing:j,interpolator:h.interpolator,step:h.step,complete:h.complete}),d.add(l),b._animations.push(l),l)}var g,h=function(){},i={stop:h};return g=function(a,c,d){var e,g,i,j,k,l,m,n,o,p,q,r,s,t;if(e=new b(function(a){g=a}),"object"==typeof a){d=c||{},l=d.easing,m=d.duration,k=[],n=d.step,o=d.complete,(n||o)&&(q={},d.step=null,d.complete=null,p=function(a){return function(b,c){q[a]=c}});for(i in a)a.hasOwnProperty(i)&&((n||o)&&(r=p(i),d={easing:l,duration:m},n&&(d.step=r)),d.complete=o?r:h,k.push(f(this,i,a[i],d)));return t={easing:l,duration:m},n&&(t.step=function(a){n(a,q)}),o&&e.then(function(a){o(a,q)}),t.complete=g,s=f(this,null,null,t),k.push(s),e.stop=function(){for(var a;a=k.pop();)a.stop();s&&s.stop()},e}return d=d||{},d.complete&&e.then(d.complete),d.complete=g,j=f(this,a,c,d),e.stop=function(){j.stop()},e}}(u,r,J,N,Xb),Zb=function(a,b){var c=new a("detach");return function(){return this.detached?this.detached:(this.el&&b(this.el.__ractive_instances__,this),this.detached=this.fragment.detach(),c.fire(this),this.detached)}}(p,q),$b=function(a){return this.el?this.fragment.find(a):null},_b=function(a,b,c){var d,e,f,g,h,i,j,k;if(a){for(e=c("div"),f=["matches","matchesSelector"],k=function(a){return function(b,c){return b[a](c)}},i=f.length;i--&&!d;)if(g=f[i],e[g])d=k(g);else for(j=b.length;j--;)if(h=b[i]+g.substr(0,1).toUpperCase()+g.substring(1),e[h]){d=k(h);break}d||(d=function(a,b){var c,d,f;for(d=a.parentNode,d||(e.innerHTML="",d=e,a=a.cloneNode(),e.appendChild(a)),c=d.querySelectorAll(b),f=c.length;f--;)if(c[f]===a)return!0;return!1})}else d=null;return d}(E,K,D),ac=function(a){return function(b,c){var d=this._isComponentQuery?!this.selector||b.name===this.selector:a(b.node,this.selector);return d?(this.push(b.node||b.instance),c||this._makeDirty(),!0):void 0}}(_b),bc=function(){var a,b,c;a=this._root[this._isComponentQuery?"liveComponentQueries":"liveQueries"],b=this.selector,c=a.indexOf(b),-1!==c&&(a.splice(c,1),a[b]=null)},cc=function(){function a(a){var b;return(b=a.parentFragment)?b.owner:a.component&&(b=a.component.parentFragment)?b.owner:void 0}function b(b){var c,d;for(c=[b],d=a(b);d;)c.push(d),d=a(d);return c}var c;return c=function(a,c){var d,e,f,g,h,i,j,k,l,m;for(d=b(a.component||a._ractive.proxy),e=b(c.component||c._ractive.proxy),f=d[d.length-1],g=e[e.length-1];f&&f===g;)d.pop(),e.pop(),h=f,f=d[d.length-1],g=e[e.length-1];if(f=f.component||f,g=g.component||g,l=f.parentFragment,m=g.parentFragment,l===m)return i=l.items.indexOf(f),j=m.items.indexOf(g),i-j||d.length-e.length;if(k=h.fragments)return i=k.indexOf(l),j=k.indexOf(m),i-j||d.length-e.length;throw new Error("An unexpected condition was met while comparing the position of two components. Please file an issue at https://github.com/RactiveJS/Ractive/issues - thanks!")}}(),dc=function(a){return function(b,c){var d;return b.compareDocumentPosition?(d=b.compareDocumentPosition(c),2&d?1:-1):a(b,c)}}(cc),ec=function(a,b){return function(){this.sort(this._isComponentQuery?b:a),this._dirty=!1}}(dc,cc),fc=function(a){return function(){var b=this;this._dirty||(this._dirty=!0,a.scheduleTask(function(){b._sort()}))}}(y),gc=function(a){var b=this.indexOf(this._isComponentQuery?a.instance:a);-1!==b&&this.splice(b,1)},hc=function(a,b,c,d,e,f){return function(g,h,i,j){var k=[];return a(k,{selector:{value:h},live:{value:i},_isComponentQuery:{value:j},_test:{value:b}}),i?(a(k,{cancel:{value:c},_root:{value:g},_sort:{value:d},_makeDirty:{value:e},_remove:{value:f},_dirty:{value:!1,writable:!0}}),k):k}}(G,ac,bc,ec,fc,gc),ic=function(a){return function(b,c){var d,e;return this.el?(c=c||{},d=this._liveQueries,(e=d[b])?c&&c.live?e:e.slice():(e=a(this,b,!!c.live,!1),e.live&&(d.push(b),d["_"+b]=e),this.fragment.findAll(b,e),e)):[]}}(hc),jc=function(a){return function(b,c){var d,e;return c=c||{},d=this._liveComponentQueries,(e=d[b])?c&&c.live?e:e.slice():(e=a(this,b,!!c.live,!0),e.live&&(d.push(b),d["_"+b]=e),this.fragment.findAllComponents(b,e),e)}}(hc),kc=function(a){return this.fragment.findComponent(a)},lc=function(){function a(a){var b,d,e,f,g,h="";if(!c[a]){for(e=[];h.length<a;)h+=1;for(b=parseInt(h,2),f=function(a){return"1"===a},g=0;b>=g;g+=1){for(d=g.toString(2);d.length<a;)d="0"+d;e[g]=Array.prototype.map.call(d,f)}c[a]=e}return c[a]}var b,c={};return b=function(b){var d,e,f,g,h,i;for(d=b.split("."),(e=c[d.length])||(e=a(d.length)),h=[],f=function(a,b){return a?"*":d[b]},g=e.length;g--;)i=e[g].map(f).join("."),h.hasOwnProperty(i)||(h.push(i),h[i]=!0);return h}}(),mc=function(a){function b(d,e,f,g){var h=arguments[4];void 0===h&&(h=!1);var i,j,k=!0;for(f&&(d.event=f),j=e.length;j>=0;j--)i=d._subs[e[j]],i&&(k=c(d,i,f,g)&&k);if(f&&delete d.event,d._parent&&k){if(h&&d.component){var l=d.component.name+"."+e[e.length-1];e=a(l),f&&(f.component=d)}b(d._parent,e,f,g)}}function c(a,b,c,d){var e=null,f=!1;c&&!c._noArg&&(d=[c].concat(d));for(var g=0,h=b.length;h>g;g+=1)b[g].apply(a,d)===!1&&(f=!0);return c&&!c._noArg&&f&&(e=c.original)&&(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()),!f}var d;return d=function(c,d){var e=arguments[2];if(void 0===e&&(e={}),d){e.event?e.event.name=d:e.event={name:d,context:c.data,keypath:"",_noArg:!0};var f=a(d);b(c,f,e.event,e.args,!0)}}}(lc),nc=function(a){return function(b){var c={args:Array.prototype.slice.call(arguments,1)};a(this,b,c)}}(mc),oc=function(a,b){var c={capture:!0};return function(d){var e;return d=a(d),e=this.viewmodel.get(d,c),void 0===e&&this._parent&&!this.isolated&&b(this,d,this.fragment)&&(e=this.viewmodel.get(d)),e}}(J,w),pc=function(a){var b;if(a&&"boolean"!=typeof a)return"undefined"!=typeof window&&document&&a?a.nodeType?a:"string"==typeof a&&(b=document.getElementById(a),!b&&document.querySelector&&(b=document.querySelector(a)),b&&b.nodeType)?b:a[0]&&a[0].nodeType?a[0]:null:null},qc=function(a,b){function c(a){e.fire(a),a.findAllComponents("*").forEach(function(a){c(a.instance)})}var d,e=new a("insert");return d=function(a,d){if(!this.fragment.rendered)throw new Error("The API has changed - you must call `ractive.render(target[, anchor])` to render your Ractive instance. Once rendered you can use `ractive.insert()`.");if(a=b(a),d=b(d)||null,!a)throw new Error("You must specify a valid target to insert into");a.insertBefore(this.detach(),d),this.el=a,(a.__ractive_instances__||(a.__ractive_instances__=[])).push(this),this.detached=null,c(this)}}(p,pc),rc=function(a,b,c){return function(d,e,f){var g,h;return d=c(d),g=this.viewmodel.get(d),b(g)&&b(e)?(h=a.start(this,!0),this.viewmodel.merge(d,g,e,f),a.end(),f&&f.complete&&h.then(f.complete),h):this.set(d,e,f&&f.complete)}}(y,h,J),sc=function(a,b){var c=function(a,b,c,d){this.root=a,this.keypath=b,this.callback=c,this.defer=d.defer,this.context=d&&d.context?d.context:a};return c.prototype={init:function(a){this.value=this.root.get(this.keypath),a!==!1?this.update():this.oldValue=this.value},setValue:function(c){var d=this;b(c,this.value)||(this.value=c,this.defer&&this.ready?a.scheduleTask(function(){return d.update()}):this.update())},update:function(){this.updating||(this.updating=!0,this.callback.call(this.context,this.value,this.oldValue,this.keypath),this.oldValue=this.value,this.updating=!1)}},c}(y,u),tc=function(a){return function(b,c){function d(c,d){var e,f,g;e=b.viewmodel.wrapped[d]?b.viewmodel.wrapped[d].get():b.get(d);for(f in e)!e.hasOwnProperty(f)||"_ractive"===f&&a(e)||(g=d?d+"."+f:f,c.push(g));return c}function e(a){return function(b){return b?b+"."+a:a}}var f,g,h;for(f=c.split("."),h=[""];g=f.shift();)"*"===g?h=h.reduce(d,[]):""===h[0]?h[0]=g:h=h.map(e(g));return h}}(h),uc=function(a){return function(b,c){var d,e;return d=a(b,c),e={},d.forEach(function(a){e[a]=b.get(a)}),e}}(tc),vc=function(a,b,c){var d,e=/\*/,f=Array.prototype.slice;return d=function(a,b,c,d){this.root=a,this.callback=c,this.defer=d.defer,this.keypath=b,this.regex=new RegExp("^"+b.replace(/\./g,"\\.").replace(/\*/g,"([^\\.]+)")+"$"),this.values={},this.defer&&(this.proxies=[]),this.context=d&&d.context?d.context:a},d.prototype={init:function(a){var b,d;if(b=c(this.root,this.keypath),a!==!1)for(d in b)b.hasOwnProperty(d)&&this.update(d);else this.values=b},update:function(b){var d,f=this;if(e.test(b)){d=c(this.root,b);for(b in d)d.hasOwnProperty(b)&&this.update(b)}else if(!this.root.viewmodel.implicitChanges[b])return this.defer&&this.ready?void a.scheduleTask(function(){return f.getProxy(b).update()}):void this.reallyUpdate(b)},reallyUpdate:function(a){var c,d,e;return c=this.root.viewmodel.get(a),this.updating?void(this.values[a]=c):(this.updating=!0,b(c,this.values[a])&&this.ready||(d=f.call(this.regex.exec(a),1),e=[c,this.values[a],a].concat(d),this.callback.apply(this.context,e),this.values[a]=c),void(this.updating=!1))},getProxy:function(a){var b=this;return this.proxies[a]||(this.proxies[a]={update:function(){b.reallyUpdate(a)}}),this.proxies[a]}},d}(y,u,uc),wc=function(a,b,c){var d=/\*/,e={};return function(f,g,h,i){var j,k,l;return g=a(g),i=i||e,d.test(g)?(j=new c(f,g,h,i),f.viewmodel.patternObservers.push(j),k=!0):j=new b(f,g,h,i),f.viewmodel.register(g,j,k?"patternObservers":"observers"),j.init(i.init),j.ready=!0,{cancel:function(){var a;l||(k?(a=f.viewmodel.patternObservers.indexOf(j),f.viewmodel.patternObservers.splice(a,1),f.viewmodel.unregister(g,j,"patternObservers")):f.viewmodel.unregister(g,j,"observers"),l=!0)
|
||
}}}}(J,sc,vc),xc=function(a,b){return function(c,d,e){var f,g,h,i;if(a(c)){e=d,g=c,f=[];for(c in g)g.hasOwnProperty(c)&&(d=g[c],f.push(this.observe(c,d,e)));return{cancel:function(){for(;f.length;)f.pop().cancel()}}}if("function"==typeof c)return e=d,d=c,c="",b(this,c,d,e);if(h=c.split(" "),1===h.length)return b(this,c,d,e);for(f=[],i=h.length;i--;)c=h[i],c&&f.push(b(this,c,d,e));return{cancel:function(){for(;f.length;)f.pop().cancel()}}}}(i,wc),yc=function(a){return a.trim()},zc=function(a){return""!==a},Ac=function(a,b){return function(c,d){var e,f=this;if(c)e=c.split(" ").map(a).filter(b),e.forEach(function(a){var b,c;(b=f._subs[a])&&(d?(c=b.indexOf(d),-1!==c&&b.splice(c,1)):f._subs[a]=[])});else for(c in this._subs)delete this._subs[c];return this}}(yc,zc),Bc=function(a,b){return function(c,d){var e,f,g,h=this,i=this;if("object"==typeof c){e=[];for(f in c)c.hasOwnProperty(f)&&e.push(this.on(f,c[f]));return{cancel:function(){for(var a;a=e.pop();)a.cancel()}}}return g=c.split(" ").map(a).filter(b),g.forEach(function(a){(h._subs[a]||(h._subs[a]=[])).push(d)}),{cancel:function(){i.off(c,d)}}}}(yc,zc),Cc=function(){function a(a,b,c){switch(b){case"splice":for(void 0!==c[0]&&c[0]<0&&(c[0]=a.length+Math.max(c[0],-a.length));c.length<2;)c.push(0);return c[1]=Math.min(c[1],a.length-c[0]),c;case"sort":case"reverse":return null;case"pop":return a.length?[a.length-1,1]:null;case"push":return[a.length,0].concat(c);case"shift":return[0,1];case"unshift":return[0,0].concat(c)}}var b;return b=function(b,c,d){var e,f,g,h,i,j,k=[];if(e=a(b,c,d),!e)return null;for(f=b.length,i=e.length-2-e[1],g=Math.min(f,e[0]),h=g+e[1],j=0;g>j;j+=1)k.push(j);for(;h>j;j+=1)k.push(-1);for(;f>j;j+=1)k.push(j+i);return k}}(),Dc=function(a,b,c){var d=Array.prototype;return function(e){return function(f){var g,h,i,j,k=Array.prototype.slice,l=k.call(arguments,1),m=[];if(g=this.get(f),h=g.length,!a(g))throw new Error("Called ractive."+e+"('"+f+"'), but '"+f+"' does not refer to an array");return m=c(g,e,l),j=d[e].apply(g,l),i=b.start(this,!0).then(function(){return j}),m?this.viewmodel.smartUpdate(f,g,m):this.viewmodel.mark(f),b.end(),i}}}(h,y,Cc),Ec=function(a){return a("pop")}(Dc),Fc=function(a){return a("push")}(Dc),Gc=function(a,b,c){var d,e,f,g,h,i,j,k="/* Ractive.js component styles */\n",l={},m=[];return b?(a.push(function(){f=a.runloop}),g=document.createElement("style"),g.type="text/css",h=document.getElementsByTagName("head")[0],j=!1,i=g.styleSheet,e=function(){var a;m.length?(a=k+m.join(" "),i?i.cssText=a:g.innerHTML=a,j||(h.appendChild(g),j=!0)):j&&(h.removeChild(g),j=!1)},d={add:function(a){a.css&&(l[a._guid]||(l[a._guid]=0,m.push(a.css),e()),l[a._guid]+=1)},remove:function(a){a.css&&(l[a._guid]-=1,l[a._guid]||(c(m,a.css),f.scheduleTask(e)))}}):d=null,d}(f,E,q),Hc=function(a,b,c,d){var e=new b("render"),f=new b("complete");return function(b,g){var h,i,j,k=this;if(j=this.transitionsEnabled,this.noIntro&&(this.transitionsEnabled=!1),h=d.start(this,!0),d.scheduleTask(function(){return e.fire(k)},!0),this.fragment.rendered)throw new Error("You cannot call ractive.render() on an already rendered instance! Call ractive.unrender() first");return b=c(b)||this.el,g=c(g)||this.anchor,this.el=b,this.anchor=g,this.constructor.css&&a.add(this.constructor),b&&((i=b.__ractive_instances__)?i.push(this):b.__ractive_instances__=[this],g?b.insertBefore(this.fragment.render(),g):b.appendChild(this.fragment.render())),d.end(),this.transitionsEnabled=j,h.then(function(){return f.fire(k)}),h}}(Gc,p,pc,y),Ic=function(){this.dirtyValue=this.dirtyArgs=!0,this.bound&&"function"==typeof this.owner.bubble&&this.owner.bubble()},Jc=function(){var a;return 1===this.items.length?this.items[0].detach():(a=document.createDocumentFragment(),this.items.forEach(function(b){var c=b.detach();c&&a.appendChild(c)}),a)},Kc=function(a){var b,c,d,e;if(this.items){for(c=this.items.length,b=0;c>b;b+=1)if(d=this.items[b],d.find&&(e=d.find(a)))return e;return null}},Lc=function(a,b){var c,d,e;if(this.items)for(d=this.items.length,c=0;d>c;c+=1)e=this.items[c],e.findAll&&e.findAll(a,b);return b},Mc=function(a,b){var c,d,e;if(this.items)for(d=this.items.length,c=0;d>c;c+=1)e=this.items[c],e.findAllComponents&&e.findAllComponents(a,b);return b},Nc=function(a){var b,c,d,e;if(this.items){for(b=this.items.length,c=0;b>c;c+=1)if(d=this.items[c],d.findComponent&&(e=d.findComponent(a)))return e;return null}},Oc=function(a){var b,c=a.index;return b=this.items[c+1]?this.items[c+1].firstNode():this.owner===this.root?this.owner.component?this.owner.component.findNextNode():null:this.owner.findNextNode(this)},Pc=function(){return this.items&&this.items[0]?this.items[0].firstNode():null},Qc=function(){var a=this;do if(a.pElement)return a.pElement.node;while(a=a.parent);return this.root.detached||this.root.el},Rc=function(a){function b(a,c,d,e){return e=e||0,a.map(function(a){var f,g,h;return a.text?a.text:a.fragments?a.fragments.map(function(a){return b(a.items,c,d,e)}).join(""):(f=d+"-"+e++,h=(g=a.root.viewmodel.wrapped[a.keypath])?g.value:a.getValue(),c[f]=h,"${"+f+"}")}).join("")}var c,d={};return c=function(){var c=arguments[0];void 0===c&&(c=d);var e,f,g,h,i,j,k;return e=c.args,i=e?"argsList":"value",j=e?"dirtyArgs":"dirtyValue",this[j]&&(g=b(this.items,f={},this.root._guid),h=a(e?"["+g+"]":g,f),k=h?h.value:e?[this.toString()]:this.toString(),this[i]=k,this[j]=!1),this[i]}}(Fb),Sc=function(){var a=/</g,b=/>/g,c=/&/g;return function(d){return d.replace(c,"&").replace(a,"<").replace(b,">")}}(),Tc=function(a){return a&&a.parentNode&&a.parentNode.removeChild(a),a},Uc=function(a){return function(){return a(this.node)}}(Tc),Vc=function(a,b,c){var d=function(b){this.type=a.TEXT,this.text=b.template};return d.prototype={detach:c,firstNode:function(){return this.node},render:function(){return this.node||(this.node=document.createTextNode(this.text)),this.node},toString:function(a){return a?b(this.text):this.text},unrender:function(a){return a?this.detach():void 0}},d}(S,Sc,Uc),Wc=function(){this.registered&&this.root.viewmodel.unregister(this.keypath,this),this.resolver&&this.resolver.unbind()},Xc=function(){return this.value},Yc=function(a,b){return a&&b&&a.substr(0,b.length+1)===b+"."},Zc=function(a){return function(b,c,d){return b===c?void 0!==d?d:null:a(b,c)?null===d?d:b.replace(c+".",d+"."):void 0}}(Yc),$c=function(a,b,c){var d=function(c,d,e){var f;this.ref=d,this.resolved=!1,this.root=c.root,this.parentFragment=c.parentFragment,this.callback=e,f=b(c.root,d,c.parentFragment),void 0!==f?this.resolve(f):a.addUnresolved(this)};return d.prototype={resolve:function(a){this.resolved=!0,this.keypath=a,this.callback(a)},forceResolution:function(){this.resolve(this.ref)},rebind:function(a,b,d,e){var f;void 0!==this.keypath&&(f=c(this.keypath,d,e),void 0!==f&&this.resolve(f))},unbind:function(){this.resolved||a.removeUnresolved(this)}},d}(y,w,Zc),_c=function(){var a=function(a,b,c){this.parentFragment=a.parentFragment,this.ref=b,this.callback=c,this.rebind()};return a.prototype={rebind:function(){var a=this.ref,b=this.parentFragment;if("@keypath"===a)for(;b;){if(b.context)return this.callback("@"+b.context);b=b.parent}if("@index"===a||"@key"===a)for(;b;){if(void 0!==b.index)return this.callback("@"+b.index);b=b.parent}throw new Error('Unknown special reference "'+a+'" - valid references are @index, @key and @keypath')},unbind:function(){}},a}(),ad=function(){var a=function(a,b,c){this.parentFragment=a.parentFragment,this.ref=b,this.callback=c,this.rebind()};return a.prototype={rebind:function(){var a=this.ref,b=this.parentFragment.indexRefs,c=b[a];void 0!==c&&this.callback("@"+c)},unbind:function(){}},a}(),bd=function(a,b,c){return function(d,e,f){var g,h;return"@"===e.charAt(0)?new b(d,e,f):(g=d.parentFragment.indexRefs,g&&void 0!==(h=g[e])?new c(d,e,f):new a(d,e,f))}}($c,_c,ad),cd=function(){var a={};return function(b,c){var d,e;if(a[b])return a[b];for(e=[];c--;)e[c]="_"+c;return d=new Function(e.join(","),"return("+b+")"),a[b]=d,d}}(),dd=function(a,b,c,d){function e(a){return a.call()}function f(a,c){return a.replace(/_([0-9]+)/g,function(a,d){var e,f;return e=c[d],void 0===e?"undefined":"@"===e[0]?(f=e.slice(1),b(f)?f:'"'+f+'"'):e})}function g(a){return"${"+a.replace(/[\.\[\]]/g,"-")+"}"}function h(a){return void 0!==a&&"@"!==a[0]}function i(b,c){var d,e,f;if(b._noWrap)return b;if(e="__ractive_"+c._guid,d=b[e])return d;if(/this/.test(b.toString())){a(b,e,{value:l.call(b,c)});for(f in b)b.hasOwnProperty(f)&&(b[e][f]=b[f]);return b[e]}return a(b,"__ractive_nowrap",{value:b}),b.__ractive_nowrap}var j,k,l=Function.prototype.bind;return k=function(a,b,d,e){var f,g,h=this;f=a.root,h.root=f,h.parentFragment=b,h.callback=e,h.owner=a,h.str=d.s,h.keypaths=[],g=b.indexRefs,h.pending=d.r.length,h.refResolvers=d.r.map(function(a,b){return c(h,a,function(a){h.resolve(b,a)})}),h.ready=!0,h.bubble()},k.prototype={bubble:function(){this.ready&&(this.uniqueString=f(this.str,this.keypaths),this.keypath=g(this.uniqueString),this.createEvaluator(),this.callback(this.keypath))},unbind:function(){for(var a;a=this.refResolvers.pop();)a.unbind()},resolve:function(a,b){this.keypaths[a]=b,this.bubble()},createEvaluator:function(){var a,c,f,g,j=this,k=this;a=this.root.viewmodel.computations[this.keypath],a?this.root.viewmodel.mark(this.keypath):(g=d(this.str,this.refResolvers.length),c=this.keypaths.map(function(a){var c;return"undefined"===a?function(){return void 0}:"@"===a[0]?(c=a.slice(1),b(c)?function(){return+c}:function(){return c}):function(){var b=j.root.viewmodel.get(a);return"function"==typeof b&&(b=i(b,k.root)),b}}),f={deps:this.keypaths.filter(h),get:function(){var a=c.map(e);return g.apply(null,a)}},a=this.root.viewmodel.compute(this.keypath,f))},rebind:function(a,b,c,d){this.refResolvers.forEach(function(e){return e.rebind(a,b,c,d)})}},j=k}(F,j,bd,cd,vb),ed=function(a,b,c){var d=function(d,e,f){var g=this;g.resolver=e,g.root=e.root,g.parentFragment=f,g.viewmodel=e.root.viewmodel,"string"==typeof d?g.value=d:d.t===a.REFERENCE?g.refResolver=b(this,d.n,function(a){g.resolve(a)}):new c(e,f,d,function(a){g.resolve(a)})};return d.prototype={resolve:function(a){this.keypath&&this.viewmodel.unregister(this.keypath,this),this.keypath=a,this.value=this.viewmodel.get(a),this.bind(),this.resolver.bubble()},bind:function(){this.viewmodel.register(this.keypath,this)},rebind:function(a,b,c,d){this.refResolver&&this.refResolver.rebind(a,b,c,d)},setValue:function(a){this.value=a,this.resolver.bubble()},unbind:function(){this.keypath&&this.viewmodel.unregister(this.keypath,this),this.unresolved&&this.unresolved.unbind()},forceResolution:function(){this.refResolver&&this.refResolver.forceResolution()}},d}(S,bd,dd),fd=function(a,b,c){function d(a){return a.value}function e(a){return void 0!=a}function f(a){a.unbind()}var g=function(d,e,f){var g,h,i,j,k=this,l=this;l.parentFragment=j=d.parentFragment,l.root=g=d.root,l.mustache=d,l.ref=h=e.r,l.callback=f,l.unresolved=[],(i=a(g,h,j))?l.base=i:l.baseResolver=new b(this,h,function(a){l.base=a,l.baseResolver=null,l.bubble()}),l.members=e.m.map(function(a){return new c(a,k,j)}),l.ready=!0,l.bubble()};return g.prototype={getKeypath:function(){var a=this.members.map(d);return!a.every(e)||this.baseResolver?null:this.base+"."+a.join(".")},bubble:function(){this.ready&&!this.baseResolver&&this.callback(this.getKeypath())},unbind:function(){this.members.forEach(f)},rebind:function(a,b,c,d){var e;this.members.forEach(function(f){f.rebind(a,b,c,d)&&(e=!0)}),e&&this.bubble()},forceResolution:function(){this.baseResolver&&(this.base=this.ref,this.baseResolver.unbind(),this.baseResolver=null),this.members.forEach(function(a){return a.forceResolution()}),this.bubble()}},g}(w,$c,ed),gd=function(a,b,c,d){return function(e,f){function g(a){e.resolve(a)}function h(a){var b=e.keypath;a!==b&&(e.resolve(a),void 0!==b&&e.fragments&&e.fragments.forEach(function(c){c.rebind(null,null,b,a)}))}var i,j,k;j=f.parentFragment,k=f.template,e.root=j.root,e.parentFragment=j,e.pElement=j.pElement,e.template=f.template,e.index=f.index||0,e.isStatic=f.template.s,e.type=f.template.t,e.registered=!1,(i=k.r)&&(e.resolver=new b(e,i,g)),f.template.x&&(e.resolver=new d(e,j,f.template.x,h)),f.template.rx&&(e.resolver=new c(e,f.template.rx,h)),e.template.n!==a.SECTION_UNLESS||e.hasOwnProperty("value")||e.setValue(void 0)}}(S,bd,fd,dd),hd=function(a){return function(b){var c,d,e;return b&&"@"===b[0]?(d=b.slice(1),a(d)&&(d=+d),this.keypath=b,void this.setValue(d)):(this.registered&&(this.root.viewmodel.unregister(this.keypath,this),this.registered=!1,c=!0),this.keypath=b,void 0!=b&&(d=this.root.viewmodel.get(b),this.root.viewmodel.register(b,this),this.registered=!0),this.setValue(d),void(c&&(e=this.twowayBinding)&&e.rebound()))}}(j),id=function(a,b,c,d){this.fragments&&this.fragments.forEach(function(e){return e.rebind(a,b,c,d)}),this.resolver&&this.resolver.rebind(a,b,c,d)},jd=function(a,b,c,d){return{getValue:a,init:b,resolve:c,rebind:d}}(Xc,gd,hd,id),kd=function(a,b,c,d,e,f,g,h){var i=function(b){this.type=a.INTERPOLATOR,g.init(this,b)};return i.prototype={update:function(){this.node.data=void 0==this.value?"":this.value},resolve:g.resolve,rebind:g.rebind,detach:h,unbind:f,render:function(){return this.node||(this.node=document.createTextNode(void 0!=this.value?this.value:"")),this.node},unrender:function(a){a&&d(this.node)},getValue:g.getValue,setValue:function(a){var c;(c=this.root.viewmodel.wrapped[this.keypath])&&(a=c.get()),e(a,this.value)||(this.value=a,this.parentFragment.bubble(),this.node&&b.addView(this))},firstNode:function(){return this.node},toString:function(a){var b=void 0!=this.value?""+this.value:"";return a?c(b):b}},i}(S,y,Sc,Tc,u,Wc,jd,Uc),ld=function(){this.parentFragment.bubble()},md=function(){var a;return 1===this.fragments.length?this.fragments[0].detach():(a=document.createDocumentFragment(),this.fragments.forEach(function(b){a.appendChild(b.detach())}),a)},nd=function(a){var b,c,d;for(c=this.fragments.length,b=0;c>b;b+=1)if(d=this.fragments[b].find(a))return d;return null},od=function(a,b){var c,d;for(d=this.fragments.length,c=0;d>c;c+=1)this.fragments[c].findAll(a,b)},pd=function(a,b){var c,d;for(d=this.fragments.length,c=0;d>c;c+=1)this.fragments[c].findAllComponents(a,b)},qd=function(a){var b,c,d;for(c=this.fragments.length,b=0;c>b;b+=1)if(d=this.fragments[b].findComponent(a))return d;return null},rd=function(a){return this.fragments[a.index+1]?this.fragments[a.index+1].firstNode():this.parentFragment.findNextNode(this)},sd=function(){var a,b,c;if(a=this.fragments.length)for(b=0;a>b;b+=1)if(c=this.fragments[b].firstNode())return c;return this.parentFragment.findNextNode(this)},td=function(a,b,c){var d;return c.push(function(){d=c.Fragment}),function(c){var d,e,f,g,h,i,j,k=this,l=this;if(!(this.shuffling||this.unbound||this.subtype&&this.subtype!==a.SECTION_EACH)){if(this.shuffling=!0,b.scheduleTask(function(){return k.shuffling=!1}),d=this.parentFragment,h=[],c.forEach(function(a,b){var c,d,f,g;return a===b?void(h[a]=l.fragments[b]):(c=l.fragments[b],void 0===e&&(e=b),-1===a?(l.fragmentsToUnrender.push(c),void c.unbind()):(d=a-b,f=l.keypath+"."+b,g=l.keypath+"."+a,c.rebind(l.template.i,a,f,g),c.index=a,void(h[a]=c)))}),g=this.root.get(this.keypath).length,void 0===e){if(this.length===g)return;e=this.length}for(this.length=this.fragments.length=g,this.rendered&&b.addView(this),i={template:this.template.f,root:this.root,owner:this},this.template.i&&(i.indexRef=this.template.i),f=e;g>f;f+=1)j=h[f],j||this.fragmentsToCreate.push(f),this.fragments[f]=j}}}(S,y,f),ud=function(){var a;return a=this.docFrag=document.createDocumentFragment(),this.update(),this.rendered=!0,a},vd=function(){var a=/^\[object (?:Array|FileList)\]$/,b=Object.prototype.toString;return function(c){return a.test(b.call(c))}}(),wd=function(a,b,c,d,e){function f(d,e){var f={template:d.template.f,root:d.root,pElement:d.parentFragment.pElement,owner:d};if(d.subtype)switch(d.subtype){case a.SECTION_IF:return k(d,e,!1,f);case a.SECTION_UNLESS:return k(d,e,!0,f);case a.SECTION_WITH:return j(d,f);case a.SECTION_IF_WITH:return i(d,e,f);case a.SECTION_EACH:if(c(e))return h(d,e,f)}return d.ordered=!!b(e),d.ordered?g(d,e,f):c(e)||"function"==typeof e?d.template.i?h(d,e,f):j(d,f):k(d,e,!1,f)}function g(a,b,c){var d,e,f;if(e=b.length,e===a.length)return!1;if(e<a.length)a.fragmentsToUnrender=a.fragments.splice(e,a.length-e),a.fragmentsToUnrender.forEach(m);else if(e>a.length)for(d=a.length;e>d;d+=1)c.context=a.keypath+"."+d,c.index=d,a.template.i&&(c.indexRef=a.template.i),f=new p(c),a.fragmentsToRender.push(a.fragments[d]=f);return a.length=e,!0}function h(a,b,c){var d,e,f,g,h;for(f=a.hasKey||(a.hasKey={}),e=a.fragments.length;e--;)g=a.fragments[e],g.index in b||(h=!0,g.unbind(),a.fragmentsToUnrender.push(g),a.fragments.splice(e,1),f[g.index]=!1);for(d in b)f[d]||(h=!0,c.context=a.keypath+"."+d,c.index=d,a.template.i&&(c.indexRef=a.template.i),g=new p(c),a.fragmentsToRender.push(g),a.fragments.push(g),f[d]=!0);return a.length=a.fragments.length,h}function i(a,b,c){return b?j(a,c):l(a)}function j(a,b){var c;return a.length?void 0:(b.context=a.keypath,b.index=0,c=new p(b),a.fragmentsToRender.push(a.fragments[0]=c),a.length=1,!0)}function k(a,d,e,f){var g,h,i,j,k;if(h=b(d)&&0===d.length,i=!1,!b(d)&&c(d)){i=!0;for(k in d){i=!1;break}}return g=e?h||i||!d:d&&!h&&!i,g?a.length?a.length>1?(a.fragmentsToUnrender=a.fragments.splice(1),a.fragmentsToUnrender.forEach(m),!0):void 0:(f.index=0,j=new p(f),a.fragmentsToRender.push(a.fragments[0]=j),a.length=1,!0):l(a)}function l(a){return a.length?(a.fragmentsToUnrender=a.fragments.splice(0,a.fragments.length).filter(n),a.fragmentsToUnrender.forEach(m),a.length=a.fragmentsToRender.length=0,!0):void 0}function m(a){a.unbind()}function n(a){return a.rendered}var o,p;return e.push(function(){p=e.Fragment}),o=function(a){var b,c,e=this;this.updating||(this.updating=!0,(b=this.root.viewmodel.wrapped[this.keypath])&&(a=b.get()),this.fragmentsToCreate.length?(c={template:this.template.f,root:this.root,pElement:this.pElement,owner:this,indexRef:this.template.i},this.fragmentsToCreate.forEach(function(a){var b;c.context=e.keypath+"."+a,c.index=a,b=new p(c),e.fragmentsToRender.push(e.fragments[a]=b)}),this.fragmentsToCreate.length=0):f(this,a)&&(this.bubble(),this.rendered&&d.addView(this)),this.value=a,this.updating=!1)}}(S,vd,i,y,f),xd=function(a){var b,c,d;for(b="",c=0,d=this.length,c=0;d>c;c+=1)b+=this.fragments[c].toString(a);return b},yd=function(a){function b(a){a.unbind()}var c;return c=function(){this.fragments.forEach(b),a.call(this),this.length=0,this.unbound=!0}}(Wc),zd=function(){function a(a){a.unrender(!0)}function b(a){a.unrender(!1)}var c;return c=function(c){this.fragments.forEach(c?a:b)}}(),Ad=function(){var a,b,c,d,e,f,g;for(c=this.renderedFragments;a=this.fragmentsToUnrender.pop();)a.unrender(!0),c.splice(c.indexOf(a),1);for(;a=this.fragmentsToRender.shift();)a.render();for(this.rendered&&(e=this.parentFragment.getNode()),g=this.fragments.length,f=0;g>f;f+=1)a=this.fragments[f],b=c.indexOf(a,f),b!==f?(this.docFrag.appendChild(a.detach()),-1!==b&&c.splice(b,1),c.splice(f,0,a)):this.docFrag.childNodes.length&&(d=a.firstNode(),e.insertBefore(this.docFrag,d));this.rendered&&this.docFrag.childNodes.length&&(d=this.parentFragment.findNextNode(this),e.insertBefore(this.docFrag,d)),this.renderedFragments=this.fragments.slice()},Bd=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){var r=function(c){this.type=a.SECTION,this.subtype=c.template.n,this.inverted=this.subtype===a.SECTION_UNLESS,this.pElement=c.pElement,this.fragments=[],this.fragmentsToCreate=[],this.fragmentsToRender=[],this.fragmentsToUnrender=[],this.renderedFragments=[],this.length=0,b.init(this,c)};return r.prototype={bubble:c,detach:d,find:e,findAll:f,findAllComponents:g,findComponent:h,findNextNode:i,firstNode:j,getValue:b.getValue,shuffle:k,rebind:b.rebind,render:l,resolve:b.resolve,setValue:m,toString:n,unbind:o,unrender:p,update:q},r}(S,jd,ld,md,nd,od,pd,qd,rd,sd,td,ud,wd,xd,yd,zd,Ad),Cd=function(){var a,b;if(this.docFrag){for(a=this.nodes.length,b=0;a>b;b+=1)this.docFrag.appendChild(this.nodes[b]);return this.docFrag}},Dd=function(a){return function(b){var c,d,e,f;for(d=this.nodes.length,c=0;d>c;c+=1)if(e=this.nodes[c],1===e.nodeType){if(a(e,b))return e;if(f=e.querySelector(b))return f}return null}}(_b),Ed=function(a){return function(b,c){var d,e,f,g,h,i;for(e=this.nodes.length,d=0;e>d;d+=1)if(f=this.nodes[d],1===f.nodeType&&(a(f,b)&&c.push(f),g=f.querySelectorAll(b)))for(h=g.length,i=0;h>i;i+=1)c.push(g[i])}}(_b),Fd=function(){return this.rendered&&this.nodes[0]?this.nodes[0]:this.parentFragment.findNextNode(this)},Gd=function(a,b){function c(a){return g[a]||(g[a]=b(a))}var d,e,f,g={};try{b("table").innerHTML="foo"}catch(h){e=!0,f={TABLE:['<table class="x">',"</table>"],THEAD:['<table><thead class="x">',"</thead></table>"],TBODY:['<table><tbody class="x">',"</tbody></table>"],TR:['<table><tr class="x">',"</tr></table>"],SELECT:['<select class="x">',"</select>"]}}return d=function(b,d,g){var h,i,j,k,l,m=[];if(null!=b&&""!==b){for(e&&(i=f[d.tagName])?(h=c("DIV"),h.innerHTML=i[0]+b+i[1],h=h.querySelector(".x"),"SELECT"===h.tagName&&(j=h.options[h.selectedIndex])):d.namespaceURI===a.svg?(h=c("DIV"),h.innerHTML='<svg class="x">'+b+"</svg>",h=h.querySelector(".x")):(h=c(d.tagName),h.innerHTML=b,"SELECT"===h.tagName&&(j=h.options[h.selectedIndex]));k=h.firstChild;)m.push(k),g.appendChild(k);if("SELECT"===d.tagName)for(l=m.length;l--;)m[l]!==j&&(m[l].selected=!1)}return m}}(C,D),Hd=function(a){for(var b=[],c=a.length;c--;)b[c]=a[c];return b},Id=function(a){function b(a){return a.selected}var c;return c=function(c){var d,e,f;c&&"select"===c.name&&c.binding&&(d=a(c.node.options).filter(b),c.getAttribute("multiple")?f=d.map(function(a){return a.value}):(e=d[0])&&(f=e.value),void 0!==f&&c.binding.setValue(f),c.bubble())}}(Hd),Jd=function(a,b){return function(){if(this.rendered)throw new Error("Attempted to render an item that was already rendered");return this.docFrag=document.createDocumentFragment(),this.nodes=a(this.value,this.parentFragment.getNode(),this.docFrag),b(this.pElement),this.rendered=!0,this.docFrag}}(Gd,Id),Kd=function(a){return function(b){var c;(c=this.root.viewmodel.wrapped[this.keypath])&&(b=c.get()),b!==this.value&&(this.value=b,this.parentFragment.bubble(),this.rendered&&a.addView(this))}}(y),Ld=function(a){return function(){return void 0!=this.value?a(""+this.value):""}}(Bb),Md=function(a){return function(b){this.rendered&&b&&(this.nodes.forEach(a),this.rendered=!1)}}(Tc),Nd=function(a,b){return function(){var c,d;if(this.rendered){for(;this.nodes&&this.nodes.length;)c=this.nodes.pop(),c.parentNode.removeChild(c);d=this.parentFragment.getNode(),this.nodes=a(this.value,d,this.docFrag),d.insertBefore(this.docFrag,this.parentFragment.findNextNode(this)),b(this.pElement)}}}(Gd,Id),Od=function(a,b,c,d,e,f,g,h,i,j,k,l){var m=function(c){this.type=a.TRIPLE,b.init(this,c)};return m.prototype={detach:c,find:d,findAll:e,firstNode:f,getValue:b.getValue,rebind:b.rebind,render:g,resolve:b.resolve,setValue:h,toString:i,unbind:l,unrender:j,update:k},m}(S,jd,Cd,Dd,Ed,Fd,Jd,Kd,Ld,Md,Nd,Wc),Pd=function(){this.parentFragment.bubble()},Qd=function(){var a,b=this.node;return b?((a=b.parentNode)&&a.removeChild(b),b):void 0},Rd=function(a){return function(b){return a(this.node,b)?this.node:this.fragment&&this.fragment.find?this.fragment.find(b):void 0}}(_b),Sd=function(a,b){b._test(this,!0)&&b.live&&(this.liveQueries||(this.liveQueries=[])).push(b),this.fragment&&this.fragment.findAll(a,b)},Td=function(a,b){this.fragment&&this.fragment.findAllComponents(a,b)},Ud=function(a){return this.fragment?this.fragment.findComponent(a):void 0},Vd=function(){return null},Wd=function(){return this.node},Xd=function(a){return this.attributes&&this.attributes[a]?this.attributes[a].value:void 0},Yd=function(){var a,b,c,d;return a="altGlyph altGlyphDef altGlyphItem animateColor animateMotion animateTransform clipPath feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence foreignObject glyphRef linearGradient radialGradient textPath vkern".split(" "),b="attributeName attributeType baseFrequency baseProfile calcMode clipPathUnits contentScriptType contentStyleType diffuseConstant edgeMode externalResourcesRequired filterRes filterUnits glyphRef gradientTransform gradientUnits kernelMatrix kernelUnitLength keyPoints keySplines keyTimes lengthAdjust limitingConeAngle markerHeight markerUnits markerWidth maskContentUnits maskUnits numOctaves pathLength patternContentUnits patternTransform patternUnits pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits refX refY repeatCount repeatDur requiredExtensions requiredFeatures specularConstant specularExponent spreadMethod startOffset stdDeviation stitchTiles surfaceScale systemLanguage tableValues targetX targetY textLength viewBox viewTarget xChannelSelector yChannelSelector zoomAndPan".split(" "),c=function(a){for(var b={},c=a.length;c--;)b[a[c].toLowerCase()]=a[c];return b},d=c(a.concat(b)),function(a){var b=a.toLowerCase();return d[b]||b}}(),Zd=function(a,b){return function(){var c=this.fragment.getValue();b(c,this.value)||("id"===this.name&&this.value&&delete this.root.nodes[this.value],this.value=c,"value"===this.name&&this.node&&(this.node._ractive.value=c),this.rendered&&a.addView(this))}}(y,u),$d=function(){var a=/^(allowFullscreen|async|autofocus|autoplay|checked|compact|controls|declare|default|defaultChecked|defaultMuted|defaultSelected|defer|disabled|draggable|enabled|formNoValidate|hidden|indeterminate|inert|isMap|itemScope|loop|multiple|muted|noHref|noResize|noShade|noValidate|noWrap|open|pauseOnExit|readOnly|required|reversed|scoped|seamless|selected|sortable|translate|trueSpeed|typeMustMatch|visible)$/i;return a}(),_d=function(a,b){return function(c,d){var e,f;if(e=d.indexOf(":"),-1===e||(f=d.substr(0,e),"xmlns"===f))c.name=c.element.namespace!==a.html?b(d):d;else if(d=d.substring(e+1),c.name=b(d),c.namespace=a[f.toLowerCase()],c.namespacePrefix=f,!c.namespace)throw'Unknown namespace ("'+f+'")'}}(C,Yd),ae=function(a){return function(b){var c=b.fragment.items;if(1===c.length)return c[0].type===a.INTERPOLATOR?c[0]:void 0}}(S),be=function(a,b){var c={"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"};return function(d,e){var f;!d.pNode||d.namespace||e.pNode.namespaceURI&&e.pNode.namespaceURI!==a.html||(f=c[d.name]||d.name,void 0!==e.pNode[f]&&(d.propertyName=f),(b.test(f)||"value"===f)&&(d.useProperty=!0))}}(C,$d),ce=function(a,b,c,d,e,f){var g;return f.push(function(){g=f.Fragment}),function(f){return this.type=a.ATTRIBUTE,this.element=f.element,this.root=f.root,c(this,f.name),f.value&&"string"!=typeof f.value?(this.parentFragment=this.element.parentFragment,this.fragment=new g({template:f.value,root:this.root,owner:this}),this.value=this.fragment.getValue(),this.interpolator=d(this),this.isBindable=!!this.interpolator&&!this.interpolator.isStatic,e(this,f),void(this.ready=!0)):void(this.value=b.test(this.name)?!0:f.value||"")}}(S,$d,_d,ae,be,f),de=function(a,b,c,d){this.fragment&&this.fragment.rebind(a,b,c,d)},ee=function(a,b){var c={"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"};return function(d){var e;this.node=d,d.namespaceURI&&d.namespaceURI!==a.html||(e=c[this.name]||this.name,void 0!==d[e]&&(this.propertyName=e),(b.test(e)||"value"===e)&&(this.useProperty=!0),"value"===e&&(this.useProperty=!0,d._ractive.value=this.value)),this.rendered=!0,this.update()}}(C,$d),fe=function(a){function b(a){return a.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'")}var c;return c=function(){var c=(g=this).name,d=g.namespacePrefix,e=g.value,f=g.interpolator,g=g.fragment;if(("value"!==c||"select"!==this.element.name&&"textarea"!==this.element.name)&&("value"!==c||void 0===this.element.getAttribute("contenteditable")))return"name"===c&&"input"===this.element.name&&f?"name={{"+(f.keypath||f.ref)+"}}":a.test(c)?e?c:"":(g&&(e=g.toString()),d&&(c=d+":"+c),e?c+'="'+b(e)+'"':c)}}($d),ge=function(){this.fragment&&this.fragment.unbind(),"id"===this.name&&delete this.root.nodes[this.value]},he=function(){var a,b,c,d,e=this.value;if(!this.locked)for(this.node._ractive.value=e,a=this.node.options,d=a.length;d--;)if(b=a[d],c=b._ractive?b._ractive.value:b.value,c==e){b.selected=!0;break}},ie=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]==b)return!0;return!1},je=function(a,b){return function(){var c,d,e,f,g=this.value;for(b(g)||(g=[g]),c=this.node.options,d=c.length;d--;)e=c[d],f=e._ractive?e._ractive.value:e.value,e.selected=a(g,f)}}(ie,h),ke=function(){var a=(b=this).node,b=b.value;a.checked=b==a._ractive.value},le=function(a){return function(){var b,c,d,e,f=this.node;if(b=f.checked,f.value=this.element.getAttribute("value"),f.checked=this.element.getAttribute("value")===this.element.getAttribute("name"),b&&!f.checked&&this.element.binding&&(d=this.element.binding.siblings,e=d.length)){for(;e--;){if(c=d[e],!c.element.node)return;if(c.element.node.checked)return a.addViewmodel(c.root.viewmodel),c.handleChange()}a.addViewmodel(c.root.viewmodel),this.root.viewmodel.set(c.keypath,void 0)}}}(y),me=function(a){return function(){var b,c,d=(f=this).element,e=f.node,f=f.value;if(b=d.getAttribute("value"),a(f)){for(c=f.length;c--;)if(b==f[c])return void(e.checked=!0);e.checked=!1}else e.checked=f==b}}(h),ne=function(){var a,b;a=this.node,b=this.value,void 0===b&&(b=""),a.className=b},oe=function(){var a=(b=this).node,b=b.value;this.root.nodes[b]=a,a.id=b},pe=function(){var a,b;a=this.node,b=this.value,void 0===b&&(b=""),a.style.setAttribute("cssText",b)},qe=function(){var a=this.value;void 0===a&&(a=""),this.locked||(this.node.innerHTML=a)},re=function(){var a=(b=this).node,b=b.value;a._ractive.value=b,this.locked||(a.value=void 0==b?"":b)},se=function(){this.locked||(this.node[this.propertyName]=this.value)},te=function(a){return function(){var b=(f=this).node,c=f.namespace,d=f.name,e=f.value,f=f.fragment;c?b.setAttributeNS(c,d,(f||e).toString()):a.test(d)?e?b.setAttribute(d,""):b.removeAttribute(d):b.setAttribute(d,(f||e).toString())}}($d),ue=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){return function(){var o,p,q=(s=this).name,r=s.element,s=s.node;"id"===q?p=i:"value"===q?"select"===r.name&&"value"===q?p=r.getAttribute("multiple")?d:c:"textarea"===r.name?p=l:null!=r.getAttribute("contenteditable")?p=k:"input"===r.name&&(o=r.getAttribute("type"),p="file"===o?b:"radio"===o&&r.binding&&"name"===r.binding.name?f:l):this.twoway&&"name"===q?"radio"===s.type?p=e:"checkbox"===s.type&&(p=g):"style"===q&&s.style.setAttribute?p=j:"class"!==q||s.namespaceURI&&s.namespaceURI!==a.html?this.useProperty&&(p=m):p=h,p||(p=n),this.update=p,this.update()}}(C,Sb,he,je,ke,le,me,ne,oe,pe,qe,re,se,te),ve=function(a,b,c,d,e,f,g){var h=function(a){this.init(a)};return h.prototype={bubble:a,init:b,rebind:c,render:d,toString:e,unbind:f,update:g},h}(Zd,ce,de,ee,fe,ge,ue),we=function(a){return function(b,c){var d,e,f=[];for(d in c)c.hasOwnProperty(d)&&(e=new a({element:b,name:d,value:c[d],root:b.root}),f.push(f[d]=e));
|
||
return f}}(ve),xe=function(a,b,c,d){function e(a,b){var c=b?"svg":"div";return i.innerHTML="<"+c+" "+a+"></"+c+">",d(i.childNodes[0].attributes)}function f(a,b){for(var c=a.length;c--;)if(a[c].name===b.name)return!1;return!0}var g,h,i;"undefined"!=typeof document&&(i=c("div")),a.push(function(){h=a.Fragment});var j=function(a,b){this.element=a,this.root=a.root,this.parentFragment=a.parentFragment,this.attributes=[],this.fragment=new h({root:a.root,owner:this,template:[b]})};return j.prototype={bubble:function(){this.node&&this.update(),this.element.bubble()},rebind:function(a,b,c,d){this.fragment.rebind(a,b,c,d)},render:function(a){this.node=a,this.isSvg=a.namespaceURI===b.svg,this.update()},unbind:function(){this.fragment.unbind()},update:function(){var a,b,c=this;a=this.fragment.toString(),b=e(a,this.isSvg),this.attributes.filter(function(a){return f(b,a)}).forEach(function(a){c.node.removeAttribute(a.name)}),b.forEach(function(a){c.node.setAttribute(a.name,a.value)}),this.attributes=b},toString:function(){return this.fragment.toString()}},g=j}(f,C,D,Hd),ye=function(a){return function(b,c){return c?c.map(function(c){return new a(b,c)}):[]}}(xe),ze=function(a){for(var b,c,d=Array.prototype.slice,e=d.call(arguments,1);c=e.shift();)for(b in c)c.hasOwnProperty(b)&&(a[b]=c[b]);return a},Ae=function(a,b,c,d,e){var f=function(a){var c,d,e;return this.element=a,this.root=a.root,this.attribute=a.attributes[this.name||"value"],c=this.attribute.interpolator,c.twowayBinding=this,c.keypath&&"${"===c.keypath.substr(0,2)?(b("Two-way binding does not work with expressions (`"+c.keypath.slice(2,-1)+"`)"),!1):(c.keypath||c.resolver.forceResolution(),this.keypath=d=c.keypath,void(void 0===this.root.viewmodel.get(d)&&this.getInitialValue&&(e=this.getInitialValue(),void 0!==e&&this.root.viewmodel.set(d,e))))};return f.prototype={handleChange:function(){var b=this;a.start(this.root),this.attribute.locked=!0,this.root.viewmodel.set(this.keypath,this.getValue()),a.scheduleTask(function(){return b.attribute.locked=!1}),a.end()},rebound:function(){var a,b,c;b=this.keypath,c=this.attribute.interpolator.keypath,b!==c&&(e(this.root._twowayBindings[b],this),this.keypath=c,a=this.root._twowayBindings[c]||(this.root._twowayBindings[c]=[]),a.push(this))},unbind:function(){}},f.extend=function(a){var b,e=this;return b=function(a){f.call(this,a),this.init&&this.init()},b.prototype=c(e.prototype),d(b.prototype,a),b.extend=f.extend,b},f}(y,m,T,ze,q),Be=function(){this._ractive.binding.handleChange()},Ce=function(a,b){var c=a.extend({getInitialValue:function(){return this.element.fragment?this.element.fragment.toString():""},render:function(){var a=this.element.node;a.addEventListener("change",b,!1),this.root.lazy||(a.addEventListener("input",b,!1),a.attachEvent&&a.addEventListener("keyup",b,!1))},unrender:function(){var a=this.element.node;a.removeEventListener("change",b,!1),a.removeEventListener("input",b,!1),a.removeEventListener("keyup",b,!1)},getValue:function(){return this.element.node.innerHTML}});return c}(Ae,Be),De=function(){var a={};return function(b,c,d){var e=b+c+d;return a[e]||(a[e]=[])}}(),Ee=function(a,b,c,d,e){var f=c.extend({name:"checked",init:function(){this.siblings=d(this.root._guid,"radio",this.element.getAttribute("name")),this.siblings.push(this)},render:function(){var a=this.element.node;a.addEventListener("change",e,!1),a.attachEvent&&a.addEventListener("click",e,!1)},unrender:function(){var a=this.element.node;a.removeEventListener("change",e,!1),a.removeEventListener("click",e,!1)},handleChange:function(){a.start(this.root),this.siblings.forEach(function(a){a.root.viewmodel.set(a.keypath,a.getValue())}),a.end()},getValue:function(){return this.element.node.checked},unbind:function(){b(this.siblings,this)}});return f}(y,q,Ae,De,Be),Fe=function(a,b,c,d){var e=b.extend({name:"name",init:function(){this.siblings=d(this.root._guid,"radioname",this.keypath),this.siblings.push(this),this.radioName=!0,this.attribute.twoway=!0},getInitialValue:function(){return this.element.getAttribute("checked")?this.element.getAttribute("value"):void 0},render:function(){var a=this.element.node;a.name="{{"+this.keypath+"}}",a.checked=this.root.viewmodel.get(this.keypath)==this.element.getAttribute("value"),a.addEventListener("change",c,!1),a.attachEvent&&a.addEventListener("click",c,!1)},unrender:function(){var a=this.element.node;a.removeEventListener("change",c,!1),a.removeEventListener("click",c,!1)},getValue:function(){var a=this.element.node;return a._ractive?a._ractive.value:a.value},handleChange:function(){this.element.node.checked&&b.prototype.handleChange.call(this)},rebound:function(a,c,d,e){var f;b.prototype.rebound.call(this,a,c,d,e),(f=this.element.node)&&(f.name="{{"+this.keypath+"}}")},unbind:function(){a(this.siblings,this)}});return e}(q,Ae,Be,De),Ge=function(a,b,c,d,e,f){function g(a){return a.isChecked}function h(a){return a.element.getAttribute("value")}var i=d.extend({name:"name",getInitialValue:function(){return this.noInitialValue=!0,[]},init:function(){var a,b;this.checkboxName=!0,this.attribute.twoway=!0,this.siblings=e(this.root._guid,"checkboxes",this.keypath),this.siblings.push(this),this.noInitialValue&&(this.siblings.noInitialValue=!0),this.siblings.noInitialValue&&this.element.getAttribute("checked")&&(a=this.root.viewmodel.get(this.keypath),b=this.element.getAttribute("value"),a.push(b))},unbind:function(){c(this.siblings,this)},render:function(){var c,d,e=this.element.node;c=this.root.viewmodel.get(this.keypath),d=this.element.getAttribute("value"),this.isChecked=a(c)?b(c,d):c==d,e.name="{{"+this.keypath+"}}",e.checked=this.isChecked,e.addEventListener("change",f,!1),e.attachEvent&&e.addEventListener("click",f,!1)},unrender:function(){var a=this.element.node;a.removeEventListener("change",f,!1),a.removeEventListener("click",f,!1)},changed:function(){var a=!!this.isChecked;return this.isChecked=this.element.node.checked,this.isChecked===a},handleChange:function(){this.isChecked=this.element.node.checked,d.prototype.handleChange.call(this)},getValue:function(){return this.siblings.filter(g).map(h)}});return i}(h,ie,q,Ae,De,Be),He=function(a,b){var c=a.extend({name:"checked",render:function(){var a=this.element.node;a.addEventListener("change",b,!1),a.attachEvent&&a.addEventListener("click",b,!1)},unrender:function(){var a=this.element.node;a.removeEventListener("change",b,!1),a.removeEventListener("click",b,!1)},getValue:function(){return this.element.node.checked}});return c}(Ae,Be),Ie=function(a,b,c){var d=b.extend({getInitialValue:function(){var a,b,c,d,e=this.element.options;if(void 0===this.element.getAttribute("value")&&(b=a=e.length,a)){for(;b--;)if(e[b].getAttribute("selected")){c=e[b].getAttribute("value"),d=!0;break}if(!d)for(;++b<a;)if(!e[b].getAttribute("disabled")){c=e[b].getAttribute("value");break}return void 0!==c&&(this.element.attributes.value.value=c),c}},render:function(){this.element.node.addEventListener("change",c,!1)},unrender:function(){this.element.node.removeEventListener("change",c,!1)},setValue:function(b){a.addViewmodel(this.root.viewmodel),this.root.viewmodel.set(this.keypath,b)},getValue:function(){var a,b,c,d,e;for(a=this.element.node.options,c=a.length,b=0;c>b;b+=1)if(d=a[b],a[b].selected)return e=d._ractive?d._ractive.value:d.value},forceUpdate:function(){var b=this,c=this.getValue();void 0!==c&&(this.attribute.locked=!0,a.addViewmodel(this.root.viewmodel),a.scheduleTask(function(){return b.attribute.locked=!1}),this.root.viewmodel.set(this.keypath,c))}});return d}(y,Ae,Be),Je=function(a){return function(b,c){var d;if(!a(b)||!a(c))return!1;if(b.length!==c.length)return!1;for(d=b.length;d--;)if(b[d]!==c[d])return!1;return!0}}(h),Ke=function(a,b,c,d){var e=c.extend({getInitialValue:function(){return this.element.options.filter(function(a){return a.getAttribute("selected")}).map(function(a){return a.getAttribute("value")})},render:function(){var a;this.element.node.addEventListener("change",d,!1),a=this.root.viewmodel.get(this.keypath),void 0===a&&this.handleChange()},unrender:function(){this.element.node.removeEventListener("change",d,!1)},setValue:function(){throw new Error("TODO not implemented yet")},getValue:function(){var a,b,c,d,e,f;for(a=[],b=this.element.node.options,d=b.length,c=0;d>c;c+=1)e=b[c],e.selected&&(f=e._ractive?e._ractive.value:e.value,a.push(f));return a},handleChange:function(){var a,d,e;return a=this.attribute,d=a.value,e=this.getValue(),void 0!==d&&b(e,d)||c.prototype.handleChange.call(this),this},forceUpdate:function(){var b=this,c=this.getValue();void 0!==c&&(this.attribute.locked=!0,a.addViewmodel(this.root.viewmodel),a.scheduleTask(function(){return b.attribute.locked=!1}),this.root.viewmodel.set(this.keypath,c))},updateModel:function(){void 0!==this.attribute.value&&this.attribute.value.length||this.root.viewmodel.set(this.keypath,this.initialValue)}});return e}(y,Je,Ie,Be),Le=function(a,b){var c=a.extend({render:function(){this.element.node.addEventListener("change",b,!1)},unrender:function(){this.element.node.removeEventListener("change",b,!1)},getValue:function(){return this.element.node.files}});return c}(Ae,Be),Me=function(a,b){function c(){var a;b.call(this),a=this._ractive.root.viewmodel.get(this._ractive.binding.keypath,f),this.value=void 0==a?"":a}var d,e,f;return f={evaluateWrapped:!0},e=a.extend({getInitialValue:function(){return""},getValue:function(){return this.element.node.value},render:function(){var a=this.element.node;a.addEventListener("change",b,!1),this.root.lazy||(a.addEventListener("input",b,!1),a.attachEvent&&a.addEventListener("keyup",b,!1)),a.addEventListener("blur",c,!1)},unrender:function(){var a=this.element.node;a.removeEventListener("change",b,!1),a.removeEventListener("input",b,!1),a.removeEventListener("keyup",b,!1),a.removeEventListener("blur",c,!1)}}),d=e}(Ae,Be),Ne=function(a){return a.extend({getInitialValue:function(){return void 0},getValue:function(){var a=parseFloat(this.element.node.value);return isNaN(a)?void 0:a}})}(Me),Oe=function(a,b,c,d,e,f,g,h,i,j,k){function l(a){return a&&a.isBindable}var m;return m=function(m){var n,o,p,q,r=m.attributes;return m.binding&&(m.binding.teardown(),m.binding=null),(m.getAttribute("contenteditable")||r.contenteditable&&l(r.contenteditable))&&l(r.value)?o=b:"input"===m.name?(n=m.getAttribute("type"),"radio"===n||"checkbox"===n?(p=l(r.name),q=l(r.checked),p&&q&&a.error({message:"badRadioInputBinding"}),p?o="radio"===n?d:e:q&&(o="radio"===n?c:f)):"file"===n&&l(r.value)?o=i:l(r.value)&&(o="number"===n||"range"===n?j:k)):"select"===m.name&&l(r.value)?o=m.getAttribute("multiple")?h:g:"textarea"===m.name&&l(r.value)&&(o=k),o?new o(m):void 0}}(o,Ce,Ee,Fe,Ge,He,Ie,Ke,Le,Ne,Me),Pe=function(){var a=this.getAction();a&&!this.hasListener?this.listen():!a&&this.hasListener&&this.unrender()},Qe=function(a){return function(b){a(this.root,this.getAction(),{event:b})}}(mc),Re=function(){return this.action.toString().trim()},Se=function(a,b,c,d,e){function f(a){var b,c,d;if(b=this.root,"function"!=typeof b[this.method])throw new Error('Attempted to call a non-existent method ("'+this.method+'")');c=this.keypaths.map(function(c){var d,e,f;if(void 0===c)return void 0;if(c.eventObject){if(d=a,e=c.refinements.length)for(f=0;e>f;f+=1)d=d[c.refinements[f]]}else d=b.viewmodel.get(c);return d}),b.event=a,d=this.fn.apply(null,c),b[this.method].apply(b,d),delete b.event}function g(a){d(this.root,this.getAction(),{event:a,args:this.params})}function h(a){var b=this.dynamicParams.getValue(k);"string"==typeof b&&(b=b.substr(1,b.length-2)),d(this.root,this.getAction(),{event:a,args:b})}var i,j,k={args:!0},l=/^event(?:\.(.+))?/;return c.push(function(){j=c.Fragment}),i=function(c,d,i){var k,m,n,o=this;o.element=c,o.root=c.root,o.name=d,-1!==d.indexOf("*")&&(e.error({debug:this.root.debug,message:"noElementProxyEventWildcards",args:{element:c.tagName,event:d}}),this.invalid=!0),i.m?(m=i.a.r,o.method=i.m,o.keypaths=[],o.fn=a(i.a.s,m.length),o.parentFragment=c.parentFragment,n=o.root,o.refResolvers=m.map(function(a,c){var d;return(d=l.exec(a))?(o.keypaths[c]={eventObject:!0,refinements:d[1]?d[1].split("."):[]},null):b(o,a,function(a){o.resolve(c,a)})}),this.fire=f):(k=i.n||i,"string"!=typeof k&&(k=new j({template:k,root:this.root,owner:this})),this.action=k,i.d?(this.dynamicParams=new j({template:i.d,root:this.root,owner:this.element}),this.fire=h):i.a&&(this.params=i.a,this.fire=g))}}(cd,bd,f,mc,o),Te=function(a){var b,c;b=this._ractive,c=b.events[a.type],c.fire({node:this,original:a,index:b.index,keypath:b.keypath,context:b.root.get(b.keypath)})},Ue=function(a,b,c){function d(a){return f[a]||(f[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)}),f[a]}var e,f={},g={touchstart:!0,touchmove:!0,touchend:!0,touchcancel:!0,touchleave:!0};return e=function(){var e,f=this.name;if(!this.invalid){if(e=a.registries.events.find(this.root,f))this.custom=e(this.node,d(f));else{if(!("on"+f in this.node||window&&"on"+f in window))return void(g[f]||c.error({debug:this.root.debug,message:"missingPlugin",args:{plugin:"event",name:f}}));this.node.addEventListener(f,b,!1)}this.hasListener=!0}}}(Vb,Te,o),Ve=function(a,b,c,d){function e(e){e&&e.rebind(a,b,c,d)}var f;return this.method?(f=this.element.parentFragment,void this.refResolvers.forEach(e)):("string"!=typeof this.action&&e(this.action),void(this.dynamicParams&&e(this.dynamicParams)))},We=function(){this.node=this.element.node,this.node._ractive.events[this.name]=this,(this.method||this.getAction())&&this.listen()},Xe=function(a,b){this.keypaths[a]=b},Ye=function(){function a(a){a.unbind()}var b;return b=function(){return this.method?void this.refResolvers.forEach(a):("string"!=typeof this.action&&this.action.unbind(),void(this.dynamicParams&&this.dynamicParams.unbind()))}}(),Ze=function(a){return function(){this.custom?this.custom.teardown():this.node.removeEventListener(this.name,a,!1),this.hasListener=!1}}(Te),$e=function(a,b,c,d,e,f,g,h,i,j){var k=function(a,b,c){this.init(a,b,c)};return k.prototype={bubble:a,fire:b,getAction:c,init:d,listen:e,rebind:f,render:g,resolve:h,unbind:i,unrender:j},k}(Pe,Qe,Re,Se,Ue,Ve,We,Xe,Ye,Ze),_e=function(a){return function(b,c){var d,e,f,g,h=[];for(e in c)if(c.hasOwnProperty(e))for(f=e.split("-"),d=f.length;d--;)g=new a(b,f[d],c[e]),h.push(g);return h}}($e),af=function(a,b,c){var d,e,f;return b.push(function(){d=b.Fragment}),e={args:!0},f=function(b,f){var g,h,i,j=this;j.element=b,j.root=g=b.root,h=f.n||f,"string"!=typeof h&&(i=new d({template:h,root:g,owner:b}),h=i.toString(),i.unbind()),f.a?j.params=f.a:f.d&&(j.fragment=new d({template:f.d,root:g,owner:b}),j.params=j.fragment.getValue(e),j.fragment.bubble=function(){this.dirtyArgs=this.dirtyValue=!0,j.params=this.getValue(e),j.ready&&j.update()}),j.fn=c.registries.decorators.find(g,h),j.fn||a.error({debug:g.debug,message:"missingPlugin",args:{plugin:"decorator",name:h}})},f.prototype={init:function(){var a,b,c,d=this;if(a=d.element.node,d.params?(c=[a].concat(d.params),b=d.fn.apply(d.root,c)):b=d.fn.call(d.root,a),!b||!b.teardown)throw new Error("Decorator definition must return an object with a teardown method");d.actual=b,d.ready=!0},update:function(){this.actual.update?this.actual.update.apply(this.root,this.params):(this.actual.teardown(!0),this.init())},rebind:function(a,b,c,d){this.fragment&&this.fragment.rebind(a,b,c,d)},teardown:function(a){this.actual.teardown(),!a&&this.fragment&&this.fragment.unbind()}},f}(o,f,Vb),bf=function(a){function b(a,b){for(var c=a.length;c--;)if(a[c]==b)return!0}var c;return c=function(c){var d,e,f,g,h;d=c.node,d&&(g=a(d.options),e=c.getAttribute("value"),f=c.getAttribute("multiple"),void 0!==e?(g.forEach(function(a){var c,d;c=a._ractive?a._ractive.value:a.value,d=f?b(e,c):e==c,d&&(h=!0),a.selected=d}),h||(g[0]&&(g[0].selected=!0),c.binding&&c.binding.forceUpdate())):c.binding&&c.binding.forceUpdate())}}(Hd),cf=function(a,b){return function(){var c=this;this.dirty||(this.dirty=!0,a.scheduleTask(function(){b(c),c.dirty=!1})),this.parentFragment.bubble()}}(y,bf),df=function(a){do if("select"===a.name)return a;while(a=a.parent)},ef=function(a){return function(b,c){b.select=a(b.parent),b.select&&(b.select.options.push(b),c.a||(c.a={}),void 0!==c.a.value||c.a.hasOwnProperty("disabled")||(c.a.value=c.f),"selected"in c.a&&void 0!==b.select.getAttribute("value")&&delete c.a.selected)}}(df),ff=function(a,b,c,d,e,f,g,h,i,j){var k;return j.push(function(){k=j.Fragment}),function(j){var l,m,n,o,p;this.type=a.ELEMENT,l=this.parentFragment=j.parentFragment,m=this.template=j.template,this.parent=j.pElement||l.pElement,this.root=n=l.root,this.index=j.index,this.name=b(m.e),"option"===this.name&&i(this,m),"select"===this.name&&(this.options=[],this.bubble=h),this.attributes=c(this,m.a),this.conditionalAttributes=d(this,m.m),m.f&&(this.fragment=new k({template:m.f,root:n,owner:this,pElement:this})),n.twoway&&(o=e(this,m.a))&&(this.binding=o,p=this.root._twowayBindings[o.keypath]||(this.root._twowayBindings[o.keypath]=[]),p.push(o)),m.v&&(this.eventHandlers=f(this,m.v)),m.o&&(this.decorator=new g(this,m.o)),this.intro=m.t0||m.t1,this.outro=m.t0||m.t2}}(S,Yd,we,ye,Oe,_e,af,cf,ef,f),gf=function(a){return function(b,c){return b===c||a(b,c)}}(Yc),hf=function(a,b){return function(c,d,e,f){var g=c[d];g&&!a(g,f)&&a(g,e)&&(c[d]=b(g,e,f))}}(gf,Zc),jf=function(a){return function(b,c,d,e){function f(a){a.rebind(b,c,d,e)}var g,h,i,j;if(this.attributes&&this.attributes.forEach(f),this.conditionalAttributes&&this.conditionalAttributes.forEach(f),this.eventHandlers&&this.eventHandlers.forEach(f),this.decorator&&f(this.decorator),this.fragment&&f(this.fragment),i=this.liveQueries)for(j=this.root,g=i.length;g--;)i[g]._makeDirty();this.node&&(h=this.node._ractive)&&(a(h,"keypath",d,e),void 0!=b&&(h.index[b]=c))}}(hf),kf=function(a){var b;(a.attributes.width||a.attributes.height)&&a.node.addEventListener("load",b=function(){var c=a.getAttribute("width"),d=a.getAttribute("height");void 0!==c&&a.node.setAttribute("width",c),void 0!==d&&a.node.setAttribute("height",d),a.node.removeEventListener("load",b,!1)},!1)},lf=function(a,b,c){var d,e={};return c.push(function(){d=c.Fragment}),function(c,f,g){var h,i,j,k=this;return k.element=c,k.root=h=c.root,k.isIntro=g,i=f.n||f,"string"!=typeof i&&(j=new d({template:i,root:h,owner:c}),i=j.toString(),j.unbind()),k.name=i,f.a?k.params=f.a:f.d&&(j=new d({template:f.d,root:h,owner:c}),k.params=j.getValue(e),j.unbind()),k._fn=b.registries.transitions.find(h,i),k._fn?void 0:void a.error({debug:h.debug,message:"missingPlugin",args:{plugin:"transition",name:i}})}}(o,Vb,f),mf=function(a){return a.replace(/-([a-zA-Z])/g,function(a,b){return b.toUpperCase()})},nf=function(a,b,c,d){var e,f,g;return a?(f={},g=c("div").style,e=function(a){var c,e,h;if(a=d(a),!f[a])if(void 0!==g[a])f[a]=a;else for(h=a.charAt(0).toUpperCase()+a.substring(1),c=b.length;c--;)if(e=b[c],void 0!==g[e+h]){f[a]=e+h;break}return f[a]}):e=null,e}(E,K,D,mf),of=function(a,b,c,d){var e,f;return b?(f=window.getComputedStyle||a.getComputedStyle,e=function(a){var b,e,g,h,i;if(b=f(this.node),"string"==typeof a)return i=b[d(a)],"0px"===i&&(i=0),i;if(!c(a))throw new Error("Transition$getStyle must be passed a string, or an array of strings representing CSS properties");for(e={},g=a.length;g--;)h=a[g],i=b[d(h)],"0px"===i&&(i=0),e[h]=i;return e}):e=null,e}(vb,E,h,nf),pf=function(a){return function(b,c){var d;if("string"==typeof b)this.node.style[a(b)]=c;else for(d in b)b.hasOwnProperty(d)&&(this.node.style[a(d)]=b[d]);return this}}(nf),qf=function(a,b,c){function d(a){return a}var e,f=function(e){var f;this.duration=e.duration,this.step=e.step,this.complete=e.complete,"string"==typeof e.easing?(f=e.root.easing[e.easing],f||(a('Missing easing function ("'+e.easing+'"). You may need to download a plugin from [TODO]'),f=d)):f="function"==typeof e.easing?e.easing:d,this.easing=f,this.start=b(),this.end=this.start+this.duration,this.running=!0,c.add(this)};return f.prototype={tick:function(a){var b,c;return this.running?a>this.end?(this.step&&this.step(1),this.complete&&this.complete(1),!1):(b=a-this.start,c=this.easing(b/this.duration),this.step&&this.step(c),!0):!1},stop:function(){this.abort&&this.abort(),this.running=!1}},e=f}(m,M,N),rf=function(a){var b=new RegExp("^-(?:"+a.join("|")+")-");return function(a){return a.replace(b,"")}}(K),sf=function(a){var b=new RegExp("^(?:"+a.join("|")+")([A-Z])");return function(a){var c;return a?(b.test(a)&&(a="-"+a),c=a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()})):""}}(K),tf=function(a,b,c,d,e,f,g,h,i){var j,k,l,m,n,o,p,q,r={},s={};return a?(k=c("div").style,function(){void 0!==k.transition?(l="transition",m="transitionend",n=!0):void 0!==k.webkitTransition?(l="webkitTransition",m="webkitTransitionEnd",n=!0):n=!1}(),l&&(o=l+"Duration",p=l+"Property",q=l+"TimingFunction"),j=function(a,c,j,k,l){setTimeout(function(){var t,u,v,w,x;w=function(){u&&v&&(a.root.fire(a.name+":end",a.node,a.isIntro),l())},t=(a.node.namespaceURI||"")+a.node.tagName,a.node.style[p]=k.map(g).map(i).join(","),a.node.style[q]=i(j.easing||"linear"),a.node.style[o]=j.duration/1e3+"s",x=function(b){var c;c=k.indexOf(d(h(b.propertyName))),-1!==c&&k.splice(c,1),k.length||(a.node.removeEventListener(m,x,!1),v=!0,w())},a.node.addEventListener(m,x,!1),setTimeout(function(){for(var h,i,l,o,p,q=k.length,y=[];q--;)o=k[q],h=t+o,n&&!s[h]&&(a.node.style[g(o)]=c[o],r[h]||(i=a.getStyle(o),r[h]=a.getStyle(o)!=c[o],s[h]=!r[h],s[h]&&(a.node.style[g(o)]=i))),(!n||s[h])&&(void 0===i&&(i=a.getStyle(o)),l=k.indexOf(o),-1===l?b("Something very strange happened with transitions. If you see this message, please let @RactiveJS know. Thanks!"):k.splice(l,1),p=/[^\d]*$/.exec(c[o])[0],y.push({name:g(o),interpolator:e(parseFloat(i),parseFloat(c[o])),suffix:p}));y.length?new f({root:a.root,duration:j.duration,easing:d(j.easing||""),step:function(b){var c,d;for(d=y.length;d--;)c=y[d],a.node.style[c.name]=c.interpolator(b)+c.suffix},complete:function(){u=!0,w()}}):u=!0,k.length||(a.node.removeEventListener(m,x,!1),v=!0,w())},0)},j.delay||0)}):j=null,j}(E,m,D,mf,Wb,qf,nf,rf,sf),uf=function(a){function b(){i.hidden=document[e]}function c(){i.hidden=!0}function d(){i.hidden=!1}var e,f,g,h,i;if("undefined"!=typeof document){if(e="hidden",i={},e in document)g="";else for(h=a.length;h--;)f=a[h],e=f+"Hidden",e in document&&(g=f);void 0!==g?(document.addEventListener(g+"visibilitychange",b),b()):("onfocusout"in document?(document.addEventListener("focusout",c),document.addEventListener("focusin",d)):(window.addEventListener("pagehide",c),window.addEventListener("blur",c),window.addEventListener("pageshow",d),window.addEventListener("focus",d)),i.hidden=!1)}return i}(K),vf=function(a,b,c,d,e,f,g){var h,i,j;return b?(i=window.getComputedStyle||a.getComputedStyle,h=function(a,b,h,k){var l,m=this;if(g.hidden)return this.setStyle(a,b),j||(j=d.resolve());"string"==typeof a?(l={},l[a]=b):(l=a,k=h,h=b),h||(c('The "'+m.name+'" transition does not supply an options object to `t.animateStyle()`. This will break in a future version of Ractive. For more info see https://github.com/RactiveJS/Ractive/issues/340'),h=m,k=m.complete);var n=new d(function(a){var b,c,d,g,j,k,n;if(!h.duration)return m.setStyle(l),void a();for(b=Object.keys(l),c=[],d=i(m.node),j={},k=b.length;k--;)n=b[k],g=d[e(n)],"0px"===g&&(g=0),g!=l[n]&&(c.push(n),m.node.style[e(n)]=g);return c.length?void f(m,l,h,c,a):void a()});return k&&(c("t.animateStyle returns a Promise as of 0.4.0. Transition authors should do t.animateStyle(...).then(callback)"),n.then(k)),n}):h=null,h}(vb,E,m,r,nf,tf,uf),wf=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);return c.forEach(function(b){for(var c in b)!b.hasOwnProperty(c)||c in a||(a[c]=b[c])}),a},xf=function(a){return function(b,c){return"number"==typeof b?b={duration:b}:"string"==typeof b?b="slow"===b?{duration:600}:"fast"===b?{duration:200}:{duration:400}:b||(b={}),a({},b,c)}}(wf),yf=function(){function a(a,b){b?a.setAttribute("style",b):(a.getAttribute("style"),a.removeAttribute("style"))}var b;return b=function(){var b,c,d,e=this;return b=e.node=e.element.node,c=b.getAttribute("style"),e.complete=function(f){d||(!f&&e.isIntro&&a(b,c),b._ractive.transition=null,e._manager.remove(e),d=!0)},e._fn?void e._fn.apply(e.root,[e].concat(e.params)):void e.complete()}}(),zf=function(a,b,c,d,e,f,g){var h,i;return g.push(function(){h=g.Fragment}),i=function(a,b,c){this.init(a,b,c)},i.prototype={init:a,start:f,getStyle:b,setStyle:c,animateStyle:d,processParams:e},i}(lf,of,pf,vf,xf,yf,f),Af=function(a,b,c,d,e,f,g,h,i,j,k){function l(b){var c,d,e;return c=(d=b.getAttribute("xmlns"))?d:"svg"===b.name?a.svg:(e=b.parent)?"foreignObject"===e.name?a.html:e.node.namespaceURI:b.root.el.namespaceURI}function m(a){var c,d,e;if(a.select&&(d=a.select.getAttribute("value"),void 0!==d))if(c=a.getAttribute("value"),a.select.node.multiple&&b(d)){for(e=d.length;e--;)if(c==d[e]){a.node.selected=!0;break}}else a.node.selected=c==d}function n(a){var b,c,d,e,f;b=a.root;do for(c=b._liveQueries,d=c.length;d--;)e=c[d],f=c["_"+e],f._test(a)&&(a.liveQueries||(a.liveQueries=[])).push(f);while(b=b._parent)}var o,p,q;return p=function(){var a=this.node,b=this.fragment.toString(!1);if(window&&window.appearsToBeIELessEqual8&&(a.type="text/css"),a.styleSheet)a.styleSheet.cssText=b;else{for(;a.hasChildNodes();)a.removeChild(a.firstChild);a.appendChild(document.createTextNode(b))}},q=function(){this.node.type&&"text/javascript"!==this.node.type||c("Script tag was updated. This does not cause the code to be re-evaluated!"),this.node.text=this.fragment.toString(!1)},o=function(){var a,b,c=this,o=this.root;if(a=l(this),b=this.node=e(this.name,a),o.constructor.css&&this.parentFragment.getNode()===o.el&&this.node.setAttribute("data-rvcguid",o.constructor._guid),f(this.node,"_ractive",{value:{proxy:this,keypath:i(this.parentFragment),index:this.parentFragment.indexRefs,events:d(null),root:o}}),this.attributes.forEach(function(a){return a.render(b)}),this.conditionalAttributes.forEach(function(a){return a.render(b)}),this.fragment&&("script"===this.name?(this.bubble=q,this.node.text=this.fragment.toString(!1),this.fragment.unrender=g):"style"===this.name?(this.bubble=p,this.bubble(),this.fragment.unrender=g):this.binding&&this.getAttribute("contenteditable")?this.fragment.unrender=g:this.node.appendChild(this.fragment.render())),this.eventHandlers&&this.eventHandlers.forEach(function(a){return a.render()}),this.binding&&(this.binding.render(),this.node._ractive.binding=this.binding),"img"===this.name&&j(this),this.decorator&&this.decorator.fn&&h.scheduleTask(function(){return c.decorator.init()},!0),o.transitionsEnabled&&this.intro){var r=new k(this,this.intro,!0);h.registerTransition(r),h.scheduleTask(function(){return r.start()},!0),this.transition=r}return"option"===this.name&&m(this),this.node.autofocus&&h.scheduleTask(function(){return c.node.focus()},!0),n(this),this.node}}(C,h,m,T,D,F,Sb,y,t,kf,zf),Bf=function(a,b,c){function d(a){var c,d,e;if(c=a.getAttribute("value"),void 0===c||!a.select)return!1;if(d=a.select.getAttribute("value"),d==c)return!0;if(a.select.getAttribute("multiple")&&b(d))for(e=d.length;e--;)if(d[e]==c)return!0}function e(a){var b,c,d,e;return b=a.attributes,c=b.type,d=b.value,e=b.name,c&&"radio"===c.value&&d&&e.interpolator&&d.value===e.interpolator.value?!0:void 0}function f(a){var b=a.toString();return b?" "+b:""}var g;return g=function(){var b,g;return b="<"+(this.template.y?"!DOCTYPE":this.template.e),b+=this.attributes.map(f).join("")+this.conditionalAttributes.map(f).join(""),"option"===this.name&&d(this)&&(b+=" selected"),"input"===this.name&&e(this)&&(b+=" checked"),b+=">","textarea"===this.name&&void 0!==this.getAttribute("value")?b+=c(this.getAttribute("value")):void 0!==this.getAttribute("contenteditable")&&(b+=this.getAttribute("value")),this.fragment&&(g="script"!==this.name&&"style"!==this.name,b+=this.fragment.toString(g)),a.test(this.template.e)||(b+="</"+this.template.e+">"),b}}(zb,h,Sc),Cf=function(a){return function(b){b.select&&a(b.select.options,b)}}(q),Df=function(a){function b(a){a.unbind()}var c;return c=function(){this.fragment&&this.fragment.unbind(),this.binding&&this.binding.unbind(),this.eventHandlers&&this.eventHandlers.forEach(b),"option"===this.name&&a(this),this.attributes.forEach(b),this.conditionalAttributes.forEach(b)}}(Cf),Ef=function(a,b){function c(a){var b,c,d;for(d=a.liveQueries.length;d--;)b=a.liveQueries[d],c=b.selector,b._remove(a.node)}var d;return d=function(d){var e,f;if(this.transition&&this.transition.complete(),"option"===this.name?this.detach():d&&a.detachWhenReady(this),this.fragment&&this.fragment.unrender(!1),(e=this.binding)&&(this.binding.unrender(),this.node._ractive.binding=null,f=this.root._twowayBindings[e.keypath],f.splice(f.indexOf(e),1)),this.eventHandlers&&this.eventHandlers.forEach(function(a){return a.unrender()}),this.decorator&&this.decorator.teardown(),this.root.transitionsEnabled&&this.outro){var g=new b(this,this.outro,!1);a.registerTransition(g),a.scheduleTask(function(){return g.start()})}this.liveQueries&&c(this)}}(y,zf),Ff=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p=function(a){this.init(a)};return p.prototype={bubble:a,detach:b,find:c,findAll:d,findAllComponents:e,findComponent:f,findNextNode:g,firstNode:h,getAttribute:i,init:j,rebind:k,render:l,toString:m,unbind:n,unrender:o},p}(Pd,Qd,Rd,Sd,Td,Ud,Vd,Wd,Xd,ff,jf,Af,Bf,Df,Ef),Gf=function(){function a(a,b){var c=d.exec(b)[0];return null===a||c.length<a.length?c:a}var b,c=/^\s*$/,d=/^\s*/;return b=function(b){var d,e,f,g;return d=b.split("\n"),e=d[0],void 0!==e&&c.test(e)&&d.shift(),f=d[d.length-1],void 0!==f&&c.test(f)&&d.pop(),g=d.reduce(a,null),g&&(b=d.map(function(a){return a.replace(g,"")}).join("\n")),b}}(),Hf=function(a,b,c,d){function e(d,e){var f=b.registries.partials,g=f.findInstance(d,e);if(g){var h,i=g.partials[e];if("function"==typeof i&&(h=i.bind(g),h.isOwner=g.partials.hasOwnProperty(e),i=h(g.data,c)),!i)return void a.warn({debug:d.debug,message:"noRegistryFunctionReturn",args:{registry:"partial",name:e}});if(!c.isParsed(i)){var j=c.parse(i,c.getParseOptions(g));j.p&&a.warn({debug:d.debug,message:"noNestedPartials",args:{rname:e}});var k=h?g:f.findOwner(g,e);k.partials[e]=i=j.t}return h&&(i._fn=h),i.v?i.t:i}}var f;return f=function(a,b){var f;if(f=e(a,b))return f;if(f=c.fromId(b,{noThrow:!0})){f=d(f);var g=c.parse(f,c.getParseOptions(a));return a.partials[b]=g.t}}}(o,Vb,Ob,Gf),If=function(a,b){var c;return b?c=a.split("\n").map(function(a,c){return c?b+a:a}).join("\n"):a},Jf=function(a,b,c,d,e,f,g,h,i){var j,k;return e.push(function(){k=e.Fragment}),j=function(a){var d,e;d=this.parentFragment=a.parentFragment,this.root=d.root,this.type=b.PARTIAL,this.index=a.index,this.name=a.template.r,this.fragment=this.fragmentToRender=this.fragmentToUnrender=null,g.init(this,a),!this.keypath&&(e=c(this.root,this.name))&&(i.call(this),this.isNamed=!0,this.setTemplate(e))},j.prototype={bubble:function(){this.parentFragment.bubble()},detach:function(){return this.fragment.detach()},find:function(a){return this.fragment.find(a)},findAll:function(a,b){return this.fragment.findAll(a,b)},findComponent:function(a){return this.fragment.findComponent(a)},findAllComponents:function(a,b){return this.fragment.findAllComponents(a,b)},firstNode:function(){return this.fragment.firstNode()},findNextNode:function(){return this.parentFragment.findNextNode(this)},getValue:function(){return this.fragment.getValue()},rebind:function(a,b,c,d){h.call(this,a,b,c,d),this.fragment.rebind(a,b,c,d)},render:function(){return this.docFrag=document.createDocumentFragment(),this.update(),this.rendered=!0,this.docFrag},resolve:g.resolve,setValue:function(b){var d;(void 0===b||b!==this.value)&&(d=c(this.root,""+b),!d&&this.name&&(d=c(this.root,this.name))&&(i.call(this),this.isNamed=!0),d||a.error({debug:this.root.debug,message:"noTemplateForPartial",args:{name:this.name}}),this.setTemplate(d||[]),this.value=b,this.bubble(),this.rendered&&f.addView(this))
|
||
},setTemplate:function(a){this.fragment&&(this.fragment.unbind(),this.fragmentToUnrender=this.fragment),this.fragment=new k({template:a,root:this.root,owner:this,pElement:this.parentFragment.pElement}),this.fragmentToRender=this.fragment},toString:function(a){var c,e,f,g;return c=this.fragment.toString(a),e=this.parentFragment.items[this.index-1],e&&e.type===b.TEXT?(f=e.text.split("\n").pop(),(g=/^\s+$/.exec(f))?d(c,g[0]):c):c},unbind:function(){this.isNamed||i.call(this),this.fragment&&this.fragment.unbind()},unrender:function(a){this.rendered&&(this.fragment&&this.fragment.unrender(a),this.rendered=!1)},update:function(){var a,b;this.fragmentToUnrender&&(this.fragmentToUnrender.unrender(!0),this.fragmentToUnrender=null),this.fragmentToRender&&(this.docFrag.appendChild(this.fragmentToRender.render()),this.fragmentToRender=null),this.rendered&&(a=this.parentFragment.getNode(),b=this.parentFragment.findNextNode(this),a.insertBefore(this.docFrag,b))}},j}(o,S,Hf,If,f,y,jd,id,Wc),Kf=function(a,b,c){var d;return c.push(function(){d=c.Ractive}),function e(c,d){var f,g=a.registries.components.findInstance(c,d);if(g&&(f=g.components[d],!f._parent)){var h=f.bind(g);if(h.isOwner=g.components.hasOwnProperty(d),f=h(g.data),!f)return void b.warn({debug:c.debug,message:"noRegistryFunctionReturn",args:{registry:"component",name:d}});"string"==typeof f&&(f=e(c,f)),f._fn=h,g.components[d]=f}return f}}(Vb,o,f),Lf=function(a){var b=new a("detach");return function(){var a=this.instance.fragment.detach();return b.fire(this.instance),a}}(p),Mf=function(a){return this.instance.fragment.find(a)},Nf=function(a,b){return this.instance.fragment.findAll(a,b)},Of=function(a,b){b._test(this,!0),this.instance.fragment&&this.instance.fragment.findAllComponents(a,b)},Pf=function(a){return a&&a!==this.name?this.instance.fragment?this.instance.fragment.findComponent(a):null:this.instance},Qf=function(){return this.parentFragment.findNextNode(this)},Rf=function(){return this.rendered?this.instance.fragment.firstNode():null},Sf=function(a,b){var c,d;return b.push(function(){c=b.Fragment}),d=function(a,b,d){this.parentFragment=a.parentFragment,this.component=a,this.key=b,this.fragment=new c({template:d,root:a.root,owner:this}),this.value=this.fragment.getValue()},d.prototype={bubble:function(){this.dirty||(this.dirty=!0,a.addView(this))},update:function(){var b=this.fragment.getValue();this.component.instance.viewmodel.set(this.key,b),a.addViewmodel(this.component.instance.viewmodel),this.value=b,this.dirty=!1},rebind:function(a,b,c,d){this.fragment.rebind(a,b,c,d)},unbind:function(){this.fragment.unbind()}},d}(y,f),Tf=function(a,b){var c=function(c,d,e,f){var g=this;this.root=c.root,this.parentFragment=c.parentFragment,this.ready=!1,this.hash=null,this.resolver=new a(this,e,function(a){g.binding||(g.binding=c.bindings[g.hash])?(c.bindings[g.hash]=null,g.binding.rebind(a),g.hash=a+"="+d,c.bindings[g.hash]):g.ready?b(c,c.root,a,d):f.push({childKeypath:d,parentKeypath:a}),g.value=c.root.viewmodel.get(a)})};return c.prototype={rebind:function(a,b,c,d){this.resolver.rebind(a,b,c,d)},unbind:function(){this.resolver.unbind()}},c}(fd,v),Uf=function(a,b,c,d,e){function f(f,g,h,i){var j,k,l,m,n,o;if(l=f.root,m=f.parentFragment,"string"==typeof h)return k=b(h),k?k.value:h;if(null===h)return!0;if(1===h.length&&h[0].t===a.INTERPOLATOR){if(h[0].r)return m.indexRefs&&void 0!==m.indexRefs[o=h[0].r]?(f.indexRefBindings[o]=g,m.indexRefs[o]):(n=c(l,h[0].r,m)||h[0].r,i.push({childKeypath:g,parentKeypath:n}),l.viewmodel.get(n));if(h[0].rx)return j=new e(f,g,h[0].rx,i),f.complexParameters.push(j),j.ready=!0,j.value}return j=new d(f,g,h),f.complexParameters.push(j),j.value}var g;return g=function(a,b,c,d){var e,g,h={};a.complexParameters=[];for(e in c)c.hasOwnProperty(e)&&(g=f(a,e,c[e],d),(void 0!==g||void 0===b[e])&&(h[e]=g));return h}}(S,Fb,w,Sf,Tf),Vf=function(a){return function(b,c,d,e){var f,g,h,i;return g=b.parentFragment,i=b.root,h={content:e||[]},c.defaults.el&&a.warn({debug:i.debug,message:"defaultElSpecified",args:{name:b.name}}),f=new c({el:null,append:!0,data:d,partials:h,magic:i.magic||c.defaults.magic,modifyArrays:i.modifyArrays,_parent:i,_component:b,adapt:i.adapt,"yield":{template:e,instance:i}})}}(o),Wf=function(a){return function(b,c){c.forEach(function(c){var d,e;a(b,b.root,c.parentKeypath,c.childKeypath),d=b.instance.viewmodel.get(c.childKeypath),e=b.root.viewmodel.get(c.parentKeypath),void 0!==d&&void 0===e&&b.root.viewmodel.set(c.parentKeypath,d)})}}(v),Xf=function(a,b,c){function d(a,d,e,f){"string"!=typeof f&&c.error({debug:d.debug,message:"noComponentEventArguments"}),a.on(e,function(){var a,c;return arguments.length&&arguments[0]&&arguments[0].node&&(a=Array.prototype.shift.call(arguments)),c=Array.prototype.slice.call(arguments),b(d,f,{event:a,args:c}),!1})}var e,f;return a.push(function(){f=a.Fragment}),e=function(a,b){var c;for(c in b)b.hasOwnProperty(c)&&d(a.instance,a.root,c,b[c])}}(f,mc,o),Yf=function(a){var b,c;for(b=a.root;b;)(c=b._liveComponentQueries["_"+a.name])&&c.push(a.instance),b=b._parent},Zf=function(a,b,c,d,e,f,g){return function(h,i){var j,k,l,m;if(j=this.parentFragment=h.parentFragment,k=j.root,this.root=k,this.type=a.COMPONENT,this.name=h.template.e,this.index=h.index,this.indexRefBindings={},this.bindings=[],this.yielders=[],!i)throw new Error('Component "'+this.name+'" not found');m=[],l=c(this,i.defaults.data||{},h.template.a,m),d(this,i,l,h.template.f),e(this,m),f(this,h.template.v),(h.template.t1||h.template.t2||h.template.o)&&b('The "intro", "outro" and "decorator" directives have no effect on components'),g(this)}}(S,m,Uf,Vf,Wf,Xf,Yf),$f=function(a,b){return function(c,d,e,f){function g(a){a.rebind(c,d,e,f)}var h,i,j=this.instance,k=j._parent;this.bindings.forEach(function(a){var c;a.root===k&&(c=b(a.keypath,e,f))&&a.rebind(c)}),this.complexParameters.forEach(g),this.yielders[0]&&g(this.yielders[0]),(h=this.indexRefBindings[c])&&(a.addViewmodel(j.viewmodel),j.viewmodel.set(h,d)),(i=this.root._liveComponentQueries["_"+this.name])&&i._makeDirty()}}(y,Zc),_f=function(){var a=this.instance;return a.render(this.parentFragment.getNode()),this.rendered=!0,a.fragment.detach()},ag=function(){return this.instance.fragment.toString()},bg=function(a,b){function c(a){a.unbind()}function d(a){var b,c;b=a.root;do(c=b._liveComponentQueries["_"+a.name])&&c._remove(a);while(b=b._parent)}var e,f=new a("teardown");return e=function(){var a=this.instance;this.complexParameters.forEach(c),this.bindings.forEach(c),d(this),a.fragment.unbind(),a.viewmodel.teardown(),a.fragment.rendered&&a.el.__ractive_instances__&&b(a.el.__ractive_instances__,a),f.fire(a)}}(p,q),cg=function(a){this.shouldDestroy=a,this.instance.unrender()},dg=function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n=function(a,b){this.init(a,b)};return n.prototype={detach:a,find:b,findAll:c,findAllComponents:d,findComponent:e,findNextNode:f,firstNode:g,init:h,rebind:i,render:j,toString:k,unbind:l,unrender:m},n}(Lf,Mf,Nf,Of,Pf,Qf,Rf,Zf,$f,_f,ag,bg,cg),eg=function(a,b){var c=function(b){this.type=a.COMMENT,this.value=b.template.c};return c.prototype={detach:b,firstNode:function(){return this.node},render:function(){return this.node||(this.node=document.createComment(this.value)),this.node},toString:function(){return"<!--"+this.value+"-->"},unrender:function(a){a&&this.node.parentNode.removeChild(this.node)}},c}(S,Uc),fg=function(a,b,c){var d;c.push(function(){d=c.Fragment});var e=function(b){var c,e;c=b.parentFragment.root,this.component=e=c.component,this.surrogateParent=b.parentFragment,this.parentFragment=e.parentFragment,this.fragment=new d({owner:this,root:c.yield.instance,template:c.yield.template,pElement:this.surrogateParent.pElement}),e.yielders.push(this),a.scheduleTask(function(){if(e.yielders.length>1)throw new Error("A component template can only have one {{yield}} declaration at a time")})};return e.prototype={detach:function(){return this.fragment.detach()},find:function(a){return this.fragment.find(a)},findAll:function(a,b){return this.fragment.findAll(a,b)},findComponent:function(a){return this.fragment.findComponent(a)},findAllComponents:function(a,b){return this.fragment.findAllComponents(a,b)},findNextNode:function(){return this.surrogateParent.findNextNode(this)},firstNode:function(){return this.fragment.firstNode()},getValue:function(a){return this.fragment.getValue(a)},render:function(){return this.fragment.render()},unbind:function(){this.fragment.unbind()},unrender:function(a){this.fragment.unrender(a),b(this.component.yielders,this)},rebind:function(a,b,c,d){this.fragment.rebind(a,b,c,d)},toString:function(){return this.fragment.toString()}},e}(y,q,f),gg=function(a,b,c,d,e,f,g,h,i,j,k){return function(l){if("string"==typeof l.template)return new b(l);switch(l.template.t){case a.INTERPOLATOR:return"yield"===l.template.r?new k(l):new c(l);case a.SECTION:return new d(l);case a.TRIPLE:return new e(l);case a.ELEMENT:var m;return(m=h(l.parentFragment.root,l.template.e))?new i(l,m):new f(l);case a.PARTIAL:return new g(l);case a.COMMENT:return new j(l);default:throw new Error("Something very strange happened. Please file an issue at https://github.com/ractivejs/ractive/issues. Thanks!")}}}(S,Vc,kd,Bd,Od,Ff,Jf,Kf,dg,eg,fg),hg=function(a,b,c){return function(d){var e,f,g,h=this;if(this.owner=d.owner,e=this.parent=this.owner.parentFragment,this.root=d.root,this.pElement=d.pElement,this.context=d.context,this.owner.type===a.SECTION&&(this.index=d.index),e&&(f=e.indexRefs)){this.indexRefs=b(null);for(g in f)this.indexRefs[g]=f[g]}d.indexRef&&(this.indexRefs||(this.indexRefs={}),this.indexRefs[d.indexRef]=d.index),"string"==typeof d.template?d.template=[d.template]:d.template||(d.template=[]),this.items=d.template.map(function(a,b){return c({parentFragment:h,pElement:d.pElement,template:a,index:b})}),this.value=this.argsList=null,this.dirtyArgs=this.dirtyValue=!0,this.bound=!0}}(S,T,gg),ig=function(a){return function(b,c,d,e){this.index=c,a(this,"context",d,e),this.indexRefs&&void 0!==this.indexRefs[b]&&(this.indexRefs[b]=c),this.items.forEach(function(a){a.rebind&&a.rebind(b,c,d,e)})}}(hf),jg=function(){var a;return 1===this.items.length?a=this.items[0].render():(a=document.createDocumentFragment(),this.items.forEach(function(b){a.appendChild(b.render())})),this.rendered=!0,a},kg=function(a){return this.items?this.items.map(function(b){return b.toString(a)}).join(""):""},lg=function(){function a(a){a.unbind&&a.unbind()}var b;return b=function(){this.bound&&(this.items.forEach(a),this.bound=!1)}}(),mg=function(a){if(!this.rendered)throw new Error("Attempted to unrender a fragment that was not rendered");this.items.forEach(function(b){return b.unrender(a)}),this.rendered=!1},ng=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){var r=function(a){this.init(a)};return r.prototype={bubble:a,detach:b,find:c,findAll:d,findAllComponents:e,findComponent:f,findNextNode:g,firstNode:h,getNode:i,getValue:j,init:k,rebind:l,render:m,toString:n,unbind:o,unrender:p},q.Fragment=r,r}(Ic,Jc,Kc,Lc,Mc,Nc,Oc,Pc,Qc,Rc,hg,ig,jg,kg,lg,mg,f),og=function(a,b,c,d){var e=["template","partials","components","decorators","events"],f=new a("reset");return function(a,g){var h,i,j,k,l;if("function"!=typeof a||g?a=a||{}:(g=a,a={}),"object"!=typeof a)throw new Error("The reset method takes either no arguments, or an object containing new data");for((i=this.viewmodel.wrapped[""])&&i.reset?i.reset(a)===!1&&(this.data=a):this.data=a,j=d.reset(this),k=j.length;k--;)if(e.indexOf(j[k])>-1){l=!0;break}if(l){var m;this.viewmodel.mark(""),(m=this.component)&&(m.shouldDestroy=!0),this.unrender(),m&&(m.shouldDestroy=!1),this.fragment.template!==this.template&&(this.fragment.unbind(),this.fragment=new c({template:this.template,root:this,owner:this})),h=this.render(this.el,this.anchor)}else h=b.start(this,!0),this.viewmodel.mark(""),b.end();return f.fire(this,a),g&&h.then(g),h}}(p,y,ng,Vb),pg=function(a,b){return function(c){var d,e;a.template.init(null,this,{template:c}),d=this.transitionsEnabled,this.transitionsEnabled=!1,(e=this.component)&&(e.shouldDestroy=!0),this.unrender(),e&&(e.shouldDestroy=!1),this.fragment.unbind(),this.fragment=new b({template:this.template,root:this,owner:this}),this.render(this.el,this.anchor),this.transitionsEnabled=d}}(Vb,ng),qg=function(a){return a("reverse")}(Dc),rg=function(a,b,c,d){var e=/\*/;return function(f,g,h){var i,j,k=this;if(j=a.start(this,!0),b(f)){i=f,h=g;for(f in i)i.hasOwnProperty(f)&&(g=i[f],f=c(f),this.viewmodel.set(f,g))}else f=c(f),e.test(f)?d(this,f).forEach(function(a){k.viewmodel.set(a,g)}):this.viewmodel.set(f,g);return a.end(),h&&j.then(h.bind(this)),j}}(y,i,J,tc),sg=function(a){return a("shift")}(Dc),tg=function(a){return a("sort")}(Dc),ug=function(a){return a("splice")}(Dc),vg=function(a){return function(b,c){return a(this,b,void 0===c?-1:-c)}}(H),wg=function(a,b,c){var d=new a("teardown");return function(a){var e;return this.fragment.unbind(),this.viewmodel.teardown(),this.fragment.rendered&&this.el.__ractive_instances__&&c(this.el.__ractive_instances__,this),this.shouldDestroy=!0,e=this.fragment.rendered?this.unrender():b.resolve(),d.fire(this),a&&e.then(a.bind(this)),e}}(p,r,q),xg=function(a){return function(b,c){var d;return"string"!=typeof b&&a.errorOnly({debug:this.debug,messsage:"badArguments",arg:{arguments:b}}),d=this.get(b),this.set(b,!d,c)}}(o),yg=function(){return this.fragment.toString(!0)},zg=function(a,b,c,d,e,f){var g=new b("unrender");return function(){var b,h,i=this;if(!this.fragment.rendered)return c.warn({debug:this.debug,message:"ractive.unrender() was called on a Ractive instance that was not rendered"}),d.resolve();for(b=f.start(this,!0),h=!this.component||this.component.shouldDestroy||this.shouldDestroy,this.constructor.css&&b.then(function(){a.remove(i.constructor)});this._animations[0];)this._animations[0].stop();return this.fragment.unrender(h),e(this.el.__ractive_instances__,this),g.fire(this),f.end(),b}}(Gc,p,o,r,q,y),Ag=function(a){return a("unshift")}(Dc),Bg=function(a,b){var c=new a("update");return function(a,d){var e;return"function"==typeof a?(d=a,a=""):a=a||"",e=b.start(this,!0),this.viewmodel.mark(a),b.end(),c.fire(this,a),d&&e.then(d.bind(this)),e}}(p,y),Cg=function(a,b){function c(d,e,f,g){var h,i,j,k,l,m,n=[];if(h=d._twowayBindings[e],h&&(j=h.length))for(;j--;)k=h[j],(!k.radioName||k.element.node.checked)&&(k.checkboxName?n[k.keypath]||k.changed()||(n.push(k.keypath),n[k.keypath]=k):(l=k.attribute.value,m=k.getValue(),a(l,m)||b(l,m)||(f[e]=m)));if(n.length&&n.forEach(function(b){var c,d,e;c=n[b],d=c.attribute.value,e=c.getValue(),a(d,e)||(f[b]=e)}),g&&(i=d.viewmodel.depsMap["default"][e]))for(j=i.length;j--;)c(d,i[j],f,g)}var d;return d=function(a,b){var d;return"string"!=typeof a&&(a="",b=!0),c(this,a,d={},b),this.set(d)}}(Je,u),Dg=function(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,A,B,C,D,E,F){return{add:a,animate:b,detach:c,find:d,findAll:e,findAllComponents:f,findComponent:g,fire:h,get:i,insert:j,merge:k,observe:l,off:m,on:n,pop:o,push:p,render:q,reset:r,resetTemplate:s,reverse:t,set:u,shift:v,sort:w,splice:x,subtract:y,teardown:z,toggle:A,toHTML:B,unrender:C,unshift:D,update:E,updateModel:F}}(I,Yb,Zb,$b,ic,jc,kc,nc,oc,qc,rc,xc,Ac,Bc,Ec,Fc,Hc,og,pg,qg,rg,sg,tg,ug,vg,wg,xg,yg,zg,Ag,Bg,Cg),Eg=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b,c;return b=16*Math.random()|0,c="x"==a?b:3&b|8,c.toString(16)})},Fg=function(){var a=0;return function(){return"r-"+a++}}(),Gg=function(a){function b(b){this.hook=new a(b),this.inProcess={},this.queue={}}function c(a,b){return a[b._guid]||(a[b._guid]=[])}function d(a,b){var e=c(a.queue,b);for(a.hook.fire(b);e.length;)d(a,e.shift());delete a.queue[b._guid]}return b.prototype={constructor:b,begin:function(a){this.inProcess[a._guid]=!0},end:function(a){var b=a._parent;b&&this.inProcess[b._guid]?c(this.queue,b).push(a):d(this,a),delete this.inProcess[a._guid]}},b}(p),Hg=function(a,b,c,d){var e=a.root,f=a.keypath;return"sort"===c||"reverse"===c?void e.viewmodel.set(f,b):void e.viewmodel.smartUpdate(f,b,d)},Ig=function(a,b,c,d){var e,f,g,h=[],i=["pop","push","reverse","shift","sort","splice","unshift"];return i.forEach(function(e){var f=function(){var b,f,g,h,i=Array.prototype.slice,j=i.call(arguments,0);for(b=c(this,e,j),f=Array.prototype[e].apply(this,arguments),a.start(),this._ractive.setting=!0,h=this._ractive.wrappers.length;h--;)g=this._ractive.wrappers[h],a.addViewmodel(g.root.viewmodel),d(g,this,e,b);return a.end(),this._ractive.setting=!1,f};b(h,e,{value:f})}),e={},e.__proto__?(f=function(a){a.__proto__=h},g=function(a){a.__proto__=Array.prototype}):(f=function(a){var c,d;for(c=i.length;c--;)d=i[c],b(a,d,{value:h[d],configurable:!0})},g=function(a){var b;for(b=i.length;b--;)delete a[i[b]]}),f.unpatch=g,f}(y,F,Cc,Hg),Jg=function(a,b,c){var d,e,f;return d={filter:function(a){return b(a)&&(!a._ractive||!a._ractive.setting)},wrap:function(a,b,c){return new e(a,b,c)}},e=function(b,d,e){this.root=b,this.value=d,this.keypath=e,d._ractive||(a(d,"_ractive",{value:{wrappers:[],instances:[],setting:!1},configurable:!0}),c(d)),d._ractive.instances[b._guid]||(d._ractive.instances[b._guid]=0,d._ractive.instances.push(b)),d._ractive.instances[b._guid]+=1,d._ractive.wrappers.push(this)},e.prototype={get:function(){return this.value},teardown:function(){var a,b,d,e,g;if(a=this.value,b=a._ractive,d=b.wrappers,e=b.instances,b.setting)return!1;if(g=d.indexOf(this),-1===g)throw new Error(f);if(d.splice(g,1),d.length){if(e[this.root._guid]-=1,!e[this.root._guid]){if(g=e.indexOf(this.root),-1===g)throw new Error(f);e.splice(g,1)}}else delete a._ractive,c.unpatch(this.value)}},f="Something went wrong in a rather interesting way",d}(F,h,Ig),Kg=function(a,b){var c,d;return a&&(c={filter:function(c,d,e){return a.filter(c,d,e)&&b.filter(c)},wrap:function(a,b,c){return new d(a,b,c)}},d=function(c,d,e){this.value=d,this.magic=!0,this.magicWrapper=a.wrap(c,d,e),this.arrayWrapper=b.wrap(c,d,e)},d.prototype={get:function(){return this.value},teardown:function(){this.arrayWrapper.teardown(),this.magicWrapper.teardown()},reset:function(a){return this.magicWrapper.reset(a)}}),c}(A,Jg),Lg=function(a,b,c,d,e){function f(a,b){var c,d={};if(!b)return a;b+=".";for(c in a)a.hasOwnProperty(c)&&(d[b+c]=a[c]);return d}function g(a){var b;return i[a]||(b=a?a+".":"",i[a]=function(c,d){var e;return"string"==typeof c?(e={},e[b+c]=d,e):"object"==typeof c?b?f(c,a):c:void 0}),i[a]}var h,i={};return h=function(f,h){var i,j,k,l,m=this.ractive;for(i=m.adapt.length,j=0;i>j;j+=1){if(k=m.adapt[j],"string"==typeof k){var n=a.registries.adaptors.find(m,k);if(!n)return c.critical({debug:m.debug,message:"missingPlugin",args:{plugin:"adaptor",name:k}});k=m.adapt[j]=n}if(k.filter(h,f,m))return l=this.wrapped[f]=k.wrap(m,h,f,g(f)),l.value=h,h}return m.magic?e.filter(h,f,m)?this.wrapped[f]=e.wrap(m,h,f):d.filter(h,f,m)&&(this.wrapped[f]=d.wrap(m,h,f)):m.modifyArrays&&b.filter(h,f,m)&&(this.wrapped[f]=b.wrap(m,h,f)),h}}(Vb,Jg,o,A,Kg),Mg=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("."),-1===f.indexOf(e)&&f.push(e);return f},Ng=function(){function a(a){var b,d,e,f,g,h="";if(!c[a]){for(e=[];h.length<a;)h+=1;for(b=parseInt(h,2),f=function(a){return"1"===a},g=0;b>=g;g+=1){for(d=g.toString(2);d.length<a;)d="0"+d;e[g]=Array.prototype.map.call(d,f)}c[a]=e}return c[a]}var b,c={};return b=function(b){var c,d,e,f;return c=b.split("."),d=a(c.length),e=function(a,b){return a?"*":c[b]},f=d.map(function(a){return a.map(e).join(".")})}}(),Og=function(a){function b(b,e,f){var g;d(b,e),f||(g=a(e),g.forEach(function(a){c(b,a,e)}))}function c(a,b,e){var g,h,i;g=a.depsMap.patternObservers,h=g[b],h&&h.forEach(function(b){var g=f.exec(b)[0];i=e?e+"."+g:g,d(a,i),c(a,b,i)})}function d(a,b){a.patternObservers.forEach(function(a){a.regex.test(b)&&a.update(b)})}var e,f=/[^\.]+$/;return e=b}(Ng),Pg=function(a,b){function c(a){a.invalidate()}function d(a){return a.key}function e(a,b,c,d){var e,f;(e=h(a,c,d))&&(f=a.get(c),e.forEach(function(a){b&&a.refineValue?b.push(a):a.setValue(f)}))}function f(a,b,c){b.forEach(function(b){for(var d=!1,e=0,f=c.length,g=[];f>e;){var h=c[e];if(h===b.keypath){d=!0;break}h.slice(0,b.keypath.length)===b.keypath&&g.push(h),e++}d&&b.setValue(a.get(b.keypath)),g.length&&b.refineValue(g)})}function g(a,b,c){function d(a){a.forEach(e),a.forEach(f)}function e(b){var d=h(a,b,c);d&&i.push({keypath:b,deps:d})}function f(b){var e;(e=a.depsMap[c][b])&&d(e)}function g(b){var c=a.get(b.keypath);b.deps.forEach(function(a){return a.setValue(c)})}var i=[];d(b),i.forEach(g)}function h(a,b,c){var d=a.deps[c];return d?d[b]:null}var i;return i=function(){function h(a){var b,e,f;m.noCascade.hasOwnProperty(a)||((e=m.deps.computed[a])&&(e.forEach(c),f=e.map(d),f.forEach(i),f.forEach(h)),(b=m.depsMap.computed[a])&&b.forEach(h))}function i(a){m.mark(a)}var j,k,l=this,m=this,n={};if(j=this.changes,j.length){if(j.forEach(h),k=a(j),k.forEach(function(a){var b,e;(b=m.deps.computed[a])&&(b.forEach(c),e=b.map(d),e.forEach(i),e.forEach(h))}),this.changes=[],this.patternObservers.length&&(k.forEach(function(a){return b(l,a,!0)}),j.forEach(function(a){return b(l,a)})),this.deps.observers&&(k.forEach(function(a){return e(l,null,a,"observers")}),g(this,j,"observers")),this.deps["default"]){var o=[];k.forEach(function(a){return e(l,o,a,"default")}),o.length&&f(this,o,j),g(this,j,"default")}return j.forEach(function(a){n[a]=l.get(a)}),this.implicitChanges={},this.noCascade={},n}}}(Mg,Og),Qg=function(){this.captureGroups.push([])},Rg=function(a,b){var c,d;if(b||(d=this.wrapped[a])&&d.teardown()!==!1&&(this.wrapped[a]=null),this.cache[a]=void 0,c=this.cacheMap[a])for(;c.length;)this.clearCache(c.pop())},Sg=function(){function a(a){var b="var __ractive=this;return("+a.replace(c,function(a,b){return'__ractive.get("'+b+'")'})+")";return new Function(b)}var b,c=/\$\{([^\}]+)\}/g;return b=function(b){return"function"==typeof b?{get:b}:"string"==typeof b?{get:a(b)}:("object"==typeof b&&"string"==typeof b.get&&(b={get:a(b.get),set:b.set}),b)}}(),Tg=function(a,b){var c=function(a,b,c){var d=this;this.ractive=a,this.viewmodel=a.viewmodel,this.key=b,this.getter=c.get,this.setter=c.set,this.hardDeps=c.deps||[],this.softDeps=[],this.depValues={},this.hardDeps&&this.hardDeps.forEach(function(b){return a.viewmodel.register(b,d,"computed")}),this._dirty=this._firstRun=!0};return c.prototype={constructor:c,init:function(){var a;this.bypass=!0,a=this.ractive.viewmodel.get(this.key),this.ractive.viewmodel.clearCache(this.key),this.bypass=!1,this.setter&&void 0!==a&&this.set(a)},invalidate:function(){this._dirty=!0},get:function(){var c,d,e,f=this,g=!1;if(!this.getting){if(this.getting=!0,this._dirty){if(c=this.ractive,this._firstRun||!this.hardDeps.length&&!this.softDeps.length?g=!0:[this.hardDeps,this.softDeps].forEach(function(a){var d,e,h;if(!g)for(h=a.length;h--;)if(d=a[h],e=c.viewmodel.get(d),!b(e,f.depValues[d]))return f.depValues[d]=e,void(g=!0)}),g){c.viewmodel.capture();try{this.value=this.getter.call(c)}catch(h){a.warn({debug:c.debug,message:"failedComputation",args:{key:this.key,err:h.message||h}}),this.value=void 0}d=c.viewmodel.release(),e=this.updateDependencies(d),e&&[this.hardDeps,this.softDeps].forEach(function(a){a.forEach(function(a){f.depValues[a]=c.viewmodel.get(a)})})}this._dirty=!1}return this.getting=this._firstRun=!1,this.value}},set:function(a){if(this.setting)return void(this.value=a);if(!this.setter)throw new Error("Computed properties without setters are read-only. (This may change in a future version of Ractive!)");this.setter.call(this.ractive,a)},updateDependencies:function(a){var b,c,d,e;for(c=this.softDeps,b=c.length;b--;)d=c[b],-1===a.indexOf(d)&&(e=!0,this.viewmodel.unregister(d,this,"computed"));for(b=a.length;b--;)d=a[b],-1!==c.indexOf(d)||this.hardDeps&&-1!==this.hardDeps.indexOf(d)||(e=!0,this.viewmodel.register(d,this,"computed"));return e&&(this.softDeps=a.slice()),e}},c}(o,u),Ug=function(a,b){return function(c,d){return d=a(d),this.computations[c]=new b(this.ractive,c,d)}}(Sg,Tg),Vg={FAILED_LOOKUP:!0},Wg=function(a,b){var c={},d=function(a,d){this.viewmodel=a,this.root=a.ractive,this.ref=d,this.parentFragment=c,a.unresolvedImplicitDependencies[d]=!0,a.unresolvedImplicitDependencies.push(this),b.addUnresolved(this)};return d.prototype={resolve:function(){this.viewmodel.mark(this.ref),this.viewmodel.unresolvedImplicitDependencies[this.ref]=!1,a(this.viewmodel.unresolvedImplicitDependencies,this)},teardown:function(){b.removeUnresolved(this)}},d}(q,y),Xg=function(a,b,c){function d(a,c){var d,e,f,g,h,i,j;return d=c.split("."),e=d.pop(),f=d.join("."),g=a.get(f),(j=a.wrapped[f])&&(g=j.get()),null!==g&&void 0!==g?((h=a.cacheMap[f])?-1===h.indexOf(c)&&h.push(c):a.cacheMap[f]=[c],"object"!=typeof g||e in g?(i=g[e],a.adapt(c,i,!1),a.cache[c]=i,i):a.cache[c]=b):void 0}var e,f={};return e=function(e){var g=arguments[1];void 0===g&&(g=f);var h,i,j,k,l=this.ractive,m=this.cache;return"@"===e[0]?(h=e.slice(1),a(h)?+h:h):(void 0===m[e]?((i=this.computations[e])&&!i.bypass?(h=i.get(),this.adapt(e,h)):(j=this.wrapped[e])?h=j.value:e?h=d(this,e):(this.adapt("",l.data),h=l.data),m[e]=h):h=m[e],g.evaluateWrapped&&(j=this.wrapped[e])&&(h=j.get()),g.capture&&(k=this.captureGroups[this.captureGroups.length-1])&&(~k.indexOf(e)||(k.push(e),h===b&&this.unresolvedImplicitDependencies[e]!==!0&&new c(this,e))),h===b?void 0:h)}}(j,Vg,Wg),Yg=function(){function a(a){a.init()}var b;return b=function(){var b,c,d=[];for(b in this.ractive.computed)c=this.compute(b,this.ractive.computed[b]),d.push(c);d.forEach(a)}}(),Zg=function(a,b){var c;b&&(b.implicit&&(this.implicitChanges[a]=!0),b.noCascade&&(this.noCascade[a]=!0)),(c=this.computations[a])&&c.invalidate(),-1===this.changes.indexOf(a)&&this.changes.push(a),this.clearCache(a)},$g=function(a,b){var c,d,e,f;return c={},d=0,e=a.map(function(a,e){var g,h,i;h=d,i=b.length;do{if(g=b.indexOf(a,h),-1===g)return f=!0,-1;h=g+1}while(c[g]&&i>h);return g===d&&(d+=1),g!==e&&(f=!0),c[g]=!0,g})},_g=function(a,b){function c(a){return JSON.stringify(a)}function d(a){if(a===!0)return c;if("string"==typeof a)return f[a]||(f[a]=function(b){return b[a]}),f[a];if("function"==typeof a)return a;throw new Error("The `compare` option must be a function, or a string representing an identifying field (or `true` to use JSON.stringify)")}var e,f={};return e=function(c,e,f,g){var h,i,j,k;if(this.mark(c),g&&g.compare){j=d(g.compare);try{h=e.map(j),i=f.map(j)}catch(l){if(this.debug)throw l;a("Merge operation: comparison failed. Falling back to identity checking"),h=e,i=f}}else h=e,i=f;k=b(h,i),this.smartUpdate(c,f,k,e.length!==f.length)}}(m,$g),ah=function(){function a(a,b,c){var d,e,f,g;for(d=b.split(".");d.length;)d.pop(),e=d.join("."),f=a.depsMap[c]||(a.depsMap[c]={}),g=f[e]||(f[e]=[]),void 0===g[b]&&(g[b]=0,g.push(b)),g[b]+=1,b=e}var b;return b=function(b,c){var d=arguments[2];void 0===d&&(d="default");var e,f;c.isStatic||(e=this.deps[d]||(this.deps[d]={}),f=e[b]||(e[b]=[]),f.push(c),b&&a(this,b,d))}}(),bh=function(){return this.captureGroups.pop()},ch=function(a,b){function c(a,c,d){var e,f,g,h,i,j,k;j=function(){h.set?h.set(f,d):(i=h.get(),k())},k=function(){i||(i=b(f),a.set(g,i,!0)),i[f]=d},e=c.split("."),f=e.pop(),g=e.join("."),h=a.wrapped[g],h?j():(i=a.get(g),(h=a.wrapped[g])?j():k())}var d;return d=function(b,d,e){var f,g,h;if(f=this.computations[b]){if(f.setting)return;f.set(d),d=f.get()}a(this.cache[b],d)||(g=this.wrapped[b],g&&g.reset&&(h=g.reset(d)!==!1,h&&(d=g.get())),f||h||c(this,b,d),e?this.clearCache(b):this.mark(b))}}(u,z),dh=function(){function a(a){return"function"==typeof a.shuffle}var b,c={implicit:!0},d={noCascade:!0};return b=function(b,e,f){var g,h,i=this;if(h=f.length,f.forEach(function(a,c){-1===a&&i.mark(b+"."+c,d)}),this.set(b,e,!0),(g=this.deps["default"][b])&&g.filter(a).forEach(function(a){return a.shuffle(f,e)}),h!==e.length){this.mark(b+".length",c);for(var j=h;j<e.length;j+=1)this.mark(b+"."+j);for(var k=e.length;h>k;k+=1)this.mark(b+"."+k,d)}}}(),eh=function(){var a,b=this;for(Object.keys(this.cache).forEach(function(a){return b.clearCache(a)});a=this.unresolvedImplicitDependencies.pop();)a.teardown()},fh=function(){function a(a,b,c){var d,e,f,g;for(d=b.split(".");d.length;)d.pop(),e=d.join("."),f=a.depsMap[c],g=f[e],g[b]-=1,g[b]||(g.splice(g.indexOf(b),1),g[b]=void 0),b=e}var b;return b=function(b,c){var d=arguments[2];void 0===d&&(d="default");var e,f;if(!c.isStatic){if(e=this.deps[d][b],f=e.indexOf(c),-1===f)throw new Error("Attempted to remove a dependant that was no longer registered! This should not happen. If you are seeing this bug in development please raise an issue at https://github.com/RactiveJS/Ractive/issues - thanks");e.splice(f,1),b&&a(this,b,d)}}}(),gh=function(){function a(a){return"string"==typeof a&&(a=[a]),a}var b={lookup:function(a,b){var c,d=a.adapt;if(!d||!d.length)return d;if(b&&Object.keys(b).length&&(c=d.length))for(;c--;){var e=d[c];"string"==typeof e&&(d[c]=b[e]||e)}return d},combine:function(b,c){return b=a(b),c=a(c),b&&b.length?c&&c.length?(b.forEach(function(a){-1===c.indexOf(a)&&c.push(a)}),c):b.slice():c}};return b}(),hh=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){var r;try{Object.defineProperty({},"test",{value:0})}catch(s){r=!0}var t=function(b){this.ractive=b,t.extend(b.constructor,b),this.cache={},this.cacheMap=a(null),this.deps={computed:{},"default":{}},this.depsMap={computed:{},"default":{}},this.patternObservers=[],this.wrapped=a(null),this.computations=a(null),this.captureGroups=[],this.unresolvedImplicitDependencies=[],this.changes=[],this.implicitChanges={},this.noCascade={}};return t.extend=function(a,b){if(b.magic&&r)throw new Error("Getters and setters (magic mode) are not supported in this browser");b.adapt=q.combine(a.prototype.adapt,b.adapt)||[],b.adapt=q.lookup(b,b.adaptors)},t.prototype={adapt:b,applyChanges:c,capture:d,clearCache:e,compute:f,get:g,init:h,mark:i,merge:j,register:k,release:l,set:m,smartUpdate:n,teardown:o,unregister:p},t}(T,Lg,Pg,Qg,Rg,Ug,Xg,Yg,Zg,_g,ah,bh,ch,dh,eh,fh,gh),ih=function(a,b,c,d,e,f,g,h){function i(a,c){a._guid=e(),a._subs=b(null),a._config={},a._twowayBindings=b(null),a._animations=[],a.nodes={},a._liveQueries=[],a._liveComponentQueries=[],c._parent&&c._component&&(a._parent=c._parent,a.component=c._component,c._component.instance=a)}var j,k=new f("construct"),l=new f("config"),m=new g("init");return j=function(b){var e=arguments[1];void 0===e&&(e={});var f;if(i(b,e),k.fire(a.getConstructTarget(b,e),e),a.init(b.constructor,b,e),l.fire(b),(f=d(b.el))&&!b.append){if(f.__ractive_instances__)try{f.__ractive_instances__.splice(0,f.__ractive_instances__.length).forEach(function(a){return a.teardown()})}catch(g){}f.innerHTML=""}m.begin(b),b.viewmodel=new h(b),b.viewmodel.init(),b.template&&(b.fragment=new c({template:b.template,root:b,owner:b})),m.end(b),f&&b.render(f,b.append)}}(Vb,T,ng,pc,Fg,p,Gg,hh),jh=function(a,b,c){function d(a,b,c){var d,e=Object.keys(a[c]);e.length&&((d=b[c])||(d=b[c]={}),e.filter(function(a){return!(a in d)}).forEach(function(b){return d[b]=a[c][b]}))}var e,f;return c.push(function(){f=c.Ractive}),e=function(c){if(!(c.prototype instanceof f))return c;for(var e={};c;)b.registries.forEach(function(a){d(a.useDefaults?c.prototype:c,e,a.name)}),Object.keys(c.prototype).forEach(function(b){if("computed"!==b){var d=c.prototype[b];if(b in e){if("function"==typeof e[b]&&"function"==typeof d&&e[b]._method){var f,g=d._method;g&&(d=d._method),f=a(e[b]._method,d),g&&(f._method=f),e[b]=f}}else e[b]=d._method?d._method:d}}),c=c._parent!==f?c._parent:!1;return e}}(Q,Vb,f),kh=function(a,b,c,d,e,f,g){return function h(){var i=arguments[0];void 0===i&&(i={});var j,k,l,m=this;return i=g(i),j=function(a){e(this,a)},k=a(m.prototype),k.constructor=j,l={_guid:{value:c()},defaults:{value:k},extend:{value:h,writable:!0,configurable:!0},_parent:{value:m}},b(j,l),d.extend(m,k,i),f.extend(m,k),j.prototype=k,j}}(T,G,Eg,Vb,ih,hh,jh),lh=function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n,o;
|
||
for(n=function(a){l(this,a)},o={extend:{value:j},parse:{value:k},Promise:{value:h},svg:{value:d},magic:{value:e},VERSION:{value:"0.6.1"},adaptors:{writable:!0,value:{}},components:{writable:!0,value:{}},decorators:{writable:!0,value:{}},easing:{writable:!0,value:b},events:{writable:!0,value:{}},interpolators:{writable:!0,value:c},partials:{writable:!0,value:{}},transitions:{writable:!0,value:{}}},f(n,o),n.prototype=i(g,a),n.prototype.constructor=n,n.defaults=n.prototype,m.Ractive=n;m.length;)m.pop()();var p="function";if(typeof Date.now!==p||typeof String.prototype.trim!==p||typeof Object.keys!==p||typeof Array.prototype.indexOf!==p||typeof Array.prototype.forEach!==p||typeof Array.prototype.map!==p||typeof Array.prototype.filter!==p||"undefined"!=typeof window&&typeof window.addEventListener!==p)throw new Error("It looks like you're attempting to use Ractive.js in an older browser. You'll need to use one of the 'legacy builds' in order to continue - see http://docs.ractivejs.org/latest/legacy-builds for more information.");return n}(d,e,k,l,B,G,Dg,r,ze,kh,Lb,ih,f);"undefined"!=typeof b&&b.exports?b.exports=lh:"function"==typeof define&&define.amd&&define(function(){return lh}),a.Ractive=lh,lh.noConflict=function(){return a.Ractive=c,lh}}("undefined"!=typeof window?window:this)},{}],14:[function(a,b,c){!function(a){function c(a,b){var c=b?P[eb]:P[bb];return c.test(a)?new f(a,b):null}function d(a,b){var d=c(a,b);return d?d.version:null}function e(a,b){var d=c(a.trim().replace(/^[=v]+/,""),b);return d?d.version:null}function f(a,b){if(a instanceof f){if(a.loose===b)return a;a=a.version}else if("string"!=typeof a)throw new TypeError("Invalid Version: "+a);if(!(this instanceof f))return new f(a,b);this.loose=b;var c=a.trim().match(b?P[eb]:P[bb]);if(!c)throw new TypeError("Invalid Version: "+a);this.raw=a,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.prerelease=c[4]?c[4].split(".").map(function(a){return/^[0-9]+$/.test(a)?+a:a}):[],this.build=c[5]?c[5].split("."):[],this.format()}function g(a,b,c,d){"string"==typeof c&&(d=c,c=void 0);try{return new f(a,c).inc(b,d).version}catch(e){return null}}function h(a,b){var c=Eb.test(a),d=Eb.test(b);return c&&d&&(a=+a,b=+b),c&&!d?-1:d&&!c?1:b>a?-1:a>b?1:0}function i(a,b){return h(b,a)}function j(a,b,c){return new f(a,c).compare(b)}function k(a,b){return j(a,b,!0)}function l(a,b,c){return j(b,a,c)}function m(b,c){return b.sort(function(b,d){return a.compare(b,d,c)})}function n(b,c){return b.sort(function(b,d){return a.rcompare(b,d,c)})}function o(a,b,c){return j(a,b,c)>0}function p(a,b,c){return j(a,b,c)<0}function q(a,b,c){return 0===j(a,b,c)}function r(a,b,c){return 0!==j(a,b,c)}function s(a,b,c){return j(a,b,c)>=0}function t(a,b,c){return j(a,b,c)<=0}function u(a,b,c,d){var e;switch(b){case"===":"object"==typeof a&&(a=a.version),"object"==typeof c&&(c=c.version),e=a===c;break;case"!==":"object"==typeof a&&(a=a.version),"object"==typeof c&&(c=c.version),e=a!==c;break;case"":case"=":case"==":e=q(a,c,d);break;case"!=":e=r(a,c,d);break;case">":e=o(a,c,d);break;case">=":e=s(a,c,d);break;case"<":e=p(a,c,d);break;case"<=":e=t(a,c,d);break;default:throw new TypeError("Invalid operator: "+b)}return e}function v(a,b){if(a instanceof v){if(a.loose===b)return a;a=a.value}return this instanceof v?(this.loose=b,this.parse(a),void(this.value=this.semver===Fb?"":this.operator+this.semver.version)):new v(a,b)}function w(a,b){if(a instanceof w&&a.loose===b)return a;if(!(this instanceof w))return new w(a,b);if(this.loose=b,this.raw=a,this.set=a.split(/\s*\|\|\s*/).map(function(a){return this.parseRange(a.trim())},this).filter(function(a){return a.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+a);this.format()}function x(a,b){return new w(a,b).set.map(function(a){return a.map(function(a){return a.value}).join(" ").trim().split(" ")})}function y(a,b){return a=C(a,b),a=A(a,b),a=E(a,b),a=G(a,b)}function z(a){return!a||"x"===a.toLowerCase()||"*"===a}function A(a,b){return a.trim().split(/\s+/).map(function(a){return B(a,b)}).join(" ")}function B(a,b){var c=b?P[qb]:P[pb];return a.replace(c,function(a,b,c,d,e){var f;return z(b)?f="":z(c)?f=">="+b+".0.0 <"+(+b+1)+".0.0":z(d)?f=">="+b+"."+c+".0 <"+b+"."+(+c+1)+".0":e?("-"!==e.charAt(0)&&(e="-"+e),f=">="+b+"."+c+"."+d+e+" <"+b+"."+(+c+1)+".0"):f=">="+b+"."+c+"."+d+" <"+b+"."+(+c+1)+".0",f})}function C(a,b){return a.trim().split(/\s+/).map(function(a){return D(a,b)}).join(" ")}function D(a,b){var c=b?P[vb]:P[ub];return a.replace(c,function(a,b,c,d,e){var f;return z(b)?f="":z(c)?f=">="+b+".0.0 <"+(+b+1)+".0.0":z(d)?f="0"===b?">="+b+"."+c+".0 <"+b+"."+(+c+1)+".0":">="+b+"."+c+".0 <"+(+b+1)+".0.0":e?("-"!==e.charAt(0)&&(e="-"+e),f="0"===b?"0"===c?">="+b+"."+c+"."+d+e+" <"+b+"."+c+"."+(+d+1):">="+b+"."+c+"."+d+e+" <"+b+"."+(+c+1)+".0":">="+b+"."+c+"."+d+e+" <"+(+b+1)+".0.0"):f="0"===b?"0"===c?">="+b+"."+c+"."+d+" <"+b+"."+c+"."+(+d+1):">="+b+"."+c+"."+d+" <"+b+"."+(+c+1)+".0":">="+b+"."+c+"."+d+" <"+(+b+1)+".0.0",f})}function E(a,b){return a.split(/\s+/).map(function(a){return F(a,b)}).join(" ")}function F(a,b){a=a.trim();var c=b?P[lb]:P[kb];return a.replace(c,function(a,b,c,d,e){var f=z(c),g=f||z(d),h=g||z(e),i=h;return"="===b&&i&&(b=""),f?a=">"===b||"<"===b?"<0.0.0":"*":b&&i?(g&&(d=0),h&&(e=0),">"===b?(b=">=",g?(c=+c+1,d=0,e=0):h&&(d=+d+1,e=0)):"<="===b&&(b="<",g?c=+c+1:d=+d+1),a=b+c+"."+d+"."+e):g?a=">="+c+".0.0 <"+(+c+1)+".0.0":h&&(a=">="+c+"."+d+".0 <"+c+"."+(+d+1)+".0"),a})}function G(a){return a.trim().replace(P[Cb],"")}function H(a,b,c,d,e,f,g,h,i,j,k,l){return b=z(c)?"":z(d)?">="+c+".0.0":z(e)?">="+c+"."+d+".0":">="+b,h=z(i)?"":z(j)?"<"+(+i+1)+".0.0":z(k)?"<"+i+"."+(+j+1)+".0":l?"<="+i+"."+j+"."+k+"-"+l:"<="+h,(b+" "+h).trim()}function I(a,b){for(var c=0;c<a.length;c++)if(!a[c].test(b))return!1;if(b.prerelease.length){for(var c=0;c<a.length;c++){if(a[c].semver===Fb)return!0;if(a[c].semver.prerelease.length>0){var d=a[c].semver;if(d.major===b.major&&d.minor===b.minor&&d.patch===b.patch)return!0}}return!1}return!0}function J(a,b,c){try{b=new w(b,c)}catch(d){return!1}return b.test(a)}function K(a,b,c){return a.filter(function(a){return J(a,b,c)}).sort(function(a,b){return l(a,b,c)})[0]||null}function L(a,b){try{return new w(a,b).range||"*"}catch(c){return null}}function M(a,b,c){return O(a,b,"<",c)}function N(a,b,c){return O(a,b,">",c)}function O(a,b,c,d){a=new f(a,d),b=new w(b,d);var e,g,h,i,j;switch(c){case">":e=o,g=t,h=p,i=">",j=">=";break;case"<":e=p,g=s,h=o,i="<",j="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(J(a,b,d))return!1;for(var k=0;k<b.set.length;++k){var l=b.set[k],m=null,n=null;if(l.forEach(function(a){m=m||a,n=n||a,e(a.semver,m.semver,d)?m=a:h(a.semver,n.semver,d)&&(n=a)}),m.operator===i||m.operator===j)return!1;if((!n.operator||n.operator===i)&&g(a,n.semver))return!1;if(n.operator===j&&h(a,n.semver))return!1}return!0}"object"==typeof b&&b.exports===a&&(a=b.exports=f),a.SEMVER_SPEC_VERSION="2.0.0";var P=a.re=[],Q=a.src=[],R=0,S=R++;Q[S]="0|[1-9]\\d*";var T=R++;Q[T]="[0-9]+";var U=R++;Q[U]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var V=R++;Q[V]="("+Q[S]+")\\.("+Q[S]+")\\.("+Q[S]+")";var W=R++;Q[W]="("+Q[T]+")\\.("+Q[T]+")\\.("+Q[T]+")";var X=R++;Q[X]="(?:"+Q[S]+"|"+Q[U]+")";var Y=R++;Q[Y]="(?:"+Q[T]+"|"+Q[U]+")";var Z=R++;Q[Z]="(?:-("+Q[X]+"(?:\\."+Q[X]+")*))";var $=R++;Q[$]="(?:-?("+Q[Y]+"(?:\\."+Q[Y]+")*))";var _=R++;Q[_]="[0-9A-Za-z-]+";var ab=R++;Q[ab]="(?:\\+("+Q[_]+"(?:\\."+Q[_]+")*))";var bb=R++,cb="v?"+Q[V]+Q[Z]+"?"+Q[ab]+"?";Q[bb]="^"+cb+"$";var db="[v=\\s]*"+Q[W]+Q[$]+"?"+Q[ab]+"?",eb=R++;Q[eb]="^"+db+"$";var fb=R++;Q[fb]="((?:<|>)?=?)";var gb=R++;Q[gb]=Q[T]+"|x|X|\\*";var hb=R++;Q[hb]=Q[S]+"|x|X|\\*";var ib=R++;Q[ib]="[v=\\s]*("+Q[hb]+")(?:\\.("+Q[hb]+")(?:\\.("+Q[hb]+")(?:"+Q[Z]+")?"+Q[ab]+"?)?)?";var jb=R++;Q[jb]="[v=\\s]*("+Q[gb]+")(?:\\.("+Q[gb]+")(?:\\.("+Q[gb]+")(?:"+Q[$]+")?"+Q[ab]+"?)?)?";var kb=R++;Q[kb]="^"+Q[fb]+"\\s*"+Q[ib]+"$";var lb=R++;Q[lb]="^"+Q[fb]+"\\s*"+Q[jb]+"$";var mb=R++;Q[mb]="(?:~>?)";var nb=R++;Q[nb]="(\\s*)"+Q[mb]+"\\s+",P[nb]=new RegExp(Q[nb],"g");var ob="$1~",pb=R++;Q[pb]="^"+Q[mb]+Q[ib]+"$";var qb=R++;Q[qb]="^"+Q[mb]+Q[jb]+"$";var rb=R++;Q[rb]="(?:\\^)";var sb=R++;Q[sb]="(\\s*)"+Q[rb]+"\\s+",P[sb]=new RegExp(Q[sb],"g");var tb="$1^",ub=R++;Q[ub]="^"+Q[rb]+Q[ib]+"$";var vb=R++;Q[vb]="^"+Q[rb]+Q[jb]+"$";var wb=R++;Q[wb]="^"+Q[fb]+"\\s*("+db+")$|^$";var xb=R++;Q[xb]="^"+Q[fb]+"\\s*("+cb+")$|^$";var yb=R++;Q[yb]="(\\s*)"+Q[fb]+"\\s*("+db+"|"+Q[ib]+")",P[yb]=new RegExp(Q[yb],"g");var zb="$1$2$3",Ab=R++;Q[Ab]="^\\s*("+Q[ib]+")\\s+-\\s+("+Q[ib]+")\\s*$";var Bb=R++;Q[Bb]="^\\s*("+Q[jb]+")\\s+-\\s+("+Q[jb]+")\\s*$";var Cb=R++;Q[Cb]="(<|>)?=?\\s*\\*";for(var Db=0;R>Db;Db++)P[Db]||(P[Db]=new RegExp(Q[Db]));a.parse=c,a.valid=d,a.clean=e,a.SemVer=f,f.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},f.prototype.inspect=function(){return'<SemVer "'+this+'">'},f.prototype.toString=function(){return this.version},f.prototype.compare=function(a){return a instanceof f||(a=new f(a,this.loose)),this.compareMain(a)||this.comparePre(a)},f.prototype.compareMain=function(a){return a instanceof f||(a=new f(a,this.loose)),h(this.major,a.major)||h(this.minor,a.minor)||h(this.patch,a.patch)},f.prototype.comparePre=function(a){if(a instanceof f||(a=new f(a,this.loose)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.length&&!a.prerelease.length)return 0;var b=0;do{var c=this.prerelease[b],d=a.prerelease[b];if(void 0===c&&void 0===d)return 0;if(void 0===d)return 1;if(void 0===c)return-1;if(c!==d)return h(c,d)}while(++b)},f.prototype.inc=function(a,b){switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",b);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",b);break;case"prepatch":this.prerelease.length=0,this.inc("patch",b),this.inc("pre",b);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",b),this.inc("pre",b);break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var c=this.prerelease.length;--c>=0;)"number"==typeof this.prerelease[c]&&(this.prerelease[c]++,c=-2);-1===c&&this.prerelease.push(0)}b&&(this.prerelease[0]===b?isNaN(this.prerelease[1])&&(this.prerelease=[b,0]):this.prerelease=[b,0]);break;default:throw new Error("invalid increment argument: "+a)}return this.format(),this},a.inc=g,a.compareIdentifiers=h;var Eb=/^[0-9]+$/;a.rcompareIdentifiers=i,a.compare=j,a.compareLoose=k,a.rcompare=l,a.sort=m,a.rsort=n,a.gt=o,a.lt=p,a.eq=q,a.neq=r,a.gte=s,a.lte=t,a.cmp=u,a.Comparator=v;var Fb={};v.prototype.parse=function(a){var b=this.loose?P[wb]:P[xb],c=a.match(b);if(!c)throw new TypeError("Invalid comparator: "+a);this.operator=c[1],"="===this.operator&&(this.operator=""),this.semver=c[2]?new f(c[2],this.loose):Fb},v.prototype.inspect=function(){return'<SemVer Comparator "'+this+'">'},v.prototype.toString=function(){return this.value},v.prototype.test=function(a){return this.semver===Fb?!0:("string"==typeof a&&(a=new f(a,this.loose)),u(a,this.operator,this.semver,this.loose))},a.Range=w,w.prototype.inspect=function(){return'<SemVer Range "'+this.range+'">'},w.prototype.format=function(){return this.range=this.set.map(function(a){return a.join(" ").trim()}).join("||").trim(),this.range},w.prototype.toString=function(){return this.range},w.prototype.parseRange=function(a){var b=this.loose;a=a.trim();var c=b?P[Bb]:P[Ab];a=a.replace(c,H),a=a.replace(P[yb],zb),a=a.replace(P[nb],ob),a=a.replace(P[sb],tb),a=a.split(/\s+/).join(" ");var d=b?P[wb]:P[xb],e=a.split(" ").map(function(a){return y(a,b)}).join(" ").split(/\s+/);return this.loose&&(e=e.filter(function(a){return!!a.match(d)})),e=e.map(function(a){return new v(a,b)})},a.toComparators=x,w.prototype.test=function(a){if(!a)return!1;"string"==typeof a&&(a=new f(a,this.loose));for(var b=0;b<this.set.length;b++)if(I(this.set[b],a))return!0;return!1},a.satisfies=J,a.maxSatisfying=K,a.validRange=L,a.ltr=M,a.gtr=N,a.outside=O,"function"==typeof define&&define.amd&&define(a)}("object"==typeof c?c:"function"==typeof define&&define.amd?{}:semver={})},{}],15:[function(a,b,c){!function(a){function d(a,b,c){for(var d=0,e=a?a.length:d;e>d;){var f=d+e>>>1;c(a[f],b)>0?d=f+1:e=f}return d}"function"==typeof define&&define.amd?define("sortedindex-compare",[],function(){return d}):"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=d),c.sortedIndex=d):a.sortedIndex=d}(this)},{}],16:[function(a,b){function c(){}function d(a){var b={}.toString.call(a);switch(b){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function e(){if(q.XMLHttpRequest&&("file:"!=q.location.protocol||!q.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){}return!1}function f(a){return a===Object(a)}function g(a){if(!f(a))return a;var b=[];for(var c in a)null!=a[c]&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")}function h(a){for(var b,c,d={},e=a.split("&"),f=0,g=e.length;g>f;++f)c=e[f],b=c.split("="),d[decodeURIComponent(b[0])]=decodeURIComponent(b[1]);return d}function i(a){var b,c,d,e,f=a.split(/\r?\n/),g={};f.pop();for(var h=0,i=f.length;i>h;++h)c=f[h],b=c.indexOf(":"),d=c.slice(0,b).toLowerCase(),e=r(c.slice(b+1)),g[d]=e;return g}function j(a){return a.split(/ *; */).shift()}function k(a){return p(a.split(/ *; */),function(a,b){var c=b.split(/ *= */),d=c.shift(),e=c.shift();return d&&e&&(a[d]=e),a},{})}function l(a,b){b=b||{},this.req=a,this.xhr=this.req.xhr,this.text=this.xhr.responseText,this.setStatusProperties(this.xhr.status),this.header=this.headers=i(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text):null}function m(a,b){var c=this;o.call(this),this._query=this._query||[],this.method=a,this.url=b,this.header={},this._header={},this.on("end",function(){try{var b=new l(c);"HEAD"==a&&(b.text=null),c.callback(null,b)}catch(d){var e=new Error("Parser is unable to parse the response");e.parse=!0,e.original=d,c.callback(e)}})}function n(a,b){return"function"==typeof b?new m("GET",a).end(b):1==arguments.length?new m("GET",a):new m(a,b)}var o=a("emitter"),p=a("reduce"),q="undefined"==typeof window?this:window,r="".trim?function(a){return a.trim()}:function(a){return a.replace(/(^\s*|\s*$)/g,"")};n.serializeObject=g,n.parseString=h,n.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},n.serialize={"application/x-www-form-urlencoded":g,"application/json":JSON.stringify},n.parse={"application/x-www-form-urlencoded":h,"application/json":JSON.parse},l.prototype.get=function(a){return this.header[a.toLowerCase()]},l.prototype.setHeaderProperties=function(){var a=this.header["content-type"]||"";this.type=j(a);var b=k(a);for(var c in b)this[c]=b[c]},l.prototype.parseBody=function(a){var b=n.parse[this.type];return b&&a&&a.length?b(a):null},l.prototype.setStatusProperties=function(a){var b=a/100|0;this.status=a,this.statusType=b,this.info=1==b,this.ok=2==b,this.clientError=4==b,this.serverError=5==b,this.error=4==b||5==b?this.toError():!1,this.accepted=202==a,this.noContent=204==a||1223==a,this.badRequest=400==a,this.unauthorized=401==a,this.notAcceptable=406==a,this.notFound=404==a,this.forbidden=403==a},l.prototype.toError=function(){var a=this.req,b=a.method,c=a.url,d="cannot "+b+" "+c+" ("+this.status+")",e=new Error(d);return e.status=this.status,e.method=b,e.url=c,e},n.Response=l,o(m.prototype),m.prototype.use=function(a){return a(this),this},m.prototype.timeout=function(a){return this._timeout=a,this},m.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},m.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},m.prototype.set=function(a,b){if(f(a)){for(var c in a)this.set(c,a[c]);return this}return this._header[a.toLowerCase()]=b,this.header[a]=b,this},m.prototype.unset=function(a){return delete this._header[a.toLowerCase()],delete this.header[a],this},m.prototype.getHeader=function(a){return this._header[a.toLowerCase()]},m.prototype.type=function(a){return this.set("Content-Type",n.types[a]||a),this},m.prototype.accept=function(a){return this.set("Accept",n.types[a]||a),this},m.prototype.auth=function(a,b){var c=btoa(a+":"+b);return this.set("Authorization","Basic "+c),this},m.prototype.query=function(a){return"string"!=typeof a&&(a=g(a)),a&&this._query.push(a),this},m.prototype.field=function(a,b){return this._formData||(this._formData=new FormData),this._formData.append(a,b),this},m.prototype.attach=function(a,b,c){return this._formData||(this._formData=new FormData),this._formData.append(a,b,c),this},m.prototype.send=function(a){var b=f(a),c=this.getHeader("Content-Type");if(b&&f(this._data))for(var d in a)this._data[d]=a[d];else"string"==typeof a?(c||this.type("form"),c=this.getHeader("Content-Type"),this._data="application/x-www-form-urlencoded"==c?this._data?this._data+"&"+a:a:(this._data||"")+a):this._data=a;return b?(c||this.type("json"),this):this},m.prototype.callback=function(a,b){var c=this._callback;return 2==c.length?c(a,b):a?this.emit("error",a):void c(b)},m.prototype.crossDomainError=function(){var a=new Error("Origin is not allowed by Access-Control-Allow-Origin");a.crossDomain=!0,this.callback(a)},m.prototype.timeoutError=function(){var a=this._timeout,b=new Error("timeout of "+a+"ms exceeded");b.timeout=a,this.callback(b)},m.prototype.withCredentials=function(){return this._withCredentials=!0,this},m.prototype.end=function(a){var b=this,f=this.xhr=e(),g=this._query.join("&"),h=this._timeout,i=this._formData||this._data;if(this._callback=a||c,f.onreadystatechange=function(){return 4==f.readyState?0==f.status?b.aborted?b.timeoutError():b.crossDomainError():void b.emit("end"):void 0},f.upload&&(f.upload.onprogress=function(a){a.percent=a.loaded/a.total*100,b.emit("progress",a)}),h&&!this._timer&&(this._timer=setTimeout(function(){b.abort()},h)),g&&(g=n.serializeObject(g),this.url+=~this.url.indexOf("?")?"&"+g:"?"+g),f.open(this.method,this.url,!0),this._withCredentials&&(f.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof i&&!d(i)){var j=n.serialize[this.getHeader("Content-Type")];j&&(i=j(i))}for(var k in this.header)null!=this.header[k]&&f.setRequestHeader(k,this.header[k]);return this.emit("request",this),f.send(i),this},n.Request=m,n.get=function(a,b,c){var d=n("GET",a);return"function"==typeof b&&(c=b,b=null),b&&d.query(b),c&&d.end(c),d},n.head=function(a,b,c){var d=n("HEAD",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},n.del=function(a,b){var c=n("DELETE",a);return b&&c.end(b),c},n.patch=function(a,b,c){var d=n("PATCH",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},n.post=function(a,b,c){var d=n("POST",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},n.put=function(a,b,c){var d=n("PUT",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},b.exports=n},{emitter:17,reduce:18}],17:[function(a,b){function c(a){return a?d(a):void 0}function d(a){for(var b in c.prototype)a[b]=c.prototype[b];return a}b.exports=c,c.prototype.on=c.prototype.addEventListener=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks[a]=this._callbacks[a]||[]).push(b),this},c.prototype.once=function(a,b){function c(){d.off(a,c),b.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},c.fn=b,this.on(a,c),this},c.prototype.off=c.prototype.removeListener=c.prototype.removeAllListeners=c.prototype.removeEventListener=function(a,b){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var c=this._callbacks[a];if(!c)return this;if(1==arguments.length)return delete this._callbacks[a],this;for(var d,e=0;e<c.length;e++)if(d=c[e],d===b||d.fn===b){c.splice(e,1);break}return this},c.prototype.emit=function(a){this._callbacks=this._callbacks||{};var b=[].slice.call(arguments,1),c=this._callbacks[a];if(c){c=c.slice(0);for(var d=0,e=c.length;e>d;++d)c[d].apply(this,b)}return this},c.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},c.prototype.hasListeners=function(a){return!!this.listeners(a).length}},{}],18:[function(a,b){b.exports=function(a,b,c){for(var d=0,e=a.length,f=3==arguments.length?c:a[d++];e>d;)f=b.call(null,f,a[d],++d,a);return f}},{}],19:[function(a){var b,c,d,e;d=a("ractive"),a("ractive-transitions-fade"),a("ractive-ractive"),a("./utils/mixins.coffee"),a("./models/projects.coffee"),b=a("./views/header.coffee"),c=a("./views/notify.coffee"),e=a("./modules/router.coffee"),new d({template:a("./templates/app.html"),el:"body",components:{Header:b,Notify:c},onrender:function(){return e.init("/")}})},{"./models/projects.coffee":22,"./modules/router.coffee":31,"./templates/app.html":33,"./utils/mixins.coffee":48,"./views/header.coffee":52,"./views/notify.coffee":55,ractive:13,"ractive-ractive":11,"ractive-transitions-fade":12}],20:[function(a,b){var c;c=a("../utils/ractive/model.coffee"),b.exports=new c({name:"models/config",data:{firebase:"burnchart",provider:"github",fields:{milestone:["closed_issues","created_at","description","due_on","number","open_issues","title","updated_at"]},chart:{off_days:[],datetime:/^(\d{4}-\d{2}-\d{2})T(.*)/,size_label:/^size (\d+)$/,location:/^#!((\/[^\/]+){2,3})$/,points:"ONE_SIZE"}}})},{"../utils/ractive/model.coffee":50}],21:[function(a,b){var c,d,e,f;c=a("firebase"),d=a("../utils/ractive/model.coffee"),f=a("./user.coffee"),e=a("./config.coffee"),b.exports=new d({name:"models/firebase",login:function(a){return this.data.client||a("Not ready yet"),this.data.client.authWithOAuthPopup("github",function(a){return function(b,c){return b?a.publish("!app/notify",{text:b.toString(),type:"alert",system:!0}):a.onAuth(c)}}(this),{rememberMe:!0,scope:"private_repo"})},onAuth:function(a){return f.set(a),f.set("ready",!0)},logout:function(){throw"Implement"},onrender:function(){var a;return this.set("client",a=new c("https://"+e.data.firebase+".firebaseio.com")),a.onAuth(this.onAuth)}})},{"../utils/ractive/model.coffee":50,"./config.coffee":20,"./user.coffee":24,firebase:6}],22:[function(a,b){var c,d,e,f,g,h,i,j,k,l=[].slice;k=a("lodash"),f=a("lscache"),h=a("sortedindex-compare"),g=a("semver"),c=a("../utils/ractive/model.coffee"),d=a("../models/config.coffee"),i=a("../modules/stats.coffee"),e=a("../utils/date.coffee"),j=a("./user.coffee"),b.exports=new c({name:"models/projects",data:{sortBy:"priority",sortFns:["progress","priority","name"]},comparator:function(){var a,b,c,d,e;switch(e=this.data,c=e.list,d=e.sortBy,a=function(a){return function(b){return function(){var d,e,f,g;return g=arguments[0],f=2<=arguments.length?l.call(arguments,1):[],d=g[0],e=g[1],b.apply(a,[[c[d],c[d].milestones[e]]].concat(f))}}}(this),b=function(a,b){var c,d,e,f,g,h,i,j,k,l;for(l=[],j=0,k=a.length;k>j;j++)d=a[j],l.push(function(){var a;a=[];for(e in b)i=b[e],h=d,a.push(function(){var a,b,d,j;for(d=f=e.split("."),j=[],c=a=0,b=d.length;b>a;c=++a)g=d[c],j.push(c===f.length-1?null!=h[g]?h[g]:h[g]=i:h=null!=h[g]?h[g]:h[g]={});return j}());return a}());return l},d){case"progress":return a(function(a,c){var d,e,f,g;return e=a[0],d=a[1],g=c[0],f=c[1],b([d,f],{"stats.progress.points":0}),d.stats.progress.points-f.stats.progress.points});case"priority":return a(function(a,c){var d,e,f,g,h,i,j;return g=a[0],f=a[1],i=c[0],h=c[1],b([f,h],{"stats.progress.time":0,"stats.days":1e3}),j=k.map([f,h],function(a){var b;return b=a.stats,(b.progress.points-b.progress.time)*b.days}),d=j[0],e=j[1],e-d});case"name":return a(function(a,b){var c,d,e,f,h,i;return d=a[0],c=a[1],f=b[0],e=b[1],(i=f.owner.localeCompare(d.owner))?i:(h=f.name.localeCompare(d.name))?h:g.valid(e.title)&&g.valid(c.title)?g.gt(e.title,c.title):e.title.localeCompare(c.title)});default:return function(){return 0}}},find:function(a){return k.find(this.data.list,a)},exists:function(){return!!this.find.apply(this,arguments)},add:function(a){return this.exists(a)?void 0:this.push("list",a)},findIndex:function(a){var b,c;return c=a.owner,b=a.name,k.findIndex(this.data.list,{owner:c,name:b})},addMilestone:function(a,b){var c,d;if(k.extend(b,{stats:i(b)}),(c=this.findIndex(a))<0)throw 500;return null!=a.milestones?(this.push("list."+c+".milestones",b),d=this.data.list[c].milestones.length-1):(this.set("list."+c+".milestones",[b]),d=0),this.sort([c,d],[a,b])},saveError:function(a,b){var c;if((c=this.findIndex(a))>-1)return null!=a.errors?this.push("list."+c+".errors",b):this.set("list."+c+".errors",[b]);throw 500},clear:function(){return this.set({list:[],index:[]})},sort:function(a,b){var c,d,e,f,g,i,j,k,l,m,n,o;if(e=this.data.index||[],a)d=h(e,b,this.comparator()),e.splice(d,0,a);else for(n=this.data.list,c=j=0,l=n.length;l>j;c=++j)if(i=n[c],null!=i.milestones)for(o=i.milestones,f=k=0,m=o.length;m>k;f=++k)g=o[f],d=h(e,[i,g],this.comparator()),e.splice(d,0,[c,f]);return this.set("index",e)},onconstruct:function(){return this.subscribe("!projects/add",this.add,this),this.subscribe("!projects/clear",this.clear,this)},onrender:function(){return this.set("list",f.get("projects")||[]),this.observe("list",function(a){return f.set("projects",k.pluckMany(a,["owner","name"]))},{init:!1}),this.observe("sortBy",function(){return this.set("index",null),this.sort()},{init:!1})}})},{"../models/config.coffee":20,"../modules/stats.coffee":32,"../utils/date.coffee":45,"../utils/ractive/model.coffee":50,"./user.coffee":24,lodash:7,lscache:8,semver:14,"sortedindex-compare":15}],23:[function(a,b){var c,d,e,f;c=a("../utils/ractive/model.coffee"),f=new c({name:"models/system",data:{loading:!1}}),e=0,d=function(){return e+=1,f.set("loading",!0),function(){return e-=1,f.set("loading",+e)}},b.exports={system:f,async:d}},{"../utils/ractive/model.coffee":50}],24:[function(a,b){var c;c=a("../utils/ractive/model.coffee"),b.exports=new c({name:"models/user"})},{"../utils/ractive/model.coffee":50}],25:[function(a,b){var c;c=a("d3"),b.exports={horizontal:function(a,b){return c.svg.axis().scale(b).orient("bottom").tickSize(-a).tickFormat(function(a){return a.getDate()}).tickPadding(10)},vertical:function(a,b){return c.svg.axis().scale(b).orient("left").tickSize(-a).ticks(5).tickPadding(10)}}},{d3:4}],26:[function(a,b){var c,d,e,f=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};e=a("lodash"),d=a("d3"),c=a("../../models/config.coffee"),b.exports={actual:function(a,b,c){var f,g,h,i,j;return f=[{date:new Date(b),points:c}],h=+1/0,g=-1/0,j=e.map(a,function(a){var b,d;return d=a.size,b=a.closed_at,h>d&&(h=d),d>g&&(g=d),a.date=new Date(b),a.points=c-=d,a}),i=d.scale.linear().domain([h,g]).range([5,8]),j=e.map(j,function(a){return a.radius=i(a.size),a}),[].concat(f,j)},ideal:function(a,b,d){var g,h,i,j,k,l,m,n,o,p,q;return a>b&&(p=[a,b],b=p[0],a=p[1]),q=e.map(a.match(c.data.chart.datetime)[1].split("-"),function(a){return parseInt(a)}),o=q[0],k=q[1],h=q[2],g=new Date(b),i=[],j=0,(m=function(a){var b,d;return b=new Date(o,k-1,h+a),(d=b.getDay())||(d=7),f.call(c.data.chart.off_days,d)>=0?i.push({date:b,off_day:!0}):(j+=1,i.push({date:b})),b>g?void 0:m(a+1)})(0),n=d/(j-1),i=e.map(i,function(a,b){return a.points=d,i[b]&&!i[b].off_day&&(d-=n),a}),(l=new Date)>g&&i.push({date:l,points:0}),i},trend:function(a,b,c){var d,f,g,h,i,j,k,l,m,n,o,p;return a.length?(o=+a[0].date,p=e.map(a,function(a){var b,c;return b=a.date,c=a.points,[+b-o,c]}),m=a[a.length-1],p.push([+new Date-o,m.points]),g=0,i=0,h=0,d=(l=p.length)*e.reduce(p,function(a,b){var c,d;return c=b[0],d=b[1],g+=c,i+=d,h+=Math.pow(c,2),a+c*d},0),n=(d-g*i)/(l*h-Math.pow(g,2)),k=(i-n*g)/l,j=function(a){return n*a+k},b=new Date(b),c=c?new Date(c):new Date,d=b-o,f=c-o,[{date:b,points:j(d)},{date:c,points:j(f)}]):[]}}},{"../../models/config.coffee":20,d3:4,lodash:7}],27:[function(a,b){var c,d,e,f;f=a("lodash"),c=a("async"),d=a("../../models/config.coffee"),e=a("./request.coffee"),b.exports={fetchAll:function(a,b){var g,h;return g=function(a,b){var c,e,g,h;switch(d.data.chart.points){case"ONE_SIZE":for(e=a.length,g=0,h=a.length;h>g;g++)c=a[g],c.size=1;return b(null,{list:a,size:e});case"LABELS":return e=0,a=f.filter(a,function(a){var b;return(b=a.labels)?(a.size=f.reduce(b,function(a,b){var c;return(c=b.name.match(d.data.chart.size_label))?a+=parseInt(c[1]):a},0),e+=a.size,!!a.size):!1}),b(null,{list:a,size:e})}},h=function(b,c){var d,g;return g=[],(d=function(h){return e.allIssues(a,{state:b,page:h},function(a,b){return a?c(a):b.length?(g=g.concat(f.sortBy(b,"closed_at")),b.length<100?c(null,g):d(h+1)):c(null,g)})})(1)},c.parallel([f.partial(c.waterfall,[f.partial(h,"open"),g]),f.partial(c.waterfall,[f.partial(h,"closed"),g])],function(a,c){var d,e;return e=c[0],d=c[1],b(a,{open:e,closed:d})})}}},{"../../models/config.coffee":20,"./request.coffee":29,async:1,lodash:7}],28:[function(a,b){var c;c=a("./request.coffee"),b.exports={fetch:c.oneMilestone,fetchAll:c.allMilestones}},{"./request.coffee":29}],29:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n;n=a("lodash"),l=a("superagent"),m=a("../../models/user.coffee"),l.parse={"application/json":function(a){var b;try{return JSON.parse(a)}catch(c){return b=c,{}}}},c={github:{host:"api.github.com",protocol:"https"}},b.exports={repo:function(a,b){var d,f;return f=a.owner,d=a.name,g({owner:f,name:d})?h(function(){var a;return a=n.defaults({path:"/repos/"+f+"/"+d,headers:e(m.data.accessToken)},c.github),i(a,b)}):b("Request is malformed")},allMilestones:function(a,b){var d,f;return f=a.owner,d=a.name,g({owner:f,name:d})?h(function(){var a;return a=n.defaults({path:"/repos/"+f+"/"+d+"/milestones",query:{state:"open",sort:"due_date",direction:"asc"},headers:e(m.data.accessToken)},c.github),i(a,b)}):b("Request is malformed")},oneMilestone:function(a,b){var d,f,j;return j=a.owner,f=a.name,d=a.milestone,g({owner:j,name:f,milestone:d})?h(function(){var a;return a=n.defaults({path:"/repos/"+j+"/"+f+"/milestones/"+d,query:{state:"open",sort:"due_date",direction:"asc"},headers:e(m.data.accessToken)},c.github),i(a,b)}):b("Request is malformed")},allIssues:function(a,b,d){var f,j,k;return k=a.owner,j=a.name,f=a.milestone,g({owner:k,name:j,milestone:f})?h(function(){var a;return a=n.defaults({path:"/repos/"+k+"/"+j+"/issues",query:n.extend(b,{milestone:f,per_page:"100"}),headers:e(m.data.accessToken)},c.github),i(a,d)}):d("Request is malformed")}},i=function(a,b){var c,d,e,f,g,h,i,k,m,n,o;h=a.protocol,e=a.host,g=a.path,k=a.query,d=a.headers,c=!1,i=k?"?"+function(){var a;a=[];for(f in k)o=k[f],a.push(""+f+"="+o);return a}().join("&"):"",m=l.get(""+h+"://"+e+g+i);for(f in d)o=d[f],m.set(f,o);return n=setTimeout(function(){return c=!0,b("Request has timed out")},1e4),m.end(function(a,d){return c?void 0:(c=!0,clearTimeout(n),j(a,d,b))})},j=function(a,b,c){var e;return a?c(d(a)):2!==b.statusType?c(null!=(null!=b&&null!=(e=b.body)?e.message:void 0)?b.body.message:b.error.message):c(null,b.body)},e=function(a){var b;return b={"Content-Type":"application/json",Accept:"application/vnd.github.v3"},null!=a&&(b.Authorization="token "+a),b
|
||
},g=function(a){var b,c,d;c={owner:function(a){return null!=a},name:function(a){return null!=a},milestone:function(a){return n.isInt(a)}};for(b in a)if(d=a[b],b in c&&!c[b](d))return!1;return!0},f=m.data.ready,k=[],h=function(a){return f?a():k.push(a)},m.observe("ready",function(a){var b;if(f=a,a){for(b=[];k.length;)b.push(k.shift()());return b}}),d=function(a){var b;switch(!1){case!n.isString(a):b=a;break;case!n.isArray(a):b=a[1];break;case!(n.isObject(a)&&n.isString(a.message)):b=a.message}if(!b)try{b=JSON.stringify(a)}catch(c){b=a.toString()}return b}},{"../../models/user.coffee":24,lodash:7,superagent:16}],30:[function(a,b){var c,d;d=a("ractive"),c=d.extend({}),b.exports=new c},{ractive:13}],31:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=[].slice;m=a("lodash"),e=a("director"),g=a("./mediator.coffee"),k=a("../models/system.coffee"),f="#page",h={index:a("../views/pages/index.coffee"),milestone:a("../views/pages/milestone.coffee"),"new":a("../views/pages/new.coffee"),project:a("../views/pages/project.coffee")},c=function(a,b,c){return g.fire("!projects/add",{owner:b,name:c})},d=function(a,b){var c,d,e,f;for(null==b&&(b=[]),f=[],d=0,e=b.length;e>d;d++)c=b[d],f.push(m.partial(c,a));return f},l=null,i=function(){var a,b,c;return c=arguments[0],b=2<=arguments.length?n.call(arguments,1):[],null!=l&&l.teardown(),g.fire("!app/notify/hide"),a=h[c],l=new a({el:f,data:{route:b}})},j={"/":d("index",[i]),"/new/project":d("new",[i]),"/:owner/:name":d("project",[c,i]),"/:owner/:name/:milestone":d("milestone",[c,i]),"/reset":function(){return g.fire("!projects/clear"),window.location.hash="#"}},b.exports=e.Router(j).configure({strict:!1,notfound:function(){throw 404}})},{"../models/system.coffee":23,"../views/pages/index.coffee":56,"../views/pages/milestone.coffee":57,"../views/pages/new.coffee":58,"../views/pages/project.coffee":59,"./mediator.coffee":30,director:5,lodash:7}],32:[function(a,b){var c,d;c=a("moment"),d=function(a,b){return 100*(a/(b+a))},b.exports=function(a){var b,e,f,g,h,i,j,k,l;return h=!1,i=!0,j=!1,k=d(a.issues.closed.size,a.issues.open.size),100===k&&(h=!0),a.due_on?(b=+new Date(a.created_at),e=+new Date,f=+new Date(a.due_on),e>f&&(j=!0),l=d(e-b,f-e),g=c(e).diff(c(b),"days")/100,i=k>l,{isDone:h,days:g,isOnTime:i,isOverdue:j,progress:{points:k,time:l}}):{isOverdue:j,isOnTime:i,isDone:h,progress:{points:k}}}},{moment:10}],33:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"app"},f:[{t:7,e:"Notify"}," ",{t:7,e:"Header"}," ",{t:7,e:"div",a:{id:"page"},f:[]}," ",{t:7,e:"div",a:{id:"footer"},f:[{t:7,e:"div",a:{"class":"wrap"},f:["© 2012-2014 ",{t:7,e:"a",a:{href:"http://cloudfi.re"},f:["Cloudfire Systems"]}]}]}]}]}},{}],34:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"chart"}}]}},{}],35:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"head"},f:[{t:4,n:53,r:"user",f:[{t:4,r:"ready",f:[{t:7,e:"div",a:{"class":"right"},t1:"fade",f:[{t:4,r:"uid",f:[{t:2,r:"github.displayName"}," logged in"]},{t:4,n:51,f:[{t:7,e:"a",a:{"class":"github"},v:{click:"!login"},f:[{t:7,e:"Icons",a:{icon:"github"}}," Sign In"]}],r:"uid"}]}]}]}," ",{t:7,e:"a",a:{id:"icon",href:"#"},f:[{t:7,e:"Icons",a:{icon:[{t:2,r:"icon"}]}}]}," ",{t:7,e:"ul",f:[{t:7,e:"li",f:[{t:7,e:"a",a:{href:"#new/project","class":"add"},f:[{t:7,e:"Icons",a:{icon:"plus-circled"}}," Add a Project"]}]}," ",{t:7,e:"li",f:[{t:7,e:"a",a:{href:"#","class":"faq"},f:["FAQ"]}]}," ",{t:7,e:"li",f:[{t:7,e:"a",a:{href:"#reset"},f:["DB Reset"]}]}]}]}]}},{}],36:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"hero"},f:[{t:7,e:"div",a:{"class":"content"},f:[{t:7,e:"Icons",a:{icon:"address"}}," ",{t:7,e:"h2",f:["See your project progress"]}," ",{t:7,e:"p",f:["Not sure where to start? Just add a demo repo to see a chart. There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable."]}," ",{t:7,e:"div",a:{"class":"cta"},f:[{t:7,e:"a",a:{href:"#new/project","class":"primary"},f:[{t:7,e:"Icons",a:{icon:"plus-circled"}}," Add your project"]}," ",{t:7,e:"a",a:{href:"#","class":"secondary"},f:["Read the Guide"]}]}]}]}]}},{}],37:[function(a,b){b.exports={v:1,t:[{t:4,r:"code",f:[{t:7,e:"span",a:{"class":["icon ",{t:2,r:"icon"}]},f:[{t:3,x:{r:["code"],s:'"&#"+_0+";"'}}]}]}]}},{}],38:[function(a,b){b.exports={v:1,t:[{t:4,r:"text",f:[{t:4,r:"system",f:[{t:7,e:"div",a:{id:"notify","class":[{t:2,r:"type"}," system"],style:["top:",{t:2,r:"top"},"%"]},f:[{t:7,e:"Icons",a:{icon:[{t:2,r:"icon"}]}}," ",{t:7,e:"p",f:[{t:2,r:"text"}]}]}]},{t:4,n:51,f:[{t:7,e:"div",a:{id:"notify","class":[{t:2,r:"type"}],style:["top:",{t:2,x:{r:["top"],s:"-_0"}},"px"]},f:[{t:7,e:"span",a:{"class":"close"},v:{click:"close"}}," ",{t:7,e:"Icons",a:{icon:[{t:2,r:"icon"}]}}," ",{t:7,e:"p",f:[{t:2,r:"text"}]}]}],r:"system"}]}]}},{}],39:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"content","class":"wrap"},f:[{t:4,n:50,r:"projects.list",f:[{t:4,r:"ready",f:[{t:7,e:"div",t1:"fade",f:[{t:7,e:"Projects",a:{projects:[{t:2,r:"projects"}]}}]}]}]},{t:4,n:51,f:[{t:7,e:"Hero"}],r:"projects.list"}]}]}},{}],40:[function(a,b){b.exports={v:1,t:[{t:4,r:"ready",f:[{t:7,e:"div",t1:"fade",f:[{t:7,e:"div",a:{id:"title"},f:[{t:7,e:"div",a:{"class":"wrap"},f:[{t:7,e:"h2",a:{"class":"title"},f:[{t:2,x:{r:["format","milestone.title"],s:"_0.title(_1)"}}]}," ",{t:7,e:"span",a:{"class":"sub"},f:[{t:3,x:{r:["format","milestone.due_on"],s:"_0.due(_1)"}}]}," ",{t:7,e:"p",a:{"class":"description"},f:[{t:3,x:{r:["format","milestone.description"],s:"_0.markdown(_1)"}}]}]}]}," ",{t:7,e:"div",a:{id:"content","class":"wrap"},f:[{t:7,e:"Chart",a:{milestone:[{t:2,r:"milestone"}]}}]}]}]}]}},{}],41:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"content","class":"wrap"},f:[{t:7,e:"div",a:{id:"add"},f:[{t:7,e:"div",a:{"class":"header"},f:[{t:7,e:"h2",f:["Add a Project"]}," ",{t:7,e:"p",f:["Type in the name of the repository as you would normally. ",{t:4,n:53,r:"user",f:[{t:4,r:"ready",f:[{t:4,r:"uid",f:["If you'd like to add a private GitHub project, ",{t:7,e:"a",v:{click:"!login"},f:["Sign In"]}," first."],n:51}]}]}]}]}," ",{t:7,e:"div",a:{"class":"form"},f:[{t:7,e:"table",f:[{t:7,e:"tr",f:[{t:7,e:"td",f:[{t:7,e:"input",a:{type:"text",placeholder:"user/repo",autocomplete:"off",value:[{t:2,r:"value"}]},v:{keyup:{n:"submit",d:[{t:2,r:"value"}]}}}]}," ",{t:7,e:"td",f:[{t:7,e:"a",v:{click:{n:"submit",d:[{t:2,r:"value"}]}},f:["Add"]}]}]}]}]}]}]}]}},{}],42:[function(a,b){b.exports={v:1,t:[{t:4,r:"ready",f:[{t:7,e:"div",t1:"fade",f:[{t:7,e:"div",a:{id:"title"},f:[{t:7,e:"div",a:{"class":"wrap"},f:[{t:7,e:"h2",a:{"class":"title"},f:[{t:2,x:{r:["route"],s:'_0.join("/")'}}]}]}]}," ",{t:7,e:"div",a:{id:"content","class":"wrap"},f:[{t:7,e:"Milestones",a:{project:[{t:2,r:"project"}]}}]}]}]}]}},{}],43:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"projects"},f:[{t:7,e:"div",a:{"class":"header"},f:[{t:7,e:"a",a:{"class":"sort"},v:{click:"sortBy"},f:[{t:7,e:"Icons",a:{icon:"sort-alphabet"}}," Sorted by ",{t:2,r:"projects.sortBy"}]}," ",{t:7,e:"h2",f:["Milestones"]}]}," ",{t:7,e:"table",f:[{t:4,r:"projects.index",f:[{t:4,x:{r:["."],s:"{index:_0}"},f:[{t:4,x:{r:["index.0","projects.list"],s:"{p:_1[_0]}"},f:[{t:4,n:50,x:{r:["p.owner","project.owner","p.name","project.name"],s:"_0==_1&&_2==_3"},f:[{t:4,x:{r:["index.1","project.milestones"],s:"{milestone:_1[_0]}"},f:[{t:7,e:"tr",a:{"class":[{t:4,n:50,r:"milestone.stats.isDone",f:["done"]}]},f:[{t:7,e:"td",f:[{t:7,e:"a",a:{"class":"milestone",href:["#",{t:2,r:"project.owner"},"/",{t:2,r:"project.name"},"/",{t:2,r:"milestone.number"}]},f:[{t:2,r:"milestone.title"}]}]}," ",{t:7,e:"td",a:{style:"width:1%"},f:[{t:7,e:"div",a:{"class":"progress"},f:[{t:7,e:"span",a:{"class":"percent"},f:[{t:2,x:{r:["milestone.stats.progress.points"],s:"Math.floor(_0)"}},"%"]}," ",{t:7,e:"span",a:{"class":["due ",{t:4,n:50,r:"milestone.stats.isOverdue",f:["red"]}]},f:[{t:3,x:{r:["format","milestone.due_on"],s:"_0.due(_1)"}}]}," ",{t:7,e:"div",a:{"class":"outer bar"},f:[{t:7,e:"div",a:{"class":["inner bar ",{t:2,x:{r:["milestone.stats.isOnTime"],s:'(_0)?"green":"red"'}}],style:["width:",{t:2,r:"milestone.stats.progress.points"},"%"]}}]}]}]}]}]}]}]}]}]}]}," ",{t:7,e:"div",a:{"class":"footer"},f:[]}]}]}},{}],44:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"projects"},f:[{t:7,e:"div",a:{"class":"header"},f:[{t:7,e:"a",a:{"class":"sort"},v:{click:"sortBy"},f:[{t:7,e:"Icons",a:{icon:"sort-alphabet"}}," Sorted by ",{t:2,r:"projects.sortBy"}]}," ",{t:7,e:"h2",f:["Projects"]}]}," ",{t:7,e:"table",f:[{t:4,r:"projects.list",f:[{t:4,n:50,r:"errors",f:[{t:7,e:"tr",f:[{t:7,e:"td",a:{colspan:"3","class":"repo"},f:[{t:7,e:"div",a:{"class":"project"},f:[{t:2,r:"owner"},"/",{t:2,r:"name"}," ",{t:7,e:"span",a:{"class":"error",title:[{t:2,x:{r:["errors"],s:'_0.join("\\n")'}}]},f:[{t:7,e:"Icons",a:{icon:"attention"}}]}]}]}]}]}]}," ",{t:4,r:"projects.index",f:[{t:4,x:{r:["."],s:"{index:_0}"},f:[{t:4,x:{r:["index.0","projects.list"],s:"{project:_1[_0]}"},f:[{t:4,n:53,r:"project",f:[{t:4,x:{r:["index.1","project.milestones"],s:"{milestone:_1[_0]}"},f:[{t:7,e:"tr",a:{"class":[{t:4,n:50,r:"milestone.stats.isDone",f:["done"]}]},f:[{t:7,e:"td",a:{"class":"repo"},f:[{t:7,e:"a",a:{"class":"project",href:["#",{t:2,r:"owner"},"/",{t:2,r:"name"}]},f:[{t:2,r:"owner"},"/",{t:2,r:"name"}]}]}," ",{t:7,e:"td",f:[{t:7,e:"a",a:{"class":"milestone",href:["#",{t:2,r:"owner"},"/",{t:2,r:"name"},"/",{t:2,r:"milestone.number"}]},f:[{t:2,r:"milestone.title"}]}]}," ",{t:7,e:"td",a:{style:"width:1%"},f:[{t:7,e:"div",a:{"class":"progress"},f:[{t:7,e:"span",a:{"class":"percent"},f:[{t:2,x:{r:["milestone.stats.progress.points"],s:"Math.floor(_0)"}},"%"]}," ",{t:7,e:"span",a:{"class":["due ",{t:4,n:50,r:"milestone.stats.isOverdue",f:["red"]}]},f:[{t:3,x:{r:["format","milestone.due_on"],s:"_0.due(_1)"}}]}," ",{t:7,e:"div",a:{"class":"outer bar"},f:[{t:7,e:"div",a:{"class":["inner bar ",{t:2,x:{r:["milestone.stats.isOnTime"],s:'(_0)?"green":"red"'}}],style:["width:",{t:2,r:"milestone.stats.progress.points"},"%"]}}]}]}]}]}]}]}]}]}]}]}," ",{t:7,e:"div",a:{"class":"footer"},f:[]}]}]}},{}],45:[function(a,b){b.exports={now:function(){return(new Date).toJSON()}}},{}],46:[function(a,b){var c,d,e;e=a("lodash"),d=a("moment"),c=a("marked"),b.exports={fromNow:e.memoize(function(a){return d(new Date(a)).fromNow()}),due:function(a){return a?["due",this.fromNow(a)].join(" "):" "},markdown:function(a){return c(a)},title:function(a){return a.toLowerCase().indexOf("milestone")>-1?a:["Milestone",a].join(" ")},hexToDec:function(a){return parseInt(a,16)}}},{lodash:7,marked:9,moment:10}],47:[function(a,b){b.exports={is:function(a){var b;return"keyup"===(b=a.original.type)||"keydown"===b},isEnter:function(a){return 13===a.original.which}}},{}],48:[function(a){var b;b=a("lodash"),b.mixin({pluckMany:function(a,c){if(!b.isArray(c))throw"`keys` needs to be an Array";return b.map(a,function(a){var d;return d={},b.each(c,function(b){return d[b]=a[b]}),d})},isInt:function(a){return!isNaN(a)&&parseInt(Number(a))===a&&!isNaN(parseInt(a,10))}})},{lodash:7}],49:[function(a,b){var c,d,e;e=a("lodash"),c=a("ractive"),d=a("../../modules/mediator.coffee"),b.exports=c.extend({subscribe:function(a,b,c){return null==c&&(c=this),e.isArray(this._subs)||(this._subs=[]),e.isFunction(b)?this._subs.push(d.on(a,e.bind(b,c))):console.log("Warning: `cb` is not a function")},publish:function(){return d.fire.apply(d,arguments)},onteardown:function(){var a,b,c,d,f;if(e.isArray(this._subs)){for(d=this._subs,f=[],b=0,c=d.length;c>b;b++)a=d[b],f.push(e.isFunction(a.cancel)?a.cancel():console.log("Warning: `sub.cancel` is not a function"));return f}}})},{"../../modules/mediator.coffee":30,lodash:7,ractive:13}],50:[function(a,b){var c;c=a("./eventful.coffee"),b.exports=function(a){var b,d;return b=c.extend(a),d=new b,d.render(),d}},{"./eventful.coffee":49}],51:[function(a,b){var c,d,e,f;c=a("ractive"),e=a("d3"),a("d3-tip")(e),f=a("../modules/chart/lines.coffee"),d=a("../modules/chart/axes.coffee"),b.exports=c.extend({name:"views/chart",template:a("../templates/chart.html"),oncomplete:function(){var a,b,c,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;return m=this.data.milestone,h=m.issues,p=h.open.size+h.closed.size,b=h.closed.list[0].closed_at,h.length&&m.created_at>b&&(m.created_at=b),a=f.actual(h.closed.list,m.created_at,p),g=f.ideal(m.created_at,m.due_on,p),q=f.trend(a,m.created_at,m.due_on),w=this.el.getBoundingClientRect(),c=w.height,r=w.width,l={top:30,right:30,bottom:40,left:50},r-=l.left+l.right,c-=l.top+l.bottom,s=e.time.scale().range([0,r]),u=e.scale.linear().range([c,0]),t=d.horizontal(c,s),v=d.vertical(r,u),i=e.svg.line().interpolate("linear").x(function(a){return s(a.date)}).y(function(a){return u(a.points)}),s.domain([g[0].date,g[g.length-1].date]),u.domain([0,g[0].points]).nice(),n=e.select(this.el.querySelector("#chart")).append("svg").attr("width",r+l.left+l.right).attr("height",c+l.top+l.bottom).append("g").attr("transform","translate("+l.left+","+l.top+")"),n.append("g").attr("class","x axis day").attr("transform","translate(0,"+c+")").call(t),j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],k=t.orient("top").tickSize(c).tickFormat(function(a){return j[a.getMonth()]}).ticks(2),n.append("g").attr("class","x axis month").attr("transform","translate(0,"+c+")").call(k),n.append("g").attr("class","y axis").call(v),n.append("svg:line").attr("class","today").attr("x1",s(new Date)).attr("y1",0).attr("x2",s(new Date)).attr("y2",c),n.append("path").attr("class","ideal line").attr("d",i.interpolate("basis")(g)),n.append("path").attr("class","trendline line").attr("d",i.interpolate("linear")(q)),n.append("path").attr("class","actual line").attr("d",i.interpolate("linear").y(function(a){return u(a.points)})(a)),o=e.tip().attr("class","d3-tip").html(function(a){var b,c;return b=a.number,c=a.title,"#"+b+": "+c}),n.call(o),n.selectAll("a.issue").data(a.slice(1)).enter().append("svg:a").attr("xlink:href",function(a){var b;return b=a.html_url}).attr("xlink:show","new").append("svg:circle").attr("cx",function(a){var b;return b=a.date,s(b)}).attr("cy",function(a){var b;return b=a.points,u(b)}).attr("r",function(a){var b;return b=a.radius,5}).on("mouseover",o.show).on("mouseout",o.hide)}})},{"../modules/chart/axes.coffee":25,"../modules/chart/lines.coffee":26,"../templates/chart.html":34,d3:4,"d3-tip":3,ractive:13}],52:[function(a,b){var c,d,e,f,g;d=a("ractive"),f=a("../models/system.coffee").system,e=a("../models/firebase.coffee"),g=a("../models/user.coffee"),c=a("./icons.coffee"),b.exports=d.extend({name:"views/header",template:a("../templates/header.html"),data:{user:g,icon:"fire-station"},components:{Icons:c},adapt:[d.adaptors.Ractive],onconstruct:function(){return this.on("!login",function(){return e.login()})},onrender:function(){return f.observe("loading",function(a){return function(b){return a.set("icon",b?"spinner1":"fire-station")}}(this))}})},{"../models/firebase.coffee":21,"../models/system.coffee":23,"../models/user.coffee":24,"../templates/header.html":35,"./icons.coffee":54,ractive:13}],53:[function(a,b){var c,d;d=a("ractive"),c=a("./icons.coffee"),b.exports=d.extend({name:"views/hero",template:a("../templates/hero.html"),components:{Icons:c},adapt:[d.adaptors.Ractive]})},{"../templates/hero.html":36,"./icons.coffee":54,ractive:13}],54:[function(a,b){var c,d,e;c=a("ractive"),e=a("../utils/format.coffee"),d={cog:"e800",search:"e801",github:"e802",address:"e803","plus-circled":"e804","fire-station":"e805","sort-alphabet":"e806","down-open":"e807",spin6:"e808",megaphone:"e809",spin4:"e80a",spinner1:"e80b",attention:"e80c"},b.exports=c.extend({name:"views/icons",template:a("../templates/icons.html"),isolated:!0,onrender:function(){return this.observe("icon",function(a){var b;return a&&(b=d[a])?this.set("code",e.hexToDec(b)):this.set("code",null)})}})},{"../templates/icons.html":37,"../utils/format.coffee":46,ractive:13}],55:[function(a,b){var c,d,e,f,g,h;h=a("lodash"),f=a("ractive"),g=a("d3"),c=a("../utils/ractive/eventful.coffee"),e=a("./icons.coffee"),d=68,b.exports=c.extend({name:"views/notify",template:a("../templates/notify.html"),data:{top:d,hidden:!0,defaults:{text:"",type:"",system:!1,icon:"megaphone",ttl:5e3}},components:{Icons:e},adapt:[f.adaptors.Ractive],show:function(a){var b;return this.set("hidden",!1),this.set(a=h.defaults(a,this.data.defaults)),b=[0,50][+a.system],this.animate("top",b,{easing:g.ease("bounce"),duration:800}),a.ttl?h.delay(h.bind(this.hide,this),a.ttl):void 0},hide:function(){return this.data.hidden?void 0:(this.set("hidden",!0),this.animate("top",d,{easing:g.ease("back"),complete:function(a){return function(){return a.set("text",null)}}(this)}))},onconstruct:function(){return this.subscribe("!app/notify",this.show,this),this.subscribe("!app/notify/hide",this.hide,this),this.on("close",this.hide)}})},{"../templates/notify.html":38,"../utils/ractive/eventful.coffee":49,"./icons.coffee":54,d3:4,lodash:7,ractive:13}],56:[function(a,b){var c,d,e,f,g,h,i,j,k;k=a("lodash"),e=a("ractive"),f=a("async"),c=a("../hero.coffee"),d=a("../tables/projects.coffee"),i=a("../../models/projects.coffee"),j=a("../../models/system.coffee"),h=a("../../modules/github/milestones.coffee"),g=a("../../modules/github/issues.coffee"),b.exports=e.extend({name:"views/pages/index",template:a("../../templates/pages/index.html"),components:{Hero:c,Projects:d},data:{projects:i,ready:!1},adapt:[e.adaptors.Ractive],onrender:function(){var a;return document.title="Burnchart: GitHub Burndown Chart as a Service",i.list.length?(a=j.async(),f.map(i.data.list,function(a,b){return h.fetchAll(a,function(c,d){return c?(i.saveError(a,c),b()):f.each(d,function(b,c){return k.find(a.milestones,function(a){var c;return c=a.number,b.number===c})?c(null):g.fetchAll({owner:a.owner,name:a.name,milestone:b.number},function(d,e){return d?(i.saveError(a,d),c()):(k.extend(b,{issues:e}),i.addMilestone(a,b),c())})},b)})},function(b){return function(){return a(),b.set("ready",!0)}}(this))):this.set("ready",!0)}})},{"../../models/projects.coffee":22,"../../models/system.coffee":23,"../../modules/github/issues.coffee":27,"../../modules/github/milestones.coffee":28,"../../templates/pages/index.html":39,"../hero.coffee":53,"../tables/projects.coffee":61,async:1,lodash:7,ractive:13}],57:[function(a,b){var c,d,e,f,g,h,i,j,k;k=a("lodash"),e=a("async"),c=a("../chart.coffee"),d=a("../../utils/ractive/eventful.coffee"),i=a("../../models/projects.coffee"),j=a("../../models/system.coffee"),h=a("../../modules/github/milestones.coffee"),g=a("../../modules/github/issues.coffee"),f=a("../../utils/format.coffee"),b.exports=d.extend({name:"views/pages/chart",template:a("../../templates/pages/milestone.html"),components:{Chart:c},data:{format:f,ready:!1},onrender:function(){var a,b,c,d,f,l,m,n,o;if(o=this.get("route"),m=o[0],f=o[1],d=o[2],d=parseInt(d),document.title=""+m+"/"+f+"/"+d,n=i.find({owner:m,name:f}),!n)throw 500;return l=k.find(n.milestones,{number:d}),null!=l?this.set({milestone:l,ready:!0}):(a=j.async(),c=function(a){return h.fetch({owner:m,name:f,milestone:d},a)},b=function(a,b){return g.fetchAll({owner:m,name:f,milestone:d},function(c,d){return b(c,k.extend(a,{issues:d}))})},e.waterfall([c,b],function(b){return function(c,d){return a(),c?b.publish("!app/notify",{text:c.toString(),type:"alert",system:!0,ttl:null}):(i.addMilestone(n,d),d.stats.isDone&&b.publish("!app/notify",{text:"The milestone is complete",type:"success"}),d.stats.isOverdue&&b.publish("!app/notify",{text:"The milestone is overdue",type:"warn"}),b.set({milestone:d,ready:!0}))}}(this)))}})},{"../../models/projects.coffee":22,"../../models/system.coffee":23,"../../modules/github/issues.coffee":27,"../../modules/github/milestones.coffee":28,"../../templates/pages/milestone.html":40,"../../utils/format.coffee":46,"../../utils/ractive/eventful.coffee":49,"../chart.coffee":51,async:1,lodash:7}],58:[function(a,b){var c,d,e,f,g,h,i;i=a("lodash"),d=a("ractive"),c=a("../../utils/ractive/eventful.coffee"),e=a("../../models/firebase.coffee"),g=a("../../models/system.coffee"),h=a("../../models/user.coffee"),f=a("../../utils/key.coffee"),b.exports=c.extend({name:"views/pages/new",template:a("../../templates/pages/new.html"),data:{value:"radekstepan/disposable",user:h},adapt:[d.adaptors.Ractive],submit:function(a,b){var c,d,e;if(!f.is(a)||f.isEnter(a))return e=b.split("/"),d=e[0],c=e[1],this.publish("!projects/add",{owner:d,name:c}),window.location.hash="#"},onconstruct:function(){return this.on("!login",function(){return e.login()})},onrender:function(){var a;return document.title="Add a new project",a=function(){},this.observe("value",i.debounce(a,200),{init:!1}),this.el.querySelector("input").focus(),this.on("submit",this.submit)}})},{"../../models/firebase.coffee":21,"../../models/system.coffee":23,"../../models/user.coffee":24,"../../templates/pages/new.html":41,"../../utils/key.coffee":47,"../../utils/ractive/eventful.coffee":49,lodash:7,ractive:13}],59:[function(a,b){var c,d,e,f,g,h,i,j;j=a("lodash"),e=a("async"),d=a("../tables/milestones.coffee"),c=a("../../utils/ractive/eventful.coffee"),h=a("../../models/projects.coffee"),i=a("../../models/system.coffee"),g=a("../../modules/github/milestones.coffee"),f=a("../../modules/github/issues.coffee"),b.exports=c.extend({name:"views/pages/project",template:a("../../templates/pages/project.html"),components:{Milestones:d},data:{projects:h,ready:!1},onrender:function(){var a,b,c,d,k,l,m,n;if(n=this.get("route"),l=n[0],k=n[1],document.title=""+l+"/"+k,this.set("project",m=h.find({owner:l,name:k})),!m)throw 500;return a=i.async(),d=function(a){return j.find(m.milestones||[],{number:a})},c=function(a){return g.fetchAll(m,a)},b=function(a,b){return a.length?e.each(a,function(a,b){return d(a.number)?b(null):f.fetchAll({owner:l,name:k,milestone:a.number},function(c,d){return c?b(c):(h.addMilestone(m,j.extend(a,{issues:d})),b())})},b):b("The project has no milestones")},e.waterfall([c,b],function(b){return function(c){return a(),c?b.publish("!app/notify",{text:c.toString(),type:"alert",system:!0,ttl:null}):b.set("ready",!0)}}(this))}})},{"../../models/projects.coffee":22,"../../models/system.coffee":23,"../../modules/github/issues.coffee":27,"../../modules/github/milestones.coffee":28,"../../templates/pages/project.html":42,"../../utils/ractive/eventful.coffee":49,"../tables/milestones.coffee":60,async:1,lodash:7}],60:[function(a,b){var c;c=a("./table.coffee"),b.exports=c.extend({name:"views/milestones",template:a("../../templates/tables/milestones.html")})},{"../../templates/tables/milestones.html":43,"./table.coffee":62}],61:[function(a,b){var c;c=a("./table.coffee"),b.exports=c.extend({name:"views/projects",template:a("../../templates/tables/projects.html")})},{"../../templates/tables/projects.html":44,"./table.coffee":62}],62:[function(a,b){var c,d,e,f;d=a("ractive"),e=a("../../utils/format.coffee"),c=a("../icons.coffee"),f=a("../../models/projects.coffee"),b.exports=d.extend({name:"views/table",data:{format:e},components:{Icons:c},adapt:[d.adaptors.Ractive],onconstruct:function(){return this.on("sortBy",function(){var a,b;return a=f.data.sortFns,b=1+a.indexOf(f.data.sortBy),b===a.length&&(b=0),f.set("sortBy",a[b])})}})},{"../../models/projects.coffee":22,"../../utils/format.coffee":46,"../icons.coffee":54,ractive:13}]},{},[19]); |