text: !function(t,e){t.Bokeh=e()}(this,function(){var t;return function(t,e,n){var i={},r=function(n){var o=null!=e[n]?e[n]:n;if(!i[o]){if(!t[o]){var s=new Error("Cannot find module '"+n+"'");throw s.code="MODULE_NOT_FOUND",s}var a=i[o]={exports:{}};t[o].call(a.exports,r,a,a.exports)}return i[o].exports},o=r(n);return o.require=r,o.register_plugin=function(n,i,s){for(var a in n)t[a]=n[a];for(var a in i)e[a]=i[a];var l=r(s);for(var a in l)o[a]=l[a];return l},o}([function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(135),r=t(30);n.overrides={};var o=r.clone(i);n.Models=function(t){var e=n.overrides[t]||o[t];if(null==e)throw new Error("Model '"+t+"' does not exist. This could be due to a widget\n                     or a custom model not being registered before first usage.");return e},n.Models.register=function(t,e){n.overrides[t]=e},n.Models.unregister=function(t){delete n.overrides[t]},n.Models.register_models=function(t,e,n){if(void 0===e&&(e=!1),null!=t)for(var i in t){var r=t[i];e||!o.hasOwnProperty(i)?o[i]=r:null!=n?n(i):console.warn("Model '"+i+"' was already registered")}},n.register_models=n.Models.register_models,n.Models.registered_names=function(){return Object.keys(o)},n.index={}},function(t,e,n){"use strict";function i(t,e,n){var i,s=new r.Promise(function(r,s){return i=new c(t,e,n,function(t){try{r(t)}catch(e){throw o.logger.error("Promise handler threw an error, closing session "+e),t.close(),e}},function(){s(new Error("Connection was closed before we successfully pulled a session"))}),i.connect().then(function(t){},function(t){throw o.logger.error("Failed to connect to Bokeh server "+t),t})});return s}Object.defineProperty(n,"__esModule",{value:!0});var r=t(302),o=t(14),s=t(47),a=t(245),l=t(246),u=t(2);n.DEFAULT_SERVER_WEBSOCKET_URL="ws://localhost:5006/ws",n.DEFAULT_SESSION_ID="default";var h=0,c=function(){function t(t,e,i,r,s){void 0===t&&(t=n.DEFAULT_SERVER_WEBSOCKET_URL),void 0===e&&(e=n.DEFAULT_SESSION_ID),void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=null),this.url=t,this.id=e,this.args_string=i,this._on_have_session_hook=r,this._on_closed_permanently_hook=s,this._number=h++,this.socket=null,this.session=null,this.closed_permanently=!1,this._current_handler=null,this._pending_ack=null,this._pending_replies={},this._receiver=new l.Receiver,o.logger.debug("Creating websocket "+this._number+" to '"+this.url+"' session '"+this.id+"'")}return t.prototype.connect=function(){var t=this;if(this.closed_permanently)return r.Promise.reject(new Error("Cannot connect() a closed ClientConnection"));if(null!=this.socket)return r.Promise.reject(new Error("Already connected"));this._pending_replies={},this._current_handler=null;try{var e=this.url+"?bokeh-protocol-version=1.0&bokeh-session-id="+this.id;return null!=this.args_string&&this.args_string.length>0&&(e+="&"+this.args_string),this.socket=new WebSocket(e),new r.Promise(function(e,n){t.socket.binaryType="arraybuffer",t.socket.onopen=function(){return t._on_open(e,n)},t.socket.onmessage=function(e){return t._on_message(e)},t.socket.onclose=function(e){return t._on_close(e)},t.socket.onerror=function(){return t._on_error(n)}})}catch(n){return o.logger.error("websocket creation failed to url: "+this.url),o.logger.error(" - "+n),r.Promise.reject(n)}},t.prototype.close=function(){this.closed_permanently||(o.logger.debug("Permanently closing websocket connection "+this._number),this.closed_permanently=!0,null!=this.socket&&this.socket.close(1e3,"close method called on ClientConnection "+this._number),this.session._connection_closed(),null!=this._on_closed_permanently_hook&&(this._on_closed_permanently_hook(),this._on_closed_permanently_hook=null))},t.prototype._schedule_reconnect=function(t){var e=this,n=function(){e.closed_permanently||o.logger.info("Websocket connection "+e._number+" disconnected, will not attempt to reconnect")};setTimeout(n,t)},t.prototype.send=function(t){if(null==this.socket)throw new Error("not connected so cannot send "+t);t.send(this.socket)},t.prototype.send_with_reply=function(t){var e=this,n=new r.Promise(function(n,i){e._pending_replies[t.msgid()]=[n,i],e.send(t)});return n.then(function(t){if("ERROR"===t.msgtype())throw new Error("Error reply "+t.content.text);return t},function(t){throw t})},t.prototype._pull_doc_json=function(){var t=a.Message.create("PULL-DOC-REQ",{}),e=this.send_with_reply(t);return e.then(function(t){if(!("doc"in t.content))throw new Error("No 'doc' field in PULL-DOC-REPLY");return t.content.doc},function(t){throw t})},t.prototype._repull_session_doc=function(){var t=this;null==this.session?o.logger.debug("Pulling session for first time"):o.logger.debug("Repulling session"),this._pull_doc_json().then(function(e){if(null==t.session)if(t.closed_permanently)o.logger.debug("Got new document after connection was already closed");else{var n=s.Document.from_json(e),i=s.Document._compute_patch_since_json(e,n);if(i.events.length>0){o.logger.debug("Sending "+i.events.length+" changes from model construction back to server");var r=a.Message.create("PATCH-DOC",{},i);t.send(r)}t.session=new u.ClientSession(t,n,t.id),o.logger.debug("Created a new session from new pulled doc"),null!=t._on_have_session_hook&&(t._on_have_session_hook(t.session),t._on_have_session_hook=null)}else t.session.document.replace_with_json(e),o.logger.debug("Updated existing session with new pulled doc")},function(t){throw t})["catch"](function(t){null!=console.trace&&console.trace(t),o.logger.error("Failed to repull session "+t)})},t.prototype._on_open=function(t,e){var n=this;o.logger.info("Websocket connection "+this._number+" is now open"),this._pending_ack=[t,e],this._current_handler=function(t){n._awaiting_ack_handler(t)}},t.prototype._on_message=function(t){null==this._current_handler&&o.logger.error("Got a message with no current handler set");try{this._receiver.consume(t.data)}catch(e){this._close_bad_protocol(e.toString())}if(null!=this._receiver.message){var n=this._receiver.message,i=n.problem();null!=i&&this._close_bad_protocol(i),this._current_handler(n)}},t.prototype._on_close=function(t){var e=this;o.logger.info("Lost websocket "+this._number+" connection, "+t.code+" ("+t.reason+")"),this.socket=null,null!=this._pending_ack&&(this._pending_ack[1](new Error("Lost websocket connection, "+t.code+" ("+t.reason+")")),this._pending_ack=null);for(var n=function(){for(var t in e._pending_replies){var n=e._pending_replies[t];return delete e._pending_replies[t],n}return null},i=n();null!=i;)i[1]("Disconnected"),i=n();this.closed_permanently||this._schedule_reconnect(2e3)},t.prototype._on_error=function(t){o.logger.debug("Websocket error on socket "+this._number),t(new Error("Could not open websocket"))},t.prototype._close_bad_protocol=function(t){o.logger.error("Closing connection: "+t),null!=this.socket&&this.socket.close(1002,t)},t.prototype._awaiting_ack_handler=function(t){var e=this;"ACK"===t.msgtype()?(this._current_handler=function(t){return e._steady_state_handler(t)},this._repull_session_doc(),null!=this._pending_ack&&(this._pending_ack[0](this),this._pending_ack=null)):this._close_bad_protocol("First message was not an ACK")},t.prototype._steady_state_handler=function(t){if(t.reqid()in this._pending_replies){var e=this._pending_replies[t.reqid()];delete this._pending_replies[t.reqid()],e[0](t)}else this.session.handle(t)},t}();n.ClientConnection=c,n.pull_session=i},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(14),r=t(47),o=t(245),s=function(){function t(t,e,n){var i=this;this._connection=t,this.document=e,this.id=n,this._document_listener=function(t){return i._document_changed(t)},this.document.on_change(this._document_listener),this.event_manager=this.document.event_manager,this.event_manager.session=this}return t.prototype.handle=function(t){var e=t.msgtype();"PATCH-DOC"===e?this._handle_patch(t):"OK"===e?this._handle_ok(t):"ERROR"===e?this._handle_error(t):i.logger.debug("Doing nothing with message "+t.msgtype())},t.prototype.close=function(){this._connection.close()},t.prototype.send_event=function(t){var e=o.Message.create("EVENT",{},JSON.stringify(t));this._connection.send(e)},t.prototype._connection_closed=function(){this.document.remove_on_change(this._document_listener)},t.prototype.request_server_info=function(){var t=o.Message.create("SERVER-INFO-REQ",{}),e=this._connection.send_with_reply(t);return e.then(function(t){return t.content})},t.prototype.force_roundtrip=function(){return this.request_server_info().then(function(t){})},t.prototype._document_changed=function(t){if(t.setter_id!==this.id&&(!(t instanceof r.ModelChangedEvent)||t.attr in t.model.serializable_attributes())){var e=o.Message.create("PATCH-DOC",{},this.document.create_json_patch([t]));this._connection.send(e)}},t.prototype._handle_patch=function(t){this.document.apply_json_patch(t.content,t.buffers,this.id)},t.prototype._handle_ok=function(t){i.logger.trace("Unhandled OK reply to "+t.reqid())},t.prototype._handle_error=function(t){i.logger.error("Unhandled ERROR reply to "+t.reqid()+": "+t.content.text)},t}();n.ClientSession=s},function(t,e,n){"use strict";function i(t){return function(e){e.prototype.event_name=t,l[t]=e}}function r(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=t.prototype.applicable_models.concat(e);t.prototype.applicable_models=i}Object.defineProperty(n,"__esModule",{value:!0});var o=t(364),s=t(14),a=t(30),l={};n.register_event_class=i,n.register_with_event=r;var u=function(){function t(t){void 0===t&&(t={}),this.model_id=null,this._options=t,t.model_id&&(this.model_id=t.model_id)}return t.prototype.set_model_id=function(t){return this._options.model_id=t,this.model_id=t,this},t.prototype.is_applicable_to=function(t){return this.applicable_models.some(function(e){return t instanceof e})},t.event_class=function(t){return t.type?l[t.type]:void s.logger.warn("BokehEvent.event_class required events with a string type attribute")},t.prototype.toJSON=function(){return{event_name:this.event_name,event_values:a.clone(this._options)}},t.prototype._customize_event=function(t){return this},t}();n.BokehEvent=u,u.prototype.applicable_models=[];var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("button_click")],e)}(u);n.ButtonClick=h;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(u);n.UIEvent=c;var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("lodstart")],e)}(c);n.LODStart=_;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("lodend")],e)}(c);n.LODEnd=p;var d=function(t){function e(e){var n=t.call(this,e)||this;return n.geometry=e.geometry,n["final"]=e["final"],n}return o.__extends(e,t),e=o.__decorate([i("selectiongeometry")],e)}(c);n.SelectionGeometry=d;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("reset")],e)}(c);n.Reset=f;var m=function(t){function e(e){var n=t.call(this,e)||this;return n.sx=e.sx,n.sy=e.sy,n.x=null,n.y=null,n}return o.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.bokeh.sx,sy:t.bokeh.sy,model_id:e})},e.prototype._customize_event=function(t){var e=t.plot_canvas.frame.xscales["default"],n=t.plot_canvas.frame.yscales["default"];return this.x=e.invert(this.sx),this.y=n.invert(this.sy),this._options.x=this.x,this._options.y=this.y,this},e}(c);n.PointEvent=m;var v=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.delta_x=e.delta_x,n.delta_y=e.delta_y,n}return o.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.bokeh.sx,sy:t.bokeh.sy,delta_x:t.deltaX,delta_y:t.deltaY,direction:t.direction,model_id:e})},e=o.__decorate([i("pan")],e)}(m);n.Pan=v;var g=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.scale=e.scale,n}return o.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.bokeh.sx,sy:t.bokeh.sy,scale:t.scale,model_id:e})},e=o.__decorate([i("pinch")],e)}(m);n.Pinch=g;var y=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.delta=e.delta,n}return o.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.bokeh.sx,sy:t.bokeh.sy,delta:t.bokeh.delta,model_id:e})},e=o.__decorate([i("wheel")],e)}(m);n.MouseWheel=y;var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("mousemove")],e)}(m);n.MouseMove=b;var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("mouseenter")],e)}(m);n.MouseEnter=x;var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("mouseleave")],e)}(m);n.MouseLeave=w;var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("tap")],e)}(m);n.Tap=k;var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("doubletap")],e)}(m);n.DoubleTap=M;var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("press")],e)}(m);n.Press=S;var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("panstart")],e)}(m);n.PanStart=T;var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("panend")],e)}(m);n.PanEnd=O;var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("pinchstart")],e)}(m);n.PinchStart=A;var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([i("pinchend")],e)}(m);n.PinchEnd=E},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(22),r=t(30);n.build_views=function(t,e,n,o){void 0===o&&(o=function(t){return t.default_view});var s,a,l,u,h,c,_,p,d,f,m,v,g,y;for(m=i.difference(Object.keys(t),function(){var t,n,i;for(i=[],t=0,n=e.length;t<n;t++)p=e[t],i.push(p.id);return i}()),a=0,h=m.length;a<h;a++)d=m[a],t[d].remove(),delete t[d];for(s=[],f=e.filter(function(e){return null==t[e.id]}),l=0,c=f.length;l<c;l++)p=f[l],g=o(p),y=r.extend({},n,{model:p,connect_signals:!1}),t[p.id]=v=new g(y),s.push(v);for(u=0,_=s.length;u<_;u++)v=s[u],v.connect_signals();return s},n.remove_views=function(t){var e,n,i,o,s;for(o=r.keys(t),s=[],e=0,i=o.length;e<i;e++)n=o[e],t[n].remove(),s.push(delete t[n]);return s}},function(t,e,n){"use strict";function i(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return f(t).apply(void 0,[e].concat(n))}function r(t){var e=t.parentNode;null!=e&&e.removeChild(t)}function o(t,e){var n=t.parentNode;null!=n&&n.replaceChild(e,t)}function s(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=t.firstChild,r=0,o=e;r<o.length;r++){var s=o[r];t.insertBefore(s,i)}}function a(t){for(var e;e=t.firstChild;)t.removeChild(e)}function l(t){t.style.display=""}function u(t){t.style.display="none"}function h(t){return{top:t.offsetTop,left:t.offsetLeft}}function c(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}}function _(t,e){var n=Element.prototype,i=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;return i.call(t,e)}function p(t,e){for(var n=t;n=n.parentElement;)if(_(n,e))return n;return null}Object.defineProperty(n,"__esModule",{value:!0});var d=t(42),f=function(t){return function(e){function n(t){if(t instanceof HTMLElement)o.appendChild(t);else if(d.isString(t))o.appendChild(document.createTextNode(t));else if(null!=t&&t!==!1)throw new Error("expected an HTMLElement, string, false or null, got "+JSON.stringify(t))}void 0===e&&(e={});for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];var o=document.createElement(t);for(var s in e){var a=e[s];if(null!=a&&(!d.isBoolean(a)||a))if("class"===s&&d.isArray(a))for(var l=0,u=a;l<u.length;l++){var h=u[l];null!=h&&o.classList.add(h)}else if("style"===s&&d.isObject(a))for(var c in a)o.style[c]=a[c];else if("data"===s&&d.isObject(a))for(var _ in a)o.dataset[_]=a[_];else o.setAttribute(s,a)}for(var p=0,f=i;p<f.length;p++){var m=f[p];if(d.isArray(m))for(var v=0,g=m;v<g.length;v++){var y=g[v];n(y)}else n(m)}return o}};n.createElement=i,n.div=f("div"),n.span=f("span"),n.link=f("link"),n.style=f("style"),n.a=f("a"),n.p=f("p"),n.pre=f("pre"),n.button=f("button"),n.label=f("label"),n.input=f("input"),n.select=f("select"),n.option=f("option"),n.optgroup=f("optgroup"),n.canvas=f("canvas"),n.ul=f("ul"),n.ol=f("ol"),n.li=f("li"),n.nbsp=document.createTextNode(" "),n.removeElement=r,n.replaceWith=o,n.prepend=s,n.empty=a,n.show=l,n.hide=u,n.position=h,n.offset=c,n.matches=_,n.parent=p;var m;!function(t){t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Esc=27]="Esc",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.Up=38]="Up",t[t.Down=40]="Down"}(m=n.Keys||(n.Keys={}))},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(45),o=t(5),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this._has_finished=!1,this.el=this._createElement()},e.prototype.remove=function(){return o.removeElement(this.el),t.prototype.remove.call(this)},e.prototype.layout=function(){},e.prototype.render=function(){},e.prototype.renderTo=function(t,e){return void 0===e&&(e=!1),e?o.replaceWith(t,this.el):t.appendChild(this.el),this.layout()},e.prototype.has_finished=function(){return this._has_finished},e.prototype.notify_finished=function(){return this.root.notify_finished()},e.prototype._createElement=function(){return o.createElement(this.tagName,{id:this.id,"class":this.className})},e}(r.View);n.DOMView=s,s.prototype.tagName="div",s.getters({_root_element:function(){return o.parent(this.el,".bk-root")},solver:function(){return this.is_root?this._solver:this.parent.solver},is_idle:function(){return this.has_finished()}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.AngleUnits=["deg","rad"],n.Dimension=["width","height"],n.Dimensions=["width","height","both"],n.Direction=["clock","anticlock"],n.FontStyle=["normal","italic","bold"],n.LatLon=["lat","lon"],n.LineCap=["butt","round","square"],n.LineJoin=["miter","round","bevel"],n.Location=["above","below","left","right"],n.LegendLocation=["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"],n.Orientation=["vertical","horizontal"],n.OutputBackend=["canvas","svg","webgl"],n.RenderLevel=["image","underlay","glyph","annotation","overlay"],n.RenderMode=["canvas","css"],n.Side=["left","right"],n.SpatialUnits=["screen","data"],n.StartEnd=["start","end"],n.VerticalAlign=["top","middle","bottom"],n.TextAlign=["left","right","center"],n.TextBaseline=["top","middle","bottom","alphabetic","hanging","ideographic"],n.DistributionTypes=["uniform","normal"],n.StepModes=["after","before","center"],n.SizingMode=["stretch_both","scale_width","scale_height","scale_both","fixed"],n.PaddingUnits=["percent","absolute"]},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i={}.hasOwnProperty,r=t(14),o=t(20),s=t(16),a=t(33),l=t(15),u=t(37),h=t(22),c=t(30),_=t(42),p=t(28),d=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n,i,r,s;this.document=null,this.destroyed=new o.Signal(this,"destroyed"),this.change=new o.Signal(this,"change"),this.transformchange=new o.Signal(this,"transformchange"),this.attributes={},this.properties={},r=this.props;for(i in r){if(a=r[i],s=a.type,n=a.default_value,null==s)throw new Error("undefined property type for "+this.type+"."+i);this.properties[i]=new s({obj:this,attr:i,default_value:n})}this._set_after_defaults={},null==t.id&&this.setv("id",u.uniqueId(),{silent:!0}),this.setv(t,c.extend({silent:!0},e)),e.defer_initialization||this.finalize(t,e);var a}return t.getters=function(t){var e,n,i;i=[];for(n in t)e=t[n],i.push(Object.defineProperty(this.prototype,n,{get:e}));return i},t.define=function(t){var e,n,i,r=this;i=[];for(e in t)n=t[e],i.push(function(t,e){var n,i,o,s,a;if(null!=r.prototype.props[t])throw new Error("attempted to redefine property '"+r.name+"."+t+"'");if(null!=r.prototype[t])throw new Error("attempted to redefine attribute '"+r.name+"."+t+"'");return Object.defineProperty(r.prototype,t,{get:function(){var e;return e=this.getv(t)},set:function(e){return this.setv(t,e),this}},{configurable:!1,enumerable:!0}),a=e[0],n=e[1],i=e[2],s={type:a,default_value:n,internal:null!=i&&i},o=c.clone(r.prototype.props),o[t]=s,r.prototype.props=o}(e,n));return i},t.internal=function(t){var e,n,i,r;e={},n=function(t,n){var i,r;return r=n[0],i=n[1],e[t]=[r,i,!0]};for(i in t)r=t[i],n(i,r);return this.define(e)},t.mixin=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n;return this.define(s.create(t)),n=this.prototype.mixins.concat(t),this.prototype.mixins=n},t.mixins=function(t){return this.mixin.apply(this,t)},t.override=function(t,e){var n,i,r,o=this;_.isString(t)?(i={},i[n]=e):i=t,r=[];for(n in i)e=i[n],r.push(function(t,e){var n,i;if(i=o.prototype.props[t],null==i)throw new Error("attempted to override nonexistent '"+o.name+"."+t+"'");return n=c.clone(o.prototype.props),n[t]=c.extend({},i,{default_value:e}),o.prototype.props=n}(n,e));return r},t.prototype.toString=function(){return this.type+"("+this.id+")"},t.prototype.finalize=function(t,e){var n,i,r;r=this.properties;for(n in r)i=r[n],i.update(),i.spec.transform&&this.connect(i.spec.transform.change,function(){return this.transformchange.emit()});return this.initialize(t,e),this.connect_signals()},t.prototype.initialize=function(t,e){},t.prototype.connect_signals=function(){},t.prototype.disconnect_signals=function(){return o.Signal.disconnectReceiver(this)},t.prototype.destroy=function(){return this.disconnect_signals(),this.destroyed.emit()},t.prototype.clone=function(){return new this.constructor(this.attributes)},t.prototype._setv=function(t,e){var n,i,r,o,s,a,l,u,h,c;o=e.check_eq,h=e.silent,i=[],r=this._changing,this._changing=!0,s=this.attributes;for(n in t)c=t[n],c=t[n],o!==!1?p.isEqual(s[n],c)||i.push(n):i.push(n),s[n]=c;if(!h)for(i.length&&(this._pending=!0),a=l=0,u=i.length;0<=u?l<u:l>u;a=0<=u?++l:--l)this.properties[i[a]].change.emit(s[i[a]]);if(r)return this;if(!h&&!e.no_change)for(;this._pending;)this._pending=!1,this.change.emit();return this._pending=!1,this._changing=!1,this},t.prototype.setv=function(t,e,n){var r,o,s,a,l;_.isObject(t)||null===t?(r=t,n=e):(r={},r[t]=e),null==n&&(n={});for(t in r)if(i.call(r,t)){if(l=r[t],s=t,null==this.props[s])throw new Error("property "+this.type+"."+s+" wasn't declared");null!=n&&n.defaults||(this._set_after_defaults[t]=!0)}if(!c.isEmpty(r)){o={};for(t in r)e=r[t],o[t]=this.getv(t);if(this._setv(r,n),null==(null!=n?n.silent:void 0)){a=[];for(t in r)e=r[t],a.push(this._tell_document_about_change(t,o[t],this.getv(t),n));return a}}},t.prototype.set=function(t,e,n){return r.logger.warn("HasProps.set('prop_name', value) is deprecated, use HasProps.prop_name = value instead"),this.setv(t,e,n)},t.prototype.get=function(t){return r.logger.warn("HasProps.get('prop_name') is deprecated, use HasProps.prop_name instead"),this.getv(t)},t.prototype.getv=function(t){if(null==this.props[t])throw new Error("property "+this.type+"."+t+" wasn't declared");return this.attributes[t]},t.prototype.ref=function(){return a.create_ref(this)},t.prototype.set_subtype=function(t){return this._subtype=t},t.prototype.attribute_is_serializable=function(t){var e;if(e=this.props[t],null==e)throw new Error(this.type+".attribute_is_serializable('"+t+"'): "+t+" wasn't declared");return!e.internal},t.prototype.serializable_attributes=function(){var t,e,n,i;t={},n=this.attributes;for(e in n)i=n[e],this.attribute_is_serializable(e)&&(t[e]=i);return t},t._value_to_json=function(e,n,r){var o,s,a,l,u,h,c;if(n instanceof t)return n.ref();if(_.isArray(n)){for(l=[],o=s=0,a=n.length;s<a;o=++s)c=n[o],l.push(t._value_to_json(o,c,n));return l}if(_.isObject(n)){u={};for(h in n)i.call(n,h)&&(u[h]=t._value_to_json(h,n[h],n));return u}return n},t.prototype.attributes_as_json=function(e,n){void 0===e&&(e=!0),void 0===n&&(n=t._value_to_json);var r,o,s,a;r={},s=this.serializable_attributes();for(o in s)i.call(s,o)&&(a=s[o],e?r[o]=a:o in this._set_after_defaults&&(r[o]=a));return n("attributes",r,this)},t._json_record_references=function(e,n,r,o){var s,l,u,h,c,p,d;if(null==n);else if(a.is_ref(n)){if(!(n.id in r))return c=e.get_model_by_id(n.id),t._value_record_references(c,r,o)}else{if(_.isArray(n)){for(p=[],l=0,h=n.length;l<h;l++)s=n[l],p.push(t._json_record_references(e,s,r,o));return p}if(_.isObject(n)){d=[];for(u in n)i.call(n,u)&&(s=n[u],d.push(t._json_record_references(e,s,r,o)));return d}}},t._value_record_references=function(e,n,r){var o,s,a,l,u,h,c,p,d,f,m;if(null==e);else if(e instanceof t){if(!(e.id in n)&&(n[e.id]=e,r)){for(s=e._immediate_references(),d=[],a=0,h=s.length;a<h;a++)p=s[a],d.push(t._value_record_references(p,n,!0));return d}}else if(e.buffer instanceof ArrayBuffer);else{if(_.isArray(e)){for(f=[],u=0,c=e.length;u<c;u++)o=e[u],f.push(t._value_record_references(o,n,r));return f}if(_.isObject(e)){m=[];for(l in e)i.call(e,l)&&(o=e[l],m.push(t._value_record_references(o,n,r)));return m}}},t.prototype._immediate_references=function(){var e,n,i,r;i={},e=this.serializable_attributes();for(n in e)r=e[n],t._value_record_references(r,i,!1);return c.values(i)},t.prototype.references=function(){var e;return e={},t._value_record_references(this,e,!0),c.values(e)},t.prototype.attach_document=function(t){if(null!==this.document&&this.document!==t)throw new Error("models must be owned by only a single document");if(this.document=t,null!=this._doc_attached)return this._doc_attached()},t.prototype.detach_document=function(){return this.document=null},t.prototype._tell_document_about_change=function(e,n,i,r){var o,s,a,l,u,h,c;if(this.attribute_is_serializable(e)&&null!==this.document){l={},t._value_record_references(i,l,!1),c={},t._value_record_references(n,c,!1),o=!1;for(s in l)if(a=l[s],!(s in c)){o=!0;break}if(!o)for(u in c)if(h=c[u],!(u in l)){o=!0;break}return o&&this.document._invalidate_all_models(),this.document._notify_change(this,e,n,i,r)}},t.prototype.materialize_dataspecs=function(t){var e,n,i,r;e={},r=this.properties;for(n in r)i=r[n],i.dataspec&&(!i.optional||null!==i.spec.value||n in this._set_after_defaults)&&(e["_"+n]=i.array(t),null!=i.spec.field&&i.spec.field in t._shapes&&(e["_"+n+"_shape"]=t._shapes[i.spec.field]),i instanceof l.Distance&&(e["max_"+n]=h.max(e["_"+n])));return e},t}();n.HasProps=d,c.extend(d.prototype,o.Signalable),d.prototype.props={},d.prototype.mixins=[],d.define({id:[l.Any]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o=t(22),s=t(30);n.point_in_poly=function(t,e,n,i){var r,o,s,a,l,u,h,c;for(o=!1,l=n[n.length-1],h=i[i.length-1],r=s=0,a=n.length;0<=a?s<a:s>a;r=0<=a?++s:--s)u=n[r],c=i[r],h<e!=c<e&&l+(e-h)/(c-h)*(u-l)<t&&(o=!o),l=u,h=c;return o},i=function(){return null};var a=function(){function t(){this["0d"]={glyph:null,get_view:i,indices:[]},this["1d"]={indices:[]},this["2d"]={indices:{}}}return t.prototype.is_empty=function(){return 0===this._0d.indices.length&&0===this._1d.indices.length&&0===Object.keys(this._2d.indices).length},t.prototype.update_through_union=function(t){return this["0d"].indices=o.union(t["0d"].indices,this["0d"].indices),this["0d"].glyph=t["0d"].glyph||this["0d"].glyph,this["1d"].indices=o.union(t["1d"].indices,this["1d"].indices),this["2d"].indices=s.merge(t["2d"].indices,this["2d"].indices)},t}();n.HitTestResult=a,Object.defineProperty(a.prototype,"_0d",{get:function(){return this["0d"]}}),Object.defineProperty(a.prototype,"_1d",{get:function(){return this["1d"]}}),Object.defineProperty(a.prototype,"_2d",{get:function(){return this["2d"]}}),n.create_hit_test_result=function(){return new a},n.create_1d_hit_test_result=function(t){var e,n,i;return i=new a,i["1d"].indices=function(){var i,r,s,a;for(s=o.sortBy(t,function(t){var e=(t[0],t[1]);return e}),a=[],i=0,r=s.length;i<r;i++)l=s[i],n=l[0],e=l[1],a.push(n);return a;var l}(),i},n.validate_bbox_coords=function(t,e){var n=t[0],i=t[1],r=e[0],o=e[1];return n>i&&(s=[i,n],n=s[0],i=s[1]),r>o&&(a=[o,r],r=a[0],o=a[1]),{minX:n,minY:r,maxX:i,maxY:o};var s,a},r=function(t){return t*t},n.dist_2_pts=function(t,e,n,i){return r(t-n)+r(e-i)},n.dist_to_segment_squared=function(t,e,i){var r,o;return r=n.dist_2_pts(e.x,e.y,i.x,i.y),0===r?n.dist_2_pts(t.x,t.y,e.x,e.y):(o=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r,o<0?n.dist_2_pts(t.x,t.y,e.x,e.y):o>1?n.dist_2_pts(t.x,t.y,i.x,i.y):n.dist_2_pts(t.x,t.y,e.x+o*(i.x-e.x),e.y+o*(i.y-e.y)))},n.dist_to_segment=function(t,e,i){return Math.sqrt(n.dist_to_segment_squared(t,e,i))},n.check_2_segments_intersect=function(t,e,n,i,r,o,s,a){var l,u,h,c,_,p,d;return h=(a-o)*(n-t)-(s-r)*(i-e),0===h?{hit:!1,x:null,y:null}:(l=e-o,u=t-r,c=(s-r)*l-(a-o)*u,_=(n-t)*l-(i-e)*u,l=c/h,u=_/h,p=t+l*(n-t),d=e+l*(i-e),{hit:l>0&&l<1&&u>0&&u<1,x:p,y:d})}},function(t,e,n){"use strict";function i(t,e){var n=[];if(e.length>0){n.push(o.EQ(s.head(e)._bottom,[-1,t._bottom])),n.push(o.EQ(s.tail(e)._top,[-1,t._top])),n.push.apply(n,s.pairwise(e,function(t,e){return o.EQ(t._top,[-1,e._bottom])}));for(var i=0,r=e;i<r.length;i++){var a=r[i];n.push(o.EQ(a._left,[-1,t._left])),n.push(o.EQ(a._right,[-1,t._right]))}}return n}function r(t,e){var n=[];if(e.length>0){n.push(o.EQ(s.head(e)._right,[-1,t._right])),n.push(o.EQ(s.tail(e)._left,[-1,t._left])),n.push.apply(n,s.pairwise(e,function(t,e){return o.EQ(t._left,[-1,e._right])}));for(var i=0,r=e;i<r.length;i++){var a=r[i];n.push(o.EQ(a._top,[-1,t._top])),n.push(o.EQ(a._bottom,[-1,t._bottom]))}}return n}Object.defineProperty(n,"__esModule",{value:!0});var o=t(13),s=t(22);n.vstack=i,n.hstack=r},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(13),o=t(8),s=t(23),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),this._top=new r.Variable(this.toString()+".top"),this._left=new r.Variable(this.toString()+".left"),this._width=new r.Variable(this.toString()+".width"),this._height=new r.Variable(this.toString()+".height"),this._right=new r.Variable(this.toString()+".right"),this._bottom=new r.Variable(this.toString()+".bottom"),this._hcenter=new r.Variable(this.toString()+".hcenter"),this._vcenter=new r.Variable(this.toString()+".vcenter")},e.prototype.get_editables=function(){return[]},e.prototype.get_constraints=function(){return[r.GE(this._top),r.GE(this._bottom),r.GE(this._left),r.GE(this._right),r.GE(this._width),r.GE(this._height),r.EQ(this._left,this._width,[-1,this._right]),r.EQ(this._top,this._height,[-1,this._bottom]),r.EQ([2,this._hcenter],[-1,this._left],[-1,this._right]),r.EQ([2,this._vcenter],[-1,this._top],[-1,this._bottom])]},Object.defineProperty(e.prototype,"bbox",{get:function(){return new s.BBox({x0:this._left.value,y0:this._top.value,x1:this._right.value,y1:this._bottom.value})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layout_bbox",{get:function(){return{top:this._top.value,left:this._left.value,width:this._width.value,height:this._height.value,right:this._right.value,
  bottom:this._bottom.value,hcenter:this._hcenter.value,vcenter:this._vcenter.value}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"xview",{get:function(){var t=this;return{compute:function(e){return t._left.value+e},v_compute:function(e){for(var n=new Float64Array(e.length),i=t._left.value,r=0;r<e.length;r++)n[r]=i+e[r];return n}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"yview",{get:function(){var t=this;return{compute:function(e){return t._bottom.value-e},v_compute:function(e){for(var n=new Float64Array(e.length),i=t._bottom.value,r=0;r<e.length;r++)n[r]=i-e[r];return n}}},enumerable:!0,configurable:!0}),e}(o.HasProps);n.LayoutCanvas=a,a.prototype.type="LayoutCanvas"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a,l,u,h,c,_,p,d,f,m,v=t(364),g=t(13),y=t(11),b=t(15),x=t(14),w=t(42);m=Math.PI/2,i="alphabetic",h="top",r="bottom",l="middle",s="hanging",a="left",u="right",o="center",d={above:{parallel:0,normal:-m,horizontal:0,vertical:-m},below:{parallel:0,normal:m,horizontal:0,vertical:m},left:{parallel:-m,normal:0,horizontal:0,vertical:-m},right:{parallel:m,normal:0,horizontal:0,vertical:m}},f={above:{justified:h,parallel:i,normal:l,horizontal:i,vertical:l},below:{justified:r,parallel:s,normal:l,horizontal:s,vertical:l},left:{justified:h,parallel:i,normal:l,horizontal:l,vertical:i},right:{justified:h,parallel:i,normal:l,horizontal:l,vertical:i}},c={above:{justified:o,parallel:o,normal:a,horizontal:o,vertical:a},below:{justified:o,parallel:o,normal:a,horizontal:o,vertical:a},left:{justified:o,parallel:o,normal:u,horizontal:u,vertical:o},right:{justified:o,parallel:o,normal:a,horizontal:a,vertical:o}},_={above:u,below:a,left:u,right:a},p={above:a,below:u,left:u,right:a},n._view_sizes=new WeakMap,n.update_panel_constraints=function(t){var e,i;if(i=t.get_size(),e=t.solver,null!=t._size_constraint&&e.has_constraint(t._size_constraint)){if(n._view_sizes.get(t)===i)return;e.remove_constraint(t._size_constraint)}return n._view_sizes.set(t,i),t._size_constraint=g.GE(t.model.panel._size,-i),e.add_constraint(t._size_constraint)};var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v.__extends(e,t),e.prototype.toString=function(){return this.type+"("+this.id+", "+this.side+")"},e.prototype.initialize=function(e,n){switch(t.prototype.initialize.call(this,e,n),this.side){case"above":return this._dim=0,this._normals=[0,-1],this._size=this._height;case"below":return this._dim=0,this._normals=[0,1],this._size=this._height;case"left":return this._dim=1,this._normals=[-1,0],this._size=this._width;case"right":return this._dim=1,this._normals=[1,0],this._size=this._width;default:return x.logger.error("unrecognized side: '"+this.side+"'")}},e.prototype.apply_label_text_heuristics=function(t,e){var n,i,r;return r=this.side,w.isString(e)?(i=f[r][e],n=c[r][e]):0===e?(i=f[r][e],n=c[r][e]):e<0?(i="middle",n=_[r]):e>0&&(i="middle",n=p[r]),t.textBaseline=i,t.textAlign=n,t},e.prototype.get_label_angle_heuristic=function(t){var e;return e=this.side,d[e][t]},e}(y.LayoutCanvas);n.SidePanel=k,k.prototype.type="SidePanel",k.internal({side:[b.String]}),k.getters({is_horizontal:function(){return"above"===this.side||"below"===this.side},is_vertical:function(){return"left"===this.side||"right"===this.side}})},function(t,e,n){"use strict";function i(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new o.Constraint(new(o.Expression.bind.apply(o.Expression,[void 0].concat(e))),t)}}function r(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new o.Constraint(new(o.Expression.bind.apply(o.Expression,[void 0].concat(e))),t,o.Strength.weak)}}Object.defineProperty(n,"__esModule",{value:!0});var o=t(321);n.Variable=o.Variable,n.Expression=o.Expression,n.Constraint=o.Constraint,n.Operator=o.Operator,n.Strength=o.Strength,n.EQ=i(o.Operator.Eq),n.LE=i(o.Operator.Le),n.GE=i(o.Operator.Ge),n.WEAK_EQ=r(o.Operator.Eq),n.WEAK_LE=r(o.Operator.Le),n.WEAK_GE=r(o.Operator.Ge);var s=function(){function t(){this.solver=new o.Solver}return t.prototype.clear=function(){this.solver=new o.Solver},t.prototype.toString=function(){return"Solver(num_constraints="+this.num_constraints+", num_editables="+this.num_editables+")"},Object.defineProperty(t.prototype,"num_constraints",{get:function(){return this.solver.numConstraints},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"num_editables",{get:function(){return this.solver.numEditVariables},enumerable:!0,configurable:!0}),t.prototype.get_constraints=function(){return this.solver.getConstraints()},t.prototype.update_variables=function(){this.solver.updateVariables()},t.prototype.has_constraint=function(t){return this.solver.hasConstraint(t)},t.prototype.add_constraint=function(t){try{this.solver.addConstraint(t)}catch(e){throw new Error(e.message+": "+t.toString())}},t.prototype.remove_constraint=function(t){this.solver.removeConstraint(t)},t.prototype.add_edit_variable=function(t,e){this.solver.addEditVariable(t,e)},t.prototype.remove_edit_variable=function(t){this.solver.removeEditVariable(t)},t.prototype.suggest_value=function(t,e){this.solver.suggestValue(t,e)},t}();n.Solver=s},function(t,e,n){"use strict";function i(t,e){return null!=console[t]?console[t].bind(console,e):null!=console.log?console.log.bind(console,e):function(){}}function r(t){null==l.log_levels[t]?(console.log("[bokeh] unrecognized logging level '"+t+"' passed to Bokeh.set_log_level(), ignoring"),console.log("[bokeh] valid log levels are: "+l.levels.join(", "))):(console.log("[bokeh] setting log level to: '"+t+"'"),n.logger.set_level(t))}Object.defineProperty(n,"__esModule",{value:!0});var o=t(42),s={},a=function(){function t(t,e){this.name=t,this.level=e}return t}();n.LogLevel=a;var l=function(){function t(e,n){void 0===n&&(n=t.INFO),this._name=e,this.set_level(n)}return Object.defineProperty(t,"levels",{get:function(){return Object.keys(t.log_levels)},enumerable:!0,configurable:!0}),t.get=function(e,n){if(void 0===n&&(n=t.INFO),e.length>0){var i=s[e];return null==i&&(s[e]=i=new t(e,n)),i}throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")},Object.defineProperty(t.prototype,"level",{get:function(){return this.get_level()},enumerable:!0,configurable:!0}),t.prototype.get_level=function(){return this._log_level},t.prototype.set_level=function(e){if(e instanceof a)this._log_level=e;else{if(!o.isString(e)||null==t.log_levels[e])throw new Error("Logger.set_level() expects a log-level object or a string name of a log-level");this._log_level=t.log_levels[e]}var n="["+this._name+"]";for(var r in t.log_levels){var s=t.log_levels[r];s.level<this._log_level.level||this._log_level.level===t.OFF.level?this[r]=function(){}:this[r]=i(r,n)}},t.prototype.trace=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.TRACE=new a("trace",0),t.DEBUG=new a("debug",1),t.INFO=new a("info",2),t.WARN=new a("warn",6),t.ERROR=new a("error",7),t.FATAL=new a("fatal",8),t.OFF=new a("off",9),t.log_levels={trace:t.TRACE,debug:t.DEBUG,info:t.INFO,warn:t.WARN,error:t.ERROR,fatal:t.FATAL,off:t.OFF},t}();n.Logger=l,n.logger=l.get("bokeh"),n.set_log_level=r},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=[].indexOf,s=t(20),a=t(7),l=t(38),u=t(26),h=t(22),c=t(30),_=t(42);i=function(t){try{return JSON.stringify(t)}catch(e){return t.toString()}};var p=function(){function t(t){var e=t.obj,n=t.attr,i=t.default_value,r=this;this.obj=e,this.attr=n,this.default_value=i,this._init(),this.change=new s.Signal(this.obj,"change"),this.connect(this.change,function(){return r._init()})}return t.prototype.update=function(){return this._init()},t.prototype.init=function(){},t.prototype.transform=function(t){return t},t.prototype.validate=function(t){},t.prototype.value=function(t){void 0===t&&(t=!0);var e;if(void 0===this.spec.value)throw new Error("attempted to retrieve property value for property without value specification");return e=this.transform([this.spec.value])[0],null!=this.spec.transform&&t&&(e=this.spec.transform.compute(e)),e},t.prototype.array=function(t){var e,n,i,r,o;if(!this.dataspec)throw new Error("attempted to retrieve property array for non-dataspec property");if(e=t.data,null!=this.spec.field){if(!(this.spec.field in e))throw new Error("attempted to retrieve property array for nonexistent field '"+this.spec.field+"'");r=this.transform(t.get_column(this.spec.field))}else null!=this.spec.expr?r=this.transform(this.spec.expr._v_compute(t)):(i=t.get_length(),null==i&&(i=1),o=this.value(!1),r=function(){var t,e,r;for(r=[],n=t=0,e=i;0<=e?t<e:t>e;n=0<=e?++t:--t)r.push(o);return r}());return null!=this.spec.transform&&(r=this.spec.transform.v_compute(r)),r},t.prototype._init=function(){var t,e,n,i;if(i=this.obj,null==i)throw new Error("missing property object");if(null==i.properties)throw new Error("property object must be a HasProps");if(t=this.attr,null==t)throw new Error("missing property attr");if(e=i.getv(t),void 0===e&&(n=this.default_value,e=function(){switch(!1){case void 0!==n:return null;case!_.isArray(n):return h.copy(n);case!_.isFunction(n):return n(i);default:return n}}(),i.setv(t,e,{silent:!0,defaults:!0})),_.isArray(e)?this.spec={value:e}:_.isObject(e)&&(void 0===e.value?0:1)+(void 0===e.field?0:1)+(void 0===e.expr?0:1)===1?this.spec=e:this.spec={value:e},null!=this.spec.field&&!_.isString(this.spec.field))throw new Error("field value for property '"+t+"' is not a string");return null!=this.spec.value&&this.validate(this.spec.value),this.init()},t.prototype.toString=function(){return this.name+"("+this.obj+"."+this.attr+", spec: "+i(this.spec)+")"},t}();n.Property=p,c.extend(p.prototype,s.Signalable),p.prototype.dataspec=!1,n.simple_prop=function(t,e){var n;return n=function(){var n=function(n){function o(){return null!==n&&n.apply(this,arguments)||this}return r.__extends(o,n),o.prototype.validate=function(n){if(!e(n))throw new Error(t+" property '"+this.attr+"' given invalid value: "+i(n))},o}(p);return n.prototype.name=t,n}()},n.Any=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Any",function(t){return!0})),n.Array=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Array",function(t){return _.isArray(t)||t instanceof Float64Array})),n.Bool=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Bool",_.isBoolean)),n.Boolean=n.Bool,n.Color=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Color",function(t){return null!=l[t.toLowerCase()]||"#"===t.substring(0,1)||u.valid_rgb(t)})),n.Instance=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Instance",function(t){return null!=t.properties})),n.Number=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Number",function(t){return _.isNumber(t)||_.isBoolean(t)})),n.Int=n.Number,n.Percent=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Number",function(t){return(_.isNumber(t)||_.isBoolean(t))&&0<=t&&t<=1})),n.String=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("String",_.isString)),n.Font=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.String),n.enum_prop=function(t,e){var i;return i=function(){var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop(t,function(t){return o.call(e,t)>=0}));return i.prototype.name=t,i}()},n.Anchor=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("Anchor",a.LegendLocation)),n.AngleUnits=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("AngleUnits",a.AngleUnits)),n.Direction=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.transform=function(t){var e,n,i,r;for(r=new Uint8Array(t.length),e=n=0,i=t.length;0<=i?n<i:n>i;e=0<=i?++n:--n)switch(t[e]){case"clock":r[e]=!1;break;case"anticlock":r[e]=!0}return r},e}(n.enum_prop("Direction",a.Direction)),n.Dimension=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("Dimension",a.Dimension)),n.Dimensions=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("Dimensions",a.Dimensions)),n.FontStyle=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("FontStyle",a.FontStyle)),n.LatLon=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("LatLon",a.LatLon)),n.LineCap=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("LineCap",a.LineCap)),n.LineJoin=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("LineJoin",a.LineJoin)),n.LegendLocation=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("LegendLocation",a.LegendLocation)),n.Location=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("Location",a.Location)),n.OutputBackend=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("OutputBackend",a.OutputBackend)),n.Orientation=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("Orientation",a.Orientation)),n.VerticalAlign=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("VerticalAlign",a.VerticalAlign)),n.TextAlign=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("TextAlign",a.TextAlign)),n.TextBaseline=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("TextBaseline",a.TextBaseline)),n.RenderLevel=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("RenderLevel",a.RenderLevel)),n.RenderMode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("RenderMode",a.RenderMode)),n.SizingMode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("SizingMode",a.SizingMode)),n.SpatialUnits=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("SpatialUnits",a.SpatialUnits)),n.Distribution=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("Distribution",a.DistributionTypes)),n.StepMode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("StepMode",a.StepModes)),n.PaddingUnits=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("PaddingUnits",a.PaddingUnits)),n.StartEnd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("StartEnd",a.StartEnd)),n.units_prop=function(t,e,i){var s;return s=function(){var s=function(n){function s(){return null!==n&&n.apply(this,arguments)||this}return r.__extends(s,n),s.prototype.init=function(){var n;if(null==this.spec.units&&(this.spec.units=i),this.units=this.spec.units,n=this.spec.units,o.call(e,n)<0)throw new Error(t+" units must be one of "+e+", given invalid value: "+n)},s}(n.Number);return s.prototype.name=t,s}()},n.Angle=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.transform=function(e){var n;return"deg"===this.spec.units&&(e=function(){var t,i,r;for(r=[],t=0,i=e.length;t<i;t++)n=e[t],r.push(n*Math.PI/180);return r}()),e=function(){var t,i,r;for(r=[],t=0,i=e.length;t<i;t++)n=e[t],r.push(-n);return r}(),t.prototype.transform.call(this,e)},e}(n.units_prop("Angle",a.AngleUnits,"rad")),n.Distance=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.units_prop("Distance",a.SpatialUnits,"data"));var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.Angle);n.AngleSpec=d,d.prototype.dataspec=!0;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.Color);n.ColorSpec=f,f.prototype.dataspec=!0;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.Distance);n.DirectionSpec=m,m.prototype.dataspec=!0;var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.Distance);n.DistanceSpec=v,v.prototype.dataspec=!0;var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.String);n.FontSizeSpec=g,g.prototype.dataspec=!0;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.Number);n.NumberSpec=y,y.prototype.dataspec=!0;var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.String);n.StringSpec=b,b.prototype.dataspec=!0},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a=t(15),l=t(30);r=function(t,e){var n,i,r;i={},null==e&&(e="");for(n in t)r=t[n],i[e+n]=r;return i},o={line_color:[a.ColorSpec,"black"],line_width:[a.NumberSpec,1],line_alpha:[a.NumberSpec,1],line_join:[a.LineJoin,"miter"],line_cap:[a.LineCap,"butt"],line_dash:[a.Array,[]],line_dash_offset:[a.Number,0]},n.line=function(t){return r(o,t)},i={fill_color:[a.ColorSpec,"gray"],fill_alpha:[a.NumberSpec,1]},n.fill=function(t){return r(i,t)},s={text_font:[a.Font,"helvetica"],text_font_size:[a.FontSizeSpec,"12pt"],text_font_style:[a.FontStyle,"normal"],text_color:[a.ColorSpec,"#444444"],text_alpha:[a.NumberSpec,1],text_align:[a.TextAlign,"left"],text_baseline:[a.TextBaseline,"bottom"],text_line_height:[a.Number,1.2]},n.text=function(t){return r(s,t)},n.create=function(t){var e,n,i,r,o,s;for(s={},n=0,r=t.length;n<r;n++){if(e=t[n],a=e.split(":"),i=a[0],o=a[1],null==this[i])throw new Error("Unknown property mixin kind '"+i+"'");s=l.extend(s,this[i](o))}return s;var a}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(8),o=t(18),s=t(9),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.selector=new o.Selector,this.inspectors={}},e.prototype.select=function(t,e,n,i){void 0===i&&(i=!1);var r,o,s,a;for(r=!1,o=0,s=t.length;o<s;o++)a=t[o],r||(r=a.hit_test(e,n,i));return r},e.prototype.inspect=function(t,e){var n;return n=!1,n||(n=t.hit_test(e,!1,!1,"inspect")),n},e.prototype.clear=function(t){return this.selector.clear(),this.source.selected=s.create_hit_test_result()},e.prototype.get_or_create_inspector=function(t){return null==this.inspectors[t.id]&&(this.inspectors[t.id]=new o.Selector),this.inspectors[t.id]},e}(r.HasProps);n.SelectionManager=l,l.prototype.type="SelectionManager",l.internal({source:[a.Any]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(8),o=t(9),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.update=function(t,e,n,i){return void 0===i&&(i=!1),this.setv("timestamp",new Date,{silent:i}),this.setv("final",e,{silent:i}),n&&t.update_through_union(this.indices),this.setv("indices",t,{silent:i})},e.prototype.clear=function(){return this.timestamp=new Date,this["final"]=!0,this.indices=o.create_hit_test_result()},e}(r.HasProps);n.Selector=a,a.prototype.type="Selector",a.internal({indices:[s.Any,function(){return o.create_hit_test_result()}],"final":[s.Boolean],timestamp:[s.Any]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function t(){this._dev=!1}return Object.defineProperty(t.prototype,"dev",{get:function(){return this._dev},set:function(t){this._dev=t},enumerable:!0,configurable:!0}),t}();n.Settings=i,n.settings=new i},function(t,e,n){"use strict";function i(t,e,n,i){return l.find(t,function(t){return t.signal===e&&t.slot===n&&t.context===i})}function r(t){0===p.size&&a.defer(o),p.add(t)}function o(){p.forEach(function(t){l.removeBy(t,function(t){return null==t.signal})}),p.clear()}Object.defineProperty(n,"__esModule",{value:!0});var s=t(14),a=t(24),l=t(22),u=function(){function t(t,e){this.sender=t,this.name=e}return t.prototype.connect=function(t,e){void 0===e&&(e=null),c.has(this.sender)||c.set(this.sender,[]);var n=c.get(this.sender);if(null!=i(n,this,t,e))return!1;var r=e||t;_.has(r)||_.set(r,[]);var o=_.get(r),s={signal:this,slot:t,context:e};return n.push(s),o.push(s),!0},t.prototype.disconnect=function(t,e){void 0===e&&(e=null);var n=c.get(this.sender);if(null==n||0===n.length)return!1;var o=i(n,this,t,e);if(null==o)return!1;var s=e||t,a=_.get(s);return o.signal=null,r(n),r(a),!0},t.prototype.emit=function(t){for(var e=c.get(this.sender)||[],n=0,i=e;n<i.length;n++){var r=i[n],o=r.signal,s=r.slot,a=r.context;o===this&&s.call(a,t,this.sender)}},t}();n.Signal=u,function(t){function e(t,e){var n=c.get(t);if(null!=n&&0!==n.length){var i=_.get(e);if(null!=i&&0!==i.length){for(var o=0,s=i;o<s.length;o++){var a=s[o];if(null==a.signal)return;a.signal.sender===t&&(a.signal=null)}r(n),r(i)}}}function n(t){var e=c.get(t);if(null!=e&&0!==e.length){for(var n=0,i=e;n<i.length;n++){var o=i[n];if(null==o.signal)return;var s=o.context||o.slot;o.signal=null,r(_.get(s))}r(e)}}function i(t){var e=_.get(t);if(null!=e&&0!==e.length){for(var n=0,i=e;n<i.length;n++){var o=i[n];if(null==o.signal)return;var s=o.signal.sender;o.signal=null,r(c.get(s))}r(e)}}function o(t){var e=c.get(t);if(null!=e&&0!==e.length){for(var n=0,i=e;n<i.length;n++){var o=i[n];o.signal=null}r(e)}var s=_.get(t);if(null!=s&&0!==s.length){for(var a=0,l=s;a<l.length;a++){var o=l[a];o.signal=null}r(s)}}t.disconnectBetween=e,t.disconnectSender=n,t.disconnectReceiver=i,t.disconnectAll=o}(u=n.Signal||(n.Signal={})),n.Signal=u;var h;!function(t){function e(t,e){return t.connect(e,this)}function n(t,e){s.logger.warn("obj.listenTo('event', handler) is deprecated, use obj.connect(signal, slot)");var n=t.split(":"),i=n[0],r=n[1],o=null==r?this[i]:this.properties[r][i];return o.connect(e,this)}function i(t,e){s.logger.warn("obj.trigger('event', args) is deprecated, use signal.emit(args)");var n=t.split(":"),i=n[0],r=n[1],o=null==r?this[i]:this.properties[r][i];return o.emit(e)}t.connect=e,t.listenTo=n,t.trigger=i}(h=n.Signalable||(n.Signalable={}));var c=new WeakMap,_=new WeakMap,p=new Set},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(318),r=t(20),o=t(14),s=t(5),a=t(43),l=t(30),u=t(3);n.UIEvents=function(){function t(t,e,n,i){this.plot_view=t,this.toolbar=e,this.hit_area=n,this.plot=i,this.tap=new r.Signal(this,"tap"),this.doubletap=new r.Signal(this,"doubletap"),this.press=new r.Signal(this,"press"),this.pan_start=new r.Signal(this,"pan:start"),this.pan=new r.Signal(this,"pan"),this.pan_end=new r.Signal(this,"pan:end"),this.pinch_start=new r.Signal(this,"pinch:start"),this.pinch=new r.Signal(this,"pinch"),this.pinch_end=new r.Signal(this,"pinch:end"),this.rotate_start=new r.Signal(this,"rotate:start"),this.rotate=new r.Signal(this,"rotate"),this.rotate_end=new r.Signal(this,"rotate:end"),this.move_enter=new r.Signal(this,"move:enter"),this.move=new r.Signal(this,"move"),this.move_exit=new r.Signal(this,"move:exit"),this.scroll=new r.Signal(this,"scroll"),this.keydown=new r.Signal(this,"keydown"),this.keyup=new r.Signal(this,"keyup"),this._configure_hammerjs()}return t.prototype._configure_hammerjs=function(){var t=this;return this.hammer=new i(this.hit_area),this.hammer.get("doubletap").recognizeWith("tap"),this.hammer.get("tap").requireFailure("doubletap"),this.hammer.get("doubletap").dropRequireFailure("tap"),this.hammer.on("doubletap",function(e){return t._doubletap(e)}),this.hammer.on("tap",function(e){return t._tap(e)}),this.hammer.on("press",function(e){return t._press(e)}),this.hammer.get("pan").set({direction:i.DIRECTION_ALL}),this.hammer.on("panstart",function(e){return t._pan_start(e)}),this.hammer.on("pan",function(e){return t._pan(e)}),this.hammer.on("panend",function(e){return t._pan_end(e)}),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("pinchstart",function(e){return t._pinch_start(e)}),this.hammer.on("pinch",function(e){return t._pinch(e)}),this.hammer.on("pinchend",function(e){return t._pinch_end(e)}),this.hammer.get("rotate").set({enable:!0}),this.hammer.on("rotatestart",function(e){return t._rotate_start(e)}),this.hammer.on("rotate",function(e){return t._rotate(e)}),this.hammer.on("rotateend",function(e){return t._rotate_end(e)}),this.hit_area.addEventListener("mousemove",function(e){return t._mouse_move(e)}),this.hit_area.addEventListener("mouseenter",function(e){return t._mouse_enter(e)}),this.hit_area.addEventListener("mouseleave",function(e){return t._mouse_exit(e)}),this.hit_area.addEventListener("wheel",function(e){return t._mouse_wheel(e)}),document.addEventListener("keydown",function(e){return t._key_down(e)}),document.addEventListener("keyup",function(e){return t._key_up(e)})},t.prototype.register_tool=function(t){var e,n,i,r;if(e=t.model.event_type,n=t.model.id,i=t.model.type,null==e)return void o.logger.debug("Button tool: "+i);switch(r=t,e){case"pan":null!=r._pan_start&&r.connect(this.pan_start,function(t){if(t.id===n)return r._pan_start(t.e)}),null!=r._pan&&r.connect(this.pan,function(t){if(t.id===n)return r._pan(t.e)}),null!=r._pan_end&&r.connect(this.pan_end,function(t){if(t.id===n)return r._pan_end(t.e)});break;case"pinch":null!=r._pinch_start&&r.connect(this.pinch_start,function(t){if(t.id===n)return r._pinch_start(t.e)}),null!=r._pinch&&r.connect(this.pinch,function(t){if(t.id===n)return r._pinch(t.e)}),null!=r._pinch_end&&r.connect(this.pinch_end,function(t){if(t.id===n)return r._pinch_end(t.e)});break;case"rotate":null!=r._rotate_start&&r.connect(this.rotate_start,function(t){if(t.id===n)return r._rotate_start(t.e)}),null!=r._rotate&&r.connect(this.rotate,function(t){if(t.id===n)return r._rotate(t.e)}),null!=r._rotate_end&&r.connect(this.rotate_end,function(t){if(t.id===n)return r._rotate_end(t.e)});break;case"move":null!=r._move_enter&&r.connect(this.move_enter,function(t){if(t.id===n)return r._move_enter(t.e)}),null!=r._move&&r.connect(this.move,function(t){if(t.id===n)return r._move(t.e)}),null!=r._move_exit&&r.connect(this.move_exit,function(t){if(t.id===n)return r._move_exit(t.e)});break;case"tap":null!=r._tap&&r.connect(this.tap,function(t){if(t.id===n)return r._tap(t.e)});break;case"press":null!=r._press&&r.connect(this.press,function(t){if(t.id===n)return r._press(t.e)});break;case"scroll":null!=r._scroll&&r.connect(this.scroll,function(t){if(t.id===n)return r._scroll(t.e)});break;default:throw new Error("unsupported event_type: "+ev)}return null!=r._doubletap&&r.connect(this.doubletap,function(t){return r._doubletap(t.e)}),null!=r._keydown&&r.connect(this.keydown,function(t){return r._keydown(t.e)}),null!=r._keyup&&r.connect(this.keyup,function(t){return r._keyup(t.e)}),("ontouchstart"in window||navigator.maxTouchPoints>0)&&"pinch"===e?(o.logger.debug("Registering scroll on touch screen"),r.connect(this.scroll,function(t){if(t.id===n)return r._scroll(t.e)})):void 0},t.prototype._hit_test_renderers=function(t,e){var n,i,r,o;for(i=this.plot_view.get_renderer_views(),n=i.length-1;n>=0;n+=-1)if(o=i[n],("annotation"===(r=o.model.level)||"overlay"===r)&&null!=o.bbox&&o.bbox().contains(t,e))return o;return null},t.prototype._hit_test_frame=function(t,e){return this.plot_view.frame.bbox.contains(t,e)},t.prototype._trigger=function(t,e){var n,i,r,o,s,a,u,h,c,_,p;switch(a=t.name,o=a.split(":")[0],p=this._hit_test_renderers(e.bokeh.sx,e.bokeh.sy),o){case"move":for(i=this.toolbar.inspectors.filter(function(t){return t.active}),s="default",null!=p?(null!=p.model.cursor&&(s=p.model.cursor()),l.isEmpty(i)||(t=this.move_exit,a=t.name)):this._hit_test_frame(e.bokeh.sx,e.bokeh.sy)&&(l.isEmpty(i)||(s="crosshair")),this.plot_view.set_cursor(s),_=[],u=0,c=i.length;u<c;u++)h=i[u],_.push(this.trigger(t,e,h.id));return _;case"tap":if(null!=p&&"function"==typeof p.on_hit&&p.on_hit(e.bokeh.sx,e.bokeh.sy),n=this.toolbar.gestures[o].active,null!=n)return this.trigger(t,e,n.id);break;case"scroll":if(r="ontouchstart"in window||navigator.maxTouchPoints>0?"pinch":"scroll",n=this.toolbar.gestures[r].active,null!=n)return e.preventDefault(),e.stopPropagation(),this.trigger(t,e,n.id);break;default:if(n=this.toolbar.gestures[o].active,null!=n)return this.trigger(t,e,n.id)}},t.prototype.trigger=function(t,e,n){return void 0===n&&(n=null),t.emit({id:n,e:e})},t.prototype._event_sxy=function(t){var e,n;return i=s.offset(this.hit_area),e=i.left,n=i.top,{sx:t.pageX-e,sy:t.pageY-n};var i},t.prototype._bokify_hammer=function(t,e){void 0===e&&(e={});var n;return t.bokeh=l.extend(this._event_sxy(t.srcEvent),e),n=u.BokehEvent.event_class(t),null!=n?this.plot.trigger_event(n.from_event(t)):o.logger.debug("Unhandled event of type "+t.type)},t.prototype._bokify_point_event=function(t,e){void 0===e&&(e={});var n;return t.bokeh=l.extend(this._event_sxy(t),e),n=u.BokehEvent.event_class(t),null!=n?this.plot.trigger_event(n.from_event(t)):o.logger.debug("Unhandled event of type "+t.type)},t.prototype._tap=function(t){return this._bokify_hammer(t),this._trigger(this.tap,t)},t.prototype._doubletap=function(t){return this._bokify_hammer(t),this.trigger(this.doubletap,t)},t.prototype._press=function(t){return this._bokify_hammer(t),this._trigger(this.press,t)},t.prototype._pan_start=function(t){return this._bokify_hammer(t),t.bokeh.sx-=t.deltaX,t.bokeh.sy-=t.deltaY,this._trigger(this.pan_start,t)},t.prototype._pan=function(t){return this._bokify_hammer(t),this._trigger(this.pan,t)},t.prototype._pan_end=function(t){return this._bokify_hammer(t),this._trigger(this.pan_end,t)},t.prototype._pinch_start=function(t){return this._bokify_hammer(t),this._trigger(this.pinch_start,t)},t.prototype._pinch=function(t){return this._bokify_hammer(t),this._trigger(this.pinch,t)},t.prototype._pinch_end=function(t){return this._bokify_hammer(t),this._trigger(this.pinch_end,t)},t.prototype._rotate_start=function(t){return this._bokify_hammer(t),this._trigger(this.rotate_start,t)},t.prototype._rotate=function(t){return this._bokify_hammer(t),this._trigger(this.rotate,t)},t.prototype._rotate_end=function(t){return this._bokify_hammer(t),this._trigger(this.rotate_end,t)},t.prototype._mouse_enter=function(t){return this._bokify_point_event(t),this._trigger(this.move_enter,t)},t.prototype._mouse_move=function(t){return this._bokify_point_event(t),this._trigger(this.move,t)},t.prototype._mouse_exit=function(t){
  return this._bokify_point_event(t),this._trigger(this.move_exit,t)},t.prototype._mouse_wheel=function(t){return this._bokify_point_event(t,{delta:a.getDeltaY(t)}),this._trigger(this.scroll,t)},t.prototype._key_down=function(t){return this.trigger(this.keydown,t)},t.prototype._key_up=function(t){return this.trigger(this.keyup,t)},t}()},function(t,e,n){"use strict";function i(t){return t[0]}function r(t){return t[t.length-1]}function o(t){return t[t.length-1]}function s(t){return L.call(t)}function a(t){return(e=[]).concat.apply(e,t);var e}function l(t,e){return t.indexOf(e)!==-1}function u(t,e){return t[e>=0?e:t.length+e]}function h(t,e){for(var n=Math.min(t.length,e.length),i=new Array(n),r=0;r<n;r++)i[r]=[t[r],e[r]];return i}function c(t){for(var e=t.length,n=new Array(e),i=new Array(e),r=0;r<e;r++)o=t[r],n[r]=o[0],i[r]=o[1];return[n,i];var o}function _(t,e,n){void 0===n&&(n=1),null==e&&(e=t,t=0);for(var i=Math.max(Math.ceil((e-t)/n),0),r=Array(i),o=0;o<i;o++,t+=n)r[o]=t;return r}function p(t,e,n){void 0===n&&(n=100);for(var i=(e-t)/(n-1),r=new Array(n),o=0;o<n;o++)r[o]=t+i*o;return r}function d(t){for(var e=t.length,n=t[0].length,i=[],r=0;r<n;r++){i[r]=[];for(var o=0;o<e;o++)i[r][o]=t[o][r]}return i}function f(t){return t.reduce(function(t,e){return t+e},0)}function m(t){var e=[];return t.reduce(function(t,n,i){return e[i]=t+n},0),e}function v(t){for(var e,n=1/0,i=0,r=t.length;i<r;i++)e=t[i],e<n&&(n=e);return n}function g(t,e){if(0==t.length)throw new Error("minBy() called with an empty array");for(var n=t[0],i=e(n),r=1,o=t.length;r<o;r++){var s=t[r],a=e(s);a<i&&(n=s,i=a)}return n}function y(t){for(var e,n=-(1/0),i=0,r=t.length;i<r;i++)e=t[i],e>n&&(n=e);return n}function b(t,e){if(0==t.length)throw new Error("maxBy() called with an empty array");for(var n=t[0],i=e(n),r=1,o=t.length;r<o;r++){var s=t[r],a=e(s);a>i&&(n=s,i=a)}return n}function x(t){return g(_(t.length),function(e){return t[e]})}function w(t){return b(_(t.length),function(e){return t[e]})}function k(t,e){for(var n=0,i=t;n<i.length;n++){var r=i[n];if(!e(r))return!1}return!0}function M(t,e){for(var n=0,i=t;n<i.length;n++){var r=i[n];if(e(r))return!0}return!1}function S(t){return function(e,n){for(var i=e.length,r=t>0?0:i-1;r>=0&&r<i;r+=t)if(n(e[r]))return r;return-1}}function T(t,e){var i=n.findIndex(t,e);return i==-1?void 0:t[i]}function O(t,e){var i=n.findLastIndex(t,e);return i==-1?void 0:t[i]}function A(t,e){for(var n=0,i=t.length;n<i;){var r=Math.floor((n+i)/2);t[r]<e?n=r+1:i=r}return n}function E(t,e){var n=t.map(function(t,n){return{value:t,index:n,key:e(t)}});return n.sort(function(t,e){var n=t.key,i=e.key;if(n!==i){if(n>i||void 0===n)return 1;if(n<i||void 0===i)return-1}return t.index-e.index}),n.map(function(t){return t.value})}function j(t){for(var e=[],n=0,i=t;n<i.length;n++){var r=i[n];l(e,r)||e.push(r)}return e}function P(t,e){for(var n=[],i=[],r=0,o=t;r<o.length;r++){var s=o[r],a=e(s);l(i,a)||(i.push(a),n.push(s))}return n}function z(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return j(a(t))}function C(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=[];t:for(var r=0,o=t;r<o.length;r++){var s=o[r];if(!l(i,s)){for(var a=0,u=e;a<u.length;a++){var h=u[a];if(!l(h,s))continue t}i.push(s)}}return i}function N(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=a(e);return t.filter(function(t){return!l(i,t)})}function D(t,e){for(var n=0;n<t.length;)e(t[n])?t.splice(n,1):n++}function F(t){for(var e=t.length,n=new Array(e),i=0;i<e;i++){var r=R.randomIn(0,i);r!==i&&(n[i]=n[r]),n[r]=t[i]}return n}function I(t,e){for(var n=t.length,i=new Array(n-1),r=0;r<n-1;r++)i[r]=e(t[r],t[r+1]);return i}function B(t){for(var e=t.length,n=new Array(e),i=0;i<e;i++)n[e-i-1]=t[i];return n}
  //     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  //     Underscore may be freely distributed under the MIT license.
  Object.defineProperty(n,"__esModule",{value:!0});var R=t(29),L=Array.prototype.slice;n.head=i,n.tail=r,n.last=o,n.copy=s,n.concat=a,n.contains=l,n.nth=u,n.zip=h,n.unzip=c,n.range=_,n.linspace=p,n.transpose=d,n.sum=f,n.cumsum=m,n.min=v,n.minBy=g,n.max=y,n.maxBy=b,n.argmin=x,n.argmax=w,n.all=k,n.any=M,n.findIndex=S(1),n.findLastIndex=S(-1),n.find=T,n.findLast=O,n.sortedIndex=A,n.sortBy=E,n.uniq=j,n.uniqBy=P,n.union=z,n.intersection=C,n.difference=N,n.removeBy=D,n.shuffle=F,n.pairwise=I,n.reversed=B},function(t,e,n){"use strict";function i(){return{minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)}}function r(){return{minX:Number.MIN_VALUE,minY:-(1/0),maxX:1/0,maxY:1/0}}function o(){return{minX:-(1/0),minY:Number.MIN_VALUE,maxX:1/0,maxY:1/0}}function s(t,e){return{minX:a(t.minX,e.minX),maxX:l(t.maxX,e.maxX),minY:a(t.minY,e.minY),maxY:l(t.maxY,e.maxY)}}Object.defineProperty(n,"__esModule",{value:!0});var a=Math.min,l=Math.max;n.empty=i,n.positive_x=r,n.positive_y=o,n.union=s;var u=function(){function t(t){if("x0"in t&&"y0"in t&&"x1"in t&&"y1"in t){var e=t,n=e.x0,i=e.y0,r=e.x1,o=e.y1;if(!(n<=r&&i<=o))throw new Error("invalid bbox {x0: "+n+", y0: "+i+", x1: "+r+", y1: "+o+"}");this.x0=n,this.y0=i,this.x1=r,this.y1=o}else{var s=t,a=s.x,l=s.y,u=s.width,h=s.height;if(!(u>=0&&h>=0))throw new Error("invalid bbox {x: "+a+", y: "+l+", width: "+u+", height: "+h+"}");this.x0=a,this.y0=l,this.x1=a+u,this.y1=l+h}}return Object.defineProperty(t.prototype,"minX",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minY",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxX",{get:function(){return this.x1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxY",{get:function(){return this.y1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"p0",{get:function(){return[this.x0,this.y0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"p1",{get:function(){return[this.x1,this.y1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.x1-this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.y1-this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rect",{get:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"h_range",{get:function(){return{start:this.x0,end:this.x1}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v_range",{get:function(){return{start:this.y0,end:this.y1}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ranges",{get:function(){return[this.h_range,this.v_range]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"aspect",{get:function(){return this.width/this.height},enumerable:!0,configurable:!0}),t.prototype.contains=function(t,e){return t>=this.x0&&t<=this.x1&&e>=this.y0&&e<=this.y1},t.prototype.clip=function(t,e){return t<this.x0?t=this.x0:t>this.x1&&(t=this.x1),e<this.y0?e=this.y0:e>this.y1&&(e=this.y1),[t,e]},t.prototype.union=function(e){return new t({x0:a(this.x0,e.x0),y0:a(this.y0,e.y0),x1:l(this.x1,e.x1),y1:l(this.y1,e.y1)})},t}();n.BBox=u},function(t,e,n){"use strict";function i(t,e){return setTimeout(t,e)}function r(t){return a(t)}function o(t,e,n){void 0===n&&(n={});var i,r,o,s=null,a=0,l=function(){a=n.leading===!1?0:Date.now(),s=null,o=t.apply(i,r),s||(i=r=null)};return function(){var u=Date.now();a||n.leading!==!1||(a=u);var h=e-(u-a);return i=this,r=arguments,h<=0||h>e?(s&&(clearTimeout(s),s=null),a=u,o=t.apply(i,r),s||(i=r=null)):s||n.trailing===!1||(s=setTimeout(l,h)),o}}function s(t){var e,n=!1;return function(){return n||(n=!0,e=t()),e}}
  //     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  //     Underscore may be freely distributed under the MIT license.
  Object.defineProperty(n,"__esModule",{value:!0}),n.delay=i;var a="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;n.defer=r,n.throttle=o,n.once=s},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a;o=function(t){if(t.setLineDash||(t.setLineDash=function(e){return t.mozDash=e,t.webkitLineDash=e}),!t.getLineDash)return t.getLineDash=function(){return t.mozDash}},s=function(t){return t.setLineDashOffset=function(e){return t.lineDashOffset=e,t.mozDashOffset=e,t.webkitLineDashOffset=e},t.getLineDashOffset=function(){return t.mozDashOffset}},r=function(t){return t.setImageSmoothingEnabled=function(e){return t.imageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.oImageSmoothingEnabled=e,t.webkitImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e},t.getImageSmoothingEnabled=function(){var e;return null==(e=t.imageSmoothingEnabled)||e}},a=function(t){if(t.measureText&&null==t.html5MeasureText)return t.html5MeasureText=t.measureText,t.measureText=function(e){var n;return n=t.html5MeasureText(e),n.ascent=1.6*t.html5MeasureText("m").width,n}},i=function(t){var e;if(e=function(e,n,i,r,o,s,a,l){void 0===l&&(l=!1);var u,h,c;u=.551784,t.translate(e,n),t.rotate(o),h=i,c=r,l&&(h=-i,c=-r),t.moveTo(-h,0),t.bezierCurveTo(-h,c*u,-h*u,c,0,c),t.bezierCurveTo(h*u,c,h,c*u,h,0),t.bezierCurveTo(h,-c*u,h*u,-c,0,-c),t.bezierCurveTo(-h*u,-c,-h,-c*u,-h,0),t.rotate(-o),t.translate(-e,-n)},!t.ellipse)return t.ellipse=e},n.fixup_ctx=function(t){return o(t),s(t),r(t),a(t),i(t)},n.get_scale_ratio=function(t,e,n){var i,r;return"svg"===n?1:e?(r=window.devicePixelRatio||1,i=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1,r/i):1}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=[].indexOf,o=t(38);i=function(t){var e;return e=Number(t).toString(16),e=1===e.length?"0"+e:e},n.color2hex=function(t){var e,n,r,s;return t+="",0===t.indexOf("#")?t:null!=o[t]?o[t]:0===t.indexOf("rgb")?(r=t.replace(/^rgba?\(|\s+|\)$/g,"").split(","),e=function(){var t,e,n,o;for(n=r.slice(0,3),o=[],t=0,e=n.length;t<e;t++)s=n[t],o.push(i(s));return o}().join(""),4===r.length&&(e+=i(Math.floor(255*parseFloat(r.slice(3))))),n="#"+e.slice(0,8)):t},n.color2rgba=function(t,e){void 0===e&&(e=1);var i,r,o;if(!t)return[0,0,0,0];for(i=n.color2hex(t),i=i.replace(/ |#/g,""),i.length<=4&&(i=i.replace(/(.)/g,"$1$1")),i=i.match(/../g),o=function(){var t,e,n;for(n=[],t=0,e=i.length;t<e;t++)r=i[t],n.push(parseInt(r,16)/255);return n}();o.length<3;)o.push(0);return o.length<4&&o.push(e),o.slice(0,4)},n.valid_rgb=function(t){var e,n,i,o;switch(t.substring(0,4)){case"rgba":n={start:"rgba(",len:4,alpha:!0};break;case"rgb(":n={start:"rgb(",len:3,alpha:!1};break;default:return!1}if(new RegExp(".*?(\\.).*(,)").test(t))throw new Error("color expects integers for rgb in rgb/rgba tuple, received "+t);if(e=t.replace(n.start,"").replace(")","").split(",").map(parseFloat),e.length!==n.len)throw new Error("color expects rgba "+expect_len+"-tuple, received "+t);if(n.alpha&&!(0<=(i=e[3])&&i<=1))throw new Error("color expects rgba 4-tuple to have alpha value between 0 and 1");if(r.call(function(){var t,n,i,r;for(i=e.slice(0,3),r=[],t=0,n=i.length;t<n;t++)o=i[t],r.push(0<=o&&o<=255);return r}(),!1)>=0)throw new Error("color expects rgb to have value between 0 and 255");return!0}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(22),r=t(28),o=t(42),s=function(){function t(){this._dict={}}return t.prototype._existing=function(t){return t in this._dict?this._dict[t]:null},t.prototype.add_value=function(t,e){var n=this._existing(t);null==n?this._dict[t]=e:o.isArray(n)?n.push(e):this._dict[t]=[n,e]},t.prototype.remove_value=function(t,e){var n=this._existing(t);if(o.isArray(n)){var s=i.difference(n,[e]);s.length>0?this._dict[t]=s:delete this._dict[t]}else r.isEqual(n,e)&&delete this._dict[t]},t.prototype.get_one=function(t,e){var n=this._existing(t);if(o.isArray(n)){if(1===n.length)return n[0];throw new Error(e)}return n},t}();n.MultiDict=s;var a=function(){function t(e){null==e?this.values=[]:e instanceof t?this.values=i.copy(e.values):this.values=this._compact(e)}return t.prototype._compact=function(t){for(var e=[],n=0,i=t;n<i.length;n++){var r=i[n];e.indexOf(r)===-1&&e.push(r)}return e},t.prototype.push=function(t){this.missing(t)&&this.values.push(t)},t.prototype.remove=function(t){var e=this.values.indexOf(t);this.values=this.values.slice(0,e).concat(this.values.slice(e+1))},t.prototype.length=function(){return this.values.length},t.prototype.includes=function(t){return this.values.indexOf(t)!=-1},t.prototype.missing=function(t){return!this.includes(t)},t.prototype.slice=function(t,e){return this.values.slice(t,e)},t.prototype.join=function(t){return this.values.join(t)},t.prototype.toString=function(){return this.join(", ")},t.prototype.union=function(e){return e=new t(e),new t(this.values.concat(e.values))},t.prototype.intersect=function(e){e=new t(e);for(var n=new t,i=0,r=e.values;i<r.length;i++){var o=r[i];this.includes(o)&&e.includes(o)&&n.push(o)}return n},t.prototype.diff=function(e){e=new t(e);for(var n=new t,i=0,r=this.values;i<r.length;i++){var o=r[i];e.missing(o)&&n.push(o)}return n},t}();n.Set=a},function(t,e,n){"use strict";function i(t,e,n,r){if(t===e)return 0!==t||1/t===1/e;if(null==t||null==e)return t===e;var a=s.call(t);if(a!==s.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!==+t?+e!==+e:0===+t?1/+t===1/e:+t===+e;case"[object Date]":case"[object Boolean]":return+t===+e}var l="[object Array]"===a;if(!l){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,h=e.constructor;if(u!==h&&!(o.isFunction(u)&&u instanceof u&&o.isFunction(h)&&h instanceof h)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],r=r||[];for(var c=n.length;c--;)if(n[c]===t)return r[c]===e;if(n.push(t),r.push(e),l){if(c=t.length,c!==e.length)return!1;for(;c--;)if(!i(t[c],e[c],n,r))return!1}else{var _=Object.keys(t),p=void 0;if(c=_.length,Object.keys(e).length!==c)return!1;for(;c--;)if(p=_[c],!e.hasOwnProperty(p)||!i(t[p],e[p],n,r))return!1}return n.pop(),r.pop(),!0}function r(t,e){return i(t,e)}
  //     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  //     Underscore may be freely distributed under the MIT license.
  Object.defineProperty(n,"__esModule",{value:!0});var o=t(42),s=Object.prototype.toString;n.isEqual=r},function(t,e,n){"use strict";function i(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}function r(t,e){return Math.abs(i(t-e))}function o(t,e,n,o){var s=i(t),a=r(e,n),l=r(e,s)<=a&&r(s,n)<=a;return"anticlock"==o?l:!l}function s(){return Math.random()}function a(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}function l(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])}function u(t,e){for(var n,i;;)if(n=s(),i=s(),i=(2*i-1)*Math.sqrt(2*(1/Math.E)),-4*n*n*Math.log(n)>=i*i)break;var r=i/n;return r=t+e*r}function h(t,e,n){return t>n?n:t<e?e:t}Object.defineProperty(n,"__esModule",{value:!0}),n.angle_norm=i,n.angle_dist=r,n.angle_between=o,n.random=s,n.randomIn=a,n.atan2=l,n.rnorm=u,n.clamp=h},function(t,e,n){"use strict";function i(t){for(var e=Object.keys(t),n=e.length,i=new Array(n),r=0;r<n;r++)i[r]=t[e[r]];return i}function r(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0,r=e;i<r.length;i++){var o=r[i];for(var s in o)o.hasOwnProperty(s)&&(t[s]=o[s])}return t}function o(t){return r({},t)}function s(t,e){for(var n=Object.create(Object.prototype),i=u.concat([Object.keys(t),Object.keys(e)]),r=0,o=i;r<o.length;r++){var s=o[r],a=t.hasOwnProperty(s)?t[s]:[],l=e.hasOwnProperty(s)?e[s]:[];n[s]=u.union(a,l)}return n}function a(t){return Object.keys(t).length}function l(t){return 0===a(t)}Object.defineProperty(n,"__esModule",{value:!0});var u=t(22);n.keys=Object.keys,n.values=i,n.extend=r,n.clone=o,n.merge=s,n.size=a,n.isEmpty=l},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(345);n.proj4=r;var o=t(333),s=t(339),a=t(349),l=t(358);r.defaultDatum="WGS84",r.WGS84=new o("WGS84"),r.Proj=o,r.toPoint=s,r.defs=a,r.transform=l,n.mercator=a("GOOGLE"),n.wgs84=a("WGS84"),n.mercator_bounds={lon:[-20026376.39,20026376.39],lat:[-20048966.1,20048966.1]},i={lon:[-180,180],lat:[-85.06,85.06]},n.clip_mercator=function(t,e,i){var r,o;return s=n.mercator_bounds[i],o=s[0],r=s[1],[Math.max(t,o),Math.min(e,r)];var s},n.in_bounds=function(t,e){return t>i[e][0]&&t<i[e][1]}},function(t,e,n){"use strict";function i(t,e){for(var n=Math.min(t.length,e.length),i=new Array(n),r=new Array(n),s=0;s<n;s++){var a=o.proj4(o.mercator,[t[s],e[s]]),l=a[0],u=a[1];i[s]=l,r[s]=u}return[i,r]}function r(t,e){for(var n=Math.min(t.length,e.length),r=new Array(n),o=new Array(n),s=0;s<n;s++){var a=i(t[s],e[s]),l=a[0],u=a[1];r[s]=l,o[s]=u}return[r,o]}Object.defineProperty(n,"__esModule",{value:!0});var o=t(31);n.project_xy=i,n.project_xsys=r},function(t,e,n){"use strict";function i(t){if(!(t instanceof o.HasProps))throw new Error("can only create refs for HasProps subclasses");var e={type:t.type,id:t.id};return null!=t._subtype&&(e.subtype=t._subtype),e}function r(t){if(s.isObject(t)){var e=Object.keys(t).sort();if(2==e.length)return"id"==e[0]&&"type"==e[1];if(3==e.length)return"id"==e[0]&&"subtype"==e[1]&&"type"==e[2]}return!1}Object.defineProperty(n,"__esModule",{value:!0});var o=t(8),s=t(42);n.create_ref=i,n.is_ref=r},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.get_indices=function(t){var e;return e=t.selected,e["0d"].glyph?e["0d"].indices:e["1d"].indices.length>0?e["1d"].indices:e["2d"].indices.length>0?e["2d"].indices:[]}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a,l,u=t(42);n.ARRAY_TYPES={float32:Float32Array,float64:Float64Array,uint8:Uint8Array,int8:Int8Array,uint16:Uint16Array,int16:Int16Array,uint32:Uint32Array,int32:Int32Array},n.DTYPES={};for(a in n.ARRAY_TYPES)l=n.ARRAY_TYPES[a],n.DTYPES[l.name]=a;r=new ArrayBuffer(2),s=new Uint8Array(r),o=new Uint16Array(r),s[0]=170,s[1]=187,i=48042===o[0]?"little":"big",n.BYTE_ORDER=i,n.swap16=function(t){var e,n,i,r,o;for(o=new Uint8Array(t.buffer,t.byteOffset,2*t.length),e=n=0,i=o.length;n<i;e=n+=2)r=o[e],o[e]=o[e+1],o[e+1]=r;return null},n.swap32=function(t){var e,n,i,r,o;for(o=new Uint8Array(t.buffer,t.byteOffset,4*t.length),e=n=0,i=o.length;n<i;e=n+=4)r=o[e],o[e]=o[e+3],o[e+3]=r,r=o[e+1],o[e+1]=o[e+2],o[e+2]=r;return null},n.swap64=function(t){var e,n,i,r,o;for(o=new Uint8Array(t.buffer,t.byteOffset,8*t.length),e=n=0,i=o.length;n<i;e=n+=8)r=o[e],o[e]=o[e+7],o[e+7]=r,r=o[e+1],o[e+1]=o[e+6],o[e+6]=r,r=o[e+2],o[e+2]=o[e+5],o[e+5]=r,r=o[e+3],o[e+3]=o[e+4],o[e+4]=r;return null},n.process_buffer=function(t,e){var i,o,s,a,l,u,h;for(u=t.order!==n.BYTE_ORDER,h=t.shape,o=null,a=0,l=e.length;a<l;a++)if(r=e[a],s=JSON.parse(r[0]),s.id===t.__buffer__){o=r[1];break}return i=new n.ARRAY_TYPES[t.dtype](o),u&&(2===i.BYTES_PER_ELEMENT?n.swap16(i):4===i.BYTES_PER_ELEMENT?n.swap32(i):8===i.BYTES_PER_ELEMENT&&n.swap64(i)),[i,h]},n.process_array=function(t,e){return u.isObject(t)&&"__ndarray__"in t?n.decode_base64(t):u.isObject(t)&&"__buffer__"in t?n.process_buffer(t,e):u.isArray(t)?[t,[]]:void 0},n.arrayBufferToBase64=function(t){var e,n,i;return i=new Uint8Array(t),n=function(){var t,n,r;for(r=[],t=0,n=i.length;t<n;t++)e=i[t],r.push(String.fromCharCode(e));return r}(),btoa(n.join(""))},n.base64ToArrayBuffer=function(t){var e,n,i,r,o,s;for(e=atob(t),o=e.length,n=new Uint8Array(o),i=r=0,s=o;0<=s?r<s:r>s;i=0<=s?++r:--r)n[i]=e.charCodeAt(i);return n.buffer},n.decode_base64=function(t){var e,i,r,o;return i=n.base64ToArrayBuffer(t.__ndarray__),r=t.dtype,r in n.ARRAY_TYPES&&(e=new n.ARRAY_TYPES[r](i)),o=t.shape,[e,o]},n.encode_base64=function(t,e){var i,r,o;return i=n.arrayBufferToBase64(t.buffer),o=n.DTYPES[t.constructor.name],r={__ndarray__:i,shape:e,dtype:o}},n.decode_column_data=function(t,e){var i,r,o,s,h,c,_,p,d;h={},c={};for(a in t)if(l=t[a],u.isArray(l)){if(0===l.length||!u.isObject(l[0])&&!u.isArray(l[0])){h[a]=l;continue}for(r=[],d=[],o=0,s=l.length;o<s;o++)_=l[o],f=n.process_array(_,e),i=f[0],p=f[1],r.push(i),d.push(p);h[a]=r,c[a]=d}else m=n.process_array(l,e),i=m[0],p=m[1],h[a]=i,c[a]=p;return[h,c];var f,m},n.encode_column_data=function(t,e){var i,r,o,s,h,c,_;s={};for(a in t){if(l=t[a],(null!=l?l.buffer:void 0)instanceof ArrayBuffer)l=n.encode_base64(l,null!=e?e[a]:void 0);else if(u.isArray(l)){for(o=[],i=r=0,h=l.length;0<=h?r<h:r>h;i=0<=h?++r:--r)(null!=(c=l[i])?c.buffer:void 0)instanceof ArrayBuffer?o.push(n.encode_base64(l[i],null!=e&&null!=(_=e[a])?_[i]:void 0)):o.push(l[i]);l=o}s[a]=l}return s}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(361),o=function(){function t(){}return t}();n.SpatialIndex=o;var s=function(t){function e(e){var n=t.call(this)||this;return n.index=r(),n.index.load(e),n}return i.__extends(e,t),Object.defineProperty(e.prototype,"bbox",{get:function(){var t=this.index.toJSON(),e=t.minX,n=t.minY,i=t.maxX,r=t.maxY;return{minX:e,minY:n,maxX:i,maxY:r}},enumerable:!0,configurable:!0}),e.prototype.search=function(t){return this.index.search(t)},e.prototype.indices=function(t){for(var e=this.search(t),n=e.length,i=new Array(n),r=0;r<n;r++)i[r]=e[r].i;return i},e}(o);n.RBush=s},function(t,e,n){"use strict";function i(t,e,n){return void 0===n&&(n=0),t.substr(n,e.length)==e}function r(){for(var t=new Array(32),e="0123456789ABCDEF",n=0;n<32;n++)t[n]=e.substr(Math.floor(16*Math.random()),1);return t[12]="4",t[16]=e.substr(3&t[16].charCodeAt(0)|8,1),t.join("")}function o(t){var e=l.settings.dev?"j"+u++:r();return null!=t?t+"-"+e:e}function s(t){return t.replace(/(?:[&<>"'`])/g,function(t){switch(t){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&#x27;";case"`":return"&#x60;";default:return t}})}function a(t){return t.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,function(t,e){switch(e){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"#x27":return"'";case"#x60":return"`";default:return e}})}Object.defineProperty(n,"__esModule",{value:!0});var l=t(19);n.startsWith=i,n.uuid4=r;var u=1e3;n.uniqueId=o,n.escape=s,n.unescape=a},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.indianred="#CD5C5C",n.lightcoral="#F08080",n.salmon="#FA8072",n.darksalmon="#E9967A",n.lightsalmon="#FFA07A",n.crimson="#DC143C",n.red="#FF0000",n.firebrick="#B22222",n.darkred="#8B0000",n.pink="#FFC0CB",n.lightpink="#FFB6C1",n.hotpink="#FF69B4",n.deeppink="#FF1493",n.mediumvioletred="#C71585",n.palevioletred="#DB7093",n.coral="#FF7F50",n.tomato="#FF6347",n.orangered="#FF4500",n.darkorange="#FF8C00",n.orange="#FFA500",n.gold="#FFD700",n.yellow="#FFFF00",n.lightyellow="#FFFFE0",n.lemonchiffon="#FFFACD",n.lightgoldenrodyellow="#FAFAD2",n.papayawhip="#FFEFD5",n.moccasin="#FFE4B5",n.peachpuff="#FFDAB9",n.palegoldenrod="#EEE8AA",n.khaki="#F0E68C",n.darkkhaki="#BDB76B",n.lavender="#E6E6FA",n.thistle="#D8BFD8",n.plum="#DDA0DD",n.violet="#EE82EE",n.orchid="#DA70D6",n.fuchsia="#FF00FF",n.magenta="#FF00FF",n.mediumorchid="#BA55D3",n.mediumpurple="#9370DB",n.blueviolet="#8A2BE2",n.darkviolet="#9400D3",n.darkorchid="#9932CC",n.darkmagenta="#8B008B",n.purple="#800080",n.indigo="#4B0082",n.slateblue="#6A5ACD",n.darkslateblue="#483D8B",n.mediumslateblue="#7B68EE",n.greenyellow="#ADFF2F",n.chartreuse="#7FFF00",n.lawngreen="#7CFC00",n.lime="#00FF00",n.limegreen="#32CD32",n.palegreen="#98FB98",n.lightgreen="#90EE90",n.mediumspringgreen="#00FA9A",n.springgreen="#00FF7F",n.mediumseagreen="#3CB371",n.seagreen="#2E8B57",n.forestgreen="#228B22",n.green="#008000",n.darkgreen="#006400",n.yellowgreen="#9ACD32",n.olivedrab="#6B8E23",n.olive="#808000",n.darkolivegreen="#556B2F",n.mediumaquamarine="#66CDAA",n.darkseagreen="#8FBC8F",n.lightseagreen="#20B2AA",n.darkcyan="#008B8B",n.teal="#008080",n.aqua="#00FFFF",n.cyan="#00FFFF",n.lightcyan="#E0FFFF",n.paleturquoise="#AFEEEE",n.aquamarine="#7FFFD4",n.turquoise="#40E0D0",n.mediumturquoise="#48D1CC",n.darkturquoise="#00CED1",n.cadetblue="#5F9EA0",n.steelblue="#4682B4",n.lightsteelblue="#B0C4DE",n.powderblue="#B0E0E6",n.lightblue="#ADD8E6",n.skyblue="#87CEEB",n.lightskyblue="#87CEFA",n.deepskyblue="#00BFFF",n.dodgerblue="#1E90FF",n.cornflowerblue="#6495ED",n.royalblue="#4169E1",n.blue="#0000FF",n.mediumblue="#0000CD",n.darkblue="#00008B",n.navy="#000080",n.midnightblue="#191970",n.cornsilk="#FFF8DC",n.blanchedalmond="#FFEBCD",n.bisque="#FFE4C4",n.navajowhite="#FFDEAD",n.wheat="#F5DEB3",n.burlywood="#DEB887",n.tan="#D2B48C",n.rosybrown="#BC8F8F",n.sandybrown="#F4A460",n.goldenrod="#DAA520",n.darkgoldenrod="#B8860B",n.peru="#CD853F",n.chocolate="#D2691E",n.saddlebrown="#8B4513",n.sienna="#A0522D",n.brown="#A52A2A",n.maroon="#800000",n.white="#FFFFFF",n.snow="#FFFAFA",n.honeydew="#F0FFF0",n.mintcream="#F5FFFA",n.azure="#F0FFFF",n.aliceblue="#F0F8FF",n.ghostwhite="#F8F8FF",n.whitesmoke="#F5F5F5",n.seashell="#FFF5EE",n.beige="#F5F5DC",n.oldlace="#FDF5E6",n.floralwhite="#FFFAF0",n.ivory="#FFFFF0",n.antiquewhite="#FAEBD7",n.linen="#FAF0E6",n.lavenderblush="#FFF0F5",n.mistyrose="#FFE4E1",n.gainsboro="#DCDCDC",n.lightgray="#D3D3D3",n.lightgrey="#D3D3D3",n.silver="#C0C0C0",n.darkgray="#A9A9A9",n.darkgrey="#A9A9A9",n.gray="#808080",n.grey="#808080",n.dimgray="#696969",n.dimgrey="#696969",n.lightslategray="#778899",n.lightslategrey="#778899",n.slategray="#708090",n.slategrey="#708090",n.darkslategray="#2F4F4F",n.darkslategrey="#2F4F4F",n.black="#000000"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(362),o=t(332),s=t(363),a=t(37),l=t(42);i=function(t){var e;return l.isNumber(t)?(e=function(){switch(!1){case Math.floor(t)!==t:return"%d";case!(Math.abs(t)>.1&&Math.abs(t)<1e3):return"%0.3f";default:return"%0.3e"}}(),r.sprintf(e,t)):""+t},n.replace_placeholders=function(t,e,n,l,u){return void 0===u&&(u={}),t=t.replace(/(^|[^\$])\$(\w+)/g,function(t,e,n){return e+"@$"+n}),t=t.replace(/(^|[^@])@(?:(\$?\w+)|{([^{}]+)})(?:{([^{}]+)})?/g,function(t,h,c,_,p){var d,f,m;if(c=null!=_?_:c,m="$"===c[0]?u[c.substring(1)]:null!=(d=e.get_column(c))?d[n]:void 0,f=null,null==m)f="???";else{if("safe"===p)return""+h+m;if(null!=p)if(null!=l&&c in l)if("numeral"===l[c])f=o.format(m,p);else if("datetime"===l[c])f=s(m,p);else{if("printf"!==l[c])throw new Error("Unknown tooltip field formatter type '"+l[c]+"'");f=r.sprintf(p,m)}else f=o.format(m,p);else f=i(m)}return f=""+h+a.escape(f)})}},function(t,e,n){"use strict";function i(t){if(null!=o[t])return o[t];var e=r.span({style:{font:t}},"Hg"),n=r.div({style:{display:"inline-block",width:"1px",height:"0px"}}),i=r.div({},e,n);document.body.appendChild(i);try{n.style.verticalAlign="baseline";var s=r.offset(n).top-r.offset(e).top;n.style.verticalAlign="bottom";var a=r.offset(n).top-r.offset(e).top,l={height:a,ascent:s,descent:a-s};return o[t]=l,l}finally{document.body.removeChild(i)}}Object.defineProperty(n,"__esModule",{value:!0});var r=t(5),o={};n.get_text_height=i},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r;i=function(t){return t()},r=("undefined"!=typeof window&&null!==window?window.requestAnimationFrame:void 0)||("undefined"!=typeof window&&null!==window?window.mozRequestAnimationFrame:void 0)||("undefined"!=typeof window&&null!==window?window.webkitRequestAnimationFrame:void 0)||("undefined"!=typeof window&&null!==window?window.msRequestAnimationFrame:void 0)||i,n.throttle=function(t,e){var n,i,o,s,a,l,u;return h=[null,null,null,null],i=h[0],n=h[1],u=h[2],l=h[3],a=0,s=!1,o=function(){return a=new Date,u=null,s=!1,l=t.apply(i,n)},function(){var t,h;return t=new Date,h=e-(t-a),i=this,n=arguments,h<=0&&!s?(clearTimeout(u),s=!0,r(o)):u||s||(u=setTimeout(function(){return r(o)},h)),l};var h}},function(t,e,n){"use strict";function i(t){return t===!0||t===!1||"[object Boolean]"===c.call(t)}function r(t){return"[object Number]"===c.call(t)}function o(t){return r(t)&&isFinite(t)&&Math.floor(t)===t}function s(t){return"[object String]"===c.call(t)}function a(t){return r(t)&&t!==+t}function l(t){return"[object Function]"===c.call(t)}function u(t){return Array.isArray(t)}function h(t){var e=typeof t;return"function"===e||"object"===e&&!!t}
  //     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  //     Underscore may be freely distributed under the MIT license.
  Object.defineProperty(n,"__esModule",{value:!0});var c=Object.prototype.toString;n.isBoolean=i,n.isNumber=r,n.isInteger=o,n.isString=s,n.isStrictNaN=a,n.isFunction=l,n.isArray=u,n.isObject=h},function(t,e,n){"use strict";function i(t){var e=getComputedStyle(t).fontSize;return null!=e?parseInt(e,10):null}function r(t){var e=t.offsetParent||document.body;return i(e)||i(t)||16}function o(t){return t.clientHeight}function s(t){var e=-t.deltaY;if(t.target instanceof HTMLElement)switch(t.deltaMode){case t.DOM_DELTA_LINE:e*=r(t.target);break;case t.DOM_DELTA_PAGE:e*=o(t.target)}return e}/*!
   * jQuery Mousewheel 3.1.13
   *
   * Copyright jQuery Foundation and other contributors
   * Released under the MIT license
   * http://jquery.org/license
   */
  Object.defineProperty(n,"__esModule",{value:!0}),n.getDeltaY=s},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(29);n.scale_highlow=function(t,e,n){void 0===n&&(n=null);var i,r,o,s,a;return l=[t.start,t.end],r=l[0],i=l[1],o=null!=n?n:(i+r)/2,s=r-(r-o)*e,a=i-(i-o)*e,[s,a];var l},n.get_info=function(t,e){var n,i,r,o,s,a=e[0],l=e[1];i={};for(r in t)o=t[r],u=o.r_invert(a,l),s=u[0],n=u[1],i[r]={start:s,end:n};return i;var u},n.scale_range=function(t,e,r,o,s){void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===s&&(s=null);var a,l,u,h,c,_,p,d;return e=i.clamp(e,-.9,.9),a=r?e:0,f=n.scale_highlow(t.bbox.h_range,a,null!=s?s.x:void 0),l=f[0],u=f[1],p=n.get_info(t.xscales,[l,u]),_=o?e:0,m=n.scale_highlow(t.bbox.v_range,_,null!=s?s.y:void 0),h=m[0],c=m[1],d=n.get_info(t.yscales,[h,c]),{xrs:p,yrs:d,factor:e};var f,m}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(20),r=t(37),o=t(30),s=function(){function t(t){void 0===t&&(t={});var e;if(this.removed=new i.Signal(this,"removed"),null==t.model)throw new Error("model of a view wasn't configured");this.model=t.model,this._parent=t.parent,this.id=null!=(e=t.id)?e:r.uniqueId(),this.initialize(t),t.connect_signals!==!1&&this.connect_signals()}return t.getters=function(t){var e,n,i;i=[];for(n in t)e=t[n],i.push(Object.defineProperty(this.prototype,n,{get:e}));return i},t.prototype.initialize=function(t){},t.prototype.remove=function(){return this._parent=void 0,this.disconnect_signals(),this.removed.emit()},t.prototype.toString=function(){return this.model.type+"View("+this.id+")"},t.prototype.connect_signals=function(){},t.prototype.disconnect_signals=function(){return i.Signal.disconnectReceiver(this)},t}();n.View=s,o.extend(s.prototype,i.Signalable),s.getters({parent:function(){if(void 0!==this._parent)return this._parent;throw new Error("parent of a view wasn't configured")},is_root:function(){return null===this.parent},root:function(){return this.is_root?this:this.parent.root}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o={}.hasOwnProperty,s=t(16),a=t(26);i=function(){function t(t,e){void 0===e&&(e="");var n,i,r,o,s;for(this.obj=t,this.prefix=e,this.cache={},i=t.properties[e+this.do_attr].spec,this.doit=null!==i.value,s=this.attrs,r=0,o=s.length;r<o;r++)n=s[r],this[n]=t.properties[e+n]}return t.prototype.warm_cache=function(t){var e,n,i,r,o,s;for(o=this.attrs,s=[],n=0,i=o.length;n<i;n++)e=o[n],r=this.obj.properties[this.prefix+e],void 0!==r.spec.value?s.push(this.cache[e]=r.spec.value):s.push(this.cache[e+"_array"]=r.array(t));return s},t.prototype.cache_select=function(t,e){var n;return n=this.obj.properties[this.prefix+t],void 0!==n.spec.value?this.cache[t]=n.spec.value:this.cache[t]=this.cache[t+"_array"][e]},t.prototype.set_vectorize=function(t,e){return null!=this.all_indices?this._set_vectorize(t,this.all_indices[e]):this._set_vectorize(t,e)},t}();var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.set_value=function(t){return t.strokeStyle=this.line_color.value(),t.globalAlpha=this.line_alpha.value(),t.lineWidth=this.line_width.value(),t.lineJoin=this.line_join.value(),t.lineCap=this.line_cap.value(),t.setLineDash(this.line_dash.value()),t.setLineDashOffset(this.line_dash_offset.value())},e.prototype._set_vectorize=function(t,e){if(this.cache_select("line_color",e),t.strokeStyle!==this.cache.line_color&&(t.strokeStyle=this.cache.line_color),this.cache_select("line_alpha",e),t.globalAlpha!==this.cache.line_alpha&&(t.globalAlpha=this.cache.line_alpha),this.cache_select("line_width",e),t.lineWidth!==this.cache.line_width&&(t.lineWidth=this.cache.line_width),this.cache_select("line_join",e),t.lineJoin!==this.cache.line_join&&(t.lineJoin=this.cache.line_join),this.cache_select("line_cap",e),t.lineCap!==this.cache.line_cap&&(t.lineCap=this.cache.line_cap),this.cache_select("line_dash",e),t.getLineDash()!==this.cache.line_dash&&t.setLineDash(this.cache.line_dash),this.cache_select("line_dash_offset",e),t.getLineDashOffset()!==this.cache.line_dash_offset)return t.setLineDashOffset(this.cache.line_dash_offset)},e.prototype.color_value=function(){var t;return t=a.color2rgba(this.line_color.value(),this.line_alpha.value()),"rgba("+255*t[0]+","+255*t[1]+","+255*t[2]+","+t[3]+")"},e}(i);n.Line=l,l.prototype.attrs=Object.keys(s.line()),l.prototype.do_attr="line_color";var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.set_value=function(t){return t.fillStyle=this.fill_color.value(),t.globalAlpha=this.fill_alpha.value()},e.prototype._set_vectorize=function(t,e){if(this.cache_select("fill_color",e),t.fillStyle!==this.cache.fill_color&&(t.fillStyle=this.cache.fill_color),this.cache_select("fill_alpha",e),t.globalAlpha!==this.cache.fill_alpha)return t.globalAlpha=this.cache.fill_alpha},e.prototype.color_value=function(){var t;return t=a.color2rgba(this.fill_color.value(),this.fill_alpha.value()),"rgba("+255*t[0]+","+255*t[1]+","+255*t[2]+","+t[3]+")"},e}(i);n.Fill=u,u.prototype.attrs=Object.keys(s.fill()),u.prototype.do_attr="fill_color";var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.cache_select=function(e,n){var i;return"font"===e?(i=t.prototype.cache_select.call(this,"text_font_style",n)+" "+t.prototype.cache_select.call(this,"text_font_size",n)+" "+t.prototype.cache_select.call(this,"text_font",n),this.cache.font=i):t.prototype.cache_select.call(this,e,n)},e.prototype.font_value=function(){var t,e,n;return t=this.text_font.value(),e=this.text_font_size.value(),n=this.text_font_style.value(),n+" "+e+" "+t},e.prototype.color_value=function(){var t;return t=a.color2rgba(this.text_color.value(),this.text_alpha.value()),"rgba("+255*t[0]+","+255*t[1]+","+255*t[2]+","+t[3]+")"},e.prototype.set_value=function(t){return t.font=this.font_value(),t.fillStyle=this.text_color.value(),t.globalAlpha=this.text_alpha.value(),t.textAlign=this.text_align.value(),t.textBaseline=this.text_baseline.value()},e.prototype._set_vectorize=function(t,e){if(this.cache_select("font",e),t.font!==this.cache.font&&(t.font=this.cache.font),this.cache_select("text_color",e),t.fillStyle!==this.cache.text_color&&(t.fillStyle=this.cache.text_color),this.cache_select("text_alpha",e),t.globalAlpha!==this.cache.text_alpha&&(t.globalAlpha=this.cache.text_alpha),this.cache_select("text_align",e),t.textAlign!==this.cache.text_align&&(t.textAlign=this.cache.text_align),this.cache_select("text_baseline",e),t.textBaseline!==this.cache.text_baseline)return t.textBaseline=this.cache.text_baseline},e}(i);n.Text=h,h.prototype.attrs=Object.keys(s.text()),h.prototype.do_attr="text_color",n.Visuals=function(){function t(t){var e,n,i,r,o,s,a;for(s=t.mixins,n=0,i=s.length;n<i;n++)a=s[n],c=a.split(":"),r=c[0],_=c[1],o=void 0===_?"":_,e=function(){switch(r){case"line":return l;case"fill":return u;case"text":return h}}(),this[o+r]=new e(t,o);var c,_}return t.prototype.warm_cache=function(t){var e,n,r,s;r=this,s=[];for(e in r)o.call(r,e)&&(n=r[e],n instanceof i?s.push(n.warm_cache(t)):s.push(void 0));return s},t.prototype.set_all_indices=function(t){var e,n,r,s;r=this,s=[];for(e in r)o.call(r,e)&&(n=r[e],n instanceof i?s.push(n.all_indices=t):s.push(void 0));return s},t}()},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=[].indexOf,o=t(0),s=t(248),a=t(14),l=t(3),u=t(8),h=t(20),c=t(33),_=t(35),p=t(27),d=t(22),f=t(30),m=t(28),v=t(42),g=t(139),y=t(173),b=function(){function t(t){this.document=t,this.session=null,this.subscribed_models=new p.Set}return t.prototype.send_event=function(t){null!=this.session&&this.session.send_event(t)},t.prototype.trigger=function(t){for(var e=0,n=this.subscribed_models.values;e<n.length;e++){var i=n[e];if(null==t.model_id||t.model_id===i){var r=this.document._all_models[i];null!=r&&r._process_event(t)}}},t}();n.EventManager=b,n.DocumentChangedEvent=function(){function t(t){this.document=t}return t}(),n.ModelChangedEvent=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e)||this;return a.model=n,a.attr=i,a.old=r,a.new_=o,a.setter_id=s,a}return i.__extends(e,t),e.prototype.json=function(t){var e,n,i,r;if("id"===this.attr)throw a.logger.warn("'id' field is immutable and should never be in a ModelChangedEvent ",this),new Error("'id' field should never change, whatever code just set it is wrong");n=this.new_,i=this.model.constructor._value_to_json(this.attr,n,this.model),r={},u.HasProps._value_record_references(n,r,!0),this.model.id in r&&this.model!==n&&delete r[this.model.id];for(e in r)t[e]=r[e];return{kind:"ModelChanged",model:this.model.ref(),attr:this.attr,"new":i}},e}(n.DocumentChangedEvent),n.TitleChangedEvent=function(t){function e(e,n,i){var r=t.call(this,document)||this;return r.document=e,r.title=n,r.setter_id=i,r}return i.__extends(e,t),e.prototype.json=function(t){return{kind:"TitleChanged",title:this.title}},e}(n.DocumentChangedEvent),n.RootAddedEvent=function(t){function e(e,n,i){var r=t.call(this,document)||this;return r.document=e,r.model=n,r.setter_id=i,r}return i.__extends(e,t),e.prototype.json=function(t){return u.HasProps._value_record_references(this.model,t,!0),{kind:"RootAdded",model:this.model.ref()}},e}(n.DocumentChangedEvent),n.RootRemovedEvent=function(t){function e(e,n,i){var r=t.call(this,document)||this;return r.document=e,r.model=n,r.setter_id=i,r}return i.__extends(e,t),e.prototype.json=function(t){return{kind:"RootRemoved",model:this.model.ref()}},e}(n.DocumentChangedEvent),n.documents=[],n.DEFAULT_TITLE="Bokeh Application";var x=function(){function t(){n.documents.push(this),this._init_timestamp=Date.now(),this._title=n.DEFAULT_TITLE,this._roots=[],this._all_models={},this._all_models_by_name=new p.MultiDict,this._all_models_freeze_count=0,this._callbacks=[],this.event_manager=new b(this),this.idle=new h.Signal(this,"idle"),this._idle_roots=new WeakMap,this._interactive_timestamp=null,this._interactive_plot=null}return t.prototype.notify_idle=function(t){if(this._idle_roots.set(t,!0),this.is_idle)return a.logger.info("document idle at "+(Date.now()-this._init_timestamp)+" ms"),this.idle.emit()},t.prototype.clear=function(){var t;this._push_all_models_freeze();try{for(t=[];this._roots.length>0;)t.push(this.remove_root(this._roots[0]));return t}finally{this._pop_all_models_freeze()}},t.prototype.interactive_start=function(t){return null===this._interactive_plot&&(this._interactive_plot=t,this._interactive_plot.trigger_event(new l.LODStart({}))),this._interactive_timestamp=Date.now()},t.prototype.interactive_stop=function(t){var e;return(null!=(e=this._interactive_plot)?e.id:void 0)===t.id&&this._interactive_plot.trigger_event(new l.LODEnd({})),this._interactive_plot=null,this._interactive_timestamp=null},t.prototype.interactive_duration=function(){return null===this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp},t.prototype.destructively_move=function(t){var e,n,i,r,o,s,a,l,u;if(t===this)throw new Error("Attempted to overwrite a document with itself");for(t.clear(),u=[],l=this._roots,e=0,i=l.length;e<i;e++)a=l[e],u.push(a);for(this.clear(),n=0,r=u.length;n<r;n++)if(a=u[n],null!==a.document)throw new Error("Somehow we didn't detach "+a);if(0!==Object.keys(this._all_models).length)throw new Error("@_all_models still had stuff in it: "+this._all_models);for(s=0,o=u.length;s<o;s++)a=u[s],t.add_root(a);return t.set_title(this._title)},t.prototype._push_all_models_freeze=function(){return this._all_models_freeze_count+=1},t.prototype._pop_all_models_freeze=function(){if(this._all_models_freeze_count-=1,0===this._all_models_freeze_count)return this._recompute_all_models()},t.prototype._invalidate_all_models=function(){if(a.logger.debug("invalidating document models"),0===this._all_models_freeze_count)return this._recompute_all_models()},t.prototype._recompute_all_models=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,d,m,v,g,y,b,x,w,k;for(c=new p.Set,g=this._roots,n=0,r=g.length;n<r;n++)m=g[n],c=c.union(m.references());for(d=new p.Set(f.values(this._all_models)),k=d.diff(c),w=c.diff(d),v={},y=c.values,i=0,o=y.length;i<o;i++)l=y[i],v[l.id]=l;for(b=k.values,u=0,s=b.length;u<s;u++)e=b[u],e.detach_document(),h=e.name,null!==h&&this._all_models_by_name.remove_value(h,e);for(x=w.values,_=0,a=x.length;_<a;_++)t=x[_],t.attach_document(this),h=t.name,null!==h&&this._all_models_by_name.add_value(h,t);return this._all_models=v},t.prototype.roots=function(){return this._roots},t.prototype.add_root=function(t,e){if(a.logger.debug("Adding root: "+t),!(r.call(this._roots,t)>=0)){this._push_all_models_freeze();try{this._roots.push(t)}finally{this._pop_all_models_freeze()}return this._trigger_on_change(new n.RootAddedEvent(this,t,e))}},t.prototype.remove_root=function(t,e){var i;if(i=this._roots.indexOf(t),!(i<0)){this._push_all_models_freeze();try{this._roots.splice(i,1)}finally{this._pop_all_models_freeze()}return this._trigger_on_change(new n.RootRemovedEvent(this,t,e))}},t.prototype.title=function(){return this._title},t.prototype.set_title=function(t,e){if(t!==this._title)return this._title=t,this._trigger_on_change(new n.TitleChangedEvent(this,t,e))},t.prototype.get_model_by_id=function(t){return t in this._all_models?this._all_models[t]:null},t.prototype.get_model_by_name=function(t){return this._all_models_by_name.get_one(t,"Multiple models are named '"+t+"'")},t.prototype.on_change=function(t){if(!(r.call(this._callbacks,t)>=0))return this._callbacks.push(t)},t.prototype.remove_on_change=function(t){var e;if(e=this._callbacks.indexOf(t),e>=0)return this._callbacks.splice(e,1)},t.prototype._trigger_on_change=function(t){var e,n,i,r,o;for(r=this._callbacks,o=[],n=0,i=r.length;n<i;n++)e=r[n],o.push(e(t));return o},t.prototype._notify_change=function(t,e,i,r,o){return"name"===e&&(this._all_models_by_name.remove_value(i,t),null!==r&&this._all_models_by_name.add_value(r,t)),this._trigger_on_change(new n.ModelChangedEvent(this,t,e,i,r,null!=o?o.setter_id:void 0))},t._references_json=function(t,e){void 0===e&&(e=!0);var n,i,r,o,s;for(s=[],n=0,i=t.length;n<i;n++)r=t[n],o=r.ref(),o.attributes=r.attributes_as_json(e),delete o.attributes.id,s.push(o);return s},t._instantiate_object=function(t,e,n){var i,r;return i=f.extend({},n,{id:t}),new(r=o.Models(e))(i,{silent:!0,defer_initialization:!0})},t._instantiate_references_json=function(e,n){var i,r,o,s,a,l,u,h;for(h={},r=0,o=e.length;r<o;r++)s=e[r],l=s.id,u=s.type,a=s.attributes,l in n?i=n[l]:(i=t._instantiate_object(l,u,a),"subtype"in s&&i.set_subtype(s.subtype)),h[i.id]=i;return h},t._resolve_refs=function(t,e,n){var i,r,o;return o=function(t){if(c.is_ref(t)){if(t.id in e)return e[t.id];if(t.id in n)return n[t.id];throw new Error("reference "+JSON.stringify(t)+" isn't known (not in Document?)")}return v.isArray(t)?i(t):v.isObject(t)?r(t):t},r=function(t){var e,n,i;n={};for(e in t)i=t[e],n[e]=o(i);return n},i=function(t){var e,n,i,r;for(i=[],e=0,n=t.length;e<n;e++)r=t[e],i.push(o(r));return i},o(t)},t._initialize_references_json=function(e,n,i){var r,o,s,a,l,h,c,_,p;for(_={},s=0,a=e.length;s<a;s++)l=e[s],c=l.id,h=l.attributes,p=!1,o=c in n?n[c]:(p=!0,i[c]),h=t._resolve_refs(h,n,i),_[o.id]=[o,h,p];return r=function(t,e){var n,i,r,o,s;n={},i=function(e,r){var o,s,a,l,h,c,_,d,f;if(e instanceof u.HasProps){if(!(e.id in n)&&e.id in t){n[e.id]=!0,m=t[e.id],f=m[0],s=m[1],p=m[2];for(o in s)a=s[o],i(a,r);return r(e,s,p)}}else{if(v.isArray(e)){for(_=[],h=0,c=e.length;h<c;h++)a=e[h],_.push(i(a,r));return _}if(v.isObject(e)){d=[];for(l in e)a=e[l],d.push(i(a,r));return d}}var m},o=[];for(r in t)s=t[r],o.push(i(s[0],e));return o},r(_,function(t,e,n){if(n)return t.setv(e,{silent:!0})}),r(_,function(t,e,n){if(n)return t.finalize(e)})},t._event_for_attribute_change=function(t,e,n,i,r){var o,s;return o=i.get_model_by_id(t.id),o.attribute_is_serializable(e)?(s={kind:"ModelChanged",model:{id:t.id,type:t.type},attr:e,"new":n},u.HasProps._json_record_references(i,n,r,!0),s):null},t._events_to_sync_objects=function(e,n,i,r){var o,s,l,u,h,c,_,p,f,v,g,y,b,x,w;for(l=Object.keys(e.attributes),w=Object.keys(n.attributes),b=d.difference(l,w),o=d.difference(w,l),x=d.intersection(l,w),s=[],u=0,_=b.length;u<_;u++)h=b[u],a.logger.warn("Server sent key "+h+" but we don't seem to have it in our JSON");for(c=0,p=o.length;c<p;c++)h=o[c],g=n.attributes[h],s.push(t._event_for_attribute_change(e,h,g,i,r));for(v=0,f=x.length;v<f;v++)h=x[v],y=e.attributes[h],g=n.attributes[h],null===y&&null===g||(null===y||null===g?s.push(t._event_for_attribute_change(e,h,g,i,r)):m.isEqual(y,g)||s.push(t._event_for_attribute_change(e,h,g,i,r)));return s.filter(function(t){return null!==t})},t._compute_patch_since_json=function(e,n){var i,r,o,s,a,l,u,h,c,_,p,m,v,g,y,b,x,w,k,M,S,T;for(x=n.to_json(l=!1),b=function(t){var e,n,i,r,o;for(o={},r=t.roots.references,e=0,n=r.length;e<n;e++)i=r[e],o[i.id]=i;return o},r=b(e),s={},o=[],v=e.roots.root_ids,u=0,c=v.length;u<c;u++)m=v[u],s[m]=r[m],o.push(m);for(w=b(x),M={},k=[],g=x.roots.root_ids,h=0,_=g.length;h<_;h++)m=g[h],M[m]=w[m],k.push(m);if(o.sort(),k.sort(),d.difference(o,k).length>0||d.difference(k,o).length>0)throw new Error("Not implemented: computing add/remove of document roots");T={},i=[],y=n._all_models;for(a in y)p=y[a],a in r&&(S=t._events_to_sync_objects(r[a],w[a],n,T),i=i.concat(S));return{events:i,references:t._references_json(f.values(T),l=!1)}},t.prototype.to_json_string=function(t){return void 0===t&&(t=!0),JSON.stringify(this.to_json(t))},t.prototype.to_json=function(e){void 0===e&&(e=!0);var n,i,r,o,s,a;for(s=[],o=this._roots,n=0,i=o.length;n<i;n++)r=o[n],s.push(r.id);return a=f.values(this._all_models),{title:this._title,roots:{root_ids:s,references:t._references_json(a,e)}}},t.from_json_string=function(e){var n;if(null===e||null==e)throw new Error("JSON string is "+typeof e);return n=JSON.parse(e),t.from_json(n)},t.from_json=function(e){var n,i,r,o,l,u,h,c,_,p,d;if(a.logger.debug("Creating Document from JSON"),"object"!=typeof e)throw new Error("JSON object has wrong type "+typeof e);for(l=e.version,i=l.indexOf("+")!==-1||l.indexOf("-")!==-1,d="Library versions: JS ("+s.version+")  /  Python ("+l+")",i||s.version===l?a.logger.debug(d):(a.logger.warn("JS/Python version mismatch"),a.logger.warn(d)),p=e.roots,_=p.root_ids,c=p.references,h=t._instantiate_references_json(c,{}),t._initialize_references_json(c,{},h),n=new t,r=0,o=_.length;r<o;r++)u=_[r],n.add_root(h[u]);return n.set_title(e.title),n},t.prototype.replace_with_json=function(e){var n;return n=t.from_json(e),n.destructively_move(this)},t.prototype.create_json_patch_string=function(t){return JSON.stringify(this.create_json_patch(t))},t.prototype.create_json_patch=function(e){var n,i,r,o,s,l;for(s={},r=[],i=0,o=e.length;i<o;i++){if(n=e[i],n.document!==this)throw a.logger.warn("Cannot create a patch using events from a different document, event had ",n.document," we are ",this),new Error("Cannot create a patch using events from a different document");r.push(n.json(s))}return l={events:r,references:t._references_json(f.values(s))}},t.prototype.apply_json_patch=function(e,n,i){var r,o,s,l,u,h,c,p,d,f,m,v,g,b,x,w,k,M,S,T,O,A,E,j,P,z,C;for(O=e.references,h=e.events,T=t._instantiate_references_json(O,this._all_models),p=0,m=h.length;p<m;p++)if(u=h[p],"model"in u)if(g=u.model.id,g in this._all_models)T[g]=this._all_models[g];else if(!(g in T))throw a.logger.warn("Got an event for unknown model ",u.model),new Error("event model wasn't known");w={},x={};for(c in T)C=T[c],c in this._all_models?w[c]=C:x[c]=C;for(t._initialize_references_json(O,w,x),A=[],f=0,v=h.length;f<v;f++)switch(u=h[f],u.kind){case"ModelChanged":if(k=u.model.id,!(k in this._all_models))throw new Error("Cannot apply patch to "+k+" which is not in the document");M=this._all_models[k],r=u.attr,b=u.model.type,"data"===r&&"ColumnDataSource"===b?(N=_.decode_column_data(u["new"],n),l=N[0],z=N[1],A.push(M.setv({_shapes:z,data:l},{setter_id:i}))):(C=t._resolve_refs(u["new"],w,x),A.push(M.setv((D={},D[""+r]=C,D),{setter_id:i})));break;case"ColumnDataChanged":if(s=u.column_source.id,!(s in this._all_models))throw new Error("Cannot stream to "+s+" which is not in the document");if(o=this._all_models[s],F=_.decode_column_data(u["new"],n),l=F[0],z=F[1],null!=u.cols){for(d in o.data)d in l||(l[d]=o.data[d]);for(d in o._shapes)d in z||(z[d]=o._shapes[d])}A.push(o.setv({_shapes:z,data:l},{setter_id:i,check_eq:!1}));break;case"ColumnsStreamed":if(s=u.column_source.id,!(s in this._all_models))throw new Error("Cannot stream to "+s+" which is not in the document");if(o=this._all_models[s],!(o instanceof y.ColumnDataSource))throw new Error("Cannot stream to non-ColumnDataSource");l=u.data,E=u.rollover,A.push(o.stream(l,E));break;case"ColumnsPatched":if(s=u.column_source.id,!(s in this._all_models))throw new Error("Cannot patch "+s+" which is not in the document");if(o=this._all_models[s],!(o instanceof y.ColumnDataSource))throw new Error("Cannot patch non-ColumnDataSource");S=u.patches,A.push(o.patch(S));break;case"RootAdded":j=u.model.id,P=T[j],A.push(this.add_root(P,i));break;case"RootRemoved":j=u.model.id,P=T[j],A.push(this.remove_root(P,i));break;case"TitleChanged":A.push(this.set_title(u.title,i));break;default:throw new Error("Unknown patch event "+JSON.stringify(u))}return A;var N,D,F},t}();n.Document=x,Object.defineProperty(x.prototype,"layoutables",{get:function(){var t,e,n,i,r;for(n=this._roots,i=[],t=0,e=n.length;t<e;t++)r=n[t],r instanceof g.LayoutDOM&&i.push(r);return i}}),Object.defineProperty(x.prototype,"is_idle",{get:function(){var t,e,n,i;for(n=this.layoutables,t=0,e=n.length;t<e;t++)if(i=n[t],!this._idle_roots.has(i))return!1;return!0}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a,l,u,h,c,_,p,d,f=t(0),m=t(1),v=t(14),g=t(47),y=t(5),b=t(24),x=t(246),w=t(42),k=t(37);n.BOKEH_ROOT="bk-root",s=function(t,e){if(e.buffers.length>0?t.consume(e.buffers[0].buffer):t.consume(e.content.data),e=t.message,null!=e)return this.apply_json_patch(e.content,e.buffers)},h=function(t,e,n){var i;if(t===n.target_name)return i=new x.Receiver,n.on_msg(s.bind(e,i))},a=function(t,e){var n,i,r,o,a,l;if("undefined"==typeof Jupyter||null===Jupyter||null==Jupyter.notebook.kernel)return console.warn("Jupyter notebooks comms not available. push_notebook() will not function");v.logger.info("Registering Jupyter comms for target "+t),n=Jupyter.notebook.kernel.comm_manager,l=function(n){return h(t,e,n)},a=n.comms;for(r in a)o=a[r],o.then(l);try{return n.register_target(t,function(n,i){var r;return v.logger.info("Registering Jupyter comms for target "+t),r=new x.Receiver,n.on_msg(s.bind(e,r))})}catch(u){return i=u,v.logger.warn("Jupyter comms failed to register. push_notebook() will not function. (exception reported: "+i+")")}},i=function(t){var e;return e=new t.default_view({model:t,parent:null}),f.index[t.id]=e,e},l=function(t,e,n){var r,o,s,a,l,u,h;h={},l=function(e){var n;return n=i(e),n.renderTo(t),h[e.id]=n},u=function(e){var n;if(e.id in h)return n=h[e.id],t.removeChild(n.el),delete h[e.id],delete f.index[e.id]},a=e.roots();for(r=0,o=a.length;r<o;r++)s=a[r],l(s);return n&&(window.document.title=e.title()),e.on_change(function(t){return t instanceof g.RootAddedEvent?l(t.model):t instanceof g.RootRemovedEvent?u(t.model):n&&t instanceof g.TitleChangedEvent?window.document.title=t.title:void 0}),h},p=function(t,e,n){var r,o;if(r=n.get_model_by_id(e),null==r)throw new Error("Model "+e+" was not in document "+n);return o=i(r),o.renderTo(t,!0)},n.add_document_static=function(t,e,n){return l(t,e,n)},n.add_document_standalone=function(t,e,n){return void 0===n&&(n=!1),l(e,t,n)},u={},o=function(t,e,n){var i;if(null==t)throw new Error("Missing websocket_url");return t in u||(u[t]={}),i=u[t],e in i||(i[e]=m.pull_session(t,e,n)),i[e]},c=function(t,e,n,i){var r,s;return r=window.location.search.substr(1),s=o(e,n,r),s.then(function(e){return l(t,e.document,i)},function(t){throw v.logger.error("Failed to load Bokeh session "+n+": "+t),t})},_=function(t,e,n,r){var s,a;return s=window.location.search.substr(1),a=o(e,r,s),a.then(function(e){var r,o;if(r=e.document.get_model_by_id(n),null==r)throw new Error("Did not find model "+n+" in session");return o=i(r),o.renderTo(t,!0)},function(t){throw v.logger.error("Failed to load Bokeh session "+r+": "+t),t})},n.inject_css=function(t){var e;return e=y.link({href:t,rel:"stylesheet",type:"text/css"}),document.body.appendChild(e)},n.inject_raw_css=function(t){var e;return e=y.style({},t),document.body.appendChild(e)},d=function(t,e){var n;return n=t.dataset,null!=n.bokehLogLevel&&n.bokehLogLevel.length>0&&v.set_log_level(n.bokehLogLevel),null!=n.bokehDocId&&n.bokehDocId.length>0&&(e.docid=n.bokehDocId),null!=n.bokehModelId&&n.bokehModelId.length>0&&(e.modelid=n.bokehModelId),null!=n.bokehSessionId&&n.bokehSessionId.length>0&&(e.sessionid=n.bokehSessionId),v.logger.info("Will inject Bokeh script tag with params "+JSON.stringify(e))},n.embed_items=function(t,e,n,i){return b.defer(function(){return r(t,e,n,i)})},r=function(t,e,i,r){var o,s,l,u,h,f,m,b,x,M,S,T,O,A,E;T="ws:","https:"===window.location.protocol&&(T="wss:"),null!=r?(M=document.createElement("a"),M.href=r):M=window.location,null!=i?"/"===i&&(i=""):i=M.pathname.replace(/\/+$/,""),E=T+"//"+M.host+i+"/ws",v.logger.debug("embed: computed ws url: "+E),w.isString(t)&&(t=JSON.parse(k.unescape(t))),u={};for(l in t)u[l]=g.Document.from_json(t[l]);for(O=[],m=0,x=e.length;m<x;m++){if(b=e[m],null!=b.notebook_comms_target&&a(b.notebook_comms_target,u[l]),f=b.elementid,h=document.getElementById(f),null==h)throw new Error("Error rendering Bokeh model: could not find tag with id: "+f);if(!document.body.contains(h))throw new Error("Error rendering Bokeh model: element with id '"+f+"' must be under <body>");if("SCRIPT"===h.tagName&&(d(h,b),s=y.div({"class":n.BOKEH_ROOT}),y.replaceWith(h,s),o=y.div(),s.appendChild(o),h=o),A=null!=b.use_for_title&&b.use_for_title,S=null,null!=b.modelid)if(null!=b.docid)p(h,b.modelid,u[b.docid]);else{if(null==b.sessionid)throw new Error("Error rendering Bokeh model "+b.modelid+" to element "+f+": no document ID or session ID specified");S=_(h,E,b.modelid,b.sessionid)}else if(null!=b.docid)n.add_document_static(h,u[b.docid],A);else{if(null==b.sessionid)throw new Error("Error rendering Bokeh document to element "+f+": no document ID or session ID specified");S=c(h,E,b.sessionid,A)}null!==S?O.push(S.then(function(t){return console.log("Bokeh items were rendered successfully")},function(t){return console.log("Error rendering Bokeh items ",t)})):O.push(void 0)}return O}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),t(244);var i=t(248);n.version=i.version;var r=t(48);n.embed=r;var o=t(14);n.logger=o.logger,n.set_log_level=o.set_log_level;var s=t(19);n.settings=s.settings;var a=t(0);n.Models=a.Models,n.index=a.index;var l=t(47);n.documents=l.documents;var u=t(247);n.safely=u.safely},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(8),o=t(15),s=t(42),a=t(30),l=t(14),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e,n,i,r,o,s,a;t.prototype.connect_signals.call(this),a=this.js_property_callbacks;for(r in a)for(n=a[r],l=r.split(":"),r=l[0],u=l[1],e=void 0===u?null:u,o=0,s=n.length;o<s;o++)i=n[o],null!==e?this.connect(this.properties[e][r],function(){return i.execute(this)}):this.connect(this[r],function(){return i.execute(this)});return this.connect(this.properties.js_event_callbacks.change,function(){return this._update_event_callbacks}),this.connect(this.properties.subscribed_events.change,function(){return this._update_event_callbacks});var l,u},e.prototype._process_event=function(t){var e,n,i,r,o;if(t.is_applicable_to(this)){for(t=t._customize_event(this),o=null!=(r=this.js_event_callbacks[t.event_name])?r:[],n=0,i=o.length;n<i;n++)e=o[n],e.execute(t,{});if(this.subscribed_events.some(function(e){return e===t.event_name}))return this.document.event_manager.send_event(t)}},e.prototype.trigger_event=function(t){var e;return null!=(e=this.document)?e.event_manager.trigger(t.set_model_id(this.id)):void 0},e.prototype._update_event_callbacks=function(){return null==this.document?void l.logger.warn("WARNING: Document not defined for updating event callbacks"):this.document.event_manager.subscribed_models.push(this.id)},e.prototype._doc_attached=function(){if(!a.isEmpty(this.js_event_callbacks)||!a.isEmpty(this.subscribed_events))return this._update_event_callbacks()},e.prototype.select=function(t){if(t.prototype instanceof e)return this.references().filter(function(e){return e instanceof t});if(s.isString(t))return this.references().filter(function(e){return e.name===t});throw new Error("invalid selector")},e.prototype.select_one=function(t){var e;switch(e=this.select(t),e.length){case 0:return null;case 1:return e[0];default:throw new Error("found more than one object matching given selector")}},e}(r.HasProps);n.Model=u,u.prototype.type="Model",u.define({tags:[o.Array,[]],name:[o.String],js_property_callbacks:[o.Any,{}],js_event_callbacks:[o.Any,{}],subscribed_events:[o.Array,[]]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(12),o=t(15),s=t(165);n.AnnotationView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._get_size=function(){return new Error("not implemented")},e.prototype.get_size=function(){return this.model.visible?Math.round(this._get_size()):0},e}(s.RendererView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.add_panel=function(t){var e;if(null==this.panel||t!==this.panel.side)return e=new r.SidePanel({side:t}),e.attach_document(this.document),this.set_panel(e)},e.prototype.set_panel=function(t){return this.panel=t,this.level="overlay"},e}(s.Renderer);n.Annotation=a,a.prototype.type="Annotation",a.prototype.default_view=n.AnnotationView,a.define({plot:[o.Instance]}),a.override({level:"annotation"})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(53),s=t(173),a=t(15),l=t(29);n.ArrowView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),null==this.model.source&&(this.model.source=new s.ColumnDataSource),this.set_data(this.model.source)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source)})},e.prototype.set_data=function(e){return t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,n,i,r,o,s;return e=this.plot_view.frame,"data"===this.model.start_units?(r=e.xscales[this.model.x_range_name].v_compute(this._x_start),s=e.yscales[this.model.y_range_name].v_compute(this._y_start)):(r=e.xview.v_compute(this._x_start),s=e.yview.v_compute(this._y_start)),"data"===this.model.end_units?(i=e.xscales[this.model.x_range_name].v_compute(this._x_end),o=e.yscales[this.model.y_range_name].v_compute(this._y_end)):(i=e.xview.v_compute(this._x_end),o=e.yview.v_compute(this._y_end)),n=[r,s],t=[i,o],[n,t]},e.prototype.render=function(){var t,e,n,i,r;if(this.model.visible){return t=this.plot_view.canvas_view.ctx,t.save(),o=this._map_data(),this.start=o[0],this.end=o[1],null!=this.model.end&&this._arrow_head(t,"render",this.model.end,this.start,this.end),
  null!=this.model.start&&this._arrow_head(t,"render",this.model.start,this.end,this.start),t.beginPath(),s=this.plot_model.canvas.bbox.rect,i=s.x,r=s.y,n=s.width,e=s.height,t.rect(i,r,n,e),null!=this.model.end&&this._arrow_head(t,"clip",this.model.end,this.start,this.end),null!=this.model.start&&this._arrow_head(t,"clip",this.model.start,this.end,this.start),t.closePath(),t.clip(),this._arrow_body(t),t.restore();var o,s}},e.prototype._arrow_body=function(t){var e,n,i,r;if(this.visuals.line.doit){for(r=[],e=n=0,i=this._x_start.length;0<=i?n<i:n>i;e=0<=i?++n:--n)this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(this.start[0][e],this.start[1][e]),t.lineTo(this.end[0][e],this.end[1][e]),r.push(t.stroke());return r}},e.prototype._arrow_head=function(t,e,n,i,r){var o,s,a,u,h;for(h=[],s=a=0,u=this._x_start.length;0<=u?a<u:a>u;s=0<=u?++a:--a)o=Math.PI/2+l.atan2([i[0][s],i[1][s]],[r[0][s],r[1][s]]),t.save(),t.translate(r[0][s],r[1][s]),t.rotate(o),"render"===e?n.render(t):"clip"===e&&n.clip(t),h.push(t.restore());return h},e}(r.AnnotationView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Arrow=u,u.prototype.default_view=n.ArrowView,u.prototype.type="Arrow",u.mixins(["line"]),u.define({x_start:[a.NumberSpec],y_start:[a.NumberSpec],start_units:[a.String,"data"],start:[a.Instance,null],x_end:[a.NumberSpec],y_end:[a.NumberSpec],end_units:[a.String,"data"],end:[a.Instance,new o.OpenHead({})],source:[a.Instance],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(46),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.visuals=new o.Visuals(this)},e.prototype.render=function(t,e){return null},e.prototype.clip=function(t,e){return null},e}(r.Annotation);n.ArrowHead=a,a.prototype.type="ArrowHead";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clip=function(t,e){return this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(0,0),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){if(this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.stroke()},e}(a);n.OpenHead=l,l.prototype.type="OpenHead",l.mixins(["line"]),l.define({size:[s.Number,25]});var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clip=function(t,e){return this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){if(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._normal(t,e),t.fill()),this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),this._normal(t,e),t.stroke()},e.prototype._normal=function(t,e){return t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.closePath()},e}(a);n.NormalHead=u,u.prototype.type="NormalHead",u.mixins(["line","fill"]),u.define({size:[s.Number,25]}),u.override({fill_color:"black"});var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clip=function(t,e){return this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(0,.5*this.size),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){if(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._vee(t,e),t.fill()),this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),this._vee(t,e),t.stroke()},e.prototype._vee=function(t,e){return t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.lineTo(0,.5*this.size),t.closePath()},e}(a);n.VeeHead=h,h.prototype.type="VeeHead",h.mixins(["line","fill"]),h.define({size:[s.Number,25]}),h.override({fill_color:"black"});var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(t,e){if(this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.size,0),t.lineTo(-.5*this.size,0),t.stroke()},e}(a);n.TeeHead=c,c.prototype.type="TeeHead",c.mixins(["line"]),c.define({size:[s.Number,25]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(173),s=t(15);n.BandView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.set_data(this.model.source)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source)})},e.prototype.set_data=function(e){return t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d;return l=this.plot_view.frame,a=this.model.dimension,p=l.xscales[this.model.x_range_name],d=l.yscales[this.model.y_range_name],c="height"===a?d:p,o="height"===a?p:d,_="height"===a?l.yview:l.xview,s="height"===a?l.xview:l.yview,n="data"===this.model.lower.units?c.v_compute(this._lower):_.v_compute(this._lower),r="data"===this.model.upper.units?c.v_compute(this._upper):_.v_compute(this._upper),t="data"===this.model.base.units?o.v_compute(this._base):s.v_compute(this._base),f="height"===a?[1,0]:[0,1],u=f[0],h=f[1],e=[n,t],i=[r,t],this._lower_sx=e[u],this._lower_sy=e[h],this._upper_sx=i[u],this._upper_sy=i[h];var f},e.prototype.render=function(){var t,e,n,i,r,o,s,a,l,u;if(this.model.visible){for(this._map_data(),t=this.plot_view.canvas_view.ctx,t.beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]),e=n=0,s=this._lower_sx.length;0<=s?n<s:n>s;e=0<=s?++n:--n)t.lineTo(this._lower_sx[e],this._lower_sy[e]);for(e=i=a=this._upper_sx.length-1;a<=0?i<=0:i>=0;e=a<=0?++i:--i)t.lineTo(this._upper_sx[e],this._upper_sy[e]);for(t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_value(t),t.fill()),t.beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]),e=r=0,l=this._lower_sx.length;0<=l?r<l:r>l;e=0<=l?++r:--r)t.lineTo(this._lower_sx[e],this._lower_sy[e]);for(this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke()),t.beginPath(),t.moveTo(this._upper_sx[0],this._upper_sy[0]),e=o=0,u=this._upper_sx.length;0<=u?o<u:o>u;e=0<=u?++o:--o)t.lineTo(this._upper_sx[e],this._upper_sy[e]);return this.visuals.line.doit?(this.visuals.line.set_value(t),t.stroke()):void 0}},e}(r.AnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Band=a,a.prototype.default_view=n.BandView,a.prototype.type="Band",a.mixins(["line","fill"]),a.define({lower:[s.DistanceSpec],upper:[s.DistanceSpec],base:[s.DistanceSpec],dimension:[s.Dimension,"height"],source:[s.Instance,function(){return new o.ColumnDataSource}],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),a.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(20),s=t(5),a=t(15),l=t(42);n.BoxAnnotationView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.classList.add("bk-shading"),s.hide(this.el)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),"css"===this.model.render_mode?(this.connect(this.model.change,function(){return this.render()}),this.connect(this.model.data_update,function(){return this.render()})):(this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.data_update,function(){return e.plot_view.request_render()}))},e.prototype.render=function(){var t,e,n,i,r,o,a,l,u,h=this;if(this.model.visible||"css"!==this.model.render_mode||s.hide(this.el),this.model.visible)return null==this.model.left&&null==this.model.right&&null==this.model.top&&null==this.model.bottom?(s.hide(this.el),null):(n=this.plot_model.frame,l=n.xscales[this.model.x_range_name],u=n.yscales[this.model.y_range_name],t=function(t,e,n,i,r){var o;return o=null!=t?h.model.screen?t:"data"===e?n.compute(t):i.compute(t):r},r=t(this.model.left,this.model.left_units,l,n.xview,n._left.value),o=t(this.model.right,this.model.right_units,l,n.xview,n._right.value),a=t(this.model.top,this.model.top_units,u,n.yview,n._top.value),i=t(this.model.bottom,this.model.bottom_units,u,n.yview,n._bottom.value),(e="css"===this.model.render_mode?this._css_box.bind(this):this._canvas_box.bind(this))(r,o,i,a))},e.prototype._css_box=function(t,e,n,i){var r,o,a;return a=Math.abs(e-t),o=Math.abs(n-i),this.el.style.left=t+"px",this.el.style.width=a+"px",this.el.style.top=i+"px",this.el.style.height=o+"px",this.el.style.borderWidth=this.model.line_width.value+"px",this.el.style.borderColor=this.model.line_color.value,this.el.style.backgroundColor=this.model.fill_color.value,this.el.style.opacity=this.model.fill_alpha.value,r=this.model.line_dash,l.isArray(r)&&(r=r.length<2?"solid":"dashed"),l.isString(r)&&(this.el.style.borderStyle=r),s.show(this.el)},e.prototype._canvas_box=function(t,e,n,i){var r;return r=this.plot_view.canvas_view.ctx,r.save(),r.beginPath(),r.rect(t,i,e-t,n-i),this.visuals.fill.set_value(r),r.fill(),this.visuals.line.set_value(r),r.stroke(),r.restore()},e}(r.AnnotationView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.data_update=new o.Signal(this,"data_update")},e.prototype.update=function(t){var e=t.left,n=t.right,i=t.top,r=t.bottom;return this.setv({left:e,right:n,top:i,bottom:r,screen:!0},{silent:!0}),this.data_update.emit()},e}(r.Annotation);n.BoxAnnotation=u,u.prototype.default_view=n.BoxAnnotationView,u.prototype.type="BoxAnnotation",u.mixins(["line","fill"]),u.define({render_mode:[a.RenderMode,"canvas"],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"],top:[a.Number,null],top_units:[a.SpatialUnits,"data"],bottom:[a.Number,null],bottom_units:[a.SpatialUnits,"data"],left:[a.Number,null],left_units:[a.SpatialUnits,"data"],right:[a.Number,null],right_units:[a.SpatialUnits,"data"]}),u.internal({screen:[a.Boolean,!1]}),u.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s=t(364),a=t(51),l=t(180),u=t(91),h=t(146),c=t(168),_=t(169),p=t(160),d=t(15),f=t(40),m=t(22),v=t(30),g=t(42);o=25,r=.3,i=.8,n.ColorBarView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this._set_canvas_image()},e.prototype.connect_signals=function(){var e=this;if(t.prototype.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(){return e.plot_view.request_render()}),this.connect(this.model.ticker.change,function(){return e.plot_view.request_render()}),this.connect(this.model.formatter.change,function(){return e.plot_view.request_render()}),null!=this.model.color_mapper)return this.connect(this.model.color_mapper.change,function(){return this._set_canvas_image(),this.plot_view.request_render()})},e.prototype._get_size=function(){var t,e;return null==this.model.color_mapper?0:(t=this.compute_legend_dimensions(),e=this.model.panel.side,"above"===e||"below"===e?t.height:"left"===e||"right"===e?t.width:void 0)},e.prototype._set_canvas_image=function(){var t,e,n,i,r,o,s,a,l,u;if(null!=this.model.color_mapper){switch(a=this.model.color_mapper.palette,"vertical"===this.model.orientation&&(a=a.slice(0).reverse()),this.model.orientation){case"vertical":c=[1,a.length],u=c[0],r=c[1];break;case"horizontal":_=[a.length,1],u=_[0],r=_[1]}return n=document.createElement("canvas"),p=[u,r],n.width=p[0],n.height=p[1],o=n.getContext("2d"),s=o.getImageData(0,0,u,r),i=new h.LinearColorMapper({palette:a}),t=i.v_map_screen(function(){l=[];for(var t=0,e=a.length;0<=e?t<e:t>e;0<=e?t++:t--)l.push(t);return l}.apply(this)),e=new Uint8Array(t),s.data.set(e),o.putImageData(s,0,0),this.image=n;var c,_,p}},e.prototype.compute_legend_dimensions=function(){var t,e,n,i,r,o,s,a,l;switch(t=this.model._computed_image_dimensions(),u=[t.height,t.width],e=u[0],n=u[1],i=this._get_label_extent(),l=this.model._title_extent(),a=this.model._tick_extent(),s=this.model.padding,this.model.orientation){case"vertical":r=e+l+2*s,o=n+a+i+2*s;break;case"horizontal":r=e+l+a+i+2*s,o=n+2*s}return{height:r,width:o};var u},e.prototype.compute_legend_location=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_;if(e=this.compute_legend_dimensions(),p=[e.height,e.width],n=p[0],r=p[1],i=this.model.margin,s=null!=(a=this.model.panel)?a:this.plot_view.frame,d=s.bbox.ranges,t=d[0],h=d[1],o=this.model.location,g.isString(o))switch(o){case"top_left":l=t.start+i,u=h.start+i;break;case"top_center":l=(t.end+t.start)/2-r/2,u=h.start+i;break;case"top_right":l=t.end-i-r,u=h.start+i;break;case"bottom_right":l=t.end-i-r,u=h.end-i-n;break;case"bottom_center":l=(t.end+t.start)/2-r/2,u=h.end-i-n;break;case"bottom_left":l=t.start+i,u=h.end-i-n;break;case"center_left":l=t.start+i,u=(h.end+h.start)/2-n/2;break;case"center":l=(t.end+t.start)/2-r/2,u=(h.end+h.start)/2-n/2;break;case"center_right":l=t.end-i-r,u=(h.end+h.start)/2-n/2}else g.isArray(o)&&2===o.length&&(c=o[0],_=o[1],l=s.xview.compute(c),u=s.yview.compute(_)-n);return{sx:l,sy:u};var p,d},e.prototype.render=function(){var t,e,n,i,r;if(this.model.visible&&null!=this.model.color_mapper){return t=this.plot_view.canvas_view.ctx,t.save(),o=this.compute_legend_location(),n=o.sx,i=o.sy,t.translate(n,i),this._draw_bbox(t),e=this._get_image_offset(),t.translate(e.x,e.y),this._draw_image(t),null!=this.model.color_mapper.low&&null!=this.model.color_mapper.high&&(r=this.model.tick_info(),this._draw_major_ticks(t,r),this._draw_minor_ticks(t,r),this._draw_major_labels(t,r)),this.model.title&&this._draw_title(t),t.restore();var o}},e.prototype._draw_bbox=function(t){var e;return e=this.compute_legend_dimensions(),t.save(),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fillRect(0,0,e.width,e.height)),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.strokeRect(0,0,e.width,e.height)),t.restore()},e.prototype._draw_image=function(t){var e;return e=this.model._computed_image_dimensions(),t.save(),t.setImageSmoothingEnabled(!1),t.globalAlpha=this.model.scale_alpha,t.drawImage(this.image,0,0,e.width,e.height),this.visuals.bar_line.doit&&(this.visuals.bar_line.set_value(t),t.strokeRect(0,0,e.width,e.height)),t.restore()},e.prototype._draw_major_ticks=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p;if(this.visuals.major_tick_line.doit){for(d=this.model._normals(),o=d[0],s=d[1],i=this.model._computed_image_dimensions(),f=[i.width*o,i.height*s],_=f[0],p=f[1],m=e.coords.major,l=m[0],u=m[1],h=this.model.major_tick_in,c=this.model.major_tick_out,t.save(),t.translate(_,p),this.visuals.major_tick_line.set_value(t),n=r=0,a=l.length;0<=a?r<a:r>a;n=0<=a?++r:--r)t.beginPath(),t.moveTo(Math.round(l[n]+o*c),Math.round(u[n]+s*c)),t.lineTo(Math.round(l[n]-o*h),Math.round(u[n]-s*h)),t.stroke();return t.restore();var d,f,m}},e.prototype._draw_minor_ticks=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p;if(this.visuals.minor_tick_line.doit){for(d=this.model._normals(),o=d[0],s=d[1],i=this.model._computed_image_dimensions(),f=[i.width*o,i.height*s],_=f[0],p=f[1],m=e.coords.minor,l=m[0],u=m[1],h=this.model.minor_tick_in,c=this.model.minor_tick_out,t.save(),t.translate(_,p),this.visuals.minor_tick_line.set_value(t),n=r=0,a=l.length;0<=a?r<a:r>a;n=0<=a?++r:--r)t.beginPath(),t.moveTo(Math.round(l[n]+o*c),Math.round(u[n]+s*c)),t.lineTo(Math.round(l[n]-o*h),Math.round(u[n]-s*h)),t.stroke();return t.restore();var d,f,m}},e.prototype._draw_major_labels=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p,d,f;if(this.visuals.major_label_text.doit){for(m=this.model._normals(),s=m[0],a=m[1],r=this.model._computed_image_dimensions(),v=[r.width*s,r.height*a],_=v[0],d=v[1],u=this.model.label_standoff+this.model._tick_extent(),g=[u*s,u*a],p=g[0],f=g[1],y=e.coords.major,h=y[0],c=y[1],n=e.labels.major,this.visuals.major_label_text.set_value(t),t.save(),t.translate(_+p,d+f),i=o=0,l=h.length;0<=l?o<l:o>l;i=0<=l?++o:--o)t.fillText(n[i],Math.round(h[i]+s*this.model.label_standoff),Math.round(c[i]+a*this.model.label_standoff));return t.restore();var m,v,g,y}},e.prototype._draw_title=function(t){if(this.visuals.title_text.doit)return t.save(),this.visuals.title_text.set_value(t),t.fillText(this.model.title,0,-this.model.title_standoff),t.restore()},e.prototype._get_label_extent=function(){var t,e,n,i;if(i=this.model.tick_info().labels.major,null==this.model.color_mapper.low||null==this.model.color_mapper.high||v.isEmpty(i))n=0;else{switch(t=this.plot_view.canvas_view.ctx,t.save(),this.visuals.major_label_text.set_value(t),this.model.orientation){case"vertical":n=m.max(function(){var n,r,o;for(o=[],n=0,r=i.length;n<r;n++)e=i[n],o.push(t.measureText(e.toString()).width);return o}());break;case"horizontal":n=f.get_text_height(this.visuals.major_label_text.font_value()).height}n+=this.model.label_standoff,t.restore()}return n},e.prototype._get_image_offset=function(){var t,e;return t=this.model.padding,e=this.model.padding+this.model._title_extent(),{x:t,y:e}},e}(a.AnnotationView);var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n)},e.prototype._normals=function(){var t,e;return"vertical"===this.orientation?(n=[1,0],t=n[0],e=n[1]):(i=[0,1],t=i[0],e=i[1]),[t,e];var n,i},e.prototype._title_extent=function(){var t,e;return t=this.title_text_font+" "+this.title_text_font_size+" "+this.title_text_font_style,e=this.title?f.get_text_height(t).height+this.title_standoff:0},e.prototype._tick_extent=function(){var t;return t=null!=this.color_mapper.low&&null!=this.color_mapper.high?m.max([this.major_tick_out,this.minor_tick_out]):0},e.prototype._computed_image_dimensions=function(){var t,e,n,s,a;switch(t=this.plot.plot_canvas.frame._height.value,e=this.plot.plot_canvas.frame._width.value,s=this._title_extent(),this.orientation){case"vertical":"auto"===this.height?null!=this.panel?n=t-2*this.padding-s:(n=m.max([this.color_mapper.palette.length*o,t*r]),n=m.min([n,t*i-2*this.padding-s])):n=this.height,a="auto"===this.width?o:this.width;break;case"horizontal":n="auto"===this.height?o:this.height,"auto"===this.width?null!=this.panel?a=e-2*this.padding:(a=m.max([this.color_mapper.palette.length*o,e*r]),a=m.min([a,e*i-2*this.padding])):a=this.width}return{height:n,width:a}},e.prototype._tick_coordinate_scale=function(t){var e,n;switch(e={source_range:new p.Range1d({start:this.color_mapper.low,end:this.color_mapper.high}),target_range:new p.Range1d({start:0,end:t})},this.color_mapper.type){case"LinearColorMapper":n=new c.LinearScale(e);break;case"LogColorMapper":n=new _.LogScale(e)}return n},e.prototype._format_major_labels=function(t,e){var n,i,r,o,s;for(o=t,n=this.formatter.doFormat(o,null),i=r=0,s=e.length;0<=s?r<s:r>s;i=0<=s?++r:--r)e[i]in this.major_label_overrides&&(n[i]=this.major_label_overrides[e[i]]);return n},e.prototype.tick_info=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y;switch(o=this._computed_image_dimensions(),this.orientation){case"vertical":v=o.height;break;case"horizontal":v=o.width}for(m=this._tick_coordinate_scale(v),b=this._normals(),i=b[0],s=b[1],x=[this.color_mapper.low,this.color_mapper.high],g=x[0],n=x[1],y=this.ticker.get_ticks(g,n,null,null,this.ticker.desired_num_ticks),e={major:[[],[]],minor:[[],[]]},c=y.major,p=y.minor,h=e.major,_=e.minor,r=a=0,d=c.length;0<=d?a<d:a>d;r=0<=d?++a:--a)c[r]<g||c[r]>n||(h[i].push(c[r]),h[s].push(0));for(r=l=0,f=p.length;0<=f?l<f:l>f;r=0<=f?++l:--l)p[r]<g||p[r]>n||(_[i].push(p[r]),_[s].push(0));return u={major:this._format_major_labels(h[i].slice(0),c)},h[i]=m.v_compute(h[i]),_[i]=m.v_compute(_[i]),"vertical"===this.orientation&&(h[i]=new Float64Array(function(){var e,n,r,o;for(r=h[i],o=[],n=0,e=r.length;n<e;n++)t=r[n],o.push(v-t);return o}()),_[i]=new Float64Array(function(){var e,n,r,o;for(r=_[i],o=[],n=0,e=r.length;n<e;n++)t=r[n],o.push(v-t);return o}())),{ticks:y,coords:e,labels:u};var b,x},e}(a.Annotation);n.ColorBar=y,y.prototype.default_view=n.ColorBarView,y.prototype.type="ColorBar",y.mixins(["text:major_label_","text:title_","line:major_tick_","line:minor_tick_","line:border_","line:bar_","fill:background_"]),y.define({location:[d.Any,"top_right"],orientation:[d.Orientation,"vertical"],title:[d.String],title_standoff:[d.Number,2],height:[d.Any,"auto"],width:[d.Any,"auto"],scale_alpha:[d.Number,1],ticker:[d.Instance,function(){return new l.BasicTicker}],formatter:[d.Instance,function(){return new u.BasicTickFormatter}],major_label_overrides:[d.Any,{}],color_mapper:[d.Instance],label_standoff:[d.Number,5],margin:[d.Number,30],padding:[d.Number,10],major_tick_in:[d.Number,5],major_tick_out:[d.Number,0],minor_tick_in:[d.Number,0],minor_tick_out:[d.Number,0]}),y.override({background_fill_color:"#ffffff",background_fill_alpha:.95,bar_line_color:null,border_line_color:null,major_label_text_align:"center",major_label_text_baseline:"middle",major_label_text_font_size:"8pt",major_tick_line_color:"#ffffff",minor_tick_line_color:null,title_text_font_size:"10pt",title_text_font_style:"italic"})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(51);n.Annotation=i.Annotation;var r=t(52);n.Arrow=r.Arrow;var o=t(53);n.ArrowHead=o.ArrowHead;var s=t(53);n.OpenHead=s.OpenHead;var a=t(53);n.NormalHead=a.NormalHead;var l=t(53);n.TeeHead=l.TeeHead;var u=t(53);n.VeeHead=u.VeeHead;var h=t(54);n.Band=h.Band;var c=t(55);n.BoxAnnotation=c.BoxAnnotation;var _=t(56);n.ColorBar=_.ColorBar;var p=t(58);n.Label=p.Label;var d=t(59);n.LabelSet=d.LabelSet;var f=t(60);n.Legend=f.Legend;var m=t(61);n.LegendItem=m.LegendItem;var v=t(62);n.PolyAnnotation=v.PolyAnnotation;var g=t(63);n.Span=g.Span;var y=t(64);n.TextAnnotation=y.TextAnnotation;var b=t(65);n.Title=b.Title;var x=t(66);n.ToolbarPanel=x.ToolbarPanel;var w=t(67);n.Tooltip=w.Tooltip;var k=t(68);n.Whisker=k.Whisker},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(64),o=t(5),s=t(15);n.LabelView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.visuals.warm_cache(null)},e.prototype._get_size=function(){var t,e,n;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),this.model.panel.is_horizontal?e=t.measureText(this.model.text).ascent:n=t.measureText(this.model.text).width},e.prototype.render=function(){var t,e,n,i,r,s,a,l;if(this.model.visible||"css"!==this.model.render_mode||o.hide(this.el),this.model.visible){switch(this.model.angle_units){case"rad":t=-1*this.model.angle;break;case"deg":t=-1*this.model.angle*Math.PI/180}return n=null!=(i=this.model.panel)?i:this.plot_view.frame,a=this.plot_view.frame.xscales[this.model.x_range_name],l=this.plot_view.frame.yscales[this.model.y_range_name],r="data"===this.model.x_units?a.compute(this.model.x):n.xview.compute(this.model.x),s="data"===this.model.y_units?l.compute(this.model.y):n.yview.compute(this.model.y),r+=this.model.x_offset,s-=this.model.y_offset,(e="canvas"===this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this))(this.plot_view.canvas_view.ctx,this.model.text,r,s,t)}},e}(r.TextAnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.TextAnnotation);n.Label=a,a.prototype.default_view=n.LabelView,a.prototype.type="Label",a.mixins(["text","line:border_","fill:background_"]),a.define({x:[s.Number],x_units:[s.SpatialUnits,"data"],y:[s.Number],y_units:[s.SpatialUnits,"data"],text:[s.String],angle:[s.Angle,0],angle_units:[s.AngleUnits,"rad"],x_offset:[s.Number,0],y_offset:[s.Number,0],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"],render_mode:[s.RenderMode,"canvas"]}),a.override({background_fill_color:null,border_line_color:null})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(64),o=t(173),s=t(5),a=t(15),l=t(42);n.LabelSetView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n,i,r,o;if(t.prototype.initialize.call(this,e),this.set_data(this.model.source),"css"===this.model.render_mode){for(o=[],n=i=0,r=this._text.length;0<=r?i<r:i>r;n=0<=r?++i:--i)this.title_div=s.div({"class":"bk-annotation-child",style:{display:"none"}}),o.push(this.el.appendChild(this.title_div));return o}},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),"css"===this.model.render_mode?(this.connect(this.model.change,function(){return this.set_data(this.model.source),this.render()}),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source),this.render()}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source),this.render()}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source),this.render()})):(this.connect(this.model.change,function(){return this.set_data(this.model.source),this.plot_view.request_render()}),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source),this.plot_view.request_render()}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source),this.plot_view.request_render()}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source),this.plot_view.request_render()}))},e.prototype.set_data=function(e){return t.prototype.set_data.call(this,e),this.visuals.warm_cache(e)},e.prototype._map_data=function(){var t,e,n,i,r,o;return r=this.plot_view.frame.xscales[this.model.x_range_name],o=this.plot_view.frame.yscales[this.model.y_range_name],t=null!=(e=this.model.panel)?e:this.plot_view.frame,n="data"===this.model.x_units?r.v_compute(this._x):t.xview.v_compute(this._x),i="data"===this.model.y_units?o.v_compute(this._y):t.yview.v_compute(this._y),[n,i]},e.prototype.render=function(){var t,e,n,i,r,o,a,l;if(this.model.visible||"css"!==this.model.render_mode||s.hide(this.el),this.model.visible){for(e="canvas"===this.model.render_mode?this._v_canvas_text.bind(this):this._v_css_text.bind(this),t=this.plot_view.canvas_view.ctx,u=this._map_data(),a=u[0],l=u[1],o=[],n=i=0,r=this._text.length;0<=r?i<r:i>r;n=0<=r?++i:--i)o.push(e(t,n,this._text[n],a[n]+this._x_offset[n],l[n]-this._y_offset[n],this._angle[n]));return o;var u}},e.prototype._get_size=function(){var t,e,n,i;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),n=this.model.panel.side,"above"===n||"below"===n?e=t.measureText(this._text[0]).ascent:"left"===n||"right"===n?i=t.measureText(this._text[0]).width:void 0},e.prototype._v_canvas_text=function(t,e,n,i,r,o){var s;return this.visuals.text.set_vectorize(t,e),s=this._calculate_bounding_box_dimensions(t,n),t.save(),t.beginPath(),t.translate(i,r),t.rotate(o),t.rect(s[0],s[1],s[2],s[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_vectorize(t,e),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_vectorize(t,e),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_vectorize(t,e),t.fillText(n,0,0)),t.restore()},e.prototype._v_css_text=function(t,e,n,i,r,o){var a,u,h,c;return u=this.el.childNodes[e],u.textContent=n,this.visuals.text.set_vectorize(t,e),a=this._calculate_bounding_box_dimensions(t,n),h=this.visuals.border_line.line_dash.value(),l.isArray(h)&&(c=h.length<2?"solid":"dashed"),l.isString(h)&&(c=h),this.visuals.border_line.set_vectorize(t,e),this.visuals.background_fill.set_vectorize(t,e),u.style.position="absolute",u.style.left=i+a[0]+"px",u.style.top=r+a[1]+"px",u.style.color=""+this.visuals.text.text_color.value(),u.style.opacity=""+this.visuals.text.text_alpha.value(),u.style.font=""+this.visuals.text.font_value(),u.style.lineHeight="normal",o&&(u.style.transform="rotate("+o+"rad)"),this.visuals.background_fill.doit&&(u.style.backgroundColor=""+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(u.style.borderStyle=""+c,u.style.borderWidth=this.visuals.border_line.line_width.value()+"px",u.style.borderColor=""+this.visuals.border_line.color_value()),s.show(u)},e}(r.TextAnnotationView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.TextAnnotation);n.LabelSet=u,u.prototype.default_view=n.LabelSetView,u.prototype.type="Label",u.mixins(["text","line:border_","fill:background_"]),u.define({x:[a.NumberSpec],y:[a.NumberSpec],x_units:[a.SpatialUnits,"data"],y_units:[a.SpatialUnits,"data"],text:[a.StringSpec,{field:"text"}],angle:[a.AngleSpec,0],x_offset:[a.NumberSpec,{value:0}],y_offset:[a.NumberSpec,{value:0}],source:[a.Instance,function(){return new o.ColumnDataSource}],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"],render_mode:[a.RenderMode,"canvas"]}),u.override({background_fill_color:null,border_line_color:null})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(15),s=t(40),a=t(23),l=t(22),u=t(30),h=t(42),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(){return e.plot_view.request_render()})},e.prototype.compute_legend_bbox=function(){var t,e,n,i,r,o,a,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j;for(d=this.model.get_legend_names(),e=this.model.glyph_height,n=this.model.glyph_width,o=this.model.label_height,c=this.model.label_width,this.max_label_height=l.max([s.get_text_height(this.visuals.label_text.font_value()).height,o,e]),t=this.plot_view.canvas_view.ctx,t.save(),this.visuals.label_text.set_value(t),this.text_widths={},r=0,g=d.length;r<g;r++)x=d[r],this.text_widths[x]=l.max([t.measureText(x).width,c]);if(t.restore(),b=Math.max(l.max(u.values(this.text_widths)),0),p=this.model.margin,f=this.legend_padding,m=this.model.spacing,a=this.model.label_standoff,"vertical"===this.model.orientation)_=d.length*this.max_label_height+Math.max(d.length-1,0)*m+2*f,v=b+n+a+2*f;else{v=2*f+Math.max(d.length-1,0)*m,k=this.text_widths;for(x in k)j=k[x],v+=l.max([j,c])+n+a;_=this.max_label_height+2*f}if(w=null!=(M=this.model.panel)?M:this.plot_view.frame,P=w.bbox.ranges,i=P[0],O=P[1],y=this.model.location,h.isString(y))switch(y){case"top_left":
  S=i.start+p,T=O.start+p;break;case"top_center":S=(i.end+i.start)/2-v/2,T=O.start+p;break;case"top_right":S=i.end-p-v,T=O.start+p;break;case"bottom_right":S=i.end-p-v,T=O.end-p-_;break;case"bottom_center":S=(i.end+i.start)/2-v/2,T=O.end-p-_;break;case"bottom_left":S=i.start+p,T=O.end-p-_;break;case"center_left":S=i.start+p,T=(O.end+O.start)/2-_/2;break;case"center":S=(i.end+i.start)/2-v/2,T=(O.end+O.start)/2-_/2;break;case"center_right":S=i.end-p-v,T=(O.end+O.start)/2-_/2}else h.isArray(y)&&2===y.length&&(A=y[0],E=y[1],S=w.xview.compute(A),T=w.yview.compute(E)-_);return{x:S,y:T,width:v,height:_};var P},e.prototype.bbox=function(){var t,e,n,i;return r=this.compute_legend_bbox(),n=r.x,i=r.y,e=r.width,t=r.height,new a.BBox({x:n,y:i,width:e,height:t});var r},e.prototype.on_hit=function(t,e){var n,i,r,o,s,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j,P,z,C,N;for(r=this.model.glyph_height,o=this.model.glyph_width,v=this.legend_padding,g=this.model.spacing,d=this.model.label_standoff,P=N=v,m=this.compute_legend_bbox(),O="vertical"===this.model.orientation,M=this.model.items,l=0,y=M.length;l<y;l++)for(u=M[l],f=u.get_labels_list_from_label_prop(),i=u.get_field_from_label_prop(),h=0,b=f.length;h<b;h++){if(p=f[h],E=m.x+P,z=m.y+N,j=E+o,C=z+r,O?(D=[m.width-2*v,this.max_label_height],A=D[0],s=D[1]):(F=[this.text_widths[p]+o+d,this.max_label_height],A=F[0],s=F[1]),n=new a.BBox({x:E,y:z,width:A,height:s}),n.contains(t,e)){switch(this.model.click_policy){case"hide":for(S=u.renderers,c=0,x=S.length;c<x;c++)k=S[c],k.visible=!k.visible;break;case"mute":for(T=u.renderers,_=0,w=T.length;_<w;_++)k=T[_],k.muted=!k.muted}return!0}O?N+=this.max_label_height+g:P+=this.text_widths[p]+o+d+g}return!1;var D,F},e.prototype.render=function(){var t,e;if(this.model.visible&&0!==this.model.items.length)return e=this.plot_view.canvas_view.ctx,t=this.compute_legend_bbox(),e.save(),this._draw_legend_box(e,t),this._draw_legend_items(e,t),e.restore()},e.prototype._draw_legend_box=function(t,e){if(t.beginPath(),t.rect(e.x,e.y,e.width,e.height),this.visuals.background_fill.set_value(t),t.fill(),this.visuals.border_line.doit)return this.visuals.border_line.set_value(t),t.stroke()},e.prototype._draw_legend_items=function(t,e){var n,i,r,o,s,a,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j,P;for(r=this.model.glyph_height,o=this.model.glyph_width,f=this.legend_padding,m=this.model.spacing,p=this.model.label_standoff,A=P=f,k="vertical"===this.model.orientation,x=this.model.items,a=0,v=x.length;a<v;a++)if(u=x[a],d=u.get_labels_list_from_label_prop(),i=u.get_field_from_label_prop(),0!==d.length)for(n=function(){switch(this.model.click_policy){case"none":return!0;case"hide":return l.all(u.renderers,function(t){return t.visible});case"mute":return l.all(u.renderers,function(t){return!t.muted})}}.call(this),h=0,g=d.length;h<g;h++){for(_=d[h],T=e.x+A,E=e.y+P,O=T+o,j=E+r,k?P+=this.max_label_height+m:A+=this.text_widths[_]+o+p+m,this.visuals.label_text.set_value(t),t.fillText(_,O+p,E+this.max_label_height/2),w=u.renderers,c=0,y=w.length;c<y;c++)b=w[c],M=this.plot_view.renderer_views[b.id],M.draw_legend(t,T,O,E,j,i,_);n||(k?(z=[e.width-2*f,this.max_label_height],S=z[0],s=z[1]):(C=[this.text_widths[_]+o+p,this.max_label_height],S=C[0],s=C[1]),t.beginPath(),t.rect(T,E,S,s),this.visuals.inactive_fill.set_value(t),t.fill())}return null;var z,C},e.prototype._get_size=function(){var t,e;return t=this.compute_legend_bbox(),e=this.model.panel.side,"above"===e||"below"===e?t.height+2*this.model.margin:"left"===e||"right"===e?t.width+2*this.model.margin:void 0},e}(r.AnnotationView);n.LegendView=c,c.getters({legend_padding:function(){return null!=this.visuals.border_line.line_color.value()?this.model.padding:0}});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.cursor=function(){return"none"===this.click_policy?null:"pointer"},e.prototype.get_legend_names=function(){var t,e,n,i,r,o;for(i=[],o=this.items,t=0,r=o.length;t<r;t++)e=o[t],n=e.get_labels_list_from_label_prop(),i=i.concat(n);return i},e}(r.Annotation);n.Legend=_,_.prototype.default_view=c,_.prototype.type="Legend",_.mixins(["text:label_","fill:inactive_","line:border_","fill:background_"]),_.define({orientation:[o.Orientation,"vertical"],location:[o.Any,"top_right"],label_standoff:[o.Number,5],glyph_height:[o.Number,20],glyph_width:[o.Number,20],label_height:[o.Number,20],label_width:[o.Number,20],margin:[o.Number,10],padding:[o.Number,10],spacing:[o.Number,3],items:[o.Array,[]],click_policy:[o.Any,"none"]}),_.override({border_line_color:"#e5e5e5",border_line_alpha:.5,border_line_width:1,background_fill_color:"#ffffff",background_fill_alpha:.95,inactive_fill_color:"white",inactive_fill_alpha:.7,label_text_font_size:"10pt",label_text_baseline:"middle"})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=[].indexOf,o=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},s=t(50),a=t(15),l=t(14),u=t(22),h=t(173),c=function(t){function e(){var e=t.apply(this,arguments)||this;return e.get_field_from_label_prop=e.get_field_from_label_prop.bind(e),e.get_labels_list_from_label_prop=e.get_labels_list_from_label_prop.bind(e),e}return i.__extends(e,t),e.prototype._check_data_sources_on_renderers=function(){var t,e,n,i,r,o;if(t=this.get_field_from_label_prop(),null!=t){if(this.renderers.length<1)return!1;if(o=this.renderers[0].data_source,null!=o)for(r=this.renderers,e=0,n=r.length;e<n;e++)if(i=r[e],i.data_source!==o)return!1}return!0},e.prototype._check_field_label_on_data_source=function(){var t,e;if(t=this.get_field_from_label_prop(),null!=t){if(this.renderers.length<1)return!1;if(e=this.renderers[0].data_source,null!=e&&r.call(e.columns(),t)<0)return!1}return!0},e.prototype.initialize=function(e,n){var i,r;if(t.prototype.initialize.call(this,e,n),i=this._check_data_sources_on_renderers(),i||l.logger.error("Non matching data sources on legend item renderers"),r=this._check_field_label_on_data_source(),!r)return l.logger.error("Bad column name on label: "+this.label)},e.prototype.get_field_from_label_prop=function(){if(o(this,e),null!=this.label&&null!=this.label.field)return this.label.field},e.prototype.get_labels_list_from_label_prop=function(){var t,n,i;if(o(this,e),null!=this.label&&null!=this.label.value)return[this.label.value];if(n=this.get_field_from_label_prop(),null!=n){if(!this.renderers[0]||null==this.renderers[0].data_source)return["No source found"];if(i=this.renderers[0].data_source,i instanceof h.ColumnDataSource)return t=i.get_column(n),null!=t?u.uniq(t):["Invalid field"]}return[]},e}(s.Model);n.LegendItem=c,c.prototype.type="LegendItem",c.define({label:[a.StringSpec,null],renderers:[a.Array,[]]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(20),s=t(15);n.PolyAnnotationView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.data_update,function(){return e.plot_view.request_render()})},e.prototype.render=function(t){var e,n,i,r,o,s,a,l;if(this.model.visible){if(a=this.model.xs,l=this.model.ys,a.length!==l.length)return null;if(a.length<3||l.length<3)return null;for(e=this.plot_view.frame,t=this.plot_view.canvas_view.ctx,n=i=0,r=a.length;0<=r?i<r:i>r;n=0<=r?++i:--i)"screen"===this.model.xs_units&&(o=this.model.screen?a[n]:e.xview.compute(a[n])),"screen"===this.model.ys_units&&(s=this.model.screen?l[n]:e.yview.compute(l[n])),0===n?(t.beginPath(),t.moveTo(o,s)):t.lineTo(o,s);return t.closePath(),this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke()),this.visuals.fill.doit?(this.visuals.fill.set_value(t),t.fill()):void 0}},e}(r.AnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.data_update=new o.Signal(this,"data_update")},e.prototype.update=function(t){var e=t.xs,n=t.ys;return this.setv({xs:e,ys:n,screen:!0},{silent:!0}),this.data_update.emit()},e}(r.Annotation);n.PolyAnnotation=a,a.prototype.default_view=n.PolyAnnotationView,a.prototype.type="PolyAnnotation",a.mixins(["line","fill"]),a.define({xs:[s.Array,[]],xs_units:[s.SpatialUnits,"data"],ys:[s.Array,[]],ys_units:[s.SpatialUnits,"data"],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),a.internal({screen:[s.Boolean,!1]}),a.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(5),s=t(15);n.SpanView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.position="absolute",o.hide(this.el)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.model.for_hover?this.connect(this.model.properties.computed_location.change,function(){return this._draw_span()}):"canvas"===this.model.render_mode?(this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.properties.location.change,function(){return e.plot_view.request_render()})):(this.connect(this.model.change,function(){return this.render()}),this.connect(this.model.properties.location.change,function(){return this._draw_span()}))},e.prototype.render=function(){if(this.model.visible||"css"!==this.model.render_mode||o.hide(this.el),this.model.visible)return this._draw_span()},e.prototype._draw_span=function(){var t,e,n,i,r,s,a,l,u,h,c=this;return r=this.model.for_hover?this.model.computed_location:this.model.location,null==r?void o.hide(this.el):(n=this.plot_view.frame,u=n.xscales[this.model.x_range_name],h=n.yscales[this.model.y_range_name],t=function(t,e){return c.model.for_hover?c.model.computed_location:"data"===c.model.location_units?t.compute(r):e.compute(r)},"width"===this.model.dimension?(a=t(h,n.yview),s=n._left.value,l=n._width.value,i=this.model.properties.line_width.value()):(a=n._top.value,s=t(u,n.xview),l=this.model.properties.line_width.value(),i=n._height.value),"css"===this.model.render_mode?(this.el.style.top=a+"px",this.el.style.left=s+"px",this.el.style.width=l+"px",this.el.style.height=i+"px",this.el.style.zIndex=1e3,this.el.style.backgroundColor=this.model.properties.line_color.value(),this.el.style.opacity=this.model.properties.line_alpha.value(),o.show(this.el)):"canvas"===this.model.render_mode?(e=this.plot_view.canvas_view.ctx,e.save(),e.beginPath(),this.visuals.line.set_value(e),e.moveTo(s,a),"width"===this.model.dimension?e.lineTo(s+l,a):e.lineTo(s,a+i),e.stroke(),e.restore()):void 0)},e}(r.AnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Span=a,a.prototype.default_view=n.SpanView,a.prototype.type="Span",a.mixins(["line"]),a.define({render_mode:[s.RenderMode,"canvas"],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"],location:[s.Number,null],location_units:[s.SpatialUnits,"data"],dimension:[s.Dimension,"width"]}),a.override({line_color:"black"}),a.internal({for_hover:[s.Boolean,!1],computed_location:[s.Number,null]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(5),s=t(42),a=t(40);n.TextAnnotationView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),"css"===this.model.render_mode)return this.el.classList.add("bk-annotation"),this.plot_view.canvas_overlays.appendChild(this.el)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),"css"===this.model.render_mode?this.connect(this.model.change,function(){return this.render()}):this.connect(this.model.change,function(){return e.plot_view.request_render()})},e.prototype._calculate_text_dimensions=function(t,e){var n,i;return i=t.measureText(e).width,n=a.get_text_height(this.visuals.text.font_value()).height,[i,n]},e.prototype._calculate_bounding_box_dimensions=function(t,e){var n,i,r,o;switch(s=this._calculate_text_dimensions(t,e),i=s[0],n=s[1],t.textAlign){case"left":r=0;break;case"center":r=-i/2;break;case"right":r=-i}switch(t.textBaseline){case"top":o=0;break;case"middle":o=-.5*n;break;case"bottom":o=-1*n;break;case"alphabetic":o=-.8*n;break;case"hanging":o=-.17*n;break;case"ideographic":o=-.83*n}return[r,o,i,n];var s},e.prototype._get_size=function(){var t;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),t.measureText(this.model.text).ascent},e.prototype.render=function(){return null},e.prototype._canvas_text=function(t,e,n,i,r){var o;return this.visuals.text.set_value(t),o=this._calculate_bounding_box_dimensions(t,e),t.save(),t.beginPath(),t.translate(n,i),r&&t.rotate(r),t.rect(o[0],o[1],o[2],o[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_value(t),t.fillText(e,0,0)),t.restore()},e.prototype._css_text=function(t,e,n,i,r){var a,l,u;return o.hide(this.el),this.visuals.text.set_value(t),a=this._calculate_bounding_box_dimensions(t,e),l=this.visuals.border_line.line_dash.value(),s.isArray(l)&&(u=l.length<2?"solid":"dashed"),s.isString(l)&&(u=l),this.visuals.border_line.set_value(t),this.visuals.background_fill.set_value(t),this.el.style.position="absolute",this.el.style.left=n+a[0]+"px",this.el.style.top=i+a[1]+"px",this.el.style.color=""+this.visuals.text.text_color.value(),this.el.style.opacity=""+this.visuals.text.text_alpha.value(),this.el.style.font=""+this.visuals.text.font_value(),this.el.style.lineHeight="normal",r&&(this.el.style.transform="rotate("+r+"rad)"),this.visuals.background_fill.doit&&(this.el.style.backgroundColor=""+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(this.el.style.borderStyle=""+u,this.el.style.borderWidth=this.visuals.border_line.line_width.value()+"px",this.el.style.borderColor=""+this.visuals.border_line.color_value()),this.el.textContent=e,o.show(this.el)},e}(r.AnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.TextAnnotation=l,l.prototype.type="TextAnnotation",l.prototype.default_view=n.TextAnnotationView},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(64),o=t(5),s=t(15),a=t(46);n.TitleView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.visuals.text=new a.Text(this.model)},e.prototype._get_location=function(){var t,e,n,i,r;switch(e=this.model.panel,t=this.model.offset,r=5,e.side){case"above":case"below":switch(this.model.vertical_align){case"top":i=e._top.value+r;break;case"middle":i=e._vcenter.value;break;case"bottom":i=e._bottom.value-r}switch(this.model.align){case"left":n=e._left.value+t;break;case"center":n=e._hcenter.value;break;case"right":n=e._right.value-t}break;case"left":switch(this.model.vertical_align){case"top":n=e._left.value-r;break;case"middle":n=e._hcenter.value;break;case"bottom":n=e._right.value+r}switch(this.model.align){case"left":i=e._bottom.value-t;break;case"center":i=e._vcenter.value;break;case"right":i=e._top.value+t}break;case"right":switch(this.model.vertical_align){case"top":n=e._right.value-r;break;case"middle":n=e._hcenter.value;break;case"bottom":n=e._left.value+r}switch(this.model.align){case"left":i=e._top.value+t;break;case"center":i=e._vcenter.value;break;case"right":i=e._bottom.value-t}}return[n,i]},e.prototype.render=function(){var t,e,n,i,r;if(!this.model.visible)return void("css"===this.model.render_mode&&o.hide(this.el));if(r=this.model.text,null!=r&&0!==r.length){return this.model.text_baseline=this.model.vertical_align,this.model.text_align=this.model.align,s=this._get_location(),n=s[0],i=s[1],t=this.model.panel.get_label_angle_heuristic("parallel"),(e="canvas"===this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this))(this.plot_view.canvas_view.ctx,r,n,i,t);var s}},e.prototype._get_size=function(){var t,e;return e=this.model.text,null==e||0===e.length?0:(t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),t.measureText(e).ascent+10)},e}(r.TextAnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.TextAnnotation);n.Title=l,l.prototype.default_view=n.TitleView,l.prototype.type="Title",l.mixins(["line:border_","fill:background_"]),l.define({text:[s.String],text_font:[s.Font,"helvetica"],text_font_size:[s.FontSizeSpec,"10pt"],text_font_style:[s.FontStyle,"bold"],text_color:[s.ColorSpec,"#444444"],text_alpha:[s.NumberSpec,1],vertical_align:[s.VerticalAlign,"bottom"],align:[s.TextAlign,"left"],offset:[s.Number,0],render_mode:[s.RenderMode,"canvas"]}),l.override({background_fill_color:null,border_line_color:null}),l.internal({text_align:[s.TextAlign,"left"],text_baseline:[s.TextBaseline,"bottom"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(4),s=t(5),a=t(15);n.ToolbarPanelView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_events.appendChild(this.el),this._toolbar_views={},o.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){return o.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.render=function(){var e,n;return t.prototype.render.call(this),this.model.visible?(e=this.model.panel,this.el.style.position="absolute",this.el.style.left=e._left.value+"px",this.el.style.top=e._top.value+"px",this.el.style.width=e._width.value+"px",this.el.style.height=e._height.value+"px",this.el.style.overflow="hidden",n=this._toolbar_views[this.model.toolbar.id],n.render(),s.empty(this.el),this.el.appendChild(n.el),s.show(this.el)):void s.hide(this.el)},e.prototype._get_size=function(){return 30},e}(r.AnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.ToolbarPanel=l,l.prototype.type="ToolbarPanel",l.prototype.default_view=n.ToolbarPanelView,l.define({toolbar:[a.Instance]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(5),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.zIndex=1010,o.hide(this.el)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.properties.data.change,function(){return this._draw_tips()})},e.prototype.render=function(){if(this.model.visible)return this._draw_tips()},e.prototype._draw_tips=function(){var t,e,n,i,r,s,a,l,u,h,c,_,p,d;if(i=this.model.data,o.empty(this.el),o.hide(this.el),this.model.custom?this.el.classList.add("bk-tooltip-custom"):this.el.classList.remove("bk-tooltip-custom"),0!==i.length){for(r=this.plot_view.frame,s=0,l=i.length;s<l;s++)d=i[s],h=d[0],c=d[1],n=d[2],this.model.inner_only&&!r.bbox.contains(h,c)||(_=o.div({},n),this.el.appendChild(_));switch(e=this.model.attachment){case"horizontal":u=h<r._hcenter.value?"right":"left";break;case"vertical":u=c<r._vcenter.value?"below":"above";break;default:u=e}switch(this.el.classList.remove("bk-right"),this.el.classList.remove("bk-left"),this.el.classList.remove("bk-above"),this.el.classList.remove("bk-below"),t=10,o.show(this.el),u){case"right":this.el.classList.add("bk-left"),a=h+(this.el.offsetWidth-this.el.clientWidth)+t,p=c-this.el.offsetHeight/2;break;case"left":this.el.classList.add("bk-right"),a=h-this.el.offsetWidth-t,p=c-this.el.offsetHeight/2;break;case"above":this.el.classList.add("bk-above"),p=c+(this.el.offsetHeight-this.el.clientHeight)+t,a=Math.round(h-this.el.offsetWidth/2);break;case"below":this.el.classList.add("bk-below"),p=c-this.el.offsetHeight-t,a=Math.round(h-this.el.offsetWidth/2)}return this.model.show_arrow&&this.el.classList.add("bk-tooltip-arrow"),this.el.childNodes.length>0?(this.el.style.top=p+"px",this.el.style.left=a+"px"):o.hide(this.el)}},e}(r.AnnotationView);n.TooltipView=a,a.prototype.className="bk-tooltip";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clear=function(){return this.data=[]},e.prototype.add=function(t,e,n){var i;return i=this.data,i.push([t,e,n]),this.data=i,this.properties.data.change.emit()},e}(r.Annotation);n.Tooltip=l,l.prototype.default_view=a,l.prototype.type="Tooltip",l.define({attachment:[s.String,"horizontal"],inner_only:[s.Bool,!0],show_arrow:[s.Bool,!0]}),l.override({level:"overlay"}),l.internal({data:[s.Any,[]],custom:[s.Any]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(173),s=t(53),a=t(15);n.WhiskerView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.set_data(this.model.source)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source)})},e.prototype.set_data=function(e){return t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d;return l=this.plot_model.frame,a=this.model.dimension,p=l.xscales[this.model.x_range_name],d=l.yscales[this.model.y_range_name],c="height"===a?d:p,o="height"===a?p:d,_="height"===a?l.yview:l.xview,s="height"===a?l.xview:l.yview,n="data"===this.model.lower.units?c.v_compute(this._lower):_.v_compute(this._lower),r="data"===this.model.upper.units?c.v_compute(this._upper):_.v_compute(this._upper),t="data"===this.model.base.units?o.v_compute(this._base):s.v_compute(this._base),f="height"===a?[1,0]:[0,1],u=f[0],h=f[1],e=[n,t],i=[r,t],this._lower_sx=e[u],this._lower_sy=e[h],this._upper_sx=i[u],this._upper_sy=i[h];var f},e.prototype.render=function(){var t,e,n,i,r,o,s,a,l,u;if(this.model.visible){if(this._map_data(),e=this.plot_view.canvas_view.ctx,this.visuals.line.doit)for(n=i=0,s=this._lower_sx.length;0<=s?i<s:i>s;n=0<=s?++i:--i)this.visuals.line.set_vectorize(e,n),e.beginPath(),e.moveTo(this._lower_sx[n],this._lower_sy[n]),e.lineTo(this._upper_sx[n],this._upper_sy[n]),e.stroke();if(t="height"===this.model.dimension?0:Math.PI/2,null!=this.model.lower_head)for(n=r=0,a=this._lower_sx.length;0<=a?r<a:r>a;n=0<=a?++r:--r)e.save(),e.translate(this._lower_sx[n],this._lower_sy[n]),e.rotate(t+Math.PI),this.model.lower_head.render(e,n),e.restore();if(null!=this.model.upper_head){for(u=[],n=o=0,l=this._upper_sx.length;0<=l?o<l:o>l;n=0<=l?++o:--o)e.save(),e.translate(this._upper_sx[n],this._upper_sy[n]),e.rotate(t),this.model.upper_head.render(e,n),u.push(e.restore());return u}}},e}(r.AnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Whisker=l,l.prototype.default_view=n.WhiskerView,l.prototype.type="Whisker",l.mixins(["line"]),l.define({lower:[a.DistanceSpec],lower_head:[a.Instance,function(){return new s.TeeHead({level:"underlay",size:10})}],upper:[a.DistanceSpec],upper_head:[a.Instance,function(){return new s.TeeHead({level:"underlay",size:10})}],base:[a.DistanceSpec],dimension:[a.Dimension,"height"],source:[a.Instance,function(){return new o.ColumnDataSource}],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]}),l.override({level:"underlay"})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(12),o=t(163),s=t(165),a=t(14),l=t(15),u=t(22),h=t(42);n.AxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){var t,e,n;if(this.model.visible!==!1)return e={tick:this._tick_extent(),tick_label:this._tick_label_extents(),axis_label:this._axis_label_extent()},n=this.model.tick_coords,t=this.plot_view.canvas_view.ctx,t.save(),this._draw_rule(t,e),this._draw_major_ticks(t,e,n),this._draw_minor_ticks(t,e,n),this._draw_major_labels(t,e,n),this._draw_axis_label(t,e,n),null!=this._render&&this._render(t,e,n),t.restore()},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()})},e.prototype._get_size=function(){return this._tick_extent()+this._tick_label_extent()+this._axis_label_extent()},e.prototype.get_size=function(){return this.model.visible?Math.round(this._get_size()):0},e.prototype._draw_rule=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p;if(this.visuals.axis_line.doit){for(d=this.model.rule_coords,h=d[0],_=d[1],f=this.plot_view.map_to_screen(h,_,this.model.x_range_name,this.model.y_range_name),l=f[0],u=f[1],m=this.model.normals,o=m[0],s=m[1],v=this.model.offsets,c=v[0],p=v[1],this.visuals.axis_line.set_value(t),t.beginPath(),t.moveTo(Math.round(l[0]+o*c),Math.round(u[0]+s*p)),i=r=1,a=l.length;1<=a?r<a:r>a;i=1<=a?++r:--r)l=Math.round(l[i]+o*c),u=Math.round(u[i]+s*p),t.lineTo(l,u);t.stroke();var d,f,m,v}},e.prototype._draw_major_ticks=function(t,e,n){var i,r,o;i=this.model.major_tick_in,r=this.model.major_tick_out,o=this.visuals.major_tick_line,this._draw_ticks(t,n.major,i,r,o)},e.prototype._draw_minor_ticks=function(t,e,n){var i,r,o;i=this.model.minor_tick_in,r=this.model.minor_tick_out,o=this.visuals.minor_tick_line,this._draw_ticks(t,n.minor,i,r,o)},e.prototype._draw_major_labels=function(t,e,n){var i,r,o,s,a;i=n.major,r=this.model.compute_labels(i[this.model.dimension]),o=this.model.major_label_orientation,s=e.tick+this.model.major_label_standoff,a=this.visuals.major_label_text,this._draw_oriented_labels(t,r,i,o,this.model.panel_side,s,a)},e.prototype._draw_axis_label=function(t,e,n){var i,r,o,s,a;if(null!=this.model.axis_label&&0!==this.model.axis_label.length){switch(this.model.panel.side){case"above":o=this.model.panel._hcenter.value,s=this.model.panel._bottom.value;break;case"below":o=this.model.panel._hcenter.value,s=this.model.panel._top.value;break;case"left":o=this.model.panel._right.value,s=this.model.panel._vcenter._value;break;case"right":o=this.model.panel._left.value,s=this.model.panel._vcenter._value}i=[[o],[s]],r=e.tick+u.sum(e.tick_label)+this.model.axis_label_standoff,a=this.visuals.axis_label_text,this._draw_oriented_labels(t,[this.model.axis_label],i,"parallel",this.model.panel_side,r,a,"screen")}},e.prototype._draw_ticks=function(t,e,n,i,r){var o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;if(r.doit&&0!==e.length){for(b=e[0],w=e[1],M=this.plot_view.map_to_screen(b,w,this.model.x_range_name,this.model.y_range_name),m=M[0],y=M[1],S=this.model.normals,a=S[0],h=S[1],T=this.model.offsets,x=T[0],k=T[1],O=[a*(x-n),h*(k-n)],l=O[0],c=O[1],A=[a*(x+i),h*(k+i)],u=A[0],_=A[1],r.set_value(t),o=s=0,p=m.length;0<=p?s<p:s>p;o=0<=p?++s:--s)d=Math.round(m[o]+u),v=Math.round(y[o]+_),f=Math.round(m[o]+l),g=Math.round(y[o]+c),t.beginPath(),t.moveTo(d,v),t.lineTo(f,g),t.stroke();var M,S,T,O,A}},e.prototype._draw_oriented_labels=function(t,e,n,i,r,o,s,a){void 0===a&&(a="data");var l,u,c,_,p,d,f,m,v,g,y,b,x,w,k,M;if(s.doit&&0!==e.length){for("screen"===a?(b=n[0],w=n[1],S=[0,0],k=S[0],M=S[1]):(u=n[0],c=n[1],T=this.plot_view.map_to_screen(u,c,this.model.x_range_name,this.model.y_range_name),b=T[0],w=T[1],O=this.model.offsets,k=O[0],M=O[1]),A=this.model.normals,d=A[0],m=A[1],f=d*(k+o),v=m*(M+o),s.set_value(t),this.model.panel.apply_label_text_heuristics(t,i),l=h.isString(i)?this.model.panel.get_label_angle_heuristic(i):-i,_=p=0,g=b.length;0<=g?p<g:p>g;_=0<=g?++p:--p)y=Math.round(b[_]+f),x=Math.round(w[_]+v),t.translate(y,x),t.rotate(l),t.fillText(e[_],0,0),t.rotate(-l),t.translate(-y,-x);var S,T,O,A}},e.prototype._axis_label_extent=function(){var t,e;return null==this.model.axis_label||""===this.model.axis_label?0:(t=this.model.axis_label_standoff,e=this.visuals.axis_label_text,this._oriented_labels_extent([this.model.axis_label],"parallel",this.model.panel_side,t,e))},e.prototype._tick_extent=function(){return this.model.major_tick_out},e.prototype._tick_label_extent=function(){return u.sum(this._tick_label_extents())},e.prototype._tick_label_extents=function(){var t,e,n,i,r;return t=this.model.tick_coords.major,e=this.model.compute_labels(t[this.model.dimension]),n=this.model.major_label_orientation,i=this.model.major_label_standoff,r=this.visuals.major_label_text,[this._oriented_labels_extent(e,n,this.model.panel_side,i,r)]},e.prototype._tick_label_extent=function(){return u.sum(this._tick_label_extents())},e.prototype._oriented_labels_extent=function(t,e,n,i,r){var o,s,a,l,u,c,_,p,d,f,m,v;if(0===t.length)return 0;for(a=this.plot_view.canvas_view.ctx,r.set_value(a),h.isString(e)?(c=1,o=this.model.panel.get_label_angle_heuristic(e)):(c=2,o=-e),o=Math.abs(o),s=Math.cos(o),f=Math.sin(o),l=0,_=p=0,d=t.length;0<=d?p<d:p>d;_=0<=d?++p:--p)v=1.1*a.measureText(t[_]).width,u=.9*a.measureText(t[_]).ascent,m="above"===n||"below"===n?v*f+u/c*s:v*s+u/c*f,m>l&&(l=m);return l>0&&(l+=i),l},e}(s.RendererView);var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute_labels=function(t){var e,n,i,r;for(i=this.formatter.doFormat(t,this),e=n=0,r=t.length;0<=r?n<r:n>r;e=0<=r?++n:--n)t[e]in this.major_label_overrides&&(i[e]=this.major_label_overrides[t[e]]);return i},e.prototype.label_info=function(t){var e,n;return n=this.major_label_orientation,e={dim:this.dimension,coords:t,side:this.panel_side,orient:n,standoff:this.major_label_standoff}},e.prototype.add_panel=function(t){return this.panel=new r.SidePanel({side:t}),this.panel.attach_document(this.document),this.panel_side=t},e.prototype._offsets=function(){var t,e,n,i;switch(e=this.panel_side,r=[0,0],n=r[0],i=r[1],t=this.plot.plot_canvas.frame,e){case"below":i=Math.abs(this.panel._top.value-t._bottom.value);break;case"above":i=Math.abs(this.panel._bottom.value-t._top.value);break;case"right":n=Math.abs(this.panel._left.value-t._right.value);break;case"left":n=Math.abs(this.panel._right.value-t._left.value)}return[n,i];var r},e.prototype._ranges=function(){var t,e,n,i;return e=this.dimension,n=(e+1)%2,t=this.plot.plot_canvas.frame,i=[t.x_ranges[this.x_range_name],t.y_ranges[this.y_range_name]],[i[e],i[n]]},e.prototype._computed_bounds=function(){var t,e,n,i,r,o,s;return l=this.ranges,n=l[0],t=l[1],s=null!=(r=this.bounds)?r:"auto",i=[n.min,n.max],"auto"===s?i:h.isArray(s)?(Math.abs(s[0]-s[1])>Math.abs(i[0]-i[1])?(o=Math.max(Math.min(s[0],s[1]),i[0]),e=Math.min(Math.max(s[0],s[1]),i[1])):(o=Math.min(s[0],s[1]),e=Math.max(s[0],s[1])),[o,e]):(a.logger.error("user bounds '"+s+"' not understood"),null);var l},e.prototype._rule_coords=function(){var t,e,n,i,r,o,s,a,l;return i=this.dimension,r=(i+1)%2,u=this.ranges,o=u[0],e=u[1],h=this.computed_bounds,
  s=h[0],n=h[1],a=new Array(2),l=new Array(2),t=[a,l],t[i][0]=Math.max(s,o.min),t[i][1]=Math.min(n,o.max),t[i][0]>t[i][1]&&(t[i][0]=t[i][1]=NaN),t[r][0]=this.loc,t[r][1]=this.loc,t;var u,h},e.prototype._tick_coords=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x;for(i=this.dimension,o=(i+1)%2,w=this.ranges,p=w[0],e=w[1],k=this.computed_bounds,g=k[0],n=k[1],y=this.ticker.get_ticks(g,n,p,this.loc,{}),l=y.major,_=y.minor,b=[],x=[],t=[b,x],h=[],c=[],u=[h,c],M=[p.min,p.max],f=M[0],d=M[1],r=s=0,m=l.length;0<=m?s<m:s>m;r=0<=m?++s:--s)l[r]<f||l[r]>d||(t[i].push(l[r]),t[o].push(this.loc));for(r=a=0,v=_.length;0<=v?a<v:a>v;r=0<=v?++a:--a)_[r]<f||_[r]>d||(u[i].push(_[r]),u[o].push(this.loc));return{major:t,minor:u};var w,k,M},e.prototype._get_loc=function(){var t,e,n,i,r;switch(o=this.ranges,i=o[0],e=o[1],n=e.start,t=e.end,r=this.panel_side){case"left":case"below":return e.start;case"right":case"above":return e.end}var o},e}(o.GuideRenderer);n.Axis=c,c.prototype.default_view=n.AxisView,c.prototype.type="Axis",c.mixins(["line:axis_","line:major_tick_","line:minor_tick_","text:major_label_","text:axis_label_"]),c.define({bounds:[l.Any,"auto"],ticker:[l.Instance,null],formatter:[l.Instance,null],x_range_name:[l.String,"default"],y_range_name:[l.String,"default"],axis_label:[l.String,""],axis_label_standoff:[l.Int,5],major_label_standoff:[l.Int,5],major_label_orientation:[l.Any,"horizontal"],major_label_overrides:[l.Any,{}],major_tick_in:[l.Number,2],major_tick_out:[l.Number,6],minor_tick_in:[l.Number,0],minor_tick_out:[l.Number,4]}),c.override({axis_line_color:"black",major_tick_line_color:"black",minor_tick_line_color:"black",major_label_text_font_size:"8pt",major_label_text_align:"center",major_label_text_baseline:"alphabetic",axis_label_text_font_size:"10pt",axis_label_text_font_style:"italic"}),c.internal({panel_side:[l.Any]}),c.getters({computed_bounds:function(){return this._computed_bounds()},rule_coords:function(){return this._rule_coords()},tick_coords:function(){return this._tick_coords()},ranges:function(){return this._ranges()},normals:function(){return this.panel._normals},dimension:function(){return this.panel._dim},offsets:function(){return this._offsets()},loc:function(){return this._get_loc()}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(69),o=t(92),s=t(181);n.CategoricalAxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){return this._draw_group_separators(t,e,n)},e.prototype._draw_group_separators=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;if(M=this.model.ranges,v=M[0],o=M[1],S=this.model.computed_bounds,x=S[0],a=S[1],f=this.model.loc,k=this.model.ticker.get_ticks(x,a,v,f,{}),T=this.model.ranges,v=T[0],o=T[1],v.tops&&!(v.tops.length<2)&&this.visuals.separator_line.doit){for(s=this.model.dimension,i=(s+1)%2,r=[[],[]],h=0,u=_=0,g=v.tops.length-1;0<=g?_<g:_>g;u=0<=g?++_:--_){for(c=p=y=h,b=v.factors.length;y<=b?p<b:p>b;c=y<=b?++p:--p)if(v.factors[c][0]===v.tops[u+1]){O=[v.factors[c-1],v.factors[c]],l=O[0],d=O[1],h=c;break}m=(v.synthetic(l)+v.synthetic(d))/2,m>x&&m<a&&(r[s].push(m),r[i].push(this.model.loc))}w=this._tick_label_extent(),this._draw_ticks(t,r,-3,w-6,this.visuals.separator_line);var M,S,T,O}},e.prototype._draw_major_labels=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d;for(a=this._get_factor_info(),h=this.model.loc,o=this.model.dimension,i=(o+1)%2,p=e.tick+this.model.major_label_standoff,s=l=0,_=a.length;0<=_?l<_:l>_;s=0<=_?++l:--l)f=a[s],u=f[0],r=f[1],c=f[2],d=f[3],this._draw_oriented_labels(t,u,r,c,this.model.panel_side,p,d),p+=e.tick_label[s];var f},e.prototype._tick_label_extents=function(){var t,e,n,i,r,o,s,a,l;for(i=this._get_factor_info(),n=[],r=0,s=i.length;r<s;r++)u=i[r],o=u[0],t=u[1],a=u[2],l=u[3],e=this._oriented_labels_extent(o,a,this.model.panel_side,this.model.major_label_standoff,l),n.push(e);return n;var u},e.prototype._get_factor_info=function(){var t,e,n,i,r,o,s,a,l,u,h;return c=this.model.ranges,a=c[0],e=c[1],_=this.model.computed_bounds,l=_[0],n=_[1],o=this.model.loc,u=this.model.ticker.get_ticks(l,n,a,o,{}),t=this.model.tick_coords,i=[],1===a.levels?(r=this.model.formatter.doFormat(u.major,this),i.push([r,t.major,this.model.major_label_orientation,this.visuals.major_label_text])):2===a.levels?(r=this.model.formatter.doFormat(function(){var t,e,n,i;for(n=u.major,i=[],t=0,e=n.length;t<e;t++)h=n[t],i.push(h[1]);return i}(),this),i.push([r,t.major,this.model.major_label_orientation,this.visuals.major_label_text]),i.push([u.tops,t.tops,"parallel",this.visuals.group_text])):3===a.levels&&(r=this.model.formatter.doFormat(function(){var t,e,n,i;for(n=u.major,i=[],t=0,e=n.length;t<e;t++)h=n[t],i.push(h[2]);return i}(),this),s=function(){var t,e,n,i;for(n=u.mids,i=[],t=0,e=n.length;t<e;t++)h=n[t],i.push(h[1]);return i}(),i.push([r,t.major,this.model.major_label_orientation,this.visuals.major_label_text]),i.push([s,t.mids,"parallel",this.visuals.subgroup_text]),i.push([u.tops,t.tops,"parallel",this.visuals.group_text])),i;var c,_},e}(r.AxisView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._tick_coords=function(){var t,e,n,i,r,o,s,a,l;return i=this.dimension,r=(i+1)%2,u=this.ranges,o=u[0],e=u[1],h=this.computed_bounds,s=h[0],n=h[1],a=this.ticker.get_ticks(s,n,o,this.loc,{}),t={major:[[],[]],mids:[[],[]],tops:[[],[]],minor:[]},t.major[i]=a.major,t.major[r]=function(){var t,e,n,i;for(n=a.major,i=[],t=0,e=n.length;t<e;t++)l=n[t],i.push(this.loc);return i}.call(this),3===o.levels&&(t.mids[i]=a.mids,t.mids[r]=function(){var t,e,n,i;for(n=a.mids,i=[],t=0,e=n.length;t<e;t++)l=n[t],i.push(this.loc);return i}.call(this)),o.levels>1&&(t.tops[i]=a.tops,t.tops[r]=function(){var t,e,n,i;for(n=a.tops,i=[],t=0,e=n.length;t<e;t++)l=n[t],i.push(this.loc);return i}.call(this)),t;var u,h},e}(r.Axis);n.CategoricalAxis=a,a.prototype.default_view=n.CategoricalAxisView,a.prototype.type="CategoricalAxis",a.mixins(["line:separator_","text:group_","text:subgroup_"]),a.override({ticker:function(){return new s.CategoricalTicker},formatter:function(){return new o.CategoricalTickFormatter},separator_line_color:"lightgrey",separator_line_width:2,group_text_font_style:"bold",group_text_font_size:"8pt",group_text_color:"grey",subgroup_text_font_style:"bold",subgroup_text_font_size:"8pt"})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(69),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Axis);n.ContinuousAxis=o,o.prototype.type="ContinuousAxis"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(74),o=t(93),s=t(184);n.DatetimeAxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.LinearAxisView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.LinearAxis);n.DatetimeAxis=a,a.prototype.default_view=n.DatetimeAxisView,a.prototype.type="DatetimeAxis",a.override({ticker:function(){return new s.DatetimeTicker},formatter:function(){return new o.DatetimeTickFormatter}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(69);n.Axis=i.Axis;var r=t(70);n.CategoricalAxis=r.CategoricalAxis;var o=t(71);n.ContinuousAxis=o.ContinuousAxis;var s=t(72);n.DatetimeAxis=s.DatetimeAxis;var a=t(74);n.LinearAxis=a.LinearAxis;var l=t(75);n.LogAxis=l.LogAxis},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(69),o=t(71),s=t(91),a=t(180);n.LinearAxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.AxisView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ContinuousAxis);n.LinearAxis=l,l.prototype.default_view=n.LinearAxisView,l.prototype.type="LinearAxis",l.override({ticker:function(){return new a.BasicTicker},formatter:function(){return new s.BasicTickFormatter}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(69),o=t(71),s=t(96),a=t(188);n.LogAxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.AxisView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ContinuousAxis);n.LogAxis=l,l.prototype.default_view=n.LogAxisView,l.prototype.type="LogAxis",l.override({ticker:function(){return new a.LogTicker},formatter:function(){return new s.LogTickFormatter}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(30),s=t(50),a=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(n,e),n.prototype.execute=function(e,n){return this.func.apply(e,this.values.concat(e,n,t,{}))},n.prototype._make_values=function(){return o.values(this.args)},n.prototype._make_func=function(){return new(Function.bind.apply(Function,[void 0].concat(Object.keys(this.args),["cb_obj","cb_data","require","exports",this.code])))},n}(s.Model);n.CustomJS=a,a.prototype.type="CustomJS",a.define({args:[r.Any,{}],code:[r.String,""]}),a.getters({values:function(){return this._make_values()},func:function(){return this._make_func()}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(76);n.CustomJS=i.CustomJS;var r=t(78);n.OpenURL=r.OpenURL},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50),o=t(15),s=t(34),a=t(39),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.execute=function(t,e){var n,i,r,o,l;for(o=s.get_indices(e.source),i=0,r=o.length;i<r;i++)n=o[i],l=a.replace_placeholders(this.url,e.source,n),window.open(l);return null},e}(r.Model);n.OpenURL=l,l.prototype.type="OpenURL",l.define({url:[o.String,"http://"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(11),o=t(6),s=t(13),a=t(14),l=t(15),u=t(5),h=t(25),c=t(249);null!=window.CanvasPixelArray&&(CanvasPixelArray.prototype.set=function(t){var e,n,i,r;for(r=[],e=n=0,i=this.length;0<=i?n<i:n>i;e=0<=i?++n:--n)r.push(this[e]=t[e]);return r});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){switch(t.prototype.initialize.call(this,e),this.map_el=this.model.map?this.el.appendChild(u.div({"class":"bk-canvas-map"})):null,this.model.output_backend){case"canvas":case"webgl":this.canvas_el=this.el.appendChild(u.canvas({"class":"bk-canvas"})),this._ctx=this.canvas_el.getContext("2d");break;case"svg":this._ctx=new c,this.canvas_el=this.el.appendChild(this._ctx.getSvg())}return this.overlays_el=this.el.appendChild(u.div({"class":"bk-canvas-overlays"})),this.events_el=this.el.appendChild(u.div({"class":"bk-canvas-events"})),this.ctx=this.get_ctx(),h.fixup_ctx(this.ctx),a.logger.debug("CanvasView initialized")},e.prototype.get_ctx=function(){return this._ctx},e.prototype.get_canvas_element=function(){return this.canvas_el},e.prototype.prepare_canvas=function(){var t,e,n;return n=this.model._width.value,t=this.model._height.value,this.el.style.width=n+"px",this.el.style.height=t+"px",e=h.get_scale_ratio(this.ctx,this.model.use_hidpi,this.model.output_backend),this.model.pixel_ratio=e,this.canvas_el.style.width=n+"px",this.canvas_el.style.height=t+"px",this.canvas_el.setAttribute("width",n*e),this.canvas_el.setAttribute("height",t*e),a.logger.debug("Rendering CanvasView with width: "+n+", height: "+t+", pixel ratio: "+e)},e.prototype.set_dims=function(t){var e=t[0],n=t[1];if(0!==e&&0!==n)return e!==this.model._width.value&&(null!=this._width_constraint&&this.solver.has_constraint(this._width_constraint)&&this.solver.remove_constraint(this._width_constraint),this._width_constraint=s.EQ(this.model._width,-e),this.solver.add_constraint(this._width_constraint)),n!==this.model._height.value&&(null!=this._height_constraint&&this.solver.has_constraint(this._height_constraint)&&this.solver.remove_constraint(this._height_constraint),this._height_constraint=s.EQ(this.model._height,-n),this.solver.add_constraint(this._height_constraint)),this.solver.update_variables()},e}(o.DOMView);n.CanvasView=_,_.prototype.className="bk-canvas-wrapper";var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.LayoutCanvas);n.Canvas=p,p.prototype.type="Canvas",p.prototype.default_view=_,p.internal({map:[l.Boolean,!1],use_hidpi:[l.Boolean,!0],pixel_ratio:[l.Number,1],output_backend:[l.OutputBackend,"canvas"]}),p.getters({panel:function(){return this}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(166),o=t(168),s=t(169),a=t(160),l=t(156),u=t(157),h=t(11),c=t(15),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){var i=this;return t.prototype.initialize.call(this,e,n),this._configure_scales(),this.connect(this.change,function(){return i._configure_scales()})},e.prototype.get_editables=function(){return t.prototype.get_editables.call(this).concat([this._width,this._height])},e.prototype.map_to_screen=function(t,e,n,i){void 0===n&&(n="default"),void 0===i&&(i="default");var r,o;return r=this.xscales[n].v_compute(t),o=this.yscales[i].v_compute(e),[r,o]},e.prototype._get_ranges=function(t,e){var n,i,r;if(r={},r["default"]=t,null!=e)for(i in e)n=e[i],r[i]=n;return r},e.prototype._get_scales=function(t,e,n){var i,h,c,_;_={};for(i in e){if(h=e[i],h instanceof l.DataRange1d||h instanceof a.Range1d){if(!(t instanceof s.LogScale||t instanceof o.LinearScale))throw new Error("Range "+h.type+" is incompatible is Scale "+t.type);if(t instanceof r.CategoricalScale)throw new Error("Range "+h.type+" is incompatible is Scale "+t.type)}if(h instanceof u.FactorRange&&!(t instanceof r.CategoricalScale))throw new Error("Range "+h.type+" is incompatible is Scale "+t.type);t instanceof s.LogScale&&h instanceof l.DataRange1d&&(h.scale_hint="log"),c=t.clone(),c.setv({source_range:h,target_range:n}),_[i]=c}return _},e.prototype._configure_frame_ranges=function(){return this._h_target=new a.Range1d({start:this._left.value,end:this._right.value}),this._v_target=new a.Range1d({start:this._bottom._value,end:this._top.value})},e.prototype._configure_scales=function(){return this._configure_frame_ranges(),this._x_ranges=this._get_ranges(this.x_range,this.extra_x_ranges),this._y_ranges=this._get_ranges(this.y_range,this.extra_y_ranges),this._xscales=this._get_scales(this.x_scale,this._x_ranges,this._h_target),this._yscales=this._get_scales(this.y_scale,this._y_ranges,this._v_target)},e.prototype._update_scales=function(){var t,e,n,i;this._configure_frame_ranges(),e=this._xscales;for(t in e)i=e[t],i.target_range=this._h_target;n=this._yscales;for(t in n)i=n[t],i.target_range=this._v_target;return null},e}(h.LayoutCanvas);n.CartesianFrame=_,_.prototype.type="CartesianFrame",_.getters({panel:function(){return this}}),_.getters({x_ranges:function(){return this._x_ranges},y_ranges:function(){return this._y_ranges},xscales:function(){return this._xscales},yscales:function(){return this._yscales}}),_.internal({extra_x_ranges:[c.Any,{}],extra_y_ranges:[c.Any,{}],x_range:[c.Instance],y_range:[c.Instance],x_scale:[c.Instance],y_scale:[c.Instance]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(79);n.Canvas=i.Canvas;var r=t(80);n.CartesianFrame=r.CartesianFrame},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50);n.Expression=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._connected={},this._result={}},e.prototype._v_compute=function(t){return null==this._connected[t.id]&&(this.connect(t.change,function(){return this._result[t.id]=null}),this._connected[t.id]=!0),null!=this._result[t.id]?this._result[t.id]:(this._result[t.id]=this.v_compute(t),this._result[t.id])},e}(r.Model)},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(82);n.Expression=i.Expression;var r=t(84);n.Stack=r.Stack},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(82),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.v_compute=function(t){var e,n,i,r,o,s,a,l,u,h;for(u=new Float64Array(t.get_length()),a=this.fields,i=0,o=a.length;i<o;i++)for(e=a[i],l=t.data[e],n=r=0,s=l.length;r<s;n=++r)h=l[n],u[n]+=h;return u},e}(r.Expression);n.Stack=s,s.define({fields:[o.Array,[]]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(87),o=t(15),s=t(14),a=t(22),l=t(42),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute_indices=function(t){var e,n,i;return(null!=(n=this.booleans)?n.length:void 0)>0?a.all(this.booleans,l.isBoolean)?(this.booleans.length!==t.get_length()&&s.logger.warn("BooleanFilter "+this.id+": length of booleans doesn't match data source"),function(){var t,n,i,r;for(i=a.range(0,this.booleans.length),r=[],t=0,n=i.length;t<n;t++)e=i[t],this.booleans[e]===!0&&r.push(e);return r}.call(this)):(s.logger.warn("BooleanFilter "+this.id+": booleans should be array of booleans, defaulting to no filtering"),null):(0===(null!=(i=this.booleans)?i.length:void 0)?s.logger.warn("BooleanFilter "+this.id+": booleans is empty, defaulting to no filtering"):s.logger.warn("BooleanFilter "+this.id+": booleans was not set, defaulting to no filtering"),null)},e}(r.Filter);n.BooleanFilter=u,u.prototype.type="BooleanFilter",u.define({booleans:[o.Array,null]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(87),o=t(15),s=t(30),a=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(n,e),n.prototype.compute_indices=function(n){return this.filter=this.func.apply(this,this.values.concat([n,t,{}])),e.prototype.compute_indices.call(this)},n.prototype._make_values=function(){return s.values(this.args)},n.prototype._make_func=function(){return new(Function.bind.apply(Function,[void 0].concat(Object.keys(this.args),["source","require","exports",this.code])))},n}(r.Filter);n.CustomJSFilter=a,a.prototype.type="CustomJSFilter",a.define({args:[o.Any,{}],code:[o.String,""]}),a.getters({values:function(){return this._make_values()},func:function(){return this._make_func()}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50),o=t(15),s=t(42),a=t(22),l=t(14),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e)},e.prototype.compute_indices=function(){var t,e;return(null!=(e=this.filter)?e.length:void 0)>=0?a.all(this.filter,s.isBoolean)?function(){var e,n,i,r;for(i=a.range(0,this.filter.length),r=[],e=0,n=i.length;e<n;e++)t=i[e],this.filter[t]===!0&&r.push(t);return r}.call(this):a.all(this.filter,s.isInteger)?this.filter:(l.logger.warn("Filter "+this.id+": filter should either be array of only booleans or only integers, defaulting to no filtering"),null):(l.logger.warn("Filter "+this.id+": filter was not set to be an array, defaulting to no filtering"),null)},e}(r.Model);n.Filter=u,u.prototype.type="Filter",u.define({filter:[o.Array,null]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(87),o=t(15),s=t(14),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute_indices=function(t){var e,n;return e=t.get_column(this.column_name),null==e?(s.logger.warn("group filter: groupby column not found in data source"),null):(this.indices=function(){var i,r,o;for(o=[],n=i=0,r=t.get_length();0<=r?i<r:i>r;n=0<=r?++i:--i)e[n]===this.group&&o.push(n);return o}.call(this),0===this.indices.length&&s.logger.warn("group filter: group '"+this.group+"' did not match any values in column '"+this.column_name+"'"),this.indices)},e}(r.Filter);n.GroupFilter=a,a.prototype.type="GroupFilter",a.define({column_name:[o.String],group:[o.String]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(85);n.BooleanFilter=i.BooleanFilter;var r=t(86);n.CustomJSFilter=r.CustomJSFilter;var o=t(87);n.Filter=o.Filter;var s=t(88);n.GroupFilter=s.GroupFilter;var a=t(90);n.IndexFilter=a.IndexFilter},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(87),o=t(15),s=t(14),a=t(42),l=t(22),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute_indices=function(t){var e;return(null!=(e=this.indices)?e.length:void 0)>=0?l.all(this.indices,a.isInteger)?this.indices:(s.logger.warn("IndexFilter "+this.id+": indices should be array of integers, defaulting to no filtering"),null):(s.logger.warn("IndexFilter "+this.id+": indices was not set, defaulting to no filtering"),null)},e}(r.Filter);n.IndexFilter=u,u.prototype.type="IndexFilter",u.define({indices:[o.Array,null]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(100),o=t(15),s=t(42),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.last_precision=3},e.prototype.doFormat=function(t,e){var n,i,r,o,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;if(0===t.length)return[];if(k=0,t.length>=2&&(k=Math.abs(t[1]-t[0])/1e4),_=!1,this.use_scientific)for(r=0,u=t.length;r<u;r++)if(b=t[r],x=Math.abs(b),x>k&&(x>=this.scientific_limit_high||x<=this.scientific_limit_low)){_=!0;break}if(d=this.precision,null==d||s.isNumber(d)){if(l=new Array(t.length),_)for(n=o=0,f=t.length;0<=f?o<f:o>f;n=0<=f?++o:--o)l[n]=t[n].toExponential(d||void 0);else for(n=a=0,m=t.length;0<=m?a<m:a>m;n=0<=m?++a:--a)l[n]=t[n].toFixed(d||void 0).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"");return l}if("auto"===d)for(l=new Array(t.length),w=h=v=this.last_precision;v<=15?h<=15:h>=15;w=v<=15?++h:--h){if(i=!0,_){for(n=c=0,g=t.length;0<=g?c<g:c>g;n=0<=g?++c:--c)if(l[n]=t[n].toExponential(w),n>0&&l[n]===l[n-1]){i=!1;break}if(i)break}else{for(n=p=0,y=t.length;0<=y?p<y:p>y;n=0<=y?++p:--p)if(l[n]=t[n].toFixed(w).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,""),n>0&&l[n]===l[n-1]){i=!1;break}if(i)break}if(i)return this.last_precision=w,l}return l},e}(r.TickFormatter);n.BasicTickFormatter=a,a.prototype.type="BasicTickFormatter",a.define({precision:[o.Any,"auto"],use_scientific:[o.Bool,!0],power_limit_high:[o.Number,5],power_limit_low:[o.Number,-3]}),a.getters({scientific_limit_low:function(){return Math.pow(10,this.power_limit_low)},scientific_limit_high:function(){return Math.pow(10,this.power_limit_high)}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(100),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(t,e){return t},e}(r.TickFormatter);n.CategoricalTickFormatter=o,o.prototype.type="CategoricalTickFormatter"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s=t(364),a=t(362),l=t(363),u=t(100),h=t(14),c=t(15),_=t(22),p=t(42);o=function(t){return Math.round(t/1e3%1*1e6)},i=function(t){return l(t,"%Y %m %d %H %M %S").split(/\s+/).map(function(t){return parseInt(t,10)})},r=function(t,e){var n;return p.isFunction(e)?e(t):(n=a.sprintf("$1%06d",o(t)),e=e.replace(/((^|[^%])(%%)*)%f/,n),e.indexOf("%")===-1?e:l(t,e))};var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._update_width_formats()},e.prototype._update_width_formats=function(){var t,e;return e=l(new Date),t=function(t){var n,i,o;return i=function(){var i,o,s;for(s=[],i=0,o=t.length;i<o;i++)n=t[i],s.push(r(e,n).length);return s}(),o=_.sortBy(_.zip(i,t),function(t){var e=t[0];t[1];return e}),_.unzip(o)},this._width_formats={microseconds:t(this.microseconds),milliseconds:t(this.milliseconds),seconds:t(this.seconds),minsec:t(this.minsec),minutes:t(this.minutes),hourmin:t(this.hourmin),hours:t(this.hours),days:t(this.days),months:t(this.months),years:t(this.years)}},e.prototype._get_resolution_str=function(t,e){var n;switch(n=1.1*t,!1){case!(n<.001):return"microseconds";case!(n<1):return"milliseconds";case!(n<60):return e>=60?"minsec":"seconds";case!(n<3600):return e>=3600?"hourmin":"minutes";case!(n<86400):return"hours";case!(n<2678400):return"days";case!(n<31536e3):return"months";default:return"years"}},e.prototype.doFormat=function(t,e,n,o,s,a){void 0===n&&(n=null),void 0===o&&(o=null),void 0===s&&(s=.3),void 0===a&&(a=null);var l,u,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j,P,z,C,N,D;if(0===t.length)return[];if(j=Math.abs(t[t.length-1]-t[0])/1e3,M=a?a.resolution:j/(t.length-1),O=this._get_resolution_str(M,j),I=this._width_formats[O],D=I[0],_=I[1],c=_[0],o){for(p=[],f=m=0,S=D.length;0<=S?m<S:m>S;f=0<=S?++m:--m)D[f]*t.length<s*o&&p.push(this._width_formats[f]);p.length>0&&(c=p[p.length-1])}for(y=[],A=this.format_order.indexOf(O),C={},T=this.format_order,v=0,b=T.length;v<b;v++)u=T[v],C[u]=0;for(C.seconds=5,C.minsec=4,C.minutes=4,C.hourmin=3,C.hours=3,g=0,x=t.length;g<x;g++){z=t[g];try{N=i(z),E=r(z,c)}catch(F){l=F,h.logger.warn("unable to format tick for timestamp value "+z),h.logger.warn(" - "+l),y.push("ERR");continue}for(d=!1,k=A;0===N[C[this.format_order[k]]]&&(k+=1,k!==this.format_order.length);){if(("minsec"===O||"hourmin"===O)&&!d){if("minsec"===O&&0===N[4]&&0!==N[5]||"hourmin"===O&&0===N[3]&&0!==N[4]){w=this._width_formats[this.format_order[A-1]][1][0],E=r(z,w);break}d=!0}w=this._width_formats[this.format_order[k]][1][0],E=r(z,w)}this.strip_leading_zeros?(P=E.replace(/^0+/g,""),P!==E&&isNaN(parseInt(P))&&(P="0"+P),y.push(P)):y.push(E)}return y;var I},e}(u.TickFormatter);n.DatetimeTickFormatter=d,d.prototype.type="DatetimeTickFormatter",d.define({microseconds:[c.Array,["%fus"]],milliseconds:[c.Array,["%3Nms","%S.%3Ns"]],seconds:[c.Array,["%Ss"]],minsec:[c.Array,[":%M:%S"]],minutes:[c.Array,[":%M","%Mm"]],hourmin:[c.Array,["%H:%M"]],hours:[c.Array,["%Hh","%H:%M"]],days:[c.Array,["%m/%d","%a%d"]],months:[c.Array,["%m/%Y","%b%y"]],years:[c.Array,["%Y"]]}),d.prototype.format_order=["microseconds","milliseconds","seconds","minsec","minutes","hourmin","hours","days","months","years"],d.prototype.strip_leading_zeros=!0},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(100),o=t(15),s=t(30),a=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(n,e),n.prototype._make_func=function(){return new(Function.bind.apply(Function,[void 0,"tick"].concat(Object.keys(this.args),["require",this.code])))},n.prototype.doFormat=function(e,n){var i,r;return i=this._make_func(),function(){var n,o,a;for(a=[],n=0,o=e.length;n<o;n++)r=e[n],a.push(i.apply(void 0,[r].concat(s.values(this.args),[t])));return a}.call(this)},n}(r.TickFormatter);n.FuncTickFormatter=a,a.prototype.type="FuncTickFormatter",a.define({args:[o.Any,{}],code:[o.String,""]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(91);n.BasicTickFormatter=i.BasicTickFormatter;var r=t(92);n.CategoricalTickFormatter=r.CategoricalTickFormatter;var o=t(93);n.DatetimeTickFormatter=o.DatetimeTickFormatter;var s=t(94);n.FuncTickFormatter=s.FuncTickFormatter;var a=t(96);n.LogTickFormatter=a.LogTickFormatter;var l=t(97);n.MercatorTickFormatter=l.MercatorTickFormatter;var u=t(98);n.NumeralTickFormatter=u.NumeralTickFormatter;var h=t(99);n.PrintfTickFormatter=h.PrintfTickFormatter;var c=t(100);n.TickFormatter=c.TickFormatter},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(91),o=t(100),s=t(14),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){if(t.prototype.initialize.call(this,e,n),this.basic_formatter=new r.BasicTickFormatter,null==this.ticker)return s.logger.warn("LogTickFormatter not configured with a ticker, using default base of 10 (labels will be incorrect if ticker base is not 10)")},e.prototype.doFormat=function(t,e){var n,i,r,o,s,a;if(0===t.length)return[];for(n=null!=this.ticker?this.ticker.base:10,a=!1,o=new Array(t.length),i=r=0,s=t.length;0<=s?r<s:r>s;i=0<=s?++r:--r)if(o[i]=n+"^"+Math.round(Math.log(t[i])/Math.log(n)),i>0&&o[i]===o[i-1]){a=!0;break}return a&&(o=this.basic_formatter.doFormat(t)),o},e}(o.TickFormatter);n.LogTickFormatter=l,l.prototype.type="LogTickFormatter",l.define({ticker:[a.Instance,null]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(91),o=t(15),s=t(31),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(e,n){var i,r,o,a,l,u,h,c;if(null==this.dimension)throw new Error("MercatorTickFormatter.dimension not configured");if(0===e.length)return[];if(u=new Array(e.length),"lon"===this.dimension)for(i=r=0,h=e.length;0<=h?r<h:r>h;i=0<=h?++r:--r)_=s.proj4(s.mercator).inverse([e[i],n.loc]),l=_[0],a=_[1],u[i]=l;else for(i=o=0,c=e.length;0<=c?o<c:o>c;i=0<=c?++o:--o)p=s.proj4(s.mercator).inverse([n.loc,e[i]]),l=p[0],a=p[1],u[i]=a;return t.prototype.doFormat.call(this,u,n);var _,p},e}(r.BasicTickFormatter);n.MercatorTickFormatter=a,a.prototype.type="MercatorTickFormatter",a.define({dimension:[o.LatLon]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(332),o=t(100),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(t,e){var n,i,o,s,a;return n=this.format,o=this.language,s=function(){switch(this.rounding){case"round":case"nearest":return Math.round;case"floor":case"rounddown":return Math.floor;case"ceil":case"roundup":return Math.ceil}}.call(this),i=function(){var e,i,l;for(l=[],e=0,i=t.length;e<i;e++)a=t[e],l.push(r.format(a,n,o,s));return l}()},e}(o.TickFormatter);n.NumeralTickFormatter=a,a.prototype.type="NumeralTickFormatter",a.define({format:[s.String,"0,0"],language:[s.String,"en"],rounding:[s.String,"round"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(362),o=t(100),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(t,e){var n,i,o;return n=this.format,i=function(){var e,i,s;for(s=[],e=0,i=t.length;e<i;e++)o=t[e],s.push(r.sprintf(n,o));return s}()},e}(o.TickFormatter);n.PrintfTickFormatter=a,a.prototype.type="PrintfTickFormatter",a.define({format:[s.String,"%s"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(t,e){},e}(r.Model);n.TickFormatter=o,o.prototype.type="TickFormatter"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(9),s=t(15),a=t(29);n.AnnularWedgeView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){var t,e,n,i;for("data"===this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,this._x,this._inner_radius):this.sinner_radius=this._inner_radius,
  "data"===this.model.properties.outer_radius.units?this.souter_radius=this.sdist(this.renderer.xscale,this._x,this._outer_radius):this.souter_radius=this._outer_radius,this._angle=new Float32Array(this._start_angle.length),i=[],t=e=0,n=this._start_angle.length;0<=n?e<n:e>n;t=0<=n?++e:--e)i.push(this._angle[t]=this._end_angle[t]-this._start_angle[t]);return i},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n._start_angle,c=n._angle,_=n.sinner_radius,p=n.souter_radius;for(i=this.model.properties.direction.value(),a=[],o=0,s=e.length;o<s;o++)r=e[o],isNaN(l[r]+u[r]+_[r]+p[r]+h[r]+c[r])||(t.translate(l[r],u[r]),t.rotate(h[r]),t.moveTo(p[r],0),t.beginPath(),t.arc(0,0,p[r],0,c[r],i),t.rotate(c[r]),t.lineTo(_[r],0),t.arc(0,0,_[r],0,-c[r],!i),t.closePath(),t.rotate(-c[r]-h[r]),t.translate(-l[r],-u[r]),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,r),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,r),a.push(t.stroke())):a.push(void 0));return a},e.prototype._hit_point=function(t){var e,n,i,r,s,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A;for(v=t.sx,b=t.sy,k=this.renderer.xscale.invert(v),T=this.renderer.yscale.invert(b),"data"===this.model.properties.outer_radius.units?(M=k-this.max_outer_radius,S=k+this.max_outer_radius,O=T-this.max_outer_radius,A=T+this.max_outer_radius):(g=v-this.max_outer_radius,y=v+this.max_outer_radius,E=this.renderer.xscale.r_invert(g,y),M=E[0],S=E[1],x=b-this.max_outer_radius,w=b+this.max_outer_radius,j=this.renderer.yscale.r_invert(x,w),O=j[0],A=j[1]),i=[],n=o.validate_bbox_coords([M,S],[O,A]),m=this.index.indices(n),c=0,p=m.length;c<p;c++)u=m[c],f=Math.pow(this.souter_radius[u],2),h=Math.pow(this.sinner_radius[u],2),P=this.renderer.xscale.r_compute(k,this._x[u]),g=P[0],y=P[1],z=this.renderer.yscale.r_compute(T,this._y[u]),x=z[0],w=z[1],s=Math.pow(g-y,2)+Math.pow(x-w,2),s<=f&&s>=h&&i.push([u,s]);for(r=this.model.properties.direction.value(),l=[],_=0,d=i.length;_<d;_++)C=i[_],u=C[0],s=C[1],e=Math.atan2(b-this.sy[u],v-this.sx[u]),a.angle_between(-e,-this._start_angle[u],-this._end_angle[u],r)&&l.push([u,s]);return o.create_1d_hit_test_result(l);var E,j,P,z,C},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e.prototype._scxy=function(t){var e,n;return n=(this.sinner_radius[t]+this.souter_radius[t])/2,e=(this._start_angle[t]+this._end_angle[t])/2,{x:this.sx[t]+n*Math.cos(e),y:this.sy[t]+n*Math.sin(e)}},e.prototype.scx=function(t){return this._scxy(t).x},e.prototype.scy=function(t){return this._scxy(t).y},e}(r.XYGlyphView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.AnnularWedge=l,l.prototype.default_view=n.AnnularWedgeView,l.prototype.type="AnnularWedge",l.mixins(["line","fill"]),l.define({direction:[s.Direction,"anticlock"],inner_radius:[s.DistanceSpec],outer_radius:[s.DistanceSpec],start_angle:[s.AngleSpec],end_angle:[s.AngleSpec]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(9),s=t(15);n.AnnulusView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){return"data"===this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,this._x,this._inner_radius):this.sinner_radius=this._inner_radius,"data"===this.model.properties.outer_radius.units?this.souter_radius=this.sdist(this.renderer.xscale,this._x,this._outer_radius):this.souter_radius=this._outer_radius},e.prototype._render=function(t,e,n){var i,r,o,s,a,l,u,h,c,_=n.sx,p=n.sy,d=n.sinner_radius,f=n.souter_radius;for(c=[],s=0,l=e.length;s<l;s++)if(r=e[s],!isNaN(_[r]+p[r]+d[r]+f[r])){if(o=navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>0||navigator.userAgent.indexOf("Edge")>0,this.visuals.fill.doit){if(this.visuals.fill.set_vectorize(t,r),t.beginPath(),o)for(h=[!1,!0],a=0,u=h.length;a<u;a++)i=h[a],t.arc(_[r],p[r],d[r],0,Math.PI,i),t.arc(_[r],p[r],f[r],Math.PI,0,!i);else t.arc(_[r],p[r],d[r],0,2*Math.PI,!0),t.arc(_[r],p[r],f[r],2*Math.PI,0,!1);t.fill()}this.visuals.line.doit?(this.visuals.line.set_vectorize(t,r),t.beginPath(),t.arc(_[r],p[r],d[r],0,2*Math.PI),t.moveTo(_[r]+f[r],p[r]),t.arc(_[r],p[r],f[r],0,2*Math.PI),c.push(t.stroke())):c.push(void 0)}return c},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w;for(c=t.sx,d=t.sy,v=this.renderer.xscale.invert(c),g=v-this.max_radius,y=v+this.max_radius,b=this.renderer.yscale.invert(d),x=b-this.max_radius,w=b+this.max_radius,i=[],e=o.validate_bbox_coords([g,y],[x,w]),h=this.index.indices(e),a=0,l=h.length;a<l;a++)r=h[a],u=Math.pow(this.souter_radius[r],2),s=Math.pow(this.sinner_radius[r],2),k=this.renderer.xscale.r_compute(v,this._x[r]),_=k[0],p=k[1],M=this.renderer.yscale.r_compute(b,this._y[r]),f=M[0],m=M[1],n=Math.pow(_-p,2)+Math.pow(f-m,2),n<=u&&n>=s&&i.push([r,n]);return o.create_1d_hit_test_result(i);var k,M},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h,c,_;return a=[o],c={},c[o]=(e+n)/2,_={},_[o]=(i+r)/2,l=.5*Math.min(Math.abs(n-e),Math.abs(r-i)),u={},u[o]=.4*l,h={},h[o]=.8*l,s={sx:c,sy:_,sinner_radius:u,souter_radius:h},this._render(t,a,s)},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Annulus=a,a.prototype.default_view=n.AnnulusView,a.prototype.type="Annulus",a.mixins(["line","fill"]),a.define({inner_radius:[s.DistanceSpec],outer_radius:[s.DistanceSpec]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(15);n.ArcView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){return"data"===this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n.sradius,c=n._start_angle,_=n._end_angle;if(this.visuals.line.doit){for(i=this.model.properties.direction.value(),a=[],o=0,s=e.length;o<s;o++)r=e[o],isNaN(l[r]+u[r]+h[r]+c[r]+_[r])||(t.beginPath(),t.arc(l[r],u[r],h[r],c[r],_[r],i),this.visuals.line.set_vectorize(t,r),a.push(t.stroke()));return a}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Arc=s,s.prototype.default_view=n.ArcView,s.prototype.type="Arc",s.mixins(["line"]),s.define({direction:[o.Direction,"anticlock"],radius:[o.DistanceSpec],start_angle:[o.AngleSpec],end_angle:[o.AngleSpec]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=t(36),s=t(108);i=function(t,e,n,i,r,o,s,a){var l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M;for(w=[],c=[[],[]],p=m=0;m<=2;p=++m)if(0===p?(u=6*t-12*n+6*r,l=-3*t+9*n-9*r+3*s,_=3*n-3*t):(u=6*e-12*i+6*o,l=-3*e+9*i-9*o+3*a,_=3*i-3*e),Math.abs(l)<1e-12){if(Math.abs(u)<1e-12)continue;y=-_/u,0<y&&y<1&&w.push(y)}else h=u*u-4*_*l,g=Math.sqrt(h),h<0||(b=(-u+g)/(2*l),0<b&&b<1&&w.push(b),x=(-u-g)/(2*l),0<x&&x<1&&w.push(x));for(d=w.length,f=d;d--;)y=w[d],v=1-y,k=v*v*v*t+3*v*v*y*n+3*v*y*y*r+y*y*y*s,c[0][d]=k,M=v*v*v*e+3*v*v*y*i+3*v*y*y*o+y*y*y*a,c[1][d]=M;return c[0][f]=t,c[1][f]=e,c[0][f+1]=s,c[1][f+1]=a,[Math.min.apply(null,c[0]),Math.max.apply(null,c[1]),Math.max.apply(null,c[0]),Math.min.apply(null,c[1])]},n.BezierView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._index_data=function(){var t,e,n,r,s,a,l,u;for(n=[],t=e=0,r=this._x0.length;0<=r?e<r:e>r;t=0<=r?++e:--e)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t]+this._cx0[t]+this._cy0[t]+this._cx1[t]+this._cy1[t])||(h=i(this._x0[t],this._y0[t],this._x1[t],this._y1[t],this._cx0[t],this._cy0[t],this._cx1[t],this._cy1[t]),s=h[0],l=h[1],a=h[2],u=h[3],n.push({minX:s,minY:l,maxX:a,maxY:u,i:t}));return new o.RBush(n);var h},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx0,l=n.sy0,u=n.sx1,h=n.sy1,c=(n.scx,n.scx0),_=n.scy0,p=n.scx1,d=n.scy1;if(this.visuals.line.doit){for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+l[i]+u[i]+h[i]+c[i]+_[i]+p[i]+d[i])||(t.beginPath(),t.moveTo(a[i],l[i]),t.bezierCurveTo(c[i],_[i],p[i],d[i],u[i],h[i]),this.visuals.line.set_vectorize(t,i),s.push(t.stroke()));return s}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(s.GlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(s.Glyph);n.Bezier=a,a.prototype.default_view=n.BezierView,a.prototype.type="Bezier",a.coords([["x0","y0"],["x1","y1"],["cx0","cy0"],["cx1","cy1"]]),a.mixins(["line"])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(36),o=t(108),s=t(9);n.BoxView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._index_box=function(t){var e,n,i,o,s,a,l,u;for(s=[],n=i=0,l=t;0<=l?i<l:i>l;n=0<=l?++i:--i)h=this._lrtb(n),o=h[0],a=h[1],u=h[2],e=h[3],!isNaN(o+a+u+e)&&isFinite(o+a+u+e)&&s.push({minX:o,minY:e,maxX:a,maxY:u,i:n});return new r.RBush(s);var h},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sleft,l=n.sright,u=n.stop,h=n.sbottom;for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+u[i]+l[i]+h[i])||(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,i),t.fillRect(a[i],u[i],l[i]-a[i],h[i]-u[i])),this.visuals.line.doit?(t.beginPath(),t.rect(a[i],u[i],l[i]-a[i],h[i]-u[i]),this.visuals.line.set_vectorize(t,i),s.push(t.stroke())):s.push(void 0));return s},e.prototype._hit_rect=function(t){return this._hit_rect_against_index(t)},e.prototype._hit_point=function(t){var e,n,i,r,o,a;return i=t.sx,r=t.sy,o=this.renderer.xscale.invert(i),a=this.renderer.yscale.invert(r),e=this.index.indices({minX:o,minY:a,maxX:o,maxY:a}),n=s.create_hit_test_result(),n["1d"].indices=e,n},e.prototype._hit_span=function(t){var e,n,i,r,o,a,l,u,h,c,_,p;return u=t.sx,h=t.sy,"v"===t.direction?(p=this.renderer.yscale.invert(h),n=this.renderer.plot_view.frame.bbox.h_range,d=this.renderer.xscale.r_invert(n.start,n.end),o=d[0],i=d[1],e=this.index.indices({minX:o,minY:p,maxX:i,maxY:p})):(_=this.renderer.xscale.invert(u),c=this.renderer.plot_view.frame.bbox.v_range,f=this.renderer.yscale.r_invert(c.start,c.end),a=f[0],r=f[1],e=this.index.indices({minX:_,minY:a,maxX:_,maxY:r})),l=s.create_hit_test_result(),l["1d"].indices=e,l;var d,f},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e}(o.GlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Glyph);n.Box=a,a.mixins(["line","fill"])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(9),s=t(15);n.CircleView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){var t,e;return null!=this._radius?"data"===this.model.properties.radius.spec.units?(t=this.model.properties.radius_dimension.spec.value,this.sradius=this.sdist(this.renderer[t+"scale"],this["_"+t],this._radius)):(this.sradius=this._radius,this.max_size=2*this.max_radius):this.sradius=function(){var t,n,i,r;for(i=this._size,r=[],t=0,n=i.length;t<n;t++)e=i[t],r.push(e/2);return r}.call(this)},e.prototype._mask_data=function(t){var e,n,i,r,s,a,l,u,h,c,_;return p=this.renderer.plot_view.frame.bbox.ranges,n=p[0],l=p[1],null!=this._radius&&"data"===this.model.properties.radius.units?(i=n.start,r=n.end,d=this.renderer.xscale.r_invert(i,r),u=d[0],h=d[1],u-=this.max_radius,h+=this.max_radius,s=l.start,a=l.end,f=this.renderer.yscale.r_invert(s,a),c=f[0],_=f[1],c-=this.max_radius,_+=this.max_radius):(i=n.start-this.max_size,r=n.end+this.max_size,m=this.renderer.xscale.r_invert(i,r),u=m[0],h=m[1],s=l.start-this.max_size,a=l.end+this.max_size,v=this.renderer.yscale.r_invert(s,a),c=v[0],_=v[1]),e=o.validate_bbox_coords([u,h],[c,_]),this.index.indices(e);var p,d,f,m,v},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx,l=n.sy,u=n.sradius;for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+l[i]+u[i])||(t.beginPath(),t.arc(a[i],l[i],u[i],0,2*Math.PI,!1),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,i),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,i),s.push(t.stroke())):s.push(void 0));return s},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;if(_=t.sx,f=t.sy,g=this.renderer.xscale.invert(_),x=this.renderer.yscale.invert(f),null!=this._radius&&"data"===this.model.properties.radius.units?(y=g-this.max_radius,b=g+this.max_radius,w=x-this.max_radius,k=x+this.max_radius):(p=_-this.max_size,d=_+this.max_size,M=this.renderer.xscale.r_invert(p,d),y=M[0],b=M[1],S=[Math.min(y,b),Math.max(y,b)],y=S[0],b=S[1],m=f-this.max_size,v=f+this.max_size,T=this.renderer.yscale.r_invert(m,v),w=T[0],k=T[1],O=[Math.min(w,k),Math.max(w,k)],w=O[0],k=O[1]),e=o.validate_bbox_coords([y,b],[w,k]),n=this.index.indices(e),r=[],null!=this._radius&&"data"===this.model.properties.radius.units)for(a=0,u=n.length;a<u;a++)s=n[a],c=Math.pow(this.sradius[s],2),A=this.renderer.xscale.r_compute(g,this._x[s]),p=A[0],d=A[1],E=this.renderer.yscale.r_compute(x,this._y[s]),m=E[0],v=E[1],i=Math.pow(p-d,2)+Math.pow(m-v,2),i<=c&&r.push([s,i]);else for(l=0,h=n.length;l<h;l++)s=n[l],c=Math.pow(this.sradius[s],2),i=Math.pow(this.sx[s]-_,2)+Math.pow(this.sy[s]-f,2),i<=c&&r.push([s,i]);return o.create_1d_hit_test_result(r);var M,S,T,O,A,E},e.prototype._hit_span=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y;return h=t.sx,p=t.sy,b=this.bounds(),s=b.minX,a=b.minY,i=b.maxX,r=b.maxY,u=o.create_hit_test_result(),"h"===t.direction?(g=a,y=r,null!=this._radius&&"data"===this.model.properties.radius.units?(c=h-this.max_radius,_=h+this.max_radius,x=this.renderer.xscale.r_invert(c,_),m=x[0],v=x[1]):(l=this.max_size/2,c=h-l,_=h+l,w=this.renderer.xscale.r_invert(c,_),m=w[0],v=w[1])):(m=s,v=i,null!=this._radius&&"data"===this.model.properties.radius.units?(d=p-this.max_radius,f=p+this.max_radius,k=this.renderer.yscale.r_invert(d,f),g=k[0],y=k[1]):(l=this.max_size/2,d=p-l,f=p+l,M=this.renderer.yscale.r_invert(d,f),g=M[0],y=M[1])),e=o.validate_bbox_coords([m,v],[g,y]),n=this.index.indices(e),u["1d"].indices=n,u;var b,x,w,k,M},e.prototype._hit_rect=function(t){var e,n,i,r,s,a,l,u,h,c;return i=t.sx0,r=t.sx1,s=t.sy0,a=t.sy1,_=this.renderer.xscale.r_invert(i,r),l=_[0],u=_[1],p=this.renderer.yscale.r_invert(s,a),h=p[0],c=p[1],e=o.validate_bbox_coords([l,u],[h,c]),n=o.create_hit_test_result(),n["1d"].indices=this.index.indices(e),n;var _,p},e.prototype._hit_poly=function(t){var e,n,i,r,s,a,l,u,h,c;for(h=t.sx,c=t.sy,e=function(){u=[];for(var t=0,e=this.sx.length;0<=e?t<e:t>e;0<=e?t++:t--)u.push(t);return u}.apply(this),n=[],i=s=0,a=e.length;0<=a?s<a:s>a;i=0<=a?++s:--s)r=e[i],o.point_in_poly(this.sx[i],this.sy[i],h,c)&&n.push(r);return l=o.create_hit_test_result(),l["1d"].indices=n,l},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h;return a=[o],u={},u[o]=(e+n)/2,h={},h[o]=(i+r)/2,l={},l[o]=.2*Math.min(Math.abs(n-e),Math.abs(r-i)),s={sx:u,sy:h,sradius:l},this._render(t,a,s)},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.properties.radius.optional=!0},e}(r.XYGlyph);n.Circle=a,a.prototype.default_view=n.CircleView,a.prototype.type="Circle",a.mixins(["line","fill"]),a.define({angle:[s.AngleSpec,0],size:[s.DistanceSpec,{units:"screen",value:4}],radius:[s.DistanceSpec,null],radius_dimension:[s.String,"x"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(15);n.EllipseView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._set_data=function(){if(this.max_w2=0,"data"===this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,"data"===this.model.properties.height.units)return this.max_h2=this.max_height/2},e.prototype._map_data=function(){return"data"===this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this._width,"center"):this.sw=this._width,"data"===this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this._height,"center"):this.sh=this._height},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx,l=n.sy,u=n.sw,h=n.sh;for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+l[i]+u[i]+h[i]+this._angle[i])||(t.beginPath(),t.ellipse(a[i],l[i],u[i]/2,h[i]/2,this._angle[i],0,2*Math.PI),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,i),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,i),s.push(t.stroke())):s.push(void 0));return s},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h,c,_,p;return l=[o],_={},_[o]=(e+n)/2,p={},p[o]=(i+r)/2,u=this.sw[o]/this.sh[o],s=.8*Math.min(Math.abs(n-e),Math.abs(r-i)),c={},h={},u>1?(c[o]=s,h[o]=s/u):(c[o]=s*u,h[o]=s),a={sx:_,sy:p,sw:c,sh:h},this._render(t,l,a)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Ellipse=s,s.prototype.default_view=n.EllipseView,s.prototype.type="Ellipse",s.mixins(["line","fill"]),s.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(9),o=t(15),s=t(23),a=t(32),l=t(45),u=t(50),h=t(46),c=t(14),_=t(30),p=t(42),d=t(114);n.GlyphView=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(n,e),n.prototype.initialize=function(n){var i,r,o,s;if(e.prototype.initialize.call(this,n),this._nohit_warned={},this.renderer=n.renderer,this.visuals=new h.Visuals(this.model),r=this.renderer.plot_view.canvas_view.ctx,null!=r.glcanvas){try{s=t(425)}catch(a){if(o=a,"MODULE_NOT_FOUND"!==o.code)throw o;c.logger.warn("WebGL was requested and is supported, but bokeh-gl(.min).js is not available, falling back to 2D rendering."),s=null}if(null!=s&&(i=s[this.model.type+"GLGlyph"],null!=i))return this.glglyph=new i(r.glcanvas.gl,this)}},n.prototype.set_visuals=function(t){if(this.visuals.warm_cache(t),null!=this.glglyph)return this.glglyph.set_visuals_changed()},n.prototype.render=function(t,e,n){if(t.beginPath(),null==this.glglyph||!this.glglyph.render(t,e,n))return this._render(t,e,n)},n.prototype.has_finished=function(){return!0},n.prototype.notify_finished=function(){return this.renderer.notify_finished()},n.prototype.bounds=function(){return null==this.index?s.empty():this._bounds(this.index.bbox)},n.prototype.log_bounds=function(){var t,e,n,i,r,o,a,l,u;if(null==this.index)return s.empty();for(t=s.empty(),o=this.index.search(s.positive_x()),a=this.index.search(s.positive_y()),e=0,i=o.length;e<i;e++)l=o[e],l.minX<t.minX&&(t.minX=l.minX),l.maxX>t.maxX&&(t.maxX=l.maxX);for(n=0,r=a.length;n<r;n++)u=a[n],u.minY<t.minY&&(t.minY=u.minY),u.maxY>t.maxY&&(t.maxY=u.maxY);return this._bounds(t)},n.prototype.max_wh2_bounds=function(t){return{minX:t.minX-this.max_w2,maxX:t.maxX+this.max_w2,minY:t.minY-this.max_h2,maxY:t.maxY+this.max_h2}},n.prototype.get_anchor_point=function(t,e,n){var i=n[0],r=n[1];switch(t){case"center":return{x:this.scx(e,i,r),y:this.scy(e,i,r)};default:return null}},n.prototype.scx=function(t){return this.sx[t]},n.prototype.scy=function(t){return this.sy[t]},n.prototype.sdist=function(t,e,n,i,r){void 0===i&&(i="edge"),void 0===r&&(r=!1);var o,s,a,l,u,h,c;return null!=t.source_range.v_synthetic&&(e=t.source_range.v_synthetic(e)),"center"===i?(s=function(){var t,e,i;for(i=[],t=0,e=n.length;t<e;t++)o=n[t],i.push(o/2);return i}(),l=function(){var t,n,i;for(i=[],a=t=0,n=e.length;0<=n?t<n:t>n;a=0<=n?++t:--t)i.push(e[a]-s[a]);return i}(),u=function(){var t,n,i;for(i=[],a=t=0,n=e.length;0<=n?t<n:t>n;a=0<=n?++t:--t)i.push(e[a]+s[a]);return i}()):(l=e,u=function(){var t,e,i;for(i=[],a=t=0,e=l.length;0<=e?t<e:t>e;a=0<=e?++t:--t)i.push(l[a]+n[a]);return i}()),h=t.v_compute(l),c=t.v_compute(u),r?function(){var t,e,n;for(n=[],a=t=0,e=h.length;0<=e?t<e:t>e;a=0<=e?++t:--t)n.push(Math.ceil(Math.abs(c[a]-h[a])));return n}():function(){var t,e,n;for(n=[],a=t=0,e=h.length;0<=e?t<e:t>e;a=0<=e?++t:--t)n.push(Math.abs(c[a]-h[a]));return n}()},n.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return null},n.prototype._generic_line_legend=function(t,e,n,i,r,o){return t.save(),t.beginPath(),t.moveTo(e,(i+r)/2),t.lineTo(n,(i+r)/2),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,o),t.stroke()),t.restore()},n.prototype._generic_area_legend=function(t,e,n,i,r,o){var s,a,l,u,h,c,_,p,d;if(u=[o],d=Math.abs(n-e),a=.1*d,l=Math.abs(r-i),s=.1*l,h=e+a,c=n-a,_=i+s,p=r-s,this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,o),t.fillRect(h,_,c-h,p-_)),this.visuals.line.doit)return t.beginPath(),t.rect(h,_,c-h,p-_),this.visuals.line.set_vectorize(t,o),t.stroke()},n.prototype.hit_test=function(t){var e,n;return n=null,e="_hit_"+t.type,null!=this[e]?n=this[e](t):null==this._nohit_warned[t.type]&&(c.logger.debug("'"+t.type+"' selection not available for "+this.model.type),this._nohit_warned[t.type]=!0),n},n.prototype._hit_rect_against_index=function(t){var e,n,i,o,s,a,l,u,h,c;return i=t.sx0,o=t.sx1,s=t.sy0,a=t.sy1,_=this.renderer.xscale.r_invert(i,o),l=_[0],u=_[1],p=this.renderer.yscale.r_invert(s,a),h=p[0],c=p[1],e=r.validate_bbox_coords([l,u],[h,c]),n=r.create_hit_test_result(),n["1d"].indices=this.index.indices(e),n;var _,p},n.prototype.set_data=function(t,e,n){var i,r,o,s,l,u,h,c,p,f,m,v;if(i=this.model.materialize_dataspecs(t),this.visuals.set_all_indices(e),e&&!(this instanceof d.LineView)){r={};for(l in i)c=i[l],"_"===l.charAt(0)?r[l]=function(){var t,n,i;for(i=[],t=0,n=e.length;t<n;t++)o=e[t],i.push(c[o]);return i}():r[l]=c;i=r}if(_.extend(this,i),this.renderer.plot_view.model.use_map&&(null!=this._x&&(g=a.project_xy(this._x,this._y),this._x=g[0],this._y=g[1]),null!=this._xs&&(y=a.project_xsys(this._xs,this._ys),this._xs=y[0],this._ys=y[1])),null!=this.renderer.plot_view.frame.x_ranges)for(f=this.renderer.plot_view.frame.x_ranges[this.model.x_range_name],v=this.renderer.plot_view.frame.y_ranges[this.model.y_range_name],h=this.model._coords,s=0,u=h.length;s<u;s++)b=h[s],p=b[0],m=b[1],p="_"+p,m="_"+m,null!=f.v_synthetic&&(this[p]=f.v_synthetic(this[p])),null!=v.v_synthetic&&(this[m]=v.v_synthetic(this[m]));return null!=this.glglyph&&this.glglyph.set_data_changed(this._x.length),this._set_data(t,n),this.index=this._index_data();var g,y,b},n.prototype._set_data=function(){},n.prototype._index_data=function(){},n.prototype.mask_data=function(t){return null!=this.glglyph?t:this._mask_data(t)},n.prototype._mask_data=function(t){return t},n.prototype._bounds=function(t){return t},n.prototype.map_data=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,d,f;for(r=this.model._coords,e=0,i=r.length;e<i;e++)if(m=r[e],d=m[0],f=m[1],h="s"+d,_="s"+f,d="_"+d,f="_"+f,p.isArray(null!=(o=this[d])?o[0]:void 0)||(null!=(s=this[d])&&null!=(a=s[0])?a.buffer:void 0)instanceof ArrayBuffer)for(v=[[],[]],this[h]=v[0],this[_]=v[1],t=n=0,l=this[d].length;0<=l?n<l:n>l;t=0<=l?++n:--n)g=this.map_to_screen(this[d][t],this[f][t]),u=g[0],c=g[1],this[h].push(u),this[_].push(c);else y=this.map_to_screen(this[d],this[f]),this[h]=y[0],this[_]=y[1];return this._map_data();var m,v,g,y},n.prototype._map_data=function(){},n.prototype.map_to_screen=function(t,e){return this.renderer.plot_view.map_to_screen(t,e,this.model.x_range_name,this.model.y_range_name)},n}(l.View);var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.coords=function(t){var e,n,i,r,s,a;for(e=this.prototype._coords.concat(t),this.prototype._coords=e,r={},n=0,i=t.length;n<i;n++)l=t[n],s=l[0],a=l[1],r[s]=[o.NumberSpec],r[a]=[o.NumberSpec];return this.define(r);var l},e}(u.Model);n.Glyph=f,f.prototype._coords=[],f.internal({x_range_name:[o.String,"default"],y_range_name:[o.String,"default"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(105),o=t(15);n.HBarView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.scx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype._index_data=function(){return this._index_box(this._y.length)},e.prototype._lrtb=function(t){var e,n,i,r;return n=Math.min(this._left[t],this._right[t]),i=Math.max(this._left[t],this._right[t]),r=this._y[t]+.5*this._height[t],e=this._y[t]-.5*this._height[t],[n,i,r,e]},e.prototype._map_data=function(){var t,e,n;for(this.sy=this.renderer.yscale.v_compute(this._y),this.sright=this.renderer.xscale.v_compute(this._right),this.sleft=this.renderer.xscale.v_compute(this._left),this.stop=[],this.sbottom=[],this.sh=this.sdist(this.renderer.yscale,this._y,this._height,"center"),t=e=0,n=this.sy.length;0<=n?e<n:e>n;t=0<=n?++e:--e)this.stop.push(this.sy[t]-this.sh[t]/2),this.sbottom.push(this.sy[t]+this.sh[t]/2);return null},e}(r.BoxView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Box);n.HBar=s,s.prototype.default_view=n.HBarView,s.prototype.type="HBar",s.coords([["left","y"]]),s.define({height:[o.DistanceSpec],right:[o.NumberSpec]}),s.override({left:0})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=t(128),s=t(146),a=t(15),l=t(22);n.ImageView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model.color_mapper.change,function(){return this._update_image()})},e.prototype._update_image=function(){if(null!=this.image_data)return this._set_data(),this.renderer.plot_view.request_render()},e.prototype._set_data=function(){var t,e,n,i,r,o,s,a,u,h,c,_;for(null!=this.image_data&&this.image_data.length===this._image.length||(this.image_data=new Array(this._image.length)),null!=this._width&&this._width.length===this._image.length||(this._width=new Array(this._image.length)),null!=this._height&&this._height.length===this._image.length||(this._height=new Array(this._image.length)),c=[],o=u=0,h=this._image.length;0<=h?u<h:u>h;o=0<=h?++u:--u)_=[],null!=this._image_shape&&(_=this._image_shape[o]),_.length>0?(a=this._image[o],this._height[o]=_[0],this._width[o]=_[1]):(a=l.concat(this._image[o]),this._height[o]=this._image[o].length,this._width[o]=this._image[o][0].length),null!=this.image_data[o]&&this.image_data[o].width===this._width[o]&&this.image_data[o].height===this._height[o]?n=this.image_data[o]:(n=document.createElement("canvas"),n.width=this._width[o],n.height=this._height[o]),r=n.getContext("2d"),s=r.getImageData(0,0,this._width[o],this._height[o]),i=this.model.color_mapper,t=i.v_map_screen(a,!0),e=new Uint8Array(t),s.data.set(e),r.putImageData(s,0,0),this.image_data[o]=n,this.max_dw=0,"data"===this._dw.units&&(this.max_dw=l.max(this._dw)),this.max_dh=0,"data"===this._dh.units?c.push(this.max_dh=l.max(this._dh)):c.push(void 0);return c},e.prototype._map_data=function(){switch(this.model.properties.dw.units){case"data":this.sw=this.sdist(this.renderer.xscale,this._x,this._dw,"edge",this.model.dilate);break;case"screen":this.sw=this._dw}switch(this.model.properties.dh.units){case"data":return this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,"edge",this.model.dilate);case"screen":return this.sh=this._dh}},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.image_data,u=n.sx,h=n.sy,c=n.sw,_=n.sh;for(s=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),r=0,o=e.length;r<o;r++)i=e[r],null!=l[i]&&(isNaN(u[i]+h[i]+c[i]+_[i])||(a=h[i],t.translate(0,a),t.scale(1,-1),t.translate(0,-a),t.drawImage(l[i],0|u[i],0|h[i],c[i],_[i]),t.translate(0,a),t.scale(1,-1),t.translate(0,-a)));return t.setImageSmoothingEnabled(s)},e.prototype.bounds=function(){var t;return t=this.index.bbox,t.maxX+=this.max_dw,t.maxY+=this.max_dh,t},e}(o.XYGlyphView),i=function(){return[0,2434341,5395026,7566195,9868950,12434877,14277081,15790320,16777215]};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o.XYGlyph);n.Image=u,u.prototype.default_view=n.ImageView,u.prototype.type="Image",u.define({image:[a.NumberSpec],dw:[a.DistanceSpec],dh:[a.DistanceSpec],dilate:[a.Bool,!1],color_mapper:[a.Instance,function(){return new s.LinearColorMapper({palette:i()})}]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(15),s=t(22);n.ImageRGBAView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._set_data=function(t,e){var n,i,r,o,a,l,u,h,c,_,p,d,f,m,v;for(null!=this.image_data&&this.image_data.length===this._image.length||(this.image_data=new Array(this._image.length)),null!=this._width&&this._width.length===this._image.length||(this._width=new Array(this._image.length)),null!=this._height&&this._height.length===this._image.length||(this._height=new Array(this._image.length)),m=[],u=_=0,d=this._image.length;0<=d?_<d:_>d;u=0<=d?++_:--_)if(!(null!=e&&e.indexOf(u)<0)){if(v=[],null!=this._image_shape&&(v=this._image_shape[u]),v.length>0)n=this._image[u].buffer,this._height[u]=v[0],this._width[u]=v[1];else{for(l=s.concat(this._image[u]),n=new ArrayBuffer(4*l.length),o=new Uint32Array(n),c=p=0,f=l.length;0<=f?p<f:p>f;c=0<=f?++p:--p)o[c]=l[c];this._height[u]=this._image[u].length,this._width[u]=this._image[u][0].length}null!=this.image_data[u]&&this.image_data[u].width===this._width[u]&&this.image_data[u].height===this._height[u]?r=this.image_data[u]:(r=document.createElement("canvas"),r.width=this._width[u],r.height=this._height[u]),a=r.getContext("2d"),h=a.getImageData(0,0,this._width[u],this._height[u]),i=new Uint8Array(n),h.data.set(i),a.putImageData(h,0,0),this.image_data[u]=r,this.max_dw=0,"data"===this._dw.units&&(this.max_dw=s.max(this._dw)),this.max_dh=0,"data"===this._dh.units?m.push(this.max_dh=s.max(this._dh)):m.push(void 0)}return m},e.prototype._map_data=function(){switch(this.model.properties.dw.units){case"data":this.sw=this.sdist(this.renderer.xscale,this._x,this._dw,"edge",this.model.dilate);break;case"screen":this.sw=this._dw}switch(this.model.properties.dh.units){case"data":return this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,"edge",this.model.dilate);case"screen":return this.sh=this._dh}},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.image_data,u=n.sx,h=n.sy,c=n.sw,_=n.sh;for(s=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),r=0,o=e.length;r<o;r++)i=e[r],isNaN(u[i]+h[i]+c[i]+_[i])||(a=h[i],t.translate(0,a),t.scale(1,-1),t.translate(0,-a),t.drawImage(l[i],0|u[i],0|h[i],c[i],_[i]),t.translate(0,a),t.scale(1,-1),t.translate(0,-a));return t.setImageSmoothingEnabled(s)},e.prototype.bounds=function(){var t;return t=this.index.bbox,t.maxX+=this.max_dw,t.maxY+=this.max_dh,t},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.ImageRGBA=a,a.prototype.default_view=n.ImageRGBAView,a.prototype.type="ImageRGBA",a.define({image:[o.NumberSpec],dw:[o.DistanceSpec],dh:[o.DistanceSpec],dilate:[o.Bool,!1]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(108),o=t(14),s=t(15);n.ImageURLView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),
  this.connect(this.model.properties.global_alpha.change,function(){return n.renderer.request_render()})},e.prototype._index_data=function(){},e.prototype._set_data=function(){var t,e,n,i,r,s,a,l=this;for(null!=this.image&&this.image.length===this._url.length||(this.image=function(){var t,n,i,r;for(i=this._url,r=[],t=0,n=i.length;t<n;t++)e=i[t],r.push(null);return r}.call(this)),s=this.model.retry_attempts,a=this.model.retry_timeout,this.retries=function(){var t,n,i,r;for(i=this._url,r=[],t=0,n=i.length;t<n;t++)e=i[t],r.push(s);return r}.call(this),r=[],t=n=0,i=this._url.length;0<=i?n<i:n>i;t=0<=i?++n:--n)null!=this._url[t]&&(e=new Image,e.onerror=function(t,e){return function(){return l.retries[t]>0?(o.logger.trace("ImageURL failed to load "+l._url[t]+" image, retrying in "+a+" ms"),setTimeout(function(){return e.src=l._url[t]},a)):o.logger.warn("ImageURL unable to load "+l._url[t]+" image after "+s+" retries"),l.retries[t]-=1}}(t,e),e.onload=function(t,e){return function(){return l.image[e]=t,l.renderer.request_render()}}(e,t),r.push(e.src=this._url[t]));return r},e.prototype.has_finished=function(){return t.prototype.has_finished.call(this)&&this._images_rendered===!0},e.prototype._map_data=function(){var t,e,n;switch(e=function(){var t,e,i,r;if(null!=this.model.w)return this._w;for(i=this._x,r=[],t=0,e=i.length;t<e;t++)n=i[t],r.push(NaN);return r}.call(this),t=function(){var t,e,i,r;if(null!=this.model.h)return this._h;for(i=this._x,r=[],t=0,e=i.length;t<e;t++)n=i[t],r.push(NaN);return r}.call(this),this.model.properties.w.units){case"data":this.sw=this.sdist(this.renderer.xscale,this._x,e,"edge",this.model.dilate);break;case"screen":this.sw=e}switch(this.model.properties.h.units){case"data":return this.sh=this.sdist(this.renderer.yscale,this._y,t,"edge",this.model.dilate);case"screen":return this.sh=t}},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=(n._url,n.image),u=n.sx,h=n.sy,c=n.sw,_=n.sh,p=n._angle;for(r=this.renderer.plot_view.frame,t.rect(r._left.value+1,r._top.value+1,r._width.value-2,r._height.value-2),t.clip(),i=!0,s=0,a=e.length;s<a;s++)o=e[s],isNaN(u[o]+h[o]+p[o])||this.retries[o]!==-1&&(null!=l[o]?this._render_image(t,o,l[o],u,h,c,_,p):i=!1);if(i&&!this._images_rendered)return this._images_rendered=!0,this.notify_finished()},e.prototype._final_sx_sy=function(t,e,n,i,r){switch(t){case"top_left":return[e,n];case"top_center":return[e-i/2,n];case"top_right":return[e-i,n];case"center_right":return[e-i,n-r/2];case"bottom_right":return[e-i,n-r];case"bottom_center":return[e-i/2,n-r];case"bottom_left":return[e,n-r];case"center_left":return[e,n-r/2];case"center":return[e-i/2,n-r/2]}},e.prototype._render_image=function(t,e,n,i,r,o,s,a){var l;return isNaN(o[e])&&(o[e]=n.width),isNaN(s[e])&&(s[e]=n.height),l=this.model.anchor,u=this._final_sx_sy(l,i[e],r[e],o[e],s[e]),i=u[0],r=u[1],t.save(),t.globalAlpha=this.model.global_alpha,a[e]?(t.translate(i,r),t.rotate(a[e]),t.drawImage(n,0,0,o[e],s[e]),t.rotate(-a[e]),t.translate(-i,-r)):t.drawImage(n,i,r,o[e],s[e]),t.restore();var u},e}(r.GlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Glyph);n.ImageURL=a,a.prototype.default_view=n.ImageURLView,a.prototype.type="ImageURL",a.coords([["x","y"]]),a.mixins([]),a.define({url:[s.StringSpec],anchor:[s.Anchor,"top_left"],global_alpha:[s.Number,1],angle:[s.AngleSpec,0],w:[s.DistanceSpec],h:[s.DistanceSpec],dilate:[s.Bool,!1],retry_attempts:[s.Number,0],retry_timeout:[s.Number,0]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(101);n.AnnularWedge=i.AnnularWedge;var r=t(102);n.Annulus=r.Annulus;var o=t(103);n.Arc=o.Arc;var s=t(104);n.Bezier=s.Bezier;var a=t(106);n.Circle=a.Circle;var l=t(107);n.Ellipse=l.Ellipse;var u=t(108);n.Glyph=u.Glyph;var h=t(109);n.HBar=h.HBar;var c=t(110);n.Image=c.Image;var _=t(111);n.ImageRGBA=_.ImageRGBA;var p=t(112);n.ImageURL=p.ImageURL;var d=t(114);n.Line=d.Line;var f=t(115);n.MultiLine=f.MultiLine;var m=t(116);n.Oval=m.Oval;var v=t(117);n.Patch=v.Patch;var g=t(118);n.Patches=g.Patches;var y=t(119);n.Quad=y.Quad;var b=t(120);n.Quadratic=b.Quadratic;var x=t(121);n.Ray=x.Ray;var w=t(122);n.Rect=w.Rect;var k=t(123);n.Segment=k.Segment;var M=t(124);n.Step=M.Step;var S=t(125);n.Text=S.Text;var T=t(126);n.VBar=T.VBar;var O=t(127);n.Wedge=O.Wedge;var A=t(128);n.XYGlyph=A.XYGlyph},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(9);n.LineView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy;for(i=!1,this.visuals.line.set_value(t),s=null,o=0,a=e.length;o<a;o++){if(r=e[o],i){if(!isFinite(l[r]+u[r])){t.stroke(),t.beginPath(),i=!1,s=r;continue}null!==s&&r-s>1&&(t.stroke(),i=!1)}i?t.lineTo(l[r],u[r]):(t.beginPath(),t.moveTo(l[r],u[r]),i=!0),s=r}if(i)return t.stroke()},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c;for(u=o.create_hit_test_result(),a={x:t.sx,y:t.sy},h=9999,c=Math.max(2,this.visuals.line.line_width.value()/2),n=i=0,l=this.sx.length-1;0<=l?i<l:i>l;n=0<=l?++i:--i)_=[{x:this.sx[n],y:this.sy[n]},{x:this.sx[n+1],y:this.sy[n+1]}],r=_[0],s=_[1],e=o.dist_to_segment(a,r,s),e<c&&e<h&&(h=e,u["0d"].glyph=this.model,u["0d"].get_view=function(){return this}.bind(this),u["0d"].flag=!0,u["0d"].indices=[n]);return u;var _},e.prototype._hit_span=function(t){var e,n,i,r,s,a,l,u;for(s=t.sx,a=t.sy,r=o.create_hit_test_result(),"v"===t.direction?(l=this.renderer.yscale.invert(a),u=this._y):(l=this.renderer.xscale.invert(s),u=this._x),e=n=0,i=u.length-1;0<=i?n<i:n>i;e=0<=i?++n:--n)(u[e]<=l&&l<=u[e+1]||u[e+1]<=l&&l<=u[e])&&(r["0d"].glyph=this.model,r["0d"].get_view=function(){return this}.bind(this),r["0d"].flag=!0,r["0d"].indices.push(e));return r},e.prototype.get_interpolation_hit=function(t,e){var n,i,r,s,a,l,u,h,c,_,p;return i=e.sx,r=e.sy,d=[this._x[t],this._y[t],this._x[t+1],this._y[t+1]],l=d[0],_=d[1],u=d[2],p=d[3],"point"===e.type?(f=this.renderer.yscale.r_invert(r-1,r+1),h=f[0],c=f[1],m=this.renderer.xscale.r_invert(i-1,i+1),s=m[0],a=m[1]):"v"===e.direction?(v=this.renderer.yscale.r_invert(r,r),h=v[0],c=v[1],g=[l,u],s=g[0],a=g[1]):(y=this.renderer.xscale.r_invert(i,i),s=y[0],a=y[1],b=[_,p],h=b[0],c=b[1]),n=o.check_2_segments_intersect(s,h,a,c,l,_,u,p),[n.x,n.y];var d,f,m,v,g,y,b},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Line=s,s.prototype.default_view=n.LineView,s.prototype.type="Line",s.mixins(["line"])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(36),o=t(9),s=t(22),a=t(42),l=t(108);n.MultiLineView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._index_data=function(){var t,e,n,i,o,l,u,h;for(n=[],t=e=0,i=this._xs.length;0<=i?e<i:e>i;t=0<=i?++e:--e)null!==this._xs[t]&&0!==this._xs[t].length&&(l=function(){var e,n,i,r;for(i=this._xs[t],r=[],e=0,n=i.length;e<n;e++)o=i[e],a.isStrictNaN(o)||r.push(o);return r}.call(this),h=function(){var e,n,i,r;for(i=this._ys[t],r=[],e=0,n=i.length;e<n;e++)u=i[e],a.isStrictNaN(u)||r.push(u);return r}.call(this),n.push({minX:s.min(l),minY:s.min(h),maxX:s.max(l),maxY:s.max(h),i:t}));return new r.RBush(n)},e.prototype._render=function(t,e,n){var i,r,o,s,a,l,u,h,c,_=n.sxs,p=n.sys;for(u=[],o=0,a=e.length;o<a;o++){for(i=e[o],d=[_[i],p[i]],h=d[0],c=d[1],this.visuals.line.set_vectorize(t,i),r=s=0,l=h.length;0<=l?s<l:s>l;r=0<=l?++s:--s)0!==r?isNaN(h[r])||isNaN(c[r])?(t.stroke(),t.beginPath()):t.lineTo(h[r],c[r]):(t.beginPath(),t.moveTo(h[r],c[r]));u.push(t.stroke())}return u;var d},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m;for(d=o.create_hit_test_result(),h={x:t.sx,y:t.sy},f=9999,n={},i=s=0,_=this.sxs.length;0<=_?s<_:s>_;i=0<=_?++s:--s){for(m=Math.max(2,this.visuals.line.cache_select("line_width",i)/2),c=null,r=a=0,p=this.sxs[i].length-1;0<=p?a<p:a>p;r=0<=p?++a:--a)v=[{x:this.sxs[i][r],y:this.sys[i][r]},{x:this.sxs[i][r+1],y:this.sys[i][r+1]}],l=v[0],u=v[1],e=o.dist_to_segment(h,l,u),e<m&&e<f&&(f=e,c=[r]);c&&(n[i]=c)}return d["1d"].indices=function(){var t,e,r,o;for(r=Object.keys(n),o=[],e=0,t=r.length;e<t;e++)i=r[e],o.push(parseInt(i));return o}(),d["2d"].indices=n,d;var v},e.prototype._hit_span=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d;for(c=t.sx,_=t.sy,h=o.create_hit_test_result(),"v"===t.direction?(p=this.renderer.yscale.invert(_),d=this._ys):(p=this.renderer.xscale.invert(c),d=this._xs),e={},n=r=0,l=d.length;0<=l?r<l:r>l;n=0<=l?++r:--r){for(a=[],i=s=0,u=d[n].length-1;0<=u?s<u:s>u;i=0<=u?++s:--s)d[n][i]<=p&&p<=d[n][i+1]&&a.push(i);a.length>0&&(e[n]=a)}return h["1d"].indices=function(){var t,i,r,o;for(r=Object.keys(e),o=[],i=0,t=r.length;i<t;i++)n=r[i],o.push(parseInt(n));return o}(),h["2d"].indices=e,h},e.prototype.get_interpolation_hit=function(t,e,n){var i,r,s,a,l,u,h,c,_,p,d;return r=n.sx,s=n.sy,f=[this._xs[t][e],this._ys[t][e],this._xs[t][e+1],this._ys[t][e+1]],u=f[0],p=f[1],h=f[2],d=f[3],"point"===n.type?(m=this.renderer.yscale.r_invert(s-1,s+1),c=m[0],_=m[1],v=this.renderer.xscale.r_invert(r-1,r+1),a=v[0],l=v[1]):"v"===n.direction?(g=this.renderer.yscale.r_invert(s,s),c=g[0],_=g[1],y=[u,h],a=y[0],l=y[1]):(b=this.renderer.xscale.r_invert(r,r),a=b[0],l=b[1],x=[p,d],c=x[0],_=x[1]),i=o.check_2_segments_intersect(a,c,l,_,u,p,h,d),[i.x,i.y];var f,m,v,g,y,b,x},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(l.GlyphView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(l.Glyph);n.MultiLine=u,u.prototype.default_view=n.MultiLineView,u.prototype.type="MultiLine",u.coords([["xs","ys"]]),u.mixins(["line"])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(15);n.OvalView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._set_data=function(){if(this.max_w2=0,"data"===this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,"data"===this.model.properties.height.units)return this.max_h2=this.max_height/2},e.prototype._map_data=function(){return"data"===this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this._width,"center"):this.sw=this._width,"data"===this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this._height,"center"):this.sh=this._height},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx,l=n.sy,u=n.sw,h=n.sh;for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+l[i]+u[i]+h[i]+this._angle[i])||(t.translate(a[i],l[i]),t.rotate(this._angle[i]),t.beginPath(),t.moveTo(0,-h[i]/2),t.bezierCurveTo(u[i]/2,-h[i]/2,u[i]/2,h[i]/2,0,h[i]/2),t.bezierCurveTo(-u[i]/2,h[i]/2,-u[i]/2,-h[i]/2,0,-h[i]/2),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,i),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,i),t.stroke()),t.rotate(-this._angle[i]),s.push(t.translate(-a[i],-l[i])));return s},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h,c,_,p;return l=[o],_={},_[o]=(e+n)/2,p={},p[o]=(i+r)/2,u=this.sw[o]/this.sh[o],s=.8*Math.min(Math.abs(n-e),Math.abs(r-i)),c={},h={},u>1?(c[o]=s,h[o]=s/u):(c[o]=s*u,h[o]=s),a={sx:_,sy:p,sw:c,sh:h},this._render(t,l,a)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Oval=s,s.prototype.default_view=n.OvalView,s.prototype.type="Oval",s.mixins(["line","fill"]),s.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128);n.PatchView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy;if(this.visuals.fill.doit){for(this.visuals.fill.set_value(t),r=0,s=e.length;r<s;r++)i=e[r],0!==i?isNaN(l[i]+u[i])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(l[i],u[i]):(t.beginPath(),t.moveTo(l[i],u[i]));t.closePath(),t.fill()}if(this.visuals.line.doit){for(this.visuals.line.set_value(t),o=0,a=e.length;o<a;o++)i=e[o],0!==i?isNaN(l[i]+u[i])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(l[i],u[i]):(t.beginPath(),t.moveTo(l[i],u[i]));return t.closePath(),t.stroke()}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Patch=o,o.prototype.default_view=n.PatchView,o.prototype.type="Patch",o.mixins(["line","fill"])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(36),o=t(108),s=t(22),a=t(42),l=t(9);n.PatchesView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._build_discontinuous_object=function(t){var e,n,i,r,o,l,u,h,c;for(n={},i=r=0,c=t.length;0<=c?r<c:r>c;i=0<=c?++r:--r)for(n[i]=[],u=s.copy(t[i]);u.length>0;)o=s.findLastIndex(u,function(t){return a.isStrictNaN(t)}),o>=0?h=u.splice(o):(h=u,u=[]),e=function(){var t,e,n;for(n=[],t=0,e=h.length;t<e;t++)l=h[t],a.isStrictNaN(l)||n.push(l);return n}(),n[i].push(e);return n},e.prototype._index_data=function(){var t,e,n,i,o,a,l,u,h,c,_;for(h=this._build_discontinuous_object(this._xs),_=this._build_discontinuous_object(this._ys),o=[],t=n=0,a=this._xs.length;0<=a?n<a:n>a;t=0<=a?++n:--n)for(e=i=0,l=h[t].length;0<=l?i<l:i>l;e=0<=l?++i:--i)u=h[t][e],c=_[t][e],0!==u.length&&o.push({minX:s.min(u),minY:s.min(c),maxX:s.max(u),maxY:s.max(c),i:t});return new r.RBush(o)},e.prototype._mask_data=function(t){var e,n,i,r,o,s,a,u;return o=this.renderer.plot_view.frame.x_ranges["default"],h=[o.min,o.max],i=h[0],r=h[1],u=this.renderer.plot_view.frame.y_ranges["default"],c=[u.min,u.max],s=c[0],a=c[1],e=l.validate_bbox_coords([i,r],[s,a]),n=this.index.indices(e),n.sort(function(t,e){return t-e});var h,c},e.prototype._render=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d=n.sxs,f=n.sys;for(this.renderer.sxss=this._build_discontinuous_object(d),this.renderer.syss=this._build_discontinuous_object(f),c=[],o=0,a=e.length;o<a;o++){if(i=e[o],m=[d[i],f[i]],_=m[0],p=m[1],this.visuals.fill.doit){for(this.visuals.fill.set_vectorize(t,i),r=s=0,u=_.length;0<=u?s<u:s>u;r=0<=u?++s:--s)0!==r?isNaN(_[r]+p[r])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(_[r],p[r]):(t.beginPath(),t.moveTo(_[r],p[r]));t.closePath(),t.fill()}if(this.visuals.line.doit){for(this.visuals.line.set_vectorize(t,i),r=l=0,h=_.length;0<=h?l<h:l>h;r=0<=h?++l:--l)0!==r?isNaN(_[r]+p[r])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(_[r],p[r]):(t.beginPath(),t.moveTo(_[r],p[r]));t.closePath(),c.push(t.stroke())}else c.push(void 0)}return c;var m},e.prototype._hit_point=function(t){var e,n,i,r,o,s,a,u,h,c,_,p,d,f,m,v;for(_=t.sx,d=t.sy,m=this.renderer.xscale.invert(_),v=this.renderer.yscale.invert(d),e=this.index.indices({minX:m,minY:v,maxX:m,maxY:v}),n=[],i=s=0,u=e.length;0<=u?s<u:s>u;i=0<=u?++s:--s)for(r=e[i],p=this.renderer.sxss[r],f=this.renderer.syss[r],o=a=0,h=p.length;0<=h?a<h:a>h;o=0<=h?++a:--a)l.point_in_poly(_,d,p[o],f[o])&&n.push(r);return c=l.create_hit_test_result(),c["1d"].indices=n,c},e.prototype._get_snap_coord=function(t){var e,n,i,r;for(r=0,e=0,n=t.length;e<n;e++)i=t[e],r+=i;return r/t.length},e.prototype.scx=function(t,e,n){var i,r,o,s,a;if(1===this.renderer.sxss[t].length)return this._get_snap_coord(this.sxs[t]);for(s=this.renderer.sxss[t],a=this.renderer.syss[t],i=r=0,o=s.length;0<=o?r<o:r>o;i=0<=o?++r:--r)if(l.point_in_poly(e,n,s[i],a[i]))return this._get_snap_coord(s[i]);return null},e.prototype.scy=function(t,e,n){var i,r,o,s,a;if(1===this.renderer.syss[t].length)return this._get_snap_coord(this.sys[t]);for(s=this.renderer.sxss[t],a=this.renderer.syss[t],i=r=0,o=s.length;0<=o?r<o:r>o;i=0<=o?++r:--r)if(l.point_in_poly(e,n,s[i],a[i]))return this._get_snap_coord(a[i])},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e}(o.GlyphView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Glyph);n.Patches=u,u.prototype.default_view=n.PatchesView,u.prototype.type="Patches",u.coords([["xs","ys"]]),u.mixins(["line","fill"])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(105);n.QuadView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_anchor_point=function(t,e,n){var i,r,o,s;switch(r=Math.min(this.sleft[e],this.sright[e]),o=Math.max(this.sright[e],this.sleft[e]),s=Math.min(this.stop[e],this.sbottom[e]),i=Math.max(this.sbottom[e],this.stop[e]),t){case"top_left":return{x:r,y:s};case"top_center":return{x:(r+o)/2,y:s};case"top_right":return{x:o,y:s};case"center_right":return{x:o,y:(s+i)/2};case"bottom_right":return{x:o,y:i};case"bottom_center":return{x:(r+o)/2,y:i};case"bottom_left":return{x:r,y:i};case"center_left":return{x:r,y:(s+i)/2};case"center":return{x:(r+o)/2,y:(s+i)/2}}},e.prototype.scx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype.scy=function(t){return(this.stop[t]+this.sbottom[t])/2},e.prototype._index_data=function(){return this._index_box(this._right.length)},e.prototype._lrtb=function(t){var e,n,i,r;return n=this._left[t],i=this._right[t],r=this._top[t],e=this._bottom[t],[n,i,r,e]},e}(r.BoxView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Box);n.Quad=o,o.prototype.default_view=n.QuadView,o.prototype.type="Quad",o.coords([["right","bottom"],["left","top"]])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=t(36),s=t(108);i=function(t,e,n){var i,r;return e===(t+n)/2?[t,n]:(r=(t-e)/(t-2*e+n),i=t*Math.pow(1-r,2)+2*e*(1-r)*r+n*Math.pow(r,2),[Math.min(t,n,i),Math.max(t,n,i)])},n.QuadraticView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._index_data=function(){var t,e,n,r,s,a,l,u;for(n=[],t=e=0,r=this._x0.length;0<=r?e<r:e>r;t=0<=r?++e:--e)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t]+this._cx[t]+this._cy[t])||(h=i(this._x0[t],this._cx[t],this._x1[t]),s=h[0],a=h[1],c=i(this._y0[t],this._cy[t],this._y1[t]),l=c[0],u=c[1],n.push({minX:s,minY:l,maxX:a,maxY:u,i:t}));return new o.RBush(n);var h,c},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx0,l=n.sy0,u=n.sx1,h=n.sy1,c=n.scx,_=n.scy;if(this.visuals.line.doit){for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+l[i]+u[i]+h[i]+c[i]+_[i])||(t.beginPath(),t.moveTo(a[i],l[i]),t.quadraticCurveTo(c[i],_[i],u[i],h[i]),this.visuals.line.set_vectorize(t,i),s.push(t.stroke()));return s}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(s.GlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(s.Glyph);n.Quadratic=a,a.prototype.default_view=n.QuadraticView,a.prototype.type="Quadratic",a.coords([["x0","y0"],["x1","y1"],["cx","cy"]]),a.mixins(["line"])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(15);n.RayView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){return"data"===this.model.properties.length.units?this.slength=this.sdist(this.renderer.xscale,this._x,this._length):this.slength=this._length},e.prototype._render=function(t,e,n){var i,r,o,s,a,l,u,h,c,_=n.sx,p=n.sy,d=n.slength,f=n._angle;if(this.visuals.line.doit){for(c=this.renderer.plot_view.frame._width.value,i=this.renderer.plot_view.frame._height.value,o=2*(c+i),r=s=0,u=d.length;0<=u?s<u:s>u;r=0<=u?++s:--s)0===d[r]&&(d[r]=o);for(h=[],a=0,l=e.length;a<l;a++)r=e[a],isNaN(_[r]+p[r]+f[r]+d[r])||(t.translate(_[r],p[r]),t.rotate(f[r]),t.beginPath(),t.moveTo(0,0),t.lineTo(d[r],0),this.visuals.line.set_vectorize(t,r),t.stroke(),t.rotate(-f[r]),h.push(t.translate(-_[r],-p[r])));return h}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Ray=s,s.prototype.default_view=n.RayView,s.prototype.type="Ray",s.mixins(["line"]),s.define({length:[o.DistanceSpec],angle:[o.AngleSpec]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(9),s=t(15),a=t(22);n.RectView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._set_data=function(){if(this.max_w2=0,"data"===this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,"data"===this.model.properties.height.units)return this.max_h2=this.max_height/2},e.prototype._map_data=function(){var t;return"data"===this.model.properties.width.units?(e=this._map_dist_corner_for_data_side_length(this._x,this._width,this.renderer.xscale,0),this.sw=e[0],this.sx0=e[1]):(this.sw=this._width,this.sx0=function(){var e,n,i;for(i=[],t=e=0,n=this.sx.length;0<=n?e<n:e>n;t=0<=n?++e:--e)i.push(this.sx[t]-this.sw[t]/2);return i}.call(this)),"data"===this.model.properties.height.units?(n=this._map_dist_corner_for_data_side_length(this._y,this._height,this.renderer.yscale,1),this.sh=n[0],this.sy1=n[1]):(this.sh=this._height,this.sy1=function(){var e,n,i;for(i=[],t=e=0,n=this.sy.length;0<=n?e<n:e>n;t=0<=n?++e:--e)i.push(this.sy[t]-this.sh[t]/2);return i}.call(this)),this.ssemi_diag=function(){var e,n,i;for(i=[],t=e=0,n=this.sw.length;0<=n?e<n:e>n;t=0<=n?++e:--e)i.push(Math.sqrt(this.sw[t]/2*this.sw[t]/2+this.sh[t]/2*this.sh[t]/2));return i}.call(this);var e,n},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n.sx0,c=n.sy1,_=n.sw,p=n.sh,d=n._angle;if(this.visuals.fill.doit)for(r=0,s=e.length;r<s;r++)i=e[r],isNaN(l[i]+u[i]+h[i]+c[i]+_[i]+p[i]+d[i])||(this.visuals.fill.set_vectorize(t,i),d[i]?(t.translate(l[i],u[i]),t.rotate(d[i]),t.fillRect(-_[i]/2,-p[i]/2,_[i],p[i]),t.rotate(-d[i]),t.translate(-l[i],-u[i])):t.fillRect(h[i],c[i],_[i],p[i]));if(this.visuals.line.doit){for(t.beginPath(),o=0,a=e.length;o<a;o++)i=e[o],isNaN(l[i]+u[i]+h[i]+c[i]+_[i]+p[i]+d[i])||0!==_[i]&&0!==p[i]&&(d[i]?(t.translate(l[i],u[i]),t.rotate(d[i]),t.rect(-_[i]/2,-p[i]/2,_[i],p[i]),t.rotate(-d[i]),t.translate(-l[i],-u[i])):t.rect(h[i],c[i],_[i],p[i]),this.visuals.line.set_vectorize(t,i),t.stroke(),t.beginPath());return t.stroke()}},e.prototype._hit_rect=function(t){return this._hit_rect_against_index(t)},e.prototype._hit_point=function(t){var e,n,i,r,s,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A;for(b=t.sx,x=t.sy,k=this.renderer.xscale.invert(b),T=this.renderer.yscale.invert(x),g=function(){var t,e,n;for(n=[],l=t=0,e=this.sx0.length;0<=e?t<e:t>e;l=0<=e?++t:--t)n.push(this.sx0[l]+this.sw[l]/2);return n}.call(this),y=function(){var t,e,n;for(n=[],l=t=0,e=this.sy1.length;0<=e?t<e:t>e;l=0<=e?++t:--t)n.push(this.sy1[l]+this.sh[l]/2);return n}.call(this),c=a.max(this._ddist(0,g,this.ssemi_diag)),_=a.max(this._ddist(1,y,this.ssemi_diag)),M=k-c,S=k+c,O=T-_,A=T+_,s=[],e=o.validate_bbox_coords([M,S],[O,A]),f=this.index.indices(e),u=0,h=f.length;u<h;u++)l=f[u],this._angle[l]?(i=Math.sqrt(Math.pow(b-this.sx[l],2)+Math.pow(x-this.sy[l],2)),v=Math.sin(-this._angle[l]),n=Math.cos(-this._angle[l]),p=n*(b-this.sx[l])-v*(x-this.sy[l])+this.sx[l],d=v*(b-this.sx[l])+n*(x-this.sy[l])+this.sy[l],b=p,x=d,w=Math.abs(this.sx[l]-b)<=this.sw[l]/2,r=Math.abs(this.sy[l]-x)<=this.sh[l]/2):(w=b-this.sx0[l]<=this.sw[l]&&b-this.sx0[l]>=0,r=x-this.sy1[l]<=this.sh[l]&&x-this.sy1[l]>=0),r&&w&&s.push(l);return m=o.create_hit_test_result(),m["1d"].indices=s,m},e.prototype._map_dist_corner_for_data_side_length=function(t,e,n,i){var r,o,s,a,l,u,h,c,_,p,d,f,m;if(r=this.renderer.plot_view.frame,null!=n.source_range.synthetic&&(t=function(){var e,i,r;for(r=[],e=0,i=t.length;e<i;e++)m=t[e],r.push(n.source_range.synthetic(m));return r}()),l=function(){var n,i,r;for(r=[],o=n=0,i=t.length;0<=i?n<i:n>i;o=0<=i?++n:--n)r.push(Number(t[o])-e[o]/2);return r}(),u=function(){var n,i,r;for(r=[],o=n=0,i=t.length;0<=i?n<i:n>i;o=0<=i?++n:--n)r.push(Number(t[o])+e[o]/2);return r}(),_=n.v_compute(l),p=n.v_compute(u),f=this.sdist(n,l,e,"edge",this.model.dilate),0===i){for(d=_,o=s=0,h=_.length;0<=h?s<h:s>h;o=0<=h?++s:--s)if(_[o]!==p[o]){d=_[o]<p[o]?_:p;break}return[f,d]}if(1===i){for(d=_,o=a=0,c=_.length;0<=c?a<c:a>c;o=0<=c?++a:--a)if(_[o]!==p[o]){d=_[o]<p[o]?_:p;break}return[f,d]}},e.prototype._ddist=function(t,e,n){var i,r,o,s,a,l;return s=0===t?this.renderer.xscale:this.renderer.yscale,a=e,l=function(){var t,e,r;for(r=[],i=t=0,e=a.length;0<=e?t<e:t>e;i=0<=e?++t:--t)r.push(a[i]+n[i]);return r}(),r=s.v_invert(a),o=s.v_invert(l),function(){var t,e,n;for(n=[],i=t=0,e=r.length;0<=e?t<e:t>e;i=0<=e?++t:--t)n.push(Math.abs(o[i]-r[i]));return n}()},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(r.XYGlyphView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Rect=l,l.prototype.default_view=n.RectView,l.prototype.type="Rect",l.mixins(["line","fill"]),l.define({angle:[s.AngleSpec,0],width:[s.DistanceSpec],height:[s.DistanceSpec],dilate:[s.Bool,!1]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(9),o=t(36),s=t(108);n.SegmentView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._index_data=function(){var t,e,n,i;for(n=[],t=e=0,i=this._x0.length;0<=i?e<i:e>i;t=0<=i?++e:--e)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t])||n.push({minX:Math.min(this._x0[t],this._x1[t]),minY:Math.min(this._y0[t],this._y1[t]),maxX:Math.max(this._x0[t],this._x1[t]),maxY:Math.max(this._y0[t],this._y1[t]),i:t});return new o.RBush(n)},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx0,l=n.sy0,u=n.sx1,h=n.sy1;if(this.visuals.line.doit){for(s=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(a[i]+l[i]+u[i]+h[i])||(t.beginPath(),t.moveTo(a[i],l[i]),t.lineTo(u[i],h[i]),this.visuals.line.set_vectorize(t,i),s.push(t.stroke()));return s}},e.prototype._hit_point=function(t){var e,n,i,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x;for(v=t.sx,g=t.sy,b=this.renderer.xscale.invert(v),x=this.renderer.yscale.invert(g),f={x:v,y:g},i=[],l=2,w=this.renderer.xscale.r_invert(v-l,v+l),c=w[0],u=w[1],k=this.renderer.yscale.r_invert(g-l,g+l),_=k[0],h=k[1],e=this.index.indices({minX:c,minY:_,maxX:u,maxY:h}),s=0,a=e.length;s<a;s++)o=e[s],y=Math.pow(Math.max(2,this.visuals.line.cache_select("line_width",o)/2),2),M=[{x:this.sx0[o],y:this.sy0[o]},{x:this.sx1[o],y:this.sy1[o]}],p=M[0],d=M[1],n=r.dist_to_segment_squared(f,p,d),n<y&&i.push(o);return m=r.create_hit_test_result(),m["1d"].indices=i,m;var w,k,M},e.prototype._hit_span=function(t){var e,n,i,o,s,a,l,u,h,c,_,p,d,f,m,v,g;for(y=this.renderer.plot_view.frame.bbox.ranges,i=y[0],g=y[1],p=t.sx,d=t.sy,"v"===t.direction?(v=this.renderer.yscale.invert(d),b=[this._y0,this._y1],f=b[0],m=b[1]):(v=this.renderer.xscale.invert(p),x=[this._x0,this._x1],f=x[0],m=x[1]),n=[],w=this.renderer.xscale.r_invert(i.start,i.end),h=w[0],l=w[1],k=this.renderer.yscale.r_invert(g.start,g.end),c=k[0],u=k[1],e=this.index.indices({minX:h,minY:c,maxX:l,maxY:u}),s=0,a=e.length;s<a;s++)o=e[s],(f[o]<=v&&v<=m[o]||m[o]<=v&&v<=f[o])&&n.push(o);return _=r.create_hit_test_result(),_["1d"].indices=n,_;var y,b,x,w,k},e.prototype.scx=function(t){return(this.sx0[t]+this.sx1[t])/2},e.prototype.scy=function(t){return(this.sy0[t]+this.sy1[t])/2},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(s.GlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(s.Glyph);n.Segment=a,a.prototype.default_view=n.SegmentView,a.prototype.type="Segment",a.coords([["x0","y0"],["x1","y1"]]),a.mixins(["line"])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(15);n.StepView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){var i,r,o,s,a,l,u,h,c,_=n.sx,p=n.sy;if(this.visuals.line.set_value(t),i=e.length,!(i<2)){for(t.beginPath(),t.moveTo(_[0],p[0]),r=o=1,s=i;1<=s?o<s:o>s;r=1<=s?++o:--o){switch(this.model.mode){case"before":d=[_[r-1],p[r]],a=d[0],h=d[1],f=[_[r],p[r]],l=f[0],c=f[1];break;case"after":m=[_[r],p[r-1]],a=m[0],h=m[1],v=[_[r],p[r]],l=v[0],c=v[1];break;case"center":u=(_[r-1]+_[r])/2,g=[u,p[r-1]],a=g[0],h=g[1],y=[u,p[r]],l=y[0],c=y[1]}t.lineTo(a,h),t.lineTo(l,c)}return t.lineTo(_[i-1],p[i-1]),t.stroke();var d,f,m,v,g,y}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Step=s,s.prototype.default_view=n.StepView,s.prototype.type="Step",s.mixins(["line"]),s.define({mode:[o.StepMode,"before"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(15),s=t(40);n.TextView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){var i,r,o,a,l,u,h,c,_,p,d,f,m,v,g,y=n.sx,b=n.sy,x=n._x_offset,w=n._y_offset,k=n._angle,M=n._text;for(m=[],u=0,c=e.length;u<c;u++)if(l=e[u],!isNaN(y[l]+b[l]+x[l]+w[l]+k[l])&&null!=M[l])if(this.visuals.text.doit){if(v=""+M[l],t.save(),t.translate(y[l]+x[l],b[l]+w[l]),t.rotate(k[l]),this.visuals.text.set_vectorize(t,l),v.indexOf("\n")===-1)t.fillText(v,0,0);else{switch(f=v.split("\n"),o=this.visuals.text.cache_select("font",l),a=s.get_text_height(o).height,d=this.visuals.text.text_line_height.value()*a,r=d*f.length,i=this.visuals.text.cache_select("text_baseline",l)){case"top":g=0;break;case"middle":g=-r/2+d/2;break;case"bottom":g=-r+d;break;default:g=0,console.warn("'"+i+"' baseline not supported with multi line text")}for(h=0,_=f.length;h<_;h++)p=f[h],t.fillText(p,0,g),g+=d}m.push(t.restore())}else m.push(void 0);return m},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return t.save(),this.text_props.set_value(t),t.font=this.text_props.font_value(),t.font=t.font.replace(/\b[\d\.]+[\w]+\b/,"10pt"),t.textAlign="right",t.textBaseline="middle",t.fillText("text",x2,(r+y2)/2),t.restore()},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Text=a,a.prototype.default_view=n.TextView,a.prototype.type="Text",a.mixins(["text"]),a.define({text:[o.StringSpec,{field:"text"}],angle:[o.AngleSpec,0],x_offset:[o.NumberSpec,0],y_offset:[o.NumberSpec,0]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(105),o=t(15);n.VBarView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.scy=function(t){return(this.stop[t]+this.sbottom[t])/2},e.prototype._index_data=function(){return this._index_box(this._x.length)},e.prototype._lrtb=function(t){var e,n,i,r;return n=this._x[t]-this._width[t]/2,i=this._x[t]+this._width[t]/2,r=Math.max(this._top[t],this._bottom[t]),e=Math.min(this._top[t],this._bottom[t]),[n,i,r,e]},e.prototype._map_data=function(){var t,e,n;for(this.sx=this.renderer.xscale.v_compute(this._x),
  this.stop=this.renderer.yscale.v_compute(this._top),this.sbottom=this.renderer.yscale.v_compute(this._bottom),this.sleft=[],this.sright=[],this.sw=this.sdist(this.renderer.xscale,this._x,this._width,"center"),t=e=0,n=this.sx.length;0<=n?e<n:e>n;t=0<=n?++e:--e)this.sleft.push(this.sx[t]-this.sw[t]/2),this.sright.push(this.sx[t]+this.sw[t]/2);return null},e}(r.BoxView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Box);n.VBar=s,s.prototype.default_view=n.VBarView,s.prototype.type="VBar",s.coords([["x","bottom"]]),s.define({width:[o.DistanceSpec],top:[o.NumberSpec]}),s.override({bottom:0})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(9),s=t(15),a=t(29);n.WedgeView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){return"data"===this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n.sradius,c=n._start_angle,_=n._end_angle;for(i=this.model.properties.direction.value(),a=[],o=0,s=e.length;o<s;o++)r=e[o],isNaN(l[r]+u[r]+h[r]+c[r]+_[r])||(t.beginPath(),t.arc(l[r],u[r],h[r],c[r],_[r],i),t.lineTo(l[r],u[r]),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,r),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,r),a.push(t.stroke())):a.push(void 0));return a},e.prototype._hit_point=function(t){var e,n,i,r,s,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O;for(m=t.sx,y=t.sy,w=this.renderer.xscale.invert(m),S=this.renderer.yscale.invert(y),"data"===this.model.properties.radius.units?(k=w-this.max_radius,M=w+this.max_radius,T=S-this.max_radius,O=S+this.max_radius):(v=m-this.max_radius,g=m+this.max_radius,A=this.renderer.xscale.r_invert(v,g),k=A[0],M=A[1],b=y-this.max_radius,x=y+this.max_radius,E=this.renderer.yscale.r_invert(b,x),T=E[0],O=E[1]),i=[],n=o.validate_bbox_coords([k,M],[T,O]),f=this.index.indices(n),h=0,_=f.length;h<_;h++)u=f[h],d=Math.pow(this.sradius[u],2),j=this.renderer.xscale.r_compute(w,this._x[u]),v=j[0],g=j[1],P=this.renderer.yscale.r_compute(S,this._y[u]),b=P[0],x=P[1],s=Math.pow(v-g,2)+Math.pow(b-x,2),s<=d&&i.push([u,s]);for(r=this.model.properties.direction.value(),l=[],c=0,p=i.length;c<p;c++)z=i[c],u=z[0],s=z[1],e=Math.atan2(y-this.sy[u],m-this.sx[u]),a.angle_between(-e,-this._start_angle[u],-this._end_angle[u],r)&&l.push([u,s]);return o.create_1d_hit_test_result(l);var A,E,j,P,z},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Wedge=l,l.prototype.default_view=n.WedgeView,l.prototype.type="Wedge",l.mixins(["line","fill"]),l.define({direction:[s.Direction,"anticlock"],radius:[s.DistanceSpec],start_angle:[s.AngleSpec],end_angle:[s.AngleSpec]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(36),o=t(108);n.XYGlyphView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._index_data=function(){var t,e,n,i,o,s;for(n=[],t=e=0,i=this._x.length;0<=i?e<i:e>i;t=0<=i?++e:--e)o=this._x[t],s=this._y[t],!isNaN(o+s)&&isFinite(o+s)&&n.push({minX:o,minY:s,maxX:o,maxY:s,i:t});return new r.RBush(n)},e}(o.GlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Glyph);n.XYGlyph=s,s.prototype.type="XYGlyph",s.prototype.default_view=n.XYGlyphView,s.coords([["x","y"]])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50),o=t(22),s=t(9);n.GraphHitTestPolicy=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.do_selection=function(t,e,n,i){return!1},e.prototype.do_inspection=function(t,e,n,i){return!1},e}(r.Model);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._do=function(t,e,n,i){var r,o;return o=e.node_view,r=o.glyph.hit_test(t),null!==r&&(this._node_selector.update(r,n,i),!this._node_selector.indices.is_empty())},e.prototype.do_selection=function(t,e,n,i){var r;return this._node_selector=e.node_view.model.data_source.selection_manager.selector,r=this._do(t,e,n,i),e.node_view.model.data_source.selected=this._node_selector.indices,e.node_view.model.data_source.select.emit(),r},e.prototype.do_inspection=function(t,e,n,i){var r;return this._node_selector=e.model.get_selection_manager().get_or_create_inspector(e.node_view.model),r=this._do(t,e,n,i),e.node_view.model.data_source.setv({inspected:this._node_selector.indices},{silent:!0}),e.node_view.model.data_source.inspect.emit([e.node_view,{geometry:t}]),r},e}(n.GraphHitTestPolicy);n.NodesOnly=a,a.prototype.type="NodesOnly";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._do=function(t,e,n,i){var r,a,l,u,h,c,_,p,d,f,m,v;if(g=[e.node_view,e.edge_view],m=g[0],l=g[1],u=m.glyph.hit_test(t),null===u)return!1;for(this._node_selector.update(u,n,i),f=function(){var t,e,n,i;for(n=u["1d"].indices,i=[],t=0,e=n.length;t<e;t++)h=n[t],i.push(m.model.data_source.data.index[h]);return i}(),a=l.model.data_source,r=[],h=c=0,v=a.data.start.length;0<=v?c<v:c>v;h=0<=v?++c:--c)(o.contains(f,a.data.start[h])||o.contains(f,a.data.end[h]))&&r.push(h);for(d=s.create_hit_test_result(),_=0,p=r.length;_<p;_++)h=r[_],d["2d"].indices[h]=[0];return this._edge_selector.update(d,n,i),!this._node_selector.indices.is_empty();var g},e.prototype.do_selection=function(t,e,n,i){var r;return this._node_selector=e.node_view.model.data_source.selection_manager.selector,this._edge_selector=e.edge_view.model.data_source.selection_manager.selector,r=this._do(t,e,n,i),e.node_view.model.data_source.selected=this._node_selector.indices,e.edge_view.model.data_source.selected=this._edge_selector.indices,e.node_view.model.data_source.select.emit(),r},e.prototype.do_inspection=function(t,e,n,i){var r;return this._node_selector=e.node_view.model.data_source.selection_manager.get_or_create_inspector(e.node_view.model),this._edge_selector=e.edge_view.model.data_source.selection_manager.get_or_create_inspector(e.edge_view.model),r=this._do(t,e,n,i),e.node_view.model.data_source.setv({inspected:this._node_selector.indices},{silent:!0}),e.edge_view.model.data_source.setv({inspected:this._edge_selector.indices},{silent:!0}),e.node_view.model.data_source.inspect.emit([e.node_view,{geometry:t}]),r},e}(n.GraphHitTestPolicy);n.NodesAndLinkedEdges=l,l.prototype.type="NodesAndLinkedEdges";var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._do=function(t,e,n,i){var r,a,l,u,h,c,_,p,d,f;if(m=[e.node_view,e.edge_view],d=m[0],a=m[1],l=a.glyph.hit_test(t),null===l)return!1;for(this._edge_selector.update(l,n,i),r=function(){var t,e,n,i;for(n=Object.keys(l["2d"].indices),i=[],t=0,e=n.length;t<e;t++)u=n[t],i.push(parseInt(u));return i}(),f=[],h=0,c=r.length;h<c;h++)u=r[h],f.push(a.model.data_source.data.start[u]),f.push(a.model.data_source.data.end[u]);return p=function(){var t,e,n,i;for(n=o.uniq(f),i=[],t=0,e=n.length;t<e;t++)u=n[t],i.push(d.model.data_source.data.index.indexOf(u));return i}(),_=s.create_hit_test_result(),_["1d"].indices=p,this._node_selector.update(_,n,i),!this._edge_selector.indices.is_empty();var m},e.prototype.do_selection=function(t,e,n,i){var r;return this._edge_selector=e.edge_view.model.data_source.selection_manager.selector,this._node_selector=e.node_view.model.data_source.selection_manager.selector,r=this._do(t,e,n,i),e.edge_view.model.data_source.selected=this._edge_selector.indices,e.node_view.model.data_source.selected=this._node_selector.indices,e.edge_view.model.data_source.select.emit(),r},e.prototype.do_inspection=function(t,e,n,i){var r;return this._edge_selector=e.edge_view.model.data_source.selection_manager.get_or_create_inspector(e.edge_view.model),this._node_selector=e.node_view.model.data_source.selection_manager.get_or_create_inspector(e.node_view.model),r=this._do(t,e,n,i),e.edge_view.model.data_source.setv({inspected:this._edge_selector.indices},{silent:!0}),e.node_view.model.data_source.setv({inspected:this._node_selector.indices},{silent:!0}),e.edge_view.model.data_source.inspect.emit([e.edge_view,{geometry:t}]),r},e}(n.GraphHitTestPolicy);n.EdgesAndLinkedNodes=u,u.prototype.type="EdgesAndLinkedNodes"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364);i.__exportStar(t(129),n),i.__exportStar(t(131),n),i.__exportStar(t(132),n)},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50);n.LayoutProvider=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_node_coordinates=function(t){return[[],[]]},e.prototype.get_edge_coordinates=function(t){return[[],[]]},e}(r.Model)},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(131),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_node_coordinates=function(t){var e,n,i,r,o,s,a,l;for(u=[[],[]],s=u[0],l=u[1],r=t.data.index,n=0,i=r.length;n<i;n++)e=r[n],o=null!=this.graph_layout[e]?this.graph_layout[e][0]:NaN,a=null!=this.graph_layout[e]?this.graph_layout[e][1]:NaN,s.push(o),l.push(a);return[s,l];var u},e.prototype.get_edge_coordinates=function(t){var e,n,i,r,o,s,a,l,u,h,c;for(_=[[],[]],h=_[0],c=_[1],u=t.data.start,n=t.data.end,i=null!=t.data.xs&&null!=t.data.ys,r=s=0,a=u.length;0<=a?s<a:s>a;r=0<=a?++s:--s)o=null!=this.graph_layout[u[r]]&&null!=this.graph_layout[n[r]],i&&o?(h.push(t.data.xs[r]),c.push(t.data.ys[r])):(o?(p=[this.graph_layout[u[r]],this.graph_layout[n[r]]],l=p[0],e=p[1]):(d=[[NaN,NaN],[NaN,NaN]],l=d[0],e=d[1]),h.push([l[0],e[0]]),c.push([l[1],e[1]]));return[h,c];var _,p,d},e}(r.LayoutProvider);n.StaticLayoutProvider=s,s.prototype.type="StaticLayoutProvider",s.define({graph_layout:[o.Any,{}]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(163),o=t(165),s=t(15),a=t(42);n.GridView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._x_range_name=this.model.x_range_name,this._y_range_name=this.model.y_range_name},e.prototype.render=function(){var t;if(this.model.visible!==!1)return t=this.plot_view.canvas_view.ctx,t.save(),this._draw_regions(t),this._draw_minor_grids(t),this._draw_grids(t),t.restore()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype._draw_regions=function(t){var e,n,i,r,o,s,a,l,u;if(this.visuals.band_fill.doit){for(h=this.model.grid_coords("major",!1),l=h[0],u=h[1],this.visuals.band_fill.set_value(t),e=n=0,i=l.length-1;0<=i?n<i:n>i;e=0<=i?++n:--n)e%2===1&&(c=this.plot_view.map_to_screen(l[e],u[e],this._x_range_name,this._y_range_name),r=c[0],s=c[1],_=this.plot_view.map_to_screen(l[e+1],u[e+1],this._x_range_name,this._y_range_name),o=_[0],a=_[1],t.fillRect(r[0],s[0],o[1]-r[0],a[1]-s[0]),t.fill());var h,c,_}},e.prototype._draw_grids=function(t){var e,n;if(this.visuals.grid_line.doit){return i=this.model.grid_coords("major"),e=i[0],n=i[1],this._draw_grid_helper(t,this.visuals.grid_line,e,n);var i}},e.prototype._draw_minor_grids=function(t){var e,n;if(this.visuals.minor_grid_line.doit){return i=this.model.grid_coords("minor"),e=i[0],n=i[1],this._draw_grid_helper(t,this.visuals.minor_grid_line,e,n);var i}},e.prototype._draw_grid_helper=function(t,e,n,i){var r,o,s,a,l,u,h;for(e.set_value(t),r=o=0,a=n.length;0<=a?o<a:o>a;r=0<=a?++o:--o){for(c=this.plot_view.map_to_screen(n[r],i[r],this._x_range_name,this._y_range_name),u=c[0],h=c[1],t.beginPath(),t.moveTo(Math.round(u[0]),Math.round(h[0])),r=s=1,l=u.length;1<=l?s<l:s>l;r=1<=l?++s:--s)t.lineTo(Math.round(u[r]),Math.round(h[r]));t.stroke()}var c},e}(o.RendererView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.ranges=function(){var t,e,n,i;return e=this.dimension,n=(e+1)%2,t=this.plot.plot_canvas.frame,i=[t.x_ranges[this.x_range_name],t.y_ranges[this.y_range_name]],[i[e],i[n]]},e.prototype.computed_bounds=function(){var t,e,n,i,r,o;return s=this.ranges(),n=s[0],t=s[1],o=this.bounds,i=[n.min,n.max],a.isArray(o)?(r=Math.min(o[0],o[1]),e=Math.max(o[0],o[1]),r<i[0]?r=i[0]:r>i[1]&&(r=null),e>i[1]?e=i[1]:e<i[0]&&(e=null)):(r=i[0],e=i[1]),[r,e];var s},e.prototype.grid_coords=function(t,e){void 0===e&&(e=!0);var n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M;for(h=this.dimension,_=(h+1)%2,S=this.ranges(),y=S[0],s=S[1],T=this.computed_bounds(),w=T[0],u=T[1],M=Math.min(w,u),u=Math.max(w,u),w=M,k=this.ticker.get_ticks(w,u,y,s.min,{})[t],v=y.min,m=y.max,r=s.min,i=s.max,o=[[],[]],c=p=0,b=k.length;0<=b?p<b:p>b;c=0<=b?++p:--p)if(k[c]!==v&&k[c]!==m||!e){for(a=[],l=[],n=2,g=d=0,x=n;0<=x?d<x:d>x;g=0<=x?++d:--d)f=r+(i-r)/(n-1)*g,a.push(k[c]),l.push(f);o[h].push(a),o[_].push(l)}return o;var S,T},e}(r.GuideRenderer);n.Grid=l,l.prototype.default_view=n.GridView,l.prototype.type="Grid",l.mixins(["line:grid_","line:minor_grid_","fill:band_"]),l.define({bounds:[s.Any,"auto"],dimension:[s.Number,0],ticker:[s.Instance],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),l.override({level:"underlay",band_fill_color:null,band_fill_alpha:0,grid_line_color:"#e5e5e5",minor_grid_line_color:null})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(133);n.Grid=i.Grid},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364);i.__exportStar(t(57),n),i.__exportStar(t(73),n),i.__exportStar(t(77),n),i.__exportStar(t(81),n),i.__exportStar(t(83),n),i.__exportStar(t(89),n),i.__exportStar(t(95),n),i.__exportStar(t(113),n),i.__exportStar(t(130),n),i.__exportStar(t(134),n),i.__exportStar(t(138),n),i.__exportStar(t(145),n),i.__exportStar(t(238),n),i.__exportStar(t(148),n),i.__exportStar(t(152),n),i.__exportStar(t(158),n),i.__exportStar(t(164),n),i.__exportStar(t(167),n),i.__exportStar(t(177),n),i.__exportStar(t(187),n),i.__exportStar(t(199),n),i.__exportStar(t(226),n)},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=[].indexOf,o=t(13),s=t(15),a=t(22),l=t(30),u=t(139),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.children.change,function(){return e.rebuild_child_views()})},e.prototype.get_height=function(){var t,e,n;return e=this.model.get_layoutable_children(),t=e.map(function(t){return t._height.value}),n=this.model._horizontal?a.max(t):a.sum(t)},e.prototype.get_width=function(){var t,e,n;return e=this.model.get_layoutable_children(),t=e.map(function(t){return t._width.value}),n=this.model._horizontal?a.sum(t):a.max(t)},e}(u.LayoutDOMView);n.BoxView=h,h.prototype.className="bk-grid";var c=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i._child_equal_size_width=new o.Variable(i.toString()+".child_equal_size_width"),i._child_equal_size_height=new o.Variable(i.toString()+".child_equal_size_height"),i._box_equal_size_top=new o.Variable(i.toString()+".box_equal_size_top"),i._box_equal_size_bottom=new o.Variable(i.toString()+".box_equal_size_bottom"),i._box_equal_size_left=new o.Variable(i.toString()+".box_equal_size_left"),i._box_equal_size_right=new o.Variable(i.toString()+".box_equal_size_right"),i._box_cell_align_top=new o.Variable(i.toString()+".box_cell_align_top"),i._box_cell_align_bottom=new o.Variable(i.toString()+".box_cell_align_bottom"),i._box_cell_align_left=new o.Variable(i.toString()+".box_cell_align_left"),i._box_cell_align_right=new o.Variable(i.toString()+".box_cell_align_right"),i}return i.__extends(e,t),e.prototype.get_layoutable_children=function(){return this.children},e.prototype.get_constrained_variables=function(){return l.extend({},t.prototype.get_constrained_variables.call(this),{box_equal_size_top:this._box_equal_size_top,box_equal_size_bottom:this._box_equal_size_bottom,box_equal_size_left:this._box_equal_size_left,box_equal_size_right:this._box_equal_size_right,box_cell_align_top:this._box_cell_align_top,box_cell_align_bottom:this._box_cell_align_bottom,box_cell_align_left:this._box_cell_align_left,box_cell_align_right:this._box_cell_align_right})},e.prototype.get_constraints=function(){var e,n,i,r,s,a,l,u,h,c,_,p,d;if(r=t.prototype.get_constraints.call(this),e=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r.push.apply(r,t)},i=this.get_layoutable_children(),0===i.length)return r;for(a=0,h=i.length;a<h;a++)n=i[a],d=n.get_constrained_variables(),_=this._child_rect(d),this._horizontal?null!=d.height&&e(o.EQ(_.height,[-1,this._height])):null!=d.width&&e(o.EQ(_.width,[-1,this._width])),this._horizontal?null!=d.box_equal_size_left&&null!=d.box_equal_size_right&&null!=d.width&&e(o.EQ([-1,d.box_equal_size_left],[-1,d.box_equal_size_right],d.width,this._child_equal_size_width)):null!=d.box_equal_size_top&&null!=d.box_equal_size_bottom&&null!=d.height&&e(o.EQ([-1,d.box_equal_size_top],[-1,d.box_equal_size_bottom],d.height,this._child_equal_size_height));for(u=this._info(i[0].get_constrained_variables()),e(o.EQ(u.span.start,0)),s=l=1,p=i.length;1<=p?l<p:l>p;s=1<=p?++l:--l)c=this._info(i[s].get_constrained_variables()),u.span.size&&e(o.EQ(u.span.start,u.span.size,[-1,c.span.start])),e(o.WEAK_EQ(u.whitespace.after,c.whitespace.before,0-this.spacing)),e(o.GE(u.whitespace.after,c.whitespace.before,0-this.spacing)),u=c;return this._horizontal?null!=d.width&&e(o.EQ(u.span.start,u.span.size,[-1,this._width])):null!=d.height&&e(o.EQ(u.span.start,u.span.size,[-1,this._height])),r=r.concat(this._align_outer_edges_constraints(!0),this._align_outer_edges_constraints(!1),this._align_inner_cell_edges_constraints(),this._box_equal_size_bounds(!0),this._box_equal_size_bounds(!1),this._box_cell_align_bounds(!0),this._box_cell_align_bounds(!1),this._box_whitespace(!0),this._box_whitespace(!1))},e.prototype._child_rect=function(t){return{x:t.origin_x,y:t.origin_y,width:t.width,height:t.height}},e.prototype._span=function(t){return this._horizontal?{start:t.x,size:t.width}:{start:t.y,size:t.height}},e.prototype._info=function(t){var e,n;return n=this._horizontal?{before:t.whitespace_left,after:t.whitespace_right}:{before:t.whitespace_top,after:t.whitespace_bottom},e=this._span(this._child_rect(t)),{span:e,whitespace:n}},e.prototype._flatten_cell_edge_variables=function(t){var n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w;for(x=t?e._top_bottom_inner_cell_edge_variables:e._left_right_inner_cell_edge_variables,n=t!==this._horizontal,l=this.get_layoutable_children(),r=l.length,h={},o=0,c=0,f=l.length;c<f;c++){for(a=l[c],s=a instanceof e?a._flatten_cell_edge_variables(t):{},i=a.get_constrained_variables(),_=0,m=x.length;_<m;_++)v=x[_],v in i&&(s[v]=[i[v]]);for(p in s)w=s[p],n?(y=p.split(" "),d=y[0],b=y.length>1?y[1]:"",u=this._horizontal?"row":"col",g=d+" "+u+"-"+r+"-"+o+"-"+b):g=p,g in h?h[g]=h[g].concat(w):h[g]=w;o+=1}return h},e.prototype._align_inner_cell_edges_constraints=function(){var t,e,n,i,s,a,l,u;if(t=[],null!=this.document&&r.call(this.document.roots(),this)>=0){e=this._flatten_cell_edge_variables(this._horizontal);for(s in e)if(u=e[s],u.length>1)for(a=u[0],n=i=1,l=u.length;1<=l?i<l:i>l;n=1<=l?++i:--i)t.push(o.EQ(u[n],[-1,a]))}return t},e.prototype._find_edge_leaves=function(t){var n,i,r,o,s,a,l,u;if(r=this.get_layoutable_children(),a=[[],[]],r.length>0)if(this._horizontal===t)u=r[0],o=r[r.length-1],u instanceof e?a[0]=a[0].concat(u._find_edge_leaves(t)[0]):a[0].push(u),o instanceof e?a[1]=a[1].concat(o._find_edge_leaves(t)[1]):a[1].push(o);else for(s=0,l=r.length;s<l;s++)n=r[s],n instanceof e?(i=n._find_edge_leaves(t),a[0]=a[0].concat(i[0]),a[1]=a[1].concat(i[1])):(a[0].push(n),a[1].push(n));return a},e.prototype._align_outer_edges_constraints=function(t){var e,n,i,r,s,a,l,u,h;return c=this._find_edge_leaves(t),u=c[0],r=c[1],t?(h="on_edge_align_left",s="on_edge_align_right"):(h="on_edge_align_top",s="on_edge_align_bottom"),n=function(t,e){var n,i,r,o,s;for(n=[],i=0,o=t.length;i<o;i++)r=t[i],s=r.get_constrained_variables(),e in s&&n.push(s[e]);return n},l=n(u,h),i=n(r,s),a=[],e=function(t){var e,n,i,r,s;if(t.length>1){for(n=t[0],i=r=1,s=t.length;1<=s?r<s:r>s;i=1<=s?++r:--r)e=t[i],a.push(o.EQ([-1,n],e));return null}},e(l),e(i),a;var c},e.prototype._box_insets_from_child_insets=function(t,e,n,i){var r,s,a,l,u,h,c,_;return p=this._find_edge_leaves(t),c=p[0],s=p[1],t?(_=e+"_left",a=e+"_right",u=this[n+"_left"],l=this[n+"_right"]):(_=e+"_top",a=e+"_bottom",u=this[n+"_top"],l=this[n+"_bottom"]),h=[],r=function(t,e,n){var r,s,a,l,u;for(r=[],s=0,l=e.length;s<l;s++)a=e[s],u=a.get_constrained_variables(),n in u&&(i?h.push(o.GE([-1,t],u[n])):h.push(o.EQ([-1,t],u[n])));return null},r(u,c,_),r(l,s,a),h;var p},e.prototype._box_equal_size_bounds=function(t){return this._box_insets_from_child_insets(t,"box_equal_size","_box_equal_size",!1)},e.prototype._box_cell_align_bounds=function(t){return this._box_insets_from_child_insets(t,"box_cell_align","_box_cell_align",!1)},e.prototype._box_whitespace=function(t){return this._box_insets_from_child_insets(t,"whitespace","_whitespace",!0)},e}(u.LayoutDOM);n.Box=c,c.prototype.default_view=h,c.define({children:[s.Array,[]]}),c.internal({spacing:[s.Number,6]}),c._left_right_inner_cell_edge_variables=["box_cell_align_left","box_cell_align_right"],c._top_bottom_inner_cell_edge_variables=["box_cell_align_top","box_cell_align_bottom"]},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(136),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.BoxView);n.ColumnView=o,o.prototype.className="bk-grid-column";var s=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i._horizontal=!1,i}return i.__extends(e,t),e}(r.Box);n.Column=s,s.prototype.type="Column",s.prototype.default_view=o},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(136);n.Box=i.Box;var r=t(137);n.Column=r.Column;var o=t(139);n.LayoutDOM=o.LayoutDOM;var s=t(140);n.Row=s.Row;var a=t(141);n.Spacer=a.Spacer;var l=t(142);n.WidgetBox=l.WidgetBox},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50),o=t(5),s=t(15),a=t(11),l=t(13),u=t(4),h=t(6),c=t(14);n.LayoutDOMView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.is_root&&(this._solver=new l.Solver),this.child_views={},this.build_child_views()},e.prototype.remove=function(){var e,n,i;n=this.child_views;for(e in n)i=n[e],i.remove();return this.child_views={},t.prototype.remove.call(this)},e.prototype.has_finished=function(){var e,n,i;if(!t.prototype.has_finished.call(this))return!1;i=this.child_views;for(e in i)if(n=i[e],!n.has_finished())return!1;return!0},e.prototype.notify_finished=function(){return this.is_root?!this._idle_notified&&this.has_finished()&&null!=this.model.document?(this._idle_notified=!0,this.model.document.notify_idle(this.model)):void 0:t.prototype.notify_finished.call(this)},e.prototype._calc_width_height=function(){var t,e,n;for(e=this.el;;){if(e=e.parentNode,null==e){c.logger.warn("detached element"),n=t=null;break}if(i=e.getBoundingClientRect(),n=i.width,t=i.height,0!==t)break}return[n,t];var i},e.prototype._init_solver=function(){var t,e,n,i,r,o,s,a,u;for(this._root_width=new l.Variable(this.toString()+".root_width"),this._root_height=new l.Variable(this.toString()+".root_height"),this._solver.add_edit_variable(this._root_width),this._solver.add_edit_variable(this._root_height),i=this.model.get_all_editables(),r=0,s=i.length;r<s;r++)n=i[r],this._solver.add_edit_variable(n,l.Strength.strong);for(e=this.model.get_all_constraints(),o=0,a=e.length;o<a;o++)t=e[o],this._solver.add_constraint(t);return u=this.model.get_constrained_variables(),null!=u.width&&this._solver.add_constraint(l.EQ(u.width,this._root_width)),null!=u.height&&this._solver.add_constraint(l.EQ(u.height,this._root_height)),this._solver.update_variables(),this._solver_inited=!0},e.prototype._suggest_dims=function(t,e){var n;if(n=this.model.get_constrained_variables(),null!=n.width||null!=n.height)return null!==t&&null!==e||(i=this._calc_width_height(),t=i[0],e=i[1]),null!=n.width&&null!=t&&this._solver.suggest_value(this._root_width,t),null!=n.height&&null!=e&&this._solver.suggest_value(this._root_height,e),this._solver.update_variables();var i},e.prototype.resize=function(t,e){return void 0===t&&(t=null),void 0===e&&(e=null),this.is_root?this._do_layout(!1,t,e):this.root.resize(t,e)},e.prototype.partial_layout=function(){return this.is_root?this._do_layout(!1):this.root.partial_layout()},e.prototype.layout=function(t){return void 0===t&&(t=!0),this.is_root?this._do_layout(!0):this.root.layout()},e.prototype._do_layout=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),this._solver_inited&&!t||(this._solver.clear(),this._init_solver()),this._suggest_dims(e,n),this._layout(),this._layout(),this._layout(!0),this.notify_finished()},e.prototype._layout=function(t){void 0===t&&(t=!1);var e,n,i,r,o;for(o=this.model.get_layoutable_children(),i=0,r=o.length;i<r;i++)e=o[i],n=this.child_views[e.id],null!=n._layout&&n._layout(t);if(this.render(),t)return this._has_finished=!0},e.prototype.rebuild_child_views=function(){return this.solver.clear(),this.build_child_views(),this.layout()},e.prototype.build_child_views=function(){var t,e,n,i,r,s;for(n=this.model.get_layoutable_children(),u.build_views(this.child_views,n,{parent:this}),o.empty(this.el),s=[],i=0,r=n.length;i<r;i++)t=n[i],e=this.child_views[t.id],s.push(this.el.appendChild(e.el));return s},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.is_root&&window.addEventListener("resize",function(){return e.resize()}),this.connect(this.model.properties.sizing_mode.change,function(){return e.layout()})},e.prototype._render_classes=function(){var t,e,n,i,r;if(this.el.className="",null!=this.className&&this.el.classList.add(this.className),this.el.classList.add("bk-layout-"+this.model.sizing_mode),null!=this.model.css_classes){for(i=this.model.css_classes,r=[],e=0,n=i.length;e<n;e++)t=i[e],r.push(this.el.classList.add(t));return r}},e.prototype.render=function(){var t,e;switch(this._render_classes(),this.model.sizing_mode){case"fixed":null!=this.model.width?e=this.model.width:(e=this.get_width(),this.model.setv({width:e},{silent:!0})),null!=this.model.height?t=this.model.height:(t=this.get_height(),this.model.setv({height:t},{silent:!0})),this.solver.suggest_value(this.model._width,e),this.solver.suggest_value(this.model._height,t);break;case"scale_width":t=this.get_height(),this.solver.suggest_value(this.model._height,t);break;case"scale_height":e=this.get_width(),this.solver.suggest_value(this.model._width,e);break;case"scale_both":n=this.get_width_height(),e=n[0],t=n[1],this.solver.suggest_value(this.model._width,e),this.solver.suggest_value(this.model._height,t)}return this.solver.update_variables(),this.position();var n},e.prototype.position=function(){switch(this.model.sizing_mode){case"fixed":case"scale_width":case"scale_height":this.el.style.position="relative",this.el.style.left="",this.el.style.top="";break;case"scale_both":case"stretch_both":this.el.style.position="absolute",this.el.style.left=this.model._dom_left.value+"px",this.el.style.top=this.model._dom_top.value+"px"}return this.el.style.width=this.model._width.value+"px",this.el.style.height=this.model._height.value+"px"},e.prototype.get_height=function(){throw new Error("not implemented")},e.prototype.get_width=function(){throw new Error("not implemented")},e.prototype.get_width_height=function(){var t,e,n,i,r,o,s,a,l;return s=this.el.parentNode.clientHeight,a=this.el.parentNode.clientWidth,t=this.model.get_aspect_ratio(),r=a,n=a/t,o=s*t,i=s,r<o?(l=r,e=n):(l=o,e=i),[l,e]},e}(h.DOMView);var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._width=new l.Variable(this.toString()+".width"),this._height=new l.Variable(this.toString()+".height"),this._left=new l.Variable(this.toString()+".left"),this._right=new l.Variable(this.toString()+".right"),this._top=new l.Variable(this.toString()+".top"),this._bottom=new l.Variable(this.toString()+".bottom"),this._dom_top=new l.Variable(this.toString()+".dom_top"),this._dom_left=new l.Variable(this.toString()+".dom_left"),this._width_minus_right=new l.Variable(this.toString()+".width_minus_right"),this._height_minus_bottom=new l.Variable(this.toString()+".height_minus_bottom"),this._whitespace_top=new l.Variable(this.toString()+".whitespace_top"),this._whitespace_bottom=new l.Variable(this.toString()+".whitespace_bottom"),this._whitespace_left=new l.Variable(this.toString()+".whitespace_left"),this._whitespace_right=new l.Variable(this.toString()+".whitespace_right")},e.prototype.dump_layout=function(){var t,n,i;for(t={},i=[this];i.length>0;)n=i.shift(),n instanceof e&&i.push.apply(i,n.get_layoutable_children()),t[n.toString()]=n.layout_bbox;return console.table(t)},e.prototype.get_all_constraints=function(){var t,e,n,i,r;for(e=this.get_constraints(),r=this.get_layoutable_children(),n=0,i=r.length;n<i;n++)t=r[n],e=t instanceof a.LayoutCanvas?e.concat(t.get_constraints()):e.concat(t.get_all_constraints());return e},e.prototype.get_all_editables=function(){var t,e,n,i,r;for(e=this.get_editables(),r=this.get_layoutable_children(),n=0,i=r.length;n<i;n++)t=r[n],e=t instanceof a.LayoutCanvas?e.concat(t.get_editables()):e.concat(t.get_all_editables());return e},e.prototype.get_constraints=function(){return[l.GE(this._dom_left),l.GE(this._dom_top),l.GE(this._left),l.GE(this._width,[-1,this._right]),l.GE(this._top),l.GE(this._height,[-1,this._bottom]),l.EQ(this._width_minus_right,[-1,this._width],this._right),l.EQ(this._height_minus_bottom,[-1,this._height],this._bottom)]},e.prototype.get_layoutable_children=function(){return[]},e.prototype.get_editables=function(){switch(this.sizing_mode){case"fixed":return[this._height,this._width];case"scale_width":return[this._height];case"scale_height":return[this._width];case"scale_both":return[this._width,this._height];default:return[]}},e.prototype.get_constrained_variables=function(){var t;switch(t={origin_x:this._dom_left,origin_y:this._dom_top,whitespace_top:this._whitespace_top,whitespace_bottom:this._whitespace_bottom,whitespace_left:this._whitespace_left,whitespace_right:this._whitespace_right},this.sizing_mode){case"stretch_both":t.width=this._width,t.height=this._height;break;case"scale_width":t.width=this._width;break;case"scale_height":t.height=this._height}return t},e.prototype.get_aspect_ratio=function(){return this.width/this.height},e}(r.Model);n.LayoutDOM=_,_.prototype.type="LayoutDOM",_.getters({layout_bbox:function(){return{top:this._top.value,left:this._left.value,width:this._width.value,height:this._height.value,right:this._right.value,bottom:this._bottom.value,dom_top:this._dom_top.value,dom_left:this._dom_left.value}}}),_.define({height:[s.Number],width:[s.Number],disabled:[s.Bool,!1],sizing_mode:[s.SizingMode,"fixed"],css_classes:[s.Array,[]]
  })},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(136),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.BoxView);n.RowView=o,o.prototype.className="bk-grid-row";var s=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i._horizontal=!0,i}return i.__extends(e,t),e}(r.Box);n.Row=s,s.prototype.type="Row",s.prototype.default_view=o},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(139),o=t(30),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){if(t.prototype.render.call(this),"fixed"===this.sizing_mode)return this.el.style.width=this.model.width+"px",this.el.style.height=this.model.height+"px"},e.prototype.get_height=function(){return 1},e}(r.LayoutDOMView);n.SpacerView=s,s.prototype.className="bk-spacer-box";var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_constrained_variables=function(){return o.extend({},t.prototype.get_constrained_variables.call(this),{on_edge_align_top:this._top,on_edge_align_bottom:this._height_minus_bottom,on_edge_align_left:this._left,on_edge_align_right:this._width_minus_right,box_cell_align_top:this._top,box_cell_align_bottom:this._height_minus_bottom,box_cell_align_left:this._left,box_cell_align_right:this._width_minus_right,box_equal_size_top:this._top,box_equal_size_bottom:this._height_minus_bottom,box_equal_size_left:this._left,box_equal_size_right:this._width_minus_right})},e}(r.LayoutDOM);n.Spacer=a,a.prototype.type="Spacer",a.prototype.default_view=s},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r={}.hasOwnProperty,o=t(14),s=t(15),a=t(30),l=t(139),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.children.change,function(){return e.rebuild_child_views()})},e.prototype.render=function(){var t,e,n;return this._render_classes(),"fixed"!==this.model.sizing_mode&&"scale_height"!==this.model.sizing_mode||(n=this.get_width(),this.model._width.value!==n&&this.solver.suggest_value(this.model._width,n)),"fixed"!==this.model.sizing_mode&&"scale_width"!==this.model.sizing_mode||(e=this.get_height(),this.model._height.value!==e&&this.solver.suggest_value(this.model._height,e)),this.solver.update_variables(),"stretch_both"===this.model.sizing_mode?(this.el.style.position="absolute",this.el.style.left=this.model._dom_left.value+"px",this.el.style.top=this.model._dom_top.value+"px",this.el.style.width=this.model._width.value+"px",this.el.style.height=this.model._height.value+"px"):(t=this.model._width.value-20>0?this.model._width.value-20+"px":"100%",this.el.style.width=t)},e.prototype.get_height=function(){var t,e,n,i,o,s,a,l;n=0,a=this.child_views;for(i in a)r.call(a,i)&&(t=a[i],e=t.el,l=getComputedStyle(e),s=parseInt(l.marginTop)||0,o=parseInt(l.marginBottom)||0,n+=e.offsetHeight+s+o);return n+20},e.prototype.get_width=function(){var t,e,n,i,o;if(null!=this.model.width)return this.model.width;o=this.el.scrollWidth+20,i=this.child_views;for(n in i)r.call(i,n)&&(t=i[n],e=t.el.scrollWidth,e>o&&(o=e));return o},e}(l.LayoutDOMView);n.WidgetBoxView=u,u.prototype.className="bk-widget-box";var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),"fixed"===this.sizing_mode&&null===this.width&&(this.width=300,o.logger.info("WidgetBox mode is fixed, but no width specified. Using default of 300.")),"scale_height"===this.sizing_mode)return o.logger.warn("sizing_mode `scale_height` is not experimental for WidgetBox. Please report your results to the bokeh dev team so we can improve.")},e.prototype.get_constrained_variables=function(){var e;return e=a.extend({},t.prototype.get_constrained_variables.call(this),{on_edge_align_top:this._top,on_edge_align_bottom:this._height_minus_bottom,on_edge_align_left:this._left,on_edge_align_right:this._width_minus_right,box_cell_align_top:this._top,box_cell_align_bottom:this._height_minus_bottom,box_cell_align_left:this._left,box_cell_align_right:this._width_minus_right,box_equal_size_top:this._top,box_equal_size_bottom:this._height_minus_bottom}),"fixed"!==this.sizing_mode&&(e.box_equal_size_left=this._left,e.box_equal_size_right=this._width_minus_right),e},e.prototype.get_layoutable_children=function(){return this.children},e}(l.LayoutDOM);n.WidgetBox=h,h.prototype.type="WidgetBox",h.prototype.default_view=u,h.define({children:[s.Array,[]]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=t(144),s=t(15),a=t(22),l=t(42);i=function(t,e){var n,i,r;if(t.length!==e.length)return!1;for(n=i=0,r=t.length;0<=r?i<r:i>r;n=0<=r?++i:--i)if(t[n]!==e[n])return!1;return!0};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._get_values=function(t,e){var n,r,o,s,u,h;for(h=[],o=0,u=t.length;o<u;o++)r=t[o],l.isString(r)?s=this.factors.indexOf(r):(null!=this.start?r=null!=this.end?r.slice(this.start,this.end):r.slice(this.start):null!=this.end&&(r=r.slice(0,this.end)),s=1===r.length?this.factors.indexOf(r[0]):a.findIndex(this.factors,function(t){return i(t,r)})),n=s<0||s>=e.length?this.nan_color:e[s],h.push(n);return h},e}(o.ColorMapper);n.CategoricalColorMapper=u,u.prototype.type="CategoricalColorMapper",u.define({factors:[s.Array],start:[s.Number,0],end:[s.Number]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(243),s=t(42),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._little_endian=this._is_little_endian(),this._palette=this._build_palette(this.palette),this.connect(this.change,function(){return this._palette=this._build_palette(this.palette)})},e.prototype.v_map_screen=function(t,e){void 0===e&&(e=!1);var n,i,r,o,s,a,l,u,h,c;if(c=this._get_values(t,this._palette,e),n=new ArrayBuffer(4*t.length),this._little_endian)for(i=new Uint8Array(n),r=s=0,l=t.length;0<=l?s<l:s>l;r=0<=l?++s:--s)h=c[r],o=4*r,i[o]=Math.floor(h/4278190080*255),i[o+1]=(16711680&h)>>16,i[o+2]=(65280&h)>>8,i[o+3]=255&h;else for(i=new Uint32Array(n),r=a=0,u=t.length;0<=u?a<u:a>u;r=0<=u?++a:--a)h=c[r],i[r]=h<<8|255;return n},e.prototype.compute=function(t){return null},e.prototype.v_compute=function(t){var e;return e=this._get_values(t,this.palette)},e.prototype._get_values=function(t,e,n){return void 0===n&&(n=!1),[]},e.prototype._is_little_endian=function(){var t,e,n,i;return t=new ArrayBuffer(4),n=new Uint8Array(t),e=new Uint32Array(t),e[1]=168496141,i=!0,10===n[4]&&11===n[5]&&12===n[6]&&13===n[7]&&(i=!1),i},e.prototype._build_palette=function(t){var e,n,i,r,o;for(r=new Uint32Array(t.length),e=function(t){return s.isNumber(t)?t:(9!==t.length&&(t+="ff"),parseInt(t.slice(1),16))},n=i=0,o=t.length;0<=o?i<o:i>o;n=0<=o?++i:--i)r[n]=e(t[n]);return r},e}(o.Transform);n.ColorMapper=a,a.prototype.type="ColorMapper",a.define({palette:[r.Any],nan_color:[r.Color,"gray"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(143);n.CategoricalColorMapper=i.CategoricalColorMapper;var r=t(144);n.ColorMapper=r.ColorMapper;var o=t(146);n.LinearColorMapper=o.LinearColorMapper;var s=t(147);n.LogColorMapper=s.LogColorMapper},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(26),s=t(22),a=t(144),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._nan_color=this._build_palette([o.color2hex(this.nan_color)])[0],this._high_color=null!=this.high_color?this._build_palette([o.color2hex(this.high_color)])[0]:void 0,this._low_color=null!=this.low_color?this._build_palette([o.color2hex(this.low_color)])[0]:void 0},e.prototype._get_values=function(t,e,n){void 0===n&&(n=!1);var i,r,o,a,l,u,h,c,_,p,d,f,m,v,g,y;for(h=null!=(v=this.low)?v:s.min(t),r=null!=(g=this.high)?g:s.max(t),_=e.length-1,y=[],p=n?this._nan_color:this.nan_color,c=n?this._low_color:this.low_color,o=n?this._high_color:this.high_color,d=1/(r-h),m=1/e.length,a=0,u=t.length;a<u;a++)i=t[a],isNaN(i)?y.push(p):i!==r?(f=(i-h)*d,l=Math.floor(f/m),l<0?null!=this.low_color?y.push(c):y.push(e[0]):l>_?null!=this.high_color?y.push(o):y.push(e[_]):y.push(e[l])):y.push(e[_]);return y},e}(a.ColorMapper);n.LinearColorMapper=l,l.prototype.type="LinearColorMapper",l.define({high:[r.Number],low:[r.Number],high_color:[r.Color],low_color:[r.Color]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o=t(364),s=t(15),a=t(26),l=t(22),u=t(144);i=null!=(r=Math.log1p)?r:function(t){return Math.log(1+t)};var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._nan_color=this._build_palette([a.color2hex(this.nan_color)])[0],this._high_color=null!=this.high_color?this._build_palette([a.color2hex(this.high_color)])[0]:void 0,this._low_color=null!=this.low_color?this._build_palette([a.color2hex(this.low_color)])[0]:void 0},e.prototype._get_values=function(t,e,n){void 0===n&&(n=!1);var r,o,s,a,u,h,c,_,p,d,f,m,v,g,y,b;for(f=e.length,_=null!=(v=this.low)?v:l.min(t),o=null!=(g=this.high)?g:l.max(t),y=f/(i(o)-i(_)),d=e.length-1,b=[],m=n?this._nan_color:this.nan_color,s=n?this._high_color:this.high_color,p=n?this._low_color:this.low_color,a=0,h=t.length;a<h;a++)r=t[a],isNaN(r)?b.push(m):r>o?null!=this.high_color?b.push(s):b.push(e[d]):r!==o?r<_?null!=this.low_color?b.push(p):b.push(e[0]):(c=i(r)-i(_),u=Math.floor(c*y),u>d&&(u=d),b.push(e[u])):b.push(e[d]);return b},e}(u.ColorMapper);n.LogColorMapper=h,h.prototype.type="LogColorMapper",h.define({high:[s.Number],low:[s.Number],high_color:[s.Color],low_color:[s.Color]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x=t(364),w=t(149);i=Math.sqrt(3),l=function(t,e){return t.moveTo(-e,e),t.lineTo(e,-e),t.moveTo(-e,-e),t.lineTo(e,e)},o=function(t,e){return t.moveTo(0,e),t.lineTo(0,-e),t.moveTo(-e,0),t.lineTo(e,0)},s=function(t,e){return t.moveTo(0,e),t.lineTo(e/1.5,0),t.lineTo(0,-e),t.lineTo(-e/1.5,0),t.closePath()},a=function(t,e){var n,r;return r=e*i,n=r/3,t.moveTo(-e,n),t.lineTo(e,n),t.lineTo(0,n-r),t.closePath()},u=function(t,e,n,i,r,s,a){var u;u=.65*r,o(t,r),l(t,u),s.doit&&(s.set_vectorize(t,e),t.stroke())},h=function(t,e,n,i,r,s,a){t.arc(0,0,r,0,2*Math.PI,!1),a.doit&&(a.set_vectorize(t,e),t.fill()),s.doit&&(s.set_vectorize(t,e),o(t,r),t.stroke())},c=function(t,e,n,i,r,o,s){t.arc(0,0,r,0,2*Math.PI,!1),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),l(t,r),t.stroke())},_=function(t,e,n,i,r,s,a){o(t,r),s.doit&&(s.set_vectorize(t,e),t.stroke())},p=function(t,e,n,i,r,o,a){s(t,r),a.doit&&(a.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},d=function(t,e,n,i,r,a,l){s(t,r),l.doit&&(l.set_vectorize(t,e),t.fill()),a.doit&&(a.set_vectorize(t,e),o(t,r),t.stroke())},f=function(t,e,n,i,r,o,s){t.rotate(Math.PI),a(t,r),t.rotate(-Math.PI),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},m=function(t,e,n,i,r,o,s){var a;a=2*r,t.rect(-r,-r,a,a),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},v=function(t,e,n,i,r,s,a){var l;l=2*r,t.rect(-r,-r,l,l),a.doit&&(a.set_vectorize(t,e),t.fill()),s.doit&&(s.set_vectorize(t,e),o(t,r),t.stroke())},g=function(t,e,n,i,r,o,s){var a;a=2*r,t.rect(-r,-r,a,a),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),l(t,r),t.stroke())},y=function(t,e,n,i,r,o,s){a(t,r),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},b=function(t,e,n,i,r,o,s){l(t,r),o.doit&&(o.set_vectorize(t,e),t.stroke())},r=function(t,e){var n,i;return i=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x.__extends(e,t),e}(w.MarkerView);return t.prototype._render_one=e,t}(),n=function(){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x.__extends(e,t),e}(w.Marker);return e.prototype.default_view=i,e.prototype.type=t,e}()},n.Asterisk=r("Asterisk",u),n.CircleCross=r("CircleCross",h),n.CircleX=r("CircleX",c),n.Cross=r("Cross",_),n.Diamond=r("Diamond",p),n.DiamondCross=r("DiamondCross",d),n.InvertedTriangle=r("InvertedTriangle",f),n.Square=r("Square",m),n.SquareCross=r("SquareCross",v),n.SquareX=r("SquareX",g),n.Triangle=r("Triangle",y),n.X=r("X",b)},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(9),s=t(15);n.MarkerView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h,c;return l=[o],h={},h[o]=(e+n)/2,c={},c[o]=(i+r)/2,u={},u[o]=.4*Math.min(Math.abs(n-e),Math.abs(r-i)),s={},s[o]=this._angle[o],a={sx:h,sy:c,_size:u,_angle:s},this._render(t,l,a)},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n._size,c=n._angle;for(a=[],r=0,o=e.length;r<o;r++)i=e[r],isNaN(l[i]+u[i]+h[i]+c[i])||(s=h[i]/2,t.beginPath(),t.translate(l[i],u[i]),c[i]&&t.rotate(c[i]),this._render_one(t,i,l[i],u[i],s,this.visuals.line,this.visuals.fill),c[i]&&t.rotate(-c[i]),a.push(t.translate(-l[i],-u[i])));return a},e.prototype._mask_data=function(t){var e,n,i,r,s,a,l,u,h,c,_;return n=this.renderer.plot_view.frame.bbox.h_range,i=n.start-this.max_size,r=n.end+this.max_size,p=this.renderer.xscale.r_invert(i,r),u=p[0],h=p[1],l=this.renderer.plot_view.frame.bbox.v_range,s=l.start-this.max_size,a=l.end+this.max_size,d=this.renderer.yscale.r_invert(s,a),c=d[0],_=d[1],e=o.validate_bbox_coords([u,h],[c,_]),this.index.indices(e);var p,d},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y;for(h=t.sx,p=t.sy,c=h-this.max_size,_=h+this.max_size,b=this.renderer.xscale.r_invert(c,_),m=b[0],v=b[1],d=p-this.max_size,f=p+this.max_size,x=this.renderer.yscale.r_invert(d,f),g=x[0],y=x[1],e=o.validate_bbox_coords([m,v],[g,y]),n=this.index.indices(e),r=[],a=0,l=n.length;a<l;a++)s=n[a],u=this._size[s]/2,i=Math.abs(this.sx[s]-h)+Math.abs(this.sy[s]-p),Math.abs(this.sx[s]-h)<=u&&Math.abs(this.sy[s]-p)<=u&&r.push([s,i]);return o.create_1d_hit_test_result(r);var b,x},e.prototype._hit_span=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y;return h=t.sx,p=t.sy,b=this.bounds(),s=b.minX,a=b.minY,i=b.maxX,r=b.maxY,u=o.create_hit_test_result(),"h"===t.direction?(g=a,y=r,l=this.max_size/2,c=h-l,_=h+l,x=this.renderer.xscale.r_invert(c,_),m=x[0],v=x[1]):(m=s,v=i,l=this.max_size/2,d=p-l,f=p+l,w=this.renderer.yscale.r_invert(d,f),g=w[0],y=w[1]),e=o.validate_bbox_coords([m,v],[g,y]),n=this.index.indices(e),u["1d"].indices=n,u;var b,x,w},e.prototype._hit_rect=function(t){var e,n,i,r,s,a,l,u,h,c;return i=t.sx0,r=t.sx1,s=t.sy0,a=t.sy1,_=this.renderer.xscale.r_invert(i,r),l=_[0],u=_[1],p=this.renderer.yscale.r_invert(s,a),h=p[0],c=p[1],e=o.validate_bbox_coords([l,u],[h,c]),n=o.create_hit_test_result(),n["1d"].indices=this.index.indices(e),n;var _,p},e.prototype._hit_poly=function(t){var e,n,i,r,s,a,l,u,h,c;for(h=t.sx,c=t.sy,e=function(){u=[];for(var t=0,e=this.sx.length;0<=e?t<e:t>e;0<=e?t++:t--)u.push(t);return u}.apply(this),n=[],i=s=0,a=e.length;0<=a?s<a:s>a;i=0<=a?++s:--s)r=e[i],o.point_in_poly(this.sx[i],this.sy[i],h,c)&&n.push(r);return l=o.create_hit_test_result(),l["1d"].indices=n,l},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Marker=a,a.mixins(["line","fill"]),a.define({size:[s.DistanceSpec,{units:"screen",value:4}],angle:[s.AngleSpec,0]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(14),o=t(151),s=t(153),a=t(15),l=t(50),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(l.Model);n.MapOptions=u,u.prototype.type="MapOptions",u.define({lat:[a.Number],lng:[a.Number],zoom:[a.Number,12]});var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(u);n.GMapOptions=h,h.prototype.type="GMapOptions",h.define({map_type:[a.String,"roadmap"],scale_control:[a.Bool,!1],styles:[a.String]}),n.GMapPlotView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(s.PlotView);var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),!this.api_key)return r.logger.error("api_key is required. See https://developers.google.com/maps/documentation/javascript/get-api-key for more information on how to obtain your own.")},e.prototype._init_plot_canvas=function(){return new o.GMapPlotCanvas({plot:this})},e}(s.Plot);n.GMapPlot=c,c.prototype.type="GMapPlot",c.prototype.default_view=n.GMapPlotView,c.define({map_options:[a.Instance],api_key:[a.String]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o=t(364),s=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},a=t(31),l=t(154),u=t(20);i=new u.Signal(this,"gmaps_ready"),r=function(t){var e;return window._bokeh_gmaps_callback=function(){return i.emit()},e=document.createElement("script"),e.type="text/javascript",e.src="https://maps.googleapis.com/maps/api/js?key="+t+"&callback=_bokeh_gmaps_callback",document.body.appendChild(e)},n.GMapPlotCanvasView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._get_latlon_bounds=e._get_latlon_bounds.bind(e),e._get_projected_bounds=e._get_projected_bounds.bind(e),e._set_bokeh_ranges=e._set_bokeh_ranges.bind(e),e}return o.__extends(e,t),e.prototype.initialize=function(e){var n,o,s=this;return this.pause(),t.prototype.initialize.call(this,e),this._tiles_loaded=!1,this.zoom_count=0,n=this.model.plot.map_options,this.initial_zoom=n.zoom,this.initial_lat=n.lat,this.initial_lng=n.lng,this.canvas_view.map_el.style.position="absolute",null==(null!=(o=window.google)?o.maps:void 0)&&(null==window._bokeh_gmaps_callback&&r(this.model.plot.api_key),i.connect(function(){return s.request_render()})),this.unpause()},e.prototype.update_range=function(e){var n,i,r,o,s,a,l,u;if(null==e)n=this.model.plot.map_options,this.map.setCenter({lat:this.initial_lat,lng:this.initial_lng}),this.map.setOptions({zoom:this.initial_zoom}),t.prototype.update_range.call(this,null);else if(null!=e.sdx||null!=e.sdy)this.map.panBy(e.sdx,e.sdy),t.prototype.update_range.call(this,e);else if(null!=e.factor){if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,this.pause(),t.prototype.update_range.call(this,e),u=e.factor<0?-1:1,r=this.map.getZoom(),i=r+u,i>=2&&(this.map.setZoom(i),h=this._get_projected_bounds(),s=h[0],o=h[1],l=h[2],a=h[3],o-s<0&&this.map.setZoom(r)),this.unpause()}return this._set_bokeh_ranges();var h},e.prototype._build_map=function(){var t,e,n,i=this;return e=window.google.maps,this.map_types={satellite:e.MapTypeId.SATELLITE,terrain:e.MapTypeId.TERRAIN,roadmap:e.MapTypeId.ROADMAP,hybrid:e.MapTypeId.HYBRID},n=this.model.plot.map_options,t={center:new e.LatLng(n.lat,n.lng),zoom:n.zoom,disableDefaultUI:!0,mapTypeId:this.map_types[n.map_type],scaleControl:n.scale_control},null!=n.styles&&(t.styles=JSON.parse(n.styles)),this.map=new e.Map(this.canvas_view.map_el,t),e.event.addListener(this.map,"idle",function(){return i._set_bokeh_ranges()}),e.event.addListener(this.map,"bounds_changed",function(){return i._set_bokeh_ranges()}),e.event.addListenerOnce(this.map,"tilesloaded",function(){return i._render_finished()}),this.connect(this.model.plot.properties.map_options.change,function(){return i._update_options()}),this.connect(this.model.plot.map_options.properties.styles.change,function(){return i._update_styles()}),this.connect(this.model.plot.map_options.properties.lat.change,function(){return i._update_center("lat")}),this.connect(this.model.plot.map_options.properties.lng.change,function(){return i._update_center("lng")}),this.connect(this.model.plot.map_options.properties.zoom.change,function(){return i._update_zoom()}),this.connect(this.model.plot.map_options.properties.map_type.change,function(){return i._update_map_type()}),this.connect(this.model.plot.map_options.properties.scale_control.change,function(){return i._update_scale_control()})},e.prototype._render_finished=function(){return this._tiles_loaded=!0,this.notify_finished()},e.prototype.has_finished=function(){return t.prototype.has_finished.call(this)&&this._tiles_loaded===!0},e.prototype._get_latlon_bounds=function(){var t,n,i,r,o,a,l;return s(this,e),n=this.map.getBounds(),i=n.getNorthEast(),t=n.getSouthWest(),o=t.lng(),r=i.lng(),l=t.lat(),a=i.lat(),[o,r,l,a]},e.prototype._get_projected_bounds=function(){var t,n,i,r,o,l,u,h;return s(this,e),c=this._get_latlon_bounds(),l=c[0],o=c[1],h=c[2],u=c[3],_=a.proj4(a.mercator,[l,h]),n=_[0],r=_[1],p=a.proj4(a.mercator,[o,u]),t=p[0],i=p[1],[n,t,r,i];var c,_,p},e.prototype._set_bokeh_ranges=function(){var t,n,i,r;return s(this,e),o=this._get_projected_bounds(),n=o[0],t=o[1],r=o[2],i=o[3],this.frame.x_range.setv({start:n,end:t}),this.frame.y_range.setv({start:r,end:i});var o},e.prototype._update_center=function(t){var e;return e=this.map.getCenter().toJSON(),e[t]=this.model.plot.map_options[t],this.map.setCenter(e),this._set_bokeh_ranges()},e.prototype._update_map_type=function(){var t;return t=window.google.maps,this.map.setOptions({mapTypeId:this.map_types[this.model.plot.map_options.map_type]})},e.prototype._update_scale_control=function(){var t;return t=window.google.maps,this.map.setOptions({scaleControl:this.model.plot.map_options.scale_control})},e.prototype._update_options=function(){return this._update_styles(),this._update_center("lat"),this._update_center("lng"),this._update_zoom(),this._update_map_type()},e.prototype._update_styles=function(){return this.map.setOptions({styles:JSON.parse(this.model.plot.map_options.styles)})},e.prototype._update_zoom=function(){return this.map.setOptions({zoom:this.model.plot.map_options.zoom}),this._set_bokeh_ranges()},e.prototype._map_hook=function(t,e){var n,i,r,o,s;if(i=e[0],o=e[1],s=e[2],n=e[3],this.canvas_view.map_el.style.top=o+"px",this.canvas_view.map_el.style.left=i+"px",this.canvas_view.map_el.style.width=s+"px",this.canvas_view.map_el.style.height=n+"px",null==this.map&&null!=(null!=(r=window.google)?r.maps:void 0))return this._build_map()},e.prototype._paint_empty=function(t,e){var n,i,r,o,s,a;return s=this.canvas._width.value,o=this.canvas._height.value,r=e[0],a=e[1],i=e[2],n=e[3],t.clearRect(0,0,s,o),t.beginPath(),t.moveTo(0,0),t.lineTo(0,o),t.lineTo(s,o),t.lineTo(s,0),t.lineTo(0,0),t.moveTo(r,a),t.lineTo(r+i,a),t.lineTo(r+i,a+n),t.lineTo(r,a+n),t.lineTo(r,a),t.closePath(),t.fillStyle=this.model.plot.border_fill_color,t.fill()},e}(l.PlotCanvasView);var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.initialize=function(e,n){return this.use_map=!0,t.prototype.initialize.call(this,e,n)},e}(l.PlotCanvas);n.GMapPlotCanvas=h,h.prototype.type="GMapPlotCanvas",h.prototype.default_view=n.GMapPlotCanvasView},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(150);n.MapOptions=i.MapOptions;var r=t(150);n.GMapOptions=r.GMapOptions;var o=t(150);n.GMapPlot=o.GMapPlot;var s=t(151);n.GMapPlotCanvas=s.GMapPlotCanvas;var a=t(153);n.Plot=a.Plot;var l=t(154);n.PlotCanvas=l.PlotCanvas},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(13),o=t(14),s=t(15),a=t(22),l=t(30),u=t(42),h=t(139),c=t(65),_=t(168),p=t(233),d=t(66),f=t(154),m=t(173),v=t(161),g=t(3),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e;return t.prototype.connect_signals.call(this),e="Title object cannot be replaced. Try changing properties on title to update it after initialization.",this.connect(this.model.properties.title.change,function(){return o.logger.warn(e)})},e.prototype.get_height=function(){return this.model._width.value/this.model.get_aspect_ratio()},e.prototype.get_width=function(){return this.model._height.value*this.model.get_aspect_ratio()},e.prototype.save=function(t){return this.plot_canvas_view.save(t)},e}(h.LayoutDOMView);n.PlotView=y,y.prototype.className="bk-plot-layout",y.getters({plot_canvas_view:function(){return this.child_views[this.model._plot_canvas.id]}});var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n,i,r,o,s,a,h,c,_,p,d,f,m,v,g,y;for(t.prototype.initialize.call(this,e),_=l.values(this.extra_x_ranges).concat(this.x_range),n=0,s=_.length;n<s;n++)g=_[n],c=g.plots,u.isArray(c)&&(c=c.concat(this),g.setv("plots",c,{silent:!0}));for(p=l.values(this.extra_y_ranges).concat(this.y_range),i=0,a=p.length;i<a;i++)y=p[i],c=y.plots,u.isArray(c)&&(c=c.concat(this),y.setv("plots",c,{silent:!0}));for(null!=this.min_border&&(null==this.min_border_top&&(this.min_border_top=this.min_border),null==this.min_border_bottom&&(this.min_border_bottom=this.min_border),null==this.min_border_left&&(this.min_border_left=this.min_border),null==this.min_border_right&&(this.min_border_right=this.min_border)),this._init_title_panel(),this._init_toolbar_panel(),this._plot_canvas=this._init_plot_canvas(),this.plot_canvas.toolbar=this.toolbar,null==this.width&&(this.width=this.plot_width),null==this.height&&(this.height=this.plot_height),d=["above","below","left","right"],m=[],r=0,h=d.length;r<h;r++)v=d[r],o=this.getv(v),m.push(function(){var t,e,n;for(n=[],t=0,e=o.length;t<e;t++)f=o[t],n.push(f.add_panel(v));return n}());return m},e.prototype._init_plot_canvas=function(){return new f.PlotCanvas({plot:this})},e.prototype._init_title_panel=function(){var t;if(null!=this.title)return t=u.isString(this.title)?new c.Title({text:this.title}):this.title,this.add_layout(t,this.title_location)},e.prototype._init_toolbar_panel=function(){var t,e,n,i,r,o,s=this;if(null!=this._toolbar_panel){for(r=[this.left,this.right,this.above,this.below,this.renderers],t=0,n=r.length;t<n;t++)e=r[t],a.removeBy(e,function(t){return t===s._toolbar_panel});this._toolbar_panel=null}switch(this.toolbar_location){case"left":case"right":case"above":case"below":return this._toolbar_panel=new d.ToolbarPanel({toolbar:this.toolbar}),this.toolbar.toolbar_location=this.toolbar_location,this.toolbar_sticky&&(i=this.getv(this.toolbar_location),o=a.find(i,function(t){return t instanceof c.Title}),null!=o)?(this._toolbar_panel.set_panel(o.panel),void this.add_renderers(this._toolbar_panel)):this.add_layout(this._toolbar_panel,this.toolbar_location)}},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.properties.toolbar_location.change,function(){return e._init_toolbar_panel()})},e.prototype._doc_attached=function(){return this.plot_canvas.attach_document(this.document),t.prototype._doc_attached.call(this)},e.prototype.add_renderers=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n;return n=this.renderers,n=n.concat(t),this.renderers=n},e.prototype.add_layout=function(t,e){void 0===e&&(e="center");var n;return null!=t.props.plot&&(t.plot=this),"center"!==e&&(n=this.getv(e),n.push(t),t.add_panel(e)),this.add_renderers(t)},e.prototype.add_glyph=function(t,e,n){void 0===n&&(n={});var i;return null==e&&(e=new m.ColumnDataSource),n=l.extend({},n,{data_source:e,glyph:t}),i=new v.GlyphRenderer(n),this.add_renderers(i),i},e.prototype.add_tools=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,i,r;for(n=0,i=t.length;n<i;n++)r=t[n],null!=r.overlay&&this.add_renderers(r.overlay);return this.toolbar.tools=this.toolbar.tools.concat(t)},e.prototype.get_layoutable_children=function(){return[this.plot_canvas]},e.prototype.get_constraints=function(){var e;return e=t.prototype.get_constraints.call(this),e.push(r.EQ(this._width,[-1,this.plot_canvas._width])),e.push(r.EQ(this._height,[-1,this.plot_canvas._height])),e},e.prototype.get_constrained_variables=function(){var e;return e=l.extend({},t.prototype.get_constrained_variables.call(this),{on_edge_align_top:this.plot_canvas._top,on_edge_align_bottom:this.plot_canvas._height_minus_bottom,on_edge_align_left:this.plot_canvas._left,on_edge_align_right:this.plot_canvas._width_minus_right,box_cell_align_top:this.plot_canvas._top,box_cell_align_bottom:this.plot_canvas._height_minus_bottom,box_cell_align_left:this.plot_canvas._left,box_cell_align_right:this.plot_canvas._width_minus_right,box_equal_size_top:this.plot_canvas._top,box_equal_size_bottom:this.plot_canvas._height_minus_bottom}),"fixed"!==this.sizing_mode&&(e.box_equal_size_left=this.plot_canvas._left,e.box_equal_size_right=this.plot_canvas._width_minus_right),e},e}(h.LayoutDOM);n.Plot=b,b.prototype.type="Plot",b.prototype.default_view=y,b.getters({plot_canvas:function(){return this._plot_canvas}}),b.mixins(["line:outline_","fill:background_","fill:border_"]),b.define({toolbar:[s.Instance,function(){return new p.Toolbar}],toolbar_location:[s.Location,"right"],toolbar_sticky:[s.Boolean,!0],plot_width:[s.Number,600],plot_height:[s.Number,600],title:[s.Any,function(){return new c.Title({text:""})}],title_location:[s.Location,"above"],h_symmetry:[s.Bool,!0],v_symmetry:[s.Bool,!1],above:[s.Array,[]],below:[s.Array,[]],left:[s.Array,[]],right:[s.Array,[]],renderers:[s.Array,[]],x_range:[s.Instance],extra_x_ranges:[s.Any,{}],y_range:[s.Instance],extra_y_ranges:[s.Any,{}],x_scale:[s.Instance,function(){return new _.LinearScale}],y_scale:[s.Instance,function(){return new _.LinearScale}],lod_factor:[s.Number,10],lod_interval:[s.Number,300],lod_threshold:[s.Number,2e3],lod_timeout:[s.Number,500],hidpi:[s.Bool,!0],output_backend:[s.OutputBackend,"canvas"],min_border:[s.Number,5],min_border_top:[s.Number,null],min_border_left:[s.Number,null],min_border_bottom:[s.Number,null],min_border_right:[s.Number,null],inner_width:[s.Number],inner_height:[s.Number],layout_width:[s.Number],layout_height:[s.Number],match_aspect:[s.Bool,!1],aspect_scale:[s.Number,1]}),b.override({outline_line_color:"#e5e5e5",border_fill_color:"#ffffff",background_fill_color:"#ffffff"}),b.getters({all_renderers:function(){var t,e,n,i,r;for(i=this.renderers,n=this.toolbar.tools,t=0,e=n.length;t<e;t++)r=n[t],i=i.concat(r.synthetic_renderers);return i},webgl:function(){return log.warning("webgl attr is deprecated, use output_backend"),"webgl"===this.output_backend},tool_events:function(){return log.warning("tool_events attr is deprecated, use SelectionGeometry Event"),null}}),g.register_with_event(g.UIEvent,b)},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a,l=t(364),u=[].indexOf,h=t(79),c=t(80),_=t(156),p=t(161),d=t(139),f=t(20),m=t(4),v=t(21),g=t(46),y=t(6),b=t(11),x=t(10),w=t(13),k=t(14),M=t(7),S=t(15),T=t(41),O=t(42),A=t(22),E=t(30),j=t(12);a=null;var P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e.prototype.view_options=function(){return E.extend({plot_view:this,parent:this},this.options)},e.prototype.pause=function(){return null==this._is_paused?this._is_paused=1:this._is_paused+=1},e.prototype.unpause=function(t){if(void 0===t&&(t=!1),
  this._is_paused-=1,0===this._is_paused&&!t)return this.request_render()},e.prototype.request_render=function(){return this.request_paint()},e.prototype.request_paint=function(){this.is_paused||this.throttled_paint()},e.prototype.remove=function(){return m.remove_views(this.renderer_views),m.remove_views(this.tool_views),this.canvas_view.remove(),this.canvas_view=null,t.prototype.remove.call(this)},e.prototype.initialize=function(e){var n,i,r,o,s=this;for(this.pause(),t.prototype.initialize.call(this,e),this.force_paint=new f.Signal(this,"force_paint"),this.state_changed=new f.Signal(this,"state_changed"),this.lod_started=!1,this.visuals=new g.Visuals(this.model.plot),this._initial_state_info={range:null,selection:{},dimensions:{width:this.model.canvas._width.value,height:this.model.canvas._height.value}},this.frame=this.model.frame,this.canvas=this.model.canvas,this.canvas_view=new this.canvas.default_view({model:this.canvas,parent:this}),this.el.appendChild(this.canvas_view.el),this.canvas_view.render(),"webgl"===this.model.plot.output_backend&&this.init_webgl(),this.throttled_paint=T.throttle(function(){return s.force_paint.emit()},15),this.ui_event_bus=new v.UIEvents(this,this.model.toolbar,this.canvas_view.el,this.model.plot),this.levels={},o=M.RenderLevel,n=0,i=o.length;n<i;n++)r=o[n],this.levels[r]={};return this.renderer_views={},this.tool_views={},this.build_levels(),this.build_tools(),this.update_dataranges(),this.unpause(!0),k.logger.debug("PlotView initialized"),this},e.prototype.set_cursor=function(t){return void 0===t&&(t="default"),this.canvas_view.el.style.cursor=t},e.prototype.init_webgl=function(){var t,e,n;return t=this.canvas_view.ctx,e=a,null==e&&(a=e=document.createElement("canvas"),n={premultipliedAlpha:!0},e.gl=e.getContext("webgl",n)||e.getContext("experimental-webgl",n)),null!=e.gl?t.glcanvas=e:k.logger.warn("WebGL is not supported, falling back to 2D canvas.")},e.prototype.prepare_webgl=function(t,e){var n,i,r;if(i=this.canvas_view.ctx,n=this.canvas_view.get_canvas_element(),i.glcanvas)return i.glcanvas.width=n.width,i.glcanvas.height=n.height,r=i.glcanvas.gl,r.viewport(0,0,i.glcanvas.width,i.glcanvas.height),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT||r.DEPTH_BUFFER_BIT),r.enable(r.SCISSOR_TEST),r.scissor(t*e[0],t*e[1],t*e[2],t*e[3]),r.enable(r.BLEND),r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE_MINUS_DST_ALPHA,r.ONE)},e.prototype.blit_webgl=function(t){var e;if(e=this.canvas_view.ctx,e.glcanvas)return k.logger.debug("drawing with WebGL"),e.restore(),e.drawImage(e.glcanvas,0,0),e.save(),e.scale(t,t),e.translate(.5,.5)},e.prototype.update_dataranges=function(){var t,e,n,i,r,o,s,a,l,u,h,c,p,d,f,m,v,g,y,b,x,w,M,S,T,O,A,j,P,z,C,N,D,F,I,B;for(o=this.model.frame,e={},g={},i=!1,M=E.values(o.x_ranges).concat(E.values(o.y_ranges)),l=0,c=M.length;l<c;l++)w=M[l],w instanceof _.DataRange1d&&"log"===w.scale_hint&&(i=!0);S=this.renderer_views;for(u in S)C=S[u],t=null!=(T=C.glyph)&&"function"==typeof T.bounds?T.bounds():void 0,null!=t&&(e[u]=t),i&&(v=null!=(O=C.glyph)&&"function"==typeof O.log_bounds?O.log_bounds():void 0,null!=v&&(g[u]=v));if(r=!1,s=!1,this.model.plot.match_aspect!==!1&&0!==this.frame._width.value&&0!==this.frame._height.value){w=1/this.model.plot.aspect_scale*(this.frame._width.value/this.frame._height.value);for(u in e)C=e[u],isFinite(C.maxX)&&isFinite(C.minX)&&isFinite(C.maxY)&&isFinite(C.minY)&&(N=C.maxX-C.minX,N<=0&&(N=1),a=C.maxY-C.minY,a<=0&&(a=1),D=.5*(C.maxX+C.minX),I=.5*(C.maxY+C.minY),N<w*a?N=w*a:a=N/w,e[u].maxX=D+.5*N,e[u].minX=D-.5*N,e[u].maxY=I+.5*a,e[u].minY=I-.5*a)}for(A=E.values(o.x_ranges),h=0,p=A.length;h<p;h++)F=A[h],F instanceof _.DataRange1d&&(n="log"===F.scale_hint?g:e,F.update(n,0,this.model.id),F.follow&&(r=!0)),null!=F.bounds&&(s=!0);for(j=E.values(o.y_ranges),y=0,d=j.length;y<d;y++)B=j[y],B instanceof _.DataRange1d&&(n="log"===B.scale_hint?g:e,B.update(n,1,this.model.id),B.follow&&(r=!0)),null!=B.bounds&&(s=!0);if(r&&s){for(k.logger.warn("Follow enabled so bounds are unset."),P=E.values(o.x_ranges),b=0,f=P.length;b<f;b++)F=P[b],F.bounds=null;for(z=E.values(o.y_ranges),x=0,m=z.length;x<m;x++)B=z[x],B.bounds=null}return this.range_update_timestamp=Date.now()},e.prototype.map_to_screen=function(t,e,n,i){return void 0===n&&(n="default"),void 0===i&&(i="default"),this.frame.map_to_screen(t,e,n,i)},e.prototype.push_state=function(t,e){var n,i;return n=(null!=(i=this.state.history[this.state.index])?i.info:void 0)||{},e=E.extend({},this._initial_state_info,n,e),this.state.history.slice(0,this.state.index+1),this.state.history.push({type:t,info:e}),this.state.index=this.state.history.length-1,this.state_changed.emit()},e.prototype.clear_state=function(){return this.state={history:[],index:-1},this.state_changed.emit()},e.prototype.can_undo=function(){return this.state.index>=0},e.prototype.can_redo=function(){return this.state.index<this.state.history.length-1},e.prototype.undo=function(){if(this.can_undo())return this.state.index-=1,this._do_state_change(this.state.index),this.state_changed.emit()},e.prototype.redo=function(){if(this.can_redo())return this.state.index+=1,this._do_state_change(this.state.index),this.state_changed.emit()},e.prototype._do_state_change=function(t){var e,n;if(e=(null!=(n=this.state.history[t])?n.info:void 0)||this._initial_state_info,null!=e.range&&this.update_range(e.range),null!=e.selection)return this.update_selection(e.selection)},e.prototype.get_selection=function(){var t,e,n,i,r,o;for(o=[],n=this.model.plot.renderers,t=0,e=n.length;t<e;t++)i=n[t],i instanceof p.GlyphRenderer&&(r=i.data_source.selected,o[i.id]=r);return o},e.prototype.update_selection=function(t){var e,n,i,r,o,s,a;for(r=this.model.plot.renderers,a=[],n=0,i=r.length;n<i;n++)s=r[n],s instanceof p.GlyphRenderer&&(e=s.data_source,null!=t?(o=s.id,u.call(t,o)>=0?a.push(e.selected=t[s.id]):a.push(void 0)):a.push(e.selection_manager.clear()));return a},e.prototype.reset_selection=function(){return this.update_selection(null)},e.prototype._update_ranges_together=function(t){var e,n,i,r,o,s,a,l;for(l=1,e=0,i=t.length;e<i;e++)u=t[e],a=u[0],o=u[1],l=Math.min(l,this._get_weight_to_constrain_interval(a,o));if(l<1){for(s=[],n=0,r=t.length;n<r;n++)h=t[n],a=h[0],o=h[1],o.start=l*o.start+(1-l)*a.start,s.push(o.end=l*o.end+(1-l)*a.end);return s}var u,h},e.prototype._update_ranges_individually=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f;for(i=!1,o=0,a=t.length;o<a;o++)m=t[o],d=m[0],_=m[1],r=d.start>d.end,n||(f=this._get_weight_to_constrain_interval(d,_),f<1&&(_.start=f*_.start+(1-f)*d.start,_.end=f*_.end+(1-f)*d.end)),null!=d.bounds&&(h=d.bounds[0],u=d.bounds[1],c=Math.abs(_.end-_.start),r?(null!=h&&h>=_.end&&(i=!0,_.end=h,null==e&&null==n||(_.start=h+c)),null!=u&&u<=_.start&&(i=!0,_.start=u,null==e&&null==n||(_.end=u-c))):(null!=h&&h>=_.start&&(i=!0,_.start=h,null==e&&null==n||(_.end=h+c)),null!=u&&u<=_.end&&(i=!0,_.end=u,null==e&&null==n||(_.start=u-c))));if(!n||!i){for(p=[],s=0,l=t.length;s<l;s++)v=t[s],d=v[0],_=v[1],d.have_updated_interactively=!0,d.start!==_.start||d.end!==_.end?p.push(d.setv(_)):p.push(void 0);return p;var m,v}},e.prototype._get_weight_to_constrain_interval=function(t,e){var n,i,r,o,s,a,l,u;return s=t.min_interval,i=t.max_interval,u=1,null!=t.bounds&&(h=t.bounds,o=h[0],n=h[1],null!=o&&null!=n&&(r=Math.abs(n-o),i=null!=i?Math.min(i,r):r)),null==s&&null==i||(l=Math.abs(t.end-t.start),a=Math.abs(e.end-e.start),s>0&&a<s&&(u=(l-s)/(l-a)),i>0&&a>i&&(u=(i-l)/(a-l)),u=Math.max(0,Math.min(1,u))),u;var h},e.prototype.update_range=function(t,e,n){var i,r,o,s,a,l,u;if(this.pause(),null==t){o=this.frame.x_ranges;for(i in o)u=o[i],u.reset();s=this.frame.y_ranges;for(i in s)u=s[i],u.reset();this.update_dataranges()}else{r=[],a=this.frame.x_ranges;for(i in a)u=a[i],r.push([u,t.xrs[i]]);l=this.frame.y_ranges;for(i in l)u=l[i],r.push([u,t.yrs[i]]);n&&this._update_ranges_together(r),this._update_ranges_individually(r,e,n)}return this.unpause()},e.prototype.reset_range=function(){return this.update_range(null)},e.prototype.build_levels=function(){var t,e,n,i,r,o,s,a,l,u,h;for(l=this.model.plot.all_renderers,a=Object.keys(this.renderer_views),s=m.build_views(this.renderer_views,l,this.view_options()),u=A.difference(a,function(){var t,e,n;for(n=[],t=0,e=l.length;t<e;t++)o=l[t],n.push(o.id);return n}()),e=0,i=u.length;e<i;e++)t=u[e],delete this.levels.glyph[t];for(n=0,r=s.length;n<r;n++)h=s[n],this.levels[h.model.level][h.model.id]=h;return this},e.prototype.get_renderer_views=function(){var t,e,n,i,r;for(i=this.model.plot.renderers,r=[],t=0,e=i.length;t<e;t++)n=i[t],r.push(this.levels[n.level][n.id]);return r},e.prototype.build_tools=function(){var t,e,n,i,r,o;for(r=this.model.plot.toolbar.tools,n=m.build_views(this.tool_views,r,this.view_options()),i=[],t=0,e=n.length;t<e;t++)o=n[t],i.push(this.ui_event_bus.register_tool(o));return i},e.prototype.connect_signals=function(){var e,n,i,r,o=this;t.prototype.connect_signals.call(this),this.connect(this.force_paint,function(){return o.repaint()}),n=this.model.frame.x_ranges;for(e in n)r=n[e],this.connect(r.change,function(){return this.request_render()});i=this.model.frame.y_ranges;for(e in i)r=i[e],this.connect(r.change,function(){return this.request_render()});return this.connect(this.model.plot.properties.renderers.change,function(){return o.build_levels()}),this.connect(this.model.plot.toolbar.properties.tools.change,function(){return o.build_levels(),o.build_tools()}),this.connect(this.model.plot.change,function(){return this.request_render()})},e.prototype.set_initial_range=function(){var t,e,n,i,r,o,s;t=!0,o={},n=this.frame.x_ranges;for(e in n){if(r=n[e],null==r.start||null==r.end||O.isStrictNaN(r.start+r.end)){t=!1;break}o[e]={start:r.start,end:r.end}}if(t){s={},i=this.frame.y_ranges;for(e in i){if(r=i[e],null==r.start||null==r.end||O.isStrictNaN(r.start+r.end)){t=!1;break}s[e]={start:r.start,end:r.end}}}return t?(this._initial_state_info.range=this.initial_range_info={xrs:o,yrs:s},k.logger.debug("initial ranges set")):k.logger.warn("could not set initial ranges")},e.prototype.update_constraints=function(){var t,e,n;this.solver.suggest_value(this.frame._width,this.canvas._width.value),this.solver.suggest_value(this.frame._height,this.canvas._height.value),e=this.renderer_views;for(t in e)n=e[t],null!=n.model.panel&&j.update_panel_constraints(n);return this.solver.update_variables()},e.prototype._layout=function(t){if(void 0===t&&(t=!1),this.render(),t)return this.model.plot.setv({inner_width:Math.round(this.frame._width.value),inner_height:Math.round(this.frame._height.value),layout_width:Math.round(this.canvas._width.value),layout_height:Math.round(this.canvas._height.value)},{no_change:!0}),this.paint()},e.prototype.has_finished=function(){var e,n,i,r;if(!t.prototype.has_finished.call(this))return!1;n=this.levels;for(e in n){i=n[e];for(e in i)if(r=i[e],!r.has_finished())return!1}return!0},e.prototype.render=function(){var t,e;return e=this.model._width.value,t=this.model._height.value,this.canvas_view.set_dims([e,t]),this.update_constraints(),this.model.plot.match_aspect!==!1&&0!==this.frame._width.value&&0!==this.frame._height.value&&this.update_dataranges(),this.el.style.position="absolute",this.el.style.left=this.model._dom_left.value+"px",this.el.style.top=this.model._dom_top.value+"px",this.el.style.width=this.model._width.value+"px",this.el.style.height=this.model._height.value+"px"},e.prototype._needs_layout=function(){var t,e,n;e=this.renderer_views;for(t in e)if(n=e[t],null!=n.model.panel&&j._view_sizes.get(n)!==n.get_size())return!0;return!1},e.prototype.repaint=function(){return this._needs_layout()?this.parent.partial_layout():this.paint()},e.prototype.paint=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_=this;if(!this.is_paused){k.logger.trace("PlotCanvas.render() for "+this.model.id),this.canvas_view.prepare_canvas(),null!=this.model.document&&(i=this.model.document.interactive_duration(),i>=0&&i<this.model.plot.lod_interval?(o=this.model.plot.lod_timeout,setTimeout(function(){return _.model.document.interactive_duration()>o&&_.model.document.interactive_stop(_.model.plot),_.request_render()},o)):this.model.document.interactive_stop(this.model.plot)),a=this.renderer_views;for(r in a)if(l=a[r],null==this.range_update_timestamp||l.set_data_timestamp>this.range_update_timestamp){this.update_dataranges();break}return this.model.frame._update_scales(),t=this.canvas_view.ctx,t.pixel_ratio=s=this.canvas.pixel_ratio,t.save(),t.scale(s,s),t.translate(.5,.5),e=[this.frame._left.value,this.frame._top.value,this.frame._width.value,this.frame._height.value],this._map_hook(t,e),this._paint_empty(t,e),this.prepare_webgl(s,e),t.save(),this.visuals.outline_line.doit&&(this.visuals.outline_line.set_value(t),h=e[0],c=e[1],u=e[2],n=e[3],h+u===this.canvas._width.value&&(u-=1),c+n===this.canvas._height.value&&(n-=1),t.strokeRect(h,c,u,n)),t.restore(),this._paint_levels(t,["image","underlay","glyph"],e),this.blit_webgl(s),this._paint_levels(t,["annotation"],e),this._paint_levels(t,["overlay"]),null==this.initial_range_info&&this.set_initial_range(),t.restore(),this._has_finished?void 0:(this._has_finished=!0,this.notify_finished())}},e.prototype._paint_levels=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f,m;for(t.save(),null!=n&&"canvas"===this.model.plot.output_backend&&(t.beginPath(),t.rect.apply(t,n),t.clip()),r={},_=this.model.plot.renderers,i=o=0,a=_.length;o<a;i=++o)p=_[i],r[p.id]=i;for(m=function(t){return r[t.model.id]},s=0,l=e.length;s<l;s++)for(h=e[s],f=A.sortBy(E.values(this.levels[h]),m),c=0,u=f.length;c<u;c++)d=f[c],d.render();return t.restore()},e.prototype._map_hook=function(t,e){},e.prototype._paint_empty=function(t,e){if(t.clearRect(0,0,this.canvas_view.model._width.value,this.canvas_view.model._height.value),this.visuals.border_fill.doit&&(this.visuals.border_fill.set_value(t),t.fillRect(0,0,this.canvas_view.model._width.value,this.canvas_view.model._height.value),t.clearRect.apply(t,e)),this.visuals.background_fill.doit)return this.visuals.background_fill.set_value(t),t.fillRect.apply(t,e)},e.prototype.save=function(t){var e,n,i,r,o,s,a;return"canvas"===(o=this.model.plot.output_backend)||"webgl"===o?(n=this.canvas_view.get_canvas_element(),null!=n.msToBlob?(e=n.msToBlob(),window.navigator.msSaveBlob(e,t)):(r=document.createElement("a"),r.href=n.toDataURL("image/png"),r.download=t+".png",r.target="_blank",r.dispatchEvent(new MouseEvent("click")))):"svg"===this.model.plot.output_backend?(s=this.canvas_view.ctx.getSerializedSvg(!0),a=new Blob([s],{type:"text/plain"}),i=document.createElement("a"),i.download=t+".svg",i.innerHTML="Download svg",i.href=window.URL.createObjectURL(a),i.onclick=function(t){return document.body.removeChild(t.target)},i.style.display="none",document.body.appendChild(i),i.click()):void 0},e}(y.DOMView);n.PlotCanvasView=P,P.prototype.className="bk-plot-wrapper",P.prototype.state={history:[],index:-1},P.getters({canvas_overlays:function(){return this.canvas_view.overlays_el},canvas_events:function(){return this.canvas_view.events_el},is_paused:function(){return null!=this._is_paused&&0!==this._is_paused}}),i=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e}(b.LayoutCanvas);return t.prototype.type="AbovePanel",t}(),r=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e}(b.LayoutCanvas);return t.prototype.type="BelowPanel",t}(),o=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e}(b.LayoutCanvas);return t.prototype.type="LeftPanel",t}(),s=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e}(b.LayoutCanvas);return t.prototype.type="RightPanel",t}();var z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e.prototype.initialize=function(e,n){var a;return t.prototype.initialize.call(this,e,n),this.canvas=new h.Canvas({map:null!=(a=this.use_map)&&a,use_hidpi:this.plot.hidpi,output_backend:this.plot.output_backend}),this.frame=new c.CartesianFrame({x_range:this.plot.x_range,extra_x_ranges:this.plot.extra_x_ranges,x_scale:this.plot.x_scale,y_range:this.plot.y_range,extra_y_ranges:this.plot.extra_y_ranges,y_scale:this.plot.y_scale}),this.above_panel=new i,this.below_panel=new r,this.left_panel=new o,this.right_panel=new s,k.logger.debug("PlotCanvas initialized")},e.prototype._doc_attached=function(){return this.canvas.attach_document(this.document),this.frame.attach_document(this.document),this.above_panel.attach_document(this.document),this.below_panel.attach_document(this.document),this.left_panel.attach_document(this.document),this.right_panel.attach_document(this.document),t.prototype._doc_attached.call(this),k.logger.debug("PlotCanvas attached to document")},e.prototype.get_layoutable_children=function(){var t,e;return t=[this.above_panel,this.below_panel,this.left_panel,this.right_panel,this.canvas,this.frame],e=function(e){var n,i,r,o;for(o=[],n=0,i=e.length;n<i;n++)r=e[n],null!=r.panel?o.push(t.push(r.panel)):o.push(void 0);return o},e(this.plot.above),e(this.plot.below),e(this.plot.left),e(this.plot.right),t},e.prototype.get_constraints=function(){return t.prototype.get_constraints.call(this).concat(this._get_constant_constraints(),this._get_side_constraints())},e.prototype._get_constant_constraints=function(){return[w.EQ(this.canvas._left,0),w.EQ(this.canvas._top,0),w.GE(this.above_panel._top,[-1,this.canvas._top]),w.EQ(this.above_panel._bottom,[-1,this.frame._top]),w.EQ(this.above_panel._left,[-1,this.left_panel._right]),w.EQ(this.above_panel._right,[-1,this.right_panel._left]),w.EQ(this.below_panel._top,[-1,this.frame._bottom]),w.LE(this.below_panel._bottom,[-1,this.canvas._bottom]),w.EQ(this.below_panel._left,[-1,this.left_panel._right]),w.EQ(this.below_panel._right,[-1,this.right_panel._left]),w.EQ(this.left_panel._top,[-1,this.above_panel._bottom]),w.EQ(this.left_panel._bottom,[-1,this.below_panel._top]),w.GE(this.left_panel._left,[-1,this.canvas._left]),w.EQ(this.left_panel._right,[-1,this.frame._left]),w.EQ(this.right_panel._top,[-1,this.above_panel._bottom]),w.EQ(this.right_panel._bottom,[-1,this.below_panel._top]),w.EQ(this.right_panel._left,[-1,this.frame._right]),w.LE(this.right_panel._right,[-1,this.canvas._right]),w.EQ(this._top,[-1,this.above_panel._bottom]),w.EQ(this._left,[-1,this.left_panel._right]),w.EQ(this._height,[-1,this._bottom],[-1,this.canvas._bottom],this.below_panel._top),w.EQ(this._width,[-1,this._right],[-1,this.canvas._right],this.right_panel._left),w.GE(this._top,-this.plot.min_border_top),w.GE(this._left,-this.plot.min_border_left),w.GE(this._height,[-1,this._bottom],-this.plot.min_border_bottom),w.GE(this._width,[-1,this._right],-this.plot.min_border_right)]},e.prototype._get_side_constraints=function(){var t,e,n,i,r;return i=function(t){var e,n,i,r;for(r=[],e=0,n=t.length;e<n;e++)i=t[e],r.push(i.panel);return r},t=x.vstack(this.above_panel,i(this.plot.above)),e=x.vstack(this.below_panel,A.reversed(i(this.plot.below))),n=x.hstack(this.left_panel,i(this.plot.left)),r=x.hstack(this.right_panel,A.reversed(i(this.plot.right))),[].concat(t,e,n,r)},e}(d.LayoutDOM);n.PlotCanvas=z,z.prototype.type="PlotCanvas",z.prototype.default_view=P,z.override({sizing_mode:"stretch_both"}),z.internal({plot:[S.Instance],toolbar:[S.Instance],canvas:[S.Instance],frame:[S.Instance]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(159),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Range);n.DataRange=s,s.prototype.type="DataRange",s.define({names:[o.Array,[]],renderers:[o.Array,[]]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(155),o=t(161),s=t(14),a=t(15),l=t(23),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.plot_bounds={},this.have_updated_interactively=!1,this._initial_start=this.start,this._initial_end=this.end,this._initial_range_padding=this.range_padding,this._initial_range_padding_units=this.range_padding_units,this._initial_follow=this.follow,this._initial_follow_interval=this.follow_interval,this._initial_default_span=this.default_span},e.prototype.computed_renderers=function(){var t,e,n,i,r,a,l,u,h,c,_;if(a=this.names,c=this.renderers,0===c.length)for(h=this.plots,e=0,i=h.length;e<i;e++)l=h[e],t=l.renderers,_=function(){var e,n,i;for(i=[],e=0,n=t.length;e<n;e++)u=t[e],u instanceof o.GlyphRenderer&&i.push(u);return i}(),c=c.concat(_);for(a.length>0&&(c=function(){var t,e,n;for(n=[],t=0,e=c.length;t<e;t++)u=c[t],a.indexOf(u.name)>=0&&n.push(u);return n}()),s.logger.debug("computed "+c.length+" renderers for DataRange1d "+this.id),n=0,r=c.length;n<r;n++)u=c[n],s.logger.trace(" - "+u.type+" "+u.id);return c},e.prototype._compute_plot_bounds=function(t,e){var n,i,r,o;for(o=l.empty(),n=0,i=t.length;n<i;n++)r=t[n],null!=e[r.id]&&(o=l.union(o,e[r.id]));return o},e.prototype._compute_min_max=function(t,e){var n,i,r,o,s;o=l.empty();for(n in t)s=t[n],o=l.union(o,s);return 0===e?(a=[o.minX,o.maxX],r=a[0],i=a[1]):(u=[o.minY,o.maxY],r=u[0],i=u[1]),[r,i];var a,u},e.prototype._compute_range=function(t,e){var n,i,r,o,a,l,u,h,c,_;return u=null!=(h=this.range_padding)?h:0,"log"===this.scale_hint?((isNaN(t)||!isFinite(t)||t<=0)&&(t=isNaN(e)||!isFinite(e)||e<=0?.1:e/100,s.logger.warn("could not determine minimum data value for log axis, DataRange1d using value "+t)),(isNaN(e)||!isFinite(e)||e<=0)&&(e=isNaN(t)||!isFinite(t)||t<=0?10:100*t,s.logger.warn("could not determine maximum data value for log axis, DataRange1d using value "+e)),e===t?(c=this.default_span+.001,n=Math.log(t)/Math.log(10)):("percent"===this.range_padding_units?(l=Math.log(t)/Math.log(10),a=Math.log(e)/Math.log(10),c=(a-l)*(1+u)):(l=Math.log(t-u)/Math.log(10),a=Math.log(e+u)/Math.log(10),c=a-l),n=(l+a)/2),p=[Math.pow(10,n-c/2),Math.pow(10,n+c/2)],_=p[0],i=p[1]):(c=e===t?this.default_span:"percent"===this.range_padding_units?(e-t)*(1+u):e-t+2*u,n=(e+t)/2,d=[n-c/2,n+c/2],_=d[0],i=d[1]),o=1,this.flipped&&(f=[i,_],_=f[0],i=f[1],o=-1),r=this.follow_interval,null!=r&&Math.abs(_-i)>r&&("start"===this.follow?i=_+o*r:"end"===this.follow&&(_=i-o*r)),[_,i];var p,d,f},e.prototype.update=function(t,e,n){var i,r,o,s,a,l,u,h;if(!this.have_updated_interactively){return u=this.computed_renderers(),this.plot_bounds[n]=this._compute_plot_bounds(u,t),c=this._compute_min_max(this.plot_bounds,e),a=c[0],s=c[1],_=this._compute_range(a,s),h=_[0],o=_[1],null!=this._initial_start&&("log"===this.scale_hint?this._initial_start>0&&(h=this._initial_start):h=this._initial_start),null!=this._initial_end&&("log"===this.scale_hint?this._initial_end>0&&(o=this._initial_end):o=this._initial_end),p=[this.start,this.end],r=p[0],i=p[1],h===r&&o===i||(l={},h!==r&&(l.start=h),o!==i&&(l.end=o),this.setv(l)),"auto"===this.bounds&&this.setv({bounds:[h,o]},{silent:!0}),this.change.emit();var c,_,p}},e.prototype.reset=function(){return this.have_updated_interactively=!1,this.setv({range_padding:this._initial_range_padding,range_padding_units:this._initial_range_padding_units,follow:this._initial_follow,follow_interval:this._initial_follow_interval,default_span:this._initial_default_span},{silent:!0}),this.change.emit()},e}(r.DataRange);n.DataRange1d=u,u.prototype.type="DataRange1d",u.define({start:[a.Number],end:[a.Number],range_padding:[a.Number,.1],range_padding_units:[a.PaddingUnits,"percent"],flipped:[a.Bool,!1],follow:[a.StartEnd],follow_interval:[a.Number],default_span:[a.Number,2],bounds:[a.Any],min_interval:[a.Any],max_interval:[a.Any]}),u.internal({scale_hint:[a.String,"auto"]}),u.getters({min:function(){return Math.min(this.start,this.end)},max:function(){return Math.max(this.start,this.end)}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(159),o=t(15),s=t(22),a=t(42);n.map_one_level=function(t,e,n){void 0===n&&(n=0);var i,r,o,s,a;for(a={},r=o=0,s=t.length;o<s;r=++o){if(i=t[r],i in a)throw new Error("duplicate factor or subfactor "+i);a[i]={value:.5+r*(1+e)+n}}return[a,(t.length-1)*e]},n.map_two_levels=function(t,e,i,r){void 0===r&&(r=0);var o,a,l,u,h,c,_,p,d,f,m,v,g,y,b;for(_={},g={},y=[],l=0,h=t.length;l<h;l++)x=t[l],o=x[0],a=x[1],o in g||(g[o]=[],y.push(o)),g[o].push(a);for(f=r,b=0,u=0,c=y.length;u<c;u++)o=y[u],p=g[o].length,w=n.map_one_level(g[o],i,f),d=w[0],m=w[1],b+=m,v=s.sum(function(){var t,e,n,i;for(n=g[o],i=[],t=0,e=n.length;t<e;t++)a=n[t],i.push(d[a].value);return i}()),_[o]={value:v/p,mapping:d},f+=p+e+m;return[_,y,(y.length-1)*e+b];var x,w},n.map_three_levels=function(t,e,i,r,o){void 0===o&&(o=0);var a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T;for(m={},M={},S=[],h=0,p=t.length;h<p;h++)O=t[h],a=O[0],l=O[1],u=O[2],a in M||(M[a]=[],S.push(a)),M[a].push([l,u]);for(v=[],x=o,T=0,c=0,d=S.length;c<d;c++){for(a=S[c],g=M[a].length,A=n.map_two_levels(M[a],i,r,x),y=A[0],b=A[1],w=A[2],_=0,f=b.length;_<f;_++)l=b[_],v.push([a,l]);T+=w,k=s.sum(function(){var t,e,n,i;for(n=M[a],i=[],e=0,t=n.length;e<t;e++)r=n[e],l=r[0],u=r[1],i.push(y[l].value);return i;var r}()),m[a]={value:k/g,mapping:y},x+=g+e+w}return[m,S,v,(S.length-1)*e+T];var O,A};var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._init(),this.connect(this.properties.factors.change,function(){return this._init()}),this.connect(this.properties.factor_padding.change,function(){return this._init()}),this.connect(this.properties.group_padding.change,function(){return this._init()}),this.connect(this.properties.subgroup_padding.change,function(){return this._init()}),this.connect(this.properties.range_padding.change,function(){return this._init()}),this.connect(this.properties.range_padding_units.change,function(){return this._init()})},e.prototype.reset=function(){return this._init(),this.change.emit()},e.prototype.synthetic=function(t){var e;return a.isNumber(t)?t:a.isString(t)?this._lookup([t]):(e=0,a.isNumber(t[t.length-1])&&(e=t[t.length-1],t=t.slice(0,-1)),this._lookup(t)+e)},e.prototype.v_synthetic=function(t){var e,n;return e=function(){var e,i,r;for(r=[],e=0,i=t.length;e<i;e++)n=t[e],r.push(this.synthetic(n));return r}.call(this)},e.prototype._init=function(){var t,e,i,r,o;if(s.all(this.factors,a.isString))r=1,l=n.map_one_level(this.factors,this.factor_padding),this._mapping=l[0],i=l[1];else if(s.all(this.factors,function(t){return a.isArray(t)&&2===t.length&&a.isString(t[0])&&a.isString(t[1])}))r=2,u=n.map_two_levels(this.factors,this.group_padding,this.factor_padding),this._mapping=u[0],this.tops=u[1],i=u[2];else{if(!s.all(this.factors,function(t){return a.isArray(t)&&3===t.length&&a.isString(t[0])&&a.isString(t[1])&&a.isString(t[2])}))throw new Error("");r=3,h=n.map_three_levels(this.factors,this.group_padding,this.subgroup_padding,this.factor_padding),this._mapping=h[0],this.tops=h[1],this.mids=h[2],i=h[3]}if(o=0,t=this.factors.length+i,"percent"===this.range_padding_units?(e=(t-o)*this.range_padding/2,o-=e,t+=e):(o-=this.range_padding,t+=this.range_padding),this.setv({start:o,end:t,levels:r},{silent:!0}),"auto"===this.bounds)return this.setv({bounds:[o,t]},{silent:!0});var l,u,h},e.prototype._lookup=function(t){return 1===t.length?this._mapping[t[0]].value:2===t.length?this._mapping[t[0]].mapping[t[1]].value:3===t.length?this._mapping[t[0]].mapping[t[1]].mapping[t[2]].value:void 0},e}(r.Range);n.FactorRange=l,l.prototype.type="FactorRange",l.define({factors:[o.Array,[]],factor_padding:[o.Number,0],subgroup_padding:[o.Number,.8],group_padding:[o.Number,1.4],range_padding:[o.Number,0],range_padding_units:[o.PaddingUnits,"percent"],start:[o.Number],end:[o.Number],bounds:[o.Any],min_interval:[o.Any],max_interval:[o.Any]}),l.getters({min:function(){return this.start},max:function(){return this.end}}),l.internal({levels:[o.Number],mids:[o.Array],tops:[o.Array],tops_groups:[o.Array]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(155);n.DataRange=i.DataRange;var r=t(156);n.DataRange1d=r.DataRange1d;var o=t(157);n.FactorRange=o.FactorRange;var s=t(159);n.Range=s.Range;var a=t(160);n.Range1d=a.Range1d},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50),o=t(15),s=t(42),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.change,function(){return this._emit_callback()})},e.prototype.reset=function(){return this.change.emit()},e.prototype._emit_callback=function(){if(null!=this.callback)return s.isFunction(this.callback)?this.callback(this):this.callback.execute(this)},e}(r.Model);n.Range=a,a.prototype.type="Range",a.define({callback:[o.Any]}),a.internal({plots:[o.Array,[]]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(159),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._set_auto_bounds=function(){var t,e;if("auto"===this.bounds)return e=Math.min(this._initial_start,this._initial_end),t=Math.max(this._initial_start,this._initial_end),this.setv({bounds:[e,t]},{silent:!0})},e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._initial_start=this.start,this._initial_end=this.end,this._set_auto_bounds()},e.prototype.reset=function(){return this._set_auto_bounds(),this.start!==this._initial_start||this.end!==this._initial_end?this.setv({start:this._initial_start,end:this._initial_end}):this.change.emit()},e}(r.Range);n.Range1d=s,s.prototype.type="Range1d",s.define({start:[o.Number,0],end:[o.Number,1],bounds:[o.Any],min_interval:[o.Any],max_interval:[o.Any]}),s.getters({min:function(){return Math.min(this.start,this.end)},max:function(){return Math.max(this.start,this.end)},is_reversed:function(){return this.start>this.end}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=[].indexOf,o=t(165),s=t(114),a=t(178),l=t(172),u=t(14),h=t(15),c=t(22),_=t(30);n.GlyphRendererView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n,i,o,s,l,u,h,c,p,d;if(t.prototype.initialize.call(this,e),n=this.model.glyph,s=r.call(n.mixins,"fill")>=0,l=r.call(n.mixins,"line")>=0,o=_.clone(n.attributes),delete o.id,h=function(t){var e;return e=_.clone(o),s&&_.extend(e,t.fill),l&&_.extend(e,t.line),new n.constructor(e)},this.glyph=this.build_glyph_view(n),d=this.model.selection_glyph,null==d?d=h({fill:{},line:{}}):"auto"===d&&(d=h(this.model.selection_defaults)),this.selection_glyph=this.build_glyph_view(d),p=this.model.nonselection_glyph,null==p?p=h({fill:{},line:{}}):"auto"===p&&(p=h(this.model.nonselection_defaults)),this.nonselection_glyph=this.build_glyph_view(p),u=this.model.hover_glyph,null!=u&&(this.hover_glyph=this.build_glyph_view(u)),c=this.model.muted_glyph,null!=c&&(this.muted_glyph=this.build_glyph_view(c)),i=h(this.model.decimated_defaults),this.decimated_glyph=this.build_glyph_view(i),this.xscale=this.plot_view.frame.xscales[this.model.x_range_name],this.yscale=this.plot_view.frame.yscales[this.model.y_range_name],this.set_data(!1),this.model.data_source instanceof a.RemoteDataSource)return this.model.data_source.setup()},e.prototype.build_glyph_view=function(t){return new t.default_view({model:t,renderer:this,plot_view:this.plot_view,parent:this})},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()}),this.connect(this.model.glyph.change,function(){
  return this.set_data()}),this.connect(this.model.data_source.change,function(){return this.set_data()}),this.connect(this.model.data_source.streaming,function(){return this.set_data()}),this.connect(this.model.data_source.patching,function(t){return this.set_data(!0,t)}),this.connect(this.model.data_source.select,function(){return this.request_render()}),null!=this.hover_glyph&&this.connect(this.model.data_source.inspect,function(){return this.request_render()}),this.connect(this.model.properties.view.change,function(){return this.set_data()}),this.connect(this.model.view.change,function(){return this.set_data()}),this.connect(this.model.glyph.transformchange,function(){return this.set_data()})},e.prototype.have_selection_glyphs=function(){return null!=this.selection_glyph&&null!=this.nonselection_glyph},e.prototype.set_data=function(t,e){void 0===t&&(t=!0);var n,i,r,o,s,a,l;for(l=Date.now(),a=this.model.data_source,this.all_indices=this.model.view.indices,this.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),this.glyph.set_data(a,this.all_indices,e),this.glyph.set_visuals(a),this.decimated_glyph.set_visuals(a),this.have_selection_glyphs()&&(this.selection_glyph.set_visuals(a),this.nonselection_glyph.set_visuals(a)),null!=this.hover_glyph&&this.hover_glyph.set_visuals(a),null!=this.muted_glyph&&this.muted_glyph.set_visuals(a),o=this.plot_model.plot.lod_factor,this.decimated=[],i=r=0,s=Math.floor(this.all_indices.length/o);0<=s?r<s:r>s;i=0<=s?++r:--r)this.decimated.push(i*o);if(n=Date.now()-l,u.logger.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): set_data finished in "+n+"ms"),this.set_data_timestamp=Date.now(),t)return this.request_render()},e.prototype.render=function(){var t,e,n,i,o,a,l,h,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j,P,z,C,N;if(this.model.visible){if(j=Date.now(),l=this.glyph.glglyph,P=Date.now(),this.glyph.map_data(),e=Date.now()-j,z=Date.now(),p=this.glyph.mask_data(this.all_indices),p.length===this.all_indices.length&&(p=function(){T=[];for(var t=0,e=this.all_indices.length;0<=e?t<e:t>e;0<=e?t++:t--)T.push(t);return T}.apply(this)),n=Date.now()-z,t=this.plot_view.canvas_view.ctx,t.save(),O=this.model.data_source.selected,O=O&&0!==O.length?O["0d"].glyph?this.model.view.convert_indices_from_subset(p):O["1d"].indices.length>0?O["1d"].indices:function(){var t,e,n,i;for(n=Object.keys(O["2d"].indices),i=[],t=0,e=n.length;t<e;t++)_=n[t],i.push(parseInt(_));return i}():[],d=this.model.data_source.inspected,d=d&&0!==d.length?d["0d"].glyph?this.model.view.convert_indices_from_subset(p):d["1d"].indices.length>0?d["1d"].indices:function(){var t,e,n,i;for(n=Object.keys(d["2d"].indices),i=[],t=0,e=n.length;t<e;t++)_=n[t],i.push(parseInt(_));return i}():[],d=function(){var t,e,n,i;for(i=[],t=0,e=p.length;t<e;t++)_=p[t],n=this.all_indices[_],r.call(d,n)>=0&&i.push(_);return i}.call(this),b=this.plot_model.plot.lod_threshold,(null!=(M=this.model.document)?M.interactive_duration():void 0)>0&&!l&&null!=b&&this.all_indices.length>b?(p=this.decimated,h=this.decimated_glyph,k=this.decimated_glyph,E=this.selection_glyph):(h=this.model.muted&&null!=this.muted_glyph?this.muted_glyph:this.glyph,k=this.nonselection_glyph,E=this.selection_glyph),null!=this.hover_glyph&&d.length&&(p=c.difference(p,d)),O.length&&this.have_selection_glyphs()){for(N=Date.now(),A={},f=0,v=O.length;f<v;f++)_=O[f],A[_]=!0;if(O=new Array,w=new Array,this.glyph instanceof s.LineView)for(S=this.all_indices,m=0,g=S.length;m<g;m++)_=S[m],null!=A[_]?O.push(_):w.push(_);else for(x=0,y=p.length;x<y;x++)_=p[x],null!=A[this.all_indices[_]]?O.push(_):w.push(_);o=Date.now()-N,C=Date.now(),k.render(t,w,this.glyph),E.render(t,O,this.glyph),null!=this.hover_glyph&&(this.glyph instanceof s.LineView?this.hover_glyph.render(t,this.model.view.convert_indices_from_subset(d),this.glyph):this.hover_glyph.render(t,d,this.glyph)),i=Date.now()-C}else C=Date.now(),this.glyph instanceof s.LineView?this.hover_glyph&&d.length?this.hover_glyph.render(t,this.model.view.convert_indices_from_subset(d),this.glyph):h.render(t,this.all_indices,this.glyph):(h.render(t,p,this.glyph),this.hover_glyph&&d.length&&this.hover_glyph.render(t,d,this.glyph)),i=Date.now()-C;return this.last_dtrender=i,a=Date.now()-j,u.logger.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): render finished in "+a+"ms"),u.logger.trace(" - map_data finished in       : "+e+"ms"),null!=n&&u.logger.trace(" - mask_data finished in      : "+n+"ms"),null!=o&&u.logger.trace(" - selection mask finished in : "+o+"ms"),u.logger.trace(" - glyph renders finished in  : "+i+"ms"),t.restore()}},e.prototype.draw_legend=function(t,e,n,i,r,o,s){var a;return a=this.model.get_reference_point(o,s),this.glyph.draw_legend_for_index(t,e,n,i,r,a)},e.prototype.hit_test=function(t,e,n,i){return void 0===i&&(i="select"),this.model.hit_test_helper(t,this,e,n,i)},e}(o.RendererView);var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),null==this.view.source)return this.view.source=this.data_source,this.view.compute_indices()},e.prototype.get_reference_point=function(t,e){var n,i,r;return r=0,null!=t&&null!=this.data_source.get_column&&(n=this.data_source.get_column(t),n&&(i=n.indexOf(e),i>0&&(r=i))),r},e.prototype.hit_test_helper=function(t,e,n,i,r){var o,s,a,l;return!!this.visible&&(o=e.glyph.hit_test(t),null!==o&&(s=this.view.convert_selection_from_subset(o),"select"===r?(l=this.data_source.selection_manager.selector,l.update(s,n,i),this.data_source.selected=l.indices,this.data_source.select.emit()):(a=this.data_source.selection_manager.get_or_create_inspector(this),a.update(s,!0,!1,!0),this.data_source.setv({inspected:a.indices},{silent:!0}),this.data_source.inspect.emit([e,{geometry:t}])),!s.is_empty()))},e.prototype.get_selection_manager=function(){return this.data_source.selection_manager},e}(o.Renderer);n.GlyphRenderer=p,p.prototype.default_view=n.GlyphRendererView,p.prototype.type="GlyphRenderer",p.define({x_range_name:[h.String,"default"],y_range_name:[h.String,"default"],data_source:[h.Instance],view:[h.Instance,function(){return new l.CDSView}],glyph:[h.Instance],hover_glyph:[h.Instance],nonselection_glyph:[h.Any,"auto"],selection_glyph:[h.Any,"auto"],muted_glyph:[h.Instance],muted:[h.Bool,!1]}),p.override({level:"glyph"}),p.prototype.selection_defaults={fill:{},line:{}},p.prototype.decimated_defaults={fill:{fill_alpha:.3,fill_color:"grey"},line:{line_alpha:.3,line_color:"grey"}},p.prototype.nonselection_defaults={fill:{fill_alpha:.2,line_alpha:.2},line:{}}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(165),o=t(129),s=t(15),a=t(4);n.GraphRendererView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.xscale=this.plot_view.frame.xscales["default"],this.yscale=this.plot_view.frame.yscales["default"],this._renderer_views={},n=a.build_views(this._renderer_views,[this.model.node_renderer,this.model.edge_renderer],this.plot_view.view_options()),this.node_view=n[0],this.edge_view=n[1],this.set_data();var n},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.layout_provider.change,function(){return this.set_data()}),this.connect(this.model.node_renderer.data_source.select,function(){return this.set_data()}),this.connect(this.model.node_renderer.data_source.inspect,function(){return this.set_data()}),this.connect(this.model.node_renderer.data_source.change,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.select,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.inspect,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.change,function(){return this.set_data()})},e.prototype.set_data=function(t){if(void 0===t&&(t=!0),this.node_view.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),this.edge_view.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),e=this.model.layout_provider.get_node_coordinates(this.model.node_renderer.data_source),this.node_view.glyph._x=e[0],this.node_view.glyph._y=e[1],n=this.model.layout_provider.get_edge_coordinates(this.model.edge_renderer.data_source),this.edge_view.glyph._xs=n[0],this.edge_view.glyph._ys=n[1],this.node_view.glyph.index=this.node_view.glyph._index_data(),this.edge_view.glyph.index=this.edge_view.glyph._index_data(),t)return this.request_render();var e,n},e.prototype.render=function(){return this.edge_view.render(),this.node_view.render()},e.prototype.hit_test=function(t,e,n,i){void 0===i&&(i="select");var r,o,s;return!!this.model.visible&&(r=!1,r="select"===i?null!=(o=this.model.selection_policy)?o.do_selection(t,this,e,n):void 0:null!=(s=this.model.inspection_policy)?s.do_inspection(t,this,e,n):void 0)},e}(r.RendererView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_selection_manager=function(){return this.node_renderer.data_source.selection_manager},e}(r.Renderer);n.GraphRenderer=l,l.prototype.default_view=n.GraphRendererView,l.prototype.type="GraphRenderer",l.define({x_range_name:[s.String,"default"],y_range_name:[s.String,"default"],layout_provider:[s.Instance],node_renderer:[s.Instance],edge_renderer:[s.Instance],selection_policy:[s.Instance,function(){return new o.NodesOnly}],inspection_policy:[s.Instance,function(){return new o.NodesOnly}]}),l.override({level:"glyph"})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(165),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Renderer);n.GuideRenderer=s,s.prototype.type="GuideRenderer",s.define({plot:[o.Instance]}),s.override({level:"overlay"})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(161);n.GlyphRenderer=i.GlyphRenderer;var r=t(162);n.GraphRenderer=r.GraphRenderer;var o=t(163);n.GuideRenderer=o.GuideRenderer;var s=t(165);n.Renderer=s.Renderer},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(6),o=t(46),s=t(15),a=t(32),l=t(30),u=t(50),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view=e.plot_view,this.visuals=new o.Visuals(this.model),this._has_finished=!0},e.prototype.request_render=function(){return this.plot_view.request_render()},e.prototype.set_data=function(t){var e;if(e=this.model.materialize_dataspecs(t),l.extend(this,e),this.plot_model.use_map&&(null!=this._x&&(n=a.project_xy(this._x,this._y),this._x=n[0],this._y=n[1]),null!=this._xs))return i=a.project_xsys(this._xs,this._ys),this._xs=i[0],this._ys=i[1],i;var n,i},e.prototype.map_to_screen=function(t,e){return this.plot_view.map_to_screen(t,e,this.model.x_range_name,this.model.y_range_name)},e}(r.DOMView);n.RendererView=h,h.getters({plot_model:function(){return this.plot_view.model}});var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(u.Model);n.Renderer=c,c.prototype.type="Renderer",c.define({level:[s.RenderLevel,null],visible:[s.Bool,!0]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(168),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(e){return t.prototype.compute.call(this,this.source_range.synthetic(e))},e.prototype.v_compute=function(e){return t.prototype.v_compute.call(this,this.source_range.v_synthetic(e))},e}(r.LinearScale);n.CategoricalScale=o,o.prototype.type="CategoricalScale"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(166);n.CategoricalScale=i.CategoricalScale;var r=t(168);n.LinearScale=r.LinearScale;var o=t(169);n.LogScale=o.LogScale;var s=t(170);n.Scale=s.Scale},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(170),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){var e,n;return i=this._compute_state(),e=i[0],n=i[1],e*t+n;var i},e.prototype.v_compute=function(t){var e,n,i,r,o,s,a;for(l=this._compute_state(),e=l[0],o=l[1],s=new Float64Array(t.length),i=n=0,r=t.length;n<r;i=++n)a=t[i],s[i]=e*a+o;return s;var l},e.prototype.invert=function(t){var e,n;return i=this._compute_state(),e=i[0],n=i[1],(t-n)/e;var i},e.prototype.v_invert=function(t){var e,n,i,r,o,s,a;for(l=this._compute_state(),e=l[0],o=l[1],s=new Float64Array(t.length),i=n=0,r=t.length;n<r;i=++n)a=t[i],s[i]=(a-o)/e;return s;var l},e.prototype._compute_state=function(){var t,e,n,i,r,o;return i=this.source_range.start,n=this.source_range.end,o=this.target_range.start,r=this.target_range.end,t=(r-o)/(n-i),e=-(t*i)+o,[t,e]},e}(r.Scale);n.LinearScale=o,o.prototype.type="LinearScale"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(170),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){var e,n,i,r,o,s;return a=this._compute_state(),n=a[0],o=a[1],i=a[2],r=a[3],0===i?s=0:(e=(Math.log(t)-r)/i,s=isFinite(e)?e*n+o:NaN),s;var a},e.prototype.v_compute=function(t){var e,n,i,r,o,s,a,l,u,h,c,_;if(p=this._compute_state(),n=p[0],l=p[1],r=p[2],o=p[3],c=new Float64Array(t.length),0===r)for(i=s=0,u=t.length;0<=u?s<u:s>u;i=0<=u?++s:--s)c[i]=0;else for(i=a=0,h=t.length;0<=h?a<h:a>h;i=0<=h?++a:--a)e=(Math.log(t[i])-o)/r,_=isFinite(e)?e*n+l:NaN,c[i]=_;return c;var p},e.prototype.invert=function(t){var e,n,i,r,o;return s=this._compute_state(),e=s[0],r=s[1],n=s[2],i=s[3],o=(t-r)/e,Math.exp(n*o+i);var s},e.prototype.v_invert=function(t){var e,n,i,r,o,s,a,l,u;for(h=this._compute_state(),e=h[0],s=h[1],i=h[2],r=h[3],l=new Float64Array(t.length),n=o=0,a=t.length;0<=a?o<a:o>a;n=0<=a?++o:--o)u=(t[n]-s)/e,l[n]=Math.exp(i*u+r);return l;var h},e.prototype._get_safe_factor=function(t,e){var n,i,r;return r=t<0?0:t,n=e<0?0:e,r===n&&(0===r?(o=[1,10],r=o[0],n=o[1]):(i=Math.log(r)/Math.log(10),r=Math.pow(10,Math.floor(i)),n=Math.ceil(i)!==Math.floor(i)?Math.pow(10,Math.ceil(i)):Math.pow(10,Math.ceil(i)+1))),[r,n];var o},e.prototype._compute_state=function(){var t,e,n,i,r,o,s,a,l,u,h;return a=this.source_range.start,s=this.source_range.end,h=this.target_range.start,u=this.target_range.end,o=u-h,c=this._get_safe_factor(a,s),l=c[0],t=c[1],0===l?(n=Math.log(t),i=0):(n=Math.log(t)-Math.log(l),i=Math.log(l)),e=o,r=h,[e,r,n,i];var c},e}(r.Scale);n.LogScale=o,o.prototype.type="LogScale"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(238),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){},e.prototype.v_compute=function(t){},e.prototype.invert=function(t){},e.prototype.v_invert=function(t){},e.prototype.r_compute=function(t,e){return this.target_range.is_reversed?[this.compute(e),this.compute(t)]:[this.compute(t),this.compute(e)]},e.prototype.r_invert=function(t,e){return this.target_range.is_reversed?[this.invert(e),this.invert(t)]:[this.invert(t),this.invert(e)]},e}(r.Transform);n.Scale=s,s.prototype.type="Scale",s.internal({source_range:[o.Any],target_range:[o.Any]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},o=t(178),s=t(14),a=t(15),l=function(t){function e(){var e=t.apply(this,arguments)||this;return e.destroy=e.destroy.bind(e),e.setup=e.setup.bind(e),e.get_data=e.get_data.bind(e),e}return i.__extends(e,t),e.prototype.destroy=function(){if(r(this,e),null!=this.interval)return clearInterval(this.interval)},e.prototype.setup=function(){if(r(this,e),null==this.initialized&&(this.initialized=!0,this.get_data(this.mode),this.polling_interval))return this.interval=setInterval(this.get_data,this.polling_interval,this.mode,this.max_size,this.if_modified)},e.prototype.get_data=function(t,n,i){var o=this;void 0===n&&(n=0),void 0===i&&(i=!1);var a,l,u,h;r(this,e),h=new XMLHttpRequest,h.open(this.method,this.data_url,!0),h.withCredentials=!1,h.setRequestHeader("Content-Type",this.content_type),l=this.http_headers;for(a in l)u=l[a],h.setRequestHeader(a,u);return h.addEventListener("load",function(){var e,i,r,s,a,l;if(200===h.status)switch(i=JSON.parse(h.responseText),t){case"replace":return o.data=i;case"append":for(a=o.data,l=o.columns(),r=0,s=l.length;r<s;r++)e=l[r],i[e]=a[e].concat(i[e]).slice(-n);return o.data=i}}),h.addEventListener("error",function(){return s.logger.error("Failed to fetch JSON from "+o.data_url+" with code "+h.status)}),h.send(),null},e}(o.RemoteDataSource);n.AjaxDataSource=l,l.prototype.type="AjaxDataSource",l.define({mode:[a.String,"replace"],content_type:[a.String,"application/json"],http_headers:[a.Any,{}],max_size:[a.Number],method:[a.String,"POST"],if_modified:[a.Bool,!1]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50),o=t(15),s=t(9),a=t(22),l=t(174),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.compute_indices()},e.prototype.connect_signals=function(){var e,n,i;if(t.prototype.connect_signals.call(this),this.connect(this.properties.filters.change,function(){return this.compute_indices(),this.change.emit()}),null!=(null!=(e=this.source)?e.change:void 0)&&this.connect(this.source.change,function(){return this.compute_indices()}),null!=(null!=(n=this.source)?n.streaming:void 0)&&this.connect(this.source.streaming,function(){return this.compute_indices()}),null!=(null!=(i=this.source)?i.patching:void 0))return this.connect(this.source.patching,function(){return this.compute_indices()})},e.prototype.compute_indices=function(){var t,e,n,i;return e=function(){var e,n,i,r;for(i=this.filters,r=[],e=0,n=i.length;e<n;e++)t=i[e],r.push(t.compute_indices(this.source));return r}.call(this),e=function(){var t,i,r;for(r=[],t=0,i=e.length;t<i;t++)n=e[t],null!=n&&r.push(n);return r}(),e.length>0?this.indices=a.intersection.apply(this,e):this.source instanceof l.ColumnarDataSource&&(this.indices=null!=(i=this.source)?i.get_indices():void 0),this.indices_map_to_subset()},e.prototype.indices_map_to_subset=function(){var t,e,n,i;for(this.indices_map={},i=[],t=e=0,n=this.indices.length;0<=n?e<n:e>n;t=0<=n?++e:--e)i.push(this.indices_map[this.indices[t]]=t);return i},e.prototype.convert_selection_from_subset=function(t){var e,n,i;return i=s.create_hit_test_result(),i.update_through_union(t),n=function(){var n,i,r,o;for(r=t["1d"].indices,o=[],n=0,i=r.length;n<i;n++)e=r[n],o.push(this.indices[e]);return o}.call(this),i["1d"].indices=n,i},e.prototype.convert_selection_to_subset=function(t){var e,n,i;return i=s.create_hit_test_result(),i.update_through_union(t),n=function(){var n,i,r,o;for(r=t["1d"].indices,o=[],n=0,i=r.length;n<i;n++)e=r[n],o.push(this.indices_map[e]);return o}.call(this),i["1d"].indices=n,i},e.prototype.convert_indices_from_subset=function(t){var e;return function(){var n,i,r;for(r=[],n=0,i=t.length;n<i;n++)e=t[n],r.push(this.indices[e]);return r}.call(this)},e}(r.Model);n.CDSView=u,u.prototype.type="CDSView",u.define({filters:[o.Array,[]],source:[o.Instance]}),u.internal({indices:[o.Array,[]],indices_map:[o.Any,{}]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r={}.hasOwnProperty,o=t(174),s=t(8),a=t(15),l=t(27),u=t(35),h=t(42);n.concat_typed_arrays=function(t,e){var n;return n=new t.constructor(t.length+e.length),n.set(t,0),n.set(e,t.length),n},n.stream_to_column=function(t,e,i){var r,o,s,a,l,u,h,c,_,p;if(null!=t.concat)return t=t.concat(e),t.length>i&&(t=t.slice(-i)),t;if(p=t.length+e.length,null!=i&&p>i){for(c=p-i,r=t.length,t.length<i&&(_=new t.constructor(i),_.set(t,0),t=_),o=s=l=c,u=r;l<=u?s<u:s>u;o=l<=u?++s:--s)t[o-c]=t[o];for(o=a=0,h=e.length;0<=h?a<h:a>h;o=0<=h?++a:--a)t[o+(r-c)]=e[o];return t}return _=new t.constructor(e),n.concat_typed_arrays(t,_)},n.slice=function(t,e){var n,i,r,o,s,a;return h.isObject(t)?[null!=(n=t.start)?n:0,null!=(i=t.stop)?i:e,null!=(r=t.step)?r:1]:(l=[t,t+1,1],o=l[0],a=l[1],s=l[2],l);var l},n.patch_to_column=function(t,e,i){var r,o,s,a,u,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j;for(x=new l.Set,w=!1,v=0,g=e.length;v<g;v++)for(P=e[v],s=P[0],j=P[1],h.isArray(s)?(x.push(s[0]),E=i[s[0]],_=t[s[0]]):(h.isNumber(s)?(j=[j],x.push(s)):w=!0,s=[0,0,s],E=[1,t.length],_=t),2===s.length&&(E=[1,E[0]],s=[s[0],0,s[1]]),r=0,z=n.slice(s[1],E[0]),a=z[0],c=z[1],u=z[2],C=n.slice(s[2],E[1]),d=C[0],m=C[1],f=C[2],o=y=k=a,M=c,S=u;S>0?y<M:y>M;o=y+=S)for(p=b=T=d,O=m,A=f;A>0?b<O:b>O;p=b+=A)w&&x.push(p),_[o*E[1]+p]=j[r],r++;return x;var P,z,C};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),n=u.decode_column_data(this.data),this.data=n[0],this._shapes=n[1],n;var n},e.prototype.attributes_as_json=function(t,n){void 0===t&&(t=!0),void 0===n&&(n=e._value_to_json);var i,o,s,a;i={},s=this.serializable_attributes();for(o in s)r.call(s,o)&&(a=s[o],"data"===o&&(a=u.encode_column_data(a,this._shapes)),t?i[o]=a:o in this._set_after_defaults&&(i[o]=a));return n("attributes",i,this)},e._value_to_json=function(t,e,n){return h.isObject(e)&&"data"===t?u.encode_column_data(e,n._shapes):s.HasProps._value_to_json(t,e,n)},e.prototype.stream=function(t,e){var i,r,o;i=this.data;for(r in t)o=t[r],i[r]=n.stream_to_column(i[r],t[r],e);return this.setv("data",i,{silent:!0}),this.streaming.emit()},e.prototype.patch=function(t){var e,i,r,o;e=this.data,o=new l.Set;for(i in t)r=t[i],o=o.union(n.patch_to_column(e[i],r,this._shapes[i]));return this.setv("data",e,{silent:!0}),this.patching.emit(o.values)},e}(o.ColumnarDataSource);n.ColumnDataSource=c,c.prototype.type="ColumnDataSource",c.define({data:[a.Any,{}]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(175),o=t(20),s=t(14),a=t(17),l=t(15),u=t(22),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.select=new o.Signal(this,"select"),this.inspect=new o.Signal(this,"inspect"),this.streaming=new o.Signal(this,"streaming"),this.patching=new o.Signal(this,"patching")},e.prototype.get_column=function(t){var e;return null!=(e=this.data[t])?e:null},e.prototype.columns=function(){return Object.keys(this.data)},e.prototype.get_length=function(t){void 0===t&&(t=!0);var e,n,i,r;switch(n=u.uniq(function(){var t,n;t=this.data,n=[];for(e in t)r=t[e],n.push(r.length);return n}.call(this)),n.length){case 0:return null;case 1:return n[0];default:if(i="data source has columns of inconsistent lengths",t)return s.logger.warn(i),n.sort()[0];throw new Error(i)}},e.prototype.get_indices=function(){var t,e;return t=this.get_length(),null==t&&(t=1),function(){e=[];for(var n=0;0<=t?n<t:n>t;0<=t?n++:n--)e.push(n);return e}.apply(this)},e}(r.DataSource);n.ColumnarDataSource=h,h.prototype.type="ColumnarDataSource",h.define({column_names:[l.Array,[]]}),h.internal({selection_manager:[l.Instance,function(t){return new a.SelectionManager({source:t})}],inspected:[l.Any],_shapes:[l.Any,{}]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50),o=t(9),s=t(15),a=t(42),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this.connect(this.properties.selected.change,function(){var t;if(t=n.callback,null!=t)return a.isFunction(t)?t(n):t.execute(n)})},e}(r.Model);n.DataSource=l,l.prototype.type="DataSource",l.define({selected:[s.Any,o.create_hit_test_result()],callback:[s.Any]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(174),o=t(14),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this._update_data(),this.connect(this.properties.geojson.change,function(){return n._update_data()})},e.prototype._update_data=function(){return this.data=this.geojson_to_column_data()},e.prototype._get_new_list_array=function(t){var e,n,i,r;for(r=[],e=n=0,i=t;0<=i?n<i:n>i;e=0<=i?++n:--n)r.push([]);return r},e.prototype._get_new_nan_array=function(t){var e,n,i,r;for(r=[],e=n=0,i=t;0<=i?n<i:n>i;e=0<=i?++n:--n)r.push(NaN);return r},e.prototype._flatten_function=function(t,e){return t.concat([[NaN,NaN,NaN]]).concat(e)},e.prototype._add_properties=function(t,e,n,i){var r,o;o=[];for(r in t.properties)e.hasOwnProperty(r)||(e[r]=this._get_new_nan_array(i)),o.push(e[r][n]=t.properties[r]);return o},e.prototype._add_geometry=function(t,e,n){var i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j;switch(t.type){case"Point":return r=t.coordinates,e.x[n]=r[0],e.y[n]=r[1],e.z[n]=null!=(x=r[2])?x:NaN;case"LineString":for(i=t.coordinates,O=[],u=h=0,_=i.length;h<_;u=++h)r=i[u],e.xs[n][u]=r[0],e.ys[n][u]=r[1],O.push(e.zs[n][u]=null!=(w=r[2])?w:NaN);return O;case"Polygon":for(t.coordinates.length>1&&o.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),s=t.coordinates[0],A=[],u=c=0,p=s.length;c<p;u=++c)r=s[u],e.xs[n][u]=r[0],e.ys[n][u]=r[1],A.push(e.zs[n][u]=null!=(k=r[2])?k:NaN);return A;case"MultiPoint":return o.logger.warn("MultiPoint not supported in Bokeh");case"MultiLineString":for(l=t.coordinates.reduce(this._flatten_function),E=[],u=v=0,d=l.length;v<d;u=++v)r=l[u],e.xs[n][u]=r[0],e.ys[n][u]=r[1],E.push(e.zs[n][u]=null!=(M=r[2])?M:NaN);return E;case"MultiPolygon":for(a=[],S=t.coordinates,g=0,f=S.length;g<f;g++)b=S[g],b.length>1&&o.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),a.push(b[0]);for(l=a.reduce(this._flatten_function),j=[],u=y=0,m=l.length;y<m;u=++y)r=l[u],e.xs[n][u]=r[0],e.ys[n][u]=r[1],j.push(e.zs[n][u]=null!=(T=r[2])?T:NaN);return j;default:throw new Error("Invalid type "+t.type)}},e.prototype._get_items_length=function(t){var e,n,i,r,o,s,a,l,u,h,c;for(e=0,r=a=0,u=t.length;a<u;r=++a)if(o=t[r],i="Feature"===o.type?o.geometry:o,"GeometryCollection"===i.type)for(c=i.geometries,s=l=0,h=c.length;l<h;s=++l)n=c[s],e+=1;else e+=1;return e},e.prototype.geojson_to_column_data=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d,f;if(i=JSON.parse(this.geojson),"GeometryCollection"!==(d=i.type)&&"FeatureCollection"!==d)throw new Error("Bokeh only supports type GeometryCollection and FeatureCollection at top level");if("GeometryCollection"===i.type){if(null==i.geometries)throw new Error("No geometries found in GeometryCollection");if(0===i.geometries.length)throw new Error("geojson.geometries must have one or more items");l=i.geometries}if("FeatureCollection"===i.type){if(null==i.features)throw new Error("No features found in FeaturesCollection");if(0===i.features.length)throw new Error("geojson.features must have one or more items");l=i.features}for(a=this._get_items_length(l),e={x:this._get_new_nan_array(a),y:this._get_new_nan_array(a),z:this._get_new_nan_array(a),xs:this._get_new_list_array(a),ys:this._get_new_list_array(a),zs:this._get_new_list_array(a)},t=0,o=h=0,_=l.length;h<_;o=++h)if(s=l[o],r="Feature"===s.type?s.geometry:s,"GeometryCollection"===r.type)for(f=r.geometries,u=c=0,p=f.length;c<p;u=++c)n=f[u],this._add_geometry(n,e,t),"Feature"===s.type&&this._add_properties(s,e,t,a),t+=1;else this._add_geometry(r,e,t),"Feature"===s.type&&this._add_properties(s,e,t,a),t+=1;return e},e}(r.ColumnarDataSource);n.GeoJSONDataSource=a,a.prototype.type="GeoJSONDataSource",a.define({geojson:[s.Any]}),a.internal({data:[s.Any,{}]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(171);n.AjaxDataSource=i.AjaxDataSource;var r=t(173);n.ColumnDataSource=r.ColumnDataSource;var o=t(174);n.ColumnarDataSource=o.ColumnarDataSource;var s=t(172);n.CDSView=s.CDSView;var a=t(175);n.DataSource=a.DataSource;var l=t(176);n.GeoJSONDataSource=l.GeoJSONDataSource;var u=t(178);n.RemoteDataSource=u.RemoteDataSource},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(173),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ColumnDataSource);n.RemoteDataSource=s,s.prototype.type="RemoteDataSource",s.define({data_url:[o.String],polling_interval:[o.Number]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o=t(364),s=t(183),a=t(15),l=t(22);i=function(t,e,n){return Math.max(e,Math.min(n,t))},r=function(t,e){return void 0===e&&(e=Math.E),Math.log(t)/Math.log(e)};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.initialize=function(e,n){var i,r;return t.prototype.initialize.call(this,e,n),i=l.nth(this.mantissas,-1)/this.base,r=l.nth(this.mantissas,0)*this.base,this.extended_mantissas=[i].concat(this.mantissas,[r]),this.base_factor=0===this.get_min_interval()?1:this.get_min_interval()},e.prototype.get_interval=function(t,e,n){var o,s,a,u,h,c,_,p,d;return a=e-t,h=this.get_ideal_interval(t,e,n),d=Math.floor(r(h/this.base_factor,this.base)),c=Math.pow(this.base,d)*this.base_factor,_=h/c,s=this.extended_mantissas,u=s.map(function(t){return Math.abs(n-a/(t*c))}),o=s[l.argmin(u)],p=o*c,i(p,this.get_min_interval(),this.get_max_interval())},e}(s.ContinuousTicker);n.AdaptiveTicker=u,u.prototype.type="AdaptiveTicker",u.define({base:[a.Number,10],mantissas:[a.Array,[1,2,5]],min_interval:[a.Number,0],max_interval:[a.Number]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(179),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.AdaptiveTicker);n.BasicTicker=o,o.prototype.type="BasicTicker"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(192),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_ticks=function(t,e,n,i,r){var o,s,a,l,u;r.desired_n_ticks;return o=this._collect(n.factors,n,t,e),u=this._collect(null!=(a=n.tops)?a:[],n,t,e),s=this._collect(null!=(l=n.mids)?l:[],n,t,e),{major:o,tops:u,mids:s,minor:[]}},e.prototype._collect=function(t,e,n,i){var r,o,s,a,l;for(l=[],s=0,a=t.length;s<a;s++)o=t[s],r=e.synthetic(o),r>n&&r<i&&l.push(o);return l},e}(r.Ticker);n.CategoricalTicker=o,o.prototype.type="CategoricalTicker"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(183),o=t(15),s=t(22),a=t(30),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_best_ticker=function(t,e,n){var i,r,o,l,u,h,c,_;return l=e-t,h=this.get_ideal_interval(t,e,n),_=[s.sortedIndex(this.min_intervals,h)-1,s.sortedIndex(this.max_intervals,h)],c=[this.min_intervals[_[0]],this.max_intervals[_[1]]],u=c.map(function(t){return Math.abs(n-l/t)}),a.isEmpty(u.filter(function(t){return!isNaN(t)}))?r=this.tickers[0]:(i=s.argmin(u),o=_[i],r=this.tickers[o]),r},e.prototype.get_interval=function(t,e,n){var i;return i=this.get_best_ticker(t,e,n),
  i.get_interval(t,e,n)},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r,o;return r=this.get_best_ticker(t,e,i),o=r.get_ticks_no_defaults(t,e,n,i)},e}(r.ContinuousTicker);n.CompositeTicker=l,l.prototype.type="CompositeTicker",l.define({tickers:[o.Array,[]]}),l.getters({min_intervals:function(){var t,e,n,i,r;for(n=this.tickers,i=[],t=0,e=n.length;t<e;t++)r=n[t],i.push(r.get_min_interval());return i},max_intervals:function(){var t,e,n,i,r;for(n=this.tickers,i=[],t=0,e=n.length;t<e;t++)r=n[t],i.push(r.get_max_interval());return i},min_interval:function(){return this.min_intervals[0]},max_interval:function(){return this.max_intervals[0]}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(192),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_min_interval=function(){return this.min_interval},e.prototype.get_max_interval=function(){var t;return null!=(t=this.max_interval)?t:Infinity},e.prototype.get_ideal_interval=function(t,e,n){var i;return i=e-t,i/n},e}(r.Ticker);n.ContinuousTicker=s,s.prototype.type="ContinuousTicker",s.define({num_minor_ticks:[o.Number,5],desired_num_ticks:[o.Number,6]}),s.prototype.get_interval=void 0},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a,l=t(364),u=t(22),h=t(179),c=t(182),_=t(185),p=t(190),d=t(194),f=t(193);r=f.ONE_MILLI,a=f.ONE_SECOND,o=f.ONE_MINUTE,i=f.ONE_HOUR,s=f.ONE_MONTH;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e}(c.CompositeTicker);n.DatetimeTicker=m,m.prototype.type="DatetimeTicker",m.override({num_minor_ticks:0,tickers:function(){return[new h.AdaptiveTicker({mantissas:[1,2,5],base:10,min_interval:0,max_interval:500*r,num_minor_ticks:0}),new h.AdaptiveTicker({mantissas:[1,2,5,10,15,20,30],base:60,min_interval:a,max_interval:30*o,num_minor_ticks:0}),new h.AdaptiveTicker({mantissas:[1,2,4,6,8,12],base:24,min_interval:i,max_interval:12*i,num_minor_ticks:0}),new _.DaysTicker({days:u.range(1,32)}),new _.DaysTicker({days:u.range(1,31,3)}),new _.DaysTicker({days:[1,8,15,22]}),new _.DaysTicker({days:[1,15]}),new p.MonthsTicker({months:u.range(0,12,1)}),new p.MonthsTicker({months:u.range(0,12,2)}),new p.MonthsTicker({months:u.range(0,12,4)}),new p.MonthsTicker({months:u.range(0,12,6)}),new d.YearsTicker({})]}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a=t(364),l=t(191),u=t(193),h=t(15),c=t(22);r=u.copy_date,s=u.last_month_no_later_than,i=u.ONE_DAY,o=function(t,e){var n,i,o,a,l;for(l=s(new Date(t)),o=s(new Date(e)),a=r(o),o.setUTCMonth(o.getUTCMonth()+1),i=[],n=l;;)if(i.push(r(n)),n.setUTCMonth(n.getUTCMonth()+1),n>o)break;return i};var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.initialize=function(e,n){var r,o;return e.num_minor_ticks=0,t.prototype.initialize.call(this,e,n),r=this.days,o=r.length>1?(r[1]-r[0])*i:31*i,this.interval=o},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var s,a,l,u,h,_,p,d,f;return d=o(t,e),h=this.days,_=function(t,e){var n,i,o,s,a,l;for(n=[],a=0,l=h.length;a<l;a++)i=h[a],o=r(t),o.setUTCDate(i),s=new Date(o.getTime()+e/2),s.getUTCMonth()===t.getUTCMonth()&&n.push(o);return n},p=this.interval,u=c.concat(function(){var t,e,n;for(n=[],t=0,e=d.length;t<e;t++)a=d[t],n.push(_(a,p));return n}()),s=function(){var t,e,n;for(n=[],t=0,e=u.length;t<e;t++)l=u[t],n.push(l.getTime());return n}(),f=s.filter(function(n){return t<=n&&n<=e}),{major:f,minor:[]}},e}(l.SingleIntervalTicker);n.DaysTicker=_,_.prototype.type="DaysTicker",_.define({days:[h.Array,[]]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(183),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_ticks_no_defaults=function(t,e,n,i){return{major:this.ticks,minor:[]}},e}(r.ContinuousTicker);n.FixedTicker=s,s.prototype.type="FixedTicker",s.define({ticks:[o.Array,[]]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(179);n.AdaptiveTicker=i.AdaptiveTicker;var r=t(180);n.BasicTicker=r.BasicTicker;var o=t(181);n.CategoricalTicker=o.CategoricalTicker;var s=t(182);n.CompositeTicker=s.CompositeTicker;var a=t(183);n.ContinuousTicker=a.ContinuousTicker;var l=t(184);n.DatetimeTicker=l.DatetimeTicker;var u=t(185);n.DaysTicker=u.DaysTicker;var h=t(186);n.FixedTicker=h.FixedTicker;var c=t(188);n.LogTicker=c.LogTicker;var _=t(189);n.MercatorTicker=_.MercatorTicker;var p=t(190);n.MonthsTicker=p.MonthsTicker;var d=t(191);n.SingleIntervalTicker=d.SingleIntervalTicker;var f=t(192);n.Ticker=f.Ticker;var m=t(194);n.YearsTicker=m.YearsTicker},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(22),o=t(179),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_ticks_no_defaults=function(t,e,n,i){var o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j,P,z,C,N,D,F;if(E=this.num_minor_ticks,O=[],o=this.base,k=Math.log(t)/Math.log(o),x=Math.log(e)/Math.log(o),w=x-k,isFinite(w)){if(w<2){if(c=this.get_interval(t,e,i),z=Math.floor(t/c),s=Math.ceil(e/c),u=r.range(z,s+1),D=function(){var t,e,n;for(n=[],t=0,e=u.length;t<e;t++)l=u[t],0!==l&&n.push(l*c);return n}(),D=D.filter(function(n){return t<=n&&n<=e}),E>0&&D.length>0){for(S=c/E,T=function(){var t,e,n;for(n=[],h=t=0,e=E;0<=e?t<e:t>e;h=0<=e?++t:--t)n.push(h*S);return n}(),P=T.slice(1,+T.length+1||9e9),_=0,f=P.length;_<f;_++)F=P[_],O.push(D[0]-F);for(p=0,m=D.length;p<m;p++)for(N=D[p],d=0,v=T.length;d<v;d++)F=T[d],O.push(N+F)}}else if(C=Math.ceil(.999999*k),a=Math.floor(1.000001*x),c=Math.ceil((a-C)/9),D=r.range(C,a+1,c),D=D.map(function(t){return Math.pow(o,t)}),D=D.filter(function(n){return t<=n&&n<=e}),E>0&&D.length>0){for(S=Math.pow(o,c)/E,T=function(){var t,e,n;for(n=[],h=t=1,e=E;1<=e?t<=e:t>=e;h=1<=e?++t:--t)n.push(h*S);return n}(),M=0,g=T.length;M<g;M++)F=T[M],O.push(D[0]/F);for(O.push(D[0]),A=0,y=D.length;A<y;A++)for(N=D[A],j=0,b=T.length;j<b;j++)F=T[j],O.push(N*F)}}else D=[];return{major:D,minor:O}},e}(o.AdaptiveTicker);n.LogTicker=s,s.prototype.type="LogTicker",s.override({mantissas:[1,5]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(180),o=t(15),s=t(31),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_ticks_no_defaults=function(e,n,i,r){var o,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T;if(null==this.dimension)throw new Error("MercatorTicker.dimension not configured");if(O=s.clip_mercator(e,n,this.dimension),e=O[0],n=O[1],"lon"===this.dimension?(A=s.proj4(s.mercator).inverse([e,i]),y=A[0],v=A[1],E=s.proj4(s.mercator).inverse([n,i]),g=E[0],v=E[1]):(j=s.proj4(s.mercator).inverse([i,e]),v=j[0],y=j[1],P=s.proj4(s.mercator).inverse([i,n]),v=P[0],g=P[1]),b=t.prototype.get_ticks_no_defaults.call(this,y,g,i,r),T={major:[],minor:[]},"lon"===this.dimension){for(x=b.major,a=0,_=x.length;a<_;a++)S=x[a],s.in_bounds(S,"lon")&&(z=s.proj4(s.mercator).forward([S,v]),m=z[0],o=z[1],T.major.push(m));for(w=b.minor,l=0,p=w.length;l<p;l++)S=w[l],s.in_bounds(S,"lon")&&(C=s.proj4(s.mercator).forward([S,v]),m=C[0],o=C[1],T.minor.push(m))}else{for(k=b.major,u=0,d=k.length;u<d;u++)S=k[u],s.in_bounds(S,"lat")&&(N=s.proj4(s.mercator).forward([v,S]),o=N[0],c=N[1],T.major.push(c));for(M=b.minor,h=0,f=M.length;h<f;h++)S=M[h],s.in_bounds(S,"lat")&&(D=s.proj4(s.mercator).forward([v,S]),o=D[0],c=D[1],T.minor.push(c))}return T;var O,A,E,j,P,z,C,N,D},e}(r.BasicTicker);n.MercatorTicker=a,a.prototype.type="MercatorTicker",a.define({dimension:[o.LatLon]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a=t(364),l=t(191),u=t(193),h=t(15),c=t(22);r=u.copy_date,s=u.last_year_no_later_than,i=u.ONE_MONTH,o=function(t,e){var n,i,o,a;for(a=s(new Date(t)),o=s(new Date(e)),o.setUTCFullYear(o.getUTCFullYear()+1),i=[],n=a;;)if(i.push(r(n)),n.setUTCFullYear(n.getUTCFullYear()+1),n>o)break;return i};var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.initialize=function(e,n){var r,o;return t.prototype.initialize.call(this,e,n),o=this.months,r=o.length>1?(o[1]-o[0])*i:12*i,this.interval=r},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var s,a,l,u,h,_,p,d;return d=o(t,e),h=this.months,_=function(t){return h.map(function(e){var n;return n=r(t),n.setUTCMonth(e),n})},u=c.concat(function(){var t,e,n;for(n=[],t=0,e=d.length;t<e;t++)a=d[t],n.push(_(a));return n}()),s=function(){var t,e,n;for(n=[],t=0,e=u.length;t<e;t++)l=u[t],n.push(l.getTime());return n}(),p=s.filter(function(n){return t<=n&&n<=e}),{major:p,minor:[]}},e}(l.SingleIntervalTicker);n.MonthsTicker=_,_.prototype.type="MonthsTicker",_.define({months:[h.Array,[]]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(183),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_interval=function(t,e,n){return this.interval},e}(r.ContinuousTicker);n.SingleIntervalTicker=s,s.prototype.type="SingleIntervalTicker",s.define({interval:[o.Number]}),s.getters({min_interval:function(){return this.interval},max_interval:function(){return this.interval}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50),o=t(22),s=t(42),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_ticks=function(t,e,n,i,r){r.desired_n_ticks;return this.get_ticks_no_defaults(t,e,i,this.desired_num_ticks)},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S;if(h=this.get_interval(t,e,i),w=Math.floor(t/h),r=Math.ceil(e/h),l=s.isStrictNaN(w)||s.isStrictNaN(r)?[]:o.range(w,r+1),M=function(){var t,e,n;for(n=[],t=0,e=l.length;t<e;t++)a=l[t],n.push(a*h);return n}(),M=M.filter(function(n){return t<=n&&n<=e}),b=this.num_minor_ticks,y=[],b>0&&M.length>0){for(v=h/b,g=function(){var t,e,n;for(n=[],u=t=0,e=b;0<=e?t<e:t>e;u=0<=e?++t:--t)n.push(u*v);return n}(),x=g.slice(1,+g.length+1||9e9),c=0,d=x.length;c<d;c++)S=x[c],y.push(M[0]-S);for(_=0,f=M.length;_<f;_++)for(k=M[_],p=0,m=g.length;p<m;p++)S=g[p],y.push(k+S)}return{major:M,minor:y}},e}(r.Model);n.Ticker=a,a.prototype.type="Ticker"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ONE_MILLI=1,n.ONE_SECOND=1e3,n.ONE_MINUTE=60*n.ONE_SECOND,n.ONE_HOUR=60*n.ONE_MINUTE,n.ONE_DAY=24*n.ONE_HOUR,n.ONE_MONTH=30*n.ONE_DAY,n.ONE_YEAR=365*n.ONE_DAY,n.copy_date=function(t){return new Date(t.getTime())},n.last_month_no_later_than=function(t){return t=n.copy_date(t),t.setUTCDate(1),t.setUTCHours(0),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),t},n.last_year_no_later_than=function(t){return t=n.last_month_no_later_than(t),t.setUTCMonth(0),t}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o=t(364),s=t(180),a=t(191),l=t(193);r=l.last_year_no_later_than,i=l.ONE_YEAR;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.interval=i,this.basic_ticker=new s.BasicTicker({num_minor_ticks:0})},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var o,s,a,l,u,h;return a=r(new Date(t)).getUTCFullYear(),s=r(new Date(e)).getUTCFullYear(),h=this.basic_ticker.get_ticks_no_defaults(a,s,n,i).major,o=function(){var t,e,n;for(n=[],t=0,e=h.length;t<e;t++)u=h[t],n.push(Date.UTC(u,0,1));return n}(),l=o.filter(function(n){return t<=n&&n<=e}),{major:l,minor:[]}},e}(a.SingleIntervalTicker);n.YearsTicker=u,u.prototype.type="YearsTicker"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(200),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){var i,r,o,s,a;return i=this.string_lookup_replace(this.url,this.extra_url_vars),this.use_latlon?(l=this.get_tile_geographic_bounds(t,e,n),o=l[0],a=l[1],r=l[2],s=l[3]):(u=this.get_tile_meter_bounds(t,e,n),o=u[0],a=u[1],r=u[2],s=u[3]),i.replace("{XMIN}",o).replace("{YMIN}",a).replace("{XMAX}",r).replace("{YMAX}",s);var l,u},e}(r.MercatorTileSource);n.BBoxTileSource=s,s.prototype.type="BBoxTileSource",s.define({use_latlon:[o.Bool,!1]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},o=t(165),s=t(14),a=t(15);n.DynamicImageView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._on_image_load=e._on_image_load.bind(e),e._on_image_error=e._on_image_error.bind(e),e}return i.__extends(e,t),e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype.get_extent=function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]},e.prototype._set_data=function(){return this.map_plot=this.plot_view.model.plot,this.map_canvas=this.plot_view.canvas_view.ctx,this.map_frame=this.plot_view.frame,this.x_range=this.map_plot.x_range,this.y_range=this.map_plot.y_range,this.lastImage=void 0,this.extent=this.get_extent()},e.prototype._map_data=function(){return this.initial_extent=this.get_extent()},e.prototype._on_image_load=function(t){var n;if(r(this,e),n=t.target.image_data,n.img=t.target,n.loaded=!0,this.lastImage=n,this.get_extent().join(":")===n.cache_key)return this.request_render()},e.prototype._on_image_error=function(t){var n;return r(this,e),s.logger.error("Error loading image: "+t.target.src),n=t.target.image_data,this.model.image_source.remove_image(n)},e.prototype._create_image=function(t){var e;return e=new Image,e.onload=this._on_image_load,e.onerror=this._on_image_error,e.alt="",e.image_data={bounds:t,loaded:!1,cache_key:t.join(":")},this.model.image_source.add_image(e.image_data),e.src=this.model.image_source.get_image_url(t[0],t[1],t[2],t[3],Math.ceil(this.map_frame._height.value),Math.ceil(this.map_frame._width.value)),e},e.prototype.render=function(t,e,n){var i,r,o=this;return null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),i=this.get_extent(),this.render_timer&&clearTimeout(this.render_timer),r=this.model.image_source.images[i.join(":")],null!=r&&r.loaded?void this._draw_image(i.join(":")):(null!=this.lastImage&&this._draw_image(this.lastImage.cache_key),null==r?this.render_timer=setTimeout(function(){return o._create_image(i)},125):void 0)},e.prototype._draw_image=function(t){var e,n,i,r,o,s,a,l,u;if(e=this.model.image_source.images[t],null!=e)return this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha,h=this.plot_view.map_to_screen([e.bounds[0]],[e.bounds[3]]),s=h[0],u=h[1],c=this.plot_view.map_to_screen([e.bounds[2]],[e.bounds[1]]),o=c[0],l=c[1],s=s[0],u=u[0],o=o[0],l=l[0],i=o-s,n=l-u,r=s,a=u,this.map_canvas.drawImage(e.img,r,a,i,n),this.map_canvas.restore();var h,c},e.prototype._set_rect=function(){var t,e,n,i,r;return n=this.plot_model.plot.properties.outline_line_width.value(),e=this.map_frame._left.value+n/2,i=this.map_frame._top.value+n/2,r=this.map_frame._width.value-n,t=this.map_frame._height.value-n,this.map_canvas.rect(e,i,r,t),this.map_canvas.clip()},e}(o.RendererView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Renderer);n.DynamicImageRenderer=l,l.prototype.default_view=n.DynamicImageView,l.prototype.type="DynamicImageRenderer",l.define({alpha:[a.Number,1],image_source:[a.Instance],render_parents:[a.Bool,!0]}),l.override({level:"underlay"})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ImagePool=function(){function t(){this.images=[]}return t.prototype.pop=function(){var t;return t=this.images.pop(),null!=t?t:new Image},t.prototype.push=function(t){if(!(this.images.length>50))return t.constructor===Array?Array.prototype.push.apply(this.images,t):this.images.push(t)},t}()},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(50),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.images={},this.normalize_case()},e.prototype.normalize_case=function(){"Note: should probably be refactored into subclasses.";var t;return t=this.url,t=t.replace("{xmin}","{XMIN}"),t=t.replace("{ymin}","{YMIN}"),t=t.replace("{xmax}","{XMAX}"),t=t.replace("{ymax}","{YMAX}"),t=t.replace("{height}","{HEIGHT}"),t=t.replace("{width}","{WIDTH}"),this.url=t},e.prototype.string_lookup_replace=function(t,e){var n,i,r;i=t;for(n in e)r=e[n],i=i.replace("{"+n+"}",r.toString());return i},e.prototype.add_image=function(t){return this.images[t.cache_key]=t},e.prototype.remove_image=function(t){return delete this.images[t.cache_key]},e.prototype.get_image_url=function(t,e,n,i,r,o){var s;return s=this.string_lookup_replace(this.url,this.extra_url_vars),s.replace("{XMIN}",t).replace("{YMIN}",e).replace("{XMAX}",n).replace("{YMAX}",i).replace("{WIDTH}",o).replace("{HEIGHT}",r)},e}(o.Model);n.ImageSource=s,s.prototype.type="ImageSource",s.define({url:[r.String,""],extra_url_vars:[r.Any,{}]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(195);n.BBoxTileSource=i.BBoxTileSource;var r=t(196);n.DynamicImageRenderer=r.DynamicImageRenderer;var o=t(198);n.ImageSource=o.ImageSource;var s=t(200);n.MercatorTileSource=s.MercatorTileSource;var a=t(201);n.QUADKEYTileSource=a.QUADKEYTileSource;var l=t(202);n.TileRenderer=l.TileRenderer;var u=t(203);n.TileSource=u.TileSource;var h=t(205);n.TMSTileSource=h.TMSTileSource;var c=t(206);n.WMTSTileSource=c.WMTSTileSource},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=[].indexOf,o=t(203),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n;return t.prototype.initialize.call(this,e),this._resolutions=function(){var t,e,i,r;for(r=[],n=t=e=this.min_zoom,i=this.max_zoom;e<=i?t<=i:t>=i;n=e<=i?++t:--t)r.push(this.get_resolution(n));return r}.call(this)},e.prototype._computed_initial_resolution=function(){return null!=this.initial_resolution?this.initial_resolution:2*Math.PI*6378137/this.tile_size},e.prototype.is_valid_tile=function(t,e,n){return!(!this.wrap_around&&(t<0||t>=Math.pow(2,n)))&&!(e<0||e>=Math.pow(2,n))},e.prototype.retain_children=function(t){var e,n,i,r,o,s,a;r=t.quadkey,i=r.length,n=i+3,o=this.tiles,s=[];for(e in o)a=o[e],0===a.quadkey.indexOf(r)&&a.quadkey.length>i&&a.quadkey.length<=n?s.push(a.retain=!0):s.push(void 0);return s},e.prototype.retain_neighbors=function(t){var e,n,i,o,s,a,l,u,h,c,_,p,d,f;n=4,m=t.tile_coords,c=m[0],_=m[1],p=m[2],i=function(){var t,e,i,r;for(r=[],d=t=e=c-n,i=c+n;e<=i?t<=i:t>=i;d=e<=i?++t:--t)r.push(d);return r}(),o=function(){var t,e,i,r;for(r=[],f=t=e=_-n,i=_+n;e<=i?t<=i:t>=i;f=e<=i?++t:--t)r.push(f);return r}(),s=this.tiles,u=[];for(e in s)h=s[e],h.tile_coords[2]===p&&(a=h.tile_coords[0],r.call(i,a)>=0)&&(l=h.tile_coords[1],r.call(o,l)>=0)?u.push(h.retain=!0):u.push(void 0);return u;var m},e.prototype.retain_parents=function(t){var e,n,i,r,o;n=t.quadkey,i=this.tiles,r=[];for(e in i)o=i[e],r.push(o.retain=0===n.indexOf(o.quadkey));return r},e.prototype.children_by_tile_xyz=function(t,e,n){var i,r,o,s,a,l;for(l=this.calculate_world_x_by_tile_xyz(t,e,n),0!==l&&(u=this.normalize_xyz(t,e,n),t=u[0],e=u[1],n=u[2]),a=this.tile_xyz_to_quadkey(t,e,n),r=[],o=s=0;s<=3;o=s+=1)h=this.quadkey_to_tile_xyz(a+o.toString()),t=h[0],e=h[1],n=h[2],0!==l&&(c=this.denormalize_xyz(t,e,n,l),t=c[0],e=c[1],n=c[2]),i=this.get_tile_meter_bounds(t,e,n),null!=i&&r.push([t,e,n,i]);return r;var u,h,c},e.prototype.parent_by_tile_xyz=function(t,e,n){var i,r;return r=this.tile_xyz_to_quadkey(t,e,n),i=r.substring(0,r.length-1),this.quadkey_to_tile_xyz(i)},e.prototype.get_resolution=function(t){return this._computed_initial_resolution()/Math.pow(2,t)},e.prototype.get_resolution_by_extent=function(t,e,n){var i,r;return i=(t[2]-t[0])/n,r=(t[3]-t[1])/e,[i,r]},e.prototype.get_level_by_extent=function(t,e,n){var i,r,o,s,a,l,u,h;for(u=(t[2]-t[0])/n,h=(t[3]-t[1])/e,l=Math.max(u,h),i=0,a=this._resolutions,r=0,o=a.length;r<o;r++){if(s=a[r],l>s){if(0===i)return 0;if(i>0)return i-1}i+=1}},e.prototype.get_closest_level_by_extent=function(t,e,n){var i,r,o,s,a;return s=(t[2]-t[0])/n,a=(t[3]-t[1])/e,r=Math.max(s,a),o=this._resolutions,i=this._resolutions.reduce(function(t,e){return Math.abs(e-r)<Math.abs(t-r)?e:t}),this._resolutions.indexOf(i)},e.prototype.snap_to_zoom=function(t,e,n,i){var r,o,s,a,l,u,h,c,_;return r=this._resolutions[i],o=n*r,s=e*r,u=t[0],_=t[1],l=t[2],c=t[3],a=(o-(l-u))/2,h=(s-(c-_))/2,[u-a,_-h,l+a,c+h]},e.prototype.tms_to_wmts=function(t,e,n){"Note this works both ways";return[t,Math.pow(2,n)-1-e,n]},e.prototype.wmts_to_tms=function(t,e,n){"Note this works both ways";return[t,Math.pow(2,n)-1-e,n]},e.prototype.pixels_to_meters=function(t,e,n){var i,r,o;return o=this.get_resolution(n),i=t*o-this.x_origin_offset,r=e*o-this.y_origin_offset,[i,r]},e.prototype.meters_to_pixels=function(t,e,n){var i,r,o;return o=this.get_resolution(n),i=(t+this.x_origin_offset)/o,r=(e+this.y_origin_offset)/o,[i,r]},e.prototype.pixels_to_tile=function(t,e){var n,i;return n=Math.ceil(t/parseFloat(this.tile_size)),n=0===n?n:n-1,i=Math.max(Math.ceil(e/parseFloat(this.tile_size))-1,0),[n,i]},e.prototype.pixels_to_raster=function(t,e,n){var i;return i=this.tile_size<<n,[t,i-e]},e.prototype.meters_to_tile=function(t,e,n){var i,r;return o=this.meters_to_pixels(t,e,n),i=o[0],r=o[1],this.pixels_to_tile(i,r);var o},e.prototype.get_tile_meter_bounds=function(t,e,n){var i,r,o,s;return a=this.pixels_to_meters(t*this.tile_size,e*this.tile_size,n),r=a[0],s=a[1],l=this.pixels_to_meters((t+1)*this.tile_size,(e+1)*this.tile_size,n),i=l[0],o=l[1],null!=r&&null!=s&&null!=i&&null!=o?[r,s,i,o]:void 0;var a,l},e.prototype.get_tile_geographic_bounds=function(t,e,n){var i,r,o,s,a;return i=this.get_tile_meter_bounds(t,e,n),l=this.utils.meters_extent_to_geographic(i),a=l[0],s=l[1],o=l[2],r=l[3],[a,s,o,r];var l},e.prototype.get_tiles_by_extent=function(t,e,n){void 0===n&&(n=1);var i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y;for(v=t[0],y=t[1],m=t[2],g=t[3],b=this.meters_to_tile(v,y,e),_=b[0],f=b[1],x=this.meters_to_tile(m,g,e),c=x[0],d=x[1],_-=n,f-=n,c+=n,d+=n,u=[],p=i=o=d,s=f;i>=s;p=i+=-1)for(h=r=a=_,l=c;r<=l;h=r+=1)this.is_valid_tile(h,p,e)&&u.push([h,p,e,this.get_tile_meter_bounds(h,p,e)]);return u=this.sort_tiles_from_center(u,[_,f,c,d]);var b,x},e.prototype.quadkey_to_tile_xyz=function(t){"Computes tile x, y and z values based on quadKey.";var e,n,i,r,o,s,a,l;for(o=0,s=0,a=t.length,e=n=r=a;n>0;e=n+=-1)switch(l=t.charAt(a-e),i=1<<e-1,l){case"0":continue;case"1":o|=i;break;case"2":s|=i;break;case"3":o|=i,s|=i;break;default:throw new TypeError("Invalid Quadkey: "+t)}return[o,s,a]},e.prototype.tile_xyz_to_quadkey=function(t,e,n){"Computes quadkey value based on tile x, y and z values.";var i,r,o,s,a,l;for(a="",r=o=l=n;o>0;r=o+=-1)i=0,s=1<<r-1,0!==(t&s)&&(i+=1),0!==(e&s)&&(i+=2),a+=i.toString();return a},e.prototype.children_by_tile_xyz=function(t,e,n){var i,r,o,s,a;for(a=this.tile_xyz_to_quadkey(t,e,n),r=[],o=s=0;s<=3;o=s+=1)l=this.quadkey_to_tile_xyz(a+o.toString()),t=l[0],e=l[1],n=l[2],i=this.get_tile_meter_bounds(t,e,n),null!=i&&r.push([t,e,n,i]);return r;var l},e.prototype.parent_by_tile_xyz=function(t,e,n){var i,r;return r=this.tile_xyz_to_quadkey(t,e,n),i=r.substring(0,r.length-1),this.quadkey_to_tile_xyz(i)},e.prototype.get_closest_parent_by_tile_xyz=function(t,e,n){var i,r;for(r=this.calculate_world_x_by_tile_xyz(t,e,n),o=this.normalize_xyz(t,e,n),t=o[0],e=o[1],n=o[2],i=this.tile_xyz_to_quadkey(t,e,n);i.length>0;)if(i=i.substring(0,i.length-1),s=this.quadkey_to_tile_xyz(i),t=s[0],e=s[1],n=s[2],a=this.denormalize_xyz(t,e,n,r),t=a[0],e=a[1],n=a[2],this.tile_xyz_to_key(t,e,n)in this.tiles)return[t,e,n];return[0,0,0];var o,s,a},e.prototype.normalize_xyz=function(t,e,n){var i;return this.wrap_around?(i=Math.pow(2,n),[(t%i+i)%i,e,n]):[t,e,n]},e.prototype.denormalize_xyz=function(t,e,n,i){return[t+i*Math.pow(2,n),e,n]},e.prototype.denormalize_meters=function(t,e,n,i){return[t+2*i*Math.PI*6378137,e]},e.prototype.calculate_world_x_by_tile_xyz=function(t,e,n){return Math.floor(t/Math.pow(2,n))},e}(o.TileSource);n.MercatorTileSource=a,a.prototype.type="MercatorTileSource",a.define({wrap_around:[s.Bool,!0]}),a.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(200),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){var i,r;return i=this.string_lookup_replace(this.url,this.extra_url_vars),o=this.tms_to_wmts(t,e,n),t=o[0],e=o[1],n=o[2],r=this.tile_xyz_to_quadkey(t,e,n),i.replace("{Q}",r);var o},e}(r.MercatorTileSource);n.QUADKEYTileSource=o,o.prototype.type="QUADKEYTileSource"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},o=[].indexOf,s=t(197),a=t(206),l=t(165),u=t(5),h=t(15),c=t(42);n.TileRendererView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._add_attribution=e._add_attribution.bind(e),e._on_tile_load=e._on_tile_load.bind(e),e._on_tile_cache_load=e._on_tile_cache_load.bind(e),e._on_tile_error=e._on_tile_error.bind(e),e._prefetch_tiles=e._prefetch_tiles.bind(e),e._update=e._update.bind(e),e}return i.__extends(e,t),e.prototype.initialize=function(e){return this.attributionEl=null,this._tiles=[],t.prototype.initialize.call(this,e)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype.get_extent=function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]},e.prototype._set_data=function(){return this.pool=new s.ImagePool,this.map_plot=this.plot_model.plot,this.map_canvas=this.plot_view.canvas_view.ctx,this.map_frame=this.plot_model.frame,this.x_range=this.map_plot.x_range,this.y_range=this.map_plot.y_range,this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0},e.prototype._add_attribution=function(){var t,n,i,o,s;if(r(this,e),t=this.model.tile_source.attribution,c.isString(t)&&t.length>0)return null==this.attributionEl&&(s=this.plot_model.canvas._right.value-this.plot_model.frame._right.value,n=this.plot_model.canvas._bottom.value-this.plot_model.frame._bottom.value,i=this.map_frame._width.value,this.attributionEl=u.div({"class":"bk-tile-attribution",style:{position:"absolute",bottom:n+"px",right:s+"px","max-width":i+"px",padding:"2px","background-color":"rgba(255,255,255,0.8)","font-size":"9pt","font-family":"sans-serif"}}),o=this.plot_view.canvas_view.events_el,o.appendChild(this.attributionEl)),this.attributionEl.innerHTML=t},e.prototype._map_data=function(){var t,e;return this.initial_extent=this.get_extent(),e=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value),t=this.model.tile_source.snap_to_zoom(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value,e),this.x_range.start=t[0],this.y_range.start=t[1],this.x_range.end=t[2],this.y_range.end=t[3],this._add_attribution()},e.prototype._on_tile_load=function(t){var n;return r(this,e),n=t.target.tile_data,n.img=t.target,n.current=!0,n.loaded=!0,this.request_render()},e.prototype._on_tile_cache_load=function(t){var n;return r(this,e),n=t.target.tile_data,n.img=t.target,n.loaded=!0,n.finished=!0,this.notify_finished()},e.prototype._on_tile_error=function(t){var n;return r(this,e),n=t.target.tile_data,n.finished=!0},e.prototype._create_tile=function(t,e,n,i,r){void 0===r&&(r=!1);var o,s;return o=this.model.tile_source.normalize_xyz(t,e,n),s=this.pool.pop(),r?s.onload=this._on_tile_cache_load:s.onload=this._on_tile_load,s.onerror=this._on_tile_error,s.alt="",s.tile_data={tile_coords:[t,e,n],normalized_coords:o,quadkey:this.model.tile_source.tile_xyz_to_quadkey(t,e,n),cache_key:this.model.tile_source.tile_xyz_to_key(t,e,n),bounds:i,loaded:!1,finished:!1,x_coord:i[0],y_coord:i[3]},this.model.tile_source.tiles[s.tile_data.cache_key]=s.tile_data,s.src=(a=this.model.tile_source).get_image_url.apply(a,o),this._tiles.push(s),s;var a},e.prototype._enforce_aspect_ratio=function(){var t,e,n;return(this._last_height!==this.map_frame._height.value||this._last_width!==this.map_frame._width.value)&&(t=this.get_extent(),n=this.model.tile_source.get_level_by_extent(t,this.map_frame._height.value,this.map_frame._width.value),e=this.model.tile_source.snap_to_zoom(t,this.map_frame._height.value,this.map_frame._width.value,n),this.x_range.setv({start:e[0],end:e[2]}),this.y_range.setv({start:e[1],end:e[3]}),this.extent=e,this._last_height=this.map_frame._height.value,this._last_width=this.map_frame._width.value,!0)},e.prototype.has_finished=function(){var e,n,i,r;if(!t.prototype.has_finished.call(this))return!1;if(0===this._tiles.length)return!1;for(i=this._tiles,e=0,n=i.length;e<n;e++)if(r=i[e],!r.tile_data.finished)return!1;return!0},e.prototype.render=function(t,e,n){if(null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),!this._enforce_aspect_ratio())return this._update(),null!=this.prefetch_timer&&clearTimeout(this.prefetch_timer),this.prefetch_timer=setTimeout(this._prefetch_tiles,500),this.has_finished()?this.notify_finished():void 0},e.prototype._draw_tile=function(t){var e,n,i,r,o,s,a,l,u;if(u=this.model.tile_source.tiles[t],null!=u)return h=this.plot_view.map_to_screen([u.bounds[0]],[u.bounds[3]]),o=h[0],l=h[1],c=this.plot_view.map_to_screen([u.bounds[2]],[u.bounds[1]]),r=c[0],a=c[1],o=o[0],l=l[0],r=r[0],a=a[0],n=r-o,e=a-l,i=o,s=l,this.map_canvas.drawImage(u.img,i,s,n,e);var h,c},e.prototype._set_rect=function(){var t,e,n,i,r;return n=this.plot_model.plot.properties.outline_line_width.value(),e=this.map_frame._left.value+n/2,i=this.map_frame._top.value+n/2,r=this.map_frame._width.value-n,t=this.map_frame._height.value-n,this.map_canvas.rect(e,i,r,t),this.map_canvas.clip()},e.prototype._render_tiles=function(t){var e,n,i;for(this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha,e=0,n=t.length;e<n;e++)i=t[e],this._draw_tile(i);return this.map_canvas.restore()},e.prototype._prefetch_tiles=function(){var t,n,i,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x;for(r(this,e),f=this.model.tile_source,u=this.get_extent(),h=this.map_frame._height.value,v=this.map_frame._width.value,x=this.model.tile_source.get_level_by_extent(u,h,v),m=this.model.tile_source.get_tiles_by_extent(u,x),p=[],d=c=0,_=Math.min(10,m.length);c<=_;d=c+=1)g=d[0],y=d[1],b=d[2],t=d[3],o=this.model.tile_source.children_by_tile_xyz(g,y,b),p.push(function(){var t,e,r;for(r=[],t=0,e=o.length;t<e;t++)n=o[t],s=n[0],a=n[1],l=n[2],i=n[3],f.tile_xyz_to_key(s,a,l)in f.tiles||r.push(this._create_tile(s,a,l,i,!0));return r}.call(this));return p},e.prototype._fetch_tiles=function(t){var e,n,i,r,o,s,a,l;for(r=[],n=0,i=t.length;n<i;n++)o=t[n],s=o[0],a=o[1],l=o[2],e=o[3],r.push(this._create_tile(s,a,l,e));return r},e.prototype._update=function(){var t,n,i,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j,P,z,C,N,D,F,I,B,R,L,V=this;
  for(r(this,e),C=this.model.tile_source,w=C.min_zoom,x=C.max_zoom,C.update(),_=this.get_extent(),L=this.extent[2]-this.extent[0]<_[2]-_[0],p=this.map_frame._height.value,D=this.map_frame._width.value,R=C.get_level_by_extent(_,p,D),j=!1,R<w?(_=this.extent,R=w,j=!0):R>x&&(_=this.extent,R=x,j=!0),j&&(this.x_range.setv({x_range:{start:_[0],end:_[2]}}),this.y_range.setv({start:_[1],end:_[3]}),this.extent=_),this.extent=_,N=C.get_tiles_by_extent(_,R),T=[],k=[],i=[],l=[],d=0,g=N.length;d<g;d++){if(P=N[d],F=P[0],I=P[1],B=P[2],t=P[3],v=C.tile_xyz_to_key(F,I,B),z=C.tiles[v],null!=z&&z.loaded===!0)i.push(v);else if(this.model.render_parents&&(G=C.get_closest_parent_by_tile_xyz(F,I,B),O=G[0],A=G[1],E=G[2],M=C.tile_xyz_to_key(O,A,E),S=C.tiles[M],null!=S&&S.loaded&&o.call(T,M)<0&&T.push(M),L))for(l=C.children_by_tile_xyz(F,I,B),f=0,y=l.length;f<y;f++)n=l[f],u=n[0],h=n[1],c=n[2],s=n[3],a=C.tile_xyz_to_key(u,h,c),a in C.tiles&&l.push(a);null==z&&k.push(P)}for(this._render_tiles(T),this._render_tiles(l),this._render_tiles(i),m=0,b=i.length;m<b;m++)P=i[m],C.tiles[P].current=!0;return null!=this.render_timer&&clearTimeout(this.render_timer),this.render_timer=setTimeout(function(){return V._fetch_tiles(k)},65);var G},e}(l.RendererView);var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(l.Renderer);n.TileRenderer=_,_.prototype.default_view=n.TileRendererView,_.prototype.type="TileRenderer",_.define({alpha:[h.Number,1],x_range_name:[h.String,"default"],y_range_name:[h.String,"default"],tile_source:[h.Instance,function(){return new a.WMTSTileSource}],render_parents:[h.Bool,!0]}),_.override({level:"underlay"})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(197),o=t(204),s=t(14),a=t(15),l=t(50),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.utils=new o.ProjectionUtils,this.pool=new r.ImagePool,this.tiles={},this.normalize_case()},e.prototype.string_lookup_replace=function(t,e){var n,i,r;i=t;for(n in e)r=e[n],i=i.replace("{"+n+"}",r.toString());return i},e.prototype.normalize_case=function(){"Note: should probably be refactored into subclasses.";var t;return t=this.url,t=t.replace("{x}","{X}"),t=t.replace("{y}","{Y}"),t=t.replace("{z}","{Z}"),t=t.replace("{q}","{Q}"),t=t.replace("{xmin}","{XMIN}"),t=t.replace("{ymin}","{YMIN}"),t=t.replace("{xmax}","{XMAX}"),t=t.replace("{ymax}","{YMAX}"),this.url=t},e.prototype.update=function(){var t,e,n,i;s.logger.debug("TileSource: tile cache count: "+Object.keys(this.tiles).length),e=this.tiles,n=[];for(t in e)i=e[t],i.current=!1,n.push(i.retain=!1);return n},e.prototype.tile_xyz_to_key=function(t,e,n){var i;return i=t+":"+e+":"+n},e.prototype.key_to_tile_xyz=function(t){var e;return function(){var n,i,r,o;for(r=t.split(":"),o=[],n=0,i=r.length;n<i;n++)e=r[n],o.push(parseInt(e));return o}()},e.prototype.sort_tiles_from_center=function(t,e){var n,i,r,o,s,a;return o=e[0],a=e[1],r=e[2],s=e[3],n=(r-o)/2+o,i=(s-a)/2+a,t.sort(function(t,e){var r,o;return r=Math.sqrt(Math.pow(n-t[0],2)+Math.pow(i-t[1],2)),o=Math.sqrt(Math.pow(n-e[0],2)+Math.pow(i-e[1],2)),r-o}),t},e.prototype.prune_tiles=function(){var t,e,n,i,r;e=this.tiles;for(t in e)r=e[t],r.retain=r.current||r.tile_coords[2]<3,r.current&&(this.retain_neighbors(r),this.retain_children(r),this.retain_parents(r));n=this.tiles,i=[];for(t in n)r=n[t],r.retain?i.push(void 0):i.push(this.remove_tile(t));return i},e.prototype.remove_tile=function(t){var e;if(e=this.tiles[t],null!=e)return this.pool.push(e.img),delete this.tiles[t]},e.prototype.get_image_url=function(t,e,n){var i;return i=this.string_lookup_replace(this.url,this.extra_url_vars),i.replace("{X}",t).replace("{Y}",e).replace("{Z}",n)},e.prototype.retain_neighbors=function(t){throw new Error("Not Implemented")},e.prototype.retain_parents=function(t){throw new Error("Not Implemented")},e.prototype.retain_children=function(t){throw new Error("Not Implemented")},e.prototype.tile_xyz_to_quadkey=function(t,e,n){throw new Error("Not Implemented")},e.prototype.quadkey_to_tile_xyz=function(t){throw new Error("Not Implemented")},e}(l.Model);n.TileSource=u,u.prototype.type="TileSource",u.define({url:[a.String,""],tile_size:[a.Number,256],max_zoom:[a.Number,30],min_zoom:[a.Number,0],extra_url_vars:[a.Any,{}],attribution:[a.String,""],x_origin_offset:[a.Number],y_origin_offset:[a.Number],initial_resolution:[a.Number]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(31);n.ProjectionUtils=function(){function t(){this.origin_shift=2*Math.PI*6378137/2}return t.prototype.geographic_to_meters=function(t,e){return i.proj4(i.wgs84,i.mercator,[t,e])},t.prototype.meters_to_geographic=function(t,e){return i.proj4(i.mercator,i.wgs84,[t,e])},t.prototype.geographic_extent_to_meters=function(t){var e,n,i,r;return n=t[0],r=t[1],e=t[2],i=t[3],o=this.geographic_to_meters(n,r),n=o[0],r=o[1],s=this.geographic_to_meters(e,i),e=s[0],i=s[1],[n,r,e,i];var o,s},t.prototype.meters_extent_to_geographic=function(t){var e,n,i,r;return n=t[0],r=t[1],e=t[2],i=t[3],o=this.meters_to_geographic(n,r),n=o[0],r=o[1],s=this.meters_to_geographic(e,i),e=s[0],i=s[1],[n,r,e,i];var o,s},t}()},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(200),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){var i;return i=this.string_lookup_replace(this.url,this.extra_url_vars),i.replace("{X}",t).replace("{Y}",e).replace("{Z}",n)},e}(r.MercatorTileSource);n.TMSTileSource=o,o.prototype.type="TMSTileSource"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(200),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){var i;return i=this.string_lookup_replace(this.url,this.extra_url_vars),r=this.tms_to_wmts(t,e,n),t=r[0],e=r[1],n=r[2],i.replace("{X}",t).replace("{Y}",e).replace("{Z}",n);var r},e}(r.MercatorTileSource);n.WMTSTileSource=o,o.prototype.type="WMTSTileSource"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(215),o=t(20);n.ActionToolButtonView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._clicked=function(){return this.model["do"].emit()},e}(r.ButtonToolButtonView),n.ActionToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model["do"],function(){return this.doit()})},e}(r.ButtonToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this["do"]=new o.Signal(this,"do")},e}(r.ButtonTool);n.ActionTool=s,s.prototype.button_view=n.ActionToolButtonView},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(207),o=t(15);n.HelpToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doit=function(){return window.open(this.model.redirect)},e}(r.ActionToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.HelpTool=s,s.prototype.default_view=n.HelpToolView,s.prototype.type="HelpTool",s.prototype.tool_name="Help",s.prototype.icon="bk-tool-icon-help",s.define({help_tooltip:[o.String,"Click the question mark to learn more about Bokeh plot tools."],redirect:[o.String,"https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#built-in-tools"]}),s.getters({tooltip:function(){return this.help_tooltip}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(207);n.RedoToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this.connect(this.plot_view.state_changed,function(){return n.model.disabled=!n.plot_view.can_redo()})},e.prototype.doit=function(){return this.plot_view.redo()},e}(r.ActionToolView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.RedoTool=o,o.prototype.default_view=n.RedoToolView,o.prototype.type="RedoTool",o.prototype.tool_name="Redo",o.prototype.icon="bk-tool-icon-redo",o.override({disabled:!0})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(207),o=t(3),s=t(15);n.ResetToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doit=function(){return this.plot_view.clear_state(),this.plot_view.reset_range(),this.plot_view.reset_selection(),this.plot_model.plot.trigger_event(new o.Reset)},e}(r.ActionToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.ResetTool=a,a.prototype.default_view=n.ResetToolView,a.prototype.type="ResetTool",a.prototype.tool_name="Reset",a.prototype.icon="bk-tool-icon-reset",a.define({reset_size:[s.Bool,!0]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(207);n.SaveToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doit=function(){return this.plot_view.save("bokeh_plot")},e}(r.ActionToolView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.SaveTool=o,o.prototype.default_view=n.SaveToolView,o.prototype.type="SaveTool",o.prototype.tool_name="Save",o.prototype.icon="bk-tool-icon-save"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(207);n.UndoToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this.connect(this.plot_view.state_changed,function(){return n.model.disabled=!n.plot_view.can_undo()})},e.prototype.doit=function(){return this.plot_view.undo()},e}(r.ActionToolView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.UndoTool=o,o.prototype.default_view=n.UndoToolView,o.prototype.type="UndoTool",o.prototype.tool_name="Undo",o.prototype.icon="bk-tool-icon-undo",o.override({disabled:!0})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(207),o=t(44),s=t(15);n.ZoomInToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doit=function(){var t,e,n,i,r,s;return e=this.plot_model.frame,t=this.model.dimensions,n="width"===t||"both"===t,r="height"===t||"both"===t,s=o.scale_range(e,this.model.factor,n,r),this.plot_view.push_state("zoom_out",{range:s}),this.plot_view.update_range(s,!1,!0),null!=(i=this.model.document)&&i.interactive_start(this.plot_model.plot),null},e}(r.ActionToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.ZoomInTool=a,a.prototype.default_view=n.ZoomInToolView,a.prototype.type="ZoomInTool",a.prototype.tool_name="Zoom In",a.prototype.icon="bk-tool-icon-zoom-in",a.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),a.define({factor:[s.Percent,.1],dimensions:[s.Dimensions,"both"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(207),o=t(44),s=t(15);n.ZoomOutToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doit=function(){var t,e,n,i,r,s;return e=this.plot_model.frame,t=this.model.dimensions,n="width"===t||"both"===t,r="height"===t||"both"===t,s=o.scale_range(e,-this.model.factor,n,r),this.plot_view.push_state("zoom_out",{range:s}),this.plot_view.update_range(s,!1,!0),null!=(i=this.model.document)&&i.interactive_start(this.plot_model.plot),null},e}(r.ActionToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ActionTool);n.ZoomOutTool=a,a.prototype.default_view=n.ZoomOutToolView,a.prototype.type="ZoomOutTool",a.prototype.tool_name="Zoom Out",a.prototype.icon="bk-tool-icon-zoom-out",a.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),a.define({factor:[s.Percent,.1],dimensions:[s.Dimensions,"both"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(6),o=t(231),s=t(5),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this.connect(this.model.change,function(){return n.render()}),this.el.addEventListener("click",function(t){return t.stopPropagation(),t.preventDefault(),n._clicked()}),this.render()},e.prototype.render=function(){return s.empty(this.el),this.el.disabled=this.model.disabled,this.el.classList.add(this.model.icon),this.el.title=this.model.tooltip},e.prototype._clicked=function(){},e}(r.DOMView);n.ButtonToolButtonView=l,l.prototype.className="bk-toolbar-button",n.ButtonToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ToolView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Tool);n.ButtonTool=u,u.prototype.button_view=l,u.prototype.icon=null,u.getters({tooltip:function(){return this.tool_name}}),u.internal({disabled:[a.Boolean,!1]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=t(222),s=t(55),a=t(15);n.BoxSelectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._pan_start=function(t){var e,n;return i=t.bokeh,e=i.sx,n=i.sy,this._base_point=[e,n],null;var i},e.prototype._pan=function(t){var e,n,i,r,o,s,a,l,u;return h=t.bokeh,s=h.sx,l=h.sy,n=[s,l],r=this.plot_model.frame,i=this.model.dimensions,c=this.model._get_dim_limits(this._base_point,n,r,i),a=c[0],u=c[1],this.model.overlay.update({left:a[0],right:a[1],top:u[0],bottom:u[1]}),this.model.select_every_mousemove&&(e=null!=(o=t.srcEvent.shiftKey)&&o,this._do_select(a,u,!1,e)),null;var h,c},e.prototype._pan_end=function(t){var e,n,i,r,o,s,a,l,u;return h=t.bokeh,s=h.sx,l=h.sy,n=[s,l],r=this.plot_model.frame,i=this.model.dimensions,c=this.model._get_dim_limits(this._base_point,n,r,i),a=c[0],u=c[1],e=null!=(o=t.srcEvent.shiftKey)&&o,this._do_select(a,u,!0,e),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null,this.plot_view.push_state("box_select",{selection:this.plot_view.get_selection()}),null;var h,c},e.prototype._do_select=function(t,e,n,i){var r=t[0],o=t[1],s=e[0],a=e[1];void 0===i&&(i=!1);var l;return l={type:"rect",sx0:r,sx1:o,sy0:s,sy1:a},this._select(l,n,i)},e.prototype._emit_callback=function(t){var e,n,i,r,o,s,a,l;n=this.computed_renderers[0],e=this.plot_model.frame,a=e.xscales[n.x_range_name],l=e.yscales[n.y_range_name],i=t.sx0,r=t.sx1,o=t.sy0,s=t.sy1,u=a.r_invert(i,r),t.x0=u[0],t.x1=u[1],h=l.r_invert(o,s),t.y0=h[0],t.y1=h[1],this.model.callback.execute(this.model,{geometry:t});var u,h},e}(o.SelectToolView),i=function(){return new s.BoxAnnotation({level:"overlay",render_mode:"css",top_units:"screen",left_units:"screen",bottom_units:"screen",right_units:"screen",fill_color:{value:"lightgrey"},fill_alpha:{value:.5},line_color:{value:"black"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})};var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o.SelectTool);n.BoxSelectTool=l,l.prototype.default_view=n.BoxSelectToolView,l.prototype.type="BoxSelectTool",l.prototype.tool_name="Box Select",l.prototype.icon="bk-tool-icon-box-select",l.prototype.event_type="pan",l.prototype.default_order=30,l.define({dimensions:[a.Dimensions,"both"],select_every_mousemove:[a.Bool,!1],callback:[a.Instance],overlay:[a.Instance,i]}),l.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=t(218),s=t(55),a=t(15);n.BoxZoomToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._match_aspect=function(t,e,n){var i,r,o,s,a,l,u,h,c,_;return i=n.bbox.aspect,h=Math.abs(t[0]-e[0]),u=Math.abs(t[1]-e[1]),l=0===u?0:h/u,l>=i?(p=[1,l/i],c=p[0],_=p[1]):(d=[i/l,1],c=d[0],_=d[1]),t[0]<=e[0]?(o=t[0],s=t[0]+h*c,s>hend&&(s=hend)):(s=t[0],o=t[0]-h*c,o<hstart&&(o=hstart)),h=Math.abs(s-o),t[1]<=e[1]?(r=t[1],a=t[1]+h/i,a>vend&&(a=vend)):(a=t[1],r=t[1]-h/i,r<vstart&&(r=vstart)),u=Math.abs(a-r),t[0]<=e[0]?s=t[0]+i*u:o=t[0]-i*u,[[o,s],[r,a]];var p,d},e.prototype._pan_start=function(t){return this._base_point=[t.bokeh.sx,t.bokeh.sy],null},e.prototype._pan=function(t){var e,n,i,r,o;return e=[t.bokeh.sx,t.bokeh.sy],i=this.plot_model.frame,n=this.model.dimensions,this.model.match_aspect&&"both"===n?(s=this._match_aspect(this._base_point,e,i),r=s[0],o=s[1]):(a=this.model._get_dim_limits(this._base_point,e,i,n),r=a[0],o=a[1]),this.model.overlay.update({left:r[0],right:r[1],top:o[0],bottom:o[1]}),null;var s,a},e.prototype._pan_end=function(t){var e,n,i,r,o;return e=[t.bokeh.sx,t.bokeh.sy],i=this.plot_model.frame,n=this.model.dimensions,this.model.match_aspect&&"both"===n?(s=this._match_aspect(this._base_point,e,i),r=s[0],o=s[1]):(a=this.model._get_dim_limits(this._base_point,e,i,n),r=a[0],o=a[1]),this._update(r,o),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null,null;var s,a},e.prototype._update=function(t,e){var n,i,r,o,s,a,l,u,h,c=t[0],_=t[1],p=e[0],d=e[1];if(!(Math.abs(_-c)<=5||Math.abs(d-p)<=5)){l={},r=this.plot_view.frame.xscales;for(i in r)s=r[i],f=s.r_invert(c,_),a=f[0],n=f[1],l[i]={start:a,end:n};u={},o=this.plot_view.frame.yscales;for(i in o)s=o[i],m=s.r_invert(p,d),a=m[0],n=m[1],u[i]={start:a,end:n};return h={xrs:l,yrs:u},this.plot_view.push_state("box_zoom",{range:h}),this.plot_view.update_range(h);var f,m}},e}(o.GestureToolView),i=function(){return new s.BoxAnnotation({level:"overlay",render_mode:"css",top_units:"screen",left_units:"screen",bottom_units:"screen",right_units:"screen",fill_color:{value:"lightgrey"},fill_alpha:{value:.5},line_color:{value:"black"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})};var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o.GestureTool);n.BoxZoomTool=l,l.prototype.default_view=n.BoxZoomToolView,l.prototype.type="BoxZoomTool",l.prototype.tool_name="Box Zoom",l.prototype.icon="bk-tool-icon-box-zoom",l.prototype.event_type="pan",l.prototype.default_order=20,l.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),l.define({dimensions:[a.Dimensions,"both"],overlay:[a.Instance,i],match_aspect:[a.Bool,!1]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(215),o=t(230);n.GestureToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ButtonToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.ButtonTool);n.GestureTool=s,s.prototype.button_view=o.OnOffButtonView,s.prototype.event_type=null,s.prototype.default_order=null},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=t(222),s=t(62),a=t(15);n.LassoSelectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model.properties.active.change,function(){return this._active_change()}),this.data=null},e.prototype._active_change=function(){if(!this.model.active)return this._clear_overlay()},e.prototype._keyup=function(t){if(13===t.keyCode)return this._clear_overlay()},e.prototype._pan_start=function(t){var e,n;return i=t.bokeh,e=i.sx,n=i.sy,this.data={sx:[e],sy:[n]},null;var i},e.prototype._pan=function(t){var e,n,i,r,o;if(s=t.bokeh,r=s.sx,o=s.sy,a=this.plot_model.frame.bbox.clip(r,o),r=a[0],o=a[1],this.data.sx.push(r),this.data.sy.push(o),n=this.model.overlay,n.update({xs:this.data.sx,ys:this.data.sy}),this.model.select_every_mousemove)return e=null!=(i=t.srcEvent.shiftKey)&&i,this._do_select(this.data.sx,this.data.sy,!1,e);var s,a},e.prototype._pan_end=function(t){var e,n;return this._clear_overlay(),e=null!=(n=t.srcEvent.shiftKey)&&n,this._do_select(this.data.sx,this.data.sy,!0,e),this.plot_view.push_state("lasso_select",{selection:this.plot_view.get_selection()})},e.prototype._clear_overlay=function(){return this.model.overlay.update({xs:[],ys:[]})},e.prototype._do_select=function(t,e,n,i){var r;return r={type:"poly",sx:t,sy:e},this._select(r,n,i)},e.prototype._emit_callback=function(t){var e,n,i,r;n=this.computed_renderers[0],e=this.plot_model.frame,i=e.xscales[n.x_range_name],r=e.yscales[n.y_range_name],t.x=i.v_invert(t.sx),t.y=r.v_invert(t.sy),this.model.callback.execute(this.model,{geometry:t})},e}(o.SelectToolView),i=function(){return new s.PolyAnnotation({level:"overlay",xs_units:"screen",ys_units:"screen",fill_color:{value:"lightgrey"},fill_alpha:{value:.5},line_color:{value:"black"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})};var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o.SelectTool);n.LassoSelectTool=l,l.prototype.default_view=n.LassoSelectToolView,l.prototype.type="LassoSelectTool",l.prototype.tool_name="Lasso Select",l.prototype.icon="bk-tool-icon-lasso-select",l.prototype.event_type="pan",l.prototype.default_order=12,l.define({select_every_mousemove:[a.Bool,!0],callback:[a.Instance],overlay:[a.Instance,i]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(218),o=t(15);n.PanToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._pan_start=function(t){var e,n,i,r,o,s;return this.last_dx=0,this.last_dy=0,a=t.bokeh,r=a.sx,o=a.sy,e=this.plot_view.frame.bbox,e.contains(r,o)||(n=e.h_range,s=e.v_range,(r<n.start||r>n.end)&&(this.v_axis_only=!0),(o<s.start||o>s.end)&&(this.h_axis_only=!0)),null!=(i=this.model.document)?i.interactive_start(this.plot_model.plot):void 0;var a},e.prototype._pan=function(t){var e;return this._update(t.deltaX,t.deltaY),null!=(e=this.model.document)?e.interactive_start(this.plot_model.plot):void 0},e.prototype._pan_end=function(t){if(this.h_axis_only=!1,this.v_axis_only=!1,null!=this.pan_info)return this.plot_view.push_state("pan",{range:this.pan_info})},e.prototype._update=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T;r=this.plot_view.frame,l=t-this.last_dx,u=e-this.last_dy,o=r.bbox.h_range,y=o.start-l,g=o.end-l,M=r.bbox.v_range,k=M.start-u,w=M.end-u,n=this.model.dimensions,"width"!==n&&"both"!==n||this.v_axis_only?(m=o.start,v=o.end,p=0):(m=y,v=g,p=-l),"height"!==n&&"both"!==n||this.h_axis_only?(b=M.start,x=M.end,d=0):(b=k,x=w,d=-u),this.last_dx=t,this.last_dy=e,S={},h=r.xscales;for(a in h)_=h[a],O=_.r_invert(m,v),f=O[0],i=O[1],S[a]={start:f,end:i};T={},c=r.yscales;for(a in c)_=c[a],A=_.r_invert(b,x),f=A[0],i=A[1],T[a]={start:f,end:i};return this.pan_info={xrs:S,yrs:T,sdx:p,sdy:d},this.plot_view.update_range(this.pan_info,s=!0),null;var O,A},e}(r.GestureToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.PanTool=s,s.prototype.default_view=n.PanToolView,s.prototype.type="PanTool",s.prototype.tool_name="Pan",s.prototype.event_type="pan",s.prototype.default_order=10,s.define({dimensions:[o.Dimensions,"both"]}),s.getters({tooltip:function(){return this._get_dim_tooltip("Pan",this.dimensions)},icon:function(){var t;return t=function(){switch(this.dimensions){case"both":return"pan";case"width":return"xpan";case"height":return"ypan"}}.call(this),"bk-tool-icon-"+t}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=t(222),s=t(62),a=t(15),l=t(22);n.PolySelectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model.properties.active.change,function(){return this._active_change()}),this.data={sx:[],sy:[]}},e.prototype._active_change=function(){if(!this.model.active)return this._clear_data()},e.prototype._keyup=function(t){if(13===t.keyCode)return this._clear_data()},e.prototype._doubletap=function(t){var e,n;return e=null!=(n=t.srcEvent.shiftKey)&&n,this._do_select(this.data.sx,this.data.sy,!0,e),this.plot_view.push_state("poly_select",{selection:this.plot_view.get_selection()}),this._clear_data()},e.prototype._clear_data=function(){return this.data={sx:[],sy:[]},this.model.overlay.update({xs:[],ys:[]})},e.prototype._tap=function(t){var e,n,i;if(r=t.bokeh,n=r.sx,i=r.sy,e=this.plot_model.frame,e.bbox.contains(n,i)){return this.data.sx.push(n),this.data.sy.push(i),this.model.overlay.update({xs:l.copy(this.data.sx),ys:l.copy(this.data.sy)});var r}},e.prototype._do_select=function(t,e,n,i){var r;return r={type:"poly",sx:t,sy:e},this._select(r,n,i)},e.prototype._emit_callback=function(t){var e,n,i,r;n=this.computed_renderers[0],e=this.plot_model.frame,i=e.xscales[n.x_range_name],r=e.yscales[n.y_range_name],t.x=i.v_invert(t.sx),t.y=i.v_invert(t.sy),this.model.callback.execute(this.model,{geometry:t})},e}(o.SelectToolView),i=function(){return new s.PolyAnnotation({level:"overlay",xs_units:"screen",ys_units:"screen",fill_color:{value:"lightgrey"},fill_alpha:{value:.5},line_color:{value:"black"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o.SelectTool);n.PolySelectTool=u,u.prototype.default_view=n.PolySelectToolView,u.prototype.type="PolySelectTool",u.prototype.tool_name="Poly Select",u.prototype.icon="bk-tool-icon-polygon-select",u.prototype.event_type="tap",u.prototype.default_order=11,u.define({callback:[a.Instance],overlay:[a.Instance,i]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(218),o=t(161),s=t(162),a=t(14),l=t(15),u=t(30),h=t(3),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._computed_renderers_by_data_source=function(){var t,e,n,i,r,a;for(r={},i=this.computed_renderers,t=0,e=i.length;t<e;t++)n=i[t],n instanceof s.GraphRenderer?a=n.node_renderer.data_source.id:n instanceof o.GlyphRenderer&&(a=n.data_source.id),a in r?r[a]=r[a].concat([n]):r[a]=[n];return r},e.prototype._keyup=function(t){var e,n,i,r,o,s,a;if(27===t.keyCode){for(o=this.computed_renderers,s=[],n=0,i=o.length;n<i;n++)r=o[n],e=r.data_source,a=e.selection_manager,s.push(a.clear());return s}},e.prototype._select=function(t,e,n){var i,r,o,s,a,l,u,h;u=this._computed_renderers_by_data_source();for(i in u){for(l=u[i],h=l[0].get_selection_manager(),a=[],r=0,o=l.length;r<o;r++)s=l[r],s.id in this.plot_view.renderer_views&&a.push(this.plot_view.renderer_views[s.id]);h.select(a,t,e,n)}return null!=this.model.callback&&this._emit_callback(t),this._emit_selection_event(t,e),null},e.prototype._emit_selection_event=function(t,e){void 0===e&&(e=!0);var n,i,r,o,s,l;switch(n=u.clone(t),s=this.plot_view.frame.xscales["default"],l=this.plot_view.frame.yscales["default"],n.type){case"point":n.x=s.invert(n.sx),n.y=l.invert(n.sy);break;case"rect":c=s.r_invert(n.sx0,n.sx1),n.x0=c[0],n.x1=c[1],_=l.r_invert(n.sy0,n.sy1),n.y0=_[0],n.y1=_[1];break;case"poly":for(n.x=new Array(n.sx.length),n.y=new Array(n.sy.length),i=r=0,o=n.sx.length;0<=o?r<o:r>o;i=0<=o?++r:--r)n.x[i]=s.invert(n.sx[i]),n.y[i]=l.invert(n.sy[i]);break;default:a.logger.debug("Unrecognized selection geometry type: '"+n.type+"'")}return this.plot_model.plot.trigger_event(new h.SelectionGeometry({geometry:n,"final":e}));var c,_},e}(r.GestureToolView);n.SelectToolView=c,c.getters({computed_renderers:function(){var t,e,n,i;return i=this.model.renderers,e=this.model.names,0===i.length&&(t=this.plot_model.plot.renderers,i=function(){var e,i,r;for(r=[],e=0,i=t.length;e<i;e++)n=t[e],(n instanceof o.GlyphRenderer||n instanceof s.GraphRenderer)&&r.push(n);return r}()),e.length>0&&(i=function(){var t,r,o;for(o=[],t=0,r=i.length;t<r;t++)n=i[t],e.indexOf(n.name)>=0&&o.push(n);return o}()),i}});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.SelectTool=_,_.define({renderers:[l.Array,[]],names:[l.Array,[]]}),_.internal({multi_select_modifier:[l.String,"shift"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(222),o=t(15),s=t(42);n.TapToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._tap=function(t){var e,n,i,r;return o=t.bokeh,i=o.sx,r=o.sy,e=null!=(n=t.srcEvent.shiftKey)&&n,this._select(i,r,!0,e);var o},e.prototype._select=function(t,e,n,i){var r,o,a,l,u,h,c,_,p,d,f,m,v;if(u={type:"point",sx:t,sy:e},o=this.model.callback,a={geometries:u},"select"===this.model.behavior){m=this._computed_renderers_by_data_source();for(r in m)f=m[r],v=f[0].get_selection_manager(),p=function(){var t,e,n;for(n=[],t=0,e=f.length;t<e;t++)_=f[t],n.push(this.plot_view.renderer_views[_.id]);return n}.call(this),l=v.select(p,u,n,i),l&&null!=o&&(a.source=v.source,s.isFunction(o)?o(this,a):o.execute(this,a));this._emit_selection_event(u),this.plot_view.push_state("tap",{selection:this.plot_view.get_selection()})}else for(d=this.computed_renderers,h=0,c=d.length;h<c;h++)_=d[h],v=_.get_selection_manager(),l=v.inspect(this.plot_view.renderer_views[_.id],u),l&&null!=o&&(a.source=v.source,s.isFunction(o)?o(this,a):o.execute(this,a));return null},e}(r.SelectToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.SelectTool);n.TapTool=a,a.prototype.default_view=n.TapToolView,a.prototype.type="TapTool",a.prototype.tool_name="Tap",a.prototype.icon="bk-tool-icon-tap-select",a.prototype.event_type="tap",a.prototype.default_order=10,a.define({behavior:[o.String,"select"],callback:[o.Any]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(218),o=t(15);n.WheelPanToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._scroll=function(t){var e;return e=this.model.speed*t.bokeh.delta,e>.9?e=.9:e<-.9&&(e=-.9),this._update_ranges(e)},e.prototype._update_ranges=function(t){var e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;switch(n=this.plot_model.frame,i=n.bbox.h_range,x=n.bbox.v_range,M=[i.start,i.end],d=M[0],p=M[1],S=[x.start,x.end],y=S[0],g=S[1],this.model.dimension){case"height":b=Math.abs(g-y),c=d,_=p,m=y-b*t,v=g-b*t;break;case"width":f=Math.abs(p-d),c=d-f*t,_=p-f*t,m=y,v=g}w={},s=n.xscales;for(r in s)u=s[r],T=u.r_invert(c,_),h=T[0],e=T[1],w[r]={start:h,end:e};k={},a=n.yscales;for(r in a)u=a[r],O=u.r_invert(m,v),h=O[0],e=O[1],k[r]={
  start:h,end:e};return o={xrs:w,yrs:k,factor:t},this.plot_view.push_state("wheel_pan",{range:o}),this.plot_view.update_range(o,!1,!0),null!=(l=this.model.document)&&l.interactive_start(this.plot_model.plot),null;var M,S,T,O},e}(r.GestureToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.WheelPanTool=s,s.prototype.type="WheelPanTool",s.prototype.default_view=n.WheelPanToolView,s.prototype.tool_name="Wheel Pan",s.prototype.icon="bk-tool-icon-wheel-pan",s.prototype.event_type="scroll",s.prototype.default_order=12,s.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimension)}}),s.define({dimension:[o.Dimension,"width"]}),s.internal({speed:[o.Number,.001]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(218),o=t(44),s=t(15);n.WheelZoomToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._pinch=function(t){var e;return e=t.scale>=1?20*(t.scale-1):-20/t.scale,t.bokeh.delta=e,this._scroll(t)},e.prototype._scroll=function(t){var e,n,i,r,s,a,l,u,h,c,_;return i=this.plot_model.frame,s=i.bbox.h_range,c=i.bbox.v_range,p=t.bokeh,l=p.sx,u=p.sy,e=this.model.dimensions,r=("width"===e||"both"===e)&&s.start<l&&l<s.end,h=("height"===e||"both"===e)&&c.start<u&&u<c.end,n=this.model.speed*t.bokeh.delta,_=o.scale_range(i,n,r,h,{x:l,y:u}),this.plot_view.push_state("wheel_zoom",{range:_}),this.plot_view.update_range(_,!1,!0),null!=(a=this.model.document)&&a.interactive_start(this.plot_model.plot),null;var p},e}(r.GestureToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.WheelZoomTool=a,a.prototype.default_view=n.WheelZoomToolView,a.prototype.type="WheelZoomTool",a.prototype.tool_name="Wheel Zoom",a.prototype.icon="bk-tool-icon-wheel-zoom",a.prototype.event_type="ontouchstart"in window||navigator.maxTouchPoints>0?"pinch":"scroll",a.prototype.default_order=10,a.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),a.define({dimensions:[s.Dimensions,"both"]}),a.internal({speed:[s.Number,1/600]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(207);n.ActionTool=i.ActionTool;var r=t(208);n.HelpTool=r.HelpTool;var o=t(209);n.RedoTool=o.RedoTool;var s=t(210);n.ResetTool=s.ResetTool;var a=t(211);n.SaveTool=a.SaveTool;var l=t(212);n.UndoTool=l.UndoTool;var u=t(213);n.ZoomInTool=u.ZoomInTool;var h=t(214);n.ZoomOutTool=h.ZoomOutTool;var c=t(215);n.ButtonTool=c.ButtonTool;var _=t(216);n.BoxSelectTool=_.BoxSelectTool;var p=t(217);n.BoxZoomTool=p.BoxZoomTool;var d=t(218);n.GestureTool=d.GestureTool;var f=t(219);n.LassoSelectTool=f.LassoSelectTool;var m=t(220);n.PanTool=m.PanTool;var v=t(221);n.PolySelectTool=v.PolySelectTool;var g=t(222);n.SelectTool=g.SelectTool;var y=t(223);n.TapTool=y.TapTool;var b=t(224);n.WheelPanTool=b.WheelPanTool;var x=t(225);n.WheelZoomTool=x.WheelZoomTool;var w=t(227);n.CrosshairTool=w.CrosshairTool;var k=t(228);n.HoverTool=k.HoverTool;var M=t(229);n.InspectTool=M.InspectTool;var S=t(231);n.Tool=S.Tool;var T=t(232);n.ToolProxy=T.ToolProxy;var O=t(233);n.Toolbar=O.Toolbar;var A=t(234);n.ToolbarBase=A.ToolbarBase;var E=t(235);n.ProxyToolbar=E.ProxyToolbar;var j=t(235);n.ToolbarBox=j.ToolbarBox},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(229),o=t(63),s=t(15),a=t(30);n.CrosshairToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._move=function(t){var e,n;if(this.model.active){return i=t.bokeh,e=i.sx,n=i.sy,this.plot_model.frame.bbox.contains(e,n)||(e=n=null),this._update_spans(e,n);var i}},e.prototype._move_exit=function(t){return this._update_spans(null,null)},e.prototype._update_spans=function(t,e){var n;if(n=this.model.dimensions,"width"!==n&&"both"!==n||(this.model.spans.width.computed_location=e),"height"===n||"both"===n)return this.model.spans.height.computed_location=t},e}(r.InspectToolView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.spans={width:new o.Span({for_hover:!0,dimension:"width",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha}),height:new o.Span({for_hover:!0,dimension:"height",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha})}},e}(r.InspectTool);n.CrosshairTool=l,l.prototype.default_view=n.CrosshairToolView,l.prototype.type="CrosshairTool",l.prototype.tool_name="Crosshair",l.prototype.icon="bk-tool-icon-crosshair",l.define({dimensions:[s.Dimensions,"both"],line_color:[s.Color,"black"],line_width:[s.Number,1],line_alpha:[s.Number,1]}),l.internal({location_units:[s.SpatialUnits,"screen"],render_mode:[s.RenderMode,"css"],spans:[s.Any]}),l.getters({tooltip:function(){return this._get_dim_tooltip("Crosshair",this.dimensions)},synthetic_renderers:function(){return a.values(this.spans)}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(229),o=t(67),s=t(161),a=t(162),l=t(9),u=t(39),h=t(5),c=t(15),_=t(26),p=t(30),d=t(42),f=t(4);n._nearest_line_hit=function(t,e,n,i,r,o){var s,a,u,h,c,_;if(s=r[t],a=o[t],u=r[t+1],h=o[t+1],"span"===e.type)switch(e.direction){case"h":c=Math.abs(s-n),_=Math.abs(u-n);break;case"v":c=Math.abs(a-i),_=Math.abs(h-i)}else c=l.dist_2_pts(s,a,n,i),_=l.dist_2_pts(u,h,n,i);return c<_?[[s,a],t]:[[u,h],t+1]},n._line_hit=function(t,e,n){return[[t[n],e[n]],n]};var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.ttviews={}},e.prototype.remove=function(){return f.remove_views(this.ttviews),t.prototype.remove.call(this)},e.prototype.connect_signals=function(){var e,n,i,r;for(t.prototype.connect_signals.call(this),r=this.computed_renderers,e=0,n=r.length;e<n;e++)i=r[e],i instanceof s.GlyphRenderer?this.connect(i.data_source.inspect,this._update):i instanceof a.GraphRenderer&&(this.connect(i.node_renderer.data_source.inspect,this._update),this.connect(i.edge_renderer.data_source.inspect,this._update));return this.connect(this.model.properties.renderers.change,function(){return this._computed_renderers=this._ttmodels=null}),this.connect(this.model.properties.names.change,function(){return this._computed_renderers=this._ttmodels=null}),this.connect(this.model.properties.tooltips.change,function(){return this._ttmodels=null})},e.prototype._compute_renderers=function(){var t,e,n,i;return i=this.model.renderers,e=this.model.names,0===i.length&&(t=this.plot_model.plot.renderers,i=function(){var e,i,r;for(r=[],e=0,i=t.length;e<i;e++)n=t[e],(n instanceof s.GlyphRenderer||n instanceof a.GraphRenderer)&&r.push(n);return r}()),e.length>0&&(i=function(){var t,r,o;for(o=[],t=0,r=i.length;t<r;t++)n=i[t],e.indexOf(n.name)>=0&&o.push(n);return o}()),i},e.prototype._compute_ttmodels=function(){var t,e,n,i,r,l,u;if(u={},l=this.model.tooltips,null!=l)for(i=this.computed_renderers,t=0,e=i.length;t<e;t++)n=i[t],n instanceof s.GlyphRenderer?(r=new o.Tooltip({custom:d.isString(l)||d.isFunction(l),attachment:this.model.attachment,show_arrow:this.model.show_arrow}),u[n.id]=r):n instanceof a.GraphRenderer&&(r=new o.Tooltip({custom:d.isString(l)||d.isFunction(l),attachment:this.model.attachment,show_arrow:this.model.show_arrow}),u[n.node_renderer.id]=r,u[n.edge_renderer.id]=r);return f.build_views(this.ttviews,p.values(u),{parent:this,plot_view:this.plot_view}),u},e.prototype._clear=function(){var t,e,n,i;this._inspect(Infinity,Infinity),t=this.ttmodels,e=[];for(n in t)i=t[n],e.push(i.clear());return e},e.prototype._move=function(t){var e,n;if(this.model.active){return i=t.bokeh,e=i.sx,n=i.sy,this.plot_view.frame.bbox.contains(e,n)?this._inspect(e,n):this._clear();var i}},e.prototype._move_exit=function(){return this._clear()},e.prototype._inspect=function(t,e){var n,i,r,o,s,a,l;for(l="mouse"===this.model.mode?"point":"span",n={type:l,sx:t,sy:e},"span"===l&&(n.direction="vline"===this.model.mode?"h":"v"),s=this.computed_renderers,i=0,r=s.length;i<r;i++)o=s[i],a=o.get_selection_manager(),a.inspect(this.plot_view.renderer_views[o.id],n);null!=this.model.callback&&this._emit_callback(n)},e.prototype._update=function(t){var e,i,r,o,a,l,u,h,c,_,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j,P,z,C,N,D,F=t[0],I=t[1].geometry;if(this.model.active&&(j=null!=(b=this.ttmodels[F.model.id])?b:null,null!=j&&(j.clear(),c=F.model.get_selection_manager().inspectors[F.model.id].indices,F.model instanceof s.GlyphRenderer&&(c=F.model.view.convert_selection_to_subset(c)),r=F.model.get_selection_manager().source,!c.is_empty()))){for(o=this.plot_model.frame,A=I.sx,E=I.sy,C=o.xscales[F.model.x_range_name],D=o.yscales[F.model.y_range_name],z=C.invert(A),N=D.invert(E),a=F.glyph,x=c["0d"].indices,f=0,v=x.length;f<v;f++){switch(l=x[f],e=a._x[l+1],i=a._y[l+1],u=l,this.model.line_policy){case"interp":B=a.get_interpolation_hit(l,I),e=B[0],i=B[1],T=C.compute(e),O=D.compute(i);break;case"prev":R=n._line_hit(a.sx,a.sy,l),L=R[0],T=L[0],O=L[1],u=R[1];break;case"next":V=n._line_hit(a.sx,a.sy,l+1),G=V[0],T=G[0],O=G[1],u=V[1];break;case"nearest":U=n._nearest_line_hit(l,I,A,E,a.sx,a.sy),q=U[0],T=q[0],O=q[1],u=U[1],e=a._x[u],i=a._y[u];break;default:Y=[A,E],T=Y[0],O=Y[1]}P={index:u,x:z,y:N,sx:A,sy:E,data_x:e,data_y:i,rx:T,ry:O},j.add(T,O,this._render_tooltips(r,u,P))}for(w=c["1d"].indices,m=0,g=w.length;m<g;m++)if(l=w[m],p.isEmpty(c["2d"].indices))e=null!=(M=a._x)?M[l]:void 0,i=null!=(S=a._y)?S[l]:void 0,"snap_to_data"===this.model.point_policy?(y=a.get_anchor_point(this.model.anchor,l,[A,E]),null==y&&(y=a.get_anchor_point("center",l,[A,E])),T=y.x,O=y.y):(K=[A,E],T=K[0],O=K[1]),h=F.model instanceof s.GlyphRenderer?F.model.view.convert_indices_from_subset([l])[0]:l,P={index:h,x:z,y:N,sx:A,sy:E,data_x:e,data_y:i},j.add(T,O,this._render_tooltips(r,h,P));else{k=c["2d"].indices;for(l in k){switch(_=k[l][0],e=a._xs[l][_],i=a._ys[l][_],d=_,this.model.line_policy){case"interp":X=a.get_interpolation_hit(l,_,I),e=X[0],i=X[1],T=C.compute(e),O=D.compute(i);break;case"prev":W=n._line_hit(a.sxs[l],a.sys[l],_),H=W[0],T=H[0],O=H[1],d=W[1];break;case"next":J=n._line_hit(a.sxs[l],a.sys[l],_+1),Q=J[0],T=Q[0],O=Q[1],d=J[1];break;case"nearest":$=n._nearest_line_hit(_,I,A,E,a.sxs[l],a.sys[l]),Z=$[0],T=Z[0],O=Z[1],d=$[1],e=a._xs[l][d],i=a._ys[l][d]}h=F.model instanceof s.GlyphRenderer?F.model.view.convert_indices_from_subset([l])[0]:l,P={index:h,segment_index:d,x:z,y:N,sx:A,sy:E,data_x:e,data_y:i},j.add(T,O,this._render_tooltips(r,h,P))}}return null;var B,R,L,V,G,U,q,Y,X,W,H,J,Q,$,Z,K}},e.prototype._emit_callback=function(t){var e,n,i,r,o,s,a,l,u,h,c;for(u=this.computed_renderers,o=0,s=u.length;o<s;o++)l=u[o],r=l.data_source.inspected,i=this.plot_model.frame,h=i.xscales[l.x_range_name],c=i.yscales[l.y_range_name],t.x=h.invert(t.sx),t.y=c.invert(t.sy),e=this.model.callback,_=[e,{index:r,geometry:t,renderer:l}],a=_[0],n=_[1],d.isFunction(e)?e(a,n):e.execute(a,n);var _},e.prototype._render_tooltips=function(t,e,n){var i,r,o,s,a,l,c,p,f,m,v,g,y,b,x,w;if(x=this.model.tooltips,d.isString(x))return a=h.div(),a.innerHTML=u.replace_placeholders(x,t,e,this.model.formatters,n),a;if(d.isFunction(x))return x(t,n);for(y=h.div({style:{display:"table",borderSpacing:"2px"}}),c=0,f=x.length;c<f;c++)if(k=x[c],p=k[0],w=k[1],g=h.div({style:{display:"table-row"}}),y.appendChild(g),i=h.div({style:{display:"table-cell"},"class":"bk-tooltip-row-label"},p+": "),g.appendChild(i),i=h.div({style:{display:"table-cell"},"class":"bk-tooltip-row-value"}),g.appendChild(i),w.indexOf("$color")>=0){if(M=w.match(/\$color(\[.*\])?:(\w*)/),m=M[0],v=M[1],r=M[2],s=t.get_column(r),null==s){a=h.span({},r+" unknown"),i.appendChild(a);continue}if(l=(null!=v?v.indexOf("hex"):void 0)>=0,b=(null!=v?v.indexOf("swatch"):void 0)>=0,o=s[e],null==o){a=h.span({},"(null)"),i.appendChild(a);continue}l&&(o=_.color2hex(o)),a=h.span({},o),i.appendChild(a),b&&(a=h.span({"class":"bk-tooltip-color-block",style:{backgroundColor:o}}," "),i.appendChild(a))}else w=w.replace("$~","$data_"),a=h.span(),a.innerHTML=u.replace_placeholders(w,t,e,this.model.formatters,n),i.appendChild(a);return y;var k,M},e}(r.InspectToolView);n.HoverToolView=m,m.getters({computed_renderers:function(){return null==this._computed_renderers&&(this._computed_renderers=this._compute_renderers()),this._computed_renderers},ttmodels:function(){return null==this._ttmodels&&(this._ttmodels=this._compute_ttmodels()),this._ttmodels}});var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.InspectTool);n.HoverTool=v,v.prototype.default_view=m,v.prototype.type="HoverTool",v.prototype.tool_name="Hover",v.prototype.icon="bk-tool-icon-hover",v.define({tooltips:[c.Any,[["index","$index"],["data (x, y)","($x, $y)"],["screen (x, y)","($sx, $sy)"]]],formatters:[c.Any,{}],renderers:[c.Array,[]],names:[c.Array,[]],mode:[c.String,"mouse"],point_policy:[c.String,"snap_to_data"],line_policy:[c.String,"nearest"],show_arrow:[c.Boolean,!0],anchor:[c.String,"center"],attachment:[c.String,"horizontal"],callback:[c.Any]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(215),s=t(230);n.InspectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ButtonToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ButtonTool);n.InspectTool=a,a.prototype.button_view=s.OnOffButtonView,a.prototype.event_type="move",a.define({toggleable:[r.Bool,!0]}),a.override({active:!0})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(215);n.OnOffButtonView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){return t.prototype.render.call(this),this.model.active?this.el.classList.add("bk-active"):this.el.classList.remove("bk-active")},e.prototype._clicked=function(){var t;return t=this.model.active,this.model.active=!t},e}(r.ButtonToolButtonView)},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(45),s=t(22),a=t(50),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view=e.plot_view},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){return e.model.active?e.activate():e.deactivate()})},e.prototype.activate=function(){},e.prototype.deactivate=function(){},e}(o.View);n.ToolView=l,l.getters({plot_model:function(){return this.plot_view.model}});var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._get_dim_tooltip=function(t,e){switch(e){case"width":return t+" (x-axis)";case"height":return t+" (y-axis)";case"both":return t}},e.prototype._get_dim_limits=function(t,e,n,i){var r,o,a,l,u=t[0],h=t[1],c=e[0],_=e[1];return r=n.bbox.h_range,"width"===i||"both"===i?(o=[s.min([u,c]),s.max([u,c])],o=[s.max([o[0],r.start]),s.min([o[1],r.end])]):o=[r.start,r.end],l=n.bbox.v_range,"height"===i||"both"===i?(a=[s.min([h,_]),s.max([h,_])],a=[s.max([a[0],l.start]),s.min([a[1],l.end])]):a=[l.start,l.end],[o,a]},e}(a.Model);n.Tool=u,u.getters({synthetic_renderers:function(){return[]}}),u.internal({active:[r.Boolean,!1]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(20),s=t(50),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this["do"]=new o.Signal(this,"do"),this.connect(this["do"],function(){return this.doit()}),this.connect(this.properties.active.change,function(){return this.set_active()})},e.prototype.doit=function(){var t,e,n,i;for(n=this.tools,t=0,e=n.length;t<e;t++)i=n[t],i["do"].emit();return null},e.prototype.set_active=function(){var t,e,n,i;for(n=this.tools,t=0,e=n.length;t<e;t++)i=n[t],i.active=this.active;return null},e.prototype._clicked=function(){var t;return t=this.model.active,this.model.active=!t},e}(s.Model);n.ToolProxy=a,a.getters({button_view:function(){return this.tools[0].button_view},event_type:function(){return this.tools[0].event_type},tooltip:function(){return this.tools[0].tool_name},tool_name:function(){return this.tools[0].tool_name},icon:function(){return this.tools[0].icon}}),a.define({tools:[r.Array,[]],active:[r.Bool,!1],disabled:[r.Bool,!1]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=[].indexOf,o=t(15),s=t(22),a=t(14),l=t(207),u=t(208),h=t(218),c=t(229),_=t(234),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.connect(this.properties.tools.change,function(){return this._init_tools()}),this._init_tools()},e.prototype._init_tools=function(){var t,e,n,i,o,_,p,d=this;for(o=this.tools,n=0,i=o.length;n<i;n++)if(_=o[n],_ instanceof c.InspectTool)s.any(this.inspectors,function(t){return t.id===_.id})||(this.inspectors=this.inspectors.concat([_]));else if(_ instanceof u.HelpTool)s.any(this.help,function(t){return t.id===_.id})||(this.help=this.help.concat([_]));else if(_ instanceof l.ActionTool)s.any(this.actions,function(t){return t.id===_.id})||(this.actions=this.actions.concat([_]));else if(_ instanceof h.GestureTool){if(e=_.event_type,!(e in this.gestures)){a.logger.warn("Toolbar: unknown event type '"+e+"' for tool: "+_.type+" ("+_.id+")");continue}s.any(this.gestures[e].tools,function(t){return t.id===_.id})||(this.gestures[e].tools=this.gestures[e].tools.concat([_])),this.connect(_.properties.active.change,this._active_change.bind(this,_))}"auto"===this.active_inspect||(this.active_inspect instanceof c.InspectTool?this.inspectors.map(function(t){if(t!==d.active_inspect)return t.active=!1}):this.active_inspect instanceof Array?this.inspectors.map(function(t){if(r.call(d.active_inspect,t)<0)return t.active=!1}):null===this.active_inspect&&this.inspectors.map(function(t){return t.active=!1})),t=function(t){return t.active?d._active_change(t):t.active=!0};for(e in this.gestures)if(p=this.gestures[e].tools,0!==p.length){if(this.gestures[e].tools=s.sortBy(p,function(t){return t.default_order}),"tap"===e){if(null===this.active_tap)continue;t("auto"===this.active_tap?this.gestures[e].tools[0]:this.active_tap)}if("pan"===e){if(null===this.active_drag)continue;t("auto"===this.active_drag?this.gestures[e].tools[0]:this.active_drag)}if("pinch"===e||"scroll"===e){if(null===this.active_scroll||"auto"===this.active_scroll)continue;t(this.active_scroll)}}return null},e}(_.ToolbarBase);n.Toolbar=p,p.prototype.type="Toolbar",p.prototype.default_view=_.ToolbarBaseView,p.define({active_drag:[o.Any,"auto"],active_inspect:[o.Any,"auto"],active_scroll:[o.Any,"auto"],active_tap:[o.Any,"auto"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(14),o=t(5),s=t(4),a=t(15),l=t(6),u=t(50);n.ToolbarBaseView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this._tool_button_views={},this._build_tool_button_views()},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.tools.change,function(){return e._build_tool_button_views()})},e.prototype.remove=function(){return s.remove_views(this._tool_button_views),t.prototype.remove.call(this)},e.prototype._build_tool_button_views=function(){var t,e;return e=null!=(t=this.model._proxied_tools)?t:this.model.tools,s.build_views(this._tool_button_views,e,{parent:this},function(t){return t.button_view})},e.prototype.render=function(){var t,e,n,i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w;o.empty(this.el),this.el.classList.add("bk-toolbar"),this.el.classList.add("bk-toolbar-"+this.model.toolbar_location),null!=this.model.logo&&(i="grey"===this.model.logo?"bk-grey":null,m=o.a({href:"https://bokeh.pydata.org/",target:"_blank","class":["bk-logo","bk-logo-small",i]}),this.el.appendChild(m)),e=[],s=this.model.gestures;for(r in s){for(n=[],g=s[r].tools,a=0,c=g.length;a<c;a++)w=g[a],n.push(this._tool_button_views[w.id].el);e.push(n)}for(n=[],y=this.model.actions,l=0,_=y.length;l<_;l++)w=y[l],n.push(this._tool_button_views[w.id].el);for(e.push(n),n=[],b=this.model.inspectors,u=0,p=b.length;u<p;u++)w=b[u],w.toggleable&&n.push(this._tool_button_views[w.id].el);for(e.push(n),n=[],x=this.model.help,h=0,d=x.length;h<d;h++)w=x[h],n.push(this._tool_button_views[w.id].el);for(e.push(n),v=0,f=e.length;v<f;v++)n=e[v],0!==n.length&&(t=o.div({"class":"bk-button-bar"},n),this.el.appendChild(t));return this},e}(l.DOMView);var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._active_change=function(t){var e,n;return n=t.event_type,t.active?(e=this.gestures[n].active,null!=e&&(r.logger.debug("Toolbar: deactivating tool: "+e.type+" ("+e.id+") for event type '"+n+"'"),e.active=!1),this.gestures[n].active=t,r.logger.debug("Toolbar: activating tool: "+t.type+" ("+t.id+") for event type '"+n+"'")):this.gestures[n].active=null,null},e}(u.Model);n.ToolbarBase=h,h.prototype.type="ToolbarBase",h.prototype.default_view=n.ToolbarBaseView,h.getters({horizontal:function(){return"above"===this.toolbar_location||"below"===this.toolbar_location},vertical:function(){return"left"===this.toolbar_location||"right"===this.toolbar_location}}),h.define({tools:[a.Array,[]],logo:[a.String,"normal"]}),h.internal({gestures:[a.Any,function(){return{pan:{tools:[],active:null},scroll:{tools:[],active:null},pinch:{tools:[],active:null},tap:{tools:[],active:null},doubletap:{tools:[],active:null},press:{tools:[],active:null},rotate:{tools:[],active:null}}}],actions:[a.Array,[]],inspectors:[a.Array,[]],help:[a.Array,[]],toolbar_location:[a.Location,"right"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=[].indexOf,o=t(15),s=t(5),a=t(22),l=t(207),u=t(208),h=t(218),c=t(229),_=t(234),p=t(232),d=t(139),f=t(4),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this._init_tools(),this._merge_tools()},e.prototype._init_tools=function(){var t,e,n,i,r,o;for(i=this.tools,r=[],e=0,n=i.length;e<n;e++)o=i[e],o instanceof c.InspectTool?a.any(this.inspectors,function(t){return t.id===o.id})?r.push(void 0):r.push(this.inspectors=this.inspectors.concat([o])):o instanceof u.HelpTool?a.any(this.help,function(t){return t.id===o.id})?r.push(void 0):r.push(this.help=this.help.concat([o])):o instanceof l.ActionTool?a.any(this.actions,function(t){return t.id===o.id})?r.push(void 0):r.push(this.actions=this.actions.concat([o])):o instanceof h.GestureTool?(t=o.event_type,a.any(this.gestures[t].tools,function(t){return t.id===o.id})?r.push(void 0):r.push(this.gestures[t].tools=this.gestures[t].tools.concat([o]))):r.push(void 0);return r},e.prototype._merge_tools=function(){var t,e,n,i,o,s,l,u,h,c,_,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j,P,z,C,N=this;for(this._proxied_tools=[],h={},t={},o={},b=[],x=[],k=this.help,l=0,f=k.length;l<f;l++)s=k[l],M=s.redirect,r.call(x,M)<0&&(b.push(s),x.push(s.redirect));(D=this._proxied_tools).push.apply(D,b),this.help=b,S=this.gestures;for(i in S){u=S[i],i in o||(o[i]={}),T=u.tools;for(c=0,m=T.length;c<m;c++)P=T[c],P.type in o[i]||(o[i][P.type]=[]),o[i][P.type].push(P)}for(O=this.inspectors,_=0,v=O.length;_<v;_++)P=O[_],P.type in h||(h[P.type]=[]),h[P.type].push(P);for(A=this.actions,d=0,g=A.length;d<g;d++)P=A[d],P.type in t||(t[P.type]=[]),t[P.type].push(P);y=function(t,e){void 0===e&&(e=!1);var n;return n=new p.ToolProxy({tools:t,active:e}),N._proxied_tools.push(n),n};for(i in o){this.gestures[i].tools=[],E=o[i];for(z in E)C=E[z],C.length>0&&(w=y(C),this.gestures[i].tools.push(w),this.connect(w.properties.active.change,this._active_change.bind(this,w)))}this.actions=[];for(z in t)C=t[z],C.length>0&&this.actions.push(y(C));this.inspectors=[];for(z in h)C=h[z],C.length>0&&this.inspectors.push(y(C,e=!0));j=[];for(n in this.gestures)C=this.gestures[n].tools,0!==C.length&&(this.gestures[n].tools=a.sortBy(C,function(t){return t.default_order}),"pinch"!==n&&"scroll"!==n?j.push(this.gestures[n].tools[0].active=!0):j.push(void 0));return j;var D},e}(_.ToolbarBase);n.ProxyToolbar=m,m.prototype.type="ProxyToolbar";var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.model.toolbar.toolbar_location=this.model.toolbar_location,this._toolbar_views={},f.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){return f.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.render=function(){var e;return t.prototype.render.call(this),e=this._toolbar_views[this.model.toolbar.id],e.render(),s.empty(this.el),this.el.appendChild(e.el)},e.prototype.get_width=function(){return this.model.toolbar.vertical?30:null},e.prototype.get_height=function(){return this.model.toolbar.horizontal?30:null},e}(d.LayoutDOMView);n.ToolbarBoxView=v,v.prototype.className="bk-toolbar-box";var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(d.LayoutDOM);n.ToolbarBox=g,g.prototype.type="ToolbarBox",g.prototype.default_view=v,g.define({toolbar:[o.Instance],toolbar_location:[o.Location,"right"]}),g.getters({sizing_mode:function(){switch(this.toolbar_location){case"above":case"below":return"scale_width";case"left":case"right":return"scale_height"}}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(243),o=t(15),s=t(30),a=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(r,e),r.prototype.compute=function(e){return this.scalar_transform.apply(this,this.values.concat([e,t,n]))},r.prototype.v_compute=function(e){return this.vector_transform.apply(this,this.values.concat([e,t,n]))},r.prototype._make_transform=function(t,e){return new(Function.bind.apply(Function,[void 0].concat(Object.keys(this.args),[t,"require","exports",e])))},r.prototype._make_values=function(){return s.values(this.args)},r}(r.Transform);n.CustomJSTransform=a,a.prototype.type="CustomJSTransform",a.define({args:[o.Any,{}],func:[o.String,""],v_func:[o.String,""]}),a.getters({values:function(){return this._make_values()},scalar_transform:function(){return this._make_transform("x",this.func)},vector_transform:function(){return this._make_transform("xs",this.v_func)}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(243),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t,e){void 0===e&&(e=!0);var n;return null!=(null!=(n=this.range)?n.synthetic:void 0)&&e&&(t=this.range.synthetic(t)),t+this.value},e}(r.Transform);n.Dodge=s,s.define({value:[o.Number,0],range:[o.Instance]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(236);n.CustomJSTransform=i.CustomJSTransform;var r=t(237);n.Dodge=r.Dodge;var o=t(239);n.Interpolator=o.Interpolator;var s=t(240);n.Jitter=s.Jitter;var a=t(241);n.LinearInterpolator=a.LinearInterpolator;var l=t(242);n.StepInterpolator=l.StepInterpolator;var u=t(243);n.Transform=u.Transform},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=[].indexOf,o=t(243),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._x_sorted=[],this._y_sorted=[],this._sorted_dirty=!0,this.connect(this.change,function(){return this._sorted_dirty=!0})},e.prototype.sort=function(t){void 0===t&&(t=!1);var e,n,i,o,s,a,l,u,h,c,_;if(typeof this.x!=typeof this.y)throw new Error("The parameters for x and y must be of the same type, either both strings which define a column in the data source or both arrays of the same length");if("string"==typeof this.x&&null===this.data)throw new Error("If the x and y parameters are not specified as an array, the data parameter is reqired.");if(this._sorted_dirty!==!1){if(c=[],_=[],"string"==typeof this.x){if(n=this.data,e=n.columns(),l=this.x,r.call(e,l)<0)throw new Error("The x parameter does not correspond to a valid column name defined in the data parameter");if(u=this.y,r.call(e,u)<0)throw new Error("The x parameter does not correspond to a valid column name defined in the data parameter");c=n.get_column(this.x),_=n.get_column(this.y)}else c=this.x,_=this.y;if(c.length!==_.length)throw new Error("The length for x and y do not match");if(c.length<2)throw new Error("x and y must have at least two elements to support interpolation");a=[];for(o in c)a.push({x:c[o],y:_[o]});for(t===!0?a.sort(function(t,e){var n,i;return null!=(n=t.x<e.x)?n:-{1:null!=(i=t.x===e.x)?i:{0:1}}}):a.sort(function(t,e){var n,i;return null!=(n=t.x>e.x)?n:-{1:null!=(i=t.x===e.x)?i:{0:1}}}),s=i=0,h=a.length;0<=h?i<h:i>h;s=0<=h?++i:--i)this._x_sorted[s]=a[s].x,this._y_sorted[s]=a[s].y;return this._sorted_dirty=!1}},e}(o.Transform);n.Interpolator=a,a.define({x:[s.Any],y:[s.Any],data:[s.Any],clip:[s.Bool,!0]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(243),o=t(15),s=t(29),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t,e){void 0===e&&(e=!0);var n;return null!=(null!=(n=this.range)?n.synthetic:void 0)&&e&&(t=this.range.synthetic(t)),"uniform"===this.distribution?t+this.mean+(s.random()-.5)*this.width:"normal"===this.distribution?t+s.rnorm(this.mean,this.width):void 0},e}(r.Transform);n.Jitter=a,a.define({mean:[o.Number,0],width:[o.Number,1],distribution:[o.Distribution,"uniform"],range:[o.Instance]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(22),o=t(239);n.LinearInterpolator=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){var e,n,i,o,s,a,l;if(this.sort(e=!1),this.clip===!0){if(t<this._x_sorted[0]||t>this._x_sorted[this._x_sorted.length-1])return null}else{if(t<this._x_sorted[0])return this._y_sorted[0];if(t>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}return t===this._x_sorted[0]?this._y_sorted[0]:(n=r.findLastIndex(this._x_sorted,function(e){return e<t}),o=this._x_sorted[n],s=this._x_sorted[n+1],a=this._y_sorted[n],l=this._y_sorted[n+1],i=a+(t-o)/(s-o)*(l-a))},e.prototype.v_compute=function(t){var e,n,i,r,o;for(r=new Float64Array(t.length),n=e=0,i=t.length;e<i;n=++e)o=t[n],r[n]=this.compute(o);return r},e}(o.Interpolator)},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(239),o=t(15),s=t(22),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){
  var e,n,i,r,o,a;if(this.sort(e=!1),this.clip===!0){if(t<this._x_sorted[0]||t>this._x_sorted[this._x_sorted.length-1])return null}else{if(t<this._x_sorted[0])return this._y_sorted[0];if(t>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}return i=-1,"after"===this.mode&&(i=s.findLastIndex(this._x_sorted,function(e){return t>=e})),"before"===this.mode&&(i=s.findIndex(this._x_sorted,function(e){return t<=e})),"center"===this.mode&&(n=function(){var e,n,i,r;for(i=this._x_sorted,r=[],e=0,n=i.length;e<n;e++)a=i[e],r.push(Math.abs(a-t));return r}.call(this),r=s.min(n),i=s.findIndex(n,function(t){return r===t})),o=i!==-1?this._y_sorted[i]:null},e.prototype.v_compute=function(t){var e,n,i,r,o;for(r=new Float64Array(t.length),n=e=0,i=t.length;e<i;n=++e)o=t[n],r[n]=this.compute(o);return r},e}(r.Interpolator);n.StepInterpolator=a,a.define({mode:[o.StepMode,"after"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50);n.Transform=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.v_compute=function(t){var e,n,i,r,o,s;for(null!=(null!=(r=this.range)?r.v_synthetic:void 0)&&(t=this.range.v_synthetic(t)),o=new Float64Array(t.length),n=e=0,i=t.length;e<i;n=++e)s=t[n],o[n]=this.compute(s,!1);return o},e}(r.Model)},function(t,e,n){"use strict";"function"!=typeof WeakMap&&t(313),"function"!=typeof Set&&t(303);var i=String.prototype;i.repeat||(i.repeat=function(t){if(null==this)throw new TypeError("can't convert "+this+" to object");var e=""+this;if(t=+t,t!=t&&(t=0),t<0)throw new RangeError("repeat count must be non-negative");if(t==1/0)throw new RangeError("repeat count must be less than infinity");if(t=Math.floor(t),0==e.length||0==t)return"";if(e.length*t>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");for(var n="";1==(1&t)&&(n+=e),t>>>=1,0!=t;)e+=e;return n})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(37),r=function(){function t(t,e,n){this.header=t,this.metadata=e,this.content=n,this.buffers=[]}return t.assemble=function(e,n,i){var r=JSON.parse(e),o=JSON.parse(n),s=JSON.parse(i);return new t(r,o,s)},t.prototype.assemble_buffer=function(t,e){var n=null!=this.header.num_buffers?this.header.num_buffers:0;if(n<=this.buffers.length)throw new Error("too many buffers received, expecting #{nb}");this.buffers.push([t,e])},t.create=function(e,n,i){void 0===i&&(i={});var r=t.create_header(e);return new t(r,n,i)},t.create_header=function(t){return{msgid:i.uniqueId(),msgtype:t}},t.prototype.complete=function(){return null!=this.header&&null!=this.metadata&&null!=this.content&&(!("num_buffers"in this.header)||this.buffers.length===this.header.num_buffers)},t.prototype.send=function(t){var e=null!=this.header.num_buffers?this.header.num_buffers:0;if(e>0)throw new Error("BokehJS only supports receiving buffers, not sending");var n=JSON.stringify(this.header),i=JSON.stringify(this.metadata),r=JSON.stringify(this.content);t.send(n),t.send(i),t.send(r)},t.prototype.msgid=function(){return this.header.msgid},t.prototype.msgtype=function(){return this.header.msgtype},t.prototype.reqid=function(){return this.header.reqid},t.prototype.problem=function(){return"msgid"in this.header?"msgtype"in this.header?null:"No msgtype in header":"No msgid in header"},t}();n.Message=r},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(245),r=function(){function t(){this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}return t.prototype.consume=function(t){this._current_consumer(t)},t.prototype._HEADER=function(t){this._assume_text(t),this.message=null,this._partial=null,this._fragments=[t],this._buf_header=null,this._current_consumer=this._METADATA},t.prototype._METADATA=function(t){this._assume_text(t),this._fragments.push(t),this._current_consumer=this._CONTENT},t.prototype._CONTENT=function(t){this._assume_text(t),this._fragments.push(t);var e=this._fragments.slice(0,3),n=e[0],r=e[1],o=e[2];this._partial=i.Message.assemble(n,r,o),this._check_complete()},t.prototype._BUFFER_HEADER=function(t){this._assume_text(t),this._buf_header=t,this._current_consumer=this._BUFFER_PAYLOAD},t.prototype._BUFFER_PAYLOAD=function(t){this._assume_binary(t),this._partial.assemble_buffer(this._buf_header,t),this._check_complete()},t.prototype._assume_text=function(t){if(t instanceof ArrayBuffer)throw new Error("Expected text fragment but received binary fragment")},t.prototype._assume_binary=function(t){if(!(t instanceof ArrayBuffer))throw new Error("Expected binary fragment but received text fragment")},t.prototype._check_complete=function(){this._partial.complete()?(this.message=this._partial,this._current_consumer=this._HEADER):this._current_consumer=this._BUFFER_HEADER},t}();n.Receiver=r},function(t,e,n){"use strict";function i(t){var e=document.createElement("div");e.style.backgroundColor="#f2dede",e.style.border="1px solid #a94442",e.style.borderRadius="4px",e.style.display="inline-block",e.style.fontFamily="sans-serif",e.style.marginTop="5px",e.style.minWidth="200px",e.style.padding="5px 5px 5px 10px";var n=document.createElement("span");n.style.backgroundColor="#a94442",n.style.borderRadius="0px 4px 0px 0px",n.style.color="white",n.style.cursor="pointer",n.style.cssFloat="right",n.style.fontSize="0.8em",n.style.margin="-6px -6px 0px 0px",n.style.padding="2px 5px 4px 5px",n.title="close",n.setAttribute("aria-label","close"),n.appendChild(document.createTextNode("x")),n.addEventListener("click",function(){return o.removeChild(e)});var i=document.createElement("h3");i.style.color="#a94442",i.style.margin="8px 0px 0px 0px",i.style.padding="0px",i.appendChild(document.createTextNode("Bokeh Error"));var r=document.createElement("pre");r.style.whiteSpace="unset",r.style.overflowX="auto",r.appendChild(document.createTextNode(t.message||t)),e.appendChild(n),e.appendChild(i),e.appendChild(r);var o=document.getElementsByTagName("body")[0];o.insertBefore(e,o.firstChild)}function r(t,e){void 0===e&&(e=!1);try{return t()}catch(n){if(i(n),e)return;throw n}}Object.defineProperty(n,"__esModule",{value:!0}),n.safely=r},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.version="0.12.11"},function(t,e,n){!function(){"use strict";function t(t,e){var n,i=Object.keys(e);for(n=0;n<i.length;n++)t=t.replace(new RegExp("\\{"+i[n]+"\\}","gi"),e[i[n]]);return t}function n(t){var e,n,i;if(!t)throw new Error("cannot create a random attribute name for an undefined object");e="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="";do for(n="",i=0;i<12;i++)n+=e[Math.floor(Math.random()*e.length)];while(t[n]);return n}function i(t,e){var n,i,r,o={};for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)i="&"+t[n+1]+";",r=parseInt(t[n],e),o[i]="&#"+r+";";return o["\\xa0"]="&#160;",o}function r(t){var e={left:"start",right:"end",center:"middle",start:"start",end:"end"};return e[t]||e.start}function o(t){var e={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return e[t]||e.alphabetic}var s,a,l,u,h;h=i("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),s={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}},l=function(t,e){this.__root=t,this.__ctx=e},l.prototype.addColorStop=function(e,n){var i,r,o=this.__ctx.__createElement("stop");o.setAttribute("offset",e),n.indexOf("rgba")!==-1?(i=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi,r=i.exec(n),o.setAttribute("stop-color",t("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),o.setAttribute("stop-opacity",r[4])):o.setAttribute("stop-color",n),this.__root.appendChild(o)},u=function(t,e){this.__root=t,this.__ctx=e},a=function(t){var e,n={width:500,height:500,enableMirroring:!1};return arguments.length>1?(e=n,e.width=arguments[0],e.height=arguments[1]):e=t?t:n,this instanceof a?(this.width=e.width||n.width,this.height=e.height||n.height,this.enableMirroring=void 0!==e.enableMirroring?e.enableMirroring:n.enableMirroring,this.canvas=this,this.__document=e.document||document,e.ctx?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__root.setAttribute("version",1.1),this.__root.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__root.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__root.setAttribute("width",this.width),this.__root.setAttribute("height",this.height),this.__ids={},this.__defs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__root.appendChild(this.__defs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),void this.__root.appendChild(this.__currentElement)):new a(e)},a.prototype.__createElement=function(t,e,n){"undefined"==typeof e&&(e={});var i,r,o=this.__document.createElementNS("http://www.w3.org/2000/svg",t),s=Object.keys(e);for(n&&(o.setAttribute("fill","none"),o.setAttribute("stroke","none")),i=0;i<s.length;i++)r=s[i],o.setAttribute(r,e[r]);return o},a.prototype.__setDefaultStyles=function(){var t,e,n=Object.keys(s);for(t=0;t<n.length;t++)e=n[t],this[e]=s[e].canvas},a.prototype.__applyStyleState=function(t){var e,n,i=Object.keys(t);for(e=0;e<i.length;e++)n=i[e],this[n]=t[n]},a.prototype.__getStyleState=function(){var t,e,n={},i=Object.keys(s);for(t=0;t<i.length;t++)e=i[t],n[e]=this[e];return n},a.prototype.__applyStyleToCurrentElement=function(e){var n=this.__currentElement,i=this.__currentElementsToStyle;i&&(n.setAttribute(e,""),n=i.element,i.children.forEach(function(t){t.setAttribute(e,"")}));var r,o,a,h,c,_,p=Object.keys(s);for(r=0;r<p.length;r++)if(o=s[p[r]],a=this[p[r]],o.apply)if(a instanceof u){if(a.__ctx)for(;a.__ctx.__defs.childNodes.length;)h=a.__ctx.__defs.childNodes[0].getAttribute("id"),this.__ids[h]=h,this.__defs.appendChild(a.__ctx.__defs.childNodes[0]);n.setAttribute(o.apply,t("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof l)n.setAttribute(o.apply,t("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(e)!==-1&&o.svg!==a)if("stroke"!==o.svgAttr&&"fill"!==o.svgAttr||a.indexOf("rgba")===-1){var d=o.svgAttr;if("globalAlpha"===p[r]&&(d=e+"-"+o.svgAttr,n.getAttribute(d)))continue;n.setAttribute(d,a)}else{c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi,_=c.exec(a),n.setAttribute(o.svgAttr,t("rgb({r},{g},{b})",{r:_[1],g:_[2],b:_[3]}));var f=_[4],m=this.globalAlpha;null!=m&&(f*=m),n.setAttribute(o.svgAttr+"-opacity",f)}},a.prototype.__closestGroupOrSvg=function(t){return t=t||this.__currentElement,"g"===t.nodeName||"svg"===t.nodeName?t:this.__closestGroupOrSvg(t.parentNode)},a.prototype.getSerializedSvg=function(t){var e,n,i,r,o,s,a=(new XMLSerializer).serializeToString(this.__root);if(s=/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi,s.test(a)&&(a=a.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t)for(e=Object.keys(h),n=0;n<e.length;n++)i=e[n],r=h[i],o=new RegExp(i,"gi"),o.test(a)&&(a=a.replace(o,r));return a},a.prototype.getSvg=function(){return this.__root},a.prototype.save=function(){var t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__stack.push(this.__getStyleState())},a.prototype.restore=function(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||(this.__currentElement=this.__root.childNodes[1]);var t=this.__stack.pop();this.__applyStyleState(t)},a.prototype.__addTransform=function(t){var e=this.__closestGroupOrSvg();if(e.childNodes.length>0){"path"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}var i=this.__currentElement.getAttribute("transform");i?i+=" ":i="",i+=t,this.__currentElement.setAttribute("transform",i)},a.prototype.scale=function(e,n){void 0===n&&(n=e),this.__addTransform(t("scale({x},{y})",{x:e,y:n}))},a.prototype.rotate=function(e){var n=180*e/Math.PI;this.__addTransform(t("rotate({angle},{cx},{cy})",{angle:n,cx:0,cy:0}))},a.prototype.translate=function(e,n){this.__addTransform(t("translate({x},{y})",{x:e,y:n}))},a.prototype.transform=function(e,n,i,r,o,s){this.__addTransform(t("matrix({a},{b},{c},{d},{e},{f})",{a:e,b:n,c:i,d:r,e:o,f:s}))},a.prototype.beginPath=function(){var t,e;this.__currentDefaultPath="",this.__currentPosition={},t=this.__createElement("path",{},!0),e=this.__closestGroupOrSvg(),e.appendChild(t),this.__currentElement=t},a.prototype.__applyCurrentDefaultPath=function(){var t=this.__currentElement;"path"===t.nodeName?t.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",t.nodeName)},a.prototype.__addPathCommand=function(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t},a.prototype.moveTo=function(e,n){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:n},this.__addPathCommand(t("M {x} {y}",{x:e,y:n}))},a.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand("Z")},a.prototype.lineTo=function(e,n){this.__currentPosition={x:e,y:n},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(t("L {x} {y}",{x:e,y:n})):this.__addPathCommand(t("M {x} {y}",{x:e,y:n}))},a.prototype.bezierCurveTo=function(e,n,i,r,o,s){this.__currentPosition={x:o,y:s},this.__addPathCommand(t("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:e,cp1y:n,cp2x:i,cp2y:r,x:o,y:s}))},a.prototype.quadraticCurveTo=function(e,n,i,r){this.__currentPosition={x:i,y:r},this.__addPathCommand(t("Q {cpx} {cpy} {x} {y}",{cpx:e,cpy:n,x:i,y:r}))};var c=function(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]};a.prototype.arcTo=function(t,e,n,i,r){var o=this.__currentPosition&&this.__currentPosition.x,s=this.__currentPosition&&this.__currentPosition.y;if("undefined"!=typeof o&&"undefined"!=typeof s){if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&s===e||t===n&&e===i||0===r)return void this.lineTo(t,e);var a=c([o-t,s-e]),l=c([n-t,i-e]);if(a[0]*l[1]===a[1]*l[0])return void this.lineTo(t,e);var u=a[0]*l[0]+a[1]*l[1],h=Math.acos(Math.abs(u)),_=c([a[0]+l[0],a[1]+l[1]]),p=r/Math.sin(h/2),d=t+p*_[0],f=e+p*_[1],m=[-a[1],a[0]],v=[l[1],-l[0]],g=function(t){var e=t[0],n=t[1];return n>=0?Math.acos(e):-Math.acos(e)},y=g(m),b=g(v);this.lineTo(d+m[0]*r,f+m[1]*r),this.arc(d,f,r,y,b)}},a.prototype.stroke=function(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")},a.prototype.fill=function(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")},a.prototype.rect=function(t,e,n,i){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()},a.prototype.fillRect=function(t,e,n,i){var r,o;r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0),o=this.__closestGroupOrSvg(),o.appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")},a.prototype.strokeRect=function(t,e,n,i){var r,o;r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0),o=this.__closestGroupOrSvg(),o.appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")},a.prototype.__clearCanvas=function(){for(var t=this.__closestGroupOrSvg(),e=t.getAttribute("transform"),n=this.__root.childNodes[1],i=n.childNodes,r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)},a.prototype.clearRect=function(t,e,n,i){if(0===t&&0===e&&n===this.width&&i===this.height)return void this.__clearCanvas();var r,o=this.__closestGroupOrSvg();r=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0),o.appendChild(r)},a.prototype.createLinearGradient=function(t,e,i,r){var o=this.__createElement("linearGradient",{id:n(this.__ids),x1:t+"px",x2:i+"px",y1:e+"px",y2:r+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(o),new l(o,this)},a.prototype.createRadialGradient=function(t,e,i,r,o,s){var a=this.__createElement("radialGradient",{id:n(this.__ids),cx:r+"px",cy:o+"px",r:s+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(a),new l(a,this)},a.prototype.__parseFont=function(){var t=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-,\'\"\sa-z0-9]+?)\s*$/i,e=t.exec(this.font),n={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return"underline"===this.__fontUnderline&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n},a.prototype.__wrapTextLink=function(t,e){if(t.href){var n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e},a.prototype.__applyText=function(t,e,n,i){var s=this.__parseFont(),a=this.__closestGroupOrSvg(),l=this.__createElement("text",{"font-family":s.family,"font-size":s.size,"font-style":s.style,"font-weight":s.weight,"text-decoration":s.decoration,x:e,y:n,"text-anchor":r(this.textAlign),"dominant-baseline":o(this.textBaseline)},!0);l.appendChild(this.__document.createTextNode(t)),this.__currentElement=l,this.__applyStyleToCurrentElement(i),a.appendChild(this.__wrapTextLink(s,l))},a.prototype.fillText=function(t,e,n){this.__applyText(t,e,n,"fill")},a.prototype.strokeText=function(t,e,n){this.__applyText(t,e,n,"stroke")},a.prototype.measureText=function(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)},a.prototype.arc=function(e,n,i,r,o,s){if(r!==o){r%=2*Math.PI,o%=2*Math.PI,r===o&&(o=(o+2*Math.PI-.001*(s?-1:1))%(2*Math.PI));var a=e+i*Math.cos(o),l=n+i*Math.sin(o),u=e+i*Math.cos(r),h=n+i*Math.sin(r),c=s?0:1,_=0,p=o-r;p<0&&(p+=2*Math.PI),_=s?p>Math.PI?0:1:p>Math.PI?1:0,this.lineTo(u,h),this.__addPathCommand(t("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:_,sweepFlag:c,endX:a,endY:l})),this.__currentPosition={x:a,y:l}}},a.prototype.clip=function(){var e=this.__closestGroupOrSvg(),i=this.__createElement("clipPath"),r=n(this.__ids),o=this.__createElement("g");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),i.setAttribute("id",r),i.appendChild(this.__currentElement),this.__defs.appendChild(i),e.setAttribute("clip-path",t("url(#{id})",{id:r})),e.appendChild(o),this.__currentElement=o},a.prototype.drawImage=function(){var t,e,n,i,r,o,s,l,u,h,c,_,p,d,f,m=Array.prototype.slice.call(arguments),v=m[0],g=0,y=0;if(3===m.length)t=m[1],e=m[2],r=v.width,o=v.height,n=r,i=o;else if(5===m.length)t=m[1],e=m[2],n=m[3],i=m[4],r=v.width,o=v.height;else{if(9!==m.length)throw new Error("Inavlid number of arguments passed to drawImage: "+arguments.length);g=m[1],y=m[2],r=m[3],o=m[4],t=m[5],e=m[6],n=m[7],i=m[8]}s=this.__closestGroupOrSvg(),c=this.__currentElement;var b="translate("+t+", "+e+")";if(v instanceof a){if(l=v.getSvg().cloneNode(!0),l.childNodes&&l.childNodes.length>1){for(u=l.childNodes[0];u.childNodes.length;)f=u.childNodes[0].getAttribute("id"),this.__ids[f]=f,this.__defs.appendChild(u.childNodes[0]);if(h=l.childNodes[1]){var x,w=h.getAttribute("transform");x=w?w+" "+b:b,h.setAttribute("transform",x),s.appendChild(h)}}}else"IMG"===v.nodeName?(_=this.__createElement("image"),_.setAttribute("width",n),_.setAttribute("height",i),_.setAttribute("preserveAspectRatio","none"),(g||y||r!==v.width||o!==v.height)&&(p=this.__document.createElement("canvas"),p.width=n,p.height=i,d=p.getContext("2d"),d.drawImage(v,g,y,r,o,0,0,n,i),v=p),_.setAttribute("transform",b),_.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===v.nodeName?v.toDataURL():v.getAttribute("src")),s.appendChild(_)):"CANVAS"===v.nodeName&&(_=this.__createElement("image"),_.setAttribute("width",n),_.setAttribute("height",i),_.setAttribute("preserveAspectRatio","none"),p=this.__document.createElement("canvas"),p.width=n,p.height=i,d=p.getContext("2d"),d.imageSmoothingEnabled=!1,d.mozImageSmoothingEnabled=!1,d.oImageSmoothingEnabled=!1,d.webkitImageSmoothingEnabled=!1,d.drawImage(v,g,y,r,o,0,0,n,i),v=p,_.setAttribute("transform",b),_.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",v.toDataURL()),s.appendChild(_))},a.prototype.createPattern=function(t,e){var i,r=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),o=n(this.__ids);return r.setAttribute("id",o),r.setAttribute("width",t.width),r.setAttribute("height",t.height),"CANVAS"===t.nodeName||"IMG"===t.nodeName?(i=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),i.setAttribute("width",t.width),i.setAttribute("height",t.height),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===t.nodeName?t.toDataURL():t.getAttribute("src")),r.appendChild(i),this.__defs.appendChild(r)):t instanceof a&&(r.appendChild(t.__root.childNodes[1]),this.__defs.appendChild(r)),new u(r,this)},a.prototype.setLineDash=function(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null},a.prototype.drawFocusRing=function(){},a.prototype.createImageData=function(){},a.prototype.getImageData=function(){},a.prototype.putImageData=function(){},a.prototype.globalCompositeOperation=function(){},a.prototype.setTransform=function(){},"object"==typeof window&&(window.C2S=a),"object"==typeof e&&"object"==typeof e.exports&&(e.exports=a)}()},function(t,e,n){"use strict";var i,r=t(273),o=t(283),s=t(287),a=t(282),l=t(287),u=t(289),h=Function.prototype.bind,c=Object.defineProperty,_=Object.prototype.hasOwnProperty;i=function(t,e,n){var i,o=u(e)&&l(e.value);return i=r(e),delete i.writable,delete i.value,i.get=function(){return!n.overwriteDefinition&&_.call(this,t)?o:(e.value=h.call(o,n.resolveContext?n.resolveContext(this):this),c(this,t,e),this[t])},i},e.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,n){return i(n,t,e)})}},function(t,e,n){"use strict";var i,r=t(270),o=t(283),s=t(276),a=t(290);i=e.exports=function(t,e){var n,i,s,l,u;return arguments.length<2||"string"!=typeof t?(l=e,e=t,t=null):l=arguments[2],null==t?(n=s=!0,i=!1):(n=a.call(t,"c"),i=a.call(t,"e"),s=a.call(t,"w")),u={value:e,configurable:n,enumerable:i,writable:s},l?r(o(l),u):u},i.gs=function(t,e,n){var i,l,u,h;return"string"!=typeof t?(u=n,n=e,e=t,t=null):u=arguments[3],null==e?e=void 0:s(e)?null==n?n=void 0:s(n)||(u=n,n=void 0):(u=e,e=n=void 0),null==t?(i=!0,l=!1):(i=a.call(t,"c"),l=a.call(t,"e")),h={get:e,set:n,configurable:i,enumerable:l},u?r(o(u),h):h}},function(t,e,n){"use strict";var i=t(289);e.exports=function(){return i(this).length=0,this}},function(t,e,n){"use strict";var i=t(264),r=t(268),o=t(289),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,l=Math.abs,u=Math.floor;e.exports=function(t){var e,n,h,c;if(!i(t))return s.apply(this,arguments);for(n=r(o(this).length),h=arguments[1],h=isNaN(h)?0:h>=0?u(h):r(this.length)-u(l(h)),e=h;e<n;++e)if(a.call(this,e)&&(c=this[e],i(c)))return e;return-1}},function(t,e,n){"use strict";e.exports=t(255)()?Array.from:t(256)},function(t,e,n){"use strict";e.exports=function(){var t,e,n=Array.from;return"function"==typeof n&&(t=["raz","dwa"],e=n(t),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,n){"use strict";var i=t(308).iterator,r=t(257),o=t(258),s=t(268),a=t(287),l=t(289),u=t(278),h=t(293),c=Array.isArray,_=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(t){var e,n,f,m,v,g,y,b,x,w,k=arguments[1],M=arguments[2];if(t=Object(l(t)),u(k)&&a(k),this&&this!==Array&&o(this))e=this;else{if(!k){if(r(t))return v=t.length,1!==v?Array.apply(null,t):(m=new Array(1),m[0]=t[0],m);if(c(t)){for(m=new Array(v=t.length),n=0;n<v;++n)m[n]=t[n];return m}}m=[]}if(!c(t))if(void 0!==(x=t[i])){for(y=a(x).call(t),e&&(m=new e),b=y.next(),n=0;!b.done;)w=k?_.call(k,M,b.value,n):b.value,e?(p.value=w,d(m,n,p)):m[n]=w,b=y.next(),++n;v=n}else if(h(t)){for(v=t.length,e&&(m=new e),n=0,f=0;n<v;++n)w=t[n],n+1<v&&(g=w.charCodeAt(0),g>=55296&&g<=56319&&(w+=t[++n])),w=k?_.call(k,M,w,f):w,e?(p.value=w,d(m,f,p)):m[f]=w,++f;v=f}if(void 0===v)for(v=s(t.length),e&&(m=new e(v)),n=0;n<v;++n)w=k?_.call(k,M,t[n],n):t[n],e?(p.value=w,d(m,n,p)):m[n]=w;return e&&(p.value=null,m.length=v),m}},function(t,e,n){"use strict";var i=Object.prototype.toString,r=i.call(function(){return arguments}());e.exports=function(t){return i.call(t)===r}},function(t,e,n){"use strict";var i=Object.prototype.toString,r=i.call(t(259));e.exports=function(t){return"function"==typeof t&&i.call(t)===r}},function(t,e,n){"use strict";e.exports=function(){}},function(t,e,n){e.exports=function(){return this}()},function(t,e,n){"use strict";e.exports=t(262)()?Math.sign:t(263)},function(t,e,n){"use strict";e.exports=function(){var t=Math.sign;return"function"==typeof t&&(1===t(10)&&t(-20)===-1)}},function(t,e,n){"use strict";e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,n){"use strict";e.exports=t(265)()?Number.isNaN:t(266)},function(t,e,n){"use strict";e.exports=function(){var t=Number.isNaN;return"function"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},function(t,e,n){"use strict";e.exports=function(t){return t!==t}},function(t,e,n){"use strict";var i=t(261),r=Math.abs,o=Math.floor;e.exports=function(t){return isNaN(t)?0:(t=Number(t),0!==t&&isFinite(t)?i(t)*o(r(t)):t)}},function(t,e,n){"use strict";var i=t(267),r=Math.max;e.exports=function(t){return r(0,i(t))}},function(t,e,n){"use strict";var i=t(287),r=t(289),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(n,u){var h,c=arguments[2],_=arguments[3];return n=Object(r(n)),i(u),h=a(n),_&&h.sort("function"==typeof _?o.call(_,n):void 0),"function"!=typeof t&&(t=h[t]),s.call(t,h,function(t,i){return l.call(n,t)?s.call(u,c,n[t],t,n,i):e})}}},function(t,e,n){"use strict";e.exports=t(271)()?Object.assign:t(272)},function(t,e,n){"use strict";e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){"use strict";var i=t(279),r=t(289),o=Math.max;e.exports=function(t,e){var n,s,a,l=o(arguments.length,2);for(t=Object(r(t)),a=function(i){try{t[i]=e[i]}catch(r){n||(n=r)}},s=1;s<l;++s)e=arguments[s],i(e).forEach(a);if(void 0!==n)throw n;return t}},function(t,e,n){"use strict";var i=t(254),r=t(270),o=t(289);e.exports=function(t){var e=Object(o(t)),n=arguments[1],s=Object(arguments[2]);if(e!==t&&!n)return e;var a={};return n?i(n,function(e){(s.ensure||e in t)&&(a[e]=t[e])}):r(a,t),a}},function(t,e,n){"use strict";var i,r=Object.create;t(285)()||(i=t(286)),e.exports=function(){var t,e,n;return i?1!==i.level?r:(t={},e={},n={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(t){return"__proto__"===t?void(e[t]={configurable:!0,enumerable:!1,writable:!0,value:void 0}):void(e[t]=n)}),Object.defineProperties(t,e),Object.defineProperty(i,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:t}),function(e,n){return r(null===e?t:e,n)}):r}()},function(t,e,n){"use strict";e.exports=t(269)("forEach")},function(t,e,n){"use strict";e.exports=function(t){return"function"==typeof t}},function(t,e,n){"use strict";var i=t(278),r={"function":!0,object:!0};e.exports=function(t){return i(t)&&r[typeof t]||!1}},function(t,e,n){"use strict";var i=t(259)();e.exports=function(t){return t!==i&&null!==t}},function(t,e,n){"use strict";e.exports=t(280)()?Object.keys:t(281)},function(t,e,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,n){"use strict";var i=t(278),r=Object.keys;e.exports=function(t){return r(i(t)?Object(t):t)}},function(t,e,n){"use strict";var i=t(287),r=t(275),o=Function.prototype.call;e.exports=function(t,e){var n={},s=arguments[2];return i(e),r(t,function(t,i,r,a){n[i]=o.call(e,s,t,i,r,a)}),n}},function(t,e,n){
  "use strict";var i=t(278),r=Array.prototype.forEach,o=Object.create,s=function(t,e){var n;for(n in t)e[n]=t[n]};e.exports=function(t){var e=o(null);return r.call(arguments,function(t){i(t)&&s(Object(t),e)}),e}},function(t,e,n){"use strict";e.exports=t(285)()?Object.setPrototypeOf:t(286)},function(t,e,n){"use strict";var i=Object.create,r=Object.getPrototypeOf,o={};e.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||i;return"function"==typeof t&&r(t(e(null),o))===o}},function(t,e,n){"use strict";var i,r=t(277),o=t(289),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,l={configurable:!0,enumerable:!1,writable:!0,value:void 0};i=function(t,e){if(o(t),null===e||r(e))return t;throw new TypeError("Prototype must be null or an object")},e.exports=function(t){var e,n;return t?(2===t.level?t.set?(n=t.set,e=function(t,e){return n.call(i(t,e),e),t}):e=function(t,e){return i(t,e).__proto__=e,t}:e=function r(t,e){var n;return i(t,e),n=s.call(r.nullPolyfill,t),n&&delete r.nullPolyfill.__proto__,null===e&&(e=r.nullPolyfill),t.__proto__=e,n&&a(r.nullPolyfill,"__proto__",l),t},Object.defineProperty(e,"level",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),n={},i=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(i){try{t=i.set,t.call(e,n)}catch(r){}if(Object.getPrototypeOf(e)===n)return{set:t,level:2}}return e.__proto__=n,Object.getPrototypeOf(e)===n?{level:2}:(e={},e.__proto__=n,Object.getPrototypeOf(e)===n&&{level:1})}()),t(274)},function(t,e,n){"use strict";e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,n){"use strict";var i=t(277);e.exports=function(t){if(!i(t))throw new TypeError(t+" is not an Object");return t}},function(t,e,n){"use strict";var i=t(278);e.exports=function(t){if(!i(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,n){"use strict";e.exports=t(291)()?String.prototype.contains:t(292)},function(t,e,n){"use strict";var i="razdwatrzy";e.exports=function(){return"function"==typeof i.contains&&(i.contains("dwa")===!0&&i.contains("foo")===!1)}},function(t,e,n){"use strict";var i=String.prototype.indexOf;e.exports=function(t){return i.call(this,t,arguments[1])>-1}},function(t,e,n){"use strict";var i=Object.prototype.toString,r=i.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||i.call(t)===r)||!1}},function(t,e,n){"use strict";var i=Object.create(null),r=Math.random;e.exports=function(){var t;do t=r().toString(36).slice(2);while(i[t]);return t}},function(t,e,n){"use strict";var i,r=t(284),o=t(290),s=t(251),a=t(308),l=t(298),u=Object.defineProperty;i=e.exports=function(t,e){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?o.call(e,"key+value")?"key+value":o.call(e,"key")?"key":"value":"value",u(this,"__kind__",s("",e))},r&&r(i,l),delete i.prototype.constructor,i.prototype=Object.create(l.prototype,{_resolve:s(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),u(i.prototype,a.toStringTag,s("c","Array Iterator"))},function(t,e,n){"use strict";var i=t(257),r=t(287),o=t(293),s=t(297),a=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;e.exports=function(t,e){var n,h,c,_,p,d,f,m,v=arguments[2];if(a(t)||i(t)?n="array":o(t)?n="string":t=s(t),r(e),c=function(){_=!0},"array"===n)return void u.call(t,function(t){return l.call(e,v,t,c),_});if("string"!==n)for(h=t.next();!h.done;){if(l.call(e,v,h.value,c),_)return;h=t.next()}else for(d=t.length,p=0;p<d&&(f=t[p],p+1<d&&(m=f.charCodeAt(0),m>=55296&&m<=56319&&(f+=t[++p])),l.call(e,v,f,c),!_);++p);}},function(t,e,n){"use strict";var i=t(257),r=t(293),o=t(295),s=t(300),a=t(301),l=t(308).iterator;e.exports=function(t){return"function"==typeof a(t)[l]?t[l]():i(t)?new o(t):r(t)?new s(t):new o(t)}},function(t,e,n){"use strict";var i,r=t(252),o=t(270),s=t(287),a=t(289),l=t(251),u=t(250),h=t(308),c=Object.defineProperty,_=Object.defineProperties;e.exports=i=function(t,e){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");_(this,{__list__:l("w",a(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(s(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete i.prototype.constructor,_(i.prototype,o({_next:l(function(){var t;if(this.__list__)return this.__redo__&&(t=this.__redo__.shift(),void 0!==t)?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()}),next:l(function(){return this._createResult(this._next())}),_createResult:l(function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}}),_resolve:l(function(t){return this.__list__[t]}),_unBind:l(function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)}),toString:l(function(){return"[object "+(this[h.toStringTag]||"Object")+"]"})},u({_onAdd:l(function(t){if(!(t>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void c(this,"__redo__",l("c",[t]));this.__redo__.forEach(function(e,n){e>=t&&(this.__redo__[n]=++e)},this),this.__redo__.push(t)}}),_onDelete:l(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(e=this.__redo__.indexOf(t),e!==-1&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,n){e>t&&(this.__redo__[n]=--e)},this)))}),_onClear:l(function(){this.__redo__&&r.call(this.__redo__),this.__nextIndex__=0})}))),c(i.prototype,h.iterator,l(function(){return this}))},function(t,e,n){"use strict";var i=t(257),r=t(278),o=t(293),s=t(308).iterator,a=Array.isArray;e.exports=function(t){return!!r(t)&&(!!a(t)||(!!o(t)||(!!i(t)||"function"==typeof t[s])))}},function(t,e,n){"use strict";var i,r=t(284),o=t(251),s=t(308),a=t(298),l=Object.defineProperty;i=e.exports=function(t){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");t=String(t),a.call(this,t),l(this,"__length__",o("",t.length))},r&&r(i,a),delete i.prototype.constructor,i.prototype=Object.create(a.prototype,{_next:o(function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()}),_resolve:o(function(t){var e,n=this.__list__[t];return this.__nextIndex__===this.__length__?n:(e=n.charCodeAt(0),e>=55296&&e<=56319?n+this.__list__[this.__nextIndex__++]:n)})}),l(i.prototype,s.toStringTag,o("c","String Iterator"))},function(t,e,n){"use strict";var i=t(299);e.exports=function(t){if(!i(t))throw new TypeError(t+" is not iterable");return t}},function(e,n,i){/*!
   * @overview es6-promise - a tiny implementation of Promises/A+.
   * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
   * @license   Licensed under MIT license
   *            See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
   * @version   3.0.2
   */
  (function(){"use strict";function i(t){return"function"==typeof t||"object"==typeof t&&null!==t}function r(t){return"function"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){q=t}function a(t){H=t}function l(){return function(){process.nextTick(p)}}function u(){return function(){U(p)}}function h(){var t=0,e=new $(p),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function c(){var t=new MessageChannel;return t.port1.onmessage=p,function(){t.port2.postMessage(0)}}function _(){return function(){setTimeout(p,1)}}function p(){for(var t=0;t<W;t+=2){var e=tt[t],n=tt[t+1];e(n),tt[t]=void 0,tt[t+1]=void 0}W=0}function d(){try{var t=e,n=t("vertx");return U=n.runOnLoop||n.runOnContext,u()}catch(i){return _()}}function f(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function v(){return new TypeError("A promises callback cannot return that same promise.")}function g(t){try{return t.then}catch(e){return rt.error=e,rt}}function y(t,e,n,i){try{t.call(e,n,i)}catch(r){return r}}function b(t,e,n){H(function(t){var i=!1,r=y(n,e,function(n){i||(i=!0,e!==n?k(t,n):S(t,n))},function(e){i||(i=!0,T(t,e))},"Settle: "+(t._label||" unknown promise"));!i&&r&&(i=!0,T(t,r))},t)}function x(t,e){e._state===nt?S(t,e._result):e._state===it?T(t,e._result):O(e,void 0,function(e){k(t,e)},function(e){T(t,e)})}function w(t,e){if(e.constructor===t.constructor)x(t,e);else{var n=g(e);n===rt?T(t,rt.error):void 0===n?S(t,e):r(n)?b(t,e,n):S(t,e)}}function k(t,e){t===e?T(t,m()):i(e)?w(t,e):S(t,e)}function M(t){t._onerror&&t._onerror(t._result),A(t)}function S(t,e){t._state===et&&(t._result=e,t._state=nt,0!==t._subscribers.length&&H(A,t))}function T(t,e){t._state===et&&(t._state=it,t._result=e,H(M,t))}function O(t,e,n,i){var r=t._subscribers,o=r.length;t._onerror=null,r[o]=e,r[o+nt]=n,r[o+it]=i,0===o&&t._state&&H(A,t)}function A(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var i,r,o=t._result,s=0;s<e.length;s+=3)i=e[s],r=e[s+n],i?P(n,i,r,o):r(o);t._subscribers.length=0}}function E(){this.error=null}function j(t,e){try{return t(e)}catch(n){return ot.error=n,ot}}function P(t,e,n,i){var o,s,a,l,u=r(n);if(u){if(o=j(n,i),o===ot?(l=!0,s=o.error,o=null):a=!0,e===o)return void T(e,v())}else o=i,a=!0;e._state!==et||(u&&a?k(e,o):l?T(e,s):t===nt?S(e,o):t===it&&T(e,o))}function z(t,e){try{e(function(e){k(t,e)},function(e){T(t,e)})}catch(n){T(t,n)}}function C(t,e){var n=this;n._instanceConstructor=t,n.promise=new t(f),n._validateInput(e)?(n._input=e,n.length=e.length,n._remaining=e.length,n._init(),0===n.length?S(n.promise,n._result):(n.length=n.length||0,n._enumerate(),0===n._remaining&&S(n.promise,n._result))):T(n.promise,n._validationError())}function N(t){return new st(this,t).promise}function D(t){function e(t){k(r,t)}function n(t){T(r,t)}var i=this,r=new i(f);if(!X(t))return T(r,new TypeError("You must pass an array to race.")),r;for(var o=t.length,s=0;r._state===et&&s<o;s++)O(i.resolve(t[s]),void 0,e,n);return r}function F(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(f);return k(n,t),n}function I(t){var e=this,n=new e(f);return T(n,t),n}function B(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function R(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function L(t){this._id=ct++,this._state=void 0,this._result=void 0,this._subscribers=[],f!==t&&(r(t)||B(),this instanceof L||R(),z(this,t))}function V(){var t;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;n&&"[object Promise]"===Object.prototype.toString.call(n.resolve())&&!n.cast||(t.Promise=_t)}var G;G=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var U,q,Y,X=G,W=0,H=({}.toString,function(t,e){tt[W]=t,tt[W+1]=e,W+=2,2===W&&(q?q(p):Y())}),J="undefined"!=typeof window?window:void 0,Q=J||{},$=Q.MutationObserver||Q.WebKitMutationObserver,Z="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),K="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,tt=new Array(1e3);Y=Z?l():$?h():K?c():void 0===J&&"function"==typeof e?d():_();var et=void 0,nt=1,it=2,rt=new E,ot=new E;C.prototype._validateInput=function(t){return X(t)},C.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},C.prototype._init=function(){this._result=new Array(this.length)};var st=C;C.prototype._enumerate=function(){for(var t=this,e=t.length,n=t.promise,i=t._input,r=0;n._state===et&&r<e;r++)t._eachEntry(i[r],r)},C.prototype._eachEntry=function(t,e){var n=this,i=n._instanceConstructor;o(t)?t.constructor===i&&t._state!==et?(t._onerror=null,n._settledAt(t._state,e,t._result)):n._willSettleAt(i.resolve(t),e):(n._remaining--,n._result[e]=t)},C.prototype._settledAt=function(t,e,n){var i=this,r=i.promise;r._state===et&&(i._remaining--,t===it?T(r,n):i._result[e]=n),0===i._remaining&&S(r,i._result)},C.prototype._willSettleAt=function(t,e){var n=this;O(t,void 0,function(t){n._settledAt(nt,e,t)},function(t){n._settledAt(it,e,t)})};var at=N,lt=D,ut=F,ht=I,ct=0,_t=L;L.all=at,L.race=lt,L.resolve=ut,L.reject=ht,L._setScheduler=s,L._setAsap=a,L._asap=H,L.prototype={constructor:L,then:function(t,e){var n=this,i=n._state;if(i===nt&&!t||i===it&&!e)return this;var r=new this.constructor(f),o=n._result;if(i){var s=arguments[i-1];H(function(){P(i,r,s,o)})}else O(n,r,t,e);return r},"catch":function(t){return this.then(null,t)}};var pt=V,dt={Promise:_t,polyfill:pt};"function"==typeof t&&t.amd?t(function(){return dt}):"undefined"!=typeof n&&n.exports?n.exports=dt:"undefined"!=typeof this&&(this.ES6Promise=dt),pt()}).call(this)},function(t,e,n){"use strict";t(304)()||Object.defineProperty(t(260),"Set",{value:t(307),configurable:!0,enumerable:!1,writable:!0})},function(t,e,n){"use strict";e.exports=function(){var t,e,n;return"function"==typeof Set&&(t=new Set(["raz","dwa","trzy"]),"[object Set]"===String(t)&&(3===t.size&&("function"==typeof t.add&&("function"==typeof t.clear&&("function"==typeof t["delete"]&&("function"==typeof t.entries&&("function"==typeof t.forEach&&("function"==typeof t.has&&("function"==typeof t.keys&&("function"==typeof t.values&&(e=t.values(),n=e.next(),n.done===!1&&"raz"===n.value)))))))))))}},function(t,e,n){"use strict";e.exports=function(){return"undefined"!=typeof Set&&"[object Set]"===Object.prototype.toString.call(Set.prototype)}()},function(t,e,n){"use strict";var i,r=t(284),o=t(290),s=t(251),a=t(298),l=t(308).toStringTag,u=Object.defineProperty;i=e.exports=function(t,e){return this instanceof i?(a.call(this,t.__setData__,t),e=e&&o.call(e,"key+value")?"key+value":"value",void u(this,"__kind__",s("",e))):new i(t,e)},r&&r(i,a),i.prototype=Object.create(a.prototype,{constructor:s(i),_resolve:s(function(t){return"value"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__list__[t]]}),toString:s(function(){return"[object Set Iterator]"})}),u(i.prototype,l,s("c","Set Iterator"))},function(t,e,n){"use strict";var i,r,o,s=t(252),a=t(253),l=t(284),u=t(287),h=t(251),c=t(317),_=t(308),p=t(301),d=t(296),f=t(306),m=t(305),v=Function.prototype.call,g=Object.defineProperty,y=Object.getPrototypeOf;m&&(o=Set),e.exports=i=function(){var t,e=arguments[0];if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");return t=m&&l?l(new o,y(this)):this,null!=e&&p(e),g(t,"__setData__",h("c",[])),e?(d(e,function(t){a.call(this,t)===-1&&this.push(t)},t.__setData__),t):t},m&&(l&&l(i,o),i.prototype=Object.create(o.prototype,{constructor:h(i)})),c(Object.defineProperties(i.prototype,{add:h(function(t){return this.has(t)?this:(this.emit("_add",this.__setData__.push(t)-1,t),this)}),clear:h(function(){this.__setData__.length&&(s.call(this.__setData__),this.emit("_clear"))}),"delete":h(function(t){var e=a.call(this.__setData__,t);return e!==-1&&(this.__setData__.splice(e,1),this.emit("_delete",e,t),!0)}),entries:h(function(){return new f(this,"key+value")}),forEach:h(function(t){var e,n,i,r=arguments[1];for(u(t),e=this.values(),n=e._next();void 0!==n;)i=e._resolve(n),v.call(t,r,i,i,this),n=e._next()}),has:h(function(t){return a.call(this.__setData__,t)!==-1}),keys:h(r=function(){return this.values()}),size:h.gs(function(){return this.__setData__.length}),values:h(function(){return new f(this)}),toString:h(function(){return"[object Set]"})})),g(i.prototype,_.iterator,h(r)),g(i.prototype,_.toStringTag,h("c","Set"))},function(t,e,n){"use strict";e.exports=t(309)()?Symbol:t(311)},function(t,e,n){"use strict";var i={object:!0,symbol:!0};e.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(e){return!1}return!!i[typeof Symbol.iterator]&&(!!i[typeof Symbol.toPrimitive]&&!!i[typeof Symbol.toStringTag])}},function(t,e,n){"use strict";e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},function(t,e,n){"use strict";var i,r,o,s,a=t(251),l=t(312),u=Object.create,h=Object.defineProperties,c=Object.defineProperty,_=Object.prototype,p=u(null);if("function"==typeof Symbol){i=Symbol;try{String(i()),s=!0}catch(d){}}var f=function(){var t=u(null);return function(e){for(var n,i,r=0;t[e+(r||"")];)++r;return e+=r||"",t[e]=!0,n="@@"+e,c(_,n,a.gs(null,function(t){i||(i=!0,c(this,n,a(t)),i=!1)})),n}}();o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return r(t)},e.exports=r=function m(t){var e;if(this instanceof m)throw new TypeError("Symbol is not a constructor");return s?i(t):(e=u(o.prototype),t=void 0===t?"":String(t),h(e,{__description__:a("",t),__name__:a("",f(t))}))},h(r,{"for":a(function(t){return p[t]?p[t]:p[t]=r(String(t))}),keyFor:a(function(t){var e;l(t);for(e in p)if(p[e]===t)return e}),hasInstance:a("",i&&i.hasInstance||r("hasInstance")),isConcatSpreadable:a("",i&&i.isConcatSpreadable||r("isConcatSpreadable")),iterator:a("",i&&i.iterator||r("iterator")),match:a("",i&&i.match||r("match")),replace:a("",i&&i.replace||r("replace")),search:a("",i&&i.search||r("search")),species:a("",i&&i.species||r("species")),split:a("",i&&i.split||r("split")),toPrimitive:a("",i&&i.toPrimitive||r("toPrimitive")),toStringTag:a("",i&&i.toStringTag||r("toStringTag")),unscopables:a("",i&&i.unscopables||r("unscopables"))}),h(o.prototype,{constructor:a(r),toString:a("",function(){return this.__name__})}),h(r.prototype,{toString:a(function(){return"Symbol ("+l(this).__description__+")"}),valueOf:a(function(){return l(this)})}),c(r.prototype,r.toPrimitive,a("",function(){var t=l(this);return"symbol"==typeof t?t:t.toString()})),c(r.prototype,r.toStringTag,a("c","Symbol")),c(o.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),c(o.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))},function(t,e,n){"use strict";var i=t(310);e.exports=function(t){if(!i(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,n){"use strict";t(314)()||Object.defineProperty(t(260),"WeakMap",{value:t(316),configurable:!0,enumerable:!1,writable:!0})},function(t,e,n){"use strict";e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(n){return!1}return"[object WeakMap]"===String(t)&&("function"==typeof t.set&&(t.set({},1)===t&&("function"==typeof t["delete"]&&("function"==typeof t.has&&"one"===t.get(e)))))}},function(t,e,n){"use strict";e.exports=function(){return"function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}()},function(t,e,n){"use strict";var i,r=t(284),o=t(288),s=t(289),a=t(294),l=t(251),u=t(297),h=t(296),c=t(308).toStringTag,_=t(315),p=Array.isArray,d=Object.defineProperty,f=Object.prototype.hasOwnProperty,m=Object.getPrototypeOf;e.exports=i=function(){var t,e=arguments[0];if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");return t=_&&r&&WeakMap!==i?r(new WeakMap,m(this)):this,null!=e&&(p(e)||(e=u(e))),d(t,"__weakMapData__",l("c","$weakMap$"+a())),e?(h(e,function(e){s(e),t.set(e[0],e[1])}),t):t},_&&(r&&r(i,WeakMap),i.prototype=Object.create(WeakMap.prototype,{constructor:l(i)})),Object.defineProperties(i.prototype,{"delete":l(function(t){return!!f.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)}),get:l(function(t){if(f.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]}),has:l(function(t){return f.call(o(t),this.__weakMapData__)}),set:l(function(t,e){return d(o(t),this.__weakMapData__,l("c",e)),this}),toString:l(function(){return"[object WeakMap]"})}),d(i.prototype,c,l("c","WeakMap"))},function(t,e,n){"use strict";var i,r,o,s,a,l,u,h=t(251),c=t(287),_=Function.prototype.apply,p=Function.prototype.call,d=Object.create,f=Object.defineProperty,m=Object.defineProperties,v=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};i=function(t,e){var n;return c(e),v.call(this,"__ee__")?n=this.__ee__:(n=g.value=d(null),f(this,"__ee__",g),g.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},r=function(t,e){var n,r;return c(e),r=this,i.call(this,t,n=function(){o.call(r,t,n),_.call(e,this,arguments)}),n.__eeOnceListener__=e,this},o=function(t,e){var n,i,r,o;if(c(e),!v.call(this,"__ee__"))return this;if(n=this.__ee__,!n[t])return this;if(i=n[t],"object"==typeof i)for(o=0;r=i[o];++o)r!==e&&r.__eeOnceListener__!==e||(2===i.length?n[t]=i[o?0:1]:i.splice(o,1));else i!==e&&i.__eeOnceListener__!==e||delete n[t];return this},s=function(t){var e,n,i,r,o;if(v.call(this,"__ee__")&&(r=this.__ee__[t]))if("object"==typeof r){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(r=r.slice(),e=0;i=r[e];++e)_.call(i,this,o)}else switch(arguments.length){case 1:p.call(r,this);break;case 2:p.call(r,this,arguments[1]);break;case 3:p.call(r,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];_.call(r,this,o)}},a={on:i,once:r,off:o,emit:s},l={on:h(i),once:h(r),off:h(o),emit:h(s)},u=m({},l),e.exports=n=function(t){return null==t?d(u):m(Object(t),l)},n.methods=a},function(e,n,i){/*! Hammer.JS - v2.0.7 - 2016-04-22
   * http://hammerjs.github.io/
   *
   * Copyright (c) 2016 Jorik Tangelder;
   * Licensed under the MIT license */
  !function(e,i,r,o){"use strict";function s(t,e,n){return setTimeout(c(t,n),e)}function a(t,e,n){return!!Array.isArray(t)&&(l(t,n[e],n),!0)}function l(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==o)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function u(t,n,i){var r="DEPRECATED METHOD: "+n+"\n"+i+" AT \n";return function(){var n=new Error("get-stack-trace"),i=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=e.console&&(e.console.warn||e.console.log);return o&&o.call(e.console,r,i),t.apply(this,arguments)}}function h(t,e,n){var i,r=e.prototype;i=t.prototype=Object.create(r),i.constructor=t,i._super=r,n&&pt(i,n)}function c(t,e){return function(){return t.apply(e,arguments)}}function _(t,e){return typeof t==mt?t.apply(e?e[0]||o:o,e):t}function p(t,e){return t===o?e:t}function d(t,e,n){l(g(e),function(e){t.addEventListener(e,n,!1)})}function f(t,e,n){l(g(e),function(e){t.removeEventListener(e,n,!1)})}function m(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function v(t,e){return t.indexOf(e)>-1}function g(t){return t.trim().split(/\s+/g)}function y(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;i<t.length;){if(n&&t[i][n]==e||!n&&t[i]===e)return i;i++}return-1}function b(t){return Array.prototype.slice.call(t,0)}function x(t,e,n){for(var i=[],r=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];y(r,s)<0&&i.push(t[o]),r[o]=s,o++}return n&&(i=e?i.sort(function(t,n){return t[e]>n[e]}):i.sort()),i}function w(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),s=0;s<dt.length;){if(n=dt[s],i=n?n+r:e,i in t)return i;s++}return o}function k(){return wt++}function M(t){var n=t.ownerDocument||t;return n.defaultView||n.parentWindow||e}function S(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){_(t.options.enable,[t])&&n.handler(e)},this.init()}function T(t){var e,n=t.options.inputClass;return new(e=n?n:St?L:Tt?U:Mt?Y:R)(t,O)}function O(t,e,n){var i=n.pointers.length,r=n.changedPointers.length,o=e&zt&&i-r===0,s=e&(Nt|Dt)&&i-r===0;n.isFirst=!!o,n.isFinal=!!s,o&&(t.session={}),n.eventType=e,A(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function A(t,e){var n=t.session,i=e.pointers,r=i.length;n.firstInput||(n.firstInput=P(e)),r>1&&!n.firstMultiple?n.firstMultiple=P(e):1===r&&(n.firstMultiple=!1);var o=n.firstInput,s=n.firstMultiple,a=s?s.center:o.center,l=e.center=z(i);e.timeStamp=yt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=F(a,l),e.distance=D(a,l),E(n,e),e.offsetDirection=N(e.deltaX,e.deltaY);var u=C(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=gt(u.x)>gt(u.y)?u.x:u.y,e.scale=s?B(s.pointers,i):1,e.rotation=s?I(s.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,j(n,e);var h=t.element;m(e.srcEvent.target,h)&&(h=e.srcEvent.target),e.target=h}function E(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==zt&&o.eventType!==Nt||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}function j(t,e){var n,i,r,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=Dt&&(l>Pt||a.velocity===o)){var u=e.deltaX-a.deltaX,h=e.deltaY-a.deltaY,c=C(l,u,h);i=c.x,r=c.y,n=gt(c.x)>gt(c.y)?c.x:c.y,s=N(u,h),t.lastInterval=e}else n=a.velocity,i=a.velocityX,r=a.velocityY,s=a.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=s}function P(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:vt(t.pointers[n].clientX),clientY:vt(t.pointers[n].clientY)},n++;return{timeStamp:yt(),pointers:e,center:z(e),deltaX:t.deltaX,deltaY:t.deltaY}}function z(t){var e=t.length;if(1===e)return{x:vt(t[0].clientX),y:vt(t[0].clientY)};for(var n=0,i=0,r=0;r<e;)n+=t[r].clientX,i+=t[r].clientY,r++;return{x:vt(n/e),y:vt(i/e)}}function C(t,e,n){return{x:e/t||0,y:n/t||0}}function N(t,e){return t===e?Ft:gt(t)>=gt(e)?t<0?It:Bt:e<0?Rt:Lt}function D(t,e,n){n||(n=qt);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function F(t,e,n){n||(n=qt);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function I(t,e){return F(e[1],e[0],Yt)+F(t[1],t[0],Yt)}function B(t,e){return D(e[0],e[1],Yt)/D(t[0],t[1],Yt)}function R(){this.evEl=Wt,this.evWin=Ht,this.pressed=!1,S.apply(this,arguments)}function L(){this.evEl=$t,this.evWin=Zt,S.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function V(){this.evTarget=te,this.evWin=ee,this.started=!1,S.apply(this,arguments)}function G(t,e){var n=b(t.touches),i=b(t.changedTouches);return e&(Nt|Dt)&&(n=x(n.concat(i),"identifier",!0)),[n,i]}function U(){this.evTarget=ie,this.targetIds={},S.apply(this,arguments)}function q(t,e){var n=b(t.touches),i=this.targetIds;if(e&(zt|Ct)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,s=b(t.changedTouches),a=[],l=this.target;if(o=n.filter(function(t){return m(t.target,l)}),e===zt)for(r=0;r<o.length;)i[o[r].identifier]=!0,r++;for(r=0;r<s.length;)i[s[r].identifier]&&a.push(s[r]),e&(Nt|Dt)&&delete i[s[r].identifier],r++;return a.length?[x(o.concat(a),"identifier",!0),a]:void 0}function Y(){S.apply(this,arguments);var t=c(this.handler,this);this.touch=new U(this.manager,t),this.mouse=new R(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function X(t,e){t&zt?(this.primaryTouch=e.changedPointers[0].identifier,W.call(this,e)):t&(Nt|Dt)&&W.call(this,e)}function W(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var i=this.lastTouches,r=function(){var t=i.indexOf(n);t>-1&&i.splice(t,1)};setTimeout(r,re)}}function H(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(e-r.x),s=Math.abs(n-r.y);if(o<=oe&&s<=oe)return!0}return!1}function J(t,e){this.manager=t,this.set(e)}function Q(t){if(v(t,ce))return ce;var e=v(t,_e),n=v(t,pe);return e&&n?ce:e||n?e?_e:pe:v(t,he)?he:ue}function $(){if(!ae)return!1;var t={},n=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){t[i]=!n||e.CSS.supports("touch-action",i)}),t}function Z(t){this.options=pt({},this.defaults,t||{}),this.id=k(),this.manager=null,this.options.enable=p(this.options.enable,!0),this.state=fe,this.simultaneous={},this.requireFail=[]}function K(t){return t&be?"cancel":t&ge?"end":t&ve?"move":t&me?"start":""}function tt(t){return t==Lt?"down":t==Rt?"up":t==It?"left":t==Bt?"right":""}function et(t,e){var n=e.manager;return n?n.get(t):t}function nt(){Z.apply(this,arguments)}function it(){nt.apply(this,arguments),this.pX=null,this.pY=null}function rt(){nt.apply(this,arguments)}function ot(){Z.apply(this,arguments),this._timer=null,this._input=null}function st(){nt.apply(this,arguments)}function at(){nt.apply(this,arguments)}function lt(){Z.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ut(t,e){return e=e||{},e.recognizers=p(e.recognizers,ut.defaults.preset),new ht(t,e)}function ht(t,e){this.options=pt({},ut.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=T(this),this.touchAction=new J(this,this.options.touchAction),ct(this,!0),l(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function ct(t,e){var n=t.element;if(n.style){var i;l(t.options.cssProps,function(r,o){i=w(n.style,o),e?(t.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=t.oldCssProps[i]||""}),e||(t.oldCssProps={})}}function _t(t,e){var n=i.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}var pt,dt=["","webkit","Moz","MS","ms","o"],ft=i.createElement("div"),mt="function",vt=Math.round,gt=Math.abs,yt=Date.now;pt="function"!=typeof Object.assign?function(t){if(t===o||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==o&&null!==i)for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}return e}:Object.assign;var bt=u(function(t,e,n){for(var i=Object.keys(e),r=0;r<i.length;)(!n||n&&t[i[r]]===o)&&(t[i[r]]=e[i[r]]),r++;return t},"extend","Use `assign`."),xt=u(function(t,e){return bt(t,e,!0)},"merge","Use `assign`."),wt=1,kt=/mobile|tablet|ip(ad|hone|od)|android/i,Mt="ontouchstart"in e,St=w(e,"PointerEvent")!==o,Tt=Mt&&kt.test(navigator.userAgent),Ot="touch",At="pen",Et="mouse",jt="kinect",Pt=25,zt=1,Ct=2,Nt=4,Dt=8,Ft=1,It=2,Bt=4,Rt=8,Lt=16,Vt=It|Bt,Gt=Rt|Lt,Ut=Vt|Gt,qt=["x","y"],Yt=["clientX","clientY"];S.prototype={handler:function(){},init:function(){this.evEl&&d(this.element,this.evEl,this.domHandler),this.evTarget&&d(this.target,this.evTarget,this.domHandler),this.evWin&&d(M(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&f(this.element,this.evEl,this.domHandler),this.evTarget&&f(this.target,this.evTarget,this.domHandler),this.evWin&&f(M(this.element),this.evWin,this.domHandler)}};var Xt={mousedown:zt,mousemove:Ct,mouseup:Nt},Wt="mousedown",Ht="mousemove mouseup";h(R,S,{handler:function(t){var e=Xt[t.type];e&zt&&0===t.button&&(this.pressed=!0),e&Ct&&1!==t.which&&(e=Nt),this.pressed&&(e&Nt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:Et,srcEvent:t}))}});var Jt={pointerdown:zt,pointermove:Ct,pointerup:Nt,pointercancel:Dt,pointerout:Dt},Qt={2:Ot,3:At,4:Et,5:jt},$t="pointerdown",Zt="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&($t="MSPointerDown",Zt="MSPointerMove MSPointerUp MSPointerCancel"),h(L,S,{handler:function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=Jt[i],o=Qt[t.pointerType]||t.pointerType,s=o==Ot,a=y(e,t.pointerId,"pointerId");r&zt&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):r&(Nt|Dt)&&(n=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(a,1))}});var Kt={touchstart:zt,touchmove:Ct,touchend:Nt,touchcancel:Dt},te="touchstart",ee="touchstart touchmove touchend touchcancel";h(V,S,{handler:function(t){var e=Kt[t.type];if(e===zt&&(this.started=!0),this.started){var n=G.call(this,t,e);e&(Nt|Dt)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:Ot,srcEvent:t})}}});var ne={touchstart:zt,touchmove:Ct,touchend:Nt,touchcancel:Dt},ie="touchstart touchmove touchend touchcancel";h(U,S,{handler:function(t){var e=ne[t.type],n=q.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:Ot,srcEvent:t})}});var re=2500,oe=25;h(Y,S,{handler:function(t,e,n){var i=n.pointerType==Ot,r=n.pointerType==Et;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)X.call(this,e,n);else if(r&&H.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var se=w(ft.style,"touchAction"),ae=se!==o,le="compute",ue="auto",he="manipulation",ce="none",_e="pan-x",pe="pan-y",de=$();J.prototype={set:function(t){t==le&&(t=this.compute()),ae&&this.manager.element.style&&de[t]&&(this.manager.element.style[se]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return l(this.manager.recognizers,function(e){_(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),Q(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var i=this.actions,r=v(i,ce)&&!de[ce],o=v(i,pe)&&!de[pe],s=v(i,_e)&&!de[_e];if(r){var a=1===t.pointers.length,l=t.distance<2,u=t.deltaTime<250;if(a&&l&&u)return}return s&&o?void 0:r||o&&n&Vt||s&&n&Gt?this.preventSrc(e):void 0},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var fe=1,me=2,ve=4,ge=8,ye=ge,be=16,xe=32;Z.prototype={defaults:{},set:function(t){return pt(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(a(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=et(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return a(t,"dropRecognizeWith",this)?this:(t=et(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(a(t,"requireFailure",this))return this;var e=this.requireFail;return t=et(t,this),y(e,t)===-1&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(a(t,"dropRequireFailure",this))return this;t=et(t,this);var e=y(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,i=this.state;i<ge&&e(n.options.event+K(i)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),i>=ge&&e(n.options.event+K(i))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=xe)},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(xe|fe)))return!1;t++}return!0},recognize:function(t){var e=pt({},t);return _(this.options.enable,[this,e])?(this.state&(ye|be|xe)&&(this.state=fe),this.state=this.process(e),void(this.state&(me|ve|ge|be)&&this.tryEmit(e))):(this.reset(),void(this.state=xe))},process:function(t){},getTouchAction:function(){},reset:function(){}},h(nt,Z,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,i=e&(me|ve),r=this.attrTest(t);return i&&(n&Dt||!r)?e|be:i||r?n&Nt?e|ge:e&me?e|ve:me:xe}}),h(it,nt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ut},getTouchAction:function(){var t=this.options.direction,e=[];return t&Vt&&e.push(pe),t&Gt&&e.push(_e),e},directionTest:function(t){var e=this.options,n=!0,i=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(e.direction&Vt?(r=0===o?Ft:o<0?It:Bt,n=o!=this.pX,i=Math.abs(t.deltaX)):(r=0===s?Ft:s<0?Rt:Lt,n=s!=this.pY,i=Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&r&e.direction},attrTest:function(t){return nt.prototype.attrTest.call(this,t)&&(this.state&me||!(this.state&me)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=tt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),h(rt,nt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ce]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&me)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),h(ot,Z,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ue]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!i||!n||t.eventType&(Nt|Dt)&&!r)this.reset();else if(t.eventType&zt)this.reset(),this._timer=s(function(){this.state=ye,this.tryEmit()},e.time,this);else if(t.eventType&Nt)return ye;return xe},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===ye&&(t&&t.eventType&Nt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=yt(),this.manager.emit(this.options.event,this._input)))}}),h(st,nt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ce]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&me)}}),h(at,nt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Vt|Gt,pointers:1},getTouchAction:function(){return it.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(Vt|Gt)?e=t.overallVelocity:n&Vt?e=t.overallVelocityX:n&Gt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&gt(e)>this.options.velocity&&t.eventType&Nt},emit:function(t){var e=tt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),h(lt,Z,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[he]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&zt&&0===this.count)return this.failTimeout();if(i&&r&&n){if(t.eventType!=Nt)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||D(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,a&&o?this.count+=1:this.count=1,this._input=t;var l=this.count%e.taps;if(0===l)return this.hasRequireFailures()?(this._timer=s(function(){this.state=ye,this.tryEmit()},e.interval,this),me):ye}return xe},failTimeout:function(){return this._timer=s(function(){this.state=xe},this.options.interval,this),xe},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ye&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ut.VERSION="2.0.7",ut.defaults={domEvents:!1,touchAction:le,enable:!0,inputTarget:null,inputClass:null,preset:[[st,{enable:!1}],[rt,{enable:!1},["rotate"]],[at,{direction:Vt}],[it,{direction:Vt},["swipe"]],[lt],[lt,{event:"doubletap",taps:2},["tap"]],[ot]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var we=1,ke=2;ht.prototype={set:function(t){return pt(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?ke:we},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var n,i=this.recognizers,r=e.curRecognizer;(!r||r&&r.state&ye)&&(r=e.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],e.stopped===ke||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(t),!r&&n.state&(me|ve|ge)&&(r=e.curRecognizer=n),o++}},get:function(t){if(t instanceof Z)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(a(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(a(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=y(e,t);n!==-1&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==o&&e!==o){var n=this.handlers;return l(g(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this}},off:function(t,e){if(t!==o){var n=this.handlers;return l(g(t),function(t){e?n[t]&&n[t].splice(y(n[t],e),1):delete n[t]}),this}},emit:function(t,e){this.options.domEvents&&_t(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var i=0;i<n.length;)n[i](e),i++}},destroy:function(){this.element&&ct(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},pt(ut,{INPUT_START:zt,INPUT_MOVE:Ct,INPUT_END:Nt,INPUT_CANCEL:Dt,STATE_POSSIBLE:fe,STATE_BEGAN:me,STATE_CHANGED:ve,STATE_ENDED:ge,STATE_RECOGNIZED:ye,STATE_CANCELLED:be,STATE_FAILED:xe,DIRECTION_NONE:Ft,DIRECTION_LEFT:It,DIRECTION_RIGHT:Bt,DIRECTION_UP:Rt,DIRECTION_DOWN:Lt,DIRECTION_HORIZONTAL:Vt,DIRECTION_VERTICAL:Gt,DIRECTION_ALL:Ut,Manager:ht,Input:S,TouchAction:J,TouchInput:U,MouseInput:R,PointerEventInput:L,TouchMouseInput:Y,SingleTouchInput:V,Recognizer:Z,AttrRecognizer:nt,Tap:lt,Pan:it,Swipe:at,Pinch:rt,Rotate:st,Press:ot,on:d,off:f,each:l,merge:xt,extend:bt,assign:pt,inherit:h,bindFn:c,prefixed:w});var Me="undefined"!=typeof e?e:"undefined"!=typeof self?self:{};Me.Hammer=ut,"function"==typeof t&&t.amd?t(function(){return ut}):"undefined"!=typeof n&&n.exports?n.exports=ut:e[r]=ut}(window,document,"Hammer")},function(t,e,n){"use strict";/*-----------------------------------------------------------------------------
  | Copyright (c) 2014, Nucleic Development Team.
  |
  | Distributed under the terms of the Modified BSD License.
  |
  | The full license is in the file COPYING.txt, distributed with this software.
  |----------------------------------------------------------------------------*/
  Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(324);!function(t){t[t.Le=0]="Le",t[t.Ge=1]="Ge",t[t.Eq=2]="Eq"}(i=n.Operator||(n.Operator={}));var o=function(){function t(t,e,n){void 0===n&&(n=r.Strength.required),this._id=s++,this._operator=e,this._expression=t,this._strength=r.Strength.clip(n)}return t.Compare=function(t,e){return t.id-e.id},t.prototype.toString=function(){var t=this,e=function(){switch(t._operator){case i.Le:return"<=";case i.Ge:return">=";case i.Eq:return"=="}};return this._expression+" "+e()+" 0"},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"expression",{get:function(){return this._expression},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"op",{get:function(){return this._operator},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"strength",{get:function(){return this._strength},enumerable:!0,configurable:!0}),t}();n.Constraint=o;var s=0},function(t,e,n){"use strict";function i(t){for(var e=0,n=function(){return 0},i=s.createMap(o.Variable.Compare),r=0,a=t.length;r<a;++r){var l=t[r];if("number"==typeof l)e+=l;else if(l instanceof o.Variable)i.setDefault(l,n).second+=1;else{if(!(l instanceof Array))throw new Error("invalid Expression argument: "+JSON.stringify(l));if(2!==l.length)throw new Error("array must have length 2");var u=l[0],h=l[1];if("number"!=typeof u)throw new Error("array item 0 must be a number");if(!(h instanceof o.Variable))throw new Error("array item 1 must be a variable");i.setDefault(h,n).second+=u}}return{terms:i,constant:e}}/*-----------------------------------------------------------------------------
  | Copyright (c) 2014, Nucleic Development Team.
  |
  | Distributed under the terms of the Modified BSD License.
  |
  | The full license is in the file COPYING.txt, distributed with this software.
  |----------------------------------------------------------------------------*/
  Object.defineProperty(n,"__esModule",{value:!0});var r=t(328),o=t(331),s=t(322),a=function(){function t(){var t=i(arguments);this._terms=t.terms,this._constant=t.constant}return t.prototype.toString=function(){var t=[];r.forEach(this._terms,function(e){t.push([e.first,e.second])});for(var e=!0,n="",i=0,o=t;i<o.length;i++){var s=o[i],a=s[0],l=s[1];e?(e=!1,n+=1==l?""+a:l==-1?"-"+a:l+"*"+a):n+=1==l?" + "+a:l==-1?" - "+a:l>=0?" + "+l+a:" - "+-l+a}var u=this.constant;return u<0?n+=" - "+-u:u>0&&(n+=" + "+u),n},Object.defineProperty(t.prototype,"terms",{get:function(){return this._terms},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"constant",{get:function(){return this._constant},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this._constant;return r.forEach(this._terms,function(e){t+=e.first.value*e.second}),t},enumerable:!0,configurable:!0}),t}();n.Expression=a},function(t,e,n){"use strict";/*-----------------------------------------------------------------------------
  | Copyright (c) 2014, Nucleic Development Team.
  |
  | Distributed under the terms of the Modified BSD License.
  |
  | The full license is in the file COPYING.txt, distributed with this software.
  |----------------------------------------------------------------------------*/
  function i(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}Object.defineProperty(n,"__esModule",{value:!0}),i(t(331)),i(t(320)),i(t(319)),i(t(324)),i(t(323))},function(t,e,n){"use strict";function i(t){return new r.AssociativeArray(t)}/*-----------------------------------------------------------------------------
  | Copyright (c) 2014, Nucleic Development Team.
  |
  | Distributed under the terms of the Modified BSD License.
  |
  | The full license is in the file COPYING.txt, distributed with this software.
  |----------------------------------------------------------------------------*/
  Object.defineProperty(n,"__esModule",{value:!0});var r=t(328);n.createMap=i},function(t,e,n){"use strict";function i(t){var e=1e-8;return t<0?-t<e:t<e}function r(){return _.createMap(h.Constraint.Compare)}function o(){return _.createMap(m.Compare)}function s(){return _.createMap(l.Variable.Compare)}function a(){return _.createMap(l.Variable.Compare)}/*-----------------------------------------------------------------------------
  | Copyright (c) 2014, Nucleic Development Team.
  |
  | Distributed under the terms of the Modified BSD License.
  |
  | The full license is in the file COPYING.txt, distributed with this software.
  |----------------------------------------------------------------------------*/
  Object.defineProperty(n,"__esModule",{value:!0});var l=t(331),u=t(320),h=t(319),c=t(324),_=t(322),p=t(328),d=function(){function t(){this._cnMap=r(),this._rowMap=o(),this._varMap=s(),this._editMap=a(),this._infeasibleRows=[],this._objective=new g,this._artificial=null,this._idTick=0}return t.prototype.addConstraint=function(t){var e=this._cnMap.find(t);if(void 0!==e)throw new Error("duplicate constraint");var n=this._createRow(t),r=n.row,o=n.tag,s=this._chooseSubject(r,o);if(s.type()===f.Invalid&&r.allDummies()){if(!i(r.constant())){for(var a=[],l=0,u=t.expression.terms._array;l<u.length;l++){var h=u[l];a.push(h.first.name)}var c=["LE","GE","EQ"][t.op];throw new Error("unsatisfiable constraint ["+a.join(",")+"] operator: "+c)}s=o.marker}if(s.type()===f.Invalid){if(!this._addWithArtificialVariable(r))throw new Error("unsatisfiable constraint")}else r.solveFor(s),this._substitute(s,r),this._rowMap.insert(s,r);this._cnMap.insert(t,o),this._optimize(this._objective)},t.prototype.removeConstraint=function(t,e){void 0===e&&(e=!1);var n=this._cnMap.erase(t);if(void 0===n){if(e)return;throw new Error("unknown constraint")}this._removeConstraintEffects(t,n.second);var i=n.second.marker,r=this._rowMap.erase(i);if(void 0===r){var o=this._getMarkerLeavingSymbol(i);if(o.type()===f.Invalid)throw new Error("failed to find leaving row");r=this._rowMap.erase(o),r.second.solveForEx(o,i),this._substitute(i,r.second)}this._optimize(this._objective)},t.prototype.hasConstraint=function(t){return this._cnMap.contains(t)},t.prototype.addEditVariable=function(t,e){var n=this._editMap.find(t);if(void 0!==n)throw new Error("duplicate edit variable: "+t.name);if(e=c.Strength.clip(e),e===c.Strength.required)throw new Error("bad required strength");var i=new u.Expression(t),r=new h.Constraint(i,h.Operator.Eq,e);this.addConstraint(r);var o=this._cnMap.find(r).second,s={tag:o,constraint:r,constant:0};this._editMap.insert(t,s)},t.prototype.removeEditVariable=function(t,e){void 0===e&&(e=!1);var n=this._editMap.erase(t);if(void 0===n){if(e)return;throw new Error("unknown edit variable: "+t.name)}this.removeConstraint(n.second.constraint,e)},t.prototype.hasEditVariable=function(t){return this._editMap.contains(t)},t.prototype.suggestValue=function(t,e){var n=this._editMap.find(t);if(void 0===n)throw new Error("unknown edit variable: "+t.name);var i=this._rowMap,r=n.second,o=e-r.constant;r.constant=e;var s=r.tag.marker,a=i.find(s);if(void 0!==a)return a.second.add(-o)<0&&this._infeasibleRows.push(s),void this._dualOptimize();var l=r.tag.other;if(a=i.find(l),void 0!==a)return a.second.add(o)<0&&this._infeasibleRows.push(l),void this._dualOptimize();for(var u=0,h=i.size();u<h;++u){var c=i.itemAt(u),_=c.second,p=_.coefficientFor(s);0!==p&&_.add(o*p)<0&&c.first.type()!==f.External&&this._infeasibleRows.push(c.first)}this._dualOptimize()},t.prototype.updateVariables=function(){for(var t=this._varMap,e=this._rowMap,n=0,i=t.size();n<i;++n){var r=t.itemAt(n),o=e.find(r.second),s=0;void 0!==o&&(s=o.second.constant(),s===-0&&(s=0)),r.first.setValue(s)}},t.prototype.getConstraints=function(){var t=[];return p.forEach(this._cnMap,function(e){t.push(e.first)}),t},Object.defineProperty(t.prototype,"numConstraints",{get:function(){return this._cnMap.size()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numEditVariables",{get:function(){return this._editMap.size()},enumerable:!0,configurable:!0}),t.prototype._getVarSymbol=function(t){var e=this,n=function(){return e._makeSymbol(f.External)};return this._varMap.setDefault(t,n).second},t.prototype._createRow=function(t){for(var e=t.expression,n=new g(e.constant),r=e.terms,o=0,s=r.size();o<s;++o){var a=r.itemAt(o);if(!i(a.second)){var l=this._getVarSymbol(a.first),u=this._rowMap.find(l);void 0!==u?n.insertRow(u.second,a.second):n.insertSymbol(l,a.second)}}var _=this._objective,p=t.strength,d={marker:v,other:v};switch(t.op){case h.Operator.Le:case h.Operator.Ge:var m=t.op===h.Operator.Le?1:-1,y=this._makeSymbol(f.Slack);if(d.marker=y,n.insertSymbol(y,m),p<c.Strength.required){var b=this._makeSymbol(f.Error);d.other=b,n.insertSymbol(b,-m),_.insertSymbol(b,p)}break;case h.Operator.Eq:if(p<c.Strength.required){var x=this._makeSymbol(f.Error),w=this._makeSymbol(f.Error);d.marker=x,d.other=w,n.insertSymbol(x,-1),n.insertSymbol(w,1),_.insertSymbol(x,p),_.insertSymbol(w,p)}else{var k=this._makeSymbol(f.Dummy);d.marker=k,n.insertSymbol(k)}}return n.constant()<0&&n.reverseSign(),{row:n,tag:d}},t.prototype._chooseSubject=function(t,e){for(var n=t.cells(),i=0,r=n.size();i<r;++i){var o=n.itemAt(i);if(o.first.type()===f.External)return o.first}var s=e.marker.type();return(s===f.Slack||s===f.Error)&&t.coefficientFor(e.marker)<0?e.marker:(s=e.other.type(),(s===f.Slack||s===f.Error)&&t.coefficientFor(e.other)<0?e.other:v)},t.prototype._addWithArtificialVariable=function(t){var e=this._makeSymbol(f.Slack);this._rowMap.insert(e,t.copy()),this._artificial=t.copy(),this._optimize(this._artificial);var n=i(this._artificial.constant());this._artificial=null;var r=this._rowMap.erase(e);if(void 0!==r){var o=r.second;if(o.isConstant())return n;var s=this._anyPivotableSymbol(o);if(s.type()===f.Invalid)return!1;o.solveForEx(e,s),this._substitute(s,o),this._rowMap.insert(s,o)}for(var a=this._rowMap,l=0,u=a.size();l<u;++l)a.itemAt(l).second.removeSymbol(e);return this._objective.removeSymbol(e),n},t.prototype._substitute=function(t,e){for(var n=this._rowMap,i=0,r=n.size();i<r;++i){var o=n.itemAt(i);o.second.substitute(t,e),o.second.constant()<0&&o.first.type()!==f.External&&this._infeasibleRows.push(o.first)}this._objective.substitute(t,e),this._artificial&&this._artificial.substitute(t,e)},t.prototype._optimize=function(t){for(;;){var e=this._getEnteringSymbol(t);if(e.type()===f.Invalid)return;var n=this._getLeavingSymbol(e);if(n.type()===f.Invalid)throw new Error("the objective is unbounded");var i=this._rowMap.erase(n).second;i.solveForEx(n,e),this._substitute(e,i),this._rowMap.insert(e,i)}},t.prototype._dualOptimize=function(){for(var t=this._rowMap,e=this._infeasibleRows;0!==e.length;){var n=e.pop(),i=t.find(n);if(void 0!==i&&i.second.constant()<0){var r=this._getDualEnteringSymbol(i.second);if(r.type()===f.Invalid)throw new Error("dual optimize failed");var o=i.second;t.erase(n),o.solveForEx(n,r),this._substitute(r,o),t.insert(r,o)}}},t.prototype._getEnteringSymbol=function(t){for(var e=t.cells(),n=0,i=e.size();n<i;++n){var r=e.itemAt(n),o=r.first;if(r.second<0&&o.type()!==f.Dummy)return o}return v},t.prototype._getDualEnteringSymbol=function(t){for(var e=Number.MAX_VALUE,n=v,i=t.cells(),r=0,o=i.size();r<o;++r){var s=i.itemAt(r),a=s.first,l=s.second;if(l>0&&a.type()!==f.Dummy){var u=this._objective.coefficientFor(a),h=u/l;h<e&&(e=h,n=a)}}return n},t.prototype._getLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,n=v,i=this._rowMap,r=0,o=i.size();r<o;++r){var s=i.itemAt(r),a=s.first;if(a.type()!==f.External){var l=s.second,u=l.coefficientFor(t);if(u<0){var h=-l.constant()/u;h<e&&(e=h,n=a)}}}return n},t.prototype._getMarkerLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,n=e,i=e,r=v,o=r,s=r,a=r,l=this._rowMap,u=0,h=l.size();u<h;++u){var c=l.itemAt(u),_=c.second,p=_.coefficientFor(t);if(0!==p){var d=c.first;if(d.type()===f.External)a=d;else if(p<0){var m=-_.constant()/p;m<n&&(n=m,o=d)}else{var m=_.constant()/p;m<i&&(i=m,s=d)}}}return o!==r?o:s!==r?s:a},t.prototype._removeConstraintEffects=function(t,e){e.marker.type()===f.Error&&this._removeMarkerEffects(e.marker,t.strength),e.other.type()===f.Error&&this._removeMarkerEffects(e.other,t.strength)},t.prototype._removeMarkerEffects=function(t,e){var n=this._rowMap.find(t);void 0!==n?this._objective.insertRow(n.second,-e):this._objective.insertSymbol(t,-e)},t.prototype._anyPivotableSymbol=function(t){for(var e=t.cells(),n=0,i=e.size();n<i;++n){var r=e.itemAt(n),o=r.first.type();if(o===f.Slack||o===f.Error)return r.first}return v},t.prototype._makeSymbol=function(t){return new m(t,(this._idTick++))},t}();n.Solver=d;var f;!function(t){t[t.Invalid=0]="Invalid",t[t.External=1]="External",t[t.Slack=2]="Slack",t[t.Error=3]="Error",t[t.Dummy=4]="Dummy"}(f||(f={}));var m=function(){function t(t,e){this._id=e,this._type=t}return t.Compare=function(t,e){return t.id()-e.id()},t.prototype.id=function(){return this._id},t.prototype.type=function(){return this._type},t}(),v=new m(f.Invalid,(-1)),g=function(){function t(t){void 0===t&&(t=0),this._cellMap=_.createMap(m.Compare),this._constant=t}return t.prototype.cells=function(){return this._cellMap},t.prototype.constant=function(){return this._constant},t.prototype.isConstant=function(){return this._cellMap.empty()},t.prototype.allDummies=function(){for(var t=this._cellMap,e=0,n=t.size();e<n;++e){var i=t.itemAt(e);if(i.first.type()!==f.Dummy)return!1}return!0},t.prototype.copy=function(){var e=new t(this._constant);return e._cellMap=this._cellMap.copy(),e},t.prototype.add=function(t){return this._constant+=t},t.prototype.insertSymbol=function(t,e){void 0===e&&(e=1);var n=this._cellMap.setDefault(t,function(){return 0});i(n.second+=e)&&this._cellMap.erase(t)},t.prototype.insertRow=function(t,e){void 0===e&&(e=1),this._constant+=t._constant*e;for(var n=t._cellMap,i=0,r=n.size();i<r;++i){var o=n.itemAt(i);this.insertSymbol(o.first,o.second*e)}},t.prototype.removeSymbol=function(t){this._cellMap.erase(t)},t.prototype.reverseSign=function(){this._constant=-this._constant;for(var t=this._cellMap,e=0,n=t.size();e<n;++e){var i=t.itemAt(e);i.second=-i.second}},t.prototype.solveFor=function(t){var e=this._cellMap,n=e.erase(t),i=-1/n.second;this._constant*=i;for(var r=0,o=e.size();r<o;++r)e.itemAt(r).second*=i},t.prototype.solveForEx=function(t,e){this.insertSymbol(t,-1),this.solveFor(e)},t.prototype.coefficientFor=function(t){var e=this._cellMap.find(t);return void 0!==e?e.second:0},t.prototype.substitute=function(t,e){var n=this._cellMap.erase(t);void 0!==n&&this.insertRow(e,n.second)},t}()},function(t,e,n){"use strict";/*-----------------------------------------------------------------------------
  | Copyright (c) 2014, Nucleic Development Team.
  |
  | Distributed under the terms of the Modified BSD License.
  |
  | The full license is in the file COPYING.txt, distributed with this software.
  |----------------------------------------------------------------------------*/
  Object.defineProperty(n,"__esModule",{value:!0});var i;!function(t){function e(t,e,n,i){void 0===i&&(i=1);var r=0;return r+=1e6*Math.max(0,Math.min(1e3,t*i)),r+=1e3*Math.max(0,Math.min(1e3,e*i)),r+=Math.max(0,Math.min(1e3,n*i))}function n(e){return Math.max(0,Math.min(t.required,e))}t.create=e,t.required=e(1e3,1e3,1e3),t.strong=e(1,0,0),t.medium=e(0,1,0),t.weak=e(0,0,1),t.clip=n}(i=n.Strength||(n.Strength={}))},function(t,e,n){"use strict";function i(t,e,n){for(var i,r,o=0,s=t.length;s>0;)i=s>>1,r=o+i,n(t[r],e)<0?(o=r+1,s-=i+1):s=i;return o}function r(t,e,n){var r=i(t,e,n);if(r===t.length)return-1;var o=t[r];return 0!==n(o,e)?-1:r}function o(t,e,n){var r=i(t,e,n);if(r!==t.length){var o=t[r];if(0===n(o,e))return o}}function s(t,e){var n=p.asArray(t),i=n.length;if(i<=1)return n;n.sort(e);for(var r=[n[0]],o=1,s=0;o<i;++o){var a=n[o];0!==e(r[s],a)&&(r.push(a),++s)}return r}function a(t,e,n){for(var i=0,r=0,o=t.length,s=e.length;i<o&&r<s;){var a=n(t[i],e[r]);if(a<0)++i;else{if(!(a>0))return!1;++r}}return!0}function l(t,e,n){var i=t.length,r=e.length;if(i>r)return!1;for(var o=0,s=0;o<i&&s<r;){var a=n(t[o],e[s]);if(a<0)return!1;a>0?++s:(++o,++s)}return!(o<i)}function u(t,e,n){for(var i=0,r=0,o=t.length,s=e.length,a=[];i<o&&r<s;){var l=t[i],u=e[r],h=n(l,u);h<0?(a.push(l),++i):h>0?(a.push(u),++r):(a.push(l),++i,++r)}for(;i<o;)a.push(t[i]),++i;for(;r<s;)a.push(e[r]),++r;return a}function h(t,e,n){for(var i=0,r=0,o=t.length,s=e.length,a=[];i<o&&r<s;){var l=t[i],u=e[r],h=n(l,u);h<0?++i:h>0?++r:(a.push(l),++i,++r)}return a}function c(t,e,n){for(var i=0,r=0,o=t.length,s=e.length,a=[];i<o&&r<s;){var l=t[i],u=e[r],h=n(l,u);h<0?(a.push(l),++i):h>0?++r:(++i,++r)}for(;i<o;)a.push(t[i]),++i;return a}function _(t,e,n){for(var i=0,r=0,o=t.length,s=e.length,a=[];i<o&&r<s;){var l=t[i],u=e[r],h=n(l,u);h<0?(a.push(l),++i):h>0?(a.push(u),++r):(++i,++r)}for(;i<o;)a.push(t[i]),++i;for(;r<s;)a.push(e[r]),++r;return a}/*-----------------------------------------------------------------------------
  | Copyright (c) 2014, Nucleic Development Team.
  |
  | Distributed under the terms of the Modified BSD License.
  |
  | The full license is in the file COPYING.txt, distributed with this software.
  |----------------------------------------------------------------------------*/
  Object.defineProperty(n,"__esModule",{value:!0});var p=t(329);n.lowerBound=i,n.binarySearch=r,n.binaryFind=o,n.asSet=s,n.setIsDisjoint=a,n.setIsSubset=l,n.setUnion=u,n.setIntersection=h,n.setDifference=c,n.setSymmetricDifference=_},function(t,e,n){"use strict";/*-----------------------------------------------------------------------------
  | Copyright (c) 2014, Nucleic Development Team.
  |
  | Distributed under the terms of the Modified BSD License.
  |
  | The full license is in the file COPYING.txt, distributed with this software.
  |----------------------------------------------------------------------------*/
  Object.defineProperty(n,"__esModule",{value:!0});var i=t(329),r=function(){function t(){this._array=[]}return t.prototype.size=function(){return this._array.length},t.prototype.empty=function(){return 0===this._array.length},t.prototype.itemAt=function(t){return this._array[t]},t.prototype.takeAt=function(t){return this._array.splice(t,1)[0]},t.prototype.clear=function(){this._array=[]},t.prototype.swap=function(t){var e=this._array;this._array=t._array,t._array=e},t.prototype.__iter__=function(){return i.iter(this._array)},t.prototype.__reversed__=function(){return i.reversed(this._array)},t}();n.ArrayBase=r},function(t,e,n){"use strict";function i(t){return function(e,n){return t(e.first,n)}}function r(t,e,n){for(var i=0,r=0,o=t.length,s=e.length,a=[];i<o&&r<s;){var l=t[i],u=e[r],h=n(l.first,u.first);h<0?(a.push(l.copy()),++i):h>0?(a.push(u.copy()),++r):(a.push(u.copy()),++i,++r)}for(;i<o;)a.push(t[i].copy()),++i;for(;r<s;)a.push(e[r].copy()),++r;return a}/*-----------------------------------------------------------------------------
  | Copyright (c) 2014, Nucleic Development Team.
  |
  | Distributed under the terms of the Modified BSD License.
  |
  | The full license is in the file COPYING.txt, distributed with this software.
  |----------------------------------------------------------------------------*/
  var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=t(330),a=t(326),l=t(325),u=t(329),h=function(t){function e(e){var n=t.call(this)||this;return n._compare=e,n._wrapped=i(e),n}return o(e,t),e.prototype.comparitor=function(){return this._compare},e.prototype.indexOf=function(t){return l.binarySearch(this._array,t,this._wrapped)},e.prototype.contains=function(t){return l.binarySearch(this._array,t,this._wrapped)>=0},e.prototype.find=function(t){return l.binaryFind(this._array,t,this._wrapped)},e.prototype.setDefault=function(t,e){var n=this._array,i=l.lowerBound(n,t,this._wrapped);if(i===n.length){var r=new s.Pair(t,e());return n.push(r),r}var o=n[i];if(0!==this._compare(o.first,t)){var r=new s.Pair(t,e());return n.splice(i,0,r),r}return o},e.prototype.insert=function(t,e){var n=this._array,i=l.lowerBound(n,t,this._wrapped);if(i===n.length){var r=new s.Pair(t,e);return n.push(r),r}var o=n[i];if(0!==this._compare(o.first,t)){var r=new s.Pair(t,e);return n.splice(i,0,r),r}return o.second=e,o},e.prototype.update=function(t){var n=this;t instanceof e?this._array=r(this._array,t._array,this._compare):u.forEach(t,function(t){n.insert(t.first,t.second)})},e.prototype.erase=function(t){var e=this._array,n=l.binarySearch(e,t,this._wrapped);if(!(n<0))return e.splice(n,1)[0]},e.prototype.copy=function(){for(var t=new e(this._compare),n=t._array,i=this._array,r=0,o=i.length;r<o;++r)n.push(i[r].copy());return t},e}(a.ArrayBase);n.AssociativeArray=h},function(t,e,n){"use strict";function i(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}Object.defineProperty(n,"__esModule",{value:!0}),i(t(325)),i(t(326)),i(t(327)),i(t(329)),i(t(330))},function(t,e,n){"use strict";function i(t){return t instanceof Array?new h(t):t.__iter__()}function r(t){return t instanceof Array?new c(t):t.__reversed__()}function o(t){return t.__next__()}function s(t){if(t instanceof Array)return t.slice();for(var e,n=[],i=t.__iter__();void 0!==(e=i.__next__());)n.push(e);return n}function a(t,e){if(t instanceof Array){for(var n=0,i=t.length;n<i;++n)if(e(t[n])===!1)return}else for(var r,o=t.__iter__();void 0!==(r=o.__next__());)if(e(r)===!1)return}function l(t,e){var n=[];if(t instanceof Array)for(var i=0,r=t.length;i<r;++i)n.push(e(t[i]));else for(var o,s=t.__iter__();void 0!==(o=s.__next__());)n.push(e(o));return n}function u(t,e){var n,i=[];if(t instanceof Array)for(var r=0,o=t.length;r<o;++r)n=t[r],e(n)&&i.push(n);else for(var s=t.__iter__();void 0!==(n=s.__next__());)e(n)&&i.push(n);return i}/*-----------------------------------------------------------------------------
  | Copyright (c) 2014, Nucleic Development Team.
  |
  | Distributed under the terms of the Modified BSD License.
  |
  | The full license is in the file COPYING.txt, distributed with this software.
  |----------------------------------------------------------------------------*/
  Object.defineProperty(n,"__esModule",{value:!0});var h=function(){function t(t,e){"undefined"==typeof e&&(e=0),this._array=t,this._index=Math.max(0,Math.min(e,t.length))}return t.prototype.__next__=function(){return this._array[this._index++]},t.prototype.__iter__=function(){return this},t}();n.ArrayIterator=h;var c=function(){function t(t,e){"undefined"==typeof e&&(e=t.length),this._array=t,this._index=Math.max(0,Math.min(e,t.length))}return t.prototype.__next__=function(){return this._array[--this._index]},t.prototype.__iter__=function(){return this},t}();n.ReverseArrayIterator=c,n.iter=i,n.reversed=r,n.next=o,n.asArray=s,n.forEach=a,n.map=l,n.filter=u},function(t,e,n){"use strict";/*-----------------------------------------------------------------------------
  | Copyright (c) 2014, Nucleic Development Team.
  |
  | Distributed under the terms of the Modified BSD License.
  |
  | The full license is in the file COPYING.txt, distributed with this software.
  |----------------------------------------------------------------------------*/
  Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.copy=function(){return new t(this.first,this.second)},t}();n.Pair=i},function(t,e,n){"use strict";/*-----------------------------------------------------------------------------
  | Copyright (c) 2014, Nucleic Development Team.
  |
  | Distributed under the terms of the Modified BSD License.
  |
  | The full license is in the file COPYING.txt, distributed with this software.
  |----------------------------------------------------------------------------*/
  Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function t(t){void 0===t&&(t=""),this._value=0,this._context=null,this._id=r++,this._name=t}return t.Compare=function(t,e){return t.id-e.id},t.prototype.toString=function(){return this._name},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t.prototype.setName=function(t){this._name=t},Object.defineProperty(t.prototype,"context",{get:function(){return this._context},enumerable:!0,configurable:!0}),t.prototype.setContext=function(t){this._context=t},Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t){this._value=t},t}();n.Variable=i;var r=0},function(t,e,n){function i(t){this._value=t}function r(t){var e,n="";for(e=0;e<t;e++)n+="0";return n}function o(t,e){var n,i,o,s,a;return a=t.toString(),n=a.split("e")[0],s=a.split("e")[1],i=n.split(".")[0],o=n.split(".")[1]||"",a=i+o+r(s-o.length),e>0&&(a+="."+r(e)),a}function s(t,e,n,i){var r,s,a=Math.pow(10,e);return s=t.toFixed(0).search("e")>-1?o(t,e):(n(t*a)/a).toFixed(e),i&&(r=new RegExp("0{1,"+i+"}$"),s=s.replace(r,"")),s}function a(t,e,n){var i;return i=e.indexOf("$")>-1?l(t,e,n):e.indexOf("%")>-1?u(t,e,n):e.indexOf(":")>-1?h(t):c(t,e,n)}function l(t,e,n){var i,r,o=e,s=o.indexOf("$"),a=o.indexOf("("),l=o.indexOf("+"),u=o.indexOf("-"),h="",_="";if(o.indexOf("$")===-1?"infix"===v[y].currency.position?(_=v[y].currency.symbol,v[y].currency.spaceSeparated&&(_=" "+_+" ")):v[y].currency.spaceSeparated&&(h=" "):o.indexOf(" $")>-1?(h=" ",o=o.replace(" $","")):o.indexOf("$ ")>-1?(h=" ",o=o.replace("$ ","")):o=o.replace("$",""),r=c(t,o,n,_),e.indexOf("$")===-1)switch(v[y].currency.position){case"postfix":r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,h+v[y].currency.symbol),r=r.join("")):r=r+h+v[y].currency.symbol;break;case"infix":break;case"prefix":r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),i=Math.max(a,u)+1,r.splice(i,0,v[y].currency.symbol+h),r=r.join("")):r=v[y].currency.symbol+h+r;break;default:throw Error('Currency position should be among ["prefix", "infix", "postfix"]')}else s<=1?r.indexOf("(")>-1||r.indexOf("+")>-1||r.indexOf("-")>-1?(r=r.split(""),i=1,(s<a||s<l||s<u)&&(i=0),r.splice(i,0,v[y].currency.symbol+h),r=r.join("")):r=v[y].currency.symbol+h+r:r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,h+v[y].currency.symbol),r=r.join("")):r=r+h+v[y].currency.symbol;return r}function u(t,e,n){var i,r="";return t=100*t,e.indexOf(" %")>-1?(r=" ",e=e.replace(" %","")):e=e.replace("%",""),i=c(t,e,n),i.indexOf(")")>-1?(i=i.split(""),i.splice(-1,0,r+"%"),i=i.join("")):i=i+r+"%",i}function h(t){var e=Math.floor(t/60/60),n=Math.floor((t-60*e*60)/60),i=Math.round(t-60*e*60-60*n);return e+":"+(n<10?"0"+n:n)+":"+(i<10?"0"+i:i)}function c(t,e,n,i){var r,o,a,l,u,h,c,_,p,d,f,m,g,x,w,k,M,S,T=!1,O=!1,A=!1,E="",j=!1,P=!1,z=!1,C=!1,N=!1,D="",F="",I=Math.abs(t),B=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],R=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],L="",V=!1,G=!1,U="";if(0===t&&null!==b)return b;if(!isFinite(t))return""+t;if(0===e.indexOf("{")){var q=e.indexOf("}");if(q===-1)throw Error('Format should also contain a "}"');m=e.slice(1,q),e=e.slice(q+1)}else m="";if(e.indexOf("}")===e.length-1){var Y=e.indexOf("{");if(Y===-1)throw Error('Format should also contain a "{"');g=e.slice(Y+1,-1),e=e.slice(0,Y+1)}else g="";var X;if(X=e.indexOf(".")===-1?e.match(/([0-9]+).*/):e.match(/([0-9]+)\..*/),S=null===X?-1:X[1].length,e.indexOf("-")!==-1&&(V=!0),e.indexOf("(")>-1?(T=!0,e=e.slice(1,-1)):e.indexOf("+")>-1&&(O=!0,e=e.replace(/\+/g,"")),e.indexOf("a")>-1){if(d=e.split(".")[0].match(/[0-9]+/g)||["0"],d=parseInt(d[0],10),j=e.indexOf("aK")>=0,P=e.indexOf("aM")>=0,z=e.indexOf("aB")>=0,C=e.indexOf("aT")>=0,N=j||P||z||C,e.indexOf(" a")>-1?(E=" ",e=e.replace(" a","")):e=e.replace("a",""),u=Math.floor(Math.log(I)/Math.LN10)+1,c=u%3,c=0===c?3:c,d&&0!==I&&(h=Math.floor(Math.log(I)/Math.LN10)+1-d,_=3*~~((Math.min(d,u)-c)/3),I/=Math.pow(10,_),e.indexOf(".")===-1&&d>3))for(e+="[.]",k=0===h?0:3*~~(h/3)-h,k=k<0?k+3:k,r=0;r<k;r++)e+="0";Math.floor(Math.log(Math.abs(t))/Math.LN10)+1!==d&&(I>=Math.pow(10,12)&&!N||C?(E+=v[y].abbreviations.trillion,t/=Math.pow(10,12)):I<Math.pow(10,12)&&I>=Math.pow(10,9)&&!N||z?(E+=v[y].abbreviations.billion,t/=Math.pow(10,9)):I<Math.pow(10,9)&&I>=Math.pow(10,6)&&!N||P?(E+=v[y].abbreviations.million,t/=Math.pow(10,6)):(I<Math.pow(10,6)&&I>=Math.pow(10,3)&&!N||j)&&(E+=v[y].abbreviations.thousand,t/=Math.pow(10,3)))}if(e.indexOf("b")>-1)for(e.indexOf(" b")>-1?(D=" ",e=e.replace(" b","")):e=e.replace("b",""),l=0;l<=B.length;l++)if(o=Math.pow(1024,l),a=Math.pow(1024,l+1),t>=o&&t<a){D+=B[l],o>0&&(t/=o);break}if(e.indexOf("d")>-1)for(e.indexOf(" d")>-1?(D=" ",e=e.replace(" d","")):e=e.replace("d",""),l=0;l<=R.length;l++)if(o=Math.pow(1e3,l),a=Math.pow(1e3,l+1),t>=o&&t<a){D+=R[l],o>0&&(t/=o);break}if(e.indexOf("o")>-1&&(e.indexOf(" o")>-1?(F=" ",e=e.replace(" o","")):e=e.replace("o",""),v[y].ordinal&&(F+=v[y].ordinal(t))),e.indexOf("[.]")>-1&&(A=!0,e=e.replace("[.]",".")),p=t.toString().split(".")[0],f=e.split(".")[1],x=e.indexOf(","),f){if(f.indexOf("*")!==-1?L=s(t,t.toString().split(".")[1].length,n):f.indexOf("[")>-1?(f=f.replace("]",""),f=f.split("["),L=s(t,f[0].length+f[1].length,n,f[1].length)):L=s(t,f.length,n),p=L.split(".")[0],L.split(".")[1].length){var W=i?E+i:v[y].delimiters.decimal;L=W+L.split(".")[1]}else L="";A&&0===Number(L.slice(1))&&(L="")}else p=s(t,null,n);return p.indexOf("-")>-1&&(p=p.slice(1),G=!0),p.length<S&&(p=new Array(S-p.length+1).join("0")+p),x>-1&&(p=p.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+v[y].delimiters.thousands)),0===e.indexOf(".")&&(p=""),w=e.indexOf("("),M=e.indexOf("-"),U=w<M?(T&&G?"(":"")+(V&&G||!T&&G?"-":""):(V&&G||!T&&G?"-":"")+(T&&G?"(":""),m+U+(!G&&O&&0!==t?"+":"")+p+L+(F?F:"")+(E&&!i?E:"")+(D?D:"")+(T&&G?")":"")+g}function _(t,e){v[t]=e}function p(t){y=t;var e=v[t].defaults;e&&e.format&&f.defaultFormat(e.format),e&&e.currencyFormat&&f.defaultCurrencyFormat(e.currencyFormat)}function d(t,e,n,i){return null!=n&&n!==f.culture()&&f.setCulture(n),a(Number(t),null!=e?e:x,null==i?Math.round:i)}/*!
   * numbro.js
   * version : 1.6.2
   * author : Företagsplatsen AB
   * license : MIT
   * http://www.foretagsplatsen.se
   */
  var f,m="1.6.2",v={},g=v,y="en-US",b=null,x="0,0",w="0$",k=("undefined"!=typeof e&&e.exports,{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(t){var e=t%10;return 1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th"},currency:{symbol:"$",position:"prefix"},defaults:{currencyFormat:",0000 a"},formats:{fourDigits:"0000 a",fullWithTwoDecimals:"$ ,0.00",fullWithTwoDecimalsNoCurrency:",0.00"}});f=function(t){return f.isNumbro(t)?t=t.value():0===t||"undefined"==typeof t?t=0:Number(t)||(t=f.fn.unformat(t)),new i(Number(t))},f.version=m,f.isNumbro=function(t){return t instanceof i},f.setLanguage=function(t,e){console.warn("`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead");var n=t,i=t.split("-")[0],r=null;g[n]||(Object.keys(g).forEach(function(t){r||t.split("-")[0]!==i||(r=t)}),n=r||e||"en-US"),p(n)},f.setCulture=function(t,e){var n=t,i=t.split("-")[1],r=null;v[n]||(i&&Object.keys(v).forEach(function(t){r||t.split("-")[1]!==i||(r=t)}),n=r||e||"en-US"),p(n)},f.language=function(t,e){if(console.warn("`language` is deprecated since version 1.6.0. Use `culture` instead"),!t)return y;if(t&&!e){if(!g[t])throw new Error("Unknown language : "+t);p(t)}return!e&&g[t]||_(t,e),f},f.culture=function(t,e){if(!t)return y;if(t&&!e){if(!v[t])throw new Error("Unknown culture : "+t);p(t)}return!e&&v[t]||_(t,e),f},f.languageData=function(t){if(console.warn("`languageData` is deprecated since version 1.6.0. Use `cultureData` instead"),!t)return g[y];if(!g[t])throw new Error("Unknown language : "+t);return g[t]},f.cultureData=function(t){if(!t)return v[y];if(!v[t])throw new Error("Unknown culture : "+t);return v[t]},f.culture("en-US",k),f.languages=function(){return console.warn("`languages` is deprecated since version 1.6.0. Use `cultures` instead"),g},f.cultures=function(){return v},f.zeroFormat=function(t){b="string"==typeof t?t:null},f.defaultFormat=function(t){x="string"==typeof t?t:"0.0"},f.defaultCurrencyFormat=function(t){w="string"==typeof t?t:"0$"},f.validate=function(t,e){var n,i,r,o,s,a,l,u;if("string"!=typeof t&&(t+="",console.warn&&console.warn("Numbro.js: Value is not string. It has been co-erced to: ",t)),t=t.trim(),t.match(/^\d+$/))return!0;if(""===t)return!1;try{l=f.cultureData(e)}catch(h){l=f.cultureData(f.culture())}return r=l.currency.symbol,s=l.abbreviations,n=l.delimiters.decimal,i="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,u=t.match(/^[^\d]+/),(null===u||(t=t.substr(1),u[0]===r))&&(u=t.match(/[^\d]+$/),(null===u||(t=t.slice(0,-1),u[0]===s.thousand||u[0]===s.million||u[0]===s.billion||u[0]===s.trillion))&&(a=new RegExp(i+"{2}"),!t.match(/[^\d.,]/g)&&(o=t.split(n),!(o.length>2)&&(o.length<2?!!o[0].match(/^\d+.*\d$/)&&!o[0].match(a):1===o[0].length?!!o[0].match(/^\d+$/)&&!o[0].match(a)&&!!o[1].match(/^\d+$/):!!o[0].match(/^\d+.*\d$/)&&!o[0].match(a)&&!!o[1].match(/^\d+$/)))))},e.exports={format:d}},function(t,e,n){function i(t,e){if(!(this instanceof i))return new i(t);e=e||function(t){if(t)throw t};var n=r(t);if("object"!=typeof n)return void e(t);var s=i.projections.get(n.projName);if(!s)return void e(t);if(n.datumCode&&"none"!==n.datumCode){var h=l[n.datumCode];h&&(n.datum_params=h.towgs84?h.towgs84.split(","):null,n.ellps=h.ellipse,n.datumName=h.datumName?h.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu";var c=a.sphere(n.a,n.b,n.rf,n.ellps,n.sphere),_=a.eccentricity(c.a,c.b,c.rf,n.R_A),p=n.datum||u(n.datumCode,n.datum_params,c.a,c.b,_.es,_.ep2);o(this,n),o(this,s),this.a=c.a,this.b=c.b,this.rf=c.rf,this.sphere=c.sphere,this.es=_.es,this.e=_.e,this.ep2=_.ep2,this.datum=p,this.init(),e(null,this)}var r=t(353),o=t(351),s=t(355),a=t(350),l=t(341),u=t(346);i.projections=s,i.projections.start(),e.exports=i},function(t,e,n){e.exports=function(t,e,n){var i,r,o,s=n.x,a=n.y,l=n.z||0,u={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==n.z)switch(0===o?(i=s,r="x"):1===o?(i=a,r="y"):(i=l,r="z"),t.axis[o]){case"e":u[r]=i;break;case"w":u[r]=-i;break;case"n":u[r]=i;break;case"s":u[r]=-i;break;case"u":void 0!==n[r]&&(u.z=i);break;case"d":void 0!==n[r]&&(u.z=-i);break;default:return null}return u}},function(t,e,n){var i=2*Math.PI,r=3.14159265359,o=t(338);e.exports=function(t){return Math.abs(t)<=r?t:t-o(t)*i}},function(t,e,n){e.exports=function(t,e,n){var i=t*e;return n/Math.sqrt(1-i*i)}},function(t,e,n){var i=Math.PI/2;e.exports=function(t,e){for(var n,r,o=.5*t,s=i-2*Math.atan(e),a=0;a<=15;a++)if(n=t*Math.sin(s),r=i-2*Math.atan(e*Math.pow((1-n)/(1+n),o))-s,s+=r,Math.abs(r)<=1e-10)return s;return-9999}},function(t,e,n){e.exports=function(t){return t<0?-1:1}},function(t,e,n){e.exports=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}},function(t,e,n){var i=Math.PI/2;e.exports=function(t,e,n){var r=t*n,o=.5*t;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(i-e))/r}},function(t,e,n){n.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},n.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},n.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},n.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},n.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},n.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},n.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},n.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},n.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},n.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},n.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},n.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},n.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},n.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},n.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},n.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},function(t,e,n){n.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},n.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},n.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},n.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},n.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},n.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},n.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},n.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},n.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},n.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},n.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},n.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},n.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},n.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},n.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},n.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},n.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},n.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},n.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},n.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},n.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},n.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},n.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},n.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},n.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},n.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},n.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},n.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},n.hough={a:6378270,rf:297,ellipseName:"Hough"},n.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},n.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},n.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},n.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},n.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},n.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},n.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},n.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},n.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},n.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},n.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},n.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"},n.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"},n.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},function(t,e,n){n.greenwich=0,n.lisbon=-9.131906111111,n.paris=2.337229166667,n.bogota=-74.080916666667,n.madrid=-3.687938888889,n.rome=12.452333333333,n.bern=7.439583333333,n.jakarta=106.807719444444,n.ferro=-17.666666666667,n.brussels=4.367975,n.stockholm=18.058277777778,n.athens=23.7163375,n.oslo=10.722916666667},function(t,e,n){n.ft={to_meter:.3048},n["us-ft"]={to_meter:1200/3937}},function(t,e,n){function i(t,e,n){var i;return Array.isArray(n)?(i=a(t,e,n),3===n.length?[i.x,i.y,i.z]:[i.x,i.y]):a(t,e,n)}function r(t){return t instanceof s?t:t.oProj?t.oProj:s(t)}function o(t,e,n){t=r(t);var o,s=!1;return"undefined"==typeof e?(e=t,t=l,s=!0):("undefined"!=typeof e.x||Array.isArray(e))&&(n=e,e=t,t=l,s=!0),e=r(e),n?i(t,e,n):(o={forward:function(n){return i(t,e,n)},inverse:function(n){return i(e,t,n)}},s&&(o.oProj=e),o)}var s=t(333),a=t(358),l=s("WGS84");e.exports=o},function(t,e,n){function i(t,e,n,i,u,h){var c={};return c.datum_type=s,t&&"none"===t&&(c.datum_type=a),e&&(c.datum_params=e.map(parseFloat),0===c.datum_params[0]&&0===c.datum_params[1]&&0===c.datum_params[2]||(c.datum_type=r),c.datum_params.length>3&&(0===c.datum_params[3]&&0===c.datum_params[4]&&0===c.datum_params[5]&&0===c.datum_params[6]||(c.datum_type=o,c.datum_params[3]*=l,c.datum_params[4]*=l,c.datum_params[5]*=l,c.datum_params[6]=c.datum_params[6]/1e6+1))),c.a=n,c.b=i,c.es=u,c.ep2=h,c}var r=1,o=2,s=4,a=5,l=484813681109536e-20;e.exports=i},function(t,e,n){"use strict";var i=1,r=2,o=Math.PI/2;n.compareDatums=function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(this.es-e.es)>5e-11)&&(t.datum_type===i?this.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==r||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))},n.geodeticToGeocentric=function(t,e,n){var i,r,s,a,l=t.x,u=t.y,h=t.z?t.z:0;if(u<-o&&u>-1.001*o)u=-o;else if(u>o&&u<1.001*o)u=o;else if(u<-o||u>o)return null;return l>Math.PI&&(l-=2*Math.PI),r=Math.sin(u),a=Math.cos(u),s=r*r,i=n/Math.sqrt(1-e*s),{x:(i+h)*a*Math.cos(l),y:(i+h)*a*Math.sin(l),z:(i*(1-e)+h)*r}},n.geocentricToGeodetic=function(t,e,n,i){var r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x=1e-12,w=x*x,k=30,M=t.x,S=t.y,T=t.z?t.z:0;if(r=Math.sqrt(M*M+S*S),s=Math.sqrt(M*M+S*S+T*T),r/n<x){if(g=0,s/n<x)return y=o,b=-i,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(S,M);a=T/s,l=r/s,u=1/Math.sqrt(1-e*(2-e)*l*l),_=l*(1-e)*u,p=a*u,v=0;do v++,c=n/Math.sqrt(1-e*p*p),b=r*_+T*p-c*(1-e*p*p),h=e*c/(c+b),u=1/Math.sqrt(1-h*(2-h)*l*l),d=l*(1-h)*u,f=a*u,m=f*_-d*p,_=d,p=f;while(m*m>w&&v<k);return y=Math.atan(f/Math.abs(d)),{x:g,y:y,z:b}},n.geocentricToWgs84=function(t,e,n){if(e===i)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(e===r){var o=n[0],s=n[1],a=n[2],l=n[3],u=n[4],h=n[5],c=n[6];return{x:c*(t.x-h*t.y+u*t.z)+o,y:c*(h*t.x+t.y-l*t.z)+s,z:c*(-u*t.x+l*t.y+t.z)+a}}},n.geocentricFromWgs84=function(t,e,n){if(e===i)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(e===r){var o=n[0],s=n[1],a=n[2],l=n[3],u=n[4],h=n[5],c=n[6],_=(t.x-o)/c,p=(t.y-s)/c,d=(t.z-a)/c;return{x:_+h*p-u*d,y:-h*_+p+l*d,z:u*_-l*p+d}}}},function(t,e,n){function i(t){return t===r||t===o}var r=1,o=2,s=5,a=t(347);e.exports=function(t,e,n){return a.compareDatums(t,e)?n:t.datum_type===s||e.datum_type===s?n:t.es!==e.es||t.a!==e.a||i(t.datum_type)||i(e.datum_type)?(n=a.geodeticToGeocentric(n,t.es,t.a),i(t.datum_type)&&(n=a.geocentricToWgs84(n,t.datum_type,t.datum_params)),i(e.datum_type)&&(n=a.geocentricFromWgs84(n,e.datum_type,e.datum_params)),a.geocentricToGeodetic(n,e.es,e.a,e.b)):n}},function(t,e,n){function i(t){var e=this;if(2===arguments.length){var n=arguments[1];"string"==typeof n?"+"===n.charAt(0)?i[t]=o(arguments[1]):i[t]=s(arguments[1]):i[t]=n}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?i.apply(e,t):i(t)});if("string"==typeof t){if(t in i)return i[t]}else"EPSG"in t?i["EPSG:"+t.EPSG]=t:"ESRI"in t?i["ESRI:"+t.ESRI]=t:"IAU2000"in t?i["IAU2000:"+t.IAU2000]=t:console.log(t);return}}var r=t(352),o=t(354),s=t(359);r(i),e.exports=i},function(t,e,n){var i=.16666666666666666,r=.04722222222222222,o=.022156084656084655,s=1e-10,a=t(342);n.eccentricity=function(t,e,n,s){var a=t*t,l=e*e,u=(a-l)/a,h=0;s?(t*=1-u*(i+u*(r+u*o)),a=t*t,u=0):h=Math.sqrt(u);var c=(a-l)/l;return{es:u,e:h,ep2:c}},n.sphere=function(t,e,n,i,r){if(!t){var o=a[i];o||(o=a.WGS84),t=o.a,e=o.b,n=o.rf}return n&&!e&&(e=(1-1/n)*t),(0===n||Math.abs(t-e)<s)&&(r=!0,e=t),{a:t,b:e,rf:n,sphere:r}}},function(t,e,n){e.exports=function(t,e){t=t||{};var n,i;if(!e)return t;for(i in e)n=e[i],void 0!==n&&(t[i]=n);return t}},function(t,e,n){e.exports=function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}},function(t,e,n){function i(t){return"string"==typeof t}function r(t){return t in l}function o(t){return c.some(function(e){return t.indexOf(e)>-1})}function s(t){return"+"===t[0]}function a(t){return i(t)?r(t)?l[t]:o(t)?u(t):s(t)?h(t):void 0:t}var l=t(349),u=t(359),h=t(354),c=["GEOGCS","GEOCCS","PROJCS","LOCAL_CS"];e.exports=a},function(t,e,n){var i=.017453292519943295,r=t(343),o=t(344);e.exports=function(t){var e,n,s,a={},l=t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var n=e.split("=");return n.push(!0),t[n[0].toLowerCase()]=n[1],t},{}),u={proj:"projName",datum:"datumCode",rf:function(t){a.rf=parseFloat(t)},lat_0:function(t){a.lat0=t*i},lat_1:function(t){a.lat1=t*i},lat_2:function(t){a.lat2=t*i},lat_ts:function(t){a.lat_ts=t*i},lon_0:function(t){a.long0=t*i},lon_1:function(t){a.long1=t*i},lon_2:function(t){a.long2=t*i},alpha:function(t){a.alpha=parseFloat(t)*i},lonc:function(t){a.longc=t*i},x_0:function(t){a.x0=parseFloat(t)},y_0:function(t){a.y0=parseFloat(t)},k_0:function(t){a.k0=parseFloat(t)},k:function(t){a.k0=parseFloat(t)},a:function(t){a.a=parseFloat(t)},b:function(t){a.b=parseFloat(t)},r_a:function(){a.R_A=!0},zone:function(t){a.zone=parseInt(t,10)},south:function(){a.utmSouth=!0},towgs84:function(t){a.datum_params=t.split(",").map(function(t){return parseFloat(t)})},to_meter:function(t){a.to_meter=parseFloat(t)},units:function(t){a.units=t,o[t]&&(a.to_meter=o[t].to_meter)},from_greenwich:function(t){a.from_greenwich=t*i},pm:function(t){a.from_greenwich=(r[t]?r[t]:parseFloat(t))*i},nadgrids:function(t){"@null"===t?a.datumCode="none":a.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&e.indexOf(t.substr(0,1))!==-1&&e.indexOf(t.substr(1,1))!==-1&&e.indexOf(t.substr(2,1))!==-1&&(a.axis=t)}};for(e in l)n=l[e],e in u?(s=u[e],"function"==typeof s?s(n):a[s]=n):a[e]=n;return"string"==typeof a.datumCode&&"WGS84"!==a.datumCode&&(a.datumCode=a.datumCode.toLowerCase()),a}},function(t,e,n){function i(t,e){var n=s.length;return t.names?(s[n]=t,t.names.forEach(function(t){o[t.toLowerCase()]=n}),this):(console.log(e),!0)}var r=[t(357),t(356)],o={},s=[];n.add=i,n.get=function(t){if(!t)return!1;var e=t.toLowerCase();return"undefined"!=typeof o[e]&&s[o[e]]?s[o[e]]:void 0},n.start=function(){r.forEach(i)}},function(t,e,n){function i(t){return t}n.init=function(){},n.forward=i,n.inverse=i,n.names=["longlat","identity"]},function(t,e,n){var i=t(336),r=Math.PI/2,o=1e-10,s=57.29577951308232,a=t(335),l=Math.PI/4,u=t(340),h=t(337);n.init=function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},n.forward=function(t){var e=t.x,n=t.y;if(n*s>90&&n*s<-90&&e*s>180&&e*s<-180)return null;var i,h;if(Math.abs(Math.abs(n)-r)<=o)return null;if(this.sphere)i=this.x0+this.a*this.k0*a(e-this.long0),h=this.y0+this.a*this.k0*Math.log(Math.tan(l+.5*n));else{var c=Math.sin(n),_=u(this.e,n,c);i=this.x0+this.a*this.k0*a(e-this.long0),h=this.y0-this.a*this.k0*Math.log(_)}return t.x=i,t.y=h,t},n.inverse=function(t){var e,n,i=t.x-this.x0,o=t.y-this.y0;if(this.sphere)n=r-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var s=Math.exp(-o/(this.a*this.k0));if(n=h(this.e,s),n===-9999)return null}return e=a(this.long0+i/(this.a*this.k0)),t.x=e,t.y=n,t},n.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},function(t,e,n){function i(t,e){return(t.datum.datum_type===s||t.datum.datum_type===a)&&"WGS84"!==e.datumCode||(e.datum.datum_type===s||e.datum.datum_type===a)&&"WGS84"!==t.datumCode}var r=.017453292519943295,o=57.29577951308232,s=1,a=2,l=t(348),u=t(334),h=t(333),c=t(339);e.exports=function _(t,e,n){var s;return Array.isArray(n)&&(n=c(n)),t.datum&&e.datum&&i(t,e)&&(s=new h("WGS84"),n=_(t,s,n),t=s),"enu"!==t.axis&&(n=u(t,!1,n)),"longlat"===t.projName?n={x:n.x*r,y:n.y*r}:(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter}),n=t.inverse(n)),t.from_greenwich&&(n.x+=t.from_greenwich),n=l(t.datum,e.datum,n),e.from_greenwich&&(n={x:n.x-e.grom_greenwich,y:n.y}),"longlat"===e.projName?n={x:n.x*o,y:n.y*o}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter})),"enu"!==e.axis?u(e,!0,n):n}},function(t,e,n){function i(t,e,n){t[e]=n.map(function(t){var e={};return r(t,e),e}).reduce(function(t,e){return u(t,e)},{})}function r(t,e){var n;return Array.isArray(t)?(n=t.shift(),"PARAMETER"===n&&(n=t.shift()),1===t.length?Array.isArray(t[0])?(e[n]={},r(t[0],e[n])):e[n]=t[0]:t.length?"TOWGS84"===n?e[n]=t:(e[n]={},["UNIT","PRIMEM","VERT_DATUM"].indexOf(n)>-1?(e[n]={name:t[0].toLowerCase(),convert:t[1]},3===t.length&&(e[n].auth=t[2])):"SPHEROID"===n?(e[n]={name:t[0],a:t[1],rf:t[2]},4===t.length&&(e[n].auth=t[3])):["GEOGCS","GEOCCS","DATUM","VERT_CS","COMPD_CS","LOCAL_CS","FITTED_CS","LOCAL_DATUM"].indexOf(n)>-1?(t[0]=["name",t[0]],i(e,n,t)):t.every(function(t){return Array.isArray(t)})?i(e,n,t):r(t,e[n])):e[n]=!0,void 0):void(e[t]=!0)}function o(t,e){var n=e[0],i=e[1];!(n in t)&&i in t&&(t[n]=t[i],3===e.length&&(t[n]=e[2](t[n])))}function s(t){return t*l}function a(t){function e(e){var n=t.to_meter||1;return parseFloat(e,10)*n}"GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=parseFloat(t.UNIT.convert,10)*t.DATUM.SPHEROID.a):t.to_meter=parseFloat(t.UNIT.convert,10))),t.GEOGCS&&(t.GEOGCS.DATUM?t.datumCode=t.GEOGCS.DATUM.name.toLowerCase():t.datumCode=t.GEOGCS.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"===t.datumCode&&("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),t.GEOGCS.DATUM&&t.GEOGCS.DATUM.SPHEROID&&(t.ellps=t.GEOGCS.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=t.GEOGCS.DATUM.SPHEROID.a,t.rf=parseFloat(t.GEOGCS.DATUM.SPHEROID.rf,10)),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36")),t.b&&!isFinite(t.b)&&(t.b=t.a);var n=function(e){return o(t,e)},i=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",s],["longitude_of_center","Longitude_Of_Center"],["longc","longitude_of_center",s],["x0","false_easting",e],["y0","false_northing",e],["long0","central_meridian",s],["lat0","latitude_of_origin",s],["lat0","standard_parallel_1",s],["lat1","standard_parallel_1",s],["lat2","standard_parallel_2",s],["alpha","azimuth",s],["srsCode","name"]];i.forEach(n),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=s(t.lat1>0?90:-90),t.lat_ts=t.lat1)}var l=.017453292519943295,u=t(351);e.exports=function(t,e){var n=JSON.parse((","+t).replace(/\s*\,\s*([A-Z_0-9]+?)(\[)/g,',["$1",').slice(1).replace(/\s*\,\s*([A-Z_0-9]+?)\]/g,',"$1"]').replace(/,\["VERTCS".+/,"")),i=n.shift(),o=n.shift();n.unshift(["name",o]),n.unshift(["type",i]),n.unshift("output");var s={};return r(n,s),a(s.output),u(e,s.output)}},function(t,e,n){"use strict";function i(t,e,n,s,a){for(n=n||0,s=s||t.length-1,a=a||o;s>n;){if(s-n>600){var l=s-n+1,u=e-n+1,h=Math.log(l),c=.5*Math.exp(2*h/3),_=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1),p=Math.max(n,Math.floor(e-u*c/l+_)),d=Math.min(s,Math.floor(e+(l-u)*c/l+_));i(t,e,p,d,a)}var f=t[e],m=n,v=s;for(r(t,n,e),a(t[s],f)>0&&r(t,n,s);m<v;){for(r(t,m,v),m++,v--;a(t[m],f)<0;)m++;for(;a(t[v],f)>0;)v--}0===a(t[n],f)?r(t,n,v):(v++,r(t,v,s)),v<=e&&(n=v+1),e<=v&&(s=v-1)}}function r(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function o(t,e){return t<e?-1:t>e?1:0}e.exports=i},function(t,e,n){"use strict";function i(t,e){return this instanceof i?(this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),void this.clear()):new i(t,e)}function r(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,i,r){r||(r=m(null)),r.minX=1/0,r.minY=1/0,r.maxX=-(1/0),r.maxY=-(1/0);for(var o,s=e;s<n;s++)o=t.children[s],a(r,t.leaf?i(o):o);return r}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function _(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function d(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)}}function v(t,e,n,i,r){for(var o,s=[e,n];s.length;)n=s.pop(),e=s.pop(),n-e<=i||(o=e+Math.ceil((n-e)/i/2)*i,g(t,o,e,n,r),s.push(e,o,o,n))}e.exports=i;var g=t(360);i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],i=this.toBBox;if(!f(t,e))return n;for(var r,o,s,a,l=[];e;){for(r=0,o=e.children.length;r<o;r++)s=e.children[r],a=e.leaf?i(s):s,f(t,a)&&(e.leaf?n.push(s):d(t,a)?this._all(s,n):l.push(s));e=l.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!f(t,e))return!1;for(var i,r,o,s,a=[];e;){for(i=0,r=e.children.length;i<r;i++)if(o=e.children[i],s=e.leaf?n(o):o,f(t,s)){if(e.leaf||d(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(t,e){if(!t)return this;for(var n,i,o,s,a=this.data,l=this.toBBox(t),u=[],h=[];a||u.length;){if(a||(a=u.pop(),i=u[u.length-1],n=h.pop(),s=!0),a.leaf&&(o=r(t,a.children,e),o!==-1))return a.children.splice(o,1),u.push(a),this._condense(u),this;s||a.leaf||!d(a,l)?i?(n++,a=i.children[n],s=!1):a=null:(u.push(a),h.push(n),n=0,i=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,i){var r,s=n-e+1,a=this._maxEntries;if(s<=a)return r=m(t.slice(e,n+1)),o(r,this.toBBox),r;i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,i-1))),r=m([]),r.leaf=!1,r.height=i;var l,u,h,c,_=Math.ceil(s/a),p=_*Math.ceil(Math.sqrt(a));for(v(t,e,n,p,this.compareMinX),l=e;l<=n;l+=p)for(h=Math.min(l+p-1,n),v(t,l,h,_,this.compareMinY),u=l;u<=h;u+=_)c=Math.min(u+_-1,h),r.children.push(this._build(t,u,c,i-1));return o(r,this.toBBox),r},_chooseSubtree:function(t,e,n,i){for(var r,o,s,a,l,u,c,p;;){if(i.push(e),e.leaf||i.length-1===n)break;for(c=p=1/0,r=0,o=e.children.length;r<o;r++)s=e.children[r],l=h(s),u=_(t,s)-l,u<p?(p=u,c=l<c?l:c,a=s):u===p&&l<c&&(c=l,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var i=this.toBBox,r=n?t:i(t),o=[],s=this._chooseSubtree(r,this.data,e,o);for(s.children.push(t),a(s,r);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var s=this._chooseSplitIndex(n,r,i),a=m(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var i,r,o,a,l,u,c,_;for(u=c=1/0,i=e;i<=n-e;i++)r=s(t,0,i,this.toBBox),o=s(t,i,n,this.toBBox),a=p(r,o),l=h(r)+h(o),a<u?(u=a,_=i,c=l<c?l:c):a===u&&l<c&&(c=l,_=i);return _},_chooseSplitAxis:function(t,e,n){var i=t.leaf?this.compareMinX:l,r=t.leaf?this.compareMinY:u,o=this._allDistMargin(t,e,n,i),s=this._allDistMargin(t,e,n,r);o<s&&t.children.sort(i)},_allDistMargin:function(t,e,n,i){t.children.sort(i);var r,o,l=this.toBBox,u=s(t,0,e,l),h=s(t,n-e,n,l),_=c(u)+c(h);for(r=e;r<n-e;r++)o=t.children[r],a(u,t.leaf?l(o):o),_+=c(u);for(r=n-e-1;r>=e;r--)o=t.children[r],a(h,t.leaf?l(o):o),_+=c(h);return _},_adjustParentBBoxes:function(t,e,n){for(var i=n;i>=0;i--)a(e[i],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():o(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},function(e,n,i){!function(){"use strict";function e(t){return r(o(t),arguments)}function n(t,n){return e.apply(null,[t].concat(n||[]))}function r(t,n){var i,r,o,a,l,u,h,c,_,p=1,d=t.length,f="";for(r=0;r<d;r++)if("string"==typeof t[r])f+=t[r];else if(Array.isArray(t[r])){if(a=t[r],a[2])for(i=n[p],o=0;o<a[2].length;o++){if(!i.hasOwnProperty(a[2][o]))throw new Error(e('[sprintf] property "%s" does not exist',a[2][o]));i=i[a[2][o]]}else i=a[1]?n[a[1]]:n[p++];if(s.not_type.test(a[8])&&s.not_primitive.test(a[8])&&i instanceof Function&&(i=i()),s.numeric_arg.test(a[8])&&"number"!=typeof i&&isNaN(i))throw new TypeError(e("[sprintf] expecting number but found %T",i));switch(s.number.test(a[8])&&(c=i>=0),a[8]){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,a[6]?parseInt(a[6]):0);break;case"e":i=a[7]?parseFloat(i).toExponential(a[7]):parseFloat(i).toExponential();break;case"f":i=a[7]?parseFloat(i).toFixed(a[7]):parseFloat(i);break;case"g":i=a[7]?String(Number(i.toPrecision(a[7]))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=a[7]?i.substring(0,a[7]):i;break;case"t":i=String(!!i),i=a[7]?i.substring(0,a[7]):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=a[7]?i.substring(0,a[7]):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=a[7]?i.substring(0,a[7]):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}s.json.test(a[8])?f+=i:(!s.number.test(a[8])||c&&!a[3]?_="":(_=c?"+":"-",i=i.toString().replace(s.sign,"")),u=a[4]?"0"===a[4]?"0":a[4].charAt(1):" ",h=a[6]-(_+i).length,l=a[6]&&h>0?u.repeat(h):"",f+=a[5]?_+i+l:"0"===u?_+l+i:l+_+i)}return f}function o(t){if(a[t])return a[t];for(var e,n=t,i=[],r=0;n;){if(null!==(e=s.text.exec(n)))i.push(e[0]);else if(null!==(e=s.modulo.exec(n)))i.push("%");else{if(null===(e=s.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){r|=1;var o=[],l=e[2],u=[];if(null===(u=s.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=s.key_access.exec(l)))o.push(u[1]);else{if(null===(u=s.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(u[1])}e[2]=o}else r|=2;if(3===r)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push(e)}n=n.substring(e[0].length)}return a[t]=i}var s={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,
  index_access:/^\[(\d+)\]/,sign:/^[\+\-]/},a=Object.create(null);"undefined"!=typeof i&&(i.sprintf=e,i.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n,"function"==typeof t&&t.amd&&t(function(){return{sprintf:e,vsprintf:n}}))}()},function(e,n,i){!function(e){"object"==typeof n&&n.exports?n.exports=e():"function"==typeof t?t(e):this.tz=e()}(function(){function t(t,e,n){var i,r=e.day[1];do i=new Date(Date.UTC(n,e.month,Math.abs(r++)));while(e.day[0]<7&&i.getUTCDay()!=e.day[0]);return i={clock:e.clock,sort:i.getTime(),rule:e,save:6e4*e.save,offset:t.offset},i[i.clock]=i.sort+6e4*e.time,i.posix?i.wallclock=i[i.clock]+(t.offset+e.saved):i.posix=i[i.clock]-(t.offset+e.saved),i}function e(e,n,i){var r,o,s,a,l,u,h,c=e[e.zone],_=[],p=new Date(i).getUTCFullYear(),d=1;for(r=1,o=c.length;r<o&&!(c[r][n]<=i);r++);if(s=c[r],s.rules){for(u=e[s.rules],h=p+1;h>=p-d;--h)for(r=0,o=u.length;r<o;r++)u[r].from<=h&&h<=u[r].to?_.push(t(s,u[r],h)):u[r].to<h&&1==d&&(d=h-u[r].to);for(_.sort(function(t,e){return t.sort-e.sort}),r=0,o=_.length;r<o;r++)i>=_[r][n]&&_[r][_[r].clock]>s[_[r].clock]&&(a=_[r])}return a&&((l=/^(.*)\/(.*)$/.exec(s.format))?a.abbrev=l[a.save?2:1]:a.abbrev=s.format.replace(/%s/,a.rule.letter)),a||s}function n(t,n){return"UTC"==t.zone?n:(t.entry=e(t,"posix",n),n+t.entry.offset+t.entry.save)}function i(t,n){if("UTC"==t.zone)return n;var i,r;return t.entry=i=e(t,"wallclock",n),r=n-i.wallclock,0<r&&r<i.save?null:n-i.offset-i.save}function r(t,e,r){var o,s=+(r[1]+1),a=r[2]*s,l=u.indexOf(r[3].toLowerCase());if(l>9)e+=a*c[l-10];else{if(o=new Date(n(t,e)),l<7)for(;a;)o.setUTCDate(o.getUTCDate()+s),o.getUTCDay()==l&&(a-=s);else 7==l?o.setUTCFullYear(o.getUTCFullYear()+a):8==l?o.setUTCMonth(o.getUTCMonth()+a):o.setUTCDate(o.getUTCDate()+a);null==(e=i(t,o.getTime()))&&(e=i(t,o.getTime()+864e5*s)-864e5*s)}return e}function o(t){if(!t.length)return"1.0.13";var e,o,s,a,l,u=Object.create(this),c=[];for(e=0;e<t.length;e++)if(a=t[e],Array.isArray(a))e||isNaN(a[1])?a.splice.apply(t,[e--,1].concat(a)):l=a;else if(isNaN(a)){if(s=typeof a,"string"==s)~a.indexOf("%")?u.format=a:e||"*"!=a?!e&&(s=/^(\d{4})-(\d{2})-(\d{2})(?:[T\s](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|(([+-])(\d{2}(:\d{2}){0,2})))?)?$/.exec(a))?(l=[],l.push.apply(l,s.slice(1,8)),s[9]?(l.push(s[10]+1),l.push.apply(l,s[11].split(/:/))):s[8]&&l.push(1)):/^\w{2,3}_\w{2}$/.test(a)?u.locale=a:(s=h.exec(a))?c.push(s):u.zone=a:l=a;else if("function"==s){if(s=a.call(u))return s}else if(/^\w{2,3}_\w{2}$/.test(a.name))u[a.name]=a;else if(a.zones){for(s in a.zones)u[s]=a.zones[s];for(s in a.rules)u[s]=a.rules[s]}}else e||(l=a);if(u[u.locale]||delete u.locale,u[u.zone]||delete u.zone,null!=l){if("*"==l)l=u.clock();else if(Array.isArray(l)){for(s=[],o=!l[7],e=0;e<11;e++)s[e]=+(l[e]||0);--s[1],l=Date.UTC.apply(Date.UTC,s)+-s[7]*(36e5*s[8]+6e4*s[9]+1e3*s[10])}else l=Math.floor(l);if(!isNaN(l)){if(o&&(l=i(u,l)),null==l)return l;for(e=0,o=c.length;e<o;e++)l=r(u,l,c[e]);return u.format?(s=new Date(n(u,l)),u.format.replace(/%([-0_^]?)(:{0,3})(\d*)(.)/g,function(t,e,n,i,r){var o,a,h="0";if(o=u[r]){for(t=String(o.call(u,s,l,e,n.length)),"_"==(e||o.style)&&(h=" "),a="-"==e?0:o.pad||0;t.length<a;)t=h+t;for(a="-"==e?0:i||o.pad;t.length<a;)t=h+t;"N"==r&&a<t.length&&(t=t.slice(0,a)),"^"==e&&(t=t.toUpperCase())}return t})):l}}return function(){return u.convert(arguments)}}function s(t,e){var n,i,r;return i=new Date(Date.UTC(t.getUTCFullYear(),0)),n=Math.floor((t.getTime()-i.getTime())/864e5),i.getUTCDay()==e?r=0:(r=7-i.getUTCDay()+e,8==r&&(r=1)),n>=r?Math.floor((n-r)/7)+1:0}function a(t){var e,n,i;return n=t.getUTCFullYear(),e=new Date(Date.UTC(n,0)).getUTCDay(),i=s(t,1)+(e>1&&e<=4?1:0),i?53!=i||4==e||3==e&&29==new Date(n,1,29).getDate()?[i,t.getUTCFullYear()]:[1,t.getUTCFullYear()+1]:(n=t.getUTCFullYear()-1,e=new Date(Date.UTC(n,0)).getUTCDay(),i=4==e||3==e&&29==new Date(n,1,29).getDate()?53:52,[i,t.getUTCFullYear()-1])}var l={clock:function(){return+new Date},zone:"UTC",entry:{abbrev:"UTC",offset:0,save:0},UTC:1,z:function(t,e,n,i){var r,o,s=this.entry.offset+this.entry.save,a=Math.abs(s/1e3),l=[],u=3600;for(r=0;r<3;r++)l.push(("0"+Math.floor(a/u)).slice(-2)),a%=u,u/=60;return"^"!=n||s?("^"==n&&(i=3),3==i?(o=l.join(":"),o=o.replace(/:00$/,""),"^"!=n&&(o=o.replace(/:00$/,""))):i?(o=l.slice(0,i+1).join(":"),"^"==n&&(o=o.replace(/:00$/,""))):o=l.slice(0,2).join(""),o=(s<0?"-":"+")+o,o=o.replace(/([-+])(0)/,{_:" $1","-":"$1"}[n]||"$1$2")):"Z"},"%":function(t){return"%"},n:function(t){return"\n"},t:function(t){return"\t"},U:function(t){return s(t,0)},W:function(t){return s(t,1)},V:function(t){return a(t)[0]},G:function(t){return a(t)[1]},g:function(t){return a(t)[1]%100},j:function(t){return Math.floor((t.getTime()-Date.UTC(t.getUTCFullYear(),0))/864e5)+1},s:function(t){return Math.floor(t.getTime()/1e3)},C:function(t){return Math.floor(t.getUTCFullYear()/100)},N:function(t){return t.getTime()%1e3*1e6},m:function(t){return t.getUTCMonth()+1},Y:function(t){return t.getUTCFullYear()},y:function(t){return t.getUTCFullYear()%100},H:function(t){return t.getUTCHours()},M:function(t){return t.getUTCMinutes()},S:function(t){return t.getUTCSeconds()},e:function(t){return t.getUTCDate()},d:function(t){return t.getUTCDate()},u:function(t){return t.getUTCDay()||7},w:function(t){return t.getUTCDay()},l:function(t){return t.getUTCHours()%12||12},I:function(t){return t.getUTCHours()%12||12},k:function(t){return t.getUTCHours()},Z:function(t){return this.entry.abbrev},a:function(t){return this[this.locale].day.abbrev[t.getUTCDay()]},A:function(t){return this[this.locale].day.full[t.getUTCDay()]},h:function(t){return this[this.locale].month.abbrev[t.getUTCMonth()]},b:function(t){return this[this.locale].month.abbrev[t.getUTCMonth()]},B:function(t){return this[this.locale].month.full[t.getUTCMonth()]},P:function(t){return this[this.locale].meridiem[Math.floor(t.getUTCHours()/12)].toLowerCase()},p:function(t){return this[this.locale].meridiem[Math.floor(t.getUTCHours()/12)]},R:function(t,e){return this.convert([e,"%H:%M"])},T:function(t,e){return this.convert([e,"%H:%M:%S"])},D:function(t,e){return this.convert([e,"%m/%d/%y"])},F:function(t,e){return this.convert([e,"%Y-%m-%d"])},x:function(t,e){return this.convert([e,this[this.locale].date])},r:function(t,e){return this.convert([e,this[this.locale].time12||"%I:%M:%S"])},X:function(t,e){return this.convert([e,this[this.locale].time24])},c:function(t,e){return this.convert([e,this[this.locale].dateTime])},convert:o,locale:"en_US",en_US:{date:"%m/%d/%Y",time24:"%I:%M:%S %p",time12:"%I:%M:%S %p",dateTime:"%a %d %b %Y %I:%M:%S %p %Z",meridiem:["AM","PM"],month:{abbrev:"Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec".split("|"),full:"January|February|March|April|May|June|July|August|September|October|November|December".split("|")},day:{abbrev:"Sun|Mon|Tue|Wed|Thu|Fri|Sat".split("|"),full:"Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday".split("|")}}},u="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|year|month|day|hour|minute|second|millisecond",h=new RegExp("^\\s*([+-])(\\d+)\\s+("+u+")s?\\s*$","i"),c=[36e5,6e4,1e3,1];return u=u.toLowerCase().split("|"),"delmHMSUWVgCIky".replace(/./g,function(t){l[t].pad=2}),l.N.pad=9,l.j.pad=3,l.k.style="_",l.l.style="_",l.e.style="_",function(){return l.convert(arguments)}})},function(e,n,i){/*! *****************************************************************************
  Copyright (c) Microsoft Corporation. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
  
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
  
  See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** */
  var r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b;!function(e){function i(t,e){return"function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0,function(n,i){return t[n]=e?e(n,i):i}}var r="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:{};"function"==typeof t&&t.amd?t("tslib",["exports"],function(t){e(i(r,i(t)))}):e("object"==typeof n&&"object"==typeof n.exports?i(r,i(n.exports)):i(r))}(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};r=function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)},o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},s=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&(n[i[r]]=t[i[r]]);return n},a=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},l=function(t,e){return function(n,i){e(n,i,t)}},u=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},h=function(t,e,n,i){return new(n||(n=Promise))(function(r,o){function s(t){try{l(i.next(t))}catch(e){o(e)}}function a(t){try{l(i["throw"](t))}catch(e){o(e)}}function l(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(s,a)}l((i=i.apply(t,e||[])).next())})},c=function(t,e){function n(t){return function(e){return i([t,e])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,o&&(s=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(s=s.call(o,n[1])).done)return s;switch(o=0,s&&(n=[0,s.value]),n[0]){case 0:case 1:s=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,o=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(s=l.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){l.label=n[1];break}if(6===n[0]&&l.label<s[1]){l.label=s[1],s=n;break}if(s&&l.label<s[2]){l.label=s[2],l.ops.push(n);break}s[2]&&l.ops.pop(),l.trys.pop();continue}n=e.call(t,l)}catch(i){n=[6,i],o=0}finally{r=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,s,a,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:n(0),"throw":n(1),"return":n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a},_=function(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])},p=function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}},d=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(a){r={error:a}}finally{try{i&&!i.done&&(n=o["return"])&&n.call(o)}finally{if(r)throw r.error}}return s},f=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t},m=function(t){return this instanceof m?(this.v=t,this):new m(t)},v=function(t,e,n){function i(t){h[t]&&(u[t]=function(e){return new Promise(function(n,i){c.push([t,e,n,i])>1||r(t,e)})})}function r(t,e){try{o(h[t](e))}catch(n){l(c[0][3],n)}}function o(t){t.value instanceof m?Promise.resolve(t.value.v).then(s,a):l(c[0][2],t)}function s(t){r("next",t)}function a(t){r("throw",t)}function l(t,e){t(e),c.shift(),c.length&&r(c[0][0],c[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u,h=n.apply(t,e||[]),c=[];return u={},i("next"),i("throw"),i("return"),u[Symbol.asyncIterator]=function(){return this},u},g=function(t){function e(e,r){t[e]&&(n[e]=function(n){return(i=!i)?{value:m(t[e](n)),done:"return"===e}:r?r(n):n})}var n,i;return n={},e("next"),e("throw",function(t){throw t}),e("return"),n[Symbol.iterator]=function(){return this},n},y=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof p?p(t):t[Symbol.iterator]()},b=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},t("__extends",r),t("__assign",o),t("__rest",s),t("__decorate",a),t("__param",l),t("__metadata",u),t("__awaiter",h),t("__generator",c),t("__exportStar",_),t("__values",p),t("__read",d),t("__spread",f),t("__await",m),t("__asyncGenerator",v),t("__asyncDelegator",g),t("__asyncValues",y),t("__makeTemplateObject",b)})}],{base:0,"client/connection":1,"client/session":2,"core/bokeh_events":3,"core/build_views":4,"core/dom":5,"core/dom_view":6,"core/enums":7,"core/has_props":8,"core/hittest":9,"core/layout/alignments":10,"core/layout/layout_canvas":11,"core/layout/side_panel":12,"core/layout/solver":13,"core/logging":14,"core/properties":15,"core/property_mixins":16,"core/selection_manager":17,"core/selector":18,"core/settings":19,"core/signaling":20,"core/ui_events":21,"core/util/array":22,"core/util/bbox":23,"core/util/callback":24,"core/util/canvas":25,"core/util/color":26,"core/util/data_structures":27,"core/util/eq":28,"core/util/math":29,"core/util/object":30,"core/util/proj4":31,"core/util/projections":32,"core/util/refs":33,"core/util/selection":34,"core/util/serialization":35,"core/util/spatial":36,"core/util/string":37,"core/util/svg_colors":38,"core/util/templating":39,"core/util/text":40,"core/util/throttle":41,"core/util/types":42,"core/util/wheel":43,"core/util/zoom":44,"core/view":45,"core/visuals":46,document:47,embed:48,main:49,model:50,"models/annotations/annotation":51,"models/annotations/arrow":52,"models/annotations/arrow_head":53,"models/annotations/band":54,"models/annotations/box_annotation":55,"models/annotations/color_bar":56,"models/annotations/index":57,"models/annotations/label":58,"models/annotations/label_set":59,"models/annotations/legend":60,"models/annotations/legend_item":61,"models/annotations/poly_annotation":62,"models/annotations/span":63,"models/annotations/text_annotation":64,"models/annotations/title":65,"models/annotations/toolbar_panel":66,"models/annotations/tooltip":67,"models/annotations/whisker":68,"models/axes/axis":69,"models/axes/categorical_axis":70,"models/axes/continuous_axis":71,"models/axes/datetime_axis":72,"models/axes/index":73,"models/axes/linear_axis":74,"models/axes/log_axis":75,"models/callbacks/customjs":76,"models/callbacks/index":77,"models/callbacks/open_url":78,"models/canvas/canvas":79,"models/canvas/cartesian_frame":80,"models/canvas/index":81,"models/expressions/expression":82,"models/expressions/index":83,"models/expressions/stack":84,"models/filters/boolean_filter":85,"models/filters/customjs_filter":86,"models/filters/filter":87,"models/filters/group_filter":88,"models/filters/index":89,"models/filters/index_filter":90,"models/formatters/basic_tick_formatter":91,"models/formatters/categorical_tick_formatter":92,"models/formatters/datetime_tick_formatter":93,"models/formatters/func_tick_formatter":94,"models/formatters/index":95,"models/formatters/log_tick_formatter":96,"models/formatters/mercator_tick_formatter":97,"models/formatters/numeral_tick_formatter":98,"models/formatters/printf_tick_formatter":99,"models/formatters/tick_formatter":100,"models/glyphs/annular_wedge":101,"models/glyphs/annulus":102,"models/glyphs/arc":103,"models/glyphs/bezier":104,"models/glyphs/box":105,"models/glyphs/circle":106,"models/glyphs/ellipse":107,"models/glyphs/glyph":108,"models/glyphs/hbar":109,"models/glyphs/image":110,"models/glyphs/image_rgba":111,"models/glyphs/image_url":112,"models/glyphs/index":113,"models/glyphs/line":114,"models/glyphs/multi_line":115,"models/glyphs/oval":116,"models/glyphs/patch":117,"models/glyphs/patches":118,"models/glyphs/quad":119,"models/glyphs/quadratic":120,"models/glyphs/ray":121,"models/glyphs/rect":122,"models/glyphs/segment":123,"models/glyphs/step":124,"models/glyphs/text":125,"models/glyphs/vbar":126,"models/glyphs/wedge":127,"models/glyphs/xy_glyph":128,"models/graphs/graph_hit_test_policy":129,"models/graphs/index":130,"models/graphs/layout_provider":131,"models/graphs/static_layout_provider":132,"models/grids/grid":133,"models/grids/index":134,"models/index":135,"models/layouts/box":136,"models/layouts/column":137,"models/layouts/index":138,"models/layouts/layout_dom":139,"models/layouts/row":140,"models/layouts/spacer":141,"models/layouts/widget_box":142,"models/mappers/categorical_color_mapper":143,"models/mappers/color_mapper":144,"models/mappers/index":145,"models/mappers/linear_color_mapper":146,"models/mappers/log_color_mapper":147,"models/markers/index":148,"models/markers/marker":149,"models/plots/gmap_plot":150,"models/plots/gmap_plot_canvas":151,"models/plots/index":152,"models/plots/plot":153,"models/plots/plot_canvas":154,"models/ranges/data_range":155,"models/ranges/data_range1d":156,"models/ranges/factor_range":157,"models/ranges/index":158,"models/ranges/range":159,"models/ranges/range1d":160,"models/renderers/glyph_renderer":161,"models/renderers/graph_renderer":162,"models/renderers/guide_renderer":163,"models/renderers/index":164,"models/renderers/renderer":165,"models/scales/categorical_scale":166,"models/scales/index":167,"models/scales/linear_scale":168,"models/scales/log_scale":169,"models/scales/scale":170,"models/sources/ajax_data_source":171,"models/sources/cds_view":172,"models/sources/column_data_source":173,"models/sources/columnar_data_source":174,"models/sources/data_source":175,"models/sources/geojson_data_source":176,"models/sources/index":177,"models/sources/remote_data_source":178,"models/tickers/adaptive_ticker":179,"models/tickers/basic_ticker":180,"models/tickers/categorical_ticker":181,"models/tickers/composite_ticker":182,"models/tickers/continuous_ticker":183,"models/tickers/datetime_ticker":184,"models/tickers/days_ticker":185,"models/tickers/fixed_ticker":186,"models/tickers/index":187,"models/tickers/log_ticker":188,"models/tickers/mercator_ticker":189,"models/tickers/months_ticker":190,"models/tickers/single_interval_ticker":191,"models/tickers/ticker":192,"models/tickers/util":193,"models/tickers/years_ticker":194,"models/tiles/bbox_tile_source":195,"models/tiles/dynamic_image_renderer":196,"models/tiles/image_pool":197,"models/tiles/image_source":198,"models/tiles/index":199,"models/tiles/mercator_tile_source":200,"models/tiles/quadkey_tile_source":201,"models/tiles/tile_renderer":202,"models/tiles/tile_source":203,"models/tiles/tile_utils":204,"models/tiles/tms_tile_source":205,"models/tiles/wmts_tile_source":206,"models/tools/actions/action_tool":207,"models/tools/actions/help_tool":208,"models/tools/actions/redo_tool":209,"models/tools/actions/reset_tool":210,"models/tools/actions/save_tool":211,"models/tools/actions/undo_tool":212,"models/tools/actions/zoom_in_tool":213,"models/tools/actions/zoom_out_tool":214,"models/tools/button_tool":215,"models/tools/gestures/box_select_tool":216,"models/tools/gestures/box_zoom_tool":217,"models/tools/gestures/gesture_tool":218,"models/tools/gestures/lasso_select_tool":219,"models/tools/gestures/pan_tool":220,"models/tools/gestures/poly_select_tool":221,"models/tools/gestures/select_tool":222,"models/tools/gestures/tap_tool":223,"models/tools/gestures/wheel_pan_tool":224,"models/tools/gestures/wheel_zoom_tool":225,"models/tools/index":226,"models/tools/inspectors/crosshair_tool":227,"models/tools/inspectors/hover_tool":228,"models/tools/inspectors/inspect_tool":229,"models/tools/on_off_button":230,"models/tools/tool":231,"models/tools/tool_proxy":232,"models/tools/toolbar":233,"models/tools/toolbar_base":234,"models/tools/toolbar_box":235,"models/transforms/customjs_transform":236,"models/transforms/dodge":237,"models/transforms/index":238,"models/transforms/interpolator":239,"models/transforms/jitter":240,"models/transforms/linear_interpolator":241,"models/transforms/step_interpolator":242,"models/transforms/transform":243,polyfill:244,"protocol/message":245,"protocol/receiver":246,safely:247,version:248},49)});/*!
  Copyright (c) 2012, Anaconda, Inc.
  All rights reserved.
  
  Redistribution and use in source and binary forms, with or without modification,
  are permitted provided that the following conditions are met:
  
  Redistributions of source code must retain the above copyright notice,
  this list of conditions and the following disclaimer.
  
  Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.
  
  Neither the name of Anaconda nor the names of any contributors
  may be used to endorse or promote products derived from this software
  without specific prior written permission.
  
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  THE POSSIBILITY OF SUCH DAMAGE.
  */
  
  //# sourceMappingURL=bokeh.min.js.map
  