Comparing version 6.0.0-beta1 to 6.0.0-beta2
## Changelog | ||
## 6.0.0-beta2 | ||
* Finished movetip.js | ||
* Pushed to npm | ||
## 6.0.0 | ||
@@ -4,0 +9,0 @@ |
@@ -9,3 +9,2 @@ wax = wax || {}; | ||
// Active feature | ||
_af, | ||
// Down event | ||
@@ -69,16 +68,9 @@ _d, | ||
if (feature) { | ||
if (feature && _af !== feature) { | ||
_af = feature; | ||
bean.fire(interaction, 'on', { | ||
parent: parent(), | ||
data: feature, | ||
formatter: gm.formatter().format, | ||
e: e | ||
}); | ||
} else if (!feature) { | ||
_af = null; | ||
bean.fire(interaction, 'off'); | ||
} | ||
bean.fire(interaction, 'on', { | ||
parent: parent(), | ||
data: feature, | ||
formatter: gm.formatter().format, | ||
e: e | ||
}); | ||
} else { | ||
_af = null; | ||
bean.fire(interaction, 'off'); | ||
@@ -85,0 +77,0 @@ } |
var wax = wax || {}; | ||
wax.movetip = {}; | ||
wax.movetip = function(options) { | ||
options = options || {}; | ||
var t = {}, | ||
_currentTooltip = undefined, | ||
_context = undefined, | ||
_animationOut = options.animationOut, | ||
_animationIn = options.animationIn; | ||
wax.movetip = function() { | ||
var popped = false, | ||
t = {}, | ||
_tooltipOffset, | ||
_contextOffset, | ||
tooltip, | ||
parent; | ||
// Helper function to determine whether a given element is a wax popup. | ||
function isPopup (el) { | ||
return el && el.className.indexOf('wax-popup') !== -1; | ||
function moveTooltip(e) { | ||
var eo = wax.u.eventoffset(e); | ||
// faux-positioning | ||
if ((_tooltipOffset.height + eo.y) > | ||
(_contextOffset.top + _contextOffset.height) && | ||
(_contextOffset.height > _tooltipOffset.height)) { | ||
eo.y -= _tooltipOffset.height; | ||
tooltip.className += ' flip-y'; | ||
} | ||
// faux-positioning | ||
if ((_tooltipOffset.width + eo.x) > | ||
(_contextOffset.left + _contextOffset.width)) { | ||
eo.x -= _tooltipOffset.width; | ||
tooltip.className += ' flip-x'; | ||
} | ||
tooltip.style.left = eo.x + 'px'; | ||
tooltip.style.top = eo.y + 'px'; | ||
} | ||
function getTooltip(feature, context) { | ||
// Get the active tooltip for a layer or create a new one if no tooltip exists. | ||
// Hide any tooltips on layers underneath this one. | ||
function getTooltip(feature) { | ||
var tooltip = document.createElement('div'); | ||
tooltip.className = 'wax-movetip'; | ||
tooltip.style.cssText = 'position:absolute;' | ||
tooltip.className = 'wax-tooltip wax-tooltip-0'; | ||
tooltip.innerHTML = feature; | ||
context.appendChild(tooltip); | ||
_context = context; | ||
_tooltipOffset = wax.util.offset(tooltip); | ||
_contextOffset = wax.util.offset(_context); | ||
return tooltip; | ||
} | ||
function moveTooltip(e) { | ||
if (!_currentTooltip) return; | ||
var eo = wax.util.eventoffset(e); | ||
_currentTooltip.className = 'wax-movetip'; | ||
// faux-positioning | ||
if ((_tooltipOffset.height + eo.y) > | ||
(_contextOffset.top + _contextOffset.height) && | ||
(_contextOffset.height > _tooltipOffset.height)) { | ||
eo.y -= _tooltipOffset.height; | ||
_currentTooltip.className += ' flip-y'; | ||
// Hide a given tooltip. | ||
function hide() { | ||
if (tooltip) { | ||
tooltip.parentNode.removeChild(tooltip); | ||
tooltip = null; | ||
} | ||
// faux-positioning | ||
if ((_tooltipOffset.width + eo.x) > | ||
(_contextOffset.left + _contextOffset.width)) { | ||
eo.x -= _tooltipOffset.width; | ||
_currentTooltip.className += ' flip-x'; | ||
} | ||
_currentTooltip.style.left = eo.x + 'px'; | ||
_currentTooltip.style.top = eo.y + 'px'; | ||
} | ||
// Hide a given tooltip. | ||
function hideTooltip(el) { | ||
if (!el) return; | ||
var event, | ||
remove = function() { | ||
if (this.parentNode) this.parentNode.removeChild(this); | ||
}; | ||
if (el.style['-webkit-transition'] !== undefined && _animationOut) { | ||
event = 'webkitTransitionEnd'; | ||
} else if (el.style.MozTransition !== undefined && _animationOut) { | ||
event = 'transitionend'; | ||
} | ||
if (event) { | ||
// This code assumes that transform-supporting browsers | ||
// also support proper events. IE9 does both. | ||
el.addEventListener(event, remove, false); | ||
el.addEventListener('transitionend', remove, false); | ||
el.className += ' ' + _animationOut; | ||
function on(o) { | ||
var content; | ||
if (popped) return; | ||
if ((o.e.type === 'mousemove' || !o.e.type)) { | ||
content = o.formatter({ format: 'teaser' }, o.data); | ||
if (!content) return; | ||
hide(); | ||
parent.style.cursor = 'pointer'; | ||
tooltip = document.body.appendChild(getTooltip(content)); | ||
} else { | ||
if (el.parentNode) el.parentNode.removeChild(el); | ||
} | ||
} | ||
content = o.formatter({ format: 'teaser' }, o.data); | ||
if (!content) return; | ||
hide(); | ||
var tt = document.body.appendChild(getTooltip(content)); | ||
tt.className += ' wax-popup'; | ||
// Expand a tooltip to be a "popup". Suspends all other tooltips from being | ||
// shown until this popup is closed or another popup is opened. | ||
function click(feature, context) { | ||
// Hide any current tooltips. | ||
if (_currentTooltip) { | ||
hideTooltip(_currentTooltip); | ||
_currentTooltip = undefined; | ||
} | ||
var close = tt.appendChild(document.createElement('a')); | ||
close.href = '#close'; | ||
close.className = 'close'; | ||
close.innerHTML = 'Close'; | ||
var tooltip = getTooltip(feature, context); | ||
tooltip.className += ' wax-popup'; | ||
tooltip.innerHTML = feature; | ||
popped = true; | ||
var close = document.createElement('a'); | ||
close.href = '#close'; | ||
close.className = 'close'; | ||
close.innerHTML = 'Close'; | ||
tooltip.appendChild(close); | ||
tooltip = tt; | ||
var closeClick = function(ev) { | ||
hideTooltip(tooltip); | ||
_currentTooltip = undefined; | ||
ev.returnValue = false; // Prevents hash change. | ||
if (ev.stopPropagation) ev.stopPropagation(); | ||
if (ev.preventDefault) ev.preventDefault(); | ||
return false; | ||
}; | ||
_tooltipOffset = wax.u.offset(tooltip); | ||
_contextOffset = wax.u.offset(parent); | ||
moveTooltip(o.e); | ||
// IE compatibility. | ||
if (close.addEventListener) { | ||
close.addEventListener('click', closeClick, false); | ||
} else if (close.attachEvent) { | ||
close.attachEvent('onclick', closeClick); | ||
bean.add(close, 'click touchend', function closeClick(e) { | ||
e.stop(); | ||
hide(); | ||
popped = false; | ||
}); | ||
} | ||
if (tooltip) { | ||
_tooltipOffset = wax.u.offset(tooltip); | ||
_contextOffset = wax.u.offset(parent); | ||
moveTooltip(o.e); | ||
} | ||
_currentTooltip = tooltip; | ||
} | ||
t.over = function(feature, context, e) { | ||
if (!feature) return; | ||
context.style.cursor = 'pointer'; | ||
function off() { | ||
parent.style.cursor = 'default'; | ||
if (!popped) hide(); | ||
} | ||
if (isPopup(_currentTooltip)) { | ||
return; | ||
} else { | ||
_currentTooltip = getTooltip(feature, context); | ||
moveTooltip(e); | ||
if (context.addEventListener) { | ||
context.addEventListener('mousemove', moveTooltip); | ||
} | ||
} | ||
t.parent = function(x) { | ||
if (!arguments.length) return parent; | ||
parent = x; | ||
return t; | ||
}; | ||
// Hide all tooltips on this layer and show the first hidden tooltip on the | ||
// highest layer underneath if found. | ||
t.out = function(context) { | ||
context.style.cursor = 'default'; | ||
if (isPopup(_currentTooltip)) { | ||
return; | ||
} else if (_currentTooltip) { | ||
hideTooltip(_currentTooltip); | ||
if (context.removeEventListener) { | ||
context.removeEventListener('mousemove', moveTooltip); | ||
} | ||
_currentTooltip = undefined; | ||
} | ||
t.events = function() { | ||
return { | ||
on: on, | ||
off: off | ||
}; | ||
}; | ||
@@ -150,1 +113,2 @@ | ||
}; | ||
@@ -9,4 +9,12 @@ var wax = wax || {}; | ||
tooltips = [], | ||
_currentContent, | ||
transitionEvent, | ||
parent; | ||
if (document.body.style['-webkit-transition'] !== undefined) { | ||
transitionEvent = 'webkitTransitionEnd'; | ||
} else if (document.body.style.MozTransition !== undefined) { | ||
transitionEvent = 'transitionend'; | ||
} | ||
// Get the active tooltip for a layer or create a new one if no tooltip exists. | ||
@@ -21,22 +29,15 @@ // Hide any tooltips on layers underneath this one. | ||
function remove() { | ||
if (this.parentNode) this.parentNode.removeChild(this); | ||
} | ||
// Hide a given tooltip. | ||
function hide() { | ||
var event; | ||
function remove() { | ||
if (this.parentNode) this.parentNode.removeChild(this); | ||
} | ||
if (document.body.style['-webkit-transition'] !== undefined) { | ||
event = 'webkitTransitionEnd'; | ||
} else if (document.body.style.MozTransition !== undefined) { | ||
event = 'transitionend'; | ||
} | ||
var _ct; | ||
while (_ct = tooltips.pop()) { | ||
if (animate && event) { | ||
if (animate && transitionEvent) { | ||
// This code assumes that transform-supporting browsers | ||
// also support proper events. IE9 does both. | ||
bean.add(_ct, event, remove); | ||
bean.add(_ct, transitionEvent, remove); | ||
_ct.className += ' wax-fade'; | ||
@@ -51,11 +52,14 @@ } else { | ||
var content; | ||
hide(); | ||
if ((o.e.type === 'mousemove' || !o.e.type) && !popped) { | ||
content = o.formatter({ format: 'teaser' }, o.data); | ||
if (!content) return; | ||
if (!content || content == _currentContent) return; | ||
hide(); | ||
parent.style.cursor = 'pointer'; | ||
tooltips.push(parent.appendChild(getTooltip(content))); | ||
_currentContent = content; | ||
} else { | ||
content = o.formatter({ format: 'full' }, o.data); | ||
if (!content) return; | ||
hide(); | ||
parent.style.cursor = 'pointer'; | ||
var tt = parent.appendChild(getTooltip(content)); | ||
@@ -82,2 +86,3 @@ tt.className += ' wax-popup'; | ||
parent.style.cursor = 'default'; | ||
_currentContent = null; | ||
if (!popped) hide(); | ||
@@ -84,0 +89,0 @@ } |
@@ -1,2 +0,2 @@ | ||
/* wax - 6.0.0-beta1 - 1.0.4-522-g703646f */!function(a,b,c){typeof module!="undefined"?module.exports=c(a,b):typeof define=="function"&&typeof define.amd=="object"?define(c):b[a]=c(a,b)}("bean",this,function(a,b){var c=window,d=b[a],e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=Array.prototype.slice,q=/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,r=/mouse.*(wheel|scroll)/i,s=/^text/i,t=/^touch|^gesture/i,u={one:1},v=function(a,b,c){for(c=0;c<b.length;c++)a[b[c]]=1;return a}({},("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(n?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),w=function(){function a(a,b){while((b=b.parentNode)!==null)if(b===a)return!0;return!1}function b(b){var c=b.relatedTarget;return c?c!==this&&c.prefix!=="xul"&&!/document/.test(this.toString())&&!a(this,c):c===null}return{mouseenter:{base:"mouseover",condition:b},mouseleave:{base:"mouseout",condition:b},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),x=function(){var a="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),b=a.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),c=b.concat("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis".split(" ")),d=a.concat("char charCode key keyCode keyIdentifier keyLocation".split(" ")),f=a.concat(["data"]),g=a.concat("touches targetTouches changedTouches scale rotation".split(" ")),h="preventDefault",i=function(a){return function(){a[h]?a[h]():a.returnValue=!1}},j="stopPropagation",k=function(a){return function(){a[j]?a[j]():a.cancelBubble=!0}},n=function(a){return function(){a[h](),a[j](),a.stopped=!0}},o=function(a,b,c){var d,e;for(d=c.length;d--;)e=c[d],!(e in b)&&e in a&&(b[e]=a[e])};return function(p,u){var v={originalEvent:p,isNative:u};if(!p)return v;var w,x=p.type,y=p.target||p.srcElement;v[h]=i(p),v[j]=k(p),v.stop=n(v),v.target=y&&y.nodeType===3?y.parentNode:y;if(u){if(x.indexOf("key")!==-1)w=d,v.keyCode=p.which||p.keyCode;else if(q.test(x)){w=b,v.rightClick=p.which===3||p.button===2,v.pos={x:0,y:0};if(p.pageX||p.pageY)v.clientX=p.pageX,v.clientY=p.pageY;else if(p.clientX||p.clientY)v.clientX=p.clientX+l.body.scrollLeft+m.scrollLeft,v.clientY=p.clientY+l.body.scrollTop+m.scrollTop;e.test(x)&&(v.relatedTarget=p.relatedTarget||p[(x==="mouseover"?"from":"to")+"Element"])}else t.test(x)?w=g:r.test(x)?w=c:s.test(x)&&(w=f);o(p,v,w||a)}return v}}(),y=function(a,b){return!n&&!b&&(a===l||a===c)?m:a},z=function(){function a(a,b,c,d,e){this.element=a,this.type=b,this.handler=c,this.original=d,this.namespaces=e,this.custom=w[b],this.isNative=v[b]&&a[o],this.eventType=n||this.isNative?b:"propertychange",this.customType=!n&&!this.isNative&&b,this.target=y(a,this.isNative),this.eventSupport=this.target[o]}return a.prototype={inNamespaces:function(a){var b,c;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)if(a[b]===this.namespaces[c])return!0;return!1},matches:function(a,b,c){return this.element===a&&(!b||this.original===b)&&(!c||this.handler===c)}},a}(),A=function(){var a={},b=function(c,d,e,f,g){if(!d||d==="*")for(var h in a)h.charAt(0)==="$"&&b(c,h.substr(1),e,f,g);else{var i=0,j,k=a["$"+d],l=c==="*";if(!k)return;for(j=k.length;i<j;i++)if(l||k[i].matches(c,e,f))if(!g(k[i],k,i,d))return}},c=function(b,c,d){var e,f=a["$"+c];if(f)for(e=f.length;e--;)if(f[e].matches(b,d,null))return!0;return!1},d=function(a,c,d){var e=[];return b(a,c,d,null,function(a){return e.push(a)}),e},e=function(b){return(a["$"+b.type]||(a["$"+b.type]=[])).push(b),b},f=function(c){b(c.element,c.type,null,c.handler,function(b,c,d){return c.splice(d,1),c.length===0&&delete a["$"+b.type],!1})},g=function(){var b,c=[];for(b in a)b.charAt(0)==="$"&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),B=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},C=function(a,b,d){return function(e){return e=x(e||((this.ownerDocument||this.document||this).parentWindow||c).event,!0),b.apply(a,[e].concat(d))}},D=function(a,b,d,e,f,g){return function(h){if(e?e.apply(this,arguments):n?!0:h&&h.propertyName==="_on"+d||!h)h&&(h=x(h||((this.ownerDocument||this.document||this).parentWindow||c).event,g)),b.apply(a,h&&(!f||f.length===0)?arguments:p.call(arguments,h?0:1).concat(f))}},E=function(a,b,c,d,e){return function(){a(b,c,e),d.apply(this,arguments)}},F=function(a,b,c,d){var e,f,h,i=b&&b.replace(g,""),j=A.get(a,i,c);for(e=0,f=j.length;e<f;e++)j[e].inNamespaces(d)&&((h=j[e]).eventSupport&&B(h.target,h.eventType,h.handler,!1,h.type),A.del(h))},G=function(a,b,c,d,e){var h,i=b.replace(g,""),j=b.replace(f,"").split(".");if(A.has(a,i,c))return a;i==="unload"&&(c=E(F,a,i,c,d)),w[i]&&(w[i].condition&&(c=D(a,c,i,w[i].condition,!0)),i=w[i].base||i),h=A.put(new z(a,i,c,d,j[0]&&j)),h.handler=h.isNative?C(a,h.handler,e):D(a,h.handler,i,!1,e,!1),h.eventSupport&&B(h.target,h.eventType,h.handler,!0,h.customType)},H=function(a,b,c){return function(d){var e,f,g=typeof a=="string"?c(a,this):a;for(e=d.target;e&&e!==this;e=e.parentNode)for(f=g.length;f--;)if(g[f]===e)return b.apply(e,arguments)}},I=function(a,b,c){var d,e,h,i,j,k=F,l=b&&typeof b=="string";if(l&&b.indexOf(" ")>0){b=b.split(" ");for(j=b.length;j--;)I(a,b[j],c);return a}h=l&&b.replace(g,""),h&&w[h]&&(h=w[h].type);if(!b||l){if(i=l&&b.replace(f,""))i=i.split(".");k(a,h,c,i)}else if(typeof b=="function")k(a,null,b);else for(d in b)b.hasOwnProperty(d)&&I(a,d,b[d]);return a},J=function(a,b,c,d,e){var f,g,h,i,j=c,k=c&&typeof c=="string";if(b&&!c&&typeof b=="object")for(f in b)b.hasOwnProperty(f)&&J.apply(this,[a,f,b[f]]);else{i=arguments.length>3?p.call(arguments,3):[],g=(k?c:b).split(" "),k&&(c=H(b,j=d,e))&&(i=p.call(i,1)),this===u&&(c=E(I,a,b,c,j));for(h=g.length;h--;)G(a,g[h],c,j,i)}return a},K=function(){return J.apply(u,arguments)},L=n?function(a,b,d){var e=l.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=y(c,a),a?c.fireEvent("on"+b,l.createEventObject()):c["_on"+b]++},M=function(a,b,c){var d,e,h,i,j,k=b.split(" ");for(d=k.length;d--;){b=k[d].replace(g,"");if(i=k[d].replace(f,""))i=i.split(".");if(!i&&!c&&a[o])L(v[b],b,a);else{j=A.get(a,b),c=[!1].concat(c);for(e=0,h=j.length;e<h;e++)j[e].inNamespaces(i)&&j[e].handler.apply(a,c)}}return a},N=function(a,b,c){var d=0,e=A.get(b,c),f=e.length;for(;d<f;d++)e[d].original&&J(a,e[d].type,e[d].original);return a},O={add:J,one:K,remove:I,clone:N,fire:M,noConflict:function(){return b[a]=d,this}};if(c[i]){var P=function(){var a,b=A.entries();for(a in b)b[a].type&&b[a].type!=="unload"&&I(b[a].element,b[a].type);c[k]("onunload",P),c.CollectGarbage&&c.CollectGarbage()};c[i]("onunload",P)}return O});var html4={};html4.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10},html4.ATTRIBS={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0},html4.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128},html4.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:4,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,nobr:0,noembed:4,noframes:20,noscript:20,object:16,ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:84,select:0,small:0,span:0,strike:0,strong:0,style:148,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},html4.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},html4.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"body::background":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0},html4.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},html4.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"body::background":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2};var html=function(a){function g(a){a=b(a);if(c.hasOwnProperty(a))return c[a];var d=a.match(e);return d?String.fromCharCode(parseInt(d[1],10)):(d=a.match(f))?String.fromCharCode(parseInt(d[1],16)):""}function h(a,b){return g(b)}function j(a){return a.replace(i,"")}function l(a){return a.replace(k,h)}function s(a){return a.replace(m,"&").replace(o,"<").replace(p,">").replace(q,""").replace(r,"=")}function t(a){return a.replace(n,"&$1").replace(o,"<").replace(p,">")}function w(c){return function d(d,e){d=String(d);var f=null,g=!1,h=[],i=void 0,k=void 0,m=void 0;c.startDoc&&c.startDoc(e);while(d){var n=d.match(g?u:v);d=d.substring(n[0].length);if(g){if(n[1]){var o=b(n[1]),p;if(n[2]){var q=n[3];switch(q.charCodeAt(0)){case 34:case 39:q=q.substring(1,q.length-1)}p=l(j(q))}else p=o;h.push(o,p)}else if(n[4]){k!==void 0&&(m?c.startTag&&c.startTag(i,h,e):c.endTag&&c.endTag(i,e));if(m&&k&(a.eflags.CDATA|a.eflags.RCDATA)){f===null?f=b(d):f=f.substring(f.length-d.length);var r=f.indexOf("</"+i);r<0&&(r=d.length),r&&(k&a.eflags.CDATA?c.cdata&&c.cdata(d.substring(0,r),e):c.rcdata&&c.rcdata(t(d.substring(0,r)),e),d=d.substring(r))}i=k=m=void 0,h.length=0,g=!1}}else if(n[1])c.pcdata&&c.pcdata(n[0],e);else if(n[3])m=!n[2],g=!0,i=b(n[3]),k=a.ELEMENTS.hasOwnProperty(i)?a.ELEMENTS[i]:void 0;else if(n[4])c.pcdata&&c.pcdata(n[4],e);else if(n[5]&&c.pcdata){var s=n[5];c.pcdata(s==="<"?"<":s===">"?">":"&",e)}}c.endDoc&&c.endDoc(e)}}function x(b){var c,d;return w({startDoc:function(a){c=[],d=!1},startTag:function(e,f,g){if(d)return;if(!a.ELEMENTS.hasOwnProperty(e))return;var h=a.ELEMENTS[e];if(h&a.eflags.FOLDABLE)return;if(h&a.eflags.UNSAFE){d=!(h&a.eflags.EMPTY);return}f=b(e,f);if(f){h&a.eflags.EMPTY||c.push(e),g.push("<",e);for(var i=0,j=f.length;i<j;i+=2){var k=f[i],l=f[i+1];l!==null&&l!==void 0&&g.push(" ",k,'="',s(l),'"')}g.push(">")}},endTag:function(b,e){if(d){d=!1;return}if(!a.ELEMENTS.hasOwnProperty(b))return;var f=a.ELEMENTS[b];if(!(f&(a.eflags.UNSAFE|a.eflags.EMPTY|a.eflags.FOLDABLE))){var g;if(f&a.eflags.OPTIONAL_ENDTAG)for(g=c.length;--g>=0;){var h=c[g];if(h===b)break;if(!(a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG))return}else for(g=c.length;--g>=0;)if(c[g]===b)break;if(g<0)return;for(var i=c.length;--i>g;){var h=c[i];a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG||e.push("</",h,">")}c.length=g,e.push("</",b,">")}},pcdata:function(a,b){d||b.push(a)},rcdata:function(a,b){d||b.push(a)},cdata:function(a,b){d||b.push(a)},endDoc:function(a){for(var b=c.length;--b>=0;)a.push("</",c[b],">");c.length=0}})}function z(b,c,e){var f=[];return x(function g(b,f){for(var g=0;g<f.length;g+=2){var h=f[g],i=f[g+1],j=null,k;if((k=b+"::"+h,a.ATTRIBS.hasOwnProperty(k))||(k="*::"+h,a.ATTRIBS.hasOwnProperty(k)))j=a.ATTRIBS[k];if(j!==null)switch(j){case a.atype.NONE:break;case a.atype.SCRIPT:case a.atype.STYLE:i=null;break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:i=e?e(i):i;break;case a.atype.URI:var l=(""+i).match(y);l?!l[1]||d.test(l[1])?i=c&&c(i):i=null:i=null;break;case a.atype.URI_FRAGMENT:i&&"#"===i.charAt(0)?(i=e?e(i):i,i&&(i="#"+i)):i=null;break;default:i=null}else i=null;f[g+1]=i}return f})(b,f),f.join("")}var b;"script"==="SCRIPT".toLowerCase()?b=function(a){return a.toLowerCase()}:b=function(a){return a.replace(/[A-Z]/g,function(a){return String.fromCharCode(a.charCodeAt(0)|32)})};var c={lt:"<",gt:">",amp:"&",nbsp:" ",quot:'"',apos:"'"},d=/^(?:https?|mailto|data)$/i,e=/^#(\d+)$/,f=/^#x([0-9A-Fa-f]+)$/,i=/\0/g,k=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,m=/&/g,n=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,o=/</g,p=/>/g,q=/\"/g,r=/\=/g,u=new RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[\\s\\S][^a-z\\s>]*)","i"),v=new RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<!--[\\s\\S]*?-->|<!\\w[^>]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i"),y=new RegExp("^(?:([^:/?#]+):)?");return{escapeAttrib:s,makeHtmlSanitizer:x,makeSaxParser:w,normalizeRCData:t,sanitize:z,unescapeEntities:l}}(html4),html_sanitize=html.sanitize;typeof window!="undefined"&&(window.html=html,window.html_sanitize=html_sanitize),html4.ATTRIBS["*::style"]=0,html4.ELEMENTS.style=0;var Mustache=function(){var a={},b=function(){};return b.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a);return}a=this.render_pragmas(a);var e=this.render_section(a,b,c);e===!1&&(e=this.render_tags(a,b,c,d));if(d)return e;this.sendLines(e)},send:function(a){a!==""&&this.buffer.push(a)},sendLines:function(a){if(a){var b=a.split("\n");for(var c=0;c<b.length;c++)this.send(b[c])}},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=this.getCachedRegex("render_pragmas",function(a,b){return new RegExp(a+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+b,"g")});return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return!1;var d=this,e=this.getCachedRegex("render_section",function(a,b){return new RegExp("^([\\s\\S]*?)"+a+"(\\^|\\#)\\s*(.+)\\s*"+b+"\n*([\\s\\S]*?)"+a+"\\/\\s*\\3\\s*"+b+"\\s*([\\s\\S]*)$","g")});return a.replace(e,function(a,e,f,g,h,i){var j=e?d.render_tags(e,b,c,!0):"",k=i?d.render(i,b,c,!0):"",l,m=d.find(g,b);return f==="^"?!m||d.is_array(m)&&m.length===0?l=d.render(h,b,c,!0):l="":f==="#"&&(d.is_array(m)?l=d.map(m,function(a){return d.render(h,d.create_context(a),c,!0)}).join(""):d.is_object(m)?l=d.render(h,d.create_context(m),c,!0):typeof m=="function"?l=m.call(b,h,function(a){return d.render(a,b,c,!0)}):m?l=d.render(h,b,c,!0):l=""),j+l+k})},render_tags:function(a,b,c,d){var e=this,f=function(){return e.getCachedRegex("render_tags",function(a,b){return new RegExp(a+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+b+"+","g")})},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":return e.set_delimiters(h),g=f(),"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j<i.length;j++)i[j]=i[j].replace(g,h,this),d||this.send(i[j]);if(d)return i.join("\n")},set_delimiters:function(a){var b=a.split(" ");this.otag=this.escape_regex(b[0]),this.ctag=this.escape_regex(b[1])},escape_regex:function(a){if(!arguments.callee.sRE){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+b.join("|\\")+")","g")}return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){function c(a){return a===!1||a===0||a}a=this.trim(a);var d;return c(b[a])?d=b[a]:c(this.context[a])&&(d=this.context[a]),typeof d=="function"?d.apply(b):d!==undefined?d:""},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return a=String(a===null?"":a),a.replace(/&(?!\w+;)|["'<>\\]/g,function(a){switch(a){case"&":return"&";case'"':return""";case"'":return"'";case"<":return"<";case">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};return c[b]=a,c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e<d;e++)c.push(b(a[e]));return c},getCachedRegex:function(b,c){var d=a[this.otag];d||(d=a[this.otag]={});var e=d[this.ctag];e||(e=d[this.ctag]={});var f=e[b];return f||(f=e[b]=c(this.otag,this.ctag)),f}},{name:"mustache.js",version:"0.4.0-dev",to_html:function(a,c,d,e){var f=new b;e&&(f.send=e),f.render(a,c||{},d);if(!e)return f.buffer.join("\n")}}}();!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window),wax=wax||{},wax.attribution=function(){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var a,b={};return b.content=function(b){return typeof b=="undefined"?a.innerHTML:(a.innerHTML=html_sanitize(b,c,d),this)},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){function urlX(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function idX(a){return a}var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return html_sanitize(f(a,b),urlX,idX)}catch(c){console&&console.log(c)}},formatter},wax.gi=function(a,b){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}b=b||{};var c={},d=b.resolution||4,e=b.tileSize||256;return c.grid_tile=function(){return a},c.getKey=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>=e||Math.floor(b)>=e)return;return f(a.grid[Math.floor(c/d)].charCodeAt(Math.floor(b/d)))},c.gridFeature=function(b,c){var d=this.getKey(b,c),e=a.keys;if(e&&e[d]&&a.data[e[d]])return a.data[e[d]]},c.tileFeature=function(b,c,d){if(!a)return;var e=wax.u.offset(d);return feature=this.gridFeature(b-e.left,c-e.top),feature},c},wax.gm=function(){function f(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=new RegExp("/(\\d+)\\/(\\d+)\\/(\\d+)\\.[\\w\\._]+"),d=c.exec(b);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}var a=4,b={},c={},d,e=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return c.formatter=function(a){return arguments.length?(d=wax.formatter(a),c):d},c.template=function(a){return arguments.length?(d=wax.template(a),c):d},c.gridUrl=function(a){return arguments.length?(e=typeof a=="function"?a:f(a),c):e},c.getGrid=function(b,f){var g=e(b);return!d||!g?f(null,null):(wax.request.get(g,function(b,c){if(b)return f(b,null);f(null,wax.gi(c,d,{resolution:a||4}))}),c)},c.tilejson=function(a){return a.template?c.template(a.template):a.formatter&&c.formatter(a.formatter),a.grids&&c.gridUrl(a.grids),c},c},wax=wax||{},wax.hash=function(a){function b(){return location.hash.substring(1)}function c(a){location.hash="#"+a}function g(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(c)}function h(){var b=a.getCenterZoom();d!==b&&(d=b,c(d))}function i(a){if(a===d)return;g(d=a)&&h()}a=a||{};var d,e={},f=90-1e-8,j=wax.u.throttle(h,500);return e.add=function(){return i(b()),a.bindChange(j),this},e.remove=function(){return a.unbindChange(j),this},e.add()},wax=wax||{},wax.interaction=function(){function m(a){var b=h();for(var c=0;c<b.length;c++)if(b[c][0]<a.y&&b[c][0]+256>a.y&&b[c][1]<a.x&&b[c][1]+256>a.x)return b[c][2];return!1}function n(){return d?(window.clearTimeout(d),d=null,!0):!1}function o(d){if(c)return;var f=wax.u.eventoffset(d),g=m(f),h;g&&a.getGrid(g.src,function(c,j){if(c||!j)return;h=j.tileFeature(f.x,f.y,g),h?h&&e!==h?(e=h,bean.fire(b,"on",{parent:i(),data:h,formatter:a.formatter().format,e:d})):h||(e=null,bean.fire(b,"off")):(e=null,bean.fire(b,"off"))})}function p(a){if(n())return;c=!0,f=wax.u.eventoffset(a),a.type==="mousedown"?bean.add(document.body,"mouseup",r):a.type==="touchstart"&&a.touches.length===1&&(bean.fire(b,"off"),bean.add(i(),l))}function q(){bean.remove(i(),l),c=!1}function r(a){var b={},e=wax.u.eventoffset(a);c=!1;for(var h in a)b[h]=a[h];return bean.remove(document.body,"mouseup",r),bean.remove(i(),l),a.type==="touchend"?s(a,f):Math.round(e.y/g)===Math.round(f.y/g)&&Math.round(e.x/g)===Math.round(f.x/g)&&(d=window.setTimeout(function(){d=null,s(b,e)},300)),r}function s(c,d){var e=m(d);e&&a.getGrid(e.src,function(f,g){if(f||!g)return;var h=g.tileFeature(d.x,d.y,e);if(!h)return;bean.fire(b,"on",{parent:i(),data:h,formatter:a.formatter().format,e:c})})}var a=wax.gm(),b={},c=!1,d=!1,e,f,g=4,h,i,j,k={mousemove:o,touchstart:p,mousedown:p},l={touchend:r,touchmove:r,touchcancel:q};return b.attach=function(a){return arguments.length?(attach=a,b):attach},b.map=function(a){return arguments.length?(map=a,bean.add(i(),k),bean.add(i(),"touchstart",p),attach&&attach(map),b):map},b.grid=function(a){return arguments.length?(h=a,b):h},b.remove=function(){for(var a=0;a<clearingEvents.length;a++)map.removeCallback(clearingEvents[a],clearTileGrid);return bean.remove(i(),k),bean.fire(b,"remove"),b},b.tilejson=function(c){return arguments.length?(a.tilejson(c),b):tilejson},b.formatter=function(){return a.formatter()},b.on=function(a,c){return bean.add(b,a,c),b},b.off=function(a,c){return bean.remove(b,a,c),b},b.parent=function(a){return i=a,b},b};var wax=wax||{};wax.legend=function(){function d(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function e(a){return a}var a,b={},c;return b.element=function(){return c},b.content=function(c){return arguments.length?(c?(a.innerHTML=html_sanitize(c,d,e),a.style.display="block"):(a.innerHTML="",a.style.display="none"),b):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=c.appendChild(document.createElement("div")),a.className="wax-legend",a.style.display="none",b},b.add()};var wax=wax||{};wax.movetip={},wax.movetip=function(a){function g(a){return a&&a.className.indexOf("wax-popup")!==-1}function h(a,b){var c=document.createElement("div");return c.className="wax-movetip",c.style.cssText="position:absolute;",c.innerHTML=a,b.appendChild(c),d=b,_tooltipOffset=wax.util.offset(c),_contextOffset=wax.util.offset(d),c}function i(a){if(!c)return;var b=wax.util.eventoffset(a);c.className="wax-movetip",_tooltipOffset.height+b.y>_contextOffset.top+_contextOffset.height&&_contextOffset.height>_tooltipOffset.height&&(b.y-=_tooltipOffset.height,c.className+=" flip-y"),_tooltipOffset.width+b.x>_contextOffset.left+_contextOffset.width&&(b.x-=_tooltipOffset.width,c.className+=" flip-x"),c.style.left=b.x+"px",c.style.top=b.y+"px"}function j(a){if(!a)return;var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&e?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&e&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+e):a.parentNode&&a.parentNode.removeChild(a)}function k(a,b){c&&(j(c),c=undefined);var d=h(a,b);d.className+=" wax-popup",d.innerHTML=a;var e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close",d.appendChild(e);var f=function(a){return j(d),c=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),!1};e.addEventListener?e.addEventListener("click",f,!1) | ||
:e.attachEvent&&e.attachEvent("onclick",f),c=d}a=a||{};var b={},c=undefined,d=undefined,e=a.animationOut,f=a.animationIn;return b.over=function(a,b,d){if(!a)return;b.style.cursor="pointer";if(g(c))return;c=h(a,b),i(d),b.addEventListener&&b.addEventListener("mousemove",i)},b.out=function(a){a.style.cursor="default";if(g(c))return;c&&(j(c),a.removeEventListener&&a.removeEventListener("mousemove",i),c=undefined)},b};var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}},wax.template=function(a){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var b={};return b.format=function(b,e){var f={};for(var g in e)f[g]=e[g];return b.format&&(f["__"+b.format+"__"]=!0),html_sanitize(Mustache.to_html(a,f),c,d)},b};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(){function f(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function g(){function c(){this.parentNode&&this.parentNode.removeChild(this)}var a;document.body.style["-webkit-transition"]!==undefined?a="webkitTransitionEnd":document.body.style.MozTransition!==undefined&&(a="transitionend");var e;while(e=d.pop())b&&a?(bean.add(e,a,c),e.className+=" wax-fade"):e.parentNode&&e.parentNode.removeChild(e)}function h(b){var c;g();if((b.e.type==="mousemove"||!b.e.type)&&!a){c=b.formatter({format:"teaser"},b.data);if(!c)return;e.style.cursor="pointer",d.push(e.appendChild(f(c)))}else{c=b.formatter({format:"full"},b.data);if(!c)return;var h=e.appendChild(f(c));h.className+=" wax-popup";var i=h.appendChild(document.createElement("a"));i.href="#close",i.className="close",i.innerHTML="Close",a=!0,d.push(h),bean.add(i,"click touchend",function(b){b.stop(),g(),a=!1})}}function i(){e.style.cursor="default",a||g()}var a=!1,b=!1,c={},d=[],e;return c.parent=function(a){return arguments.length?(e=a,c):e},c.animate=function(a){return arguments.length?(b=a,c):b},c.events=function(){return{on:h,off:i}},c};var wax=wax||{};wax.u={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=document.body,e=0,f=0,g=function(a){if(a===d||a===document.documentElement)return;e+=a.offsetTop,f+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");e+=parseInt(c[13],10),f+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10)};g(a);try{while(a=a.offsetParent)g(a)}catch(h){}e+=d.offsetTop,f+=d.offsetLeft,e+=d.parentNode.offsetTop,f+=d.parentNode.offsetLeft;var i=document.defaultView?window.getComputedStyle(d.parentNode,null):d.parentNode.currentStyle;return d.parentNode.offsetTop!==parseInt(i.marginTop,10)&&!isNaN(parseInt(i.marginTop,10))&&(e+=parseInt(i.marginTop,10),f+=parseInt(i.marginLeft,10)),{top:e,left:f,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;a||(a=window.event);if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}},limit:function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}},throttle:function(a,b){return this.limit(a,b,!1)}},wax=wax||{},wax.g=wax.g||{},wax.g.attribution=function(a,b){b=b||{};var c,d={};return d.element=function(){return c.element()},d.appendTo=function(a){return wax.u.$(a).appendChild(c.element()),this},d.init=function(){return c=wax.attribution(),c.set(b.attribution),c.element().className="wax-attribution wax-g",this},d.init()},wax=wax||{},wax.g=wax.g||{},wax.g.bwdetect=function(a,b){b=b||{};var c=b.png||".png128",d=b.jpg||".jpg70";if(!a.mapTypes["mb-low"]){var e=a.mapTypes.mb,f={tiles:[],scheme:e.options.scheme,blankImage:e.options.blankImage,minzoom:e.minZoom,maxzoom:e.maxZoom,name:e.name,description:e.description};for(var g=0;g<e.options.tiles.length;g++)f.tiles.push(e.options.tiles[g].replace(".png",c).replace(".jpg",d));m.mapTypes.set("mb-low",new wax.g.connector(f))}return wax.bwdetect(b,function(b){a.setMapTypeId(b?"mb":"mb-low")})},wax=wax||{},wax.g=wax.g||{},wax.g.hash=function(a){return wax.hash({getCenterZoom:function(){var b=a.getCenter(),c=a.getZoom(),d=Math.max(0,Math.ceil(Math.log(c)/Math.LN2));return[c.toFixed(2),b.lat().toFixed(d),b.lng().toFixed(d)].join("/")},setCenterZoom:function b(b){a.setCenter(new google.maps.LatLng(b[1],b[2])),a.setZoom(b[0])},bindChange:function(b){google.maps.event.addListener(a,"idle",b)},unbindChange:function(b){google.maps.event.removeListener(a,"idle",b)}})},wax=wax||{},wax.g=wax.g||{},wax.g.interaction=function(){function c(){a=!0}function d(){if(!a&&b)return b;b=[];var c=map.getZoom(),d=wax.u.offset(map.getDiv()),e=function(a){if(!a.interactive)return;for(var e in a.cache){if(e.split("/")[0]!=c)continue;var f=wax.u.offset(a.cache[e]);b.push([f.top-d.top,f.left-d.left,a.cache[e]])}};for(var f in map.mapTypes)e(map.mapTypes[f]);return map.overlayMapTypes.forEach(e),b}function e(a){if(!arguments.length)return map;map=a,google.maps.event.addListener(map,"tileloaded",c),google.maps.event.addListener(map,"idle",c)}var a=!1,b;return wax.interaction().attach(e).parent(function(){return map.getDiv()}).grid(d)},wax=wax||{},wax.g=wax.g||{},wax.g.legend=function(a,b){b=b||{};var c,d={};return d.add=function(){return c=wax.legend().content(b.legend||""),this},d.element=function(){return c.element()},d.appendTo=function(a){return wax.u.$(a).appendChild(c.element()),this},d.add()};var wax=wax||{};wax.g=wax.g||{},wax.g.connector=function(a){a=a||{},this.options={tiles:a.tiles,scheme:a.scheme||"xyz",blankImage:a.blankImage||"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},this.minZoom=a.minzoom||0,this.maxZoom=a.maxzoom||22,this.name=a.name||"",this.description=a.description||"",this.interactive=!0,this.tileSize=new google.maps.Size(256,256),this.cache={}},wax.g.connector.prototype.getTile=function(a,b,c){var d=b+"/"+a.x+"/"+a.y;if(!this.cache[d]){var e=this.cache[d]=new Image(256,256);this.cache[d].src=this.getTileUrl(a,b),this.cache[d].setAttribute("gTileKey",d),this.cache[d].onerror=function(){e.style.display="none"}}return this.cache[d]},wax.g.connector.prototype.releaseTile=function(a){var b=a.getAttribute("gTileKey");this.cache[b]&&delete this.cache[b],a.parentNode&&a.parentNode.removeChild(a)},wax.g.connector.prototype.getTileUrl=function(a,b){var c=Math.pow(2,b),d=this.options.scheme==="tms"?c-1-a.y:a.y,e=a.x%c;return e=e<0?a.x%c+c:e,d<0?this.options.blankImage:this.options.tiles[parseInt(e+d,10)%this.options.tiles.length].replace("{z}",b).replace("{x}",e).replace("{y}",d)} | ||
/* wax - 6.0.0-beta2 - 1.0.4-526-g3351932 */!function(a,b,c){typeof module!="undefined"?module.exports=c(a,b):typeof define=="function"&&typeof define.amd=="object"?define(c):b[a]=c(a,b)}("bean",this,function(a,b){var c=window,d=b[a],e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=Array.prototype.slice,q=/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,r=/mouse.*(wheel|scroll)/i,s=/^text/i,t=/^touch|^gesture/i,u={one:1},v=function(a,b,c){for(c=0;c<b.length;c++)a[b[c]]=1;return a}({},("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(n?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),w=function(){function a(a,b){while((b=b.parentNode)!==null)if(b===a)return!0;return!1}function b(b){var c=b.relatedTarget;return c?c!==this&&c.prefix!=="xul"&&!/document/.test(this.toString())&&!a(this,c):c===null}return{mouseenter:{base:"mouseover",condition:b},mouseleave:{base:"mouseout",condition:b},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),x=function(){var a="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),b=a.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),c=b.concat("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis".split(" ")),d=a.concat("char charCode key keyCode keyIdentifier keyLocation".split(" ")),f=a.concat(["data"]),g=a.concat("touches targetTouches changedTouches scale rotation".split(" ")),h="preventDefault",i=function(a){return function(){a[h]?a[h]():a.returnValue=!1}},j="stopPropagation",k=function(a){return function(){a[j]?a[j]():a.cancelBubble=!0}},n=function(a){return function(){a[h](),a[j](),a.stopped=!0}},o=function(a,b,c){var d,e;for(d=c.length;d--;)e=c[d],!(e in b)&&e in a&&(b[e]=a[e])};return function(p,u){var v={originalEvent:p,isNative:u};if(!p)return v;var w,x=p.type,y=p.target||p.srcElement;v[h]=i(p),v[j]=k(p),v.stop=n(v),v.target=y&&y.nodeType===3?y.parentNode:y;if(u){if(x.indexOf("key")!==-1)w=d,v.keyCode=p.which||p.keyCode;else if(q.test(x)){w=b,v.rightClick=p.which===3||p.button===2,v.pos={x:0,y:0};if(p.pageX||p.pageY)v.clientX=p.pageX,v.clientY=p.pageY;else if(p.clientX||p.clientY)v.clientX=p.clientX+l.body.scrollLeft+m.scrollLeft,v.clientY=p.clientY+l.body.scrollTop+m.scrollTop;e.test(x)&&(v.relatedTarget=p.relatedTarget||p[(x==="mouseover"?"from":"to")+"Element"])}else t.test(x)?w=g:r.test(x)?w=c:s.test(x)&&(w=f);o(p,v,w||a)}return v}}(),y=function(a,b){return!n&&!b&&(a===l||a===c)?m:a},z=function(){function a(a,b,c,d,e){this.element=a,this.type=b,this.handler=c,this.original=d,this.namespaces=e,this.custom=w[b],this.isNative=v[b]&&a[o],this.eventType=n||this.isNative?b:"propertychange",this.customType=!n&&!this.isNative&&b,this.target=y(a,this.isNative),this.eventSupport=this.target[o]}return a.prototype={inNamespaces:function(a){var b,c;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)if(a[b]===this.namespaces[c])return!0;return!1},matches:function(a,b,c){return this.element===a&&(!b||this.original===b)&&(!c||this.handler===c)}},a}(),A=function(){var a={},b=function(c,d,e,f,g){if(!d||d==="*")for(var h in a)h.charAt(0)==="$"&&b(c,h.substr(1),e,f,g);else{var i=0,j,k=a["$"+d],l=c==="*";if(!k)return;for(j=k.length;i<j;i++)if(l||k[i].matches(c,e,f))if(!g(k[i],k,i,d))return}},c=function(b,c,d){var e,f=a["$"+c];if(f)for(e=f.length;e--;)if(f[e].matches(b,d,null))return!0;return!1},d=function(a,c,d){var e=[];return b(a,c,d,null,function(a){return e.push(a)}),e},e=function(b){return(a["$"+b.type]||(a["$"+b.type]=[])).push(b),b},f=function(c){b(c.element,c.type,null,c.handler,function(b,c,d){return c.splice(d,1),c.length===0&&delete a["$"+b.type],!1})},g=function(){var b,c=[];for(b in a)b.charAt(0)==="$"&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),B=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},C=function(a,b,d){return function(e){return e=x(e||((this.ownerDocument||this.document||this).parentWindow||c).event,!0),b.apply(a,[e].concat(d))}},D=function(a,b,d,e,f,g){return function(h){if(e?e.apply(this,arguments):n?!0:h&&h.propertyName==="_on"+d||!h)h&&(h=x(h||((this.ownerDocument||this.document||this).parentWindow||c).event,g)),b.apply(a,h&&(!f||f.length===0)?arguments:p.call(arguments,h?0:1).concat(f))}},E=function(a,b,c,d,e){return function(){a(b,c,e),d.apply(this,arguments)}},F=function(a,b,c,d){var e,f,h,i=b&&b.replace(g,""),j=A.get(a,i,c);for(e=0,f=j.length;e<f;e++)j[e].inNamespaces(d)&&((h=j[e]).eventSupport&&B(h.target,h.eventType,h.handler,!1,h.type),A.del(h))},G=function(a,b,c,d,e){var h,i=b.replace(g,""),j=b.replace(f,"").split(".");if(A.has(a,i,c))return a;i==="unload"&&(c=E(F,a,i,c,d)),w[i]&&(w[i].condition&&(c=D(a,c,i,w[i].condition,!0)),i=w[i].base||i),h=A.put(new z(a,i,c,d,j[0]&&j)),h.handler=h.isNative?C(a,h.handler,e):D(a,h.handler,i,!1,e,!1),h.eventSupport&&B(h.target,h.eventType,h.handler,!0,h.customType)},H=function(a,b,c){return function(d){var e,f,g=typeof a=="string"?c(a,this):a;for(e=d.target;e&&e!==this;e=e.parentNode)for(f=g.length;f--;)if(g[f]===e)return b.apply(e,arguments)}},I=function(a,b,c){var d,e,h,i,j,k=F,l=b&&typeof b=="string";if(l&&b.indexOf(" ")>0){b=b.split(" ");for(j=b.length;j--;)I(a,b[j],c);return a}h=l&&b.replace(g,""),h&&w[h]&&(h=w[h].type);if(!b||l){if(i=l&&b.replace(f,""))i=i.split(".");k(a,h,c,i)}else if(typeof b=="function")k(a,null,b);else for(d in b)b.hasOwnProperty(d)&&I(a,d,b[d]);return a},J=function(a,b,c,d,e){var f,g,h,i,j=c,k=c&&typeof c=="string";if(b&&!c&&typeof b=="object")for(f in b)b.hasOwnProperty(f)&&J.apply(this,[a,f,b[f]]);else{i=arguments.length>3?p.call(arguments,3):[],g=(k?c:b).split(" "),k&&(c=H(b,j=d,e))&&(i=p.call(i,1)),this===u&&(c=E(I,a,b,c,j));for(h=g.length;h--;)G(a,g[h],c,j,i)}return a},K=function(){return J.apply(u,arguments)},L=n?function(a,b,d){var e=l.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=y(c,a),a?c.fireEvent("on"+b,l.createEventObject()):c["_on"+b]++},M=function(a,b,c){var d,e,h,i,j,k=b.split(" ");for(d=k.length;d--;){b=k[d].replace(g,"");if(i=k[d].replace(f,""))i=i.split(".");if(!i&&!c&&a[o])L(v[b],b,a);else{j=A.get(a,b),c=[!1].concat(c);for(e=0,h=j.length;e<h;e++)j[e].inNamespaces(i)&&j[e].handler.apply(a,c)}}return a},N=function(a,b,c){var d=0,e=A.get(b,c),f=e.length;for(;d<f;d++)e[d].original&&J(a,e[d].type,e[d].original);return a},O={add:J,one:K,remove:I,clone:N,fire:M,noConflict:function(){return b[a]=d,this}};if(c[i]){var P=function(){var a,b=A.entries();for(a in b)b[a].type&&b[a].type!=="unload"&&I(b[a].element,b[a].type);c[k]("onunload",P),c.CollectGarbage&&c.CollectGarbage()};c[i]("onunload",P)}return O});var html4={};html4.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10},html4.ATTRIBS={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0},html4.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128},html4.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:4,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,nobr:0,noembed:4,noframes:20,noscript:20,object:16,ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:84,select:0,small:0,span:0,strike:0,strong:0,style:148,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},html4.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},html4.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"body::background":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0},html4.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},html4.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"body::background":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2};var html=function(a){function g(a){a=b(a);if(c.hasOwnProperty(a))return c[a];var d=a.match(e);return d?String.fromCharCode(parseInt(d[1],10)):(d=a.match(f))?String.fromCharCode(parseInt(d[1],16)):""}function h(a,b){return g(b)}function j(a){return a.replace(i,"")}function l(a){return a.replace(k,h)}function s(a){return a.replace(m,"&").replace(o,"<").replace(p,">").replace(q,""").replace(r,"=")}function t(a){return a.replace(n,"&$1").replace(o,"<").replace(p,">")}function w(c){return function d(d,e){d=String(d);var f=null,g=!1,h=[],i=void 0,k=void 0,m=void 0;c.startDoc&&c.startDoc(e);while(d){var n=d.match(g?u:v);d=d.substring(n[0].length);if(g){if(n[1]){var o=b(n[1]),p;if(n[2]){var q=n[3];switch(q.charCodeAt(0)){case 34:case 39:q=q.substring(1,q.length-1)}p=l(j(q))}else p=o;h.push(o,p)}else if(n[4]){k!==void 0&&(m?c.startTag&&c.startTag(i,h,e):c.endTag&&c.endTag(i,e));if(m&&k&(a.eflags.CDATA|a.eflags.RCDATA)){f===null?f=b(d):f=f.substring(f.length-d.length);var r=f.indexOf("</"+i);r<0&&(r=d.length),r&&(k&a.eflags.CDATA?c.cdata&&c.cdata(d.substring(0,r),e):c.rcdata&&c.rcdata(t(d.substring(0,r)),e),d=d.substring(r))}i=k=m=void 0,h.length=0,g=!1}}else if(n[1])c.pcdata&&c.pcdata(n[0],e);else if(n[3])m=!n[2],g=!0,i=b(n[3]),k=a.ELEMENTS.hasOwnProperty(i)?a.ELEMENTS[i]:void 0;else if(n[4])c.pcdata&&c.pcdata(n[4],e);else if(n[5]&&c.pcdata){var s=n[5];c.pcdata(s==="<"?"<":s===">"?">":"&",e)}}c.endDoc&&c.endDoc(e)}}function x(b){var c,d;return w({startDoc:function(a){c=[],d=!1},startTag:function(e,f,g){if(d)return;if(!a.ELEMENTS.hasOwnProperty(e))return;var h=a.ELEMENTS[e];if(h&a.eflags.FOLDABLE)return;if(h&a.eflags.UNSAFE){d=!(h&a.eflags.EMPTY);return}f=b(e,f);if(f){h&a.eflags.EMPTY||c.push(e),g.push("<",e);for(var i=0,j=f.length;i<j;i+=2){var k=f[i],l=f[i+1];l!==null&&l!==void 0&&g.push(" ",k,'="',s(l),'"')}g.push(">")}},endTag:function(b,e){if(d){d=!1;return}if(!a.ELEMENTS.hasOwnProperty(b))return;var f=a.ELEMENTS[b];if(!(f&(a.eflags.UNSAFE|a.eflags.EMPTY|a.eflags.FOLDABLE))){var g;if(f&a.eflags.OPTIONAL_ENDTAG)for(g=c.length;--g>=0;){var h=c[g];if(h===b)break;if(!(a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG))return}else for(g=c.length;--g>=0;)if(c[g]===b)break;if(g<0)return;for(var i=c.length;--i>g;){var h=c[i];a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG||e.push("</",h,">")}c.length=g,e.push("</",b,">")}},pcdata:function(a,b){d||b.push(a)},rcdata:function(a,b){d||b.push(a)},cdata:function(a,b){d||b.push(a)},endDoc:function(a){for(var b=c.length;--b>=0;)a.push("</",c[b],">");c.length=0}})}function z(b,c,e){var f=[];return x(function g(b,f){for(var g=0;g<f.length;g+=2){var h=f[g],i=f[g+1],j=null,k;if((k=b+"::"+h,a.ATTRIBS.hasOwnProperty(k))||(k="*::"+h,a.ATTRIBS.hasOwnProperty(k)))j=a.ATTRIBS[k];if(j!==null)switch(j){case a.atype.NONE:break;case a.atype.SCRIPT:case a.atype.STYLE:i=null;break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:i=e?e(i):i;break;case a.atype.URI:var l=(""+i).match(y);l?!l[1]||d.test(l[1])?i=c&&c(i):i=null:i=null;break;case a.atype.URI_FRAGMENT:i&&"#"===i.charAt(0)?(i=e?e(i):i,i&&(i="#"+i)):i=null;break;default:i=null}else i=null;f[g+1]=i}return f})(b,f),f.join("")}var b;"script"==="SCRIPT".toLowerCase()?b=function(a){return a.toLowerCase()}:b=function(a){return a.replace(/[A-Z]/g,function(a){return String.fromCharCode(a.charCodeAt(0)|32)})};var c={lt:"<",gt:">",amp:"&",nbsp:" ",quot:'"',apos:"'"},d=/^(?:https?|mailto|data)$/i,e=/^#(\d+)$/,f=/^#x([0-9A-Fa-f]+)$/,i=/\0/g,k=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,m=/&/g,n=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,o=/</g,p=/>/g,q=/\"/g,r=/\=/g,u=new RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[\\s\\S][^a-z\\s>]*)","i"),v=new RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<!--[\\s\\S]*?-->|<!\\w[^>]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i"),y=new RegExp("^(?:([^:/?#]+):)?");return{escapeAttrib:s,makeHtmlSanitizer:x,makeSaxParser:w,normalizeRCData:t,sanitize:z,unescapeEntities:l}}(html4),html_sanitize=html.sanitize;typeof window!="undefined"&&(window.html=html,window.html_sanitize=html_sanitize),html4.ATTRIBS["*::style"]=0,html4.ELEMENTS.style=0;var Mustache=function(){var a={},b=function(){};return b.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a);return}a=this.render_pragmas(a);var e=this.render_section(a,b,c);e===!1&&(e=this.render_tags(a,b,c,d));if(d)return e;this.sendLines(e)},send:function(a){a!==""&&this.buffer.push(a)},sendLines:function(a){if(a){var b=a.split("\n");for(var c=0;c<b.length;c++)this.send(b[c])}},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=this.getCachedRegex("render_pragmas",function(a,b){return new RegExp(a+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+b,"g")});return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return!1;var d=this,e=this.getCachedRegex("render_section",function(a,b){return new RegExp("^([\\s\\S]*?)"+a+"(\\^|\\#)\\s*(.+)\\s*"+b+"\n*([\\s\\S]*?)"+a+"\\/\\s*\\3\\s*"+b+"\\s*([\\s\\S]*)$","g")});return a.replace(e,function(a,e,f,g,h,i){var j=e?d.render_tags(e,b,c,!0):"",k=i?d.render(i,b,c,!0):"",l,m=d.find(g,b);return f==="^"?!m||d.is_array(m)&&m.length===0?l=d.render(h,b,c,!0):l="":f==="#"&&(d.is_array(m)?l=d.map(m,function(a){return d.render(h,d.create_context(a),c,!0)}).join(""):d.is_object(m)?l=d.render(h,d.create_context(m),c,!0):typeof m=="function"?l=m.call(b,h,function(a){return d.render(a,b,c,!0)}):m?l=d.render(h,b,c,!0):l=""),j+l+k})},render_tags:function(a,b,c,d){var e=this,f=function(){return e.getCachedRegex("render_tags",function(a,b){return new RegExp(a+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+b+"+","g")})},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":return e.set_delimiters(h),g=f(),"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j<i.length;j++)i[j]=i[j].replace(g,h,this),d||this.send(i[j]);if(d)return i.join("\n")},set_delimiters:function(a){var b=a.split(" ");this.otag=this.escape_regex(b[0]),this.ctag=this.escape_regex(b[1])},escape_regex:function(a){if(!arguments.callee.sRE){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+b.join("|\\")+")","g")}return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){function c(a){return a===!1||a===0||a}a=this.trim(a);var d;return c(b[a])?d=b[a]:c(this.context[a])&&(d=this.context[a]),typeof d=="function"?d.apply(b):d!==undefined?d:""},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return a=String(a===null?"":a),a.replace(/&(?!\w+;)|["'<>\\]/g,function(a){switch(a){case"&":return"&";case'"':return""";case"'":return"'";case"<":return"<";case">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};return c[b]=a,c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e<d;e++)c.push(b(a[e]));return c},getCachedRegex:function(b,c){var d=a[this.otag];d||(d=a[this.otag]={});var e=d[this.ctag];e||(e=d[this.ctag]={});var f=e[b];return f||(f=e[b]=c(this.otag,this.ctag)),f}},{name:"mustache.js",version:"0.4.0-dev",to_html:function(a,c,d,e){var f=new b;e&&(f.send=e),f.render(a,c||{},d);if(!e)return f.buffer.join("\n")}}}();!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window),wax=wax||{},wax.attribution=function(){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var a,b={};return b.content=function(b){return typeof b=="undefined"?a.innerHTML:(a.innerHTML=html_sanitize(b,c,d),this)},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){function urlX(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function idX(a){return a}var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return html_sanitize(f(a,b),urlX,idX)}catch(c){console&&console.log(c)}},formatter},wax.gi=function(a,b){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}b=b||{};var c={},d=b.resolution||4,e=b.tileSize||256;return c.grid_tile=function(){return a},c.getKey=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>=e||Math.floor(b)>=e)return;return f(a.grid[Math.floor(c/d)].charCodeAt(Math.floor(b/d)))},c.gridFeature=function(b,c){var d=this.getKey(b,c),e=a.keys;if(e&&e[d]&&a.data[e[d]])return a.data[e[d]]},c.tileFeature=function(b,c,d){if(!a)return;var e=wax.u.offset(d);return feature=this.gridFeature(b-e.left,c-e.top),feature},c},wax.gm=function(){function f(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=new RegExp("/(\\d+)\\/(\\d+)\\/(\\d+)\\.[\\w\\._]+"),d=c.exec(b);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}var a=4,b={},c={},d,e=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return c.formatter=function(a){return arguments.length?(d=wax.formatter(a),c):d},c.template=function(a){return arguments.length?(d=wax.template(a),c):d},c.gridUrl=function(a){return arguments.length?(e=typeof a=="function"?a:f(a),c):e},c.getGrid=function(b,f){var g=e(b);return!d||!g?f(null,null):(wax.request.get(g,function(b,c){if(b)return f(b,null);f(null,wax.gi(c,d,{resolution:a||4}))}),c)},c.tilejson=function(a){return a.template?c.template(a.template):a.formatter&&c.formatter(a.formatter),a.grids&&c.gridUrl(a.grids),c},c},wax=wax||{},wax.hash=function(a){function b(){return location.hash.substring(1)}function c(a){location.hash="#"+a}function g(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(c)}function h(){var b=a.getCenterZoom();d!==b&&(d=b,c(d))}function i(a){if(a===d)return;g(d=a)&&h()}a=a||{};var d,e={},f=90-1e-8,j=wax.u.throttle(h,500);return e.add=function(){return i(b()),a.bindChange(j),this},e.remove=function(){return a.unbindChange(j),this},e.add()},wax=wax||{},wax.interaction=function(){function l(a){var b=g();for(var c=0;c<b.length;c++)if(b[c][0]<a.y&&b[c][0]+256>a.y&&b[c][1]<a.x&&b[c][1]+256>a.x)return b[c][2];return!1}function m(){return d?(window.clearTimeout(d),d=null,!0):!1}function n(d){if(c)return;var e=wax.u.eventoffset(d),f=l(e),g;f&&a.getGrid(f.src,function(c,i){if(c||!i)return;g=i.tileFeature(e.x,e.y,f),g?bean.fire(b,"on",{parent:h(),data:g,formatter:a.formatter().format,e:d}):bean.fire(b,"off")})}function o(a){if(m())return;c=!0,e=wax.u.eventoffset(a),a.type==="mousedown"?bean.add(document.body,"mouseup",q):a.type==="touchstart"&&a.touches.length===1&&(bean.fire(b,"off"),bean.add(h(),k))}function p(){bean.remove(h(),k),c=!1}function q(a){var b={},g=wax.u.eventoffset(a);c=!1;for(var i in a)b[i]=a[i];return bean.remove(document.body,"mouseup",q),bean.remove(h(),k),a.type==="touchend"?r(a,e):Math.round(g.y/f)===Math.round(e.y/f)&&Math.round(g.x/f)===Math.round(e.x/f)&&(d=window.setTimeout(function(){d=null,r(b,g)},300)),q}function r(c,d){var e=l(d);e&&a.getGrid(e.src,function(f,g){if(f||!g)return;var i=g.tileFeature(d.x,d.y,e);if(!i)return;bean.fire(b,"on",{parent:h(),data:i,formatter:a.formatter().format,e:c})})}var a=wax.gm(),b={},c=!1,d=!1,e,f=4,g,h,i,j={mousemove:n,touchstart:o,mousedown:o},k={touchend:q,touchmove:q,touchcancel:p};return b.attach=function(a){return arguments.length?(attach=a,b):attach},b.map=function(a){return arguments.length?(map=a,bean.add(h(),j),bean.add(h(),"touchstart",o),attach&&attach(map),b):map},b.grid=function(a){return arguments.length?(g=a,b):g},b.remove=function(){for(var a=0;a<clearingEvents.length;a++)map.removeCallback(clearingEvents[a],clearTileGrid);return bean.remove(h(),j),bean.fire(b,"remove"),b},b.tilejson=function(c){return arguments.length?(a.tilejson(c),b):tilejson},b.formatter=function(){return a.formatter()},b.on=function(a,c){return bean.add(b,a,c),b},b.off=function(a,c){return bean.remove(b,a,c),b},b.parent=function(a){return h=a,b},b};var wax=wax||{};wax.legend=function(){function d(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function e(a){return a}var a,b={},c;return b.element=function(){return c},b.content=function(c){return arguments.length?(c?(a.innerHTML=html_sanitize(c,d,e),a.style.display="block"):(a.innerHTML="",a.style.display="none"),b):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=c.appendChild(document.createElement("div")),a.className="wax-legend",a.style.display="none",b},b.add()};var wax=wax||{};wax.movetip={},wax.movetip=function(){function g(a){var b=wax.u.eventoffset(a);c.height+b.y>d.top+d.height&&d.height>c.height&&(b.y-=c.height,e.className+=" flip-y"),c.width+b.x>d.left+d.width&&(b.x-=c.width,e.className+=" flip-x"),e.style.left=b.x+"px",e.style.top=b.y+"px"}function h(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function i(){e&&(e.parentNode.removeChild(e),e=null)}function j(b){var j;if(a)return;if(b.e.type==="mousemove"||!b.e.type){j=b.formatter({format:"teaser"},b.data);if(!j)return;i(),f.style.cursor="pointer",e=document.body.appendChild(h(j))}else{j=b.formatter({format:"teaser"},b.data);if(!j)return;i();var k=document.body.appendChild(h(j));k.className+=" wax-popup";var l=k.appendChild(document.createElement("a"));l.href="#close",l.className="close",l.innerHTML="Close",a=!0,e=k,c=wax.u.offset(e),d=wax.u.offset(f),g(b.e),bean.add(l,"click touchend",function(b){b.stop(),i(),a=!1})}e&&(c=wax.u.offset(e),d=wax.u.offset(f),g(b.e))}function k(){f.style.cursor="default",a||i()}var a=!1,b={},c,d,e,f;return b.parent=function(a){return arguments.length?(f=a,b):f},b.events=function(){return{on:j,off:k}},b};var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success | ||
:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}},wax.template=function(a){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var b={};return b.format=function(b,e){var f={};for(var g in e)f[g]=e[g];return b.format&&(f["__"+b.format+"__"]=!0),html_sanitize(Mustache.to_html(a,f),c,d)},b};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(){function h(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function i(){this.parentNode&&this.parentNode.removeChild(this)}function j(){var a;while(a=d.pop())b&&f?(bean.add(a,f,i),a.className+=" wax-fade"):a.parentNode&&a.parentNode.removeChild(a)}function k(b){var c;if((b.e.type==="mousemove"||!b.e.type)&&!a){c=b.formatter({format:"teaser"},b.data);if(!c||c==e)return;j(),g.style.cursor="pointer",d.push(g.appendChild(h(c))),e=c}else{c=b.formatter({format:"full"},b.data);if(!c)return;j(),g.style.cursor="pointer";var f=g.appendChild(h(c));f.className+=" wax-popup";var i=f.appendChild(document.createElement("a"));i.href="#close",i.className="close",i.innerHTML="Close",a=!0,d.push(f),bean.add(i,"click touchend",function(b){b.stop(),j(),a=!1})}}function l(){g.style.cursor="default",e=null,a||j()}var a=!1,b=!1,c={},d=[],e,f,g;return document.body.style["-webkit-transition"]!==undefined?f="webkitTransitionEnd":document.body.style.MozTransition!==undefined&&(f="transitionend"),c.parent=function(a){return arguments.length?(g=a,c):g},c.animate=function(a){return arguments.length?(b=a,c):b},c.events=function(){return{on:k,off:l}},c};var wax=wax||{};wax.u={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=document.body,e=0,f=0,g=function(a){if(a===d||a===document.documentElement)return;e+=a.offsetTop,f+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");e+=parseInt(c[13],10),f+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10)};g(a);try{while(a=a.offsetParent)g(a)}catch(h){}e+=d.offsetTop,f+=d.offsetLeft,e+=d.parentNode.offsetTop,f+=d.parentNode.offsetLeft;var i=document.defaultView?window.getComputedStyle(d.parentNode,null):d.parentNode.currentStyle;return d.parentNode.offsetTop!==parseInt(i.marginTop,10)&&!isNaN(parseInt(i.marginTop,10))&&(e+=parseInt(i.marginTop,10),f+=parseInt(i.marginLeft,10)),{top:e,left:f,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;a||(a=window.event);if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}},limit:function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}},throttle:function(a,b){return this.limit(a,b,!1)}},wax=wax||{},wax.g=wax.g||{},wax.g.attribution=function(a,b){b=b||{};var c,d={};return d.element=function(){return c.element()},d.appendTo=function(a){return wax.u.$(a).appendChild(c.element()),this},d.init=function(){return c=wax.attribution(),c.set(b.attribution),c.element().className="wax-attribution wax-g",this},d.init()},wax=wax||{},wax.g=wax.g||{},wax.g.bwdetect=function(a,b){b=b||{};var c=b.png||".png128",d=b.jpg||".jpg70";if(!a.mapTypes["mb-low"]){var e=a.mapTypes.mb,f={tiles:[],scheme:e.options.scheme,blankImage:e.options.blankImage,minzoom:e.minZoom,maxzoom:e.maxZoom,name:e.name,description:e.description};for(var g=0;g<e.options.tiles.length;g++)f.tiles.push(e.options.tiles[g].replace(".png",c).replace(".jpg",d));m.mapTypes.set("mb-low",new wax.g.connector(f))}return wax.bwdetect(b,function(b){a.setMapTypeId(b?"mb":"mb-low")})},wax=wax||{},wax.g=wax.g||{},wax.g.hash=function(a){return wax.hash({getCenterZoom:function(){var b=a.getCenter(),c=a.getZoom(),d=Math.max(0,Math.ceil(Math.log(c)/Math.LN2));return[c.toFixed(2),b.lat().toFixed(d),b.lng().toFixed(d)].join("/")},setCenterZoom:function b(b){a.setCenter(new google.maps.LatLng(b[1],b[2])),a.setZoom(b[0])},bindChange:function(b){google.maps.event.addListener(a,"idle",b)},unbindChange:function(b){google.maps.event.removeListener(a,"idle",b)}})},wax=wax||{},wax.g=wax.g||{},wax.g.interaction=function(){function c(){a=!0}function d(){if(!a&&b)return b;b=[];var c=map.getZoom(),d=wax.u.offset(map.getDiv()),e=function(a){if(!a.interactive)return;for(var e in a.cache){if(e.split("/")[0]!=c)continue;var f=wax.u.offset(a.cache[e]);b.push([f.top-d.top,f.left-d.left,a.cache[e]])}};for(var f in map.mapTypes)e(map.mapTypes[f]);return map.overlayMapTypes.forEach(e),b}function e(a){if(!arguments.length)return map;map=a,google.maps.event.addListener(map,"tileloaded",c),google.maps.event.addListener(map,"idle",c)}var a=!1,b;return wax.interaction().attach(e).parent(function(){return map.getDiv()}).grid(d)},wax=wax||{},wax.g=wax.g||{},wax.g.legend=function(a,b){b=b||{};var c,d={};return d.add=function(){return c=wax.legend().content(b.legend||""),this},d.element=function(){return c.element()},d.appendTo=function(a){return wax.u.$(a).appendChild(c.element()),this},d.add()};var wax=wax||{};wax.g=wax.g||{},wax.g.connector=function(a){a=a||{},this.options={tiles:a.tiles,scheme:a.scheme||"xyz",blankImage:a.blankImage||"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},this.minZoom=a.minzoom||0,this.maxZoom=a.maxzoom||22,this.name=a.name||"",this.description=a.description||"",this.interactive=!0,this.tileSize=new google.maps.Size(256,256),this.cache={}},wax.g.connector.prototype.getTile=function(a,b,c){var d=b+"/"+a.x+"/"+a.y;if(!this.cache[d]){var e=this.cache[d]=new Image(256,256);this.cache[d].src=this.getTileUrl(a,b),this.cache[d].setAttribute("gTileKey",d),this.cache[d].onerror=function(){e.style.display="none"}}return this.cache[d]},wax.g.connector.prototype.releaseTile=function(a){var b=a.getAttribute("gTileKey");this.cache[b]&&delete this.cache[b],a.parentNode&&a.parentNode.removeChild(a)},wax.g.connector.prototype.getTileUrl=function(a,b){var c=Math.pow(2,b),d=this.options.scheme==="tms"?c-1-a.y:a.y,e=a.x%c;return e=e<0?a.x%c+c:e,d<0?this.options.blankImage:this.options.tiles[parseInt(e+d,10)%this.options.tiles.length].replace("{z}",b).replace("{x}",e).replace("{y}",d)} |
@@ -1,2 +0,2 @@ | ||
/* wax - 6.0.0-beta1 - 1.0.4-522-g703646f */!function(a,b,c){typeof module!="undefined"?module.exports=c(a,b):typeof define=="function"&&typeof define.amd=="object"?define(c):b[a]=c(a,b)}("bean",this,function(a,b){var c=window,d=b[a],e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=Array.prototype.slice,q=/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,r=/mouse.*(wheel|scroll)/i,s=/^text/i,t=/^touch|^gesture/i,u={one:1},v=function(a,b,c){for(c=0;c<b.length;c++)a[b[c]]=1;return a}({},("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(n?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),w=function(){function a(a,b){while((b=b.parentNode)!==null)if(b===a)return!0;return!1}function b(b){var c=b.relatedTarget;return c?c!==this&&c.prefix!=="xul"&&!/document/.test(this.toString())&&!a(this,c):c===null}return{mouseenter:{base:"mouseover",condition:b},mouseleave:{base:"mouseout",condition:b},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),x=function(){var a="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),b=a.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),c=b.concat("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis".split(" ")),d=a.concat("char charCode key keyCode keyIdentifier keyLocation".split(" ")),f=a.concat(["data"]),g=a.concat("touches targetTouches changedTouches scale rotation".split(" ")),h="preventDefault",i=function(a){return function(){a[h]?a[h]():a.returnValue=!1}},j="stopPropagation",k=function(a){return function(){a[j]?a[j]():a.cancelBubble=!0}},n=function(a){return function(){a[h](),a[j](),a.stopped=!0}},o=function(a,b,c){var d,e;for(d=c.length;d--;)e=c[d],!(e in b)&&e in a&&(b[e]=a[e])};return function(p,u){var v={originalEvent:p,isNative:u};if(!p)return v;var w,x=p.type,y=p.target||p.srcElement;v[h]=i(p),v[j]=k(p),v.stop=n(v),v.target=y&&y.nodeType===3?y.parentNode:y;if(u){if(x.indexOf("key")!==-1)w=d,v.keyCode=p.which||p.keyCode;else if(q.test(x)){w=b,v.rightClick=p.which===3||p.button===2,v.pos={x:0,y:0};if(p.pageX||p.pageY)v.clientX=p.pageX,v.clientY=p.pageY;else if(p.clientX||p.clientY)v.clientX=p.clientX+l.body.scrollLeft+m.scrollLeft,v.clientY=p.clientY+l.body.scrollTop+m.scrollTop;e.test(x)&&(v.relatedTarget=p.relatedTarget||p[(x==="mouseover"?"from":"to")+"Element"])}else t.test(x)?w=g:r.test(x)?w=c:s.test(x)&&(w=f);o(p,v,w||a)}return v}}(),y=function(a,b){return!n&&!b&&(a===l||a===c)?m:a},z=function(){function a(a,b,c,d,e){this.element=a,this.type=b,this.handler=c,this.original=d,this.namespaces=e,this.custom=w[b],this.isNative=v[b]&&a[o],this.eventType=n||this.isNative?b:"propertychange",this.customType=!n&&!this.isNative&&b,this.target=y(a,this.isNative),this.eventSupport=this.target[o]}return a.prototype={inNamespaces:function(a){var b,c;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)if(a[b]===this.namespaces[c])return!0;return!1},matches:function(a,b,c){return this.element===a&&(!b||this.original===b)&&(!c||this.handler===c)}},a}(),A=function(){var a={},b=function(c,d,e,f,g){if(!d||d==="*")for(var h in a)h.charAt(0)==="$"&&b(c,h.substr(1),e,f,g);else{var i=0,j,k=a["$"+d],l=c==="*";if(!k)return;for(j=k.length;i<j;i++)if(l||k[i].matches(c,e,f))if(!g(k[i],k,i,d))return}},c=function(b,c,d){var e,f=a["$"+c];if(f)for(e=f.length;e--;)if(f[e].matches(b,d,null))return!0;return!1},d=function(a,c,d){var e=[];return b(a,c,d,null,function(a){return e.push(a)}),e},e=function(b){return(a["$"+b.type]||(a["$"+b.type]=[])).push(b),b},f=function(c){b(c.element,c.type,null,c.handler,function(b,c,d){return c.splice(d,1),c.length===0&&delete a["$"+b.type],!1})},g=function(){var b,c=[];for(b in a)b.charAt(0)==="$"&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),B=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},C=function(a,b,d){return function(e){return e=x(e||((this.ownerDocument||this.document||this).parentWindow||c).event,!0),b.apply(a,[e].concat(d))}},D=function(a,b,d,e,f,g){return function(h){if(e?e.apply(this,arguments):n?!0:h&&h.propertyName==="_on"+d||!h)h&&(h=x(h||((this.ownerDocument||this.document||this).parentWindow||c).event,g)),b.apply(a,h&&(!f||f.length===0)?arguments:p.call(arguments,h?0:1).concat(f))}},E=function(a,b,c,d,e){return function(){a(b,c,e),d.apply(this,arguments)}},F=function(a,b,c,d){var e,f,h,i=b&&b.replace(g,""),j=A.get(a,i,c);for(e=0,f=j.length;e<f;e++)j[e].inNamespaces(d)&&((h=j[e]).eventSupport&&B(h.target,h.eventType,h.handler,!1,h.type),A.del(h))},G=function(a,b,c,d,e){var h,i=b.replace(g,""),j=b.replace(f,"").split(".");if(A.has(a,i,c))return a;i==="unload"&&(c=E(F,a,i,c,d)),w[i]&&(w[i].condition&&(c=D(a,c,i,w[i].condition,!0)),i=w[i].base||i),h=A.put(new z(a,i,c,d,j[0]&&j)),h.handler=h.isNative?C(a,h.handler,e):D(a,h.handler,i,!1,e,!1),h.eventSupport&&B(h.target,h.eventType,h.handler,!0,h.customType)},H=function(a,b,c){return function(d){var e,f,g=typeof a=="string"?c(a,this):a;for(e=d.target;e&&e!==this;e=e.parentNode)for(f=g.length;f--;)if(g[f]===e)return b.apply(e,arguments)}},I=function(a,b,c){var d,e,h,i,j,k=F,l=b&&typeof b=="string";if(l&&b.indexOf(" ")>0){b=b.split(" ");for(j=b.length;j--;)I(a,b[j],c);return a}h=l&&b.replace(g,""),h&&w[h]&&(h=w[h].type);if(!b||l){if(i=l&&b.replace(f,""))i=i.split(".");k(a,h,c,i)}else if(typeof b=="function")k(a,null,b);else for(d in b)b.hasOwnProperty(d)&&I(a,d,b[d]);return a},J=function(a,b,c,d,e){var f,g,h,i,j=c,k=c&&typeof c=="string";if(b&&!c&&typeof b=="object")for(f in b)b.hasOwnProperty(f)&&J.apply(this,[a,f,b[f]]);else{i=arguments.length>3?p.call(arguments,3):[],g=(k?c:b).split(" "),k&&(c=H(b,j=d,e))&&(i=p.call(i,1)),this===u&&(c=E(I,a,b,c,j));for(h=g.length;h--;)G(a,g[h],c,j,i)}return a},K=function(){return J.apply(u,arguments)},L=n?function(a,b,d){var e=l.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=y(c,a),a?c.fireEvent("on"+b,l.createEventObject()):c["_on"+b]++},M=function(a,b,c){var d,e,h,i,j,k=b.split(" ");for(d=k.length;d--;){b=k[d].replace(g,"");if(i=k[d].replace(f,""))i=i.split(".");if(!i&&!c&&a[o])L(v[b],b,a);else{j=A.get(a,b),c=[!1].concat(c);for(e=0,h=j.length;e<h;e++)j[e].inNamespaces(i)&&j[e].handler.apply(a,c)}}return a},N=function(a,b,c){var d=0,e=A.get(b,c),f=e.length;for(;d<f;d++)e[d].original&&J(a,e[d].type,e[d].original);return a},O={add:J,one:K,remove:I,clone:N,fire:M,noConflict:function(){return b[a]=d,this}};if(c[i]){var P=function(){var a,b=A.entries();for(a in b)b[a].type&&b[a].type!=="unload"&&I(b[a].element,b[a].type);c[k]("onunload",P),c.CollectGarbage&&c.CollectGarbage()};c[i]("onunload",P)}return O});var html4={};html4.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10},html4.ATTRIBS={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0},html4.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128},html4.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:4,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,nobr:0,noembed:4,noframes:20,noscript:20,object:16,ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:84,select:0,small:0,span:0,strike:0,strong:0,style:148,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},html4.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},html4.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"body::background":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0},html4.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},html4.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"body::background":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2};var html=function(a){function g(a){a=b(a);if(c.hasOwnProperty(a))return c[a];var d=a.match(e);return d?String.fromCharCode(parseInt(d[1],10)):(d=a.match(f))?String.fromCharCode(parseInt(d[1],16)):""}function h(a,b){return g(b)}function j(a){return a.replace(i,"")}function l(a){return a.replace(k,h)}function s(a){return a.replace(m,"&").replace(o,"<").replace(p,">").replace(q,""").replace(r,"=")}function t(a){return a.replace(n,"&$1").replace(o,"<").replace(p,">")}function w(c){return function d(d,e){d=String(d);var f=null,g=!1,h=[],i=void 0,k=void 0,m=void 0;c.startDoc&&c.startDoc(e);while(d){var n=d.match(g?u:v);d=d.substring(n[0].length);if(g){if(n[1]){var o=b(n[1]),p;if(n[2]){var q=n[3];switch(q.charCodeAt(0)){case 34:case 39:q=q.substring(1,q.length-1)}p=l(j(q))}else p=o;h.push(o,p)}else if(n[4]){k!==void 0&&(m?c.startTag&&c.startTag(i,h,e):c.endTag&&c.endTag(i,e));if(m&&k&(a.eflags.CDATA|a.eflags.RCDATA)){f===null?f=b(d):f=f.substring(f.length-d.length);var r=f.indexOf("</"+i);r<0&&(r=d.length),r&&(k&a.eflags.CDATA?c.cdata&&c.cdata(d.substring(0,r),e):c.rcdata&&c.rcdata(t(d.substring(0,r)),e),d=d.substring(r))}i=k=m=void 0,h.length=0,g=!1}}else if(n[1])c.pcdata&&c.pcdata(n[0],e);else if(n[3])m=!n[2],g=!0,i=b(n[3]),k=a.ELEMENTS.hasOwnProperty(i)?a.ELEMENTS[i]:void 0;else if(n[4])c.pcdata&&c.pcdata(n[4],e);else if(n[5]&&c.pcdata){var s=n[5];c.pcdata(s==="<"?"<":s===">"?">":"&",e)}}c.endDoc&&c.endDoc(e)}}function x(b){var c,d;return w({startDoc:function(a){c=[],d=!1},startTag:function(e,f,g){if(d)return;if(!a.ELEMENTS.hasOwnProperty(e))return;var h=a.ELEMENTS[e];if(h&a.eflags.FOLDABLE)return;if(h&a.eflags.UNSAFE){d=!(h&a.eflags.EMPTY);return}f=b(e,f);if(f){h&a.eflags.EMPTY||c.push(e),g.push("<",e);for(var i=0,j=f.length;i<j;i+=2){var k=f[i],l=f[i+1];l!==null&&l!==void 0&&g.push(" ",k,'="',s(l),'"')}g.push(">")}},endTag:function(b,e){if(d){d=!1;return}if(!a.ELEMENTS.hasOwnProperty(b))return;var f=a.ELEMENTS[b];if(!(f&(a.eflags.UNSAFE|a.eflags.EMPTY|a.eflags.FOLDABLE))){var g;if(f&a.eflags.OPTIONAL_ENDTAG)for(g=c.length;--g>=0;){var h=c[g];if(h===b)break;if(!(a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG))return}else for(g=c.length;--g>=0;)if(c[g]===b)break;if(g<0)return;for(var i=c.length;--i>g;){var h=c[i];a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG||e.push("</",h,">")}c.length=g,e.push("</",b,">")}},pcdata:function(a,b){d||b.push(a)},rcdata:function(a,b){d||b.push(a)},cdata:function(a,b){d||b.push(a)},endDoc:function(a){for(var b=c.length;--b>=0;)a.push("</",c[b],">");c.length=0}})}function z(b,c,e){var f=[];return x(function g(b,f){for(var g=0;g<f.length;g+=2){var h=f[g],i=f[g+1],j=null,k;if((k=b+"::"+h,a.ATTRIBS.hasOwnProperty(k))||(k="*::"+h,a.ATTRIBS.hasOwnProperty(k)))j=a.ATTRIBS[k];if(j!==null)switch(j){case a.atype.NONE:break;case a.atype.SCRIPT:case a.atype.STYLE:i=null;break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:i=e?e(i):i;break;case a.atype.URI:var l=(""+i).match(y);l?!l[1]||d.test(l[1])?i=c&&c(i):i=null:i=null;break;case a.atype.URI_FRAGMENT:i&&"#"===i.charAt(0)?(i=e?e(i):i,i&&(i="#"+i)):i=null;break;default:i=null}else i=null;f[g+1]=i}return f})(b,f),f.join("")}var b;"script"==="SCRIPT".toLowerCase()?b=function(a){return a.toLowerCase()}:b=function(a){return a.replace(/[A-Z]/g,function(a){return String.fromCharCode(a.charCodeAt(0)|32)})};var c={lt:"<",gt:">",amp:"&",nbsp:" ",quot:'"',apos:"'"},d=/^(?:https?|mailto|data)$/i,e=/^#(\d+)$/,f=/^#x([0-9A-Fa-f]+)$/,i=/\0/g,k=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,m=/&/g,n=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,o=/</g,p=/>/g,q=/\"/g,r=/\=/g,u=new RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[\\s\\S][^a-z\\s>]*)","i"),v=new RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<!--[\\s\\S]*?-->|<!\\w[^>]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i"),y=new RegExp("^(?:([^:/?#]+):)?");return{escapeAttrib:s,makeHtmlSanitizer:x,makeSaxParser:w,normalizeRCData:t,sanitize:z,unescapeEntities:l}}(html4),html_sanitize=html.sanitize;typeof window!="undefined"&&(window.html=html,window.html_sanitize=html_sanitize),html4.ATTRIBS["*::style"]=0,html4.ELEMENTS.style=0;var Mustache=function(){var a={},b=function(){};return b.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a);return}a=this.render_pragmas(a);var e=this.render_section(a,b,c);e===!1&&(e=this.render_tags(a,b,c,d));if(d)return e;this.sendLines(e)},send:function(a){a!==""&&this.buffer.push(a)},sendLines:function(a){if(a){var b=a.split("\n");for(var c=0;c<b.length;c++)this.send(b[c])}},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=this.getCachedRegex("render_pragmas",function(a,b){return new RegExp(a+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+b,"g")});return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return!1;var d=this,e=this.getCachedRegex("render_section",function(a,b){return new RegExp("^([\\s\\S]*?)"+a+"(\\^|\\#)\\s*(.+)\\s*"+b+"\n*([\\s\\S]*?)"+a+"\\/\\s*\\3\\s*"+b+"\\s*([\\s\\S]*)$","g")});return a.replace(e,function(a,e,f,g,h,i){var j=e?d.render_tags(e,b,c,!0):"",k=i?d.render(i,b,c,!0):"",l,m=d.find(g,b);return f==="^"?!m||d.is_array(m)&&m.length===0?l=d.render(h,b,c,!0):l="":f==="#"&&(d.is_array(m)?l=d.map(m,function(a){return d.render(h,d.create_context(a),c,!0)}).join(""):d.is_object(m)?l=d.render(h,d.create_context(m),c,!0):typeof m=="function"?l=m.call(b,h,function(a){return d.render(a,b,c,!0)}):m?l=d.render(h,b,c,!0):l=""),j+l+k})},render_tags:function(a,b,c,d){var e=this,f=function(){return e.getCachedRegex("render_tags",function(a,b){return new RegExp(a+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+b+"+","g")})},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":return e.set_delimiters(h),g=f(),"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j<i.length;j++)i[j]=i[j].replace(g,h,this),d||this.send(i[j]);if(d)return i.join("\n")},set_delimiters:function(a){var b=a.split(" ");this.otag=this.escape_regex(b[0]),this.ctag=this.escape_regex(b[1])},escape_regex:function(a){if(!arguments.callee.sRE){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+b.join("|\\")+")","g")}return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){function c(a){return a===!1||a===0||a}a=this.trim(a);var d;return c(b[a])?d=b[a]:c(this.context[a])&&(d=this.context[a]),typeof d=="function"?d.apply(b):d!==undefined?d:""},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return a=String(a===null?"":a),a.replace(/&(?!\w+;)|["'<>\\]/g,function(a){switch(a){case"&":return"&";case'"':return""";case"'":return"'";case"<":return"<";case">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};return c[b]=a,c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e<d;e++)c.push(b(a[e]));return c},getCachedRegex:function(b,c){var d=a[this.otag];d||(d=a[this.otag]={});var e=d[this.ctag];e||(e=d[this.ctag]={});var f=e[b];return f||(f=e[b]=c(this.otag,this.ctag)),f}},{name:"mustache.js",version:"0.4.0-dev",to_html:function(a,c,d,e){var f=new b;e&&(f.send=e),f.render(a,c||{},d);if(!e)return f.buffer.join("\n")}}}();!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window),wax=wax||{},wax.attribution=function(){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var a,b={};return b.content=function(b){return typeof b=="undefined"?a.innerHTML:(a.innerHTML=html_sanitize(b,c,d),this)},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){function urlX(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function idX(a){return a}var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return html_sanitize(f(a,b),urlX,idX)}catch(c){console&&console.log(c)}},formatter},wax.gi=function(a,b){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}b=b||{};var c={},d=b.resolution||4,e=b.tileSize||256;return c.grid_tile=function(){return a},c.getKey=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>=e||Math.floor(b)>=e)return;return f(a.grid[Math.floor(c/d)].charCodeAt(Math.floor(b/d)))},c.gridFeature=function(b,c){var d=this.getKey(b,c),e=a.keys;if(e&&e[d]&&a.data[e[d]])return a.data[e[d]]},c.tileFeature=function(b,c,d){if(!a)return;var e=wax.u.offset(d);return feature=this.gridFeature(b-e.left,c-e.top),feature},c},wax.gm=function(){function f(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=new RegExp("/(\\d+)\\/(\\d+)\\/(\\d+)\\.[\\w\\._]+"),d=c.exec(b);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}var a=4,b={},c={},d,e=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return c.formatter=function(a){return arguments.length?(d=wax.formatter(a),c):d},c.template=function(a){return arguments.length?(d=wax.template(a),c):d},c.gridUrl=function(a){return arguments.length?(e=typeof a=="function"?a:f(a),c):e},c.getGrid=function(b,f){var g=e(b);return!d||!g?f(null,null):(wax.request.get(g,function(b,c){if(b)return f(b,null);f(null,wax.gi(c,d,{resolution:a||4}))}),c)},c.tilejson=function(a){return a.template?c.template(a.template):a.formatter&&c.formatter(a.formatter),a.grids&&c.gridUrl(a.grids),c},c},wax=wax||{},wax.hash=function(a){function b(){return location.hash.substring(1)}function c(a){location.hash="#"+a}function g(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(c)}function h(){var b=a.getCenterZoom();d!==b&&(d=b,c(d))}function i(a){if(a===d)return;g(d=a)&&h()}a=a||{};var d,e={},f=90-1e-8,j=wax.u.throttle(h,500);return e.add=function(){return i(b()),a.bindChange(j),this},e.remove=function(){return a.unbindChange(j),this},e.add()},wax=wax||{},wax.interaction=function(){function m(a){var b=h();for(var c=0;c<b.length;c++)if(b[c][0]<a.y&&b[c][0]+256>a.y&&b[c][1]<a.x&&b[c][1]+256>a.x)return b[c][2];return!1}function n(){return d?(window.clearTimeout(d),d=null,!0):!1}function o(d){if(c)return;var f=wax.u.eventoffset(d),g=m(f),h;g&&a.getGrid(g.src,function(c,j){if(c||!j)return;h=j.tileFeature(f.x,f.y,g),h?h&&e!==h?(e=h,bean.fire(b,"on",{parent:i(),data:h,formatter:a.formatter().format,e:d})):h||(e=null,bean.fire(b,"off")):(e=null,bean.fire(b,"off"))})}function p(a){if(n())return;c=!0,f=wax.u.eventoffset(a),a.type==="mousedown"?bean.add(document.body,"mouseup",r):a.type==="touchstart"&&a.touches.length===1&&(bean.fire(b,"off"),bean.add(i(),l))}function q(){bean.remove(i(),l),c=!1}function r(a){var b={},e=wax.u.eventoffset(a);c=!1;for(var h in a)b[h]=a[h];return bean.remove(document.body,"mouseup",r),bean.remove(i(),l),a.type==="touchend"?s(a,f):Math.round(e.y/g)===Math.round(f.y/g)&&Math.round(e.x/g)===Math.round(f.x/g)&&(d=window.setTimeout(function(){d=null,s(b,e)},300)),r}function s(c,d){var e=m(d);e&&a.getGrid(e.src,function(f,g){if(f||!g)return;var h=g.tileFeature(d.x,d.y,e);if(!h)return;bean.fire(b,"on",{parent:i(),data:h,formatter:a.formatter().format,e:c})})}var a=wax.gm(),b={},c=!1,d=!1,e,f,g=4,h,i,j,k={mousemove:o,touchstart:p,mousedown:p},l={touchend:r,touchmove:r,touchcancel:q};return b.attach=function(a){return arguments.length?(attach=a,b):attach},b.map=function(a){return arguments.length?(map=a,bean.add(i(),k),bean.add(i(),"touchstart",p),attach&&attach(map),b):map},b.grid=function(a){return arguments.length?(h=a,b):h},b.remove=function(){for(var a=0;a<clearingEvents.length;a++)map.removeCallback(clearingEvents[a],clearTileGrid);return bean.remove(i(),k),bean.fire(b,"remove"),b},b.tilejson=function(c){return arguments.length?(a.tilejson(c),b):tilejson},b.formatter=function(){return a.formatter()},b.on=function(a,c){return bean.add(b,a,c),b},b.off=function(a,c){return bean.remove(b,a,c),b},b.parent=function(a){return i=a,b},b};var wax=wax||{};wax.legend=function(){function d(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function e(a){return a}var a,b={},c;return b.element=function(){return c},b.content=function(c){return arguments.length?(c?(a.innerHTML=html_sanitize(c,d,e),a.style.display="block"):(a.innerHTML="",a.style.display="none"),b):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=c.appendChild(document.createElement("div")),a.className="wax-legend",a.style.display="none",b},b.add()};var wax=wax||{};wax.movetip={},wax.movetip=function(a){function g(a){return a&&a.className.indexOf("wax-popup")!==-1}function h(a,b){var c=document.createElement("div");return c.className="wax-movetip",c.style.cssText="position:absolute;",c.innerHTML=a,b.appendChild(c),d=b,_tooltipOffset=wax.util.offset(c),_contextOffset=wax.util.offset(d),c}function i(a){if(!c)return;var b=wax.util.eventoffset(a);c.className="wax-movetip",_tooltipOffset.height+b.y>_contextOffset.top+_contextOffset.height&&_contextOffset.height>_tooltipOffset.height&&(b.y-=_tooltipOffset.height,c.className+=" flip-y"),_tooltipOffset.width+b.x>_contextOffset.left+_contextOffset.width&&(b.x-=_tooltipOffset.width,c.className+=" flip-x"),c.style.left=b.x+"px",c.style.top=b.y+"px"}function j(a){if(!a)return;var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&e?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&e&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+e):a.parentNode&&a.parentNode.removeChild(a)}function k(a,b){c&&(j(c),c=undefined);var d=h(a,b);d.className+=" wax-popup",d.innerHTML=a;var e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close",d.appendChild(e);var f=function(a){return j(d),c=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),!1};e.addEventListener?e.addEventListener("click",f,!1) | ||
:e.attachEvent&&e.attachEvent("onclick",f),c=d}a=a||{};var b={},c=undefined,d=undefined,e=a.animationOut,f=a.animationIn;return b.over=function(a,b,d){if(!a)return;b.style.cursor="pointer";if(g(c))return;c=h(a,b),i(d),b.addEventListener&&b.addEventListener("mousemove",i)},b.out=function(a){a.style.cursor="default";if(g(c))return;c&&(j(c),a.removeEventListener&&a.removeEventListener("mousemove",i),c=undefined)},b};var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}},wax.template=function(a){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var b={};return b.format=function(b,e){var f={};for(var g in e)f[g]=e[g];return b.format&&(f["__"+b.format+"__"]=!0),html_sanitize(Mustache.to_html(a,f),c,d)},b};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(){function f(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function g(){function c(){this.parentNode&&this.parentNode.removeChild(this)}var a;document.body.style["-webkit-transition"]!==undefined?a="webkitTransitionEnd":document.body.style.MozTransition!==undefined&&(a="transitionend");var e;while(e=d.pop())b&&a?(bean.add(e,a,c),e.className+=" wax-fade"):e.parentNode&&e.parentNode.removeChild(e)}function h(b){var c;g();if((b.e.type==="mousemove"||!b.e.type)&&!a){c=b.formatter({format:"teaser"},b.data);if(!c)return;e.style.cursor="pointer",d.push(e.appendChild(f(c)))}else{c=b.formatter({format:"full"},b.data);if(!c)return;var h=e.appendChild(f(c));h.className+=" wax-popup";var i=h.appendChild(document.createElement("a"));i.href="#close",i.className="close",i.innerHTML="Close",a=!0,d.push(h),bean.add(i,"click touchend",function(b){b.stop(),g(),a=!1})}}function i(){e.style.cursor="default",a||g()}var a=!1,b=!1,c={},d=[],e;return c.parent=function(a){return arguments.length?(e=a,c):e},c.animate=function(a){return arguments.length?(b=a,c):b},c.events=function(){return{on:h,off:i}},c};var wax=wax||{};wax.u={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=document.body,e=0,f=0,g=function(a){if(a===d||a===document.documentElement)return;e+=a.offsetTop,f+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");e+=parseInt(c[13],10),f+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10)};g(a);try{while(a=a.offsetParent)g(a)}catch(h){}e+=d.offsetTop,f+=d.offsetLeft,e+=d.parentNode.offsetTop,f+=d.parentNode.offsetLeft;var i=document.defaultView?window.getComputedStyle(d.parentNode,null):d.parentNode.currentStyle;return d.parentNode.offsetTop!==parseInt(i.marginTop,10)&&!isNaN(parseInt(i.marginTop,10))&&(e+=parseInt(i.marginTop,10),f+=parseInt(i.marginLeft,10)),{top:e,left:f,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;a||(a=window.event);if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}},limit:function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}},throttle:function(a,b){return this.limit(a,b,!1)}},wax=wax||{},wax.leaf=wax.leaf||{},wax.leaf.interaction=function(){function c(){a=!0}function d(){return!a&&b?b:b=function(a){var b=[];for(var c in a)if(a[c]._tiles)for(var d in a[c]._tiles){var e=wax.u.offset(a[c]._tiles[d]);b.push([e.top,e.left,a[c]._tiles[d]])}return b}(map._layers)}function e(a){if(!arguments.length)return map;map=a;var b=["moveend"];for(var d=0;d<b.length;d++)map.on(b[d],c)}var a=!1,b;return wax.interaction().attach(e).parent(function(){return map._container}).grid(d)},wax=wax||{},wax.leaf=wax.leaf||{},wax.leaf.connector=L.TileLayer.extend({initialize:function(a){a=a||{},a.minZoom=a.minzoom||0,a.maxZoom=a.maxzoom||22,L.TileLayer.prototype.initialize.call(this,a.tiles[0],a)}}) | ||
/* wax - 6.0.0-beta2 - 1.0.4-526-g3351932 */!function(a,b,c){typeof module!="undefined"?module.exports=c(a,b):typeof define=="function"&&typeof define.amd=="object"?define(c):b[a]=c(a,b)}("bean",this,function(a,b){var c=window,d=b[a],e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=Array.prototype.slice,q=/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,r=/mouse.*(wheel|scroll)/i,s=/^text/i,t=/^touch|^gesture/i,u={one:1},v=function(a,b,c){for(c=0;c<b.length;c++)a[b[c]]=1;return a}({},("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(n?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),w=function(){function a(a,b){while((b=b.parentNode)!==null)if(b===a)return!0;return!1}function b(b){var c=b.relatedTarget;return c?c!==this&&c.prefix!=="xul"&&!/document/.test(this.toString())&&!a(this,c):c===null}return{mouseenter:{base:"mouseover",condition:b},mouseleave:{base:"mouseout",condition:b},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),x=function(){var a="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),b=a.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),c=b.concat("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis".split(" ")),d=a.concat("char charCode key keyCode keyIdentifier keyLocation".split(" ")),f=a.concat(["data"]),g=a.concat("touches targetTouches changedTouches scale rotation".split(" ")),h="preventDefault",i=function(a){return function(){a[h]?a[h]():a.returnValue=!1}},j="stopPropagation",k=function(a){return function(){a[j]?a[j]():a.cancelBubble=!0}},n=function(a){return function(){a[h](),a[j](),a.stopped=!0}},o=function(a,b,c){var d,e;for(d=c.length;d--;)e=c[d],!(e in b)&&e in a&&(b[e]=a[e])};return function(p,u){var v={originalEvent:p,isNative:u};if(!p)return v;var w,x=p.type,y=p.target||p.srcElement;v[h]=i(p),v[j]=k(p),v.stop=n(v),v.target=y&&y.nodeType===3?y.parentNode:y;if(u){if(x.indexOf("key")!==-1)w=d,v.keyCode=p.which||p.keyCode;else if(q.test(x)){w=b,v.rightClick=p.which===3||p.button===2,v.pos={x:0,y:0};if(p.pageX||p.pageY)v.clientX=p.pageX,v.clientY=p.pageY;else if(p.clientX||p.clientY)v.clientX=p.clientX+l.body.scrollLeft+m.scrollLeft,v.clientY=p.clientY+l.body.scrollTop+m.scrollTop;e.test(x)&&(v.relatedTarget=p.relatedTarget||p[(x==="mouseover"?"from":"to")+"Element"])}else t.test(x)?w=g:r.test(x)?w=c:s.test(x)&&(w=f);o(p,v,w||a)}return v}}(),y=function(a,b){return!n&&!b&&(a===l||a===c)?m:a},z=function(){function a(a,b,c,d,e){this.element=a,this.type=b,this.handler=c,this.original=d,this.namespaces=e,this.custom=w[b],this.isNative=v[b]&&a[o],this.eventType=n||this.isNative?b:"propertychange",this.customType=!n&&!this.isNative&&b,this.target=y(a,this.isNative),this.eventSupport=this.target[o]}return a.prototype={inNamespaces:function(a){var b,c;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)if(a[b]===this.namespaces[c])return!0;return!1},matches:function(a,b,c){return this.element===a&&(!b||this.original===b)&&(!c||this.handler===c)}},a}(),A=function(){var a={},b=function(c,d,e,f,g){if(!d||d==="*")for(var h in a)h.charAt(0)==="$"&&b(c,h.substr(1),e,f,g);else{var i=0,j,k=a["$"+d],l=c==="*";if(!k)return;for(j=k.length;i<j;i++)if(l||k[i].matches(c,e,f))if(!g(k[i],k,i,d))return}},c=function(b,c,d){var e,f=a["$"+c];if(f)for(e=f.length;e--;)if(f[e].matches(b,d,null))return!0;return!1},d=function(a,c,d){var e=[];return b(a,c,d,null,function(a){return e.push(a)}),e},e=function(b){return(a["$"+b.type]||(a["$"+b.type]=[])).push(b),b},f=function(c){b(c.element,c.type,null,c.handler,function(b,c,d){return c.splice(d,1),c.length===0&&delete a["$"+b.type],!1})},g=function(){var b,c=[];for(b in a)b.charAt(0)==="$"&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),B=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},C=function(a,b,d){return function(e){return e=x(e||((this.ownerDocument||this.document||this).parentWindow||c).event,!0),b.apply(a,[e].concat(d))}},D=function(a,b,d,e,f,g){return function(h){if(e?e.apply(this,arguments):n?!0:h&&h.propertyName==="_on"+d||!h)h&&(h=x(h||((this.ownerDocument||this.document||this).parentWindow||c).event,g)),b.apply(a,h&&(!f||f.length===0)?arguments:p.call(arguments,h?0:1).concat(f))}},E=function(a,b,c,d,e){return function(){a(b,c,e),d.apply(this,arguments)}},F=function(a,b,c,d){var e,f,h,i=b&&b.replace(g,""),j=A.get(a,i,c);for(e=0,f=j.length;e<f;e++)j[e].inNamespaces(d)&&((h=j[e]).eventSupport&&B(h.target,h.eventType,h.handler,!1,h.type),A.del(h))},G=function(a,b,c,d,e){var h,i=b.replace(g,""),j=b.replace(f,"").split(".");if(A.has(a,i,c))return a;i==="unload"&&(c=E(F,a,i,c,d)),w[i]&&(w[i].condition&&(c=D(a,c,i,w[i].condition,!0)),i=w[i].base||i),h=A.put(new z(a,i,c,d,j[0]&&j)),h.handler=h.isNative?C(a,h.handler,e):D(a,h.handler,i,!1,e,!1),h.eventSupport&&B(h.target,h.eventType,h.handler,!0,h.customType)},H=function(a,b,c){return function(d){var e,f,g=typeof a=="string"?c(a,this):a;for(e=d.target;e&&e!==this;e=e.parentNode)for(f=g.length;f--;)if(g[f]===e)return b.apply(e,arguments)}},I=function(a,b,c){var d,e,h,i,j,k=F,l=b&&typeof b=="string";if(l&&b.indexOf(" ")>0){b=b.split(" ");for(j=b.length;j--;)I(a,b[j],c);return a}h=l&&b.replace(g,""),h&&w[h]&&(h=w[h].type);if(!b||l){if(i=l&&b.replace(f,""))i=i.split(".");k(a,h,c,i)}else if(typeof b=="function")k(a,null,b);else for(d in b)b.hasOwnProperty(d)&&I(a,d,b[d]);return a},J=function(a,b,c,d,e){var f,g,h,i,j=c,k=c&&typeof c=="string";if(b&&!c&&typeof b=="object")for(f in b)b.hasOwnProperty(f)&&J.apply(this,[a,f,b[f]]);else{i=arguments.length>3?p.call(arguments,3):[],g=(k?c:b).split(" "),k&&(c=H(b,j=d,e))&&(i=p.call(i,1)),this===u&&(c=E(I,a,b,c,j));for(h=g.length;h--;)G(a,g[h],c,j,i)}return a},K=function(){return J.apply(u,arguments)},L=n?function(a,b,d){var e=l.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=y(c,a),a?c.fireEvent("on"+b,l.createEventObject()):c["_on"+b]++},M=function(a,b,c){var d,e,h,i,j,k=b.split(" ");for(d=k.length;d--;){b=k[d].replace(g,"");if(i=k[d].replace(f,""))i=i.split(".");if(!i&&!c&&a[o])L(v[b],b,a);else{j=A.get(a,b),c=[!1].concat(c);for(e=0,h=j.length;e<h;e++)j[e].inNamespaces(i)&&j[e].handler.apply(a,c)}}return a},N=function(a,b,c){var d=0,e=A.get(b,c),f=e.length;for(;d<f;d++)e[d].original&&J(a,e[d].type,e[d].original);return a},O={add:J,one:K,remove:I,clone:N,fire:M,noConflict:function(){return b[a]=d,this}};if(c[i]){var P=function(){var a,b=A.entries();for(a in b)b[a].type&&b[a].type!=="unload"&&I(b[a].element,b[a].type);c[k]("onunload",P),c.CollectGarbage&&c.CollectGarbage()};c[i]("onunload",P)}return O});var html4={};html4.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10},html4.ATTRIBS={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0},html4.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128},html4.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:4,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,nobr:0,noembed:4,noframes:20,noscript:20,object:16,ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:84,select:0,small:0,span:0,strike:0,strong:0,style:148,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},html4.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},html4.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"body::background":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0},html4.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},html4.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"body::background":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2};var html=function(a){function g(a){a=b(a);if(c.hasOwnProperty(a))return c[a];var d=a.match(e);return d?String.fromCharCode(parseInt(d[1],10)):(d=a.match(f))?String.fromCharCode(parseInt(d[1],16)):""}function h(a,b){return g(b)}function j(a){return a.replace(i,"")}function l(a){return a.replace(k,h)}function s(a){return a.replace(m,"&").replace(o,"<").replace(p,">").replace(q,""").replace(r,"=")}function t(a){return a.replace(n,"&$1").replace(o,"<").replace(p,">")}function w(c){return function d(d,e){d=String(d);var f=null,g=!1,h=[],i=void 0,k=void 0,m=void 0;c.startDoc&&c.startDoc(e);while(d){var n=d.match(g?u:v);d=d.substring(n[0].length);if(g){if(n[1]){var o=b(n[1]),p;if(n[2]){var q=n[3];switch(q.charCodeAt(0)){case 34:case 39:q=q.substring(1,q.length-1)}p=l(j(q))}else p=o;h.push(o,p)}else if(n[4]){k!==void 0&&(m?c.startTag&&c.startTag(i,h,e):c.endTag&&c.endTag(i,e));if(m&&k&(a.eflags.CDATA|a.eflags.RCDATA)){f===null?f=b(d):f=f.substring(f.length-d.length);var r=f.indexOf("</"+i);r<0&&(r=d.length),r&&(k&a.eflags.CDATA?c.cdata&&c.cdata(d.substring(0,r),e):c.rcdata&&c.rcdata(t(d.substring(0,r)),e),d=d.substring(r))}i=k=m=void 0,h.length=0,g=!1}}else if(n[1])c.pcdata&&c.pcdata(n[0],e);else if(n[3])m=!n[2],g=!0,i=b(n[3]),k=a.ELEMENTS.hasOwnProperty(i)?a.ELEMENTS[i]:void 0;else if(n[4])c.pcdata&&c.pcdata(n[4],e);else if(n[5]&&c.pcdata){var s=n[5];c.pcdata(s==="<"?"<":s===">"?">":"&",e)}}c.endDoc&&c.endDoc(e)}}function x(b){var c,d;return w({startDoc:function(a){c=[],d=!1},startTag:function(e,f,g){if(d)return;if(!a.ELEMENTS.hasOwnProperty(e))return;var h=a.ELEMENTS[e];if(h&a.eflags.FOLDABLE)return;if(h&a.eflags.UNSAFE){d=!(h&a.eflags.EMPTY);return}f=b(e,f);if(f){h&a.eflags.EMPTY||c.push(e),g.push("<",e);for(var i=0,j=f.length;i<j;i+=2){var k=f[i],l=f[i+1];l!==null&&l!==void 0&&g.push(" ",k,'="',s(l),'"')}g.push(">")}},endTag:function(b,e){if(d){d=!1;return}if(!a.ELEMENTS.hasOwnProperty(b))return;var f=a.ELEMENTS[b];if(!(f&(a.eflags.UNSAFE|a.eflags.EMPTY|a.eflags.FOLDABLE))){var g;if(f&a.eflags.OPTIONAL_ENDTAG)for(g=c.length;--g>=0;){var h=c[g];if(h===b)break;if(!(a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG))return}else for(g=c.length;--g>=0;)if(c[g]===b)break;if(g<0)return;for(var i=c.length;--i>g;){var h=c[i];a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG||e.push("</",h,">")}c.length=g,e.push("</",b,">")}},pcdata:function(a,b){d||b.push(a)},rcdata:function(a,b){d||b.push(a)},cdata:function(a,b){d||b.push(a)},endDoc:function(a){for(var b=c.length;--b>=0;)a.push("</",c[b],">");c.length=0}})}function z(b,c,e){var f=[];return x(function g(b,f){for(var g=0;g<f.length;g+=2){var h=f[g],i=f[g+1],j=null,k;if((k=b+"::"+h,a.ATTRIBS.hasOwnProperty(k))||(k="*::"+h,a.ATTRIBS.hasOwnProperty(k)))j=a.ATTRIBS[k];if(j!==null)switch(j){case a.atype.NONE:break;case a.atype.SCRIPT:case a.atype.STYLE:i=null;break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:i=e?e(i):i;break;case a.atype.URI:var l=(""+i).match(y);l?!l[1]||d.test(l[1])?i=c&&c(i):i=null:i=null;break;case a.atype.URI_FRAGMENT:i&&"#"===i.charAt(0)?(i=e?e(i):i,i&&(i="#"+i)):i=null;break;default:i=null}else i=null;f[g+1]=i}return f})(b,f),f.join("")}var b;"script"==="SCRIPT".toLowerCase()?b=function(a){return a.toLowerCase()}:b=function(a){return a.replace(/[A-Z]/g,function(a){return String.fromCharCode(a.charCodeAt(0)|32)})};var c={lt:"<",gt:">",amp:"&",nbsp:" ",quot:'"',apos:"'"},d=/^(?:https?|mailto|data)$/i,e=/^#(\d+)$/,f=/^#x([0-9A-Fa-f]+)$/,i=/\0/g,k=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,m=/&/g,n=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,o=/</g,p=/>/g,q=/\"/g,r=/\=/g,u=new RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[\\s\\S][^a-z\\s>]*)","i"),v=new RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<!--[\\s\\S]*?-->|<!\\w[^>]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i"),y=new RegExp("^(?:([^:/?#]+):)?");return{escapeAttrib:s,makeHtmlSanitizer:x,makeSaxParser:w,normalizeRCData:t,sanitize:z,unescapeEntities:l}}(html4),html_sanitize=html.sanitize;typeof window!="undefined"&&(window.html=html,window.html_sanitize=html_sanitize),html4.ATTRIBS["*::style"]=0,html4.ELEMENTS.style=0;var Mustache=function(){var a={},b=function(){};return b.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a);return}a=this.render_pragmas(a);var e=this.render_section(a,b,c);e===!1&&(e=this.render_tags(a,b,c,d));if(d)return e;this.sendLines(e)},send:function(a){a!==""&&this.buffer.push(a)},sendLines:function(a){if(a){var b=a.split("\n");for(var c=0;c<b.length;c++)this.send(b[c])}},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=this.getCachedRegex("render_pragmas",function(a,b){return new RegExp(a+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+b,"g")});return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return!1;var d=this,e=this.getCachedRegex("render_section",function(a,b){return new RegExp("^([\\s\\S]*?)"+a+"(\\^|\\#)\\s*(.+)\\s*"+b+"\n*([\\s\\S]*?)"+a+"\\/\\s*\\3\\s*"+b+"\\s*([\\s\\S]*)$","g")});return a.replace(e,function(a,e,f,g,h,i){var j=e?d.render_tags(e,b,c,!0):"",k=i?d.render(i,b,c,!0):"",l,m=d.find(g,b);return f==="^"?!m||d.is_array(m)&&m.length===0?l=d.render(h,b,c,!0):l="":f==="#"&&(d.is_array(m)?l=d.map(m,function(a){return d.render(h,d.create_context(a),c,!0)}).join(""):d.is_object(m)?l=d.render(h,d.create_context(m),c,!0):typeof m=="function"?l=m.call(b,h,function(a){return d.render(a,b,c,!0)}):m?l=d.render(h,b,c,!0):l=""),j+l+k})},render_tags:function(a,b,c,d){var e=this,f=function(){return e.getCachedRegex("render_tags",function(a,b){return new RegExp(a+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+b+"+","g")})},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":return e.set_delimiters(h),g=f(),"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j<i.length;j++)i[j]=i[j].replace(g,h,this),d||this.send(i[j]);if(d)return i.join("\n")},set_delimiters:function(a){var b=a.split(" ");this.otag=this.escape_regex(b[0]),this.ctag=this.escape_regex(b[1])},escape_regex:function(a){if(!arguments.callee.sRE){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+b.join("|\\")+")","g")}return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){function c(a){return a===!1||a===0||a}a=this.trim(a);var d;return c(b[a])?d=b[a]:c(this.context[a])&&(d=this.context[a]),typeof d=="function"?d.apply(b):d!==undefined?d:""},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return a=String(a===null?"":a),a.replace(/&(?!\w+;)|["'<>\\]/g,function(a){switch(a){case"&":return"&";case'"':return""";case"'":return"'";case"<":return"<";case">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};return c[b]=a,c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e<d;e++)c.push(b(a[e]));return c},getCachedRegex:function(b,c){var d=a[this.otag];d||(d=a[this.otag]={});var e=d[this.ctag];e||(e=d[this.ctag]={});var f=e[b];return f||(f=e[b]=c(this.otag,this.ctag)),f}},{name:"mustache.js",version:"0.4.0-dev",to_html:function(a,c,d,e){var f=new b;e&&(f.send=e),f.render(a,c||{},d);if(!e)return f.buffer.join("\n")}}}();!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window),wax=wax||{},wax.attribution=function(){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var a,b={};return b.content=function(b){return typeof b=="undefined"?a.innerHTML:(a.innerHTML=html_sanitize(b,c,d),this)},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){function urlX(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function idX(a){return a}var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return html_sanitize(f(a,b),urlX,idX)}catch(c){console&&console.log(c)}},formatter},wax.gi=function(a,b){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}b=b||{};var c={},d=b.resolution||4,e=b.tileSize||256;return c.grid_tile=function(){return a},c.getKey=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>=e||Math.floor(b)>=e)return;return f(a.grid[Math.floor(c/d)].charCodeAt(Math.floor(b/d)))},c.gridFeature=function(b,c){var d=this.getKey(b,c),e=a.keys;if(e&&e[d]&&a.data[e[d]])return a.data[e[d]]},c.tileFeature=function(b,c,d){if(!a)return;var e=wax.u.offset(d);return feature=this.gridFeature(b-e.left,c-e.top),feature},c},wax.gm=function(){function f(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=new RegExp("/(\\d+)\\/(\\d+)\\/(\\d+)\\.[\\w\\._]+"),d=c.exec(b);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}var a=4,b={},c={},d,e=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return c.formatter=function(a){return arguments.length?(d=wax.formatter(a),c):d},c.template=function(a){return arguments.length?(d=wax.template(a),c):d},c.gridUrl=function(a){return arguments.length?(e=typeof a=="function"?a:f(a),c):e},c.getGrid=function(b,f){var g=e(b);return!d||!g?f(null,null):(wax.request.get(g,function(b,c){if(b)return f(b,null);f(null,wax.gi(c,d,{resolution:a||4}))}),c)},c.tilejson=function(a){return a.template?c.template(a.template):a.formatter&&c.formatter(a.formatter),a.grids&&c.gridUrl(a.grids),c},c},wax=wax||{},wax.hash=function(a){function b(){return location.hash.substring(1)}function c(a){location.hash="#"+a}function g(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(c)}function h(){var b=a.getCenterZoom();d!==b&&(d=b,c(d))}function i(a){if(a===d)return;g(d=a)&&h()}a=a||{};var d,e={},f=90-1e-8,j=wax.u.throttle(h,500);return e.add=function(){return i(b()),a.bindChange(j),this},e.remove=function(){return a.unbindChange(j),this},e.add()},wax=wax||{},wax.interaction=function(){function l(a){var b=g();for(var c=0;c<b.length;c++)if(b[c][0]<a.y&&b[c][0]+256>a.y&&b[c][1]<a.x&&b[c][1]+256>a.x)return b[c][2];return!1}function m(){return d?(window.clearTimeout(d),d=null,!0):!1}function n(d){if(c)return;var e=wax.u.eventoffset(d),f=l(e),g;f&&a.getGrid(f.src,function(c,i){if(c||!i)return;g=i.tileFeature(e.x,e.y,f),g?bean.fire(b,"on",{parent:h(),data:g,formatter:a.formatter().format,e:d}):bean.fire(b,"off")})}function o(a){if(m())return;c=!0,e=wax.u.eventoffset(a),a.type==="mousedown"?bean.add(document.body,"mouseup",q):a.type==="touchstart"&&a.touches.length===1&&(bean.fire(b,"off"),bean.add(h(),k))}function p(){bean.remove(h(),k),c=!1}function q(a){var b={},g=wax.u.eventoffset(a);c=!1;for(var i in a)b[i]=a[i];return bean.remove(document.body,"mouseup",q),bean.remove(h(),k),a.type==="touchend"?r(a,e):Math.round(g.y/f)===Math.round(e.y/f)&&Math.round(g.x/f)===Math.round(e.x/f)&&(d=window.setTimeout(function(){d=null,r(b,g)},300)),q}function r(c,d){var e=l(d);e&&a.getGrid(e.src,function(f,g){if(f||!g)return;var i=g.tileFeature(d.x,d.y,e);if(!i)return;bean.fire(b,"on",{parent:h(),data:i,formatter:a.formatter().format,e:c})})}var a=wax.gm(),b={},c=!1,d=!1,e,f=4,g,h,i,j={mousemove:n,touchstart:o,mousedown:o},k={touchend:q,touchmove:q,touchcancel:p};return b.attach=function(a){return arguments.length?(attach=a,b):attach},b.map=function(a){return arguments.length?(map=a,bean.add(h(),j),bean.add(h(),"touchstart",o),attach&&attach(map),b):map},b.grid=function(a){return arguments.length?(g=a,b):g},b.remove=function(){for(var a=0;a<clearingEvents.length;a++)map.removeCallback(clearingEvents[a],clearTileGrid);return bean.remove(h(),j),bean.fire(b,"remove"),b},b.tilejson=function(c){return arguments.length?(a.tilejson(c),b):tilejson},b.formatter=function(){return a.formatter()},b.on=function(a,c){return bean.add(b,a,c),b},b.off=function(a,c){return bean.remove(b,a,c),b},b.parent=function(a){return h=a,b},b};var wax=wax||{};wax.legend=function(){function d(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function e(a){return a}var a,b={},c;return b.element=function(){return c},b.content=function(c){return arguments.length?(c?(a.innerHTML=html_sanitize(c,d,e),a.style.display="block"):(a.innerHTML="",a.style.display="none"),b):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=c.appendChild(document.createElement("div")),a.className="wax-legend",a.style.display="none",b},b.add()};var wax=wax||{};wax.movetip={},wax.movetip=function(){function g(a){var b=wax.u.eventoffset(a);c.height+b.y>d.top+d.height&&d.height>c.height&&(b.y-=c.height,e.className+=" flip-y"),c.width+b.x>d.left+d.width&&(b.x-=c.width,e.className+=" flip-x"),e.style.left=b.x+"px",e.style.top=b.y+"px"}function h(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function i(){e&&(e.parentNode.removeChild(e),e=null)}function j(b){var j;if(a)return;if(b.e.type==="mousemove"||!b.e.type){j=b.formatter({format:"teaser"},b.data);if(!j)return;i(),f.style.cursor="pointer",e=document.body.appendChild(h(j))}else{j=b.formatter({format:"teaser"},b.data);if(!j)return;i();var k=document.body.appendChild(h(j));k.className+=" wax-popup";var l=k.appendChild(document.createElement("a"));l.href="#close",l.className="close",l.innerHTML="Close",a=!0,e=k,c=wax.u.offset(e),d=wax.u.offset(f),g(b.e),bean.add(l,"click touchend",function(b){b.stop(),i(),a=!1})}e&&(c=wax.u.offset(e),d=wax.u.offset(f),g(b.e))}function k(){f.style.cursor="default",a||i()}var a=!1,b={},c,d,e,f;return b.parent=function(a){return arguments.length?(f=a,b):f},b.events=function(){return{on:j,off:k}},b};var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success | ||
:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}},wax.template=function(a){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var b={};return b.format=function(b,e){var f={};for(var g in e)f[g]=e[g];return b.format&&(f["__"+b.format+"__"]=!0),html_sanitize(Mustache.to_html(a,f),c,d)},b};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(){function h(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function i(){this.parentNode&&this.parentNode.removeChild(this)}function j(){var a;while(a=d.pop())b&&f?(bean.add(a,f,i),a.className+=" wax-fade"):a.parentNode&&a.parentNode.removeChild(a)}function k(b){var c;if((b.e.type==="mousemove"||!b.e.type)&&!a){c=b.formatter({format:"teaser"},b.data);if(!c||c==e)return;j(),g.style.cursor="pointer",d.push(g.appendChild(h(c))),e=c}else{c=b.formatter({format:"full"},b.data);if(!c)return;j(),g.style.cursor="pointer";var f=g.appendChild(h(c));f.className+=" wax-popup";var i=f.appendChild(document.createElement("a"));i.href="#close",i.className="close",i.innerHTML="Close",a=!0,d.push(f),bean.add(i,"click touchend",function(b){b.stop(),j(),a=!1})}}function l(){g.style.cursor="default",e=null,a||j()}var a=!1,b=!1,c={},d=[],e,f,g;return document.body.style["-webkit-transition"]!==undefined?f="webkitTransitionEnd":document.body.style.MozTransition!==undefined&&(f="transitionend"),c.parent=function(a){return arguments.length?(g=a,c):g},c.animate=function(a){return arguments.length?(b=a,c):b},c.events=function(){return{on:k,off:l}},c};var wax=wax||{};wax.u={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=document.body,e=0,f=0,g=function(a){if(a===d||a===document.documentElement)return;e+=a.offsetTop,f+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");e+=parseInt(c[13],10),f+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10)};g(a);try{while(a=a.offsetParent)g(a)}catch(h){}e+=d.offsetTop,f+=d.offsetLeft,e+=d.parentNode.offsetTop,f+=d.parentNode.offsetLeft;var i=document.defaultView?window.getComputedStyle(d.parentNode,null):d.parentNode.currentStyle;return d.parentNode.offsetTop!==parseInt(i.marginTop,10)&&!isNaN(parseInt(i.marginTop,10))&&(e+=parseInt(i.marginTop,10),f+=parseInt(i.marginLeft,10)),{top:e,left:f,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;a||(a=window.event);if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}},limit:function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}},throttle:function(a,b){return this.limit(a,b,!1)}},wax=wax||{},wax.leaf=wax.leaf||{},wax.leaf.interaction=function(){function c(){a=!0}function d(){return!a&&b?b:b=function(a){var b=[];for(var c in a)if(a[c]._tiles)for(var d in a[c]._tiles){var e=wax.u.offset(a[c]._tiles[d]);b.push([e.top,e.left,a[c]._tiles[d]])}return b}(map._layers)}function e(a){if(!arguments.length)return map;map=a;var b=["moveend"];for(var d=0;d<b.length;d++)map.on(b[d],c)}var a=!1,b;return wax.interaction().attach(e).parent(function(){return map._container}).grid(d)},wax=wax||{},wax.leaf=wax.leaf||{},wax.leaf.connector=L.TileLayer.extend({initialize:function(a){a=a||{},a.minZoom=a.minzoom||0,a.maxZoom=a.maxzoom||22,L.TileLayer.prototype.initialize.call(this,a.tiles[0],a)}}) |
@@ -1,2 +0,2 @@ | ||
/* wax - 6.0.0-beta1 - 1.0.4-522-g703646f */!function(a,b,c){typeof module!="undefined"?module.exports=c(a,b):typeof define=="function"&&typeof define.amd=="object"?define(c):b[a]=c(a,b)}("bean",this,function(a,b){var c=window,d=b[a],e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=Array.prototype.slice,q=/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,r=/mouse.*(wheel|scroll)/i,s=/^text/i,t=/^touch|^gesture/i,u={one:1},v=function(a,b,c){for(c=0;c<b.length;c++)a[b[c]]=1;return a}({},("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(n?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),w=function(){function a(a,b){while((b=b.parentNode)!==null)if(b===a)return!0;return!1}function b(b){var c=b.relatedTarget;return c?c!==this&&c.prefix!=="xul"&&!/document/.test(this.toString())&&!a(this,c):c===null}return{mouseenter:{base:"mouseover",condition:b},mouseleave:{base:"mouseout",condition:b},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),x=function(){var a="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),b=a.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),c=b.concat("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis".split(" ")),d=a.concat("char charCode key keyCode keyIdentifier keyLocation".split(" ")),f=a.concat(["data"]),g=a.concat("touches targetTouches changedTouches scale rotation".split(" ")),h="preventDefault",i=function(a){return function(){a[h]?a[h]():a.returnValue=!1}},j="stopPropagation",k=function(a){return function(){a[j]?a[j]():a.cancelBubble=!0}},n=function(a){return function(){a[h](),a[j](),a.stopped=!0}},o=function(a,b,c){var d,e;for(d=c.length;d--;)e=c[d],!(e in b)&&e in a&&(b[e]=a[e])};return function(p,u){var v={originalEvent:p,isNative:u};if(!p)return v;var w,x=p.type,y=p.target||p.srcElement;v[h]=i(p),v[j]=k(p),v.stop=n(v),v.target=y&&y.nodeType===3?y.parentNode:y;if(u){if(x.indexOf("key")!==-1)w=d,v.keyCode=p.which||p.keyCode;else if(q.test(x)){w=b,v.rightClick=p.which===3||p.button===2,v.pos={x:0,y:0};if(p.pageX||p.pageY)v.clientX=p.pageX,v.clientY=p.pageY;else if(p.clientX||p.clientY)v.clientX=p.clientX+l.body.scrollLeft+m.scrollLeft,v.clientY=p.clientY+l.body.scrollTop+m.scrollTop;e.test(x)&&(v.relatedTarget=p.relatedTarget||p[(x==="mouseover"?"from":"to")+"Element"])}else t.test(x)?w=g:r.test(x)?w=c:s.test(x)&&(w=f);o(p,v,w||a)}return v}}(),y=function(a,b){return!n&&!b&&(a===l||a===c)?m:a},z=function(){function a(a,b,c,d,e){this.element=a,this.type=b,this.handler=c,this.original=d,this.namespaces=e,this.custom=w[b],this.isNative=v[b]&&a[o],this.eventType=n||this.isNative?b:"propertychange",this.customType=!n&&!this.isNative&&b,this.target=y(a,this.isNative),this.eventSupport=this.target[o]}return a.prototype={inNamespaces:function(a){var b,c;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)if(a[b]===this.namespaces[c])return!0;return!1},matches:function(a,b,c){return this.element===a&&(!b||this.original===b)&&(!c||this.handler===c)}},a}(),A=function(){var a={},b=function(c,d,e,f,g){if(!d||d==="*")for(var h in a)h.charAt(0)==="$"&&b(c,h.substr(1),e,f,g);else{var i=0,j,k=a["$"+d],l=c==="*";if(!k)return;for(j=k.length;i<j;i++)if(l||k[i].matches(c,e,f))if(!g(k[i],k,i,d))return}},c=function(b,c,d){var e,f=a["$"+c];if(f)for(e=f.length;e--;)if(f[e].matches(b,d,null))return!0;return!1},d=function(a,c,d){var e=[];return b(a,c,d,null,function(a){return e.push(a)}),e},e=function(b){return(a["$"+b.type]||(a["$"+b.type]=[])).push(b),b},f=function(c){b(c.element,c.type,null,c.handler,function(b,c,d){return c.splice(d,1),c.length===0&&delete a["$"+b.type],!1})},g=function(){var b,c=[];for(b in a)b.charAt(0)==="$"&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),B=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},C=function(a,b,d){return function(e){return e=x(e||((this.ownerDocument||this.document||this).parentWindow||c).event,!0),b.apply(a,[e].concat(d))}},D=function(a,b,d,e,f,g){return function(h){if(e?e.apply(this,arguments):n?!0:h&&h.propertyName==="_on"+d||!h)h&&(h=x(h||((this.ownerDocument||this.document||this).parentWindow||c).event,g)),b.apply(a,h&&(!f||f.length===0)?arguments:p.call(arguments,h?0:1).concat(f))}},E=function(a,b,c,d,e){return function(){a(b,c,e),d.apply(this,arguments)}},F=function(a,b,c,d){var e,f,h,i=b&&b.replace(g,""),j=A.get(a,i,c);for(e=0,f=j.length;e<f;e++)j[e].inNamespaces(d)&&((h=j[e]).eventSupport&&B(h.target,h.eventType,h.handler,!1,h.type),A.del(h))},G=function(a,b,c,d,e){var h,i=b.replace(g,""),j=b.replace(f,"").split(".");if(A.has(a,i,c))return a;i==="unload"&&(c=E(F,a,i,c,d)),w[i]&&(w[i].condition&&(c=D(a,c,i,w[i].condition,!0)),i=w[i].base||i),h=A.put(new z(a,i,c,d,j[0]&&j)),h.handler=h.isNative?C(a,h.handler,e):D(a,h.handler,i,!1,e,!1),h.eventSupport&&B(h.target,h.eventType,h.handler,!0,h.customType)},H=function(a,b,c){return function(d){var e,f,g=typeof a=="string"?c(a,this):a;for(e=d.target;e&&e!==this;e=e.parentNode)for(f=g.length;f--;)if(g[f]===e)return b.apply(e,arguments)}},I=function(a,b,c){var d,e,h,i,j,k=F,l=b&&typeof b=="string";if(l&&b.indexOf(" ")>0){b=b.split(" ");for(j=b.length;j--;)I(a,b[j],c);return a}h=l&&b.replace(g,""),h&&w[h]&&(h=w[h].type);if(!b||l){if(i=l&&b.replace(f,""))i=i.split(".");k(a,h,c,i)}else if(typeof b=="function")k(a,null,b);else for(d in b)b.hasOwnProperty(d)&&I(a,d,b[d]);return a},J=function(a,b,c,d,e){var f,g,h,i,j=c,k=c&&typeof c=="string";if(b&&!c&&typeof b=="object")for(f in b)b.hasOwnProperty(f)&&J.apply(this,[a,f,b[f]]);else{i=arguments.length>3?p.call(arguments,3):[],g=(k?c:b).split(" "),k&&(c=H(b,j=d,e))&&(i=p.call(i,1)),this===u&&(c=E(I,a,b,c,j));for(h=g.length;h--;)G(a,g[h],c,j,i)}return a},K=function(){return J.apply(u,arguments)},L=n?function(a,b,d){var e=l.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=y(c,a),a?c.fireEvent("on"+b,l.createEventObject()):c["_on"+b]++},M=function(a,b,c){var d,e,h,i,j,k=b.split(" ");for(d=k.length;d--;){b=k[d].replace(g,"");if(i=k[d].replace(f,""))i=i.split(".");if(!i&&!c&&a[o])L(v[b],b,a);else{j=A.get(a,b),c=[!1].concat(c);for(e=0,h=j.length;e<h;e++)j[e].inNamespaces(i)&&j[e].handler.apply(a,c)}}return a},N=function(a,b,c){var d=0,e=A.get(b,c),f=e.length;for(;d<f;d++)e[d].original&&J(a,e[d].type,e[d].original);return a},O={add:J,one:K,remove:I,clone:N,fire:M,noConflict:function(){return b[a]=d,this}};if(c[i]){var P=function(){var a,b=A.entries();for(a in b)b[a].type&&b[a].type!=="unload"&&I(b[a].element,b[a].type);c[k]("onunload",P),c.CollectGarbage&&c.CollectGarbage()};c[i]("onunload",P)}return O});var html4={};html4.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10},html4.ATTRIBS={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0},html4.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128},html4.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:4,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,nobr:0,noembed:4,noframes:20,noscript:20,object:16,ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:84,select:0,small:0,span:0,strike:0,strong:0,style:148,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},html4.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},html4.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"body::background":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0},html4.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},html4.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"body::background":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2};var html=function(a){function g(a){a=b(a);if(c.hasOwnProperty(a))return c[a];var d=a.match(e);return d?String.fromCharCode(parseInt(d[1],10)):(d=a.match(f))?String.fromCharCode(parseInt(d[1],16)):""}function h(a,b){return g(b)}function j(a){return a.replace(i,"")}function l(a){return a.replace(k,h)}function s(a){return a.replace(m,"&").replace(o,"<").replace(p,">").replace(q,""").replace(r,"=")}function t(a){return a.replace(n,"&$1").replace(o,"<").replace(p,">")}function w(c){return function d(d,e){d=String(d);var f=null,g=!1,h=[],i=void 0,k=void 0,m=void 0;c.startDoc&&c.startDoc(e);while(d){var n=d.match(g?u:v);d=d.substring(n[0].length);if(g){if(n[1]){var o=b(n[1]),p;if(n[2]){var q=n[3];switch(q.charCodeAt(0)){case 34:case 39:q=q.substring(1,q.length-1)}p=l(j(q))}else p=o;h.push(o,p)}else if(n[4]){k!==void 0&&(m?c.startTag&&c.startTag(i,h,e):c.endTag&&c.endTag(i,e));if(m&&k&(a.eflags.CDATA|a.eflags.RCDATA)){f===null?f=b(d):f=f.substring(f.length-d.length);var r=f.indexOf("</"+i);r<0&&(r=d.length),r&&(k&a.eflags.CDATA?c.cdata&&c.cdata(d.substring(0,r),e):c.rcdata&&c.rcdata(t(d.substring(0,r)),e),d=d.substring(r))}i=k=m=void 0,h.length=0,g=!1}}else if(n[1])c.pcdata&&c.pcdata(n[0],e);else if(n[3])m=!n[2],g=!0,i=b(n[3]),k=a.ELEMENTS.hasOwnProperty(i)?a.ELEMENTS[i]:void 0;else if(n[4])c.pcdata&&c.pcdata(n[4],e);else if(n[5]&&c.pcdata){var s=n[5];c.pcdata(s==="<"?"<":s===">"?">":"&",e)}}c.endDoc&&c.endDoc(e)}}function x(b){var c,d;return w({startDoc:function(a){c=[],d=!1},startTag:function(e,f,g){if(d)return;if(!a.ELEMENTS.hasOwnProperty(e))return;var h=a.ELEMENTS[e];if(h&a.eflags.FOLDABLE)return;if(h&a.eflags.UNSAFE){d=!(h&a.eflags.EMPTY);return}f=b(e,f);if(f){h&a.eflags.EMPTY||c.push(e),g.push("<",e);for(var i=0,j=f.length;i<j;i+=2){var k=f[i],l=f[i+1];l!==null&&l!==void 0&&g.push(" ",k,'="',s(l),'"')}g.push(">")}},endTag:function(b,e){if(d){d=!1;return}if(!a.ELEMENTS.hasOwnProperty(b))return;var f=a.ELEMENTS[b];if(!(f&(a.eflags.UNSAFE|a.eflags.EMPTY|a.eflags.FOLDABLE))){var g;if(f&a.eflags.OPTIONAL_ENDTAG)for(g=c.length;--g>=0;){var h=c[g];if(h===b)break;if(!(a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG))return}else for(g=c.length;--g>=0;)if(c[g]===b)break;if(g<0)return;for(var i=c.length;--i>g;){var h=c[i];a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG||e.push("</",h,">")}c.length=g,e.push("</",b,">")}},pcdata:function(a,b){d||b.push(a)},rcdata:function(a,b){d||b.push(a)},cdata:function(a,b){d||b.push(a)},endDoc:function(a){for(var b=c.length;--b>=0;)a.push("</",c[b],">");c.length=0}})}function z(b,c,e){var f=[];return x(function g(b,f){for(var g=0;g<f.length;g+=2){var h=f[g],i=f[g+1],j=null,k;if((k=b+"::"+h,a.ATTRIBS.hasOwnProperty(k))||(k="*::"+h,a.ATTRIBS.hasOwnProperty(k)))j=a.ATTRIBS[k];if(j!==null)switch(j){case a.atype.NONE:break;case a.atype.SCRIPT:case a.atype.STYLE:i=null;break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:i=e?e(i):i;break;case a.atype.URI:var l=(""+i).match(y);l?!l[1]||d.test(l[1])?i=c&&c(i):i=null:i=null;break;case a.atype.URI_FRAGMENT:i&&"#"===i.charAt(0)?(i=e?e(i):i,i&&(i="#"+i)):i=null;break;default:i=null}else i=null;f[g+1]=i}return f})(b,f),f.join("")}var b;"script"==="SCRIPT".toLowerCase()?b=function(a){return a.toLowerCase()}:b=function(a){return a.replace(/[A-Z]/g,function(a){return String.fromCharCode(a.charCodeAt(0)|32)})};var c={lt:"<",gt:">",amp:"&",nbsp:" ",quot:'"',apos:"'"},d=/^(?:https?|mailto|data)$/i,e=/^#(\d+)$/,f=/^#x([0-9A-Fa-f]+)$/,i=/\0/g,k=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,m=/&/g,n=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,o=/</g,p=/>/g,q=/\"/g,r=/\=/g,u=new RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[\\s\\S][^a-z\\s>]*)","i"),v=new RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<!--[\\s\\S]*?-->|<!\\w[^>]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i"),y=new RegExp("^(?:([^:/?#]+):)?");return{escapeAttrib:s,makeHtmlSanitizer:x,makeSaxParser:w,normalizeRCData:t,sanitize:z,unescapeEntities:l}}(html4),html_sanitize=html.sanitize;typeof window!="undefined"&&(window.html=html,window.html_sanitize=html_sanitize),html4.ATTRIBS["*::style"]=0,html4.ELEMENTS.style=0;var Mustache=function(){var a={},b=function(){};return b.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a);return}a=this.render_pragmas(a);var e=this.render_section(a,b,c);e===!1&&(e=this.render_tags(a,b,c,d));if(d)return e;this.sendLines(e)},send:function(a){a!==""&&this.buffer.push(a)},sendLines:function(a){if(a){var b=a.split("\n");for(var c=0;c<b.length;c++)this.send(b[c])}},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=this.getCachedRegex("render_pragmas",function(a,b){return new RegExp(a+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+b,"g")});return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return!1;var d=this,e=this.getCachedRegex("render_section",function(a,b){return new RegExp("^([\\s\\S]*?)"+a+"(\\^|\\#)\\s*(.+)\\s*"+b+"\n*([\\s\\S]*?)"+a+"\\/\\s*\\3\\s*"+b+"\\s*([\\s\\S]*)$","g")});return a.replace(e,function(a,e,f,g,h,i){var j=e?d.render_tags(e,b,c,!0):"",k=i?d.render(i,b,c,!0):"",l,m=d.find(g,b);return f==="^"?!m||d.is_array(m)&&m.length===0?l=d.render(h,b,c,!0):l="":f==="#"&&(d.is_array(m)?l=d.map(m,function(a){return d.render(h,d.create_context(a),c,!0)}).join(""):d.is_object(m)?l=d.render(h,d.create_context(m),c,!0):typeof m=="function"?l=m.call(b,h,function(a){return d.render(a,b,c,!0)}):m?l=d.render(h,b,c,!0):l=""),j+l+k})},render_tags:function(a,b,c,d){var e=this,f=function(){return e.getCachedRegex("render_tags",function(a,b){return new RegExp(a+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+b+"+","g")})},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":return e.set_delimiters(h),g=f(),"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j<i.length;j++)i[j]=i[j].replace(g,h,this),d||this.send(i[j]);if(d)return i.join("\n")},set_delimiters:function(a){var b=a.split(" ");this.otag=this.escape_regex(b[0]),this.ctag=this.escape_regex(b[1])},escape_regex:function(a){if(!arguments.callee.sRE){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+b.join("|\\")+")","g")}return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){function c(a){return a===!1||a===0||a}a=this.trim(a);var d;return c(b[a])?d=b[a]:c(this.context[a])&&(d=this.context[a]),typeof d=="function"?d.apply(b):d!==undefined?d:""},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return a=String(a===null?"":a),a.replace(/&(?!\w+;)|["'<>\\]/g,function(a){switch(a){case"&":return"&";case'"':return""";case"'":return"'";case"<":return"<";case">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};return c[b]=a,c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e<d;e++)c.push(b(a[e]));return c},getCachedRegex:function(b,c){var d=a[this.otag];d||(d=a[this.otag]={});var e=d[this.ctag];e||(e=d[this.ctag]={});var f=e[b];return f||(f=e[b]=c(this.otag,this.ctag)),f}},{name:"mustache.js",version:"0.4.0-dev",to_html:function(a,c,d,e){var f=new b;e&&(f.send=e),f.render(a,c||{},d);if(!e)return f.buffer.join("\n")}}}();!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window),wax=wax||{},wax.attribution=function(){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var a,b={};return b.content=function(b){return typeof b=="undefined"?a.innerHTML:(a.innerHTML=html_sanitize(b,c,d),this)},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){function urlX(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function idX(a){return a}var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return html_sanitize(f(a,b),urlX,idX)}catch(c){console&&console.log(c)}},formatter},wax.gi=function(a,b){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}b=b||{};var c={},d=b.resolution||4,e=b.tileSize||256;return c.grid_tile=function(){return a},c.getKey=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>=e||Math.floor(b)>=e)return;return f(a.grid[Math.floor(c/d)].charCodeAt(Math.floor(b/d)))},c.gridFeature=function(b,c){var d=this.getKey(b,c),e=a.keys;if(e&&e[d]&&a.data[e[d]])return a.data[e[d]]},c.tileFeature=function(b,c,d){if(!a)return;var e=wax.u.offset(d);return feature=this.gridFeature(b-e.left,c-e.top),feature},c},wax.gm=function(){function f(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=new RegExp("/(\\d+)\\/(\\d+)\\/(\\d+)\\.[\\w\\._]+"),d=c.exec(b);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}var a=4,b={},c={},d,e=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return c.formatter=function(a){return arguments.length?(d=wax.formatter(a),c):d},c.template=function(a){return arguments.length?(d=wax.template(a),c):d},c.gridUrl=function(a){return arguments.length?(e=typeof a=="function"?a:f(a),c):e},c.getGrid=function(b,f){var g=e(b);return!d||!g?f(null,null):(wax.request.get(g,function(b,c){if(b)return f(b,null);f(null,wax.gi(c,d,{resolution:a||4}))}),c)},c.tilejson=function(a){return a.template?c.template(a.template):a.formatter&&c.formatter(a.formatter),a.grids&&c.gridUrl(a.grids),c},c},wax=wax||{},wax.hash=function(a){function b(){return location.hash.substring(1)}function c(a){location.hash="#"+a}function g(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(c)}function h(){var b=a.getCenterZoom();d!==b&&(d=b,c(d))}function i(a){if(a===d)return;g(d=a)&&h()}a=a||{};var d,e={},f=90-1e-8,j=wax.u.throttle(h,500);return e.add=function(){return i(b()),a.bindChange(j),this},e.remove=function(){return a.unbindChange(j),this},e.add()},wax=wax||{},wax.interaction=function(){function m(a){var b=h();for(var c=0;c<b.length;c++)if(b[c][0]<a.y&&b[c][0]+256>a.y&&b[c][1]<a.x&&b[c][1]+256>a.x)return b[c][2];return!1}function n(){return d?(window.clearTimeout(d),d=null,!0):!1}function o(d){if(c)return;var f=wax.u.eventoffset(d),g=m(f),h;g&&a.getGrid(g.src,function(c,j){if(c||!j)return;h=j.tileFeature(f.x,f.y,g),h?h&&e!==h?(e=h,bean.fire(b,"on",{parent:i(),data:h,formatter:a.formatter().format,e:d})):h||(e=null,bean.fire(b,"off")):(e=null,bean.fire(b,"off"))})}function p(a){if(n())return;c=!0,f=wax.u.eventoffset(a),a.type==="mousedown"?bean.add(document.body,"mouseup",r):a.type==="touchstart"&&a.touches.length===1&&(bean.fire(b,"off"),bean.add(i(),l))}function q(){bean.remove(i(),l),c=!1}function r(a){var b={},e=wax.u.eventoffset(a);c=!1;for(var h in a)b[h]=a[h];return bean.remove(document.body,"mouseup",r),bean.remove(i(),l),a.type==="touchend"?s(a,f):Math.round(e.y/g)===Math.round(f.y/g)&&Math.round(e.x/g)===Math.round(f.x/g)&&(d=window.setTimeout(function(){d=null,s(b,e)},300)),r}function s(c,d){var e=m(d);e&&a.getGrid(e.src,function(f,g){if(f||!g)return;var h=g.tileFeature(d.x,d.y,e);if(!h)return;bean.fire(b,"on",{parent:i(),data:h,formatter:a.formatter().format,e:c})})}var a=wax.gm(),b={},c=!1,d=!1,e,f,g=4,h,i,j,k={mousemove:o,touchstart:p,mousedown:p},l={touchend:r,touchmove:r,touchcancel:q};return b.attach=function(a){return arguments.length?(attach=a,b):attach},b.map=function(a){return arguments.length?(map=a,bean.add(i(),k),bean.add(i(),"touchstart",p),attach&&attach(map),b):map},b.grid=function(a){return arguments.length?(h=a,b):h},b.remove=function(){for(var a=0;a<clearingEvents.length;a++)map.removeCallback(clearingEvents[a],clearTileGrid);return bean.remove(i(),k),bean.fire(b,"remove"),b},b.tilejson=function(c){return arguments.length?(a.tilejson(c),b):tilejson},b.formatter=function(){return a.formatter()},b.on=function(a,c){return bean.add(b,a,c),b},b.off=function(a,c){return bean.remove(b,a,c),b},b.parent=function(a){return i=a,b},b};var wax=wax||{};wax.legend=function(){function d(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function e(a){return a}var a,b={},c;return b.element=function(){return c},b.content=function(c){return arguments.length?(c?(a.innerHTML=html_sanitize(c,d,e),a.style.display="block"):(a.innerHTML="",a.style.display="none"),b):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=c.appendChild(document.createElement("div")),a.className="wax-legend",a.style.display="none",b},b.add()};var wax=wax||{};wax.movetip={},wax.movetip=function(a){function g(a){return a&&a.className.indexOf("wax-popup")!==-1}function h(a,b){var c=document.createElement("div");return c.className="wax-movetip",c.style.cssText="position:absolute;",c.innerHTML=a,b.appendChild(c),d=b,_tooltipOffset=wax.util.offset(c),_contextOffset=wax.util.offset(d),c}function i(a){if(!c)return;var b=wax.util.eventoffset(a);c.className="wax-movetip",_tooltipOffset.height+b.y>_contextOffset.top+_contextOffset.height&&_contextOffset.height>_tooltipOffset.height&&(b.y-=_tooltipOffset.height,c.className+=" flip-y"),_tooltipOffset.width+b.x>_contextOffset.left+_contextOffset.width&&(b.x-=_tooltipOffset.width,c.className+=" flip-x"),c.style.left=b.x+"px",c.style.top=b.y+"px"}function j(a){if(!a)return;var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&e?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&e&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+e):a.parentNode&&a.parentNode.removeChild(a)}function k(a,b){c&&(j(c),c=undefined);var d=h(a,b);d.className+=" wax-popup",d.innerHTML=a;var e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close",d.appendChild(e);var f=function(a){return j(d),c=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),!1};e.addEventListener?e.addEventListener("click",f,!1) | ||
:e.attachEvent&&e.attachEvent("onclick",f),c=d}a=a||{};var b={},c=undefined,d=undefined,e=a.animationOut,f=a.animationIn;return b.over=function(a,b,d){if(!a)return;b.style.cursor="pointer";if(g(c))return;c=h(a,b),i(d),b.addEventListener&&b.addEventListener("mousemove",i)},b.out=function(a){a.style.cursor="default";if(g(c))return;c&&(j(c),a.removeEventListener&&a.removeEventListener("mousemove",i),c=undefined)},b};var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}},wax.template=function(a){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var b={};return b.format=function(b,e){var f={};for(var g in e)f[g]=e[g];return b.format&&(f["__"+b.format+"__"]=!0),html_sanitize(Mustache.to_html(a,f),c,d)},b};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(){function f(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function g(){function c(){this.parentNode&&this.parentNode.removeChild(this)}var a;document.body.style["-webkit-transition"]!==undefined?a="webkitTransitionEnd":document.body.style.MozTransition!==undefined&&(a="transitionend");var e;while(e=d.pop())b&&a?(bean.add(e,a,c),e.className+=" wax-fade"):e.parentNode&&e.parentNode.removeChild(e)}function h(b){var c;g();if((b.e.type==="mousemove"||!b.e.type)&&!a){c=b.formatter({format:"teaser"},b.data);if(!c)return;e.style.cursor="pointer",d.push(e.appendChild(f(c)))}else{c=b.formatter({format:"full"},b.data);if(!c)return;var h=e.appendChild(f(c));h.className+=" wax-popup";var i=h.appendChild(document.createElement("a"));i.href="#close",i.className="close",i.innerHTML="Close",a=!0,d.push(h),bean.add(i,"click touchend",function(b){b.stop(),g(),a=!1})}}function i(){e.style.cursor="default",a||g()}var a=!1,b=!1,c={},d=[],e;return c.parent=function(a){return arguments.length?(e=a,c):e},c.animate=function(a){return arguments.length?(b=a,c):b},c.events=function(){return{on:h,off:i}},c};var wax=wax||{};wax.u={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=document.body,e=0,f=0,g=function(a){if(a===d||a===document.documentElement)return;e+=a.offsetTop,f+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");e+=parseInt(c[13],10),f+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10)};g(a);try{while(a=a.offsetParent)g(a)}catch(h){}e+=d.offsetTop,f+=d.offsetLeft,e+=d.parentNode.offsetTop,f+=d.parentNode.offsetLeft;var i=document.defaultView?window.getComputedStyle(d.parentNode,null):d.parentNode.currentStyle;return d.parentNode.offsetTop!==parseInt(i.marginTop,10)&&!isNaN(parseInt(i.marginTop,10))&&(e+=parseInt(i.marginTop,10),f+=parseInt(i.marginLeft,10)),{top:e,left:f,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;a||(a=window.event);if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}},limit:function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}},throttle:function(a,b){return this.limit(a,b,!1)}},wax=wax||{},wax.mm=wax.mm||{},wax.mm.attribution=function(a,b){b=b||{};var c,d={};return d.element=function(){return c.element()},d.appendTo=function(a){return wax.u.$(a).appendChild(c.element()),this},d.init=function(){return c=wax.attribution(),c.content(b.attribution),c.element().className="wax-attribution wax-mm",this},d.init()},wax=wax||{},wax.mm=wax.mm||{},wax.mm.boxselector=function(a,b,c){function k(b){var c=new MM.Point(b.clientX,b.clientY);c.x+=document.body.scrollLeft+document.documentElement.scrollLeft,c.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var d=a.parent;d;d=d.offsetParent)c.x-=d.offsetLeft,c.y-=d.offsetTop;return c}function l(b){if(!b.shiftKey)return;return d=k(b),f.style.left=d.x+"px",f.style.top=d.y+"px",g(a.parent,"mousemove",m),g(a.parent,"mouseup",n),a.parent.style.cursor="crosshair",MM.cancelEvent(b)}function m(a){var b=k(a),c=f.style;return c.display="block",b.x<d.x?c.left=b.x+"px":c.left=d.x+"px",b.y<d.y?c.top=b.y+"px":c.top=d.y+"px",c.width=Math.abs(b.x-d.x)+"px",c.height=Math.abs(b.y-d.y)+"px",MM.cancelEvent(a)}function n(b){var c=k(b),e=a.pointLocation(c),f=a.pointLocation(d);j.extent([new MM.Location(Math.max(e.lat,f.lat),Math.min(e.lon,f.lon)),new MM.Location(Math.min(e.lat,f.lat),Math.max(e.lon,f.lon))]),h(a.parent,"mousemove",m),h(a.parent,"mouseup",n),a.parent.style.cursor="auto"}function o(a,b){if(!f||!i)return;var c=a.locationPoint(i[1]),d=a.locationPoint(i[0]),e=f.style;e.display="block",e.height="auto",e.width="auto",e.left=Math.max(0,d.x)+"px",e.top=Math.max(0,d.y)+"px",e.right=Math.max(0,a.dimensions.x-c.x)+"px",e.bottom=Math.max(0,a.dimensions.y-c.y)+"px"}var d=null,e=typeof c=="function"?c:c.callback,f,g=MM.addEvent,h=MM.removeEvent,i,j={};return j.extent=function(b,c){if(!b)return i;i=[new MM.Location(Math.max(b[0].lat,b[1].lat),Math.min(b[0].lon,b[1].lon)),new MM.Location(Math.min(b[0].lat,b[1].lat),Math.max(b[0].lon,b[1].lon))],o(a),c||e(i)},j.add=function(a){return f=f||document.createElement("div"),f.id=a.parent.id+"-boxselector-box",f.className="boxselector-box",a.parent.appendChild(f),g(a.parent,"mousedown",l),a.addCallback("drawn",o),this},j.remove=function(){a.parent.removeChild(f),h(a.parent,"mousedown",l),a.removeCallback("drawn",o)},j.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax._={},wax.mm.bwdetect=function(a,b){b=b||{};var c=b.png||".png128",d=b.jpg||".jpg70",e=!1;return wax._.bw_png=c,wax._.bw_jpg=d,wax.bwdetect(b,function(b){wax._.bw=!b;for(var c=0;c<a.layers.length;c++)a.getLayerAt(c).provider instanceof wax.mm.connector&&a.getLayerAt(c).setProvider(a.getLayerAt(c).provider)})},wax=wax||{},wax.mm=wax.mm||{},wax.mm.fullscreen=function(a){function g(a){a&&a.stop(),b?c.original():c.full()}function h(b,c){a.dimensions=new MM.Point(b,c),a.parent.style.width=Math.round(a.dimensions.x)+"px",a.parent.style.height=Math.round(a.dimensions.y)+"px",a.dispatchCallback("resized",a.dimensions)}var b=!1,c={},d,e=document.body,f;return c.add=function(a){return d=document.createElement("a"),d.className="wax-fullscreen",d.href="#fullscreen",d.innerHTML="fullscreen",bean.add(d,"click",g),this},c.full=function(){if(b)return;b=!0,f=[a.parent.offsetWidth,a.parent.offsetHeight],a.parent.className+=" wax-fullscreen-map",e.className+=" wax-fullscreen-view",h(a.parent.offsetWidth,a.parent.offsetHeight)},c.original=function(){if(!b)return;b=!1,a.parent.className=a.parent.className.replace(" wax-fullscreen-map",""),e.className=e.className.replace(" wax-fullscreen-view",""),h(f[0],f[1])},c.appendTo=function(a){return wax.u.$(a).appendChild(d),this},c.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.interaction=function(){function c(){var c=map.getLayerAt(0).levels[Math.round(map.getZoom())];return!a&&b!==undefined&&b.length?b:(b=function(a){var b=[];for(var d in a)if(a[d].parentNode===c){var e=wax.u.offset(a[d]);b.push([e.top,e.left,a[d]])}return b}(map.getLayerAt(0).tiles),b)}function d(b){function c(){a=!0}if(!arguments.length)return map;map=b;var d=["zoomed","panned","centered","extentset","resized","drawn"];for(var e=0;e<d.length;e++)map.addCallback(d[e],c)}var a=!1,b;return wax.interaction().attach(d).parent(function(){return map.parent}).grid(c)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.latlngtooltip=function(a){function e(b){var c=new MM.Point(b.clientX,b.clientY);c.x+=document.body.scrollLeft+document.documentElement.scrollLeft,c.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var d=a.parent;d;d=d.offsetParent)c.x-=d.offsetLeft,c.y-=d.offsetTop;return c}function f(a){console.log("here"),c=!0}function g(a){c=!1}function h(d){if(!d.shiftKey||c){b.parentNode===a.parent&&a.parent.removeChild(b);return}var f=e(d),g=a.pointLocation(f),h=g.lat.toFixed(2)+", "+g.lon.toFixed(2);b.innerHTML=h,f.scale=f.width=f.height=1,f.x+=10,MM.moveElement(b,f),a.parent.appendChild(b)}var b,c=!1,d={};return d.add=function(){return MM.addEvent(a.parent,"mousemove",h),MM.addEvent(a.parent,"mousedown",f),MM.addEvent(a.parent,"mouseup",g),b=document.createElement("div"),b.className="wax-latlngtooltip",this},d.remove=function(){return MM.removeEvent(a.parent,"mousemove",h),MM.removeEvent(a.parent,"mousedown",f),MM.removeEvent(a.parent,"mouseup",g),this},d.add()},wax=wax||{},wax.mm=wax.mm||{},wax.mm.legend=function(a,b){b=b||{};var c,d={};return d.add=function(){return c=wax.legend().content(b.legend||""),this},d.content=function(a){a&&c.content(a.legend||"")},d.element=function(){return c.element()},d.appendTo=function(a){return wax.u.$(a).appendChild(c.element()),this},d.add()},wax=wax||{},wax.mm=wax.mm||{},wax.mm.pointselector=function(a,b,c){function k(b){var c=wax.u.eventoffset(b),d=new MM.Point(c.x,c.y),e={x:parseFloat(MM.getStyle(document.documentElement,"margin-left")),y:parseFloat(MM.getStyle(document.documentElement,"margin-top"))};isNaN(e.x)||(d.x-=e.x),isNaN(e.y)||(d.y-=e.y);for(var f=a.parent;f;f=f.offsetParent)d.x-=f.offsetLeft,d.y-=f.offsetTop;return d}function l(a){var b=[];for(var c=0;c<a.length;c++)b.push(new MM.Location(a[c].lat,a[c].lon));return b}function m(){var b=new MM.Point(0,0);for(var c=0;c<i.length;c++){var d=a.locationPoint(i[c]);i[c].pointDiv||(i[c].pointDiv=document.createElement("div"),i[c].pointDiv.className="wax-point-div",i[c].pointDiv.style.position="absolute",i[c].pointDiv.style.display="block",i[c].pointDiv.location=i[c],bean.add(i[c].pointDiv,"mouseup",function(b){var d=i[c];return function(b){MM.removeEvent(a.parent,"mouseup",o),h.deleteLocation(d,b)}}()),a.parent.appendChild(i[c].pointDiv)),i[c].pointDiv.style.left=d.x+"px",i[c].pointDiv.style.top=d.y+"px"}}function n(b){d=k(b),bean.add(a.parent,"mouseup",o)}function o(b){if(!d)return;e=k(b),MM.Point.distance(d,e)<f&&(h.addLocation(a.pointLocation(d)),j(l(i))),d=null}var d=null,e=null,f=5,g,h={},i=[],j=typeof c=="function"?c:c.callback;return h.addLocation=function(a){i.push(a),m(),j(l(i))},h.locations=function(a){return i},h.add=function(a){return bean.add(a.parent,"mousedown",n),a.addCallback("drawn",m),this},h.remove=function(a){bean.remove(a.parent,"mousedown",n),a.removeCallback("drawn",m);for(var b=i.length-1;b>-1;b--)h.deleteLocation(i[b]);return this},h.deleteLocation=function(a,b){if(!b||confirm("Delete this point?"))a.pointDiv.parentNode.removeChild(a.pointDiv),i.splice(wax.u.indexOf(i,a),1),j(l(i))},h.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.zoombox=function(a){function f(b){var c=new MM.Point(b.clientX,b.clientY);c.x+=document.body.scrollLeft+document.documentElement.scrollLeft,c.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var d=a.parent;d;d=d.offsetParent)c.x-=d.offsetLeft,c.y-=d.offsetTop;return c}function g(b){if(!c)return;c=!1;var h=f(b),j=a.pointLocation(h),k=a.pointLocation(e);a.setExtent([j,k]),d.style.display="none",MM.removeEvent(a.parent,"mousemove",i),MM.removeEvent(a.parent,"mouseup",g),a.parent.style.cursor="auto"}function h(b){if(!b.shiftKey||!!this.drawing)return;return c=!0,e=f(b),d.style.left=e.x+"px",d.style.top=e.y+"px",MM.addEvent(a.parent,"mousemove",i),MM.addEvent(a.parent,"mouseup",g),a.parent.style.cursor="crosshair",MM.cancelEvent(b)}function i(a){if(!c)return;var b=f(a);return d.style.display="block",b.x<e.x?d.style.left=b.x+"px":d.style.left=e.x+"px",d.style.width=Math.abs(b.x-e.x)+"px",b.y<e.y?d.style.top=b.y+"px":d.style.top=e.y+"px",d.style.height=Math.abs(b.y-e.y)+"px",MM.cancelEvent(a)}var b={},c=!1,d,e=null;return b.add=function(a){return d=d||document.createElement("div"),d.id=a.parent.id+"-zoombox-box",d.className="zoombox-box",a.parent.appendChild(d),MM.addEvent(a.parent,"mousedown",h),this},b.remove=function(){a.parent.removeChild(d),MM.removeEvent(a.parent,"mousedown",h)},b.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.zoomer=function(a){var b=document.createElement("a");b.innerHTML="+",b.href="#",b.className="zoomer zoomin",bean.add(b,"mousedown dblclick",function(a){a.stop()}),bean.add(b,"click",function(b){b.stop(),a.zoomIn()},!1);var c=document.createElement("a");c.innerHTML="-",c.href="#",c.className="zoomer zoomout",bean.add(c,"mousedown dblclick",function(a){a.stop()}),bean.add(c,"click",function(b){b.stop(),a.zoomOut()});var d={add:function(a){return a.addCallback("drawn",function(a,d){a.coordinate.zoom===a.coordLimits[0].zoom?c.className="zoomer zoomout zoomdisabled":a.coordinate.zoom===a.coordLimits[1].zoom?b.className="zoomer zoomin zoomdisabled":(b.className="zoomer zoomin",c.className="zoomer zoomout")}),this},appendTo:function(a){return wax.u.$(a).appendChild(b),wax.u.$(a).appendChild(c),this}};return d.add(a)};var wax=wax||{};wax.mm=wax.mm||{},wax.mm._provider=function(a){this.options={tiles:a.tiles,scheme:a.scheme||"xyz",minzoom:a.minzoom||0,maxzoom:a.maxzoom||22,bounds:a.bounds||[-180,-90,180,90]}},wax.mm._provider.prototype={outerLimits:function(){return[this.locationCoordinate(new MM.Location(this.options.bounds[0],this.options.bounds[1])).zoomTo(this.options.minzoom),this.locationCoordinate(new MM.Location(this.options.bounds[2],this.options.bounds[3])).zoomTo(this.options.maxzoom)]},getTile:function(a){if(!(coord=this.sourceCoordinate(a)))return null;if(coord.zoom<this.options.minzoom||coord.zoom>this.options.maxzoom)return null;coord.row=this.options.scheme==="tms"?Math.pow(2,coord.zoom)-coord.row-1:coord.row;var b=this.options.tiles[parseInt(Math.pow(2,coord.zoom)*coord.row+coord.column,10)%this.options.tiles.length].replace("{z}",coord.zoom.toFixed(0)).replace("{x}",coord.column.toFixed(0)).replace("{y}",coord.row.toFixed(0));return wax._&&wax._.bw&&(b=b.replace(".png",wax._.bw_png).replace(".jpg",wax._.bw_jpg)),b}},MM&&MM.extend(wax.mm._provider,MM.MapProvider),wax.mm.connector=function(a){var b=new wax.mm._provider(a);return new MM.Layer(b)} | ||
/* wax - 6.0.0-beta2 - 1.0.4-526-g3351932 */!function(a,b,c){typeof module!="undefined"?module.exports=c(a,b):typeof define=="function"&&typeof define.amd=="object"?define(c):b[a]=c(a,b)}("bean",this,function(a,b){var c=window,d=b[a],e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=Array.prototype.slice,q=/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,r=/mouse.*(wheel|scroll)/i,s=/^text/i,t=/^touch|^gesture/i,u={one:1},v=function(a,b,c){for(c=0;c<b.length;c++)a[b[c]]=1;return a}({},("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(n?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),w=function(){function a(a,b){while((b=b.parentNode)!==null)if(b===a)return!0;return!1}function b(b){var c=b.relatedTarget;return c?c!==this&&c.prefix!=="xul"&&!/document/.test(this.toString())&&!a(this,c):c===null}return{mouseenter:{base:"mouseover",condition:b},mouseleave:{base:"mouseout",condition:b},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),x=function(){var a="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),b=a.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),c=b.concat("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis".split(" ")),d=a.concat("char charCode key keyCode keyIdentifier keyLocation".split(" ")),f=a.concat(["data"]),g=a.concat("touches targetTouches changedTouches scale rotation".split(" ")),h="preventDefault",i=function(a){return function(){a[h]?a[h]():a.returnValue=!1}},j="stopPropagation",k=function(a){return function(){a[j]?a[j]():a.cancelBubble=!0}},n=function(a){return function(){a[h](),a[j](),a.stopped=!0}},o=function(a,b,c){var d,e;for(d=c.length;d--;)e=c[d],!(e in b)&&e in a&&(b[e]=a[e])};return function(p,u){var v={originalEvent:p,isNative:u};if(!p)return v;var w,x=p.type,y=p.target||p.srcElement;v[h]=i(p),v[j]=k(p),v.stop=n(v),v.target=y&&y.nodeType===3?y.parentNode:y;if(u){if(x.indexOf("key")!==-1)w=d,v.keyCode=p.which||p.keyCode;else if(q.test(x)){w=b,v.rightClick=p.which===3||p.button===2,v.pos={x:0,y:0};if(p.pageX||p.pageY)v.clientX=p.pageX,v.clientY=p.pageY;else if(p.clientX||p.clientY)v.clientX=p.clientX+l.body.scrollLeft+m.scrollLeft,v.clientY=p.clientY+l.body.scrollTop+m.scrollTop;e.test(x)&&(v.relatedTarget=p.relatedTarget||p[(x==="mouseover"?"from":"to")+"Element"])}else t.test(x)?w=g:r.test(x)?w=c:s.test(x)&&(w=f);o(p,v,w||a)}return v}}(),y=function(a,b){return!n&&!b&&(a===l||a===c)?m:a},z=function(){function a(a,b,c,d,e){this.element=a,this.type=b,this.handler=c,this.original=d,this.namespaces=e,this.custom=w[b],this.isNative=v[b]&&a[o],this.eventType=n||this.isNative?b:"propertychange",this.customType=!n&&!this.isNative&&b,this.target=y(a,this.isNative),this.eventSupport=this.target[o]}return a.prototype={inNamespaces:function(a){var b,c;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)if(a[b]===this.namespaces[c])return!0;return!1},matches:function(a,b,c){return this.element===a&&(!b||this.original===b)&&(!c||this.handler===c)}},a}(),A=function(){var a={},b=function(c,d,e,f,g){if(!d||d==="*")for(var h in a)h.charAt(0)==="$"&&b(c,h.substr(1),e,f,g);else{var i=0,j,k=a["$"+d],l=c==="*";if(!k)return;for(j=k.length;i<j;i++)if(l||k[i].matches(c,e,f))if(!g(k[i],k,i,d))return}},c=function(b,c,d){var e,f=a["$"+c];if(f)for(e=f.length;e--;)if(f[e].matches(b,d,null))return!0;return!1},d=function(a,c,d){var e=[];return b(a,c,d,null,function(a){return e.push(a)}),e},e=function(b){return(a["$"+b.type]||(a["$"+b.type]=[])).push(b),b},f=function(c){b(c.element,c.type,null,c.handler,function(b,c,d){return c.splice(d,1),c.length===0&&delete a["$"+b.type],!1})},g=function(){var b,c=[];for(b in a)b.charAt(0)==="$"&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),B=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},C=function(a,b,d){return function(e){return e=x(e||((this.ownerDocument||this.document||this).parentWindow||c).event,!0),b.apply(a,[e].concat(d))}},D=function(a,b,d,e,f,g){return function(h){if(e?e.apply(this,arguments):n?!0:h&&h.propertyName==="_on"+d||!h)h&&(h=x(h||((this.ownerDocument||this.document||this).parentWindow||c).event,g)),b.apply(a,h&&(!f||f.length===0)?arguments:p.call(arguments,h?0:1).concat(f))}},E=function(a,b,c,d,e){return function(){a(b,c,e),d.apply(this,arguments)}},F=function(a,b,c,d){var e,f,h,i=b&&b.replace(g,""),j=A.get(a,i,c);for(e=0,f=j.length;e<f;e++)j[e].inNamespaces(d)&&((h=j[e]).eventSupport&&B(h.target,h.eventType,h.handler,!1,h.type),A.del(h))},G=function(a,b,c,d,e){var h,i=b.replace(g,""),j=b.replace(f,"").split(".");if(A.has(a,i,c))return a;i==="unload"&&(c=E(F,a,i,c,d)),w[i]&&(w[i].condition&&(c=D(a,c,i,w[i].condition,!0)),i=w[i].base||i),h=A.put(new z(a,i,c,d,j[0]&&j)),h.handler=h.isNative?C(a,h.handler,e):D(a,h.handler,i,!1,e,!1),h.eventSupport&&B(h.target,h.eventType,h.handler,!0,h.customType)},H=function(a,b,c){return function(d){var e,f,g=typeof a=="string"?c(a,this):a;for(e=d.target;e&&e!==this;e=e.parentNode)for(f=g.length;f--;)if(g[f]===e)return b.apply(e,arguments)}},I=function(a,b,c){var d,e,h,i,j,k=F,l=b&&typeof b=="string";if(l&&b.indexOf(" ")>0){b=b.split(" ");for(j=b.length;j--;)I(a,b[j],c);return a}h=l&&b.replace(g,""),h&&w[h]&&(h=w[h].type);if(!b||l){if(i=l&&b.replace(f,""))i=i.split(".");k(a,h,c,i)}else if(typeof b=="function")k(a,null,b);else for(d in b)b.hasOwnProperty(d)&&I(a,d,b[d]);return a},J=function(a,b,c,d,e){var f,g,h,i,j=c,k=c&&typeof c=="string";if(b&&!c&&typeof b=="object")for(f in b)b.hasOwnProperty(f)&&J.apply(this,[a,f,b[f]]);else{i=arguments.length>3?p.call(arguments,3):[],g=(k?c:b).split(" "),k&&(c=H(b,j=d,e))&&(i=p.call(i,1)),this===u&&(c=E(I,a,b,c,j));for(h=g.length;h--;)G(a,g[h],c,j,i)}return a},K=function(){return J.apply(u,arguments)},L=n?function(a,b,d){var e=l.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=y(c,a),a?c.fireEvent("on"+b,l.createEventObject()):c["_on"+b]++},M=function(a,b,c){var d,e,h,i,j,k=b.split(" ");for(d=k.length;d--;){b=k[d].replace(g,"");if(i=k[d].replace(f,""))i=i.split(".");if(!i&&!c&&a[o])L(v[b],b,a);else{j=A.get(a,b),c=[!1].concat(c);for(e=0,h=j.length;e<h;e++)j[e].inNamespaces(i)&&j[e].handler.apply(a,c)}}return a},N=function(a,b,c){var d=0,e=A.get(b,c),f=e.length;for(;d<f;d++)e[d].original&&J(a,e[d].type,e[d].original);return a},O={add:J,one:K,remove:I,clone:N,fire:M,noConflict:function(){return b[a]=d,this}};if(c[i]){var P=function(){var a,b=A.entries();for(a in b)b[a].type&&b[a].type!=="unload"&&I(b[a].element,b[a].type);c[k]("onunload",P),c.CollectGarbage&&c.CollectGarbage()};c[i]("onunload",P)}return O});var html4={};html4.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10},html4.ATTRIBS={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0},html4.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128},html4.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:4,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,nobr:0,noembed:4,noframes:20,noscript:20,object:16,ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:84,select:0,small:0,span:0,strike:0,strong:0,style:148,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},html4.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},html4.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"body::background":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0},html4.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},html4.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"body::background":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2};var html=function(a){function g(a){a=b(a);if(c.hasOwnProperty(a))return c[a];var d=a.match(e);return d?String.fromCharCode(parseInt(d[1],10)):(d=a.match(f))?String.fromCharCode(parseInt(d[1],16)):""}function h(a,b){return g(b)}function j(a){return a.replace(i,"")}function l(a){return a.replace(k,h)}function s(a){return a.replace(m,"&").replace(o,"<").replace(p,">").replace(q,""").replace(r,"=")}function t(a){return a.replace(n,"&$1").replace(o,"<").replace(p,">")}function w(c){return function d(d,e){d=String(d);var f=null,g=!1,h=[],i=void 0,k=void 0,m=void 0;c.startDoc&&c.startDoc(e);while(d){var n=d.match(g?u:v);d=d.substring(n[0].length);if(g){if(n[1]){var o=b(n[1]),p;if(n[2]){var q=n[3];switch(q.charCodeAt(0)){case 34:case 39:q=q.substring(1,q.length-1)}p=l(j(q))}else p=o;h.push(o,p)}else if(n[4]){k!==void 0&&(m?c.startTag&&c.startTag(i,h,e):c.endTag&&c.endTag(i,e));if(m&&k&(a.eflags.CDATA|a.eflags.RCDATA)){f===null?f=b(d):f=f.substring(f.length-d.length);var r=f.indexOf("</"+i);r<0&&(r=d.length),r&&(k&a.eflags.CDATA?c.cdata&&c.cdata(d.substring(0,r),e):c.rcdata&&c.rcdata(t(d.substring(0,r)),e),d=d.substring(r))}i=k=m=void 0,h.length=0,g=!1}}else if(n[1])c.pcdata&&c.pcdata(n[0],e);else if(n[3])m=!n[2],g=!0,i=b(n[3]),k=a.ELEMENTS.hasOwnProperty(i)?a.ELEMENTS[i]:void 0;else if(n[4])c.pcdata&&c.pcdata(n[4],e);else if(n[5]&&c.pcdata){var s=n[5];c.pcdata(s==="<"?"<":s===">"?">":"&",e)}}c.endDoc&&c.endDoc(e)}}function x(b){var c,d;return w({startDoc:function(a){c=[],d=!1},startTag:function(e,f,g){if(d)return;if(!a.ELEMENTS.hasOwnProperty(e))return;var h=a.ELEMENTS[e];if(h&a.eflags.FOLDABLE)return;if(h&a.eflags.UNSAFE){d=!(h&a.eflags.EMPTY);return}f=b(e,f);if(f){h&a.eflags.EMPTY||c.push(e),g.push("<",e);for(var i=0,j=f.length;i<j;i+=2){var k=f[i],l=f[i+1];l!==null&&l!==void 0&&g.push(" ",k,'="',s(l),'"')}g.push(">")}},endTag:function(b,e){if(d){d=!1;return}if(!a.ELEMENTS.hasOwnProperty(b))return;var f=a.ELEMENTS[b];if(!(f&(a.eflags.UNSAFE|a.eflags.EMPTY|a.eflags.FOLDABLE))){var g;if(f&a.eflags.OPTIONAL_ENDTAG)for(g=c.length;--g>=0;){var h=c[g];if(h===b)break;if(!(a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG))return}else for(g=c.length;--g>=0;)if(c[g]===b)break;if(g<0)return;for(var i=c.length;--i>g;){var h=c[i];a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG||e.push("</",h,">")}c.length=g,e.push("</",b,">")}},pcdata:function(a,b){d||b.push(a)},rcdata:function(a,b){d||b.push(a)},cdata:function(a,b){d||b.push(a)},endDoc:function(a){for(var b=c.length;--b>=0;)a.push("</",c[b],">");c.length=0}})}function z(b,c,e){var f=[];return x(function g(b,f){for(var g=0;g<f.length;g+=2){var h=f[g],i=f[g+1],j=null,k;if((k=b+"::"+h,a.ATTRIBS.hasOwnProperty(k))||(k="*::"+h,a.ATTRIBS.hasOwnProperty(k)))j=a.ATTRIBS[k];if(j!==null)switch(j){case a.atype.NONE:break;case a.atype.SCRIPT:case a.atype.STYLE:i=null;break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:i=e?e(i):i;break;case a.atype.URI:var l=(""+i).match(y);l?!l[1]||d.test(l[1])?i=c&&c(i):i=null:i=null;break;case a.atype.URI_FRAGMENT:i&&"#"===i.charAt(0)?(i=e?e(i):i,i&&(i="#"+i)):i=null;break;default:i=null}else i=null;f[g+1]=i}return f})(b,f),f.join("")}var b;"script"==="SCRIPT".toLowerCase()?b=function(a){return a.toLowerCase()}:b=function(a){return a.replace(/[A-Z]/g,function(a){return String.fromCharCode(a.charCodeAt(0)|32)})};var c={lt:"<",gt:">",amp:"&",nbsp:" ",quot:'"',apos:"'"},d=/^(?:https?|mailto|data)$/i,e=/^#(\d+)$/,f=/^#x([0-9A-Fa-f]+)$/,i=/\0/g,k=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,m=/&/g,n=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,o=/</g,p=/>/g,q=/\"/g,r=/\=/g,u=new RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[\\s\\S][^a-z\\s>]*)","i"),v=new RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<!--[\\s\\S]*?-->|<!\\w[^>]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i"),y=new RegExp("^(?:([^:/?#]+):)?");return{escapeAttrib:s,makeHtmlSanitizer:x,makeSaxParser:w,normalizeRCData:t,sanitize:z,unescapeEntities:l}}(html4),html_sanitize=html.sanitize;typeof window!="undefined"&&(window.html=html,window.html_sanitize=html_sanitize),html4.ATTRIBS["*::style"]=0,html4.ELEMENTS.style=0;var Mustache=function(){var a={},b=function(){};return b.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a);return}a=this.render_pragmas(a);var e=this.render_section(a,b,c);e===!1&&(e=this.render_tags(a,b,c,d));if(d)return e;this.sendLines(e)},send:function(a){a!==""&&this.buffer.push(a)},sendLines:function(a){if(a){var b=a.split("\n");for(var c=0;c<b.length;c++)this.send(b[c])}},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=this.getCachedRegex("render_pragmas",function(a,b){return new RegExp(a+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+b,"g")});return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return!1;var d=this,e=this.getCachedRegex("render_section",function(a,b){return new RegExp("^([\\s\\S]*?)"+a+"(\\^|\\#)\\s*(.+)\\s*"+b+"\n*([\\s\\S]*?)"+a+"\\/\\s*\\3\\s*"+b+"\\s*([\\s\\S]*)$","g")});return a.replace(e,function(a,e,f,g,h,i){var j=e?d.render_tags(e,b,c,!0):"",k=i?d.render(i,b,c,!0):"",l,m=d.find(g,b);return f==="^"?!m||d.is_array(m)&&m.length===0?l=d.render(h,b,c,!0):l="":f==="#"&&(d.is_array(m)?l=d.map(m,function(a){return d.render(h,d.create_context(a),c,!0)}).join(""):d.is_object(m)?l=d.render(h,d.create_context(m),c,!0):typeof m=="function"?l=m.call(b,h,function(a){return d.render(a,b,c,!0)}):m?l=d.render(h,b,c,!0):l=""),j+l+k})},render_tags:function(a,b,c,d){var e=this,f=function(){return e.getCachedRegex("render_tags",function(a,b){return new RegExp(a+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+b+"+","g")})},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":return e.set_delimiters(h),g=f(),"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j<i.length;j++)i[j]=i[j].replace(g,h,this),d||this.send(i[j]);if(d)return i.join("\n")},set_delimiters:function(a){var b=a.split(" ");this.otag=this.escape_regex(b[0]),this.ctag=this.escape_regex(b[1])},escape_regex:function(a){if(!arguments.callee.sRE){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+b.join("|\\")+")","g")}return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){function c(a){return a===!1||a===0||a}a=this.trim(a);var d;return c(b[a])?d=b[a]:c(this.context[a])&&(d=this.context[a]),typeof d=="function"?d.apply(b):d!==undefined?d:""},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return a=String(a===null?"":a),a.replace(/&(?!\w+;)|["'<>\\]/g,function(a){switch(a){case"&":return"&";case'"':return""";case"'":return"'";case"<":return"<";case">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};return c[b]=a,c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e<d;e++)c.push(b(a[e]));return c},getCachedRegex:function(b,c){var d=a[this.otag];d||(d=a[this.otag]={});var e=d[this.ctag];e||(e=d[this.ctag]={});var f=e[b];return f||(f=e[b]=c(this.otag,this.ctag)),f}},{name:"mustache.js",version:"0.4.0-dev",to_html:function(a,c,d,e){var f=new b;e&&(f.send=e),f.render(a,c||{},d);if(!e)return f.buffer.join("\n")}}}();!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window),wax=wax||{},wax.attribution=function(){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var a,b={};return b.content=function(b){return typeof b=="undefined"?a.innerHTML:(a.innerHTML=html_sanitize(b,c,d),this)},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){function urlX(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function idX(a){return a}var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return html_sanitize(f(a,b),urlX,idX)}catch(c){console&&console.log(c)}},formatter},wax.gi=function(a,b){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}b=b||{};var c={},d=b.resolution||4,e=b.tileSize||256;return c.grid_tile=function(){return a},c.getKey=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>=e||Math.floor(b)>=e)return;return f(a.grid[Math.floor(c/d)].charCodeAt(Math.floor(b/d)))},c.gridFeature=function(b,c){var d=this.getKey(b,c),e=a.keys;if(e&&e[d]&&a.data[e[d]])return a.data[e[d]]},c.tileFeature=function(b,c,d){if(!a)return;var e=wax.u.offset(d);return feature=this.gridFeature(b-e.left,c-e.top),feature},c},wax.gm=function(){function f(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=new RegExp("/(\\d+)\\/(\\d+)\\/(\\d+)\\.[\\w\\._]+"),d=c.exec(b);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}var a=4,b={},c={},d,e=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return c.formatter=function(a){return arguments.length?(d=wax.formatter(a),c):d},c.template=function(a){return arguments.length?(d=wax.template(a),c):d},c.gridUrl=function(a){return arguments.length?(e=typeof a=="function"?a:f(a),c):e},c.getGrid=function(b,f){var g=e(b);return!d||!g?f(null,null):(wax.request.get(g,function(b,c){if(b)return f(b,null);f(null,wax.gi(c,d,{resolution:a||4}))}),c)},c.tilejson=function(a){return a.template?c.template(a.template):a.formatter&&c.formatter(a.formatter),a.grids&&c.gridUrl(a.grids),c},c},wax=wax||{},wax.hash=function(a){function b(){return location.hash.substring(1)}function c(a){location.hash="#"+a}function g(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(c)}function h(){var b=a.getCenterZoom();d!==b&&(d=b,c(d))}function i(a){if(a===d)return;g(d=a)&&h()}a=a||{};var d,e={},f=90-1e-8,j=wax.u.throttle(h,500);return e.add=function(){return i(b()),a.bindChange(j),this},e.remove=function(){return a.unbindChange(j),this},e.add()},wax=wax||{},wax.interaction=function(){function l(a){var b=g();for(var c=0;c<b.length;c++)if(b[c][0]<a.y&&b[c][0]+256>a.y&&b[c][1]<a.x&&b[c][1]+256>a.x)return b[c][2];return!1}function m(){return d?(window.clearTimeout(d),d=null,!0):!1}function n(d){if(c)return;var e=wax.u.eventoffset(d),f=l(e),g;f&&a.getGrid(f.src,function(c,i){if(c||!i)return;g=i.tileFeature(e.x,e.y,f),g?bean.fire(b,"on",{parent:h(),data:g,formatter:a.formatter().format,e:d}):bean.fire(b,"off")})}function o(a){if(m())return;c=!0,e=wax.u.eventoffset(a),a.type==="mousedown"?bean.add(document.body,"mouseup",q):a.type==="touchstart"&&a.touches.length===1&&(bean.fire(b,"off"),bean.add(h(),k))}function p(){bean.remove(h(),k),c=!1}function q(a){var b={},g=wax.u.eventoffset(a);c=!1;for(var i in a)b[i]=a[i];return bean.remove(document.body,"mouseup",q),bean.remove(h(),k),a.type==="touchend"?r(a,e):Math.round(g.y/f)===Math.round(e.y/f)&&Math.round(g.x/f)===Math.round(e.x/f)&&(d=window.setTimeout(function(){d=null,r(b,g)},300)),q}function r(c,d){var e=l(d);e&&a.getGrid(e.src,function(f,g){if(f||!g)return;var i=g.tileFeature(d.x,d.y,e);if(!i)return;bean.fire(b,"on",{parent:h(),data:i,formatter:a.formatter().format,e:c})})}var a=wax.gm(),b={},c=!1,d=!1,e,f=4,g,h,i,j={mousemove:n,touchstart:o,mousedown:o},k={touchend:q,touchmove:q,touchcancel:p};return b.attach=function(a){return arguments.length?(attach=a,b):attach},b.map=function(a){return arguments.length?(map=a,bean.add(h(),j),bean.add(h(),"touchstart",o),attach&&attach(map),b):map},b.grid=function(a){return arguments.length?(g=a,b):g},b.remove=function(){for(var a=0;a<clearingEvents.length;a++)map.removeCallback(clearingEvents[a],clearTileGrid);return bean.remove(h(),j),bean.fire(b,"remove"),b},b.tilejson=function(c){return arguments.length?(a.tilejson(c),b):tilejson},b.formatter=function(){return a.formatter()},b.on=function(a,c){return bean.add(b,a,c),b},b.off=function(a,c){return bean.remove(b,a,c),b},b.parent=function(a){return h=a,b},b};var wax=wax||{};wax.legend=function(){function d(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function e(a){return a}var a,b={},c;return b.element=function(){return c},b.content=function(c){return arguments.length?(c?(a.innerHTML=html_sanitize(c,d,e),a.style.display="block"):(a.innerHTML="",a.style.display="none"),b):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=c.appendChild(document.createElement("div")),a.className="wax-legend",a.style.display="none",b},b.add()};var wax=wax||{};wax.movetip={},wax.movetip=function(){function g(a){var b=wax.u.eventoffset(a);c.height+b.y>d.top+d.height&&d.height>c.height&&(b.y-=c.height,e.className+=" flip-y"),c.width+b.x>d.left+d.width&&(b.x-=c.width,e.className+=" flip-x"),e.style.left=b.x+"px",e.style.top=b.y+"px"}function h(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function i(){e&&(e.parentNode.removeChild(e),e=null)}function j(b){var j;if(a)return;if(b.e.type==="mousemove"||!b.e.type){j=b.formatter({format:"teaser"},b.data);if(!j)return;i(),f.style.cursor="pointer",e=document.body.appendChild(h(j))}else{j=b.formatter({format:"teaser"},b.data);if(!j)return;i();var k=document.body.appendChild(h(j));k.className+=" wax-popup";var l=k.appendChild(document.createElement("a"));l.href="#close",l.className="close",l.innerHTML="Close",a=!0,e=k,c=wax.u.offset(e),d=wax.u.offset(f),g(b.e),bean.add(l,"click touchend",function(b){b.stop(),i(),a=!1})}e&&(c=wax.u.offset(e),d=wax.u.offset(f),g(b.e))}function k(){f.style.cursor="default",a||i()}var a=!1,b={},c,d,e,f;return b.parent=function(a){return arguments.length?(f=a,b):f},b.events=function(){return{on:j,off:k}},b};var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success | ||
:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}},wax.template=function(a){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var b={};return b.format=function(b,e){var f={};for(var g in e)f[g]=e[g];return b.format&&(f["__"+b.format+"__"]=!0),html_sanitize(Mustache.to_html(a,f),c,d)},b};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(){function h(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function i(){this.parentNode&&this.parentNode.removeChild(this)}function j(){var a;while(a=d.pop())b&&f?(bean.add(a,f,i),a.className+=" wax-fade"):a.parentNode&&a.parentNode.removeChild(a)}function k(b){var c;if((b.e.type==="mousemove"||!b.e.type)&&!a){c=b.formatter({format:"teaser"},b.data);if(!c||c==e)return;j(),g.style.cursor="pointer",d.push(g.appendChild(h(c))),e=c}else{c=b.formatter({format:"full"},b.data);if(!c)return;j(),g.style.cursor="pointer";var f=g.appendChild(h(c));f.className+=" wax-popup";var i=f.appendChild(document.createElement("a"));i.href="#close",i.className="close",i.innerHTML="Close",a=!0,d.push(f),bean.add(i,"click touchend",function(b){b.stop(),j(),a=!1})}}function l(){g.style.cursor="default",e=null,a||j()}var a=!1,b=!1,c={},d=[],e,f,g;return document.body.style["-webkit-transition"]!==undefined?f="webkitTransitionEnd":document.body.style.MozTransition!==undefined&&(f="transitionend"),c.parent=function(a){return arguments.length?(g=a,c):g},c.animate=function(a){return arguments.length?(b=a,c):b},c.events=function(){return{on:k,off:l}},c};var wax=wax||{};wax.u={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=document.body,e=0,f=0,g=function(a){if(a===d||a===document.documentElement)return;e+=a.offsetTop,f+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");e+=parseInt(c[13],10),f+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10)};g(a);try{while(a=a.offsetParent)g(a)}catch(h){}e+=d.offsetTop,f+=d.offsetLeft,e+=d.parentNode.offsetTop,f+=d.parentNode.offsetLeft;var i=document.defaultView?window.getComputedStyle(d.parentNode,null):d.parentNode.currentStyle;return d.parentNode.offsetTop!==parseInt(i.marginTop,10)&&!isNaN(parseInt(i.marginTop,10))&&(e+=parseInt(i.marginTop,10),f+=parseInt(i.marginLeft,10)),{top:e,left:f,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;a||(a=window.event);if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}},limit:function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}},throttle:function(a,b){return this.limit(a,b,!1)}},wax=wax||{},wax.mm=wax.mm||{},wax.mm.attribution=function(a,b){b=b||{};var c,d={};return d.element=function(){return c.element()},d.appendTo=function(a){return wax.u.$(a).appendChild(c.element()),this},d.init=function(){return c=wax.attribution(),c.content(b.attribution),c.element().className="wax-attribution wax-mm",this},d.init()},wax=wax||{},wax.mm=wax.mm||{},wax.mm.boxselector=function(a,b,c){function k(b){var c=new MM.Point(b.clientX,b.clientY);c.x+=document.body.scrollLeft+document.documentElement.scrollLeft,c.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var d=a.parent;d;d=d.offsetParent)c.x-=d.offsetLeft,c.y-=d.offsetTop;return c}function l(b){if(!b.shiftKey)return;return d=k(b),f.style.left=d.x+"px",f.style.top=d.y+"px",g(a.parent,"mousemove",m),g(a.parent,"mouseup",n),a.parent.style.cursor="crosshair",MM.cancelEvent(b)}function m(a){var b=k(a),c=f.style;return c.display="block",b.x<d.x?c.left=b.x+"px":c.left=d.x+"px",b.y<d.y?c.top=b.y+"px":c.top=d.y+"px",c.width=Math.abs(b.x-d.x)+"px",c.height=Math.abs(b.y-d.y)+"px",MM.cancelEvent(a)}function n(b){var c=k(b),e=a.pointLocation(c),f=a.pointLocation(d);j.extent([new MM.Location(Math.max(e.lat,f.lat),Math.min(e.lon,f.lon)),new MM.Location(Math.min(e.lat,f.lat),Math.max(e.lon,f.lon))]),h(a.parent,"mousemove",m),h(a.parent,"mouseup",n),a.parent.style.cursor="auto"}function o(a,b){if(!f||!i)return;var c=a.locationPoint(i[1]),d=a.locationPoint(i[0]),e=f.style;e.display="block",e.height="auto",e.width="auto",e.left=Math.max(0,d.x)+"px",e.top=Math.max(0,d.y)+"px",e.right=Math.max(0,a.dimensions.x-c.x)+"px",e.bottom=Math.max(0,a.dimensions.y-c.y)+"px"}var d=null,e=typeof c=="function"?c:c.callback,f,g=MM.addEvent,h=MM.removeEvent,i,j={};return j.extent=function(b,c){if(!b)return i;i=[new MM.Location(Math.max(b[0].lat,b[1].lat),Math.min(b[0].lon,b[1].lon)),new MM.Location(Math.min(b[0].lat,b[1].lat),Math.max(b[0].lon,b[1].lon))],o(a),c||e(i)},j.add=function(a){return f=f||document.createElement("div"),f.id=a.parent.id+"-boxselector-box",f.className="boxselector-box",a.parent.appendChild(f),g(a.parent,"mousedown",l),a.addCallback("drawn",o),this},j.remove=function(){a.parent.removeChild(f),h(a.parent,"mousedown",l),a.removeCallback("drawn",o)},j.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax._={},wax.mm.bwdetect=function(a,b){b=b||{};var c=b.png||".png128",d=b.jpg||".jpg70",e=!1;return wax._.bw_png=c,wax._.bw_jpg=d,wax.bwdetect(b,function(b){wax._.bw=!b;for(var c=0;c<a.layers.length;c++)a.getLayerAt(c).provider instanceof wax.mm.connector&&a.getLayerAt(c).setProvider(a.getLayerAt(c).provider)})},wax=wax||{},wax.mm=wax.mm||{},wax.mm.fullscreen=function(a){function g(a){a&&a.stop(),b?c.original():c.full()}function h(b,c){a.dimensions=new MM.Point(b,c),a.parent.style.width=Math.round(a.dimensions.x)+"px",a.parent.style.height=Math.round(a.dimensions.y)+"px",a.dispatchCallback("resized",a.dimensions)}var b=!1,c={},d,e=document.body,f;return c.add=function(a){return d=document.createElement("a"),d.className="wax-fullscreen",d.href="#fullscreen",d.innerHTML="fullscreen",bean.add(d,"click",g),this},c.full=function(){if(b)return;b=!0,f=[a.parent.offsetWidth,a.parent.offsetHeight],a.parent.className+=" wax-fullscreen-map",e.className+=" wax-fullscreen-view",h(a.parent.offsetWidth,a.parent.offsetHeight)},c.original=function(){if(!b)return;b=!1,a.parent.className=a.parent.className.replace(" wax-fullscreen-map",""),e.className=e.className.replace(" wax-fullscreen-view",""),h(f[0],f[1])},c.appendTo=function(a){return wax.u.$(a).appendChild(d),this},c.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.interaction=function(){function c(){var c=map.getLayerAt(0).levels[Math.round(map.getZoom())];return!a&&b!==undefined&&b.length?b:(b=function(a){var b=[];for(var d in a)if(a[d].parentNode===c){var e=wax.u.offset(a[d]);b.push([e.top,e.left,a[d]])}return b}(map.getLayerAt(0).tiles),b)}function d(b){function c(){a=!0}if(!arguments.length)return map;map=b;var d=["zoomed","panned","centered","extentset","resized","drawn"];for(var e=0;e<d.length;e++)map.addCallback(d[e],c)}var a=!1,b;return wax.interaction().attach(d).parent(function(){return map.parent}).grid(c)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.latlngtooltip=function(a){function e(b){var c=new MM.Point(b.clientX,b.clientY);c.x+=document.body.scrollLeft+document.documentElement.scrollLeft,c.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var d=a.parent;d;d=d.offsetParent)c.x-=d.offsetLeft,c.y-=d.offsetTop;return c}function f(a){console.log("here"),c=!0}function g(a){c=!1}function h(d){if(!d.shiftKey||c){b.parentNode===a.parent&&a.parent.removeChild(b);return}var f=e(d),g=a.pointLocation(f),h=g.lat.toFixed(2)+", "+g.lon.toFixed(2);b.innerHTML=h,f.scale=f.width=f.height=1,f.x+=10,MM.moveElement(b,f),a.parent.appendChild(b)}var b,c=!1,d={};return d.add=function(){return MM.addEvent(a.parent,"mousemove",h),MM.addEvent(a.parent,"mousedown",f),MM.addEvent(a.parent,"mouseup",g),b=document.createElement("div"),b.className="wax-latlngtooltip",this},d.remove=function(){return MM.removeEvent(a.parent,"mousemove",h),MM.removeEvent(a.parent,"mousedown",f),MM.removeEvent(a.parent,"mouseup",g),this},d.add()},wax=wax||{},wax.mm=wax.mm||{},wax.mm.legend=function(a,b){b=b||{};var c,d={};return d.add=function(){return c=wax.legend().content(b.legend||""),this},d.content=function(a){a&&c.content(a.legend||"")},d.element=function(){return c.element()},d.appendTo=function(a){return wax.u.$(a).appendChild(c.element()),this},d.add()},wax=wax||{},wax.mm=wax.mm||{},wax.mm.pointselector=function(a,b,c){function k(b){var c=wax.u.eventoffset(b),d=new MM.Point(c.x,c.y),e={x:parseFloat(MM.getStyle(document.documentElement,"margin-left")),y:parseFloat(MM.getStyle(document.documentElement,"margin-top"))};isNaN(e.x)||(d.x-=e.x),isNaN(e.y)||(d.y-=e.y);for(var f=a.parent;f;f=f.offsetParent)d.x-=f.offsetLeft,d.y-=f.offsetTop;return d}function l(a){var b=[];for(var c=0;c<a.length;c++)b.push(new MM.Location(a[c].lat,a[c].lon));return b}function m(){var b=new MM.Point(0,0);for(var c=0;c<i.length;c++){var d=a.locationPoint(i[c]);i[c].pointDiv||(i[c].pointDiv=document.createElement("div"),i[c].pointDiv.className="wax-point-div",i[c].pointDiv.style.position="absolute",i[c].pointDiv.style.display="block",i[c].pointDiv.location=i[c],bean.add(i[c].pointDiv,"mouseup",function(b){var d=i[c];return function(b){MM.removeEvent(a.parent,"mouseup",o),h.deleteLocation(d,b)}}()),a.parent.appendChild(i[c].pointDiv)),i[c].pointDiv.style.left=d.x+"px",i[c].pointDiv.style.top=d.y+"px"}}function n(b){d=k(b),bean.add(a.parent,"mouseup",o)}function o(b){if(!d)return;e=k(b),MM.Point.distance(d,e)<f&&(h.addLocation(a.pointLocation(d)),j(l(i))),d=null}var d=null,e=null,f=5,g,h={},i=[],j=typeof c=="function"?c:c.callback;return h.addLocation=function(a){i.push(a),m(),j(l(i))},h.locations=function(a){return i},h.add=function(a){return bean.add(a.parent,"mousedown",n),a.addCallback("drawn",m),this},h.remove=function(a){bean.remove(a.parent,"mousedown",n),a.removeCallback("drawn",m);for(var b=i.length-1;b>-1;b--)h.deleteLocation(i[b]);return this},h.deleteLocation=function(a,b){if(!b||confirm("Delete this point?"))a.pointDiv.parentNode.removeChild(a.pointDiv),i.splice(wax.u.indexOf(i,a),1),j(l(i))},h.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.zoombox=function(a){function f(b){var c=new MM.Point(b.clientX,b.clientY);c.x+=document.body.scrollLeft+document.documentElement.scrollLeft,c.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var d=a.parent;d;d=d.offsetParent)c.x-=d.offsetLeft,c.y-=d.offsetTop;return c}function g(b){if(!c)return;c=!1;var h=f(b),j=a.pointLocation(h),k=a.pointLocation(e);a.setExtent([j,k]),d.style.display="none",MM.removeEvent(a.parent,"mousemove",i),MM.removeEvent(a.parent,"mouseup",g),a.parent.style.cursor="auto"}function h(b){if(!b.shiftKey||!!this.drawing)return;return c=!0,e=f(b),d.style.left=e.x+"px",d.style.top=e.y+"px",MM.addEvent(a.parent,"mousemove",i),MM.addEvent(a.parent,"mouseup",g),a.parent.style.cursor="crosshair",MM.cancelEvent(b)}function i(a){if(!c)return;var b=f(a);return d.style.display="block",b.x<e.x?d.style.left=b.x+"px":d.style.left=e.x+"px",d.style.width=Math.abs(b.x-e.x)+"px",b.y<e.y?d.style.top=b.y+"px":d.style.top=e.y+"px",d.style.height=Math.abs(b.y-e.y)+"px",MM.cancelEvent(a)}var b={},c=!1,d,e=null;return b.add=function(a){return d=d||document.createElement("div"),d.id=a.parent.id+"-zoombox-box",d.className="zoombox-box",a.parent.appendChild(d),MM.addEvent(a.parent,"mousedown",h),this},b.remove=function(){a.parent.removeChild(d),MM.removeEvent(a.parent,"mousedown",h)},b.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.zoomer=function(a){var b=document.createElement("a");b.innerHTML="+",b.href="#",b.className="zoomer zoomin",bean.add(b,"mousedown dblclick",function(a){a.stop()}),bean.add(b,"click",function(b){b.stop(),a.zoomIn()},!1);var c=document.createElement("a");c.innerHTML="-",c.href="#",c.className="zoomer zoomout",bean.add(c,"mousedown dblclick",function(a){a.stop()}),bean.add(c,"click",function(b){b.stop(),a.zoomOut()});var d={add:function(a){return a.addCallback("drawn",function(a,d){a.coordinate.zoom===a.coordLimits[0].zoom?c.className="zoomer zoomout zoomdisabled":a.coordinate.zoom===a.coordLimits[1].zoom?b.className="zoomer zoomin zoomdisabled":(b.className="zoomer zoomin",c.className="zoomer zoomout")}),this},appendTo:function(a){return wax.u.$(a).appendChild(b),wax.u.$(a).appendChild(c),this}};return d.add(a)};var wax=wax||{};wax.mm=wax.mm||{},wax.mm._provider=function(a){this.options={tiles:a.tiles,scheme:a.scheme||"xyz",minzoom:a.minzoom||0,maxzoom:a.maxzoom||22,bounds:a.bounds||[-180,-90,180,90]}},wax.mm._provider.prototype={outerLimits:function(){return[this.locationCoordinate(new MM.Location(this.options.bounds[0],this.options.bounds[1])).zoomTo(this.options.minzoom),this.locationCoordinate(new MM.Location(this.options.bounds[2],this.options.bounds[3])).zoomTo(this.options.maxzoom)]},getTile:function(a){if(!(coord=this.sourceCoordinate(a)))return null;if(coord.zoom<this.options.minzoom||coord.zoom>this.options.maxzoom)return null;coord.row=this.options.scheme==="tms"?Math.pow(2,coord.zoom)-coord.row-1:coord.row;var b=this.options.tiles[parseInt(Math.pow(2,coord.zoom)*coord.row+coord.column,10)%this.options.tiles.length].replace("{z}",coord.zoom.toFixed(0)).replace("{x}",coord.column.toFixed(0)).replace("{y}",coord.row.toFixed(0));return wax._&&wax._.bw&&(b=b.replace(".png",wax._.bw_png).replace(".jpg",wax._.bw_jpg)),b}},MM&&MM.extend(wax.mm._provider,MM.MapProvider),wax.mm.connector=function(a){var b=new wax.mm._provider(a);return new MM.Layer(b)} |
@@ -1,2 +0,2 @@ | ||
/* wax - 6.0.0-beta1 - 1.0.4-522-g703646f */!function(a,b,c){typeof module!="undefined"?module.exports=c(a,b):typeof define=="function"&&typeof define.amd=="object"?define(c):b[a]=c(a,b)}("bean",this,function(a,b){var c=window,d=b[a],e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=Array.prototype.slice,q=/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,r=/mouse.*(wheel|scroll)/i,s=/^text/i,t=/^touch|^gesture/i,u={one:1},v=function(a,b,c){for(c=0;c<b.length;c++)a[b[c]]=1;return a}({},("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(n?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),w=function(){function a(a,b){while((b=b.parentNode)!==null)if(b===a)return!0;return!1}function b(b){var c=b.relatedTarget;return c?c!==this&&c.prefix!=="xul"&&!/document/.test(this.toString())&&!a(this,c):c===null}return{mouseenter:{base:"mouseover",condition:b},mouseleave:{base:"mouseout",condition:b},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),x=function(){var a="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),b=a.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),c=b.concat("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis".split(" ")),d=a.concat("char charCode key keyCode keyIdentifier keyLocation".split(" ")),f=a.concat(["data"]),g=a.concat("touches targetTouches changedTouches scale rotation".split(" ")),h="preventDefault",i=function(a){return function(){a[h]?a[h]():a.returnValue=!1}},j="stopPropagation",k=function(a){return function(){a[j]?a[j]():a.cancelBubble=!0}},n=function(a){return function(){a[h](),a[j](),a.stopped=!0}},o=function(a,b,c){var d,e;for(d=c.length;d--;)e=c[d],!(e in b)&&e in a&&(b[e]=a[e])};return function(p,u){var v={originalEvent:p,isNative:u};if(!p)return v;var w,x=p.type,y=p.target||p.srcElement;v[h]=i(p),v[j]=k(p),v.stop=n(v),v.target=y&&y.nodeType===3?y.parentNode:y;if(u){if(x.indexOf("key")!==-1)w=d,v.keyCode=p.which||p.keyCode;else if(q.test(x)){w=b,v.rightClick=p.which===3||p.button===2,v.pos={x:0,y:0};if(p.pageX||p.pageY)v.clientX=p.pageX,v.clientY=p.pageY;else if(p.clientX||p.clientY)v.clientX=p.clientX+l.body.scrollLeft+m.scrollLeft,v.clientY=p.clientY+l.body.scrollTop+m.scrollTop;e.test(x)&&(v.relatedTarget=p.relatedTarget||p[(x==="mouseover"?"from":"to")+"Element"])}else t.test(x)?w=g:r.test(x)?w=c:s.test(x)&&(w=f);o(p,v,w||a)}return v}}(),y=function(a,b){return!n&&!b&&(a===l||a===c)?m:a},z=function(){function a(a,b,c,d,e){this.element=a,this.type=b,this.handler=c,this.original=d,this.namespaces=e,this.custom=w[b],this.isNative=v[b]&&a[o],this.eventType=n||this.isNative?b:"propertychange",this.customType=!n&&!this.isNative&&b,this.target=y(a,this.isNative),this.eventSupport=this.target[o]}return a.prototype={inNamespaces:function(a){var b,c;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)if(a[b]===this.namespaces[c])return!0;return!1},matches:function(a,b,c){return this.element===a&&(!b||this.original===b)&&(!c||this.handler===c)}},a}(),A=function(){var a={},b=function(c,d,e,f,g){if(!d||d==="*")for(var h in a)h.charAt(0)==="$"&&b(c,h.substr(1),e,f,g);else{var i=0,j,k=a["$"+d],l=c==="*";if(!k)return;for(j=k.length;i<j;i++)if(l||k[i].matches(c,e,f))if(!g(k[i],k,i,d))return}},c=function(b,c,d){var e,f=a["$"+c];if(f)for(e=f.length;e--;)if(f[e].matches(b,d,null))return!0;return!1},d=function(a,c,d){var e=[];return b(a,c,d,null,function(a){return e.push(a)}),e},e=function(b){return(a["$"+b.type]||(a["$"+b.type]=[])).push(b),b},f=function(c){b(c.element,c.type,null,c.handler,function(b,c,d){return c.splice(d,1),c.length===0&&delete a["$"+b.type],!1})},g=function(){var b,c=[];for(b in a)b.charAt(0)==="$"&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),B=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},C=function(a,b,d){return function(e){return e=x(e||((this.ownerDocument||this.document||this).parentWindow||c).event,!0),b.apply(a,[e].concat(d))}},D=function(a,b,d,e,f,g){return function(h){if(e?e.apply(this,arguments):n?!0:h&&h.propertyName==="_on"+d||!h)h&&(h=x(h||((this.ownerDocument||this.document||this).parentWindow||c).event,g)),b.apply(a,h&&(!f||f.length===0)?arguments:p.call(arguments,h?0:1).concat(f))}},E=function(a,b,c,d,e){return function(){a(b,c,e),d.apply(this,arguments)}},F=function(a,b,c,d){var e,f,h,i=b&&b.replace(g,""),j=A.get(a,i,c);for(e=0,f=j.length;e<f;e++)j[e].inNamespaces(d)&&((h=j[e]).eventSupport&&B(h.target,h.eventType,h.handler,!1,h.type),A.del(h))},G=function(a,b,c,d,e){var h,i=b.replace(g,""),j=b.replace(f,"").split(".");if(A.has(a,i,c))return a;i==="unload"&&(c=E(F,a,i,c,d)),w[i]&&(w[i].condition&&(c=D(a,c,i,w[i].condition,!0)),i=w[i].base||i),h=A.put(new z(a,i,c,d,j[0]&&j)),h.handler=h.isNative?C(a,h.handler,e):D(a,h.handler,i,!1,e,!1),h.eventSupport&&B(h.target,h.eventType,h.handler,!0,h.customType)},H=function(a,b,c){return function(d){var e,f,g=typeof a=="string"?c(a,this):a;for(e=d.target;e&&e!==this;e=e.parentNode)for(f=g.length;f--;)if(g[f]===e)return b.apply(e,arguments)}},I=function(a,b,c){var d,e,h,i,j,k=F,l=b&&typeof b=="string";if(l&&b.indexOf(" ")>0){b=b.split(" ");for(j=b.length;j--;)I(a,b[j],c);return a}h=l&&b.replace(g,""),h&&w[h]&&(h=w[h].type);if(!b||l){if(i=l&&b.replace(f,""))i=i.split(".");k(a,h,c,i)}else if(typeof b=="function")k(a,null,b);else for(d in b)b.hasOwnProperty(d)&&I(a,d,b[d]);return a},J=function(a,b,c,d,e){var f,g,h,i,j=c,k=c&&typeof c=="string";if(b&&!c&&typeof b=="object")for(f in b)b.hasOwnProperty(f)&&J.apply(this,[a,f,b[f]]);else{i=arguments.length>3?p.call(arguments,3):[],g=(k?c:b).split(" "),k&&(c=H(b,j=d,e))&&(i=p.call(i,1)),this===u&&(c=E(I,a,b,c,j));for(h=g.length;h--;)G(a,g[h],c,j,i)}return a},K=function(){return J.apply(u,arguments)},L=n?function(a,b,d){var e=l.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=y(c,a),a?c.fireEvent("on"+b,l.createEventObject()):c["_on"+b]++},M=function(a,b,c){var d,e,h,i,j,k=b.split(" ");for(d=k.length;d--;){b=k[d].replace(g,"");if(i=k[d].replace(f,""))i=i.split(".");if(!i&&!c&&a[o])L(v[b],b,a);else{j=A.get(a,b),c=[!1].concat(c);for(e=0,h=j.length;e<h;e++)j[e].inNamespaces(i)&&j[e].handler.apply(a,c)}}return a},N=function(a,b,c){var d=0,e=A.get(b,c),f=e.length;for(;d<f;d++)e[d].original&&J(a,e[d].type,e[d].original);return a},O={add:J,one:K,remove:I,clone:N,fire:M,noConflict:function(){return b[a]=d,this}};if(c[i]){var P=function(){var a,b=A.entries();for(a in b)b[a].type&&b[a].type!=="unload"&&I(b[a].element,b[a].type);c[k]("onunload",P),c.CollectGarbage&&c.CollectGarbage()};c[i]("onunload",P)}return O});var html4={};html4.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10},html4.ATTRIBS={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0},html4.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128},html4.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:4,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,nobr:0,noembed:4,noframes:20,noscript:20,object:16,ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:84,select:0,small:0,span:0,strike:0,strong:0,style:148,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},html4.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},html4.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"body::background":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0},html4.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},html4.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"body::background":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2};var html=function(a){function g(a){a=b(a);if(c.hasOwnProperty(a))return c[a];var d=a.match(e);return d?String.fromCharCode(parseInt(d[1],10)):(d=a.match(f))?String.fromCharCode(parseInt(d[1],16)):""}function h(a,b){return g(b)}function j(a){return a.replace(i,"")}function l(a){return a.replace(k,h)}function s(a){return a.replace(m,"&").replace(o,"<").replace(p,">").replace(q,""").replace(r,"=")}function t(a){return a.replace(n,"&$1").replace(o,"<").replace(p,">")}function w(c){return function d(d,e){d=String(d);var f=null,g=!1,h=[],i=void 0,k=void 0,m=void 0;c.startDoc&&c.startDoc(e);while(d){var n=d.match(g?u:v);d=d.substring(n[0].length);if(g){if(n[1]){var o=b(n[1]),p;if(n[2]){var q=n[3];switch(q.charCodeAt(0)){case 34:case 39:q=q.substring(1,q.length-1)}p=l(j(q))}else p=o;h.push(o,p)}else if(n[4]){k!==void 0&&(m?c.startTag&&c.startTag(i,h,e):c.endTag&&c.endTag(i,e));if(m&&k&(a.eflags.CDATA|a.eflags.RCDATA)){f===null?f=b(d):f=f.substring(f.length-d.length);var r=f.indexOf("</"+i);r<0&&(r=d.length),r&&(k&a.eflags.CDATA?c.cdata&&c.cdata(d.substring(0,r),e):c.rcdata&&c.rcdata(t(d.substring(0,r)),e),d=d.substring(r))}i=k=m=void 0,h.length=0,g=!1}}else if(n[1])c.pcdata&&c.pcdata(n[0],e);else if(n[3])m=!n[2],g=!0,i=b(n[3]),k=a.ELEMENTS.hasOwnProperty(i)?a.ELEMENTS[i]:void 0;else if(n[4])c.pcdata&&c.pcdata(n[4],e);else if(n[5]&&c.pcdata){var s=n[5];c.pcdata(s==="<"?"<":s===">"?">":"&",e)}}c.endDoc&&c.endDoc(e)}}function x(b){var c,d;return w({startDoc:function(a){c=[],d=!1},startTag:function(e,f,g){if(d)return;if(!a.ELEMENTS.hasOwnProperty(e))return;var h=a.ELEMENTS[e];if(h&a.eflags.FOLDABLE)return;if(h&a.eflags.UNSAFE){d=!(h&a.eflags.EMPTY);return}f=b(e,f);if(f){h&a.eflags.EMPTY||c.push(e),g.push("<",e);for(var i=0,j=f.length;i<j;i+=2){var k=f[i],l=f[i+1];l!==null&&l!==void 0&&g.push(" ",k,'="',s(l),'"')}g.push(">")}},endTag:function(b,e){if(d){d=!1;return}if(!a.ELEMENTS.hasOwnProperty(b))return;var f=a.ELEMENTS[b];if(!(f&(a.eflags.UNSAFE|a.eflags.EMPTY|a.eflags.FOLDABLE))){var g;if(f&a.eflags.OPTIONAL_ENDTAG)for(g=c.length;--g>=0;){var h=c[g];if(h===b)break;if(!(a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG))return}else for(g=c.length;--g>=0;)if(c[g]===b)break;if(g<0)return;for(var i=c.length;--i>g;){var h=c[i];a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG||e.push("</",h,">")}c.length=g,e.push("</",b,">")}},pcdata:function(a,b){d||b.push(a)},rcdata:function(a,b){d||b.push(a)},cdata:function(a,b){d||b.push(a)},endDoc:function(a){for(var b=c.length;--b>=0;)a.push("</",c[b],">");c.length=0}})}function z(b,c,e){var f=[];return x(function g(b,f){for(var g=0;g<f.length;g+=2){var h=f[g],i=f[g+1],j=null,k;if((k=b+"::"+h,a.ATTRIBS.hasOwnProperty(k))||(k="*::"+h,a.ATTRIBS.hasOwnProperty(k)))j=a.ATTRIBS[k];if(j!==null)switch(j){case a.atype.NONE:break;case a.atype.SCRIPT:case a.atype.STYLE:i=null;break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:i=e?e(i):i;break;case a.atype.URI:var l=(""+i).match(y);l?!l[1]||d.test(l[1])?i=c&&c(i):i=null:i=null;break;case a.atype.URI_FRAGMENT:i&&"#"===i.charAt(0)?(i=e?e(i):i,i&&(i="#"+i)):i=null;break;default:i=null}else i=null;f[g+1]=i}return f})(b,f),f.join("")}var b;"script"==="SCRIPT".toLowerCase()?b=function(a){return a.toLowerCase()}:b=function(a){return a.replace(/[A-Z]/g,function(a){return String.fromCharCode(a.charCodeAt(0)|32)})};var c={lt:"<",gt:">",amp:"&",nbsp:" ",quot:'"',apos:"'"},d=/^(?:https?|mailto|data)$/i,e=/^#(\d+)$/,f=/^#x([0-9A-Fa-f]+)$/,i=/\0/g,k=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,m=/&/g,n=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,o=/</g,p=/>/g,q=/\"/g,r=/\=/g,u=new RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[\\s\\S][^a-z\\s>]*)","i"),v=new RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<!--[\\s\\S]*?-->|<!\\w[^>]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i"),y=new RegExp("^(?:([^:/?#]+):)?");return{escapeAttrib:s,makeHtmlSanitizer:x,makeSaxParser:w,normalizeRCData:t,sanitize:z,unescapeEntities:l}}(html4),html_sanitize=html.sanitize;typeof window!="undefined"&&(window.html=html,window.html_sanitize=html_sanitize),html4.ATTRIBS["*::style"]=0,html4.ELEMENTS.style=0;var Mustache=function(){var a={},b=function(){};return b.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a);return}a=this.render_pragmas(a);var e=this.render_section(a,b,c);e===!1&&(e=this.render_tags(a,b,c,d));if(d)return e;this.sendLines(e)},send:function(a){a!==""&&this.buffer.push(a)},sendLines:function(a){if(a){var b=a.split("\n");for(var c=0;c<b.length;c++)this.send(b[c])}},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=this.getCachedRegex("render_pragmas",function(a,b){return new RegExp(a+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+b,"g")});return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return!1;var d=this,e=this.getCachedRegex("render_section",function(a,b){return new RegExp("^([\\s\\S]*?)"+a+"(\\^|\\#)\\s*(.+)\\s*"+b+"\n*([\\s\\S]*?)"+a+"\\/\\s*\\3\\s*"+b+"\\s*([\\s\\S]*)$","g")});return a.replace(e,function(a,e,f,g,h,i){var j=e?d.render_tags(e,b,c,!0):"",k=i?d.render(i,b,c,!0):"",l,m=d.find(g,b);return f==="^"?!m||d.is_array(m)&&m.length===0?l=d.render(h,b,c,!0):l="":f==="#"&&(d.is_array(m)?l=d.map(m,function(a){return d.render(h,d.create_context(a),c,!0)}).join(""):d.is_object(m)?l=d.render(h,d.create_context(m),c,!0):typeof m=="function"?l=m.call(b,h,function(a){return d.render(a,b,c,!0)}):m?l=d.render(h,b,c,!0):l=""),j+l+k})},render_tags:function(a,b,c,d){var e=this,f=function(){return e.getCachedRegex("render_tags",function(a,b){return new RegExp(a+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+b+"+","g")})},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":return e.set_delimiters(h),g=f(),"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j<i.length;j++)i[j]=i[j].replace(g,h,this),d||this.send(i[j]);if(d)return i.join("\n")},set_delimiters:function(a){var b=a.split(" ");this.otag=this.escape_regex(b[0]),this.ctag=this.escape_regex(b[1])},escape_regex:function(a){if(!arguments.callee.sRE){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+b.join("|\\")+")","g")}return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){function c(a){return a===!1||a===0||a}a=this.trim(a);var d;return c(b[a])?d=b[a]:c(this.context[a])&&(d=this.context[a]),typeof d=="function"?d.apply(b):d!==undefined?d:""},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return a=String(a===null?"":a),a.replace(/&(?!\w+;)|["'<>\\]/g,function(a){switch(a){case"&":return"&";case'"':return""";case"'":return"'";case"<":return"<";case">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};return c[b]=a,c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e<d;e++)c.push(b(a[e]));return c},getCachedRegex:function(b,c){var d=a[this.otag];d||(d=a[this.otag]={});var e=d[this.ctag];e||(e=d[this.ctag]={});var f=e[b];return f||(f=e[b]=c(this.otag,this.ctag)),f}},{name:"mustache.js",version:"0.4.0-dev",to_html:function(a,c,d,e){var f=new b;e&&(f.send=e),f.render(a,c||{},d);if(!e)return f.buffer.join("\n")}}}();!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window);var wax=wax||{};wax.ol=wax.ol||{},wax.ol.connector=function(a){for(var b=0;b<a.tiles.length;b++)a.tiles[b]=a.tiles[b].replace("{z}","${z}").replace("{x}","${x}").replace("{y}","${y}");var c=new OpenLayers.Layer.XYZ(a.name,a.tiles,{sphericalMercator:!0,zoomOffset:a.minzoom,numZoomLevels:a.maxzoom-a.minzoom,attribution:a.attribution});return c.CLASS_NAME="Wax.Layer",c},wax=wax||{},wax.attribution=function(){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var a,b={};return b.content=function(b){return typeof b=="undefined"?a.innerHTML:(a.innerHTML=html_sanitize(b,c,d),this)},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){function urlX(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function idX(a){return a}var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return html_sanitize(f(a,b),urlX,idX)}catch(c){console&&console.log(c)}},formatter},wax.gi=function(a,b){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}b=b||{};var c={},d=b.resolution||4,e=b.tileSize||256;return c.grid_tile=function(){return a},c.getKey=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>=e||Math.floor(b)>=e)return;return f(a.grid[Math.floor(c/d)].charCodeAt(Math.floor(b/d)))},c.gridFeature=function(b,c){var d=this.getKey(b,c),e=a.keys;if(e&&e[d]&&a.data[e[d]])return a.data[e[d]]},c.tileFeature=function(b,c,d){if(!a)return;var e=wax.u.offset(d);return feature=this.gridFeature(b-e.left,c-e.top),feature},c},wax.gm=function(){function f(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=new RegExp("/(\\d+)\\/(\\d+)\\/(\\d+)\\.[\\w\\._]+"),d=c.exec(b);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}var a=4,b={},c={},d,e=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return c.formatter=function(a){return arguments.length?(d=wax.formatter(a),c):d},c.template=function(a){return arguments.length?(d=wax.template(a),c):d},c.gridUrl=function(a){return arguments.length?(e=typeof a=="function"?a:f(a),c):e},c.getGrid=function(b,f){var g=e(b);return!d||!g?f(null,null):(wax.request.get(g,function(b,c){if(b)return f(b,null);f(null,wax.gi(c,d,{resolution:a||4}))}),c)},c.tilejson=function(a){return a.template?c.template(a.template):a.formatter&&c.formatter(a.formatter),a.grids&&c.gridUrl(a.grids),c},c},wax=wax||{},wax.hash=function(a){function b(){return location.hash.substring(1)}function c(a){location.hash="#"+a}function g(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(c)}function h(){var b=a.getCenterZoom();d!==b&&(d=b,c(d))}function i(a){if(a===d)return;g(d=a)&&h()}a=a||{};var d,e={},f=90-1e-8,j=wax.u.throttle(h,500);return e.add=function(){return i(b()),a.bindChange(j),this},e.remove=function(){return a.unbindChange(j),this},e.add()},wax=wax||{},wax.interaction=function(){function m(a){var b=h();for(var c=0;c<b.length;c++)if(b[c][0]<a.y&&b[c][0]+256>a.y&&b[c][1]<a.x&&b[c][1]+256>a.x)return b[c][2];return!1}function n(){return d?(window.clearTimeout(d),d=null,!0):!1}function o(d){if(c)return;var f=wax.u.eventoffset(d),g=m(f),h;g&&a.getGrid(g.src,function(c,j){if(c||!j)return;h=j.tileFeature(f.x,f.y,g),h?h&&e!==h?(e=h,bean.fire(b,"on",{parent:i(),data:h,formatter:a.formatter().format,e:d})):h||(e=null,bean.fire(b,"off")):(e=null,bean.fire(b,"off"))})}function p(a){if(n())return;c=!0,f=wax.u.eventoffset(a),a.type==="mousedown"?bean.add(document.body,"mouseup",r):a.type==="touchstart"&&a.touches.length===1&&(bean.fire(b,"off"),bean.add(i(),l))}function q(){bean.remove(i(),l),c=!1}function r(a){var b={},e=wax.u.eventoffset(a);c=!1;for(var h in a)b[h]=a[h];return bean.remove(document.body,"mouseup",r),bean.remove(i(),l),a.type==="touchend"?s(a,f):Math.round(e.y/g)===Math.round(f.y/g)&&Math.round(e.x/g)===Math.round(f.x/g)&&(d=window.setTimeout(function(){d=null,s(b,e)},300)),r}function s(c,d){var e=m(d);e&&a.getGrid(e.src,function(f,g){if(f||!g)return;var h=g.tileFeature(d.x,d.y,e);if(!h)return;bean.fire(b,"on",{parent:i(),data:h,formatter:a.formatter().format,e:c})})}var a=wax.gm(),b={},c=!1,d=!1,e,f,g=4,h,i,j,k={mousemove:o,touchstart:p,mousedown:p},l={touchend:r,touchmove:r,touchcancel:q};return b.attach=function(a){return arguments.length?(attach=a,b):attach},b.map=function(a){return arguments.length?(map=a,bean.add(i(),k),bean.add(i(),"touchstart",p),attach&&attach(map),b):map},b.grid=function(a){return arguments.length?(h=a,b):h},b.remove=function(){for(var a=0;a<clearingEvents.length;a++)map.removeCallback(clearingEvents[a],clearTileGrid);return bean.remove(i(),k),bean.fire(b,"remove"),b},b.tilejson=function(c){return arguments.length?(a.tilejson(c),b):tilejson},b.formatter=function(){return a.formatter()},b.on=function(a,c){return bean.add(b,a,c),b},b.off=function(a,c){return bean.remove(b,a,c),b},b.parent=function(a){return i=a,b},b};var wax=wax||{};wax.legend=function(){function d(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function e(a){return a}var a,b={},c;return b.element=function(){return c},b.content=function(c){return arguments.length?(c?(a.innerHTML=html_sanitize(c,d,e),a.style.display="block"):(a.innerHTML="",a.style.display="none"),b):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=c.appendChild(document.createElement("div")),a.className="wax-legend",a.style.display="none",b},b.add()};var wax=wax||{};wax.movetip={},wax.movetip=function(a){function g(a){return a&&a.className.indexOf("wax-popup")!==-1}function h(a,b){var c=document.createElement("div");return c.className="wax-movetip",c.style.cssText="position:absolute;",c.innerHTML=a,b.appendChild(c),d=b,_tooltipOffset=wax.util.offset(c),_contextOffset=wax.util.offset(d),c}function i(a){if(!c)return;var b=wax.util.eventoffset(a);c.className="wax-movetip",_tooltipOffset.height+b.y>_contextOffset.top+_contextOffset.height&&_contextOffset.height>_tooltipOffset.height&&(b.y-=_tooltipOffset.height,c.className+=" flip-y"),_tooltipOffset.width+b.x>_contextOffset.left+_contextOffset.width&&(b.x-=_tooltipOffset.width,c.className+=" flip-x"),c.style.left=b.x+"px",c.style.top=b.y+"px"}function j(a){if(!a)return;var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&e?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&e&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+e):a.parentNode&&a.parentNode.removeChild(a)}function k(a,b){c&& | ||
(j(c),c=undefined);var d=h(a,b);d.className+=" wax-popup",d.innerHTML=a;var e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close",d.appendChild(e);var f=function(a){return j(d),c=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),!1};e.addEventListener?e.addEventListener("click",f,!1):e.attachEvent&&e.attachEvent("onclick",f),c=d}a=a||{};var b={},c=undefined,d=undefined,e=a.animationOut,f=a.animationIn;return b.over=function(a,b,d){if(!a)return;b.style.cursor="pointer";if(g(c))return;c=h(a,b),i(d),b.addEventListener&&b.addEventListener("mousemove",i)},b.out=function(a){a.style.cursor="default";if(g(c))return;c&&(j(c),a.removeEventListener&&a.removeEventListener("mousemove",i),c=undefined)},b};var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}},wax.template=function(a){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var b={};return b.format=function(b,e){var f={};for(var g in e)f[g]=e[g];return b.format&&(f["__"+b.format+"__"]=!0),html_sanitize(Mustache.to_html(a,f),c,d)},b};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(){function f(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function g(){function c(){this.parentNode&&this.parentNode.removeChild(this)}var a;document.body.style["-webkit-transition"]!==undefined?a="webkitTransitionEnd":document.body.style.MozTransition!==undefined&&(a="transitionend");var e;while(e=d.pop())b&&a?(bean.add(e,a,c),e.className+=" wax-fade"):e.parentNode&&e.parentNode.removeChild(e)}function h(b){var c;g();if((b.e.type==="mousemove"||!b.e.type)&&!a){c=b.formatter({format:"teaser"},b.data);if(!c)return;e.style.cursor="pointer",d.push(e.appendChild(f(c)))}else{c=b.formatter({format:"full"},b.data);if(!c)return;var h=e.appendChild(f(c));h.className+=" wax-popup";var i=h.appendChild(document.createElement("a"));i.href="#close",i.className="close",i.innerHTML="Close",a=!0,d.push(h),bean.add(i,"click touchend",function(b){b.stop(),g(),a=!1})}}function i(){e.style.cursor="default",a||g()}var a=!1,b=!1,c={},d=[],e;return c.parent=function(a){return arguments.length?(e=a,c):e},c.animate=function(a){return arguments.length?(b=a,c):b},c.events=function(){return{on:h,off:i}},c};var wax=wax||{};wax.u={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=document.body,e=0,f=0,g=function(a){if(a===d||a===document.documentElement)return;e+=a.offsetTop,f+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");e+=parseInt(c[13],10),f+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10)};g(a);try{while(a=a.offsetParent)g(a)}catch(h){}e+=d.offsetTop,f+=d.offsetLeft,e+=d.parentNode.offsetTop,f+=d.parentNode.offsetLeft;var i=document.defaultView?window.getComputedStyle(d.parentNode,null):d.parentNode.currentStyle;return d.parentNode.offsetTop!==parseInt(i.marginTop,10)&&!isNaN(parseInt(i.marginTop,10))&&(e+=parseInt(i.marginTop,10),f+=parseInt(i.marginLeft,10)),{top:e,left:f,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;a||(a=window.event);if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}},limit:function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}},throttle:function(a,b){return this.limit(a,b,!1)}},wax=wax||{},wax.ol=wax.ol||{},wax.ol.interaction=function(){function c(){a=!0}function d(){var a=[];for(var b in map.layers)map.layers[b].visibility===!0&&map.layers[b].CLASS_NAME==="Wax.Layer"&&a.push(map.layers[b]);return a}function e(){if(!a&&b)return b;b=[];var c=d();for(var e=0;e<c.length;e++)for(var f=0;f<c[e].grid.length;f++)for(var g=0;g<c[e].grid[f].length;g++){var h;c[e].grid[f][g].imgDiv?h=wax.u.offset(c[e].grid[f][g].imgDiv):h=wax.u.offset(c[e].grid[f][g].frame),h&&h.top<pos.y&&h.top+256>pos.y&&h.left<pos.x&&h.left+256>pos.x&&tiles.push(c[e].grid[f][g])}return tiles}function f(a){if(!arguments.length)return map;map=a,map.events.on({addlayer:c,changelayer:c,removelayer:c,changebaselayer:c})}var a=!1,b;return wax.interaction().attach(f).parent(function(){return map.div}).grid(e)};var wax=wax||{};wax.ol=wax.ol||{},wax.ol.Legend=OpenLayers.Class(OpenLayers.Control,{CLASS_NAME:"wax.ol.Legend",legend:null,options:null,initialize:function(a){this.options=a||{},OpenLayers.Control.prototype.initialize.apply(this,[a||{}])},activate:function(){return this.legend=new wax.legend(this.map.viewPortDiv,this.options.container),OpenLayers.Control.prototype.activate.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments),this.activate(),this.map.events.on({addlayer:this.setLegend,changelayer:this.setLegend,removelayer:this.setLegend,changebaselayer:this.setLegend,scope:this})},setLegend:function(){var a=[];for(var b=0;b<this.map.layers.length;b++){var c=this.map.layers[b];c&&c.getURL&&c.visibility&&a.push(c.getURL(new OpenLayers.Bounds))}this.legend.render(a)}}) | ||
/* wax - 6.0.0-beta2 - 1.0.4-526-g3351932 */!function(a,b,c){typeof module!="undefined"?module.exports=c(a,b):typeof define=="function"&&typeof define.amd=="object"?define(c):b[a]=c(a,b)}("bean",this,function(a,b){var c=window,d=b[a],e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=Array.prototype.slice,q=/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,r=/mouse.*(wheel|scroll)/i,s=/^text/i,t=/^touch|^gesture/i,u={one:1},v=function(a,b,c){for(c=0;c<b.length;c++)a[b[c]]=1;return a}({},("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(n?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),w=function(){function a(a,b){while((b=b.parentNode)!==null)if(b===a)return!0;return!1}function b(b){var c=b.relatedTarget;return c?c!==this&&c.prefix!=="xul"&&!/document/.test(this.toString())&&!a(this,c):c===null}return{mouseenter:{base:"mouseover",condition:b},mouseleave:{base:"mouseout",condition:b},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),x=function(){var a="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),b=a.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),c=b.concat("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis".split(" ")),d=a.concat("char charCode key keyCode keyIdentifier keyLocation".split(" ")),f=a.concat(["data"]),g=a.concat("touches targetTouches changedTouches scale rotation".split(" ")),h="preventDefault",i=function(a){return function(){a[h]?a[h]():a.returnValue=!1}},j="stopPropagation",k=function(a){return function(){a[j]?a[j]():a.cancelBubble=!0}},n=function(a){return function(){a[h](),a[j](),a.stopped=!0}},o=function(a,b,c){var d,e;for(d=c.length;d--;)e=c[d],!(e in b)&&e in a&&(b[e]=a[e])};return function(p,u){var v={originalEvent:p,isNative:u};if(!p)return v;var w,x=p.type,y=p.target||p.srcElement;v[h]=i(p),v[j]=k(p),v.stop=n(v),v.target=y&&y.nodeType===3?y.parentNode:y;if(u){if(x.indexOf("key")!==-1)w=d,v.keyCode=p.which||p.keyCode;else if(q.test(x)){w=b,v.rightClick=p.which===3||p.button===2,v.pos={x:0,y:0};if(p.pageX||p.pageY)v.clientX=p.pageX,v.clientY=p.pageY;else if(p.clientX||p.clientY)v.clientX=p.clientX+l.body.scrollLeft+m.scrollLeft,v.clientY=p.clientY+l.body.scrollTop+m.scrollTop;e.test(x)&&(v.relatedTarget=p.relatedTarget||p[(x==="mouseover"?"from":"to")+"Element"])}else t.test(x)?w=g:r.test(x)?w=c:s.test(x)&&(w=f);o(p,v,w||a)}return v}}(),y=function(a,b){return!n&&!b&&(a===l||a===c)?m:a},z=function(){function a(a,b,c,d,e){this.element=a,this.type=b,this.handler=c,this.original=d,this.namespaces=e,this.custom=w[b],this.isNative=v[b]&&a[o],this.eventType=n||this.isNative?b:"propertychange",this.customType=!n&&!this.isNative&&b,this.target=y(a,this.isNative),this.eventSupport=this.target[o]}return a.prototype={inNamespaces:function(a){var b,c;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)if(a[b]===this.namespaces[c])return!0;return!1},matches:function(a,b,c){return this.element===a&&(!b||this.original===b)&&(!c||this.handler===c)}},a}(),A=function(){var a={},b=function(c,d,e,f,g){if(!d||d==="*")for(var h in a)h.charAt(0)==="$"&&b(c,h.substr(1),e,f,g);else{var i=0,j,k=a["$"+d],l=c==="*";if(!k)return;for(j=k.length;i<j;i++)if(l||k[i].matches(c,e,f))if(!g(k[i],k,i,d))return}},c=function(b,c,d){var e,f=a["$"+c];if(f)for(e=f.length;e--;)if(f[e].matches(b,d,null))return!0;return!1},d=function(a,c,d){var e=[];return b(a,c,d,null,function(a){return e.push(a)}),e},e=function(b){return(a["$"+b.type]||(a["$"+b.type]=[])).push(b),b},f=function(c){b(c.element,c.type,null,c.handler,function(b,c,d){return c.splice(d,1),c.length===0&&delete a["$"+b.type],!1})},g=function(){var b,c=[];for(b in a)b.charAt(0)==="$"&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),B=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},C=function(a,b,d){return function(e){return e=x(e||((this.ownerDocument||this.document||this).parentWindow||c).event,!0),b.apply(a,[e].concat(d))}},D=function(a,b,d,e,f,g){return function(h){if(e?e.apply(this,arguments):n?!0:h&&h.propertyName==="_on"+d||!h)h&&(h=x(h||((this.ownerDocument||this.document||this).parentWindow||c).event,g)),b.apply(a,h&&(!f||f.length===0)?arguments:p.call(arguments,h?0:1).concat(f))}},E=function(a,b,c,d,e){return function(){a(b,c,e),d.apply(this,arguments)}},F=function(a,b,c,d){var e,f,h,i=b&&b.replace(g,""),j=A.get(a,i,c);for(e=0,f=j.length;e<f;e++)j[e].inNamespaces(d)&&((h=j[e]).eventSupport&&B(h.target,h.eventType,h.handler,!1,h.type),A.del(h))},G=function(a,b,c,d,e){var h,i=b.replace(g,""),j=b.replace(f,"").split(".");if(A.has(a,i,c))return a;i==="unload"&&(c=E(F,a,i,c,d)),w[i]&&(w[i].condition&&(c=D(a,c,i,w[i].condition,!0)),i=w[i].base||i),h=A.put(new z(a,i,c,d,j[0]&&j)),h.handler=h.isNative?C(a,h.handler,e):D(a,h.handler,i,!1,e,!1),h.eventSupport&&B(h.target,h.eventType,h.handler,!0,h.customType)},H=function(a,b,c){return function(d){var e,f,g=typeof a=="string"?c(a,this):a;for(e=d.target;e&&e!==this;e=e.parentNode)for(f=g.length;f--;)if(g[f]===e)return b.apply(e,arguments)}},I=function(a,b,c){var d,e,h,i,j,k=F,l=b&&typeof b=="string";if(l&&b.indexOf(" ")>0){b=b.split(" ");for(j=b.length;j--;)I(a,b[j],c);return a}h=l&&b.replace(g,""),h&&w[h]&&(h=w[h].type);if(!b||l){if(i=l&&b.replace(f,""))i=i.split(".");k(a,h,c,i)}else if(typeof b=="function")k(a,null,b);else for(d in b)b.hasOwnProperty(d)&&I(a,d,b[d]);return a},J=function(a,b,c,d,e){var f,g,h,i,j=c,k=c&&typeof c=="string";if(b&&!c&&typeof b=="object")for(f in b)b.hasOwnProperty(f)&&J.apply(this,[a,f,b[f]]);else{i=arguments.length>3?p.call(arguments,3):[],g=(k?c:b).split(" "),k&&(c=H(b,j=d,e))&&(i=p.call(i,1)),this===u&&(c=E(I,a,b,c,j));for(h=g.length;h--;)G(a,g[h],c,j,i)}return a},K=function(){return J.apply(u,arguments)},L=n?function(a,b,d){var e=l.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=y(c,a),a?c.fireEvent("on"+b,l.createEventObject()):c["_on"+b]++},M=function(a,b,c){var d,e,h,i,j,k=b.split(" ");for(d=k.length;d--;){b=k[d].replace(g,"");if(i=k[d].replace(f,""))i=i.split(".");if(!i&&!c&&a[o])L(v[b],b,a);else{j=A.get(a,b),c=[!1].concat(c);for(e=0,h=j.length;e<h;e++)j[e].inNamespaces(i)&&j[e].handler.apply(a,c)}}return a},N=function(a,b,c){var d=0,e=A.get(b,c),f=e.length;for(;d<f;d++)e[d].original&&J(a,e[d].type,e[d].original);return a},O={add:J,one:K,remove:I,clone:N,fire:M,noConflict:function(){return b[a]=d,this}};if(c[i]){var P=function(){var a,b=A.entries();for(a in b)b[a].type&&b[a].type!=="unload"&&I(b[a].element,b[a].type);c[k]("onunload",P),c.CollectGarbage&&c.CollectGarbage()};c[i]("onunload",P)}return O});var html4={};html4.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10},html4.ATTRIBS={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0},html4.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128},html4.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:4,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,nobr:0,noembed:4,noframes:20,noscript:20,object:16,ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:84,select:0,small:0,span:0,strike:0,strong:0,style:148,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},html4.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},html4.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"body::background":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0},html4.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},html4.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"body::background":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2};var html=function(a){function g(a){a=b(a);if(c.hasOwnProperty(a))return c[a];var d=a.match(e);return d?String.fromCharCode(parseInt(d[1],10)):(d=a.match(f))?String.fromCharCode(parseInt(d[1],16)):""}function h(a,b){return g(b)}function j(a){return a.replace(i,"")}function l(a){return a.replace(k,h)}function s(a){return a.replace(m,"&").replace(o,"<").replace(p,">").replace(q,""").replace(r,"=")}function t(a){return a.replace(n,"&$1").replace(o,"<").replace(p,">")}function w(c){return function d(d,e){d=String(d);var f=null,g=!1,h=[],i=void 0,k=void 0,m=void 0;c.startDoc&&c.startDoc(e);while(d){var n=d.match(g?u:v);d=d.substring(n[0].length);if(g){if(n[1]){var o=b(n[1]),p;if(n[2]){var q=n[3];switch(q.charCodeAt(0)){case 34:case 39:q=q.substring(1,q.length-1)}p=l(j(q))}else p=o;h.push(o,p)}else if(n[4]){k!==void 0&&(m?c.startTag&&c.startTag(i,h,e):c.endTag&&c.endTag(i,e));if(m&&k&(a.eflags.CDATA|a.eflags.RCDATA)){f===null?f=b(d):f=f.substring(f.length-d.length);var r=f.indexOf("</"+i);r<0&&(r=d.length),r&&(k&a.eflags.CDATA?c.cdata&&c.cdata(d.substring(0,r),e):c.rcdata&&c.rcdata(t(d.substring(0,r)),e),d=d.substring(r))}i=k=m=void 0,h.length=0,g=!1}}else if(n[1])c.pcdata&&c.pcdata(n[0],e);else if(n[3])m=!n[2],g=!0,i=b(n[3]),k=a.ELEMENTS.hasOwnProperty(i)?a.ELEMENTS[i]:void 0;else if(n[4])c.pcdata&&c.pcdata(n[4],e);else if(n[5]&&c.pcdata){var s=n[5];c.pcdata(s==="<"?"<":s===">"?">":"&",e)}}c.endDoc&&c.endDoc(e)}}function x(b){var c,d;return w({startDoc:function(a){c=[],d=!1},startTag:function(e,f,g){if(d)return;if(!a.ELEMENTS.hasOwnProperty(e))return;var h=a.ELEMENTS[e];if(h&a.eflags.FOLDABLE)return;if(h&a.eflags.UNSAFE){d=!(h&a.eflags.EMPTY);return}f=b(e,f);if(f){h&a.eflags.EMPTY||c.push(e),g.push("<",e);for(var i=0,j=f.length;i<j;i+=2){var k=f[i],l=f[i+1];l!==null&&l!==void 0&&g.push(" ",k,'="',s(l),'"')}g.push(">")}},endTag:function(b,e){if(d){d=!1;return}if(!a.ELEMENTS.hasOwnProperty(b))return;var f=a.ELEMENTS[b];if(!(f&(a.eflags.UNSAFE|a.eflags.EMPTY|a.eflags.FOLDABLE))){var g;if(f&a.eflags.OPTIONAL_ENDTAG)for(g=c.length;--g>=0;){var h=c[g];if(h===b)break;if(!(a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG))return}else for(g=c.length;--g>=0;)if(c[g]===b)break;if(g<0)return;for(var i=c.length;--i>g;){var h=c[i];a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG||e.push("</",h,">")}c.length=g,e.push("</",b,">")}},pcdata:function(a,b){d||b.push(a)},rcdata:function(a,b){d||b.push(a)},cdata:function(a,b){d||b.push(a)},endDoc:function(a){for(var b=c.length;--b>=0;)a.push("</",c[b],">");c.length=0}})}function z(b,c,e){var f=[];return x(function g(b,f){for(var g=0;g<f.length;g+=2){var h=f[g],i=f[g+1],j=null,k;if((k=b+"::"+h,a.ATTRIBS.hasOwnProperty(k))||(k="*::"+h,a.ATTRIBS.hasOwnProperty(k)))j=a.ATTRIBS[k];if(j!==null)switch(j){case a.atype.NONE:break;case a.atype.SCRIPT:case a.atype.STYLE:i=null;break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:i=e?e(i):i;break;case a.atype.URI:var l=(""+i).match(y);l?!l[1]||d.test(l[1])?i=c&&c(i):i=null:i=null;break;case a.atype.URI_FRAGMENT:i&&"#"===i.charAt(0)?(i=e?e(i):i,i&&(i="#"+i)):i=null;break;default:i=null}else i=null;f[g+1]=i}return f})(b,f),f.join("")}var b;"script"==="SCRIPT".toLowerCase()?b=function(a){return a.toLowerCase()}:b=function(a){return a.replace(/[A-Z]/g,function(a){return String.fromCharCode(a.charCodeAt(0)|32)})};var c={lt:"<",gt:">",amp:"&",nbsp:" ",quot:'"',apos:"'"},d=/^(?:https?|mailto|data)$/i,e=/^#(\d+)$/,f=/^#x([0-9A-Fa-f]+)$/,i=/\0/g,k=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,m=/&/g,n=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,o=/</g,p=/>/g,q=/\"/g,r=/\=/g,u=new RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[\\s\\S][^a-z\\s>]*)","i"),v=new RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<!--[\\s\\S]*?-->|<!\\w[^>]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i"),y=new RegExp("^(?:([^:/?#]+):)?");return{escapeAttrib:s,makeHtmlSanitizer:x,makeSaxParser:w,normalizeRCData:t,sanitize:z,unescapeEntities:l}}(html4),html_sanitize=html.sanitize;typeof window!="undefined"&&(window.html=html,window.html_sanitize=html_sanitize),html4.ATTRIBS["*::style"]=0,html4.ELEMENTS.style=0;var Mustache=function(){var a={},b=function(){};return b.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a);return}a=this.render_pragmas(a);var e=this.render_section(a,b,c);e===!1&&(e=this.render_tags(a,b,c,d));if(d)return e;this.sendLines(e)},send:function(a){a!==""&&this.buffer.push(a)},sendLines:function(a){if(a){var b=a.split("\n");for(var c=0;c<b.length;c++)this.send(b[c])}},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=this.getCachedRegex("render_pragmas",function(a,b){return new RegExp(a+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+b,"g")});return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return!1;var d=this,e=this.getCachedRegex("render_section",function(a,b){return new RegExp("^([\\s\\S]*?)"+a+"(\\^|\\#)\\s*(.+)\\s*"+b+"\n*([\\s\\S]*?)"+a+"\\/\\s*\\3\\s*"+b+"\\s*([\\s\\S]*)$","g")});return a.replace(e,function(a,e,f,g,h,i){var j=e?d.render_tags(e,b,c,!0):"",k=i?d.render(i,b,c,!0):"",l,m=d.find(g,b);return f==="^"?!m||d.is_array(m)&&m.length===0?l=d.render(h,b,c,!0):l="":f==="#"&&(d.is_array(m)?l=d.map(m,function(a){return d.render(h,d.create_context(a),c,!0)}).join(""):d.is_object(m)?l=d.render(h,d.create_context(m),c,!0):typeof m=="function"?l=m.call(b,h,function(a){return d.render(a,b,c,!0)}):m?l=d.render(h,b,c,!0):l=""),j+l+k})},render_tags:function(a,b,c,d){var e=this,f=function(){return e.getCachedRegex("render_tags",function(a,b){return new RegExp(a+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+b+"+","g")})},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":return e.set_delimiters(h),g=f(),"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j<i.length;j++)i[j]=i[j].replace(g,h,this),d||this.send(i[j]);if(d)return i.join("\n")},set_delimiters:function(a){var b=a.split(" ");this.otag=this.escape_regex(b[0]),this.ctag=this.escape_regex(b[1])},escape_regex:function(a){if(!arguments.callee.sRE){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+b.join("|\\")+")","g")}return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){function c(a){return a===!1||a===0||a}a=this.trim(a);var d;return c(b[a])?d=b[a]:c(this.context[a])&&(d=this.context[a]),typeof d=="function"?d.apply(b):d!==undefined?d:""},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return a=String(a===null?"":a),a.replace(/&(?!\w+;)|["'<>\\]/g,function(a){switch(a){case"&":return"&";case'"':return""";case"'":return"'";case"<":return"<";case">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};return c[b]=a,c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e<d;e++)c.push(b(a[e]));return c},getCachedRegex:function(b,c){var d=a[this.otag];d||(d=a[this.otag]={});var e=d[this.ctag];e||(e=d[this.ctag]={});var f=e[b];return f||(f=e[b]=c(this.otag,this.ctag)),f}},{name:"mustache.js",version:"0.4.0-dev",to_html:function(a,c,d,e){var f=new b;e&&(f.send=e),f.render(a,c||{},d);if(!e)return f.buffer.join("\n")}}}();!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window);var wax=wax||{};wax.ol=wax.ol||{},wax.ol.connector=function(a){for(var b=0;b<a.tiles.length;b++)a.tiles[b]=a.tiles[b].replace("{z}","${z}").replace("{x}","${x}").replace("{y}","${y}");var c=new OpenLayers.Layer.XYZ(a.name,a.tiles,{sphericalMercator:!0,zoomOffset:a.minzoom,numZoomLevels:a.maxzoom-a.minzoom,attribution:a.attribution});return c.CLASS_NAME="Wax.Layer",c},wax=wax||{},wax.attribution=function(){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var a,b={};return b.content=function(b){return typeof b=="undefined"?a.innerHTML:(a.innerHTML=html_sanitize(b,c,d),this)},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){function urlX(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function idX(a){return a}var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return html_sanitize(f(a,b),urlX,idX)}catch(c){console&&console.log(c)}},formatter},wax.gi=function(a,b){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}b=b||{};var c={},d=b.resolution||4,e=b.tileSize||256;return c.grid_tile=function(){return a},c.getKey=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>=e||Math.floor(b)>=e)return;return f(a.grid[Math.floor(c/d)].charCodeAt(Math.floor(b/d)))},c.gridFeature=function(b,c){var d=this.getKey(b,c),e=a.keys;if(e&&e[d]&&a.data[e[d]])return a.data[e[d]]},c.tileFeature=function(b,c,d){if(!a)return;var e=wax.u.offset(d);return feature=this.gridFeature(b-e.left,c-e.top),feature},c},wax.gm=function(){function f(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=new RegExp("/(\\d+)\\/(\\d+)\\/(\\d+)\\.[\\w\\._]+"),d=c.exec(b);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}var a=4,b={},c={},d,e=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return c.formatter=function(a){return arguments.length?(d=wax.formatter(a),c):d},c.template=function(a){return arguments.length?(d=wax.template(a),c):d},c.gridUrl=function(a){return arguments.length?(e=typeof a=="function"?a:f(a),c):e},c.getGrid=function(b,f){var g=e(b);return!d||!g?f(null,null):(wax.request.get(g,function(b,c){if(b)return f(b,null);f(null,wax.gi(c,d,{resolution:a||4}))}),c)},c.tilejson=function(a){return a.template?c.template(a.template):a.formatter&&c.formatter(a.formatter),a.grids&&c.gridUrl(a.grids),c},c},wax=wax||{},wax.hash=function(a){function b(){return location.hash.substring(1)}function c(a){location.hash="#"+a}function g(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(c)}function h(){var b=a.getCenterZoom();d!==b&&(d=b,c(d))}function i(a){if(a===d)return;g(d=a)&&h()}a=a||{};var d,e={},f=90-1e-8,j=wax.u.throttle(h,500);return e.add=function(){return i(b()),a.bindChange(j),this},e.remove=function(){return a.unbindChange(j),this},e.add()},wax=wax||{},wax.interaction=function(){function l(a){var b=g();for(var c=0;c<b.length;c++)if(b[c][0]<a.y&&b[c][0]+256>a.y&&b[c][1]<a.x&&b[c][1]+256>a.x)return b[c][2];return!1}function m(){return d?(window.clearTimeout(d),d=null,!0):!1}function n(d){if(c)return;var e=wax.u.eventoffset(d),f=l(e),g;f&&a.getGrid(f.src,function(c,i){if(c||!i)return;g=i.tileFeature(e.x,e.y,f),g?bean.fire(b,"on",{parent:h(),data:g,formatter:a.formatter().format,e:d}):bean.fire(b,"off")})}function o(a){if(m())return;c=!0,e=wax.u.eventoffset(a),a.type==="mousedown"?bean.add(document.body,"mouseup",q):a.type==="touchstart"&&a.touches.length===1&&(bean.fire(b,"off"),bean.add(h(),k))}function p(){bean.remove(h(),k),c=!1}function q(a){var b={},g=wax.u.eventoffset(a);c=!1;for(var i in a)b[i]=a[i];return bean.remove(document.body,"mouseup",q),bean.remove(h(),k),a.type==="touchend"?r(a,e):Math.round(g.y/f)===Math.round(e.y/f)&&Math.round(g.x/f)===Math.round(e.x/f)&&(d=window.setTimeout(function(){d=null,r(b,g)},300)),q}function r(c,d){var e=l(d);e&&a.getGrid(e.src,function(f,g){if(f||!g)return;var i=g.tileFeature(d.x,d.y,e);if(!i)return;bean.fire(b,"on",{parent:h(),data:i,formatter:a.formatter().format,e:c})})}var a=wax.gm(),b={},c=!1,d=!1,e,f=4,g,h,i,j={mousemove:n,touchstart:o,mousedown:o},k={touchend:q,touchmove:q,touchcancel:p};return b.attach=function(a){return arguments.length?(attach=a,b):attach},b.map=function(a){return arguments.length?(map=a,bean.add(h(),j),bean.add(h(),"touchstart",o),attach&&attach(map),b):map},b.grid=function(a){return arguments.length?(g=a,b):g},b.remove=function(){for(var a=0;a<clearingEvents.length;a++)map.removeCallback(clearingEvents[a],clearTileGrid);return bean.remove(h(),j),bean.fire(b,"remove"),b},b.tilejson=function(c){return arguments.length?(a.tilejson(c),b):tilejson},b.formatter=function(){return a.formatter()},b.on=function(a,c){return bean.add(b,a,c),b},b.off=function(a,c){return bean.remove(b,a,c),b},b.parent=function(a){return h=a,b},b};var wax=wax||{};wax.legend=function(){function d(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function e(a){return a}var a,b={},c;return b.element=function(){return c},b.content=function(c){return arguments.length?(c?(a.innerHTML=html_sanitize(c,d,e),a.style.display="block"):(a.innerHTML="",a.style.display="none"),b):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=c.appendChild(document.createElement("div")),a.className="wax-legend",a.style.display="none",b},b.add()};var wax=wax||{};wax.movetip={},wax.movetip=function(){function g(a){var b=wax.u.eventoffset(a);c.height+b.y>d.top+d.height&&d.height>c.height&&(b.y-=c.height,e.className+=" flip-y"),c.width+b.x>d.left+d.width&&(b.x-=c.width,e.className+=" flip-x"),e.style.left=b.x+"px",e.style.top=b.y+"px"}function h(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function i(){e&&(e.parentNode.removeChild(e),e=null)}function j(b){var j;if(a)return;if(b.e.type==="mousemove"||!b.e.type){j=b.formatter({format:"teaser"},b.data);if(!j)return;i(),f.style.cursor="pointer",e=document.body.appendChild(h(j))}else{j=b.formatter({format:"teaser"},b.data);if(!j)return;i();var k=document.body.appendChild(h(j));k.className+=" wax-popup";var l=k.appendChild(document.createElement("a"));l.href="#close",l.className="close",l.innerHTML="Close",a=!0,e=k,c=wax.u.offset(e),d=wax.u.offset(f),g(b.e),bean.add(l,"click touchend",function(b){b.stop(),i(),a=!1})}e&&(c=wax.u.offset(e),d=wax.u.offset(f),g(b.e))}function k(){f.style.cursor="default",a||i()}var a=!1,b={},c,d,e,f;return b.parent=function(a){return arguments.length?(f=a,b):f},b.events=function(){return{ | ||
on:j,off:k}},b};var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}},wax.template=function(a){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var b={};return b.format=function(b,e){var f={};for(var g in e)f[g]=e[g];return b.format&&(f["__"+b.format+"__"]=!0),html_sanitize(Mustache.to_html(a,f),c,d)},b};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(){function h(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function i(){this.parentNode&&this.parentNode.removeChild(this)}function j(){var a;while(a=d.pop())b&&f?(bean.add(a,f,i),a.className+=" wax-fade"):a.parentNode&&a.parentNode.removeChild(a)}function k(b){var c;if((b.e.type==="mousemove"||!b.e.type)&&!a){c=b.formatter({format:"teaser"},b.data);if(!c||c==e)return;j(),g.style.cursor="pointer",d.push(g.appendChild(h(c))),e=c}else{c=b.formatter({format:"full"},b.data);if(!c)return;j(),g.style.cursor="pointer";var f=g.appendChild(h(c));f.className+=" wax-popup";var i=f.appendChild(document.createElement("a"));i.href="#close",i.className="close",i.innerHTML="Close",a=!0,d.push(f),bean.add(i,"click touchend",function(b){b.stop(),j(),a=!1})}}function l(){g.style.cursor="default",e=null,a||j()}var a=!1,b=!1,c={},d=[],e,f,g;return document.body.style["-webkit-transition"]!==undefined?f="webkitTransitionEnd":document.body.style.MozTransition!==undefined&&(f="transitionend"),c.parent=function(a){return arguments.length?(g=a,c):g},c.animate=function(a){return arguments.length?(b=a,c):b},c.events=function(){return{on:k,off:l}},c};var wax=wax||{};wax.u={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=document.body,e=0,f=0,g=function(a){if(a===d||a===document.documentElement)return;e+=a.offsetTop,f+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");e+=parseInt(c[13],10),f+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10)};g(a);try{while(a=a.offsetParent)g(a)}catch(h){}e+=d.offsetTop,f+=d.offsetLeft,e+=d.parentNode.offsetTop,f+=d.parentNode.offsetLeft;var i=document.defaultView?window.getComputedStyle(d.parentNode,null):d.parentNode.currentStyle;return d.parentNode.offsetTop!==parseInt(i.marginTop,10)&&!isNaN(parseInt(i.marginTop,10))&&(e+=parseInt(i.marginTop,10),f+=parseInt(i.marginLeft,10)),{top:e,left:f,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;a||(a=window.event);if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}},limit:function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}},throttle:function(a,b){return this.limit(a,b,!1)}},wax=wax||{},wax.ol=wax.ol||{},wax.ol.interaction=function(){function c(){a=!0}function d(){var a=[];for(var b in map.layers)map.layers[b].visibility===!0&&map.layers[b].CLASS_NAME==="Wax.Layer"&&a.push(map.layers[b]);return a}function e(){if(!a&&b)return b;b=[];var c=d();for(var e=0;e<c.length;e++)for(var f=0;f<c[e].grid.length;f++)for(var g=0;g<c[e].grid[f].length;g++){var h;c[e].grid[f][g].imgDiv?h=wax.u.offset(c[e].grid[f][g].imgDiv):h=wax.u.offset(c[e].grid[f][g].frame),h&&h.top<pos.y&&h.top+256>pos.y&&h.left<pos.x&&h.left+256>pos.x&&tiles.push(c[e].grid[f][g])}return tiles}function f(a){if(!arguments.length)return map;map=a,map.events.on({addlayer:c,changelayer:c,removelayer:c,changebaselayer:c})}var a=!1,b;return wax.interaction().attach(f).parent(function(){return map.div}).grid(e)};var wax=wax||{};wax.ol=wax.ol||{},wax.ol.Legend=OpenLayers.Class(OpenLayers.Control,{CLASS_NAME:"wax.ol.Legend",legend:null,options:null,initialize:function(a){this.options=a||{},OpenLayers.Control.prototype.initialize.apply(this,[a||{}])},activate:function(){return this.legend=new wax.legend(this.map.viewPortDiv,this.options.container),OpenLayers.Control.prototype.activate.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments),this.activate(),this.map.events.on({addlayer:this.setLegend,changelayer:this.setLegend,removelayer:this.setLegend,changebaselayer:this.setLegend,scope:this})},setLegend:function(){var a=[];for(var b=0;b<this.map.layers.length;b++){var c=this.map.layers[b];c&&c.getURL&&c.visibility&&a.push(c.getURL(new OpenLayers.Bounds))}this.legend.render(a)}}) |
@@ -1,2 +0,2 @@ | ||
/* wax - 6.0.0-beta1 - 1.0.4-522-g703646f */!function(a,b,c){typeof module!="undefined"?module.exports=c(a,b):typeof define=="function"&&typeof define.amd=="object"?define(c):b[a]=c(a,b)}("bean",this,function(a,b){var c=window,d=b[a],e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=Array.prototype.slice,q=/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,r=/mouse.*(wheel|scroll)/i,s=/^text/i,t=/^touch|^gesture/i,u={one:1},v=function(a,b,c){for(c=0;c<b.length;c++)a[b[c]]=1;return a}({},("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(n?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),w=function(){function a(a,b){while((b=b.parentNode)!==null)if(b===a)return!0;return!1}function b(b){var c=b.relatedTarget;return c?c!==this&&c.prefix!=="xul"&&!/document/.test(this.toString())&&!a(this,c):c===null}return{mouseenter:{base:"mouseover",condition:b},mouseleave:{base:"mouseout",condition:b},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),x=function(){var a="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),b=a.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),c=b.concat("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis".split(" ")),d=a.concat("char charCode key keyCode keyIdentifier keyLocation".split(" ")),f=a.concat(["data"]),g=a.concat("touches targetTouches changedTouches scale rotation".split(" ")),h="preventDefault",i=function(a){return function(){a[h]?a[h]():a.returnValue=!1}},j="stopPropagation",k=function(a){return function(){a[j]?a[j]():a.cancelBubble=!0}},n=function(a){return function(){a[h](),a[j](),a.stopped=!0}},o=function(a,b,c){var d,e;for(d=c.length;d--;)e=c[d],!(e in b)&&e in a&&(b[e]=a[e])};return function(p,u){var v={originalEvent:p,isNative:u};if(!p)return v;var w,x=p.type,y=p.target||p.srcElement;v[h]=i(p),v[j]=k(p),v.stop=n(v),v.target=y&&y.nodeType===3?y.parentNode:y;if(u){if(x.indexOf("key")!==-1)w=d,v.keyCode=p.which||p.keyCode;else if(q.test(x)){w=b,v.rightClick=p.which===3||p.button===2,v.pos={x:0,y:0};if(p.pageX||p.pageY)v.clientX=p.pageX,v.clientY=p.pageY;else if(p.clientX||p.clientY)v.clientX=p.clientX+l.body.scrollLeft+m.scrollLeft,v.clientY=p.clientY+l.body.scrollTop+m.scrollTop;e.test(x)&&(v.relatedTarget=p.relatedTarget||p[(x==="mouseover"?"from":"to")+"Element"])}else t.test(x)?w=g:r.test(x)?w=c:s.test(x)&&(w=f);o(p,v,w||a)}return v}}(),y=function(a,b){return!n&&!b&&(a===l||a===c)?m:a},z=function(){function a(a,b,c,d,e){this.element=a,this.type=b,this.handler=c,this.original=d,this.namespaces=e,this.custom=w[b],this.isNative=v[b]&&a[o],this.eventType=n||this.isNative?b:"propertychange",this.customType=!n&&!this.isNative&&b,this.target=y(a,this.isNative),this.eventSupport=this.target[o]}return a.prototype={inNamespaces:function(a){var b,c;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)if(a[b]===this.namespaces[c])return!0;return!1},matches:function(a,b,c){return this.element===a&&(!b||this.original===b)&&(!c||this.handler===c)}},a}(),A=function(){var a={},b=function(c,d,e,f,g){if(!d||d==="*")for(var h in a)h.charAt(0)==="$"&&b(c,h.substr(1),e,f,g);else{var i=0,j,k=a["$"+d],l=c==="*";if(!k)return;for(j=k.length;i<j;i++)if(l||k[i].matches(c,e,f))if(!g(k[i],k,i,d))return}},c=function(b,c,d){var e,f=a["$"+c];if(f)for(e=f.length;e--;)if(f[e].matches(b,d,null))return!0;return!1},d=function(a,c,d){var e=[];return b(a,c,d,null,function(a){return e.push(a)}),e},e=function(b){return(a["$"+b.type]||(a["$"+b.type]=[])).push(b),b},f=function(c){b(c.element,c.type,null,c.handler,function(b,c,d){return c.splice(d,1),c.length===0&&delete a["$"+b.type],!1})},g=function(){var b,c=[];for(b in a)b.charAt(0)==="$"&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),B=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},C=function(a,b,d){return function(e){return e=x(e||((this.ownerDocument||this.document||this).parentWindow||c).event,!0),b.apply(a,[e].concat(d))}},D=function(a,b,d,e,f,g){return function(h){if(e?e.apply(this,arguments):n?!0:h&&h.propertyName==="_on"+d||!h)h&&(h=x(h||((this.ownerDocument||this.document||this).parentWindow||c).event,g)),b.apply(a,h&&(!f||f.length===0)?arguments:p.call(arguments,h?0:1).concat(f))}},E=function(a,b,c,d,e){return function(){a(b,c,e),d.apply(this,arguments)}},F=function(a,b,c,d){var e,f,h,i=b&&b.replace(g,""),j=A.get(a,i,c);for(e=0,f=j.length;e<f;e++)j[e].inNamespaces(d)&&((h=j[e]).eventSupport&&B(h.target,h.eventType,h.handler,!1,h.type),A.del(h))},G=function(a,b,c,d,e){var h,i=b.replace(g,""),j=b.replace(f,"").split(".");if(A.has(a,i,c))return a;i==="unload"&&(c=E(F,a,i,c,d)),w[i]&&(w[i].condition&&(c=D(a,c,i,w[i].condition,!0)),i=w[i].base||i),h=A.put(new z(a,i,c,d,j[0]&&j)),h.handler=h.isNative?C(a,h.handler,e):D(a,h.handler,i,!1,e,!1),h.eventSupport&&B(h.target,h.eventType,h.handler,!0,h.customType)},H=function(a,b,c){return function(d){var e,f,g=typeof a=="string"?c(a,this):a;for(e=d.target;e&&e!==this;e=e.parentNode)for(f=g.length;f--;)if(g[f]===e)return b.apply(e,arguments)}},I=function(a,b,c){var d,e,h,i,j,k=F,l=b&&typeof b=="string";if(l&&b.indexOf(" ")>0){b=b.split(" ");for(j=b.length;j--;)I(a,b[j],c);return a}h=l&&b.replace(g,""),h&&w[h]&&(h=w[h].type);if(!b||l){if(i=l&&b.replace(f,""))i=i.split(".");k(a,h,c,i)}else if(typeof b=="function")k(a,null,b);else for(d in b)b.hasOwnProperty(d)&&I(a,d,b[d]);return a},J=function(a,b,c,d,e){var f,g,h,i,j=c,k=c&&typeof c=="string";if(b&&!c&&typeof b=="object")for(f in b)b.hasOwnProperty(f)&&J.apply(this,[a,f,b[f]]);else{i=arguments.length>3?p.call(arguments,3):[],g=(k?c:b).split(" "),k&&(c=H(b,j=d,e))&&(i=p.call(i,1)),this===u&&(c=E(I,a,b,c,j));for(h=g.length;h--;)G(a,g[h],c,j,i)}return a},K=function(){return J.apply(u,arguments)},L=n?function(a,b,d){var e=l.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=y(c,a),a?c.fireEvent("on"+b,l.createEventObject()):c["_on"+b]++},M=function(a,b,c){var d,e,h,i,j,k=b.split(" ");for(d=k.length;d--;){b=k[d].replace(g,"");if(i=k[d].replace(f,""))i=i.split(".");if(!i&&!c&&a[o])L(v[b],b,a);else{j=A.get(a,b),c=[!1].concat(c);for(e=0,h=j.length;e<h;e++)j[e].inNamespaces(i)&&j[e].handler.apply(a,c)}}return a},N=function(a,b,c){var d=0,e=A.get(b,c),f=e.length;for(;d<f;d++)e[d].original&&J(a,e[d].type,e[d].original);return a},O={add:J,one:K,remove:I,clone:N,fire:M,noConflict:function(){return b[a]=d,this}};if(c[i]){var P=function(){var a,b=A.entries();for(a in b)b[a].type&&b[a].type!=="unload"&&I(b[a].element,b[a].type);c[k]("onunload",P),c.CollectGarbage&&c.CollectGarbage()};c[i]("onunload",P)}return O});var html4={};html4.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10},html4.ATTRIBS={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0},html4.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128},html4.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:4,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,nobr:0,noembed:4,noframes:20,noscript:20,object:16,ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:84,select:0,small:0,span:0,strike:0,strong:0,style:148,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},html4.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},html4.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"body::background":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0},html4.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},html4.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"body::background":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2};var html=function(a){function g(a){a=b(a);if(c.hasOwnProperty(a))return c[a];var d=a.match(e);return d?String.fromCharCode(parseInt(d[1],10)):(d=a.match(f))?String.fromCharCode(parseInt(d[1],16)):""}function h(a,b){return g(b)}function j(a){return a.replace(i,"")}function l(a){return a.replace(k,h)}function s(a){return a.replace(m,"&").replace(o,"<").replace(p,">").replace(q,""").replace(r,"=")}function t(a){return a.replace(n,"&$1").replace(o,"<").replace(p,">")}function w(c){return function d(d,e){d=String(d);var f=null,g=!1,h=[],i=void 0,k=void 0,m=void 0;c.startDoc&&c.startDoc(e);while(d){var n=d.match(g?u:v);d=d.substring(n[0].length);if(g){if(n[1]){var o=b(n[1]),p;if(n[2]){var q=n[3];switch(q.charCodeAt(0)){case 34:case 39:q=q.substring(1,q.length-1)}p=l(j(q))}else p=o;h.push(o,p)}else if(n[4]){k!==void 0&&(m?c.startTag&&c.startTag(i,h,e):c.endTag&&c.endTag(i,e));if(m&&k&(a.eflags.CDATA|a.eflags.RCDATA)){f===null?f=b(d):f=f.substring(f.length-d.length);var r=f.indexOf("</"+i);r<0&&(r=d.length),r&&(k&a.eflags.CDATA?c.cdata&&c.cdata(d.substring(0,r),e):c.rcdata&&c.rcdata(t(d.substring(0,r)),e),d=d.substring(r))}i=k=m=void 0,h.length=0,g=!1}}else if(n[1])c.pcdata&&c.pcdata(n[0],e);else if(n[3])m=!n[2],g=!0,i=b(n[3]),k=a.ELEMENTS.hasOwnProperty(i)?a.ELEMENTS[i]:void 0;else if(n[4])c.pcdata&&c.pcdata(n[4],e);else if(n[5]&&c.pcdata){var s=n[5];c.pcdata(s==="<"?"<":s===">"?">":"&",e)}}c.endDoc&&c.endDoc(e)}}function x(b){var c,d;return w({startDoc:function(a){c=[],d=!1},startTag:function(e,f,g){if(d)return;if(!a.ELEMENTS.hasOwnProperty(e))return;var h=a.ELEMENTS[e];if(h&a.eflags.FOLDABLE)return;if(h&a.eflags.UNSAFE){d=!(h&a.eflags.EMPTY);return}f=b(e,f);if(f){h&a.eflags.EMPTY||c.push(e),g.push("<",e);for(var i=0,j=f.length;i<j;i+=2){var k=f[i],l=f[i+1];l!==null&&l!==void 0&&g.push(" ",k,'="',s(l),'"')}g.push(">")}},endTag:function(b,e){if(d){d=!1;return}if(!a.ELEMENTS.hasOwnProperty(b))return;var f=a.ELEMENTS[b];if(!(f&(a.eflags.UNSAFE|a.eflags.EMPTY|a.eflags.FOLDABLE))){var g;if(f&a.eflags.OPTIONAL_ENDTAG)for(g=c.length;--g>=0;){var h=c[g];if(h===b)break;if(!(a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG))return}else for(g=c.length;--g>=0;)if(c[g]===b)break;if(g<0)return;for(var i=c.length;--i>g;){var h=c[i];a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG||e.push("</",h,">")}c.length=g,e.push("</",b,">")}},pcdata:function(a,b){d||b.push(a)},rcdata:function(a,b){d||b.push(a)},cdata:function(a,b){d||b.push(a)},endDoc:function(a){for(var b=c.length;--b>=0;)a.push("</",c[b],">");c.length=0}})}function z(b,c,e){var f=[];return x(function g(b,f){for(var g=0;g<f.length;g+=2){var h=f[g],i=f[g+1],j=null,k;if((k=b+"::"+h,a.ATTRIBS.hasOwnProperty(k))||(k="*::"+h,a.ATTRIBS.hasOwnProperty(k)))j=a.ATTRIBS[k];if(j!==null)switch(j){case a.atype.NONE:break;case a.atype.SCRIPT:case a.atype.STYLE:i=null;break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:i=e?e(i):i;break;case a.atype.URI:var l=(""+i).match(y);l?!l[1]||d.test(l[1])?i=c&&c(i):i=null:i=null;break;case a.atype.URI_FRAGMENT:i&&"#"===i.charAt(0)?(i=e?e(i):i,i&&(i="#"+i)):i=null;break;default:i=null}else i=null;f[g+1]=i}return f})(b,f),f.join("")}var b;"script"==="SCRIPT".toLowerCase()?b=function(a){return a.toLowerCase()}:b=function(a){return a.replace(/[A-Z]/g,function(a){return String.fromCharCode(a.charCodeAt(0)|32)})};var c={lt:"<",gt:">",amp:"&",nbsp:" ",quot:'"',apos:"'"},d=/^(?:https?|mailto|data)$/i,e=/^#(\d+)$/,f=/^#x([0-9A-Fa-f]+)$/,i=/\0/g,k=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,m=/&/g,n=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,o=/</g,p=/>/g,q=/\"/g,r=/\=/g,u=new RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[\\s\\S][^a-z\\s>]*)","i"),v=new RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<!--[\\s\\S]*?-->|<!\\w[^>]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i"),y=new RegExp("^(?:([^:/?#]+):)?");return{escapeAttrib:s,makeHtmlSanitizer:x,makeSaxParser:w,normalizeRCData:t,sanitize:z,unescapeEntities:l}}(html4),html_sanitize=html.sanitize;typeof window!="undefined"&&(window.html=html,window.html_sanitize=html_sanitize),html4.ATTRIBS["*::style"]=0,html4.ELEMENTS.style=0;var Mustache=function(){var a={},b=function(){};return b.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a);return}a=this.render_pragmas(a);var e=this.render_section(a,b,c);e===!1&&(e=this.render_tags(a,b,c,d));if(d)return e;this.sendLines(e)},send:function(a){a!==""&&this.buffer.push(a)},sendLines:function(a){if(a){var b=a.split("\n");for(var c=0;c<b.length;c++)this.send(b[c])}},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=this.getCachedRegex("render_pragmas",function(a,b){return new RegExp(a+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+b,"g")});return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return!1;var d=this,e=this.getCachedRegex("render_section",function(a,b){return new RegExp("^([\\s\\S]*?)"+a+"(\\^|\\#)\\s*(.+)\\s*"+b+"\n*([\\s\\S]*?)"+a+"\\/\\s*\\3\\s*"+b+"\\s*([\\s\\S]*)$","g")});return a.replace(e,function(a,e,f,g,h,i){var j=e?d.render_tags(e,b,c,!0):"",k=i?d.render(i,b,c,!0):"",l,m=d.find(g,b);return f==="^"?!m||d.is_array(m)&&m.length===0?l=d.render(h,b,c,!0):l="":f==="#"&&(d.is_array(m)?l=d.map(m,function(a){return d.render(h,d.create_context(a),c,!0)}).join(""):d.is_object(m)?l=d.render(h,d.create_context(m),c,!0):typeof m=="function"?l=m.call(b,h,function(a){return d.render(a,b,c,!0)}):m?l=d.render(h,b,c,!0):l=""),j+l+k})},render_tags:function(a,b,c,d){var e=this,f=function(){return e.getCachedRegex("render_tags",function(a,b){return new RegExp(a+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+b+"+","g")})},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":return e.set_delimiters(h),g=f(),"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j<i.length;j++)i[j]=i[j].replace(g,h,this),d||this.send(i[j]);if(d)return i.join("\n")},set_delimiters:function(a){var b=a.split(" ");this.otag=this.escape_regex(b[0]),this.ctag=this.escape_regex(b[1])},escape_regex:function(a){if(!arguments.callee.sRE){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+b.join("|\\")+")","g")}return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){function c(a){return a===!1||a===0||a}a=this.trim(a);var d;return c(b[a])?d=b[a]:c(this.context[a])&&(d=this.context[a]),typeof d=="function"?d.apply(b):d!==undefined?d:""},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return a=String(a===null?"":a),a.replace(/&(?!\w+;)|["'<>\\]/g,function(a){switch(a){case"&":return"&";case'"':return""";case"'":return"'";case"<":return"<";case">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};return c[b]=a,c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e<d;e++)c.push(b(a[e]));return c},getCachedRegex:function(b,c){var d=a[this.otag];d||(d=a[this.otag]={});var e=d[this.ctag];e||(e=d[this.ctag]={});var f=e[b];return f||(f=e[b]=c(this.otag,this.ctag)),f}},{name:"mustache.js",version:"0.4.0-dev",to_html:function(a,c,d,e){var f=new b;e&&(f.send=e),f.render(a,c||{},d);if(!e)return f.buffer.join("\n")}}}();!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window),wax=wax||{},wax.attribution=function(){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var a,b={};return b.content=function(b){return typeof b=="undefined"?a.innerHTML:(a.innerHTML=html_sanitize(b,c,d),this)},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){function urlX(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function idX(a){return a}var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return html_sanitize(f(a,b),urlX,idX)}catch(c){console&&console.log(c)}},formatter},wax.gi=function(a,b){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}b=b||{};var c={},d=b.resolution||4,e=b.tileSize||256;return c.grid_tile=function(){return a},c.getKey=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>=e||Math.floor(b)>=e)return;return f(a.grid[Math.floor(c/d)].charCodeAt(Math.floor(b/d)))},c.gridFeature=function(b,c){var d=this.getKey(b,c),e=a.keys;if(e&&e[d]&&a.data[e[d]])return a.data[e[d]]},c.tileFeature=function(b,c,d){if(!a)return;var e=wax.u.offset(d);return feature=this.gridFeature(b-e.left,c-e.top),feature},c},wax.gm=function(){function f(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=new RegExp("/(\\d+)\\/(\\d+)\\/(\\d+)\\.[\\w\\._]+"),d=c.exec(b);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}var a=4,b={},c={},d,e=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return c.formatter=function(a){return arguments.length?(d=wax.formatter(a),c):d},c.template=function(a){return arguments.length?(d=wax.template(a),c):d},c.gridUrl=function(a){return arguments.length?(e=typeof a=="function"?a:f(a),c):e},c.getGrid=function(b,f){var g=e(b);return!d||!g?f(null,null):(wax.request.get(g,function(b,c){if(b)return f(b,null);f(null,wax.gi(c,d,{resolution:a||4}))}),c)},c.tilejson=function(a){return a.template?c.template(a.template):a.formatter&&c.formatter(a.formatter),a.grids&&c.gridUrl(a.grids),c},c},wax=wax||{},wax.hash=function(a){function b(){return location.hash.substring(1)}function c(a){location.hash="#"+a}function g(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(c)}function h(){var b=a.getCenterZoom();d!==b&&(d=b,c(d))}function i(a){if(a===d)return;g(d=a)&&h()}a=a||{};var d,e={},f=90-1e-8,j=wax.u.throttle(h,500);return e.add=function(){return i(b()),a.bindChange(j),this},e.remove=function(){return a.unbindChange(j),this},e.add()},wax=wax||{},wax.interaction=function(){function m(a){var b=h();for(var c=0;c<b.length;c++)if(b[c][0]<a.y&&b[c][0]+256>a.y&&b[c][1]<a.x&&b[c][1]+256>a.x)return b[c][2];return!1}function n(){return d?(window.clearTimeout(d),d=null,!0):!1}function o(d){if(c)return;var f=wax.u.eventoffset(d),g=m(f),h;g&&a.getGrid(g.src,function(c,j){if(c||!j)return;h=j.tileFeature(f.x,f.y,g),h?h&&e!==h?(e=h,bean.fire(b,"on",{parent:i(),data:h,formatter:a.formatter().format,e:d})):h||(e=null,bean.fire(b,"off")):(e=null,bean.fire(b,"off"))})}function p(a){if(n())return;c=!0,f=wax.u.eventoffset(a),a.type==="mousedown"?bean.add(document.body,"mouseup",r):a.type==="touchstart"&&a.touches.length===1&&(bean.fire(b,"off"),bean.add(i(),l))}function q(){bean.remove(i(),l),c=!1}function r(a){var b={},e=wax.u.eventoffset(a);c=!1;for(var h in a)b[h]=a[h];return bean.remove(document.body,"mouseup",r),bean.remove(i(),l),a.type==="touchend"?s(a,f):Math.round(e.y/g)===Math.round(f.y/g)&&Math.round(e.x/g)===Math.round(f.x/g)&&(d=window.setTimeout(function(){d=null,s(b,e)},300)),r}function s(c,d){var e=m(d);e&&a.getGrid(e.src,function(f,g){if(f||!g)return;var h=g.tileFeature(d.x,d.y,e);if(!h)return;bean.fire(b,"on",{parent:i(),data:h,formatter:a.formatter().format,e:c})})}var a=wax.gm(),b={},c=!1,d=!1,e,f,g=4,h,i,j,k={mousemove:o,touchstart:p,mousedown:p},l={touchend:r,touchmove:r,touchcancel:q};return b.attach=function(a){return arguments.length?(attach=a,b):attach},b.map=function(a){return arguments.length?(map=a,bean.add(i(),k),bean.add(i(),"touchstart",p),attach&&attach(map),b):map},b.grid=function(a){return arguments.length?(h=a,b):h},b.remove=function(){for(var a=0;a<clearingEvents.length;a++)map.removeCallback(clearingEvents[a],clearTileGrid);return bean.remove(i(),k),bean.fire(b,"remove"),b},b.tilejson=function(c){return arguments.length?(a.tilejson(c),b):tilejson},b.formatter=function(){return a.formatter()},b.on=function(a,c){return bean.add(b,a,c),b},b.off=function(a,c){return bean.remove(b,a,c),b},b.parent=function(a){return i=a,b},b};var wax=wax||{};wax.legend=function(){function d(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function e(a){return a}var a,b={},c;return b.element=function(){return c},b.content=function(c){return arguments.length?(c?(a.innerHTML=html_sanitize(c,d,e),a.style.display="block"):(a.innerHTML="",a.style.display="none"),b):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=c.appendChild(document.createElement("div")),a.className="wax-legend",a.style.display="none",b},b.add()};var wax=wax||{};wax.movetip={},wax.movetip=function(a){function g(a){return a&&a.className.indexOf("wax-popup")!==-1}function h(a,b){var c=document.createElement("div");return c.className="wax-movetip",c.style.cssText="position:absolute;",c.innerHTML=a,b.appendChild(c),d=b,_tooltipOffset=wax.util.offset(c),_contextOffset=wax.util.offset(d),c}function i(a){if(!c)return;var b=wax.util.eventoffset(a);c.className="wax-movetip",_tooltipOffset.height+b.y>_contextOffset.top+_contextOffset.height&&_contextOffset.height>_tooltipOffset.height&&(b.y-=_tooltipOffset.height,c.className+=" flip-y"),_tooltipOffset.width+b.x>_contextOffset.left+_contextOffset.width&&(b.x-=_tooltipOffset.width,c.className+=" flip-x"),c.style.left=b.x+"px",c.style.top=b.y+"px"}function j(a){if(!a)return;var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&e?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&e&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+e):a.parentNode&&a.parentNode.removeChild(a)}function k(a,b){c&&(j(c),c=undefined);var d=h(a,b);d.className+=" wax-popup",d.innerHTML=a;var e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close",d.appendChild(e);var f=function(a){return j(d),c=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),!1};e.addEventListener?e.addEventListener("click",f,!1) | ||
:e.attachEvent&&e.attachEvent("onclick",f),c=d}a=a||{};var b={},c=undefined,d=undefined,e=a.animationOut,f=a.animationIn;return b.over=function(a,b,d){if(!a)return;b.style.cursor="pointer";if(g(c))return;c=h(a,b),i(d),b.addEventListener&&b.addEventListener("mousemove",i)},b.out=function(a){a.style.cursor="default";if(g(c))return;c&&(j(c),a.removeEventListener&&a.removeEventListener("mousemove",i),c=undefined)},b};var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}},wax.template=function(a){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var b={};return b.format=function(b,e){var f={};for(var g in e)f[g]=e[g];return b.format&&(f["__"+b.format+"__"]=!0),html_sanitize(Mustache.to_html(a,f),c,d)},b};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(){function f(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function g(){function c(){this.parentNode&&this.parentNode.removeChild(this)}var a;document.body.style["-webkit-transition"]!==undefined?a="webkitTransitionEnd":document.body.style.MozTransition!==undefined&&(a="transitionend");var e;while(e=d.pop())b&&a?(bean.add(e,a,c),e.className+=" wax-fade"):e.parentNode&&e.parentNode.removeChild(e)}function h(b){var c;g();if((b.e.type==="mousemove"||!b.e.type)&&!a){c=b.formatter({format:"teaser"},b.data);if(!c)return;e.style.cursor="pointer",d.push(e.appendChild(f(c)))}else{c=b.formatter({format:"full"},b.data);if(!c)return;var h=e.appendChild(f(c));h.className+=" wax-popup";var i=h.appendChild(document.createElement("a"));i.href="#close",i.className="close",i.innerHTML="Close",a=!0,d.push(h),bean.add(i,"click touchend",function(b){b.stop(),g(),a=!1})}}function i(){e.style.cursor="default",a||g()}var a=!1,b=!1,c={},d=[],e;return c.parent=function(a){return arguments.length?(e=a,c):e},c.animate=function(a){return arguments.length?(b=a,c):b},c.events=function(){return{on:h,off:i}},c};var wax=wax||{};wax.u={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=document.body,e=0,f=0,g=function(a){if(a===d||a===document.documentElement)return;e+=a.offsetTop,f+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");e+=parseInt(c[13],10),f+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10)};g(a);try{while(a=a.offsetParent)g(a)}catch(h){}e+=d.offsetTop,f+=d.offsetLeft,e+=d.parentNode.offsetTop,f+=d.parentNode.offsetLeft;var i=document.defaultView?window.getComputedStyle(d.parentNode,null):d.parentNode.currentStyle;return d.parentNode.offsetTop!==parseInt(i.marginTop,10)&&!isNaN(parseInt(i.marginTop,10))&&(e+=parseInt(i.marginTop,10),f+=parseInt(i.marginLeft,10)),{top:e,left:f,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;a||(a=window.event);if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}},limit:function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}},throttle:function(a,b){return this.limit(a,b,!1)}};var wax=wax||{};wax.p=wax.p||{},wax.p.connector=function(a){var b=org.polymaps;if(a.scheme==="tms")throw new Error("Wax only supports XYZ TileJSON urls.");return b.image().url(a.tiles[0].replace(/\{\w\}/g,function(a){return a.toUpperCase()}))} | ||
/* wax - 6.0.0-beta2 - 1.0.4-526-g3351932 */!function(a,b,c){typeof module!="undefined"?module.exports=c(a,b):typeof define=="function"&&typeof define.amd=="object"?define(c):b[a]=c(a,b)}("bean",this,function(a,b){var c=window,d=b[a],e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=Array.prototype.slice,q=/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,r=/mouse.*(wheel|scroll)/i,s=/^text/i,t=/^touch|^gesture/i,u={one:1},v=function(a,b,c){for(c=0;c<b.length;c++)a[b[c]]=1;return a}({},("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(n?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),w=function(){function a(a,b){while((b=b.parentNode)!==null)if(b===a)return!0;return!1}function b(b){var c=b.relatedTarget;return c?c!==this&&c.prefix!=="xul"&&!/document/.test(this.toString())&&!a(this,c):c===null}return{mouseenter:{base:"mouseover",condition:b},mouseleave:{base:"mouseout",condition:b},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),x=function(){var a="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),b=a.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),c=b.concat("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis".split(" ")),d=a.concat("char charCode key keyCode keyIdentifier keyLocation".split(" ")),f=a.concat(["data"]),g=a.concat("touches targetTouches changedTouches scale rotation".split(" ")),h="preventDefault",i=function(a){return function(){a[h]?a[h]():a.returnValue=!1}},j="stopPropagation",k=function(a){return function(){a[j]?a[j]():a.cancelBubble=!0}},n=function(a){return function(){a[h](),a[j](),a.stopped=!0}},o=function(a,b,c){var d,e;for(d=c.length;d--;)e=c[d],!(e in b)&&e in a&&(b[e]=a[e])};return function(p,u){var v={originalEvent:p,isNative:u};if(!p)return v;var w,x=p.type,y=p.target||p.srcElement;v[h]=i(p),v[j]=k(p),v.stop=n(v),v.target=y&&y.nodeType===3?y.parentNode:y;if(u){if(x.indexOf("key")!==-1)w=d,v.keyCode=p.which||p.keyCode;else if(q.test(x)){w=b,v.rightClick=p.which===3||p.button===2,v.pos={x:0,y:0};if(p.pageX||p.pageY)v.clientX=p.pageX,v.clientY=p.pageY;else if(p.clientX||p.clientY)v.clientX=p.clientX+l.body.scrollLeft+m.scrollLeft,v.clientY=p.clientY+l.body.scrollTop+m.scrollTop;e.test(x)&&(v.relatedTarget=p.relatedTarget||p[(x==="mouseover"?"from":"to")+"Element"])}else t.test(x)?w=g:r.test(x)?w=c:s.test(x)&&(w=f);o(p,v,w||a)}return v}}(),y=function(a,b){return!n&&!b&&(a===l||a===c)?m:a},z=function(){function a(a,b,c,d,e){this.element=a,this.type=b,this.handler=c,this.original=d,this.namespaces=e,this.custom=w[b],this.isNative=v[b]&&a[o],this.eventType=n||this.isNative?b:"propertychange",this.customType=!n&&!this.isNative&&b,this.target=y(a,this.isNative),this.eventSupport=this.target[o]}return a.prototype={inNamespaces:function(a){var b,c;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)if(a[b]===this.namespaces[c])return!0;return!1},matches:function(a,b,c){return this.element===a&&(!b||this.original===b)&&(!c||this.handler===c)}},a}(),A=function(){var a={},b=function(c,d,e,f,g){if(!d||d==="*")for(var h in a)h.charAt(0)==="$"&&b(c,h.substr(1),e,f,g);else{var i=0,j,k=a["$"+d],l=c==="*";if(!k)return;for(j=k.length;i<j;i++)if(l||k[i].matches(c,e,f))if(!g(k[i],k,i,d))return}},c=function(b,c,d){var e,f=a["$"+c];if(f)for(e=f.length;e--;)if(f[e].matches(b,d,null))return!0;return!1},d=function(a,c,d){var e=[];return b(a,c,d,null,function(a){return e.push(a)}),e},e=function(b){return(a["$"+b.type]||(a["$"+b.type]=[])).push(b),b},f=function(c){b(c.element,c.type,null,c.handler,function(b,c,d){return c.splice(d,1),c.length===0&&delete a["$"+b.type],!1})},g=function(){var b,c=[];for(b in a)b.charAt(0)==="$"&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),B=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},C=function(a,b,d){return function(e){return e=x(e||((this.ownerDocument||this.document||this).parentWindow||c).event,!0),b.apply(a,[e].concat(d))}},D=function(a,b,d,e,f,g){return function(h){if(e?e.apply(this,arguments):n?!0:h&&h.propertyName==="_on"+d||!h)h&&(h=x(h||((this.ownerDocument||this.document||this).parentWindow||c).event,g)),b.apply(a,h&&(!f||f.length===0)?arguments:p.call(arguments,h?0:1).concat(f))}},E=function(a,b,c,d,e){return function(){a(b,c,e),d.apply(this,arguments)}},F=function(a,b,c,d){var e,f,h,i=b&&b.replace(g,""),j=A.get(a,i,c);for(e=0,f=j.length;e<f;e++)j[e].inNamespaces(d)&&((h=j[e]).eventSupport&&B(h.target,h.eventType,h.handler,!1,h.type),A.del(h))},G=function(a,b,c,d,e){var h,i=b.replace(g,""),j=b.replace(f,"").split(".");if(A.has(a,i,c))return a;i==="unload"&&(c=E(F,a,i,c,d)),w[i]&&(w[i].condition&&(c=D(a,c,i,w[i].condition,!0)),i=w[i].base||i),h=A.put(new z(a,i,c,d,j[0]&&j)),h.handler=h.isNative?C(a,h.handler,e):D(a,h.handler,i,!1,e,!1),h.eventSupport&&B(h.target,h.eventType,h.handler,!0,h.customType)},H=function(a,b,c){return function(d){var e,f,g=typeof a=="string"?c(a,this):a;for(e=d.target;e&&e!==this;e=e.parentNode)for(f=g.length;f--;)if(g[f]===e)return b.apply(e,arguments)}},I=function(a,b,c){var d,e,h,i,j,k=F,l=b&&typeof b=="string";if(l&&b.indexOf(" ")>0){b=b.split(" ");for(j=b.length;j--;)I(a,b[j],c);return a}h=l&&b.replace(g,""),h&&w[h]&&(h=w[h].type);if(!b||l){if(i=l&&b.replace(f,""))i=i.split(".");k(a,h,c,i)}else if(typeof b=="function")k(a,null,b);else for(d in b)b.hasOwnProperty(d)&&I(a,d,b[d]);return a},J=function(a,b,c,d,e){var f,g,h,i,j=c,k=c&&typeof c=="string";if(b&&!c&&typeof b=="object")for(f in b)b.hasOwnProperty(f)&&J.apply(this,[a,f,b[f]]);else{i=arguments.length>3?p.call(arguments,3):[],g=(k?c:b).split(" "),k&&(c=H(b,j=d,e))&&(i=p.call(i,1)),this===u&&(c=E(I,a,b,c,j));for(h=g.length;h--;)G(a,g[h],c,j,i)}return a},K=function(){return J.apply(u,arguments)},L=n?function(a,b,d){var e=l.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=y(c,a),a?c.fireEvent("on"+b,l.createEventObject()):c["_on"+b]++},M=function(a,b,c){var d,e,h,i,j,k=b.split(" ");for(d=k.length;d--;){b=k[d].replace(g,"");if(i=k[d].replace(f,""))i=i.split(".");if(!i&&!c&&a[o])L(v[b],b,a);else{j=A.get(a,b),c=[!1].concat(c);for(e=0,h=j.length;e<h;e++)j[e].inNamespaces(i)&&j[e].handler.apply(a,c)}}return a},N=function(a,b,c){var d=0,e=A.get(b,c),f=e.length;for(;d<f;d++)e[d].original&&J(a,e[d].type,e[d].original);return a},O={add:J,one:K,remove:I,clone:N,fire:M,noConflict:function(){return b[a]=d,this}};if(c[i]){var P=function(){var a,b=A.entries();for(a in b)b[a].type&&b[a].type!=="unload"&&I(b[a].element,b[a].type);c[k]("onunload",P),c.CollectGarbage&&c.CollectGarbage()};c[i]("onunload",P)}return O});var html4={};html4.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10},html4.ATTRIBS={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0},html4.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128},html4.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:4,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,nobr:0,noembed:4,noframes:20,noscript:20,object:16,ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:84,select:0,small:0,span:0,strike:0,strong:0,style:148,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},html4.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},html4.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"body::background":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0},html4.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},html4.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"body::background":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2};var html=function(a){function g(a){a=b(a);if(c.hasOwnProperty(a))return c[a];var d=a.match(e);return d?String.fromCharCode(parseInt(d[1],10)):(d=a.match(f))?String.fromCharCode(parseInt(d[1],16)):""}function h(a,b){return g(b)}function j(a){return a.replace(i,"")}function l(a){return a.replace(k,h)}function s(a){return a.replace(m,"&").replace(o,"<").replace(p,">").replace(q,""").replace(r,"=")}function t(a){return a.replace(n,"&$1").replace(o,"<").replace(p,">")}function w(c){return function d(d,e){d=String(d);var f=null,g=!1,h=[],i=void 0,k=void 0,m=void 0;c.startDoc&&c.startDoc(e);while(d){var n=d.match(g?u:v);d=d.substring(n[0].length);if(g){if(n[1]){var o=b(n[1]),p;if(n[2]){var q=n[3];switch(q.charCodeAt(0)){case 34:case 39:q=q.substring(1,q.length-1)}p=l(j(q))}else p=o;h.push(o,p)}else if(n[4]){k!==void 0&&(m?c.startTag&&c.startTag(i,h,e):c.endTag&&c.endTag(i,e));if(m&&k&(a.eflags.CDATA|a.eflags.RCDATA)){f===null?f=b(d):f=f.substring(f.length-d.length);var r=f.indexOf("</"+i);r<0&&(r=d.length),r&&(k&a.eflags.CDATA?c.cdata&&c.cdata(d.substring(0,r),e):c.rcdata&&c.rcdata(t(d.substring(0,r)),e),d=d.substring(r))}i=k=m=void 0,h.length=0,g=!1}}else if(n[1])c.pcdata&&c.pcdata(n[0],e);else if(n[3])m=!n[2],g=!0,i=b(n[3]),k=a.ELEMENTS.hasOwnProperty(i)?a.ELEMENTS[i]:void 0;else if(n[4])c.pcdata&&c.pcdata(n[4],e);else if(n[5]&&c.pcdata){var s=n[5];c.pcdata(s==="<"?"<":s===">"?">":"&",e)}}c.endDoc&&c.endDoc(e)}}function x(b){var c,d;return w({startDoc:function(a){c=[],d=!1},startTag:function(e,f,g){if(d)return;if(!a.ELEMENTS.hasOwnProperty(e))return;var h=a.ELEMENTS[e];if(h&a.eflags.FOLDABLE)return;if(h&a.eflags.UNSAFE){d=!(h&a.eflags.EMPTY);return}f=b(e,f);if(f){h&a.eflags.EMPTY||c.push(e),g.push("<",e);for(var i=0,j=f.length;i<j;i+=2){var k=f[i],l=f[i+1];l!==null&&l!==void 0&&g.push(" ",k,'="',s(l),'"')}g.push(">")}},endTag:function(b,e){if(d){d=!1;return}if(!a.ELEMENTS.hasOwnProperty(b))return;var f=a.ELEMENTS[b];if(!(f&(a.eflags.UNSAFE|a.eflags.EMPTY|a.eflags.FOLDABLE))){var g;if(f&a.eflags.OPTIONAL_ENDTAG)for(g=c.length;--g>=0;){var h=c[g];if(h===b)break;if(!(a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG))return}else for(g=c.length;--g>=0;)if(c[g]===b)break;if(g<0)return;for(var i=c.length;--i>g;){var h=c[i];a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG||e.push("</",h,">")}c.length=g,e.push("</",b,">")}},pcdata:function(a,b){d||b.push(a)},rcdata:function(a,b){d||b.push(a)},cdata:function(a,b){d||b.push(a)},endDoc:function(a){for(var b=c.length;--b>=0;)a.push("</",c[b],">");c.length=0}})}function z(b,c,e){var f=[];return x(function g(b,f){for(var g=0;g<f.length;g+=2){var h=f[g],i=f[g+1],j=null,k;if((k=b+"::"+h,a.ATTRIBS.hasOwnProperty(k))||(k="*::"+h,a.ATTRIBS.hasOwnProperty(k)))j=a.ATTRIBS[k];if(j!==null)switch(j){case a.atype.NONE:break;case a.atype.SCRIPT:case a.atype.STYLE:i=null;break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:i=e?e(i):i;break;case a.atype.URI:var l=(""+i).match(y);l?!l[1]||d.test(l[1])?i=c&&c(i):i=null:i=null;break;case a.atype.URI_FRAGMENT:i&&"#"===i.charAt(0)?(i=e?e(i):i,i&&(i="#"+i)):i=null;break;default:i=null}else i=null;f[g+1]=i}return f})(b,f),f.join("")}var b;"script"==="SCRIPT".toLowerCase()?b=function(a){return a.toLowerCase()}:b=function(a){return a.replace(/[A-Z]/g,function(a){return String.fromCharCode(a.charCodeAt(0)|32)})};var c={lt:"<",gt:">",amp:"&",nbsp:" ",quot:'"',apos:"'"},d=/^(?:https?|mailto|data)$/i,e=/^#(\d+)$/,f=/^#x([0-9A-Fa-f]+)$/,i=/\0/g,k=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,m=/&/g,n=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,o=/</g,p=/>/g,q=/\"/g,r=/\=/g,u=new RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[\\s\\S][^a-z\\s>]*)","i"),v=new RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<!--[\\s\\S]*?-->|<!\\w[^>]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i"),y=new RegExp("^(?:([^:/?#]+):)?");return{escapeAttrib:s,makeHtmlSanitizer:x,makeSaxParser:w,normalizeRCData:t,sanitize:z,unescapeEntities:l}}(html4),html_sanitize=html.sanitize;typeof window!="undefined"&&(window.html=html,window.html_sanitize=html_sanitize),html4.ATTRIBS["*::style"]=0,html4.ELEMENTS.style=0;var Mustache=function(){var a={},b=function(){};return b.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a);return}a=this.render_pragmas(a);var e=this.render_section(a,b,c);e===!1&&(e=this.render_tags(a,b,c,d));if(d)return e;this.sendLines(e)},send:function(a){a!==""&&this.buffer.push(a)},sendLines:function(a){if(a){var b=a.split("\n");for(var c=0;c<b.length;c++)this.send(b[c])}},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=this.getCachedRegex("render_pragmas",function(a,b){return new RegExp(a+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+b,"g")});return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return!1;var d=this,e=this.getCachedRegex("render_section",function(a,b){return new RegExp("^([\\s\\S]*?)"+a+"(\\^|\\#)\\s*(.+)\\s*"+b+"\n*([\\s\\S]*?)"+a+"\\/\\s*\\3\\s*"+b+"\\s*([\\s\\S]*)$","g")});return a.replace(e,function(a,e,f,g,h,i){var j=e?d.render_tags(e,b,c,!0):"",k=i?d.render(i,b,c,!0):"",l,m=d.find(g,b);return f==="^"?!m||d.is_array(m)&&m.length===0?l=d.render(h,b,c,!0):l="":f==="#"&&(d.is_array(m)?l=d.map(m,function(a){return d.render(h,d.create_context(a),c,!0)}).join(""):d.is_object(m)?l=d.render(h,d.create_context(m),c,!0):typeof m=="function"?l=m.call(b,h,function(a){return d.render(a,b,c,!0)}):m?l=d.render(h,b,c,!0):l=""),j+l+k})},render_tags:function(a,b,c,d){var e=this,f=function(){return e.getCachedRegex("render_tags",function(a,b){return new RegExp(a+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+b+"+","g")})},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":return e.set_delimiters(h),g=f(),"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j<i.length;j++)i[j]=i[j].replace(g,h,this),d||this.send(i[j]);if(d)return i.join("\n")},set_delimiters:function(a){var b=a.split(" ");this.otag=this.escape_regex(b[0]),this.ctag=this.escape_regex(b[1])},escape_regex:function(a){if(!arguments.callee.sRE){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+b.join("|\\")+")","g")}return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){function c(a){return a===!1||a===0||a}a=this.trim(a);var d;return c(b[a])?d=b[a]:c(this.context[a])&&(d=this.context[a]),typeof d=="function"?d.apply(b):d!==undefined?d:""},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return a=String(a===null?"":a),a.replace(/&(?!\w+;)|["'<>\\]/g,function(a){switch(a){case"&":return"&";case'"':return""";case"'":return"'";case"<":return"<";case">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};return c[b]=a,c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e<d;e++)c.push(b(a[e]));return c},getCachedRegex:function(b,c){var d=a[this.otag];d||(d=a[this.otag]={});var e=d[this.ctag];e||(e=d[this.ctag]={});var f=e[b];return f||(f=e[b]=c(this.otag,this.ctag)),f}},{name:"mustache.js",version:"0.4.0-dev",to_html:function(a,c,d,e){var f=new b;e&&(f.send=e),f.render(a,c||{},d);if(!e)return f.buffer.join("\n")}}}();!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window),wax=wax||{},wax.attribution=function(){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var a,b={};return b.content=function(b){return typeof b=="undefined"?a.innerHTML:(a.innerHTML=html_sanitize(b,c,d),this)},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){function urlX(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function idX(a){return a}var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return html_sanitize(f(a,b),urlX,idX)}catch(c){console&&console.log(c)}},formatter},wax.gi=function(a,b){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}b=b||{};var c={},d=b.resolution||4,e=b.tileSize||256;return c.grid_tile=function(){return a},c.getKey=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>=e||Math.floor(b)>=e)return;return f(a.grid[Math.floor(c/d)].charCodeAt(Math.floor(b/d)))},c.gridFeature=function(b,c){var d=this.getKey(b,c),e=a.keys;if(e&&e[d]&&a.data[e[d]])return a.data[e[d]]},c.tileFeature=function(b,c,d){if(!a)return;var e=wax.u.offset(d);return feature=this.gridFeature(b-e.left,c-e.top),feature},c},wax.gm=function(){function f(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=new RegExp("/(\\d+)\\/(\\d+)\\/(\\d+)\\.[\\w\\._]+"),d=c.exec(b);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}var a=4,b={},c={},d,e=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return c.formatter=function(a){return arguments.length?(d=wax.formatter(a),c):d},c.template=function(a){return arguments.length?(d=wax.template(a),c):d},c.gridUrl=function(a){return arguments.length?(e=typeof a=="function"?a:f(a),c):e},c.getGrid=function(b,f){var g=e(b);return!d||!g?f(null,null):(wax.request.get(g,function(b,c){if(b)return f(b,null);f(null,wax.gi(c,d,{resolution:a||4}))}),c)},c.tilejson=function(a){return a.template?c.template(a.template):a.formatter&&c.formatter(a.formatter),a.grids&&c.gridUrl(a.grids),c},c},wax=wax||{},wax.hash=function(a){function b(){return location.hash.substring(1)}function c(a){location.hash="#"+a}function g(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(c)}function h(){var b=a.getCenterZoom();d!==b&&(d=b,c(d))}function i(a){if(a===d)return;g(d=a)&&h()}a=a||{};var d,e={},f=90-1e-8,j=wax.u.throttle(h,500);return e.add=function(){return i(b()),a.bindChange(j),this},e.remove=function(){return a.unbindChange(j),this},e.add()},wax=wax||{},wax.interaction=function(){function l(a){var b=g();for(var c=0;c<b.length;c++)if(b[c][0]<a.y&&b[c][0]+256>a.y&&b[c][1]<a.x&&b[c][1]+256>a.x)return b[c][2];return!1}function m(){return d?(window.clearTimeout(d),d=null,!0):!1}function n(d){if(c)return;var e=wax.u.eventoffset(d),f=l(e),g;f&&a.getGrid(f.src,function(c,i){if(c||!i)return;g=i.tileFeature(e.x,e.y,f),g?bean.fire(b,"on",{parent:h(),data:g,formatter:a.formatter().format,e:d}):bean.fire(b,"off")})}function o(a){if(m())return;c=!0,e=wax.u.eventoffset(a),a.type==="mousedown"?bean.add(document.body,"mouseup",q):a.type==="touchstart"&&a.touches.length===1&&(bean.fire(b,"off"),bean.add(h(),k))}function p(){bean.remove(h(),k),c=!1}function q(a){var b={},g=wax.u.eventoffset(a);c=!1;for(var i in a)b[i]=a[i];return bean.remove(document.body,"mouseup",q),bean.remove(h(),k),a.type==="touchend"?r(a,e):Math.round(g.y/f)===Math.round(e.y/f)&&Math.round(g.x/f)===Math.round(e.x/f)&&(d=window.setTimeout(function(){d=null,r(b,g)},300)),q}function r(c,d){var e=l(d);e&&a.getGrid(e.src,function(f,g){if(f||!g)return;var i=g.tileFeature(d.x,d.y,e);if(!i)return;bean.fire(b,"on",{parent:h(),data:i,formatter:a.formatter().format,e:c})})}var a=wax.gm(),b={},c=!1,d=!1,e,f=4,g,h,i,j={mousemove:n,touchstart:o,mousedown:o},k={touchend:q,touchmove:q,touchcancel:p};return b.attach=function(a){return arguments.length?(attach=a,b):attach},b.map=function(a){return arguments.length?(map=a,bean.add(h(),j),bean.add(h(),"touchstart",o),attach&&attach(map),b):map},b.grid=function(a){return arguments.length?(g=a,b):g},b.remove=function(){for(var a=0;a<clearingEvents.length;a++)map.removeCallback(clearingEvents[a],clearTileGrid);return bean.remove(h(),j),bean.fire(b,"remove"),b},b.tilejson=function(c){return arguments.length?(a.tilejson(c),b):tilejson},b.formatter=function(){return a.formatter()},b.on=function(a,c){return bean.add(b,a,c),b},b.off=function(a,c){return bean.remove(b,a,c),b},b.parent=function(a){return h=a,b},b};var wax=wax||{};wax.legend=function(){function d(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function e(a){return a}var a,b={},c;return b.element=function(){return c},b.content=function(c){return arguments.length?(c?(a.innerHTML=html_sanitize(c,d,e),a.style.display="block"):(a.innerHTML="",a.style.display="none"),b):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=c.appendChild(document.createElement("div")),a.className="wax-legend",a.style.display="none",b},b.add()};var wax=wax||{};wax.movetip={},wax.movetip=function(){function g(a){var b=wax.u.eventoffset(a);c.height+b.y>d.top+d.height&&d.height>c.height&&(b.y-=c.height,e.className+=" flip-y"),c.width+b.x>d.left+d.width&&(b.x-=c.width,e.className+=" flip-x"),e.style.left=b.x+"px",e.style.top=b.y+"px"}function h(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function i(){e&&(e.parentNode.removeChild(e),e=null)}function j(b){var j;if(a)return;if(b.e.type==="mousemove"||!b.e.type){j=b.formatter({format:"teaser"},b.data);if(!j)return;i(),f.style.cursor="pointer",e=document.body.appendChild(h(j))}else{j=b.formatter({format:"teaser"},b.data);if(!j)return;i();var k=document.body.appendChild(h(j));k.className+=" wax-popup";var l=k.appendChild(document.createElement("a"));l.href="#close",l.className="close",l.innerHTML="Close",a=!0,e=k,c=wax.u.offset(e),d=wax.u.offset(f),g(b.e),bean.add(l,"click touchend",function(b){b.stop(),i(),a=!1})}e&&(c=wax.u.offset(e),d=wax.u.offset(f),g(b.e))}function k(){f.style.cursor="default",a||i()}var a=!1,b={},c,d,e,f;return b.parent=function(a){return arguments.length?(f=a,b):f},b.events=function(){return{on:j,off:k}},b};var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success | ||
:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}},wax.template=function(a){function c(a){if(/^(https?:\/\/|data:image)/.test(a))return a}function d(a){return a}var b={};return b.format=function(b,e){var f={};for(var g in e)f[g]=e[g];return b.format&&(f["__"+b.format+"__"]=!0),html_sanitize(Mustache.to_html(a,f),c,d)},b};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+(~a.indexOf("?")?"&":"?")+"callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(){function h(a){var b=document.createElement("div");return b.className="wax-tooltip wax-tooltip-0",b.innerHTML=a,b}function i(){this.parentNode&&this.parentNode.removeChild(this)}function j(){var a;while(a=d.pop())b&&f?(bean.add(a,f,i),a.className+=" wax-fade"):a.parentNode&&a.parentNode.removeChild(a)}function k(b){var c;if((b.e.type==="mousemove"||!b.e.type)&&!a){c=b.formatter({format:"teaser"},b.data);if(!c||c==e)return;j(),g.style.cursor="pointer",d.push(g.appendChild(h(c))),e=c}else{c=b.formatter({format:"full"},b.data);if(!c)return;j(),g.style.cursor="pointer";var f=g.appendChild(h(c));f.className+=" wax-popup";var i=f.appendChild(document.createElement("a"));i.href="#close",i.className="close",i.innerHTML="Close",a=!0,d.push(f),bean.add(i,"click touchend",function(b){b.stop(),j(),a=!1})}}function l(){g.style.cursor="default",e=null,a||j()}var a=!1,b=!1,c={},d=[],e,f,g;return document.body.style["-webkit-transition"]!==undefined?f="webkitTransitionEnd":document.body.style.MozTransition!==undefined&&(f="transitionend"),c.parent=function(a){return arguments.length?(g=a,c):g},c.animate=function(a){return arguments.length?(b=a,c):b},c.events=function(){return{on:k,off:l}},c};var wax=wax||{};wax.u={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=document.body,e=0,f=0,g=function(a){if(a===d||a===document.documentElement)return;e+=a.offsetTop,f+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");e+=parseInt(c[13],10),f+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))e+=parseInt(match[2],10),f+=parseInt(match[1],10)};g(a);try{while(a=a.offsetParent)g(a)}catch(h){}e+=d.offsetTop,f+=d.offsetLeft,e+=d.parentNode.offsetTop,f+=d.parentNode.offsetLeft;var i=document.defaultView?window.getComputedStyle(d.parentNode,null):d.parentNode.currentStyle;return d.parentNode.offsetTop!==parseInt(i.marginTop,10)&&!isNaN(parseInt(i.marginTop,10))&&(e+=parseInt(i.marginTop,10),f+=parseInt(i.marginLeft,10)),{top:e,left:f,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;a||(a=window.event);if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}},limit:function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}},throttle:function(a,b){return this.limit(a,b,!1)}};var wax=wax||{};wax.p=wax.p||{},wax.p.connector=function(a){var b=org.polymaps;if(a.scheme==="tms")throw new Error("Wax only supports XYZ TileJSON urls.");return b.image().url(a.tiles[0].replace(/\{\w\}/g,function(a){return a.toUpperCase()}))} |
{ | ||
"name": "wax", | ||
"version": "6.0.0-beta1", | ||
"version": "6.0.0-beta2", | ||
"description": "Tools for improving web maps.", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
155
3764836
39334