You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

186 lines
680 KiB

!function(t,e){t.Bokeh=e()}(this,function(){var t;return function(t,e,r){var n={},i=function(r){var o=null!=e[r]?e[r]:r;if(!n[o]){if(!t[o]){var s=new Error("Cannot find module '"+r+"'");throw s.code="MODULE_NOT_FOUND",s}var a=n[o]={exports:{}};t[o].call(a.exports,i,a,a.exports)}return n[o].exports},o=i(r);return o.require=i,o.register_plugin=function(r,n,s){for(var a in r)t[a]=r[a];for(var a in n)e[a]=n[a];var l=i(s);for(var a in l)o[a]=l[a];return l},o}([function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(130),i=t(28);r.overrides={};var o=i.clone(n);r.Models=function(t){var e=r.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},r.Models.register=function(t,e){r.overrides[t]=e},r.Models.unregister=function(t){delete r.overrides[t]},r.Models.register_models=function(t,e,r){if(void 0===e&&(e=!1),null!=t)for(var n in t){var i=t[n];e||!o.hasOwnProperty(n)?o[n]=i:null!=r?r(n):console.warn("Model '"+n+"' was already registered")}},r.register_models=r.Models.register_models,r.Models.registered_names=function(){return Object.keys(o)},r.index={}},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s,a=t(295),l=t(12),u=t(35),c=t(28),_=t(45);r.DEFAULT_SERVER_WEBSOCKET_URL="ws://localhost:5006/ws",r.DEFAULT_SESSION_ID="default",o=function(){function t(t,e,r){this.header=t,this.metadata=e,this.content=r,this.buffers=[]}return t.assemble=function(e,r,n){var i,o,s;return o=JSON.parse(e),s=JSON.parse(r),i=JSON.parse(n),new t(o,s,i)},t.create_header=function(t,e){var r;return r={msgid:u.uniqueId(),msgtype:t},c.extend(r,e)},t.create=function(e,r,n){var i;return null==n&&(n={}),i=t.create_header(e,r),new t(i,{},n)},t.prototype.send=function(t){var e,r,n;return r=JSON.stringify(this.header),n=JSON.stringify(this.metadata),e=JSON.stringify(this.content),t.send(r),t.send(n),t.send(e)},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.add_buffer=function(t){return this.buffers.push(t)},t.prototype._header_field=function(t){return t in this.header?this.header[t]:null},t.prototype.msgid=function(){return this._header_field("msgid")},t.prototype.msgtype=function(){return this._header_field("msgtype")},t.prototype.sessid=function(){return this._header_field("sessid")},t.prototype.reqid=function(){return this._header_field("reqid")},t.prototype.problem=function(){return"msgid"in this.header?"msgtype"in this.header?null:"No msgtype in header":"No msgid in header"},t}(),s={"PATCH-DOC":function(t,e){return t._for_session(function(t){return t._handle_patch(e)})},OK:function(t,e){return l.logger.trace("Unhandled OK reply to "+e.reqid())},ERROR:function(t,e){return l.logger.error("Unhandled ERROR reply to "+e.reqid()+": "+e.content.text)}},n=function(){function t(e,n,i,o,s){this.url=e,this.id=n,this.args_string=i,this._on_have_session_hook=o,this._on_closed_permanently_hook=s,this._number=t._connection_count,t._connection_count=this._number+1,null==this.url&&(this.url=r.DEFAULT_SERVER_WEBSOCKET_URL),null==this.id&&(this.id=r.DEFAULT_SESSION_ID),l.logger.debug("Creating websocket "+this._number+" to '"+this.url+"' session '"+this.id+"'"),this.socket=null,this.closed_permanently=!1,this._fragments=[],this._partial=null,this._current_handler=null,this._pending_ack=null,this._pending_replies={},this.session=null}return t._connection_count=0,t.prototype._for_session=function(t){if(null!==this.session)return t(this.session)},t.prototype.connect=function(){var t,e,r;if(this.closed_permanently)return a.Promise.reject(new Error("Cannot connect() a closed ClientConnection"));if(null!=this.socket)return a.Promise.reject(new Error("Already connected"));this._fragments=[],this._partial=null,this._pending_replies={},this._current_handler=null;try{return r=this.url+"?bokeh-protocol-version=1.0&bokeh-session-id="+this.id,(null!=(e=this.args_string)?e.length:void 0)>0&&(r+="&"+this.args_string),null!=window.MozWebSocket?this.socket=new MozWebSocket(r):this.socket=new WebSocket(r),new a.Promise(function(t){return function(e,r){return t.socket.binaryType="arraybuffer",t.socket.onopen=function(){return t._on_open(e,r)},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(r)}}}(this))}catch(n){return t=n,l.logger.error("websocket creation failed to url: "+this.url),l.logger.error(" - "+t),a.Promise.reject(t)}},t.prototype.close=function(){if(!this.closed_permanently&&(l.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._for_session(function(t){return t._connection_closed()}),null!=this._on_closed_permanently_hook))return this._on_closed_permanently_hook(),this._on_closed_permanently_hook=null},t.prototype._schedule_reconnect=function(t){var e;return e=function(t){return function(){t.closed_permanently||l.logger.info("Websocket connection "+t._number+" disconnected, will not attempt to reconnect")}}(this),setTimeout(e,t)},t.prototype.send=function(t){if(null===this.socket)throw new Error("not connected so cannot send "+t);return t.send(this.socket)},t.prototype.send_event=function(t){var e;return e=o.create("EVENT",{},JSON.stringify(t)),this.send(e)},t.prototype.send_with_reply=function(t){var e;return e=new a.Promise(function(e){return function(r,n){return e._pending_replies[t.msgid()]=[r,n],e.send(t)}}(this)),e.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,e;return t=o.create("PULL-DOC-REQ",{}),e=this.send_with_reply(t),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(){return null===this.session?l.logger.debug("Pulling session for first time"):l.logger.debug("Repulling session"),this._pull_doc_json().then(function(t){return function(e){var r,n,s;return null!==t.session?(t.session.document.replace_with_json(e),l.logger.debug("Updated existing session with new pulled doc")):t.closed_permanently?l.logger.debug("Got new document after connection was already closed"):(r=_.Document.from_json(e),n=_.Document._compute_patch_since_json(e,r),n.events.length>0&&(l.logger.debug("Sending "+n.events.length+" changes from model construction back to server"),s=o.create("PATCH-DOC",{},n),t.send(s)),t.session=new i(t,r,t.id),l.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):void 0)}}(this),function(t){throw t})["catch"](function(t){return null!=console.trace&&console.trace(t),l.logger.error("Failed to repull session "+t)})},t.prototype._on_open=function(t,e){return l.logger.info("Websocket connection "+this._number+" is now open"),this._pending_ack=[t,e],this._current_handler=function(t){return function(e){return t._awaiting_ack_handler(e)}}(this)},t.prototype._on_message=function(t){return this._on_message_unchecked(t)},t.prototype._on_message_unchecked=function(t){var e,r;if(null==this._current_handler&&l.logger.error("got a message but haven't set _current_handler"),t.data instanceof ArrayBuffer?null==this._partial||this._partial.complete()?this._close_bad_protocol("Got binary from websocket but we were expecting text"):this._partial.add_buffer(t.data):null!=this._partial?this._close_bad_protocol("Got text from websocket but we were expecting binary"):(this._fragments.push(t.data),3===this._fragments.length&&(this._partial=o.assemble(this._fragments[0],this._fragments[1],this._fragments[2]),this._fragments=[],r=this._partial.problem(),null!==r&&this._close_bad_protocol(r))),null!=this._partial&&this._partial.complete())return e=this._partial,this._partial=null,this._current_handler(e)},t.prototype._on_close=function(t){var e,r;for(l.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),e=function(t){return function(){var e,r,n;r=t._pending_replies;for(n in r)return e=r[n],delete t._pending_replies[n],e;return null}}(this),r=e();null!==r;)r[1]("Disconnected"),r=e();if(!this.closed_permanently)return this._schedule_reconnect(2e3)},t.prototype._on_error=function(t){return l.logger.debug("Websocket error on socket "+this._number),t(new Error("Could not open websocket"))},t.prototype._close_bad_protocol=function(t){if(l.logger.error("Closing connection: "+t),null!=this.socket)return this.socket.close(1002,t)},t.prototype._awaiting_ack_handler=function(t){return"ACK"!==t.msgtype()?this._close_bad_protocol("First message was not an ACK"):(this._current_handler=function(t){return function(e){return t._steady_state_handler(e)}}(this),this._repull_session_doc(),null!=this._pending_ack?(this._pending_ack[0](this),this._pending_ack=null):void 0)},t.prototype._steady_state_handler=function(t){var e;return t.reqid()in this._pending_replies?(e=this._pending_replies[t.reqid()],delete this._pending_replies[t.reqid()],e[0](t)):t.msgtype()in s?s[t.msgtype()](this,t):l.logger.debug("Doing nothing with message "+t.msgtype())},t}(),i=function(){function t(t,e,r){this._connection=t,this.document=e,this.id=r,this.document_listener=function(t){return function(e){return t._document_changed(e)}}(this),this.document.on_change(this.document_listener),this.event_manager=this.document.event_manager,this.event_manager.session=this}return t.prototype.close=function(){return this._connection.close()},t.prototype.send_event=function(t){return this._connection.send_event(t)},t.prototype._connection_closed=function(){return this.document.remove_on_change(this.document_listener)},t.prototype.request_server_info=function(){var t,e;return t=o.create("SERVER-INFO-REQ",{}),e=this._connection.send_with_reply(t),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){var e;if(t.setter_id!==this.id&&(!(t instanceof _.ModelChangedEvent)||t.attr in t.model.serializable_attributes()))return e=o.create("PATCH-DOC",{},this.document.create_json_patch([t])),this._connection.send(e)},t.prototype._handle_patch=function(t){return this.document.apply_json_patch(t.content,this.id)},t}(),r.pull_session=function(t,e,r){var i,o,s;return s=null,i=null,o=new a.Promise(function(o,s){return i=new n(t,e,r,function(t){var e;try{return o(t)}catch(r){throw e=r,l.logger.error("Promise handler threw an error, closing session "+error),t.close(),e}},function(){return s(new Error("Connection was closed before we successfully pulled a session"))}),i.connect().then(function(t){},function(t){throw l.logger.error("Failed to connect to Bokeh server "+t),t})}),o.close=function(){return i.close()},o}},function(t,e,r){"use strict";function n(t){return function(e){e.prototype.event_name=t,l[t]=e}}function i(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=t.prototype.applicable_models.concat(e);t.prototype.applicable_models=n}Object.defineProperty(r,"__esModule",{value:!0});var o=t(357),s=t(12),a=t(28),l={};r.register_event_class=n,r.register_with_event=i;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}();r.BokehEvent=u,u.prototype.applicable_models=[];var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("button_click")],e)}(u);r.ButtonClick=c;var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(u);r.UIEvent=_;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("lodstart")],e)}(_);r.LODStart=h;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("lodend")],e)}(_);r.LODEnd=p;var d=function(t){function e(e){var r=t.call(this,e)||this;return r.geometry=e.geometry,r["final"]=e["final"],r}return o.__extends(e,t),e=o.__decorate([n("selectiongeometry")],e)}(_);r.SelectionGeometry=d;var f=function(t){function e(e){var r=t.call(this,e)||this;return r.sx=e.sx,r.sy=e.sy,r.x=null,r.y=null,r}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"],r=t.plot_canvas.frame.yscales["default"];return this.x=e.invert(t.plot_canvas.canvas.sx_to_vx(this.sx)),this.y=r.invert(t.plot_canvas.canvas.sy_to_vy(this.sy)),this._options.x=this.x,this._options.y=this.y,this},e}(_);r.PointEvent=f;var y=function(t){function e(e){void 0===e&&(e={});var r=t.call(this,e)||this;return r.delta_x=e.delta_x,r.delta_y=e.delta_y,r}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([n("pan")],e)}(f);r.Pan=y;var m=function(t){function e(e){void 0===e&&(e={});var r=t.call(this,e)||this;return r.scale=e.scale,r}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([n("pinch")],e)}(f);r.Pinch=m;var v=function(t){function e(e){void 0===e&&(e={});var r=t.call(this,e)||this;return r.delta=e.delta,r}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([n("wheel")],e)}(f);r.MouseWheel=v;var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("mousemove")],e)}(f);r.MouseMove=g;var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("mouseenter")],e)}(f);r.MouseEnter=b;var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("mouseleave")],e)}(f);r.MouseLeave=w;var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("tap")],e)}(f);r.Tap=x;var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("doubletap")],e)}(f);r.DoubleTap=k;var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("press")],e)}(f);r.Press=M;var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("panstart")],e)}(f);r.PanStart=S;var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("panend")],e)}(f);r.PanEnd=T;var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("pinchstart")],e)}(f);r.PinchStart=O;var P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e=o.__decorate([n("pinchend")],e)}(f);r.PinchEnd=P},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(20),i=t(28);r.build_views=function(t,e,r,o){var s,a,l,u,c,_,h,p,d,f,y,m,v,g;for(null==o&&(o=[]),y=n.difference(Object.keys(t),function(){var t,r,n;for(n=[],t=0,r=e.length;t<r;t++)h=e[t],n.push(h.id);return n}()),l=0,c=y.length;l<c;l++)p=y[l],t[p].remove(),delete t[p];for(s=[],d=e.filter(function(e){return null==t[e.id]}),a=u=0,_=d.length;u<_;a=++u)h=d[a],v=null!=(f=o[a])?f:h.default_view,g=i.extend({model:h},r),t[h.id]=m=new v(g),s.push(m);return s},r.remove_views=function(t){var e,r,n,o,s;for(o=i.keys(t),s=[],r=0,n=o.length;r<n;r++)e=o[r],t[e].remove(),s.push(delete t[e]);return s}},function(t,e,r){"use strict";function n(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return f(t).apply(void 0,[e].concat(r))}function i(t){var e=t.parentNode;null!=e&&e.removeChild(t)}function o(t,e){var r=t.parentNode;null!=r&&r.replaceChild(e,t)}function s(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=t.firstChild,i=0,o=e;i<o.length;i++){var s=o[i];t.insertBefore(s,n)}}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 c(t){return{top:t.offsetTop,left:t.offsetLeft}}function _(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}}function h(t,e){var r=Element.prototype,n=r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector;return n.call(t,e)}function p(t,e){for(var r=t;r=r.parentElement;)if(h(r,e))return r;return null}Object.defineProperty(r,"__esModule",{value:!0});var d=t(40),f=function(t){return function(e){function r(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 n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];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 c=u[l];null!=c&&o.classList.add(c)}else if("style"===s&&d.isObject(a))for(var _ in a)o.style[_]=a[_];else if("data"===s&&d.isObject(a))for(var h in a)o.dataset[h]=a[h];else o.setAttribute(s,a)}for(var p=0,f=n;p<f.length;p++){var y=f[p];if(d.isArray(y))for(var m=0,v=y;m<v.length;m++){var g=v[m];r(g)}else r(y)}return o}};r.createElement=n,r.div=f("div"),r.span=f("span"),r.link=f("link"),r.style=f("style"),r.a=f("a"),r.p=f("p"),r.pre=f("pre"),r.button=f("button"),r.label=f("label"),r.input=f("input"),r.select=f("select"),r.option=f("option"),r.canvas=f("canvas"),r.ul=f("ul"),r.ol=f("ol"),r.li=f("li"),r.nbsp=document.createTextNode(" "),r.removeElement=i,r.replaceWith=o,r.prepend=s,r.empty=a,r.show=l,r.hide=u,r.position=c,r.offset=_,r.matches=h,r.parent=p;var y;!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"}(y=r.Keys||(r.Keys={}))},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(43),s=t(4);r.DOMView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.tagName="div",e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this._has_finished=!1,this.el=this._createElement()},e.prototype.remove=function(){return s.removeElement(this.el),e.__super__.remove.call(this)},e.prototype.layout=function(){},e.prototype.render=function(){},e.prototype.renderTo=function(t,e){return null==e&&(e=!1),e?s.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.getters({_root_element:function(){return s.parent(this.el,".bk-root")},solver:function(){return this.is_root?this._solver:this.parent.solver},is_idle:function(){return this.has_finished()}}),e.prototype._createElement=function(){return s.createElement(this.tagName,{id:this.id,"class":this.className})},e}(o.View)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AngleUnits=["deg","rad"],r.Dimension=["width","height"],r.Dimensions=["width","height","both"],r.Direction=["clock","anticlock"],r.FontStyle=["normal","italic","bold"],r.LatLon=["lat","lon"],r.LineCap=["butt","round","square"],r.LineJoin=["miter","round","bevel"],r.Location=["above","below","left","right"],r.LegendLocation=["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"],r.Orientation=["vertical","horizontal"],r.OutputBackend=["canvas","svg","webgl"],r.RenderLevel=["image","underlay","glyph","annotation","overlay"],r.RenderMode=["canvas","css"],r.Side=["left","right"],r.SpatialUnits=["screen","data"],r.StartEnd=["start","end"],r.TextAlign=["left","right","center"],r.TextBaseline=["top","middle","bottom","alphabetic","hanging","ideographic"],r.DistributionTypes=["uniform","normal"],r.TransformStepModes=["after","before","center"],r.SizingMode=["stretch_both","scale_width","scale_height","scale_both","fixed"],r.PaddingUnits=["percent","absolute"]},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=[].slice,s=t(12),a=t(18),l=t(14),u=t(31),c=t(13),_=t(35),h=t(20),p=t(28),d=t(40),f=t(26);r.HasProps=function(){function t(t,e){var r,n,i,o,s;null==t&&(t={}),null==e&&(e={}),this.document=null,this.destroyed=new a.Signal(this,"destroyed"),this.change=new a.Signal(this,"change"),this.transformchange=new a.Signal(this,"transformchange"),this.attributes={},this.properties={},i=this.props;for(n in i){if(o=i[n],s=o.type,r=o.default_value,null==s)throw new Error("undefined property type for "+this.type+"."+n);this.properties[n]=new s({obj:this,attr:n,default_value:r})}this._set_after_defaults={},null==t.id&&this.setv("id",_.uniqueId(),{silent:!0}),this.setv(t,p.extend({silent:!0},e)),e.defer_initialization||this.finalize(t,e)}return n(t.prototype,a.Signalable),t.getters=function(t){var e,r,n;n=[];for(r in t)e=t[r],n.push(Object.defineProperty(this.prototype,r,{get:e}));return n},t.prototype.props={},t.prototype.mixins=[],t.define=function(t){var e,r,n;n=[];for(e in t)r=t[e],n.push(function(t){return function(e,r){var n,i,o,s,a;if(null!=t.prototype.props[e])throw new Error("attempted to redefine property '"+t.name+"."+e+"'");if(null!=t.prototype[e])throw new Error("attempted to redefine attribute '"+t.name+"."+e+"'");return Object.defineProperty(t.prototype,e,{get:function(){var t;return t=this.getv(e)},set:function(t){return this.setv(e,t),this}},{configurable:!1,enumerable:!0}),a=r[0],n=r[1],i=r[2],s={type:a,default_value:n,internal:null!=i&&i},o=p.clone(t.prototype.props),o[e]=s,t.prototype.props=o}}(this)(e,r));return n},t.internal=function(t){var e,r,n,i;e={},r=function(t){return function(t,r){var n,i;return i=r[0],n=r[1],e[t]=[i,n,!0]}}(this);for(n in t)i=t[n],r(n,i);return this.define(e)},t.mixin=function(){var t,e;return e=1<=arguments.length?o.call(arguments,0):[],this.define(l.create(e)),t=this.prototype.mixins.concat(e),this.prototype.mixins=t},t.mixins=function(t){return this.mixin.apply(this,t)},t.override=function(t,e){var r,n,i;d.isString(t)?(n={},n[r]=e):n=t,i=[];for(r in n)e=n[r],i.push(function(t){return function(e,r){var n,i;if(i=t.prototype.props[e],null==i)throw new Error("attempted to override nonexistent '"+t.name+"."+e+"'");return n=p.clone(t.prototype.props),n[e]=p.extend({},i,{default_value:r}),t.prototype.props=n}}(this)(r,e));return i},t.define({id:[c.Any]}),t.prototype.toString=function(){return this.type+"("+this.id+")"},t.prototype.finalize=function(t,e){var r,n,i;i=this.properties;for(r in i)n=i[r],n.update(),n.spec.transform&&this.connect(n.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 a.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 r,n,i,o,s,a,l,u,c;u=e.silent,n=[],i=this._changing,this._changing=!0,o=this.attributes;for(r in t)c=t[r],c=t[r],f.isEqual(o[r],c)||n.push(r),o[r]=c;if(!u)for(n.length&&(this._pending=!0),s=a=0,l=n.length;0<=l?a<l:a>l;s=0<=l?++a:--a)this.properties[n[s]].change.emit(o[n[s]]);if(i)return this;if(!u&&!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,r){var n,o,s,a,l;d.isObject(t)||null===t?(n=t,r=e):(n={},n[t]=e),null==r&&(r={});for(t in n)if(i.call(n,t)){if(l=n[t],s=t,null==this.props[s])throw new Error("property "+this.type+"."+s+" wasn't declared");null!=r&&r.defaults||(this._set_after_defaults[t]=!0)}if(!p.isEmpty(n)){o={};for(t in n)e=n[t],o[t]=this.getv(t);if(this._setv(n,r),null==(null!=r?r.silent:void 0)){a=[];for(t in n)e=n[t],a.push(this._tell_document_about_change(t,o[t],this.getv(t),r));return a}}},t.prototype.set=function(t,e,r){return s.logger.warn("HasProps.set('prop_name', value) is deprecated, use HasProps.prop_name = value instead"),this.setv(t,e,r)},t.prototype.get=function(t){return s.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 u.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,r,n;t={},r=this.attributes;for(e in r)n=r[e],this.attribute_is_serializable(e)&&(t[e]=n);return t},t._value_to_json=function(e,r,n){var o,s,a,l,u,c,_;if(r instanceof t)return r.ref();if(d.isArray(r)){for(l=[],o=s=0,a=r.length;s<a;o=++s)_=r[o],l.push(t._value_to_json(o,_,r));return l}if(d.isObject(r)){u={};for(c in r)i.call(r,c)&&(u[c]=t._value_to_json(c,r[c],r));return u}return r},t.prototype.attributes_as_json=function(e,r){var n,o,s,a;null==e&&(e=!0),null==r&&(r=t._value_to_json),n={},s=this.serializable_attributes();for(o in s)i.call(s,o)&&(a=s[o],e?n[o]=a:o in this._set_after_defaults&&(n[o]=a));return r("attributes",n,this)},t._json_record_references=function(e,r,n,o){var s,a,l,c,_,h,p;if(null==r);else if(u.is_ref(r)){if(!(r.id in n))return _=e.get_model_by_id(r.id),t._value_record_references(_,n,o)}else{if(d.isArray(r)){for(h=[],a=0,c=r.length;a<c;a++)s=r[a],h.push(t._json_record_references(e,s,n,o));return h}if(d.isObject(r)){p=[];for(l in r)i.call(r,l)&&(s=r[l],p.push(t._json_record_references(e,s,n,o)));return p}}},t._value_record_references=function(e,r,n){var o,s,a,l,u,c,_,h,p,f,y;if(null==e);else if(e instanceof t){if(!(e.id in r)&&(r[e.id]=e,n)){for(s=e._immediate_references(),p=[],a=0,c=s.length;a<c;a++)h=s[a],p.push(t._value_record_references(h,r,!0));return p}}else if(e.buffer instanceof ArrayBuffer);else{if(d.isArray(e)){for(f=[],u=0,_=e.length;u<_;u++)o=e[u],f.push(t._value_record_references(o,r,n));return f}if(d.isObject(e)){y=[];for(l in e)i.call(e,l)&&(o=e[l],y.push(t._value_record_references(o,r,n)));return y}}},t.prototype._immediate_references=function(){var e,r,n,i;n={},e=this.serializable_attributes();for(r in e)i=e[r],t._value_record_references(i,n,!1);return p.values(n)},t.prototype.references=function(){var e;return e={},t._value_record_references(this,e,!0),p.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,r,n,i){var o,s,a,l,u,c,_;if(this.attribute_is_serializable(e)&&null!==this.document){l={},t._value_record_references(n,l,!1),_={},t._value_record_references(r,_,!1),o=!1;for(s in l)if(a=l[s],!(s in _)){o=!0;break}if(!o)for(u in _)if(c=_[u],!(u in l)){o=!0;break}return o&&this.document._invalidate_all_models(),this.document._notify_change(this,e,r,n,i)}},t.prototype.materialize_dataspecs=function(t){var e,r,n,i;e={},i=this.properties;for(r in i)n=i[r],n.dataspec&&(!n.optional||null!==n.spec.value||r in this._set_after_defaults)&&(e["_"+r]=n.array(t),null!=n.spec.field&&n.spec.field in t._shapes&&(e["_"+r+"_shape"]=t._shapes[n.spec.field]),n instanceof c.Distance&&(e["max_"+r]=h.max(e["_"+r])));return e},t}()},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s=t(20),a=t(28);r.point_in_poly=function(t,e,r,n){var i,o,s,a,l,u,c,_;for(o=!1,l=r[r.length-1],c=n[n.length-1],i=s=0,a=r.length;0<=a?s<a:s>a;i=0<=a?++s:--s)u=r[i],_=n[i],c<e!=_<e&&l+(e-c)/(_-c)*(u-l)<t&&(o=!o),l=u,c=_;return o},i=function(){return null},r.HitTestResult=function(){function t(){this["0d"]={glyph:null,get_view:i,indices:[]},this["1d"]={indices:[]},this["2d"]={indices:{}}}return Object.defineProperty(t.prototype,"_0d",{get:function(){return this["0d"]}}),Object.defineProperty(t.prototype,"_1d",{get:function(){return this["1d"]}}),Object.defineProperty(t.prototype,"_2d",{get:function(){return this["2d"]}}),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=s.union(t["0d"].indices,this["0d"].indices),this["0d"].glyph=t["0d"].glyph||this["0d"].glyph,this["1d"].indices=s.union(t["1d"].indices,this["1d"].indices),this["2d"].indices=a.merge(t["2d"].indices,this["2d"].indices)},t}(),r.create_hit_test_result=function(){return new r.HitTestResult},r.create_1d_hit_test_result=function(t){var e,n,i;return i=new r.HitTestResult,i["1d"].indices=function(){var r,i,o,a,l;for(o=s.sortBy(t,function(t){var e,r;return e=t[0],r=t[1]}),l=[],r=0,i=o.length;r<i;r++)a=o[r],n=a[0],e=a[1],l.push(n);return l}(),i},r.validate_bbox_coords=function(t,e){var r,n,i,o,s,a;return i=t[0],o=t[1],s=e[0],a=e[1],i>o&&(r=[o,i],i=r[0],o=r[1]),s>a&&(n=[a,s],s=n[0],a=n[1]),{minX:i,minY:s,maxX:o,maxY:a}},o=function(t){return t*t},r.dist_2_pts=function(t,e,r,n){return o(t-r)+o(e-n)},n=function(t,e,n){var i,o;return i=r.dist_2_pts(e.x,e.y,n.x,n.y),0===i?r.dist_2_pts(t.x,t.y,e.x,e.y):(o=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/i,o<0?r.dist_2_pts(t.x,t.y,e.x,e.y):o>1?r.dist_2_pts(t.x,t.y,n.x,n.y):r.dist_2_pts(t.x,t.y,e.x+o*(n.x-e.x),e.y+o*(n.y-e.y)))},r.dist_to_segment=function(t,e,r){return Math.sqrt(n(t,e,r))},r.check_2_segments_intersect=function(t,e,r,n,i,o,s,a){var l,u,c,_,h,p,d;return c=(a-o)*(r-t)-(s-i)*(n-e),0===c?{hit:!1,x:null,y:null}:(l=e-o,u=t-i,_=(s-i)*l-(a-o)*u,h=(r-t)*l-(n-e)*u,l=_/c,u=h/c,p=t+l*(r-t),d=e+l*(n-e),{hit:l>0&&l<1&&u>0&&u<1,x:p,y:d})}},function(t,e,r){"use strict";
Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(11),s=t(48);r.LayoutCanvas=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="LayoutCanvas",e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._top=new o.Variable(this.toString()+".top"),this._left=new o.Variable(this.toString()+".left"),this._width=new o.Variable(this.toString()+".width"),this._height=new o.Variable(this.toString()+".height"),this._right=new o.Variable(this.toString()+".right"),this._bottom=new o.Variable(this.toString()+".bottom")},e.prototype.get_editables=function(){return[this._width,this._height]},e.prototype.get_constraints=function(){return[o.GE(this._top),o.GE(this._bottom),o.GE(this._left),o.GE(this._right),o.GE(this._width),o.GE(this._height),o.EQ(this._left,this._width,[-1,this._right]),o.EQ(this._bottom,this._height,[-1,this._top])]},e.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}}}),e.prototype.dump_layout=function(){return console.log(this.toString(),this.layout_bbox)},e}(s.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s,a,l,u,c,_,h,p,d,f,y,m=function(t,e){function r(){this.constructor=t}for(var n in e)v.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},v={}.hasOwnProperty,g=t(11),b=t(9),w=t(13),x=t(12),k=t(40);y=Math.PI/2,n="alphabetic",c="top",i="bottom",l="middle",s="hanging",a="left",u="right",o="center",d={above:{parallel:0,normal:-y,horizontal:0,vertical:-y},below:{parallel:0,normal:y,horizontal:0,vertical:y},left:{parallel:-y,normal:0,horizontal:0,vertical:-y},right:{parallel:y,normal:0,horizontal:0,vertical:y}},f={above:{justified:c,parallel:n,normal:l,horizontal:n,vertical:l},below:{justified:i,parallel:s,normal:l,horizontal:s,vertical:l},left:{justified:c,parallel:n,normal:l,horizontal:l,vertical:n},right:{justified:c,parallel:n,normal:l,horizontal:l,vertical:n}},_={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}},h={above:u,below:a,left:u,right:a},p={above:a,below:u,left:u,right:a},r.update_panel_constraints=function(t){var e;if(null==t.model.props.visible||t.model.visible)return e=t.solver,null!=t._size_constraint&&e.has_constraint(t._size_constraint)&&e.remove_constraint(t._size_constraint),t._size_constraint=g.GE(t.model.panel._size,-t._get_size()),e.add_constraint(t._size_constraint),null!=t._full_constraint&&e.has_constraint(t._full_constraint)&&e.remove_constraint(t._full_constraint),t._full_constraint=function(){switch(t.model.panel.side){case"above":case"below":return g.EQ(t.model.panel._width,[-1,t.plot_model.canvas._width]);case"left":case"right":return g.EQ(t.model.panel._height,[-1,t.plot_model.canvas._height])}}(),e.add_constraint(t._full_constraint)},r.SidePanel=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return m(e,t),e.prototype.type="SidePanel",e.internal({side:[w.String],plot:[w.Instance]}),e.prototype.initialize=function(t,r){switch(e.__super__.initialize.call(this,t,r),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.getters({is_horizontal:function(){return"above"===this.side||"below"===this.side},is_vertical:function(){return"left"===this.side||"right"===this.side}}),e.prototype.apply_label_text_heuristics=function(t,e){var r,n,i;return i=this.side,k.isString(e)?(n=f[i][e],r=_[i][e]):0===e?(n=f[i][e],r=_[i][e]):e<0?(n="middle",r=h[i]):e>0&&(n="middle",r=p[i]),t.textBaseline=n,t.textAlign=r,t},e.prototype.get_label_angle_heuristic=function(t){var e;return e=this.side,d[e][t]},e}(b.LayoutCanvas)},function(t,e,r){"use strict";function n(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new o.Constraint(new(o.Expression.bind.apply(o.Expression,[void 0].concat(e))),t)}}function i(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new o.Constraint(new(o.Expression.bind.apply(o.Expression,[void 0].concat(e))),t,o.Strength.weak)}}Object.defineProperty(r,"__esModule",{value:!0});var o=t(314);r.Variable=o.Variable,r.Expression=o.Expression,r.Constraint=o.Constraint,r.Operator=o.Operator,r.Strength=o.Strength,r.EQ=n(o.Operator.Eq),r.LE=n(o.Operator.Le),r.GE=n(o.Operator.Ge),r.WEAK_EQ=i(o.Operator.Eq),r.WEAK_LE=i(o.Operator.Le),r.WEAK_GE=i(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){this.solver.addConstraint(t)},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}();r.Solver=s},function(t,e,r){"use strict";function n(t,e){return null!=console[t]?console[t].bind(console,e):null!=console.log?console.log.bind(console,e):function(){}}function i(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+"'"),r.logger.set_level(t))}Object.defineProperty(r,"__esModule",{value:!0});var o=t(40),s={},a=function(){function t(t,e){this.name=t,this.level=e}return t}();r.LogLevel=a;var l=function(){function t(e,r){void 0===r&&(r=t.INFO),this._name=e,this.set_level(r)}return Object.defineProperty(t,"levels",{get:function(){return Object.keys(t.log_levels)},enumerable:!0,configurable:!0}),t.get=function(e,r){if(void 0===r&&(r=t.INFO),e.length>0){var n=s[e];return null==n&&(s[e]=n=new t(e,r)),n}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 r="["+this._name+"]";for(var i in t.log_levels){var s=t.log_levels[i];s.level<this._log_level.level||this._log_level.level===t.OFF.level?this[i]=function(){}:this[i]=n(i,r)}},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}();r.Logger=l,r.logger=l.get("bokeh"),r.set_log_level=i},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},a=t(18),l=t(6),u=t(36),c=t(24),_=t(20),h=t(40);n=function(t){try{return JSON.stringify(t)}catch(e){return t.toString()}},r.Property=function(){function t(t){this.obj=t.obj,this.attr=t.attr,this.default_value=t.default_value,this._init(),this.change=new a.Signal(this.obj,"change"),this.connect(this.change,function(t){return function(){return t._init()}}(this))}return i(t.prototype,a.Signalable),t.prototype.dataspec=!1,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){var e;if(null==t&&(t=!0),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,r,n,i,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+"'");i=this.transform(t.get_column(this.spec.field))}else null!=this.spec.expr?i=this.transform(this.spec.expr._v_compute(t)):(n=t.get_length(),null==n&&(n=1),o=this.value(!1),i=function(){var t,e,i;for(i=[],r=t=0,e=n;0<=e?t<e:t>e;r=0<=e?++t:--t)i.push(o);return i}());return null!=this.spec.transform&&(i=this.spec.transform.v_compute(i)),i},t.prototype._init=function(){var t,e,r,n;if(n=this.obj,null==n)throw new Error("missing property object");if(null==n.properties)throw new Error("property object must be a HasProps");if(t=this.attr,null==t)throw new Error("missing property attr");if(e=n.getv(t),void 0===e&&(r=this.default_value,e=function(){switch(!1){case void 0!==r:return null;case!h.isArray(r):return _.copy(r);case!h.isFunction(r):return r(n);default:return r}}(),n.setv(t,e,{silent:!0,defaults:!0})),h.isArray(e)?this.spec={value:e}:h.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&&!h.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: "+n(this.spec)+")"},t}(),r.simple_prop=function(t,e){var o;return o=function(r){function o(){return o.__super__.constructor.apply(this,arguments)}return i(o,r),o.prototype.name=t,o.prototype.validate=function(r){if(!e(r))throw new Error(t+" property '"+this.attr+"' given invalid value: "+n(r))},o}(r.Property)},r.Any=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.simple_prop("Any",function(t){return!0})),r.Array=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.simple_prop("Array",function(t){return h.isArray(t)||t instanceof Float64Array})),r.Bool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.simple_prop("Bool",h.isBoolean)),r.Boolean=r.Bool,r.Color=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.simple_prop("Color",function(t){return null!=u[t.toLowerCase()]||"#"===t.substring(0,1)||c.valid_rgb(t)})),r.Instance=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.simple_prop("Instance",function(t){return null!=t.properties})),r.Number=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.simple_prop("Number",function(t){return h.isNumber(t)||h.isBoolean(t)})),r.Int=r.Number,r.Percent=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.simple_prop("Number",function(t){return(h.isNumber(t)||h.isBoolean(t))&&0<=t&&t<=1})),r.String=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.simple_prop("String",h.isString)),r.Font=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.String),r.enum_prop=function(t,e){var n;return n=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return i(r,e),r.prototype.name=t,r}(r.simple_prop(t,function(t){return s.call(e,t)>=0}))},r.Anchor=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("Anchor",l.LegendLocation)),r.AngleUnits=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("AngleUnits",l.AngleUnits)),r.Direction=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.transform=function(t){var e,r,n,i;for(i=new Uint8Array(t.length),e=r=0,n=t.length;0<=n?r<n:r>n;e=0<=n?++r:--r)switch(t[e]){case"clock":i[e]=!1;break;case"anticlock":i[e]=!0}return i},e}(r.enum_prop("Direction",l.Direction)),r.Dimension=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("Dimension",l.Dimension)),r.Dimensions=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("Dimensions",l.Dimensions)),r.FontStyle=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("FontStyle",l.FontStyle)),r.LatLon=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("LatLon",l.LatLon)),r.LineCap=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("LineCap",l.LineCap)),r.LineJoin=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("LineJoin",l.LineJoin)),r.LegendLocation=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("LegendLocation",l.LegendLocation)),r.Location=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("Location",l.Location)),r.OutputBackend=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("OutputBackend",l.OutputBackend)),r.Orientation=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("Orientation",l.Orientation)),r.TextAlign=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("TextAlign",l.TextAlign)),r.TextBaseline=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("TextBaseline",l.TextBaseline)),r.RenderLevel=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("RenderLevel",l.RenderLevel)),r.RenderMode=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("RenderMode",l.RenderMode)),r.SizingMode=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("SizingMode",l.SizingMode)),r.SpatialUnits=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("SpatialUnits",l.SpatialUnits)),r.Distribution=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("Distribution",l.DistributionTypes)),r.TransformStepMode=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("TransformStepMode",l.TransformStepModes)),r.PaddingUnits=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("PaddingUnits",l.PaddingUnits)),r.StartEnd=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.enum_prop("StartEnd",l.StartEnd)),r.units_prop=function(t,e,n){var o;return o=function(r){function o(){return o.__super__.constructor.apply(this,arguments)}return i(o,r),o.prototype.name=t,o.prototype.init=function(){var r;if(null==this.spec.units&&(this.spec.units=n),this.units=this.spec.units,r=this.spec.units,s.call(e,r)<0)throw new Error(t+" units must be one of "+e+", given invalid value: "+r)},o}(r.Number)},r.Angle=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.transform=function(t){var r;return"deg"===this.spec.units&&(t=function(){var e,n,i;for(i=[],e=0,n=t.length;e<n;e++)r=t[e],i.push(r*Math.PI/180);return i}()),t=function(){var e,n,i;for(i=[],e=0,n=t.length;e<n;e++)r=t[e],i.push(-r);return i}(),e.__super__.transform.call(this,t)},e}(r.units_prop("Angle",l.AngleUnits,"rad")),r.Distance=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e}(r.units_prop("Distance",l.SpatialUnits,"data")),r.AngleSpec=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.dataspec=!0,e}(r.Angle),r.ColorSpec=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.dataspec=!0,e}(r.Color),r.DirectionSpec=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.dataspec=!0,e}(r.Distance),r.DistanceSpec=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.dataspec=!0,e}(r.Distance),r.FontSizeSpec=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.dataspec=!0,e}(r.String),r.NumberSpec=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.dataspec=!0,e}(r.Number),r.StringSpec=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.dataspec=!0,e}(r.String)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s,a=t(13),l=t(28);i=function(t,e){var r,n,i;n={},null==e&&(e="");for(r in t)i=t[r],n[e+r]=i;return n},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]},r.line=function(t){return i(o,t)},n={fill_color:[a.ColorSpec,"gray"],fill_alpha:[a.NumberSpec,1]},r.fill=function(t){return i(n,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"]},r.text=function(t){return i(s,t)},r.create=function(t){var e,r,n,i,o,s,a;for(a={},r=0,i=t.length;r<i;r++){if(e=t[r],s=e.split(":"),n=s[0],o=s[1],null==this[n])throw new Error("Unknown property mixin kind '"+n+"'");a=l.extend(a,this[n](o))}return a}},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(7),s=t(16),a=t(8),l=t(13);r.SelectionManager=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="SelectionManager",e.internal({source:[l.Any]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.selector=new s.Selector,this.inspectors={}},e.prototype.select=function(t,e,r,n){var i,o,s,a;for(null==n&&(n=!1),i=!1,o=0,s=t.length;o<s;o++)a=t[o],i||(i=a.hit_test(e,r,n));return i},e.prototype.inspect=function(t,e){var r;return r=!1,r||(r=t.hit_test(e,!1,!1,"inspect")),r},e.prototype.clear=function(t){return this.selector.clear(),this.source.selected=a.create_hit_test_result()},e.prototype.get_or_create_inspector=function(t){return null==this.inspectors[t.id]&&(this.inspectors[t.id]=new s.Selector),this.inspectors[t.id]},e}(o.HasProps)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(7),s=t(8),a=t(13);r.Selector=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="Selector",e.prototype.update=function(t,e,r,n){return null==n&&(n=!1),this.setv("timestamp",new Date,{silent:n}),this.setv("final",e,{silent:n}),r&&t.update_through_union(this.indices),this.setv("indices",t,{silent:n})},e.prototype.clear=function(){return this.timestamp=new Date,this["final"]=!0,this.indices=s.create_hit_test_result()},e.internal({indices:[a.Any,function(){return s.create_hit_test_result()}],"final":[a.Boolean],timestamp:[a.Any]}),e}(o.HasProps)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=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}();r.Settings=n,r.settings=new n},function(t,e,r){"use strict";function n(t,e,r,n){return l.find(t,function(t){return t.signal===e&&t.slot===r&&t.context===n})}function i(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(r,"__esModule",{value:!0});var s=t(12),a=t(22),l=t(20),u=function(){function t(t,e){this.sender=t,this.name=e}return t.prototype.connect=function(t,e){void 0===e&&(e=null),_.has(this.sender)||_.set(this.sender,[]);var r=_.get(this.sender);if(null!=n(r,this,t,e))return!1;var i=e||t;h.has(i)||h.set(i,[]);var o=h.get(i),s={signal:this,slot:t,context:e};return r.push(s),o.push(s),!0},t.prototype.disconnect=function(t,e){void 0===e&&(e=null);var r=_.get(this.sender);if(null==r||0===r.length)return!1;var o=n(r,this,t,e);if(null==o)return!1;var s=e||t,a=h.get(s);return o.signal=null,i(r),i(a),!0},t.prototype.emit=function(t){for(var e=_.get(this.sender)||[],r=0,n=e;r<n.length;r++){var i=n[r],o=i.signal,s=i.slot,a=i.context;o===this&&s.call(a,t,this.sender)}},t}();r.Signal=u,function(t){function e(t,e){var r=_.get(t);if(null!=r&&0!==r.length){var n=h.get(e);if(null!=n&&0!==n.length){for(var o=0,s=n;o<s.length;o++){var a=s[o];if(null==a.signal)return;a.signal.sender===t&&(a.signal=null)}i(r),i(n)}}}function r(t){var e=_.get(t);if(null!=e&&0!==e.length){for(var r=0,n=e;r<n.length;r++){var o=n[r];if(null==o.signal)return;var s=o.context||o.slot;o.signal=null,i(h.get(s))}i(e)}}function n(t){var e=h.get(t);if(null!=e&&0!==e.length){for(var r=0,n=e;r<n.length;r++){var o=n[r];if(null==o.signal)return;var s=o.signal.sender;o.signal=null,i(_.get(s))}i(e)}}function o(t){var e=_.get(t);if(null!=e&&0!==e.length){for(var r=0,n=e;r<n.length;r++){var o=n[r];o.signal=null}i(e)}var s=h.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}i(s)}}t.disconnectBetween=e,t.disconnectSender=r,t.disconnectReceiver=n,t.disconnectAll=o}(u=r.Signal||(r.Signal={})),r.Signal=u;var c;!function(t){function e(t,e){return t.connect(e,this)}function r(t,e){s.logger.warn("obj.listenTo('event', handler) is deprecated, use obj.connect(signal, slot)");var r=t.split(":"),n=r[0],i=r[1],o=null==i?this[n]:this.properties[i][n];return o.connect(e,this)}function n(t,e){s.logger.warn("obj.trigger('event', args) is deprecated, use signal.emit(args)");var r=t.split(":"),n=r[0],i=r[1],o=null==i?this[n]:this.properties[i][n];return o.emit(e)}t.connect=e,t.listenTo=r,t.trigger=n}(c=r.Signalable||(r.Signalable={}));var _=new WeakMap,h=new WeakMap,p=new Set},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(311),i=t(18),o=t(12),s=t(4),a=t(41),l=t(28),u=t(2);r.UIEvents=function(){function t(t,e,r,n){this.plot_view=t,this.toolbar=e,this.hit_area=r,this.plot=n,this.tap=new i.Signal(this,"tap"),this.doubletap=new i.Signal(this,"doubletap"),this.press=new i.Signal(this,"press"),this.pan_start=new i.Signal(this,"pan:start"),this.pan=new i.Signal(this,"pan"),this.pan_end=new i.Signal(this,"pan:end"),this.pinch_start=new i.Signal(this,"pinch:start"),this.pinch=new i.Signal(this,"pinch"),this.pinch_end=new i.Signal(this,"pinch:end"),this.rotate_start=new i.Signal(this,"rotate:start"),this.rotate=new i.Signal(this,"rotate"),this.rotate_end=new i.Signal(this,"rotate:end"),this.move_enter=new i.Signal(this,"move:enter"),this.move=new i.Signal(this,"move"),this.move_exit=new i.Signal(this,"move:exit"),this.scroll=new i.Signal(this,"scroll"),this.keydown=new i.Signal(this,"keydown"),this.keyup=new i.Signal(this,"keyup"),this._configure_hammerjs()}return t.prototype._configure_hammerjs=function(){return this.hammer=new n(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(t){return function(e){return t._doubletap(e)}}(this)),this.hammer.on("tap",function(t){return function(e){return t._tap(e)}}(this)),this.hammer.on("press",function(t){return function(e){return t._press(e)}}(this)),this.hammer.get("pan").set({direction:n.DIRECTION_ALL}),this.hammer.on("panstart",function(t){return function(e){return t._pan_start(e)}}(this)),this.hammer.on("pan",function(t){return function(e){return t._pan(e)}}(this)),this.hammer.on("panend",function(t){return function(e){return t._pan_end(e)}}(this)),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("pinchstart",function(t){return function(e){return t._pinch_start(e)}}(this)),this.hammer.on("pinch",function(t){return function(e){return t._pinch(e)}}(this)),this.hammer.on("pinchend",function(t){return function(e){return t._pinch_end(e)}}(this)),this.hammer.get("rotate").set({enable:!0}),this.hammer.on("rotatestart",function(t){return function(e){return t._rotate_start(e)}}(this)),this.hammer.on("rotate",function(t){return function(e){return t._rotate(e)}}(this)),this.hammer.on("rotateend",function(t){return function(e){return t._rotate_end(e)}}(this)),this.hit_area.addEventListener("mousemove",function(t){return function(e){return t._mouse_move(e)}}(this)),this.hit_area.addEventListener("mouseenter",function(t){return function(e){return t._mouse_enter(e)}}(this)),this.hit_area.addEventListener("mouseleave",function(t){return function(e){return t._mouse_exit(e)}}(this)),this.hit_area.addEventListener("wheel",function(t){return function(e){return t._mouse_wheel(e)}}(this)),document.addEventListener("keydown",function(t){return function(e){return t._key_down(e)}}(this)),document.addEventListener("keyup",function(t){return function(e){return t._key_up(e)}}(this))},t.prototype.register_tool=function(t){var e,r,n,i;if(e=t.model.event_type,r=t.model.id,n=t.model.type,null==e)return void o.logger.debug("Button tool: "+n);switch(i=t,e){case"pan":null!=i._pan_start&&i.connect(this.pan_start,function(t){if(t.id===r)return i._pan_start(t.e)}),null!=i._pan&&i.connect(this.pan,function(t){if(t.id===r)return i._pan(t.e)}),null!=i._pan_end&&i.connect(this.pan_end,function(t){if(t.id===r)return i._pan_end(t.e)});break;case"pinch":null!=i._pinch_start&&i.connect(this.pinch_start,function(t){if(t.id===r)return i._pinch_start(t.e)}),null!=i._pinch&&i.connect(this.pinch,function(t){if(t.id===r)return i._pinch(t.e)}),null!=i._pinch_end&&i.connect(this.pinch_end,function(t){if(t.id===r)return i._pinch_end(t.e)});break;case"rotate":null!=i._rotate_start&&i.connect(this.rotate_start,function(t){if(t.id===r)return i._rotate_start(t.e)}),null!=i._rotate&&i.connect(this.rotate,function(t){if(t.id===r)return i._rotate(t.e)}),null!=i._rotate_end&&i.connect(this.rotate_end,function(t){if(t.id===r)return i._rotate_end(t.e)});break;case"move":null!=i._move_enter&&i.connect(this.move_enter,function(t){if(t.id===r)return i._move_enter(t.e)}),null!=i._move&&i.connect(this.move,function(t){if(t.id===r)return i._move(t.e)}),null!=i._move_exit&&i.connect(this.move_exit,function(t){if(t.id===r)return i._move_exit(t.e)});break;case"tap":null!=i._tap&&i.connect(this.tap,function(t){if(t.id===r)return i._tap(t.e)});break;case"press":null!=i._press&&i.connect(this.press,function(t){if(t.id===r)return i._press(t.e)});break;case"scroll":null!=i._scroll&&i.connect(this.scroll,function(t){if(t.id===r)return i._scroll(t.e)});break;default:throw new Error("unsupported event_type: "+ev)}return null!=i._doubletap&&i.connect(this.doubletap,function(t){return i._doubletap(t.e)}),null!=i._keydown&&i.connect(this.keydown,function(t){return i._keydown(t.e)}),null!=i._keyup&&i.connect(this.keyup,function(t){return i._keyup(t.e)}),("ontouchstart"in window||navigator.maxTouchPoints>0)&&"pinch"===e?(o.logger.debug("Registering scroll on touch screen"),i.connect(this.scroll,function(t){if(t.id===r)return i._scroll(t.e)})):void 0},t.prototype._hit_test_renderers=function(t,e){var r,n,i,o;for(n=this.plot_view.get_renderer_views(),r=n.length-1;r>=0;r+=-1)if(o=n[r],("annotation"===(i=o.model.level)||"overlay"===i)&&null!=o.bbox&&o.bbox().contains(t,e))return o;return null},t.prototype._hit_test_frame=function(t,e){var r,n,i;return r=this.plot_view.canvas,n=r.sx_to_vx(t),i=r.sy_to_vy(e),this.plot_view.frame.contains(n,i)},t.prototype._trigger=function(t,e){var r,n,i,o,s,a,u,c,_,h,p;switch(a=t.name,o=a.split(":")[0],p=this._hit_test_renderers(e.bokeh.sx,e.bokeh.sy),o){case"move":for(n=this.toolbar.inspectors.filter(function(t){return t.active}),s="default",null!=p?(null!=p.model.cursor&&(s=p.model.cursor()),l.isEmpty(n)||(t=this.move_exit,a=t.name)):this._hit_test_frame(e.bokeh.sx,e.bokeh.sy)&&(l.isEmpty(n)||(s="crosshair")),this.plot_view.set_cursor(s),h=[],u=0,_=n.length;u<_;u++)c=n[u],h.push(this.trigger(t,e,c.id));return h;case"tap":if(null!=p&&"function"==typeof p.on_hit&&p.on_hit(e.bokeh.sx,e.bokeh.sy),r=this.toolbar.gestures[o].active,null!=r)return this.trigger(t,e,r.id);break;case"scroll":if(i="ontouchstart"in window||navigator.maxTouchPoints>0?"pinch":"scroll",r=this.toolbar.gestures[i].active,null!=r)return e.preventDefault(),e.stopPropagation(),this.trigger(t,e,r.id);break;default:if(r=this.toolbar.gestures[o].active,null!=r)return this.trigger(t,e,r.id)}},t.prototype.trigger=function(t,e,r){return null==r&&(r=null),t.emit({id:r,e:e})},t.prototype._bokify_hammer=function(t,e){var r,n,i,a,c,_;return null==e&&(e={}),"mouse"===t.pointerType?(c=t.srcEvent.pageX,_=t.srcEvent.pageY):(c=t.pointers[0].pageX,_=t.pointers[0].pageY),i=s.offset(t.target),n=i.left,a=i.top,t.bokeh={sx:c-n,sy:_-a},t.bokeh=l.extend(t.bokeh,e),r=u.BokehEvent.event_class(t),null!=r?this.plot.trigger_event(r.from_event(t)):o.logger.debug("Unhandled event of type "+t.type);
},t.prototype._bokify_point_event=function(t,e){var r,n,i,a;return null==e&&(e={}),i=s.offset(t.currentTarget),n=i.left,a=i.top,t.bokeh={sx:t.pageX-n,sy:t.pageY-a},t.bokeh=l.extend(t.bokeh,e),r=u.BokehEvent.event_class(t),null!=r?this.plot.trigger_event(r.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,r){"use strict";function n(t){return t[t.length-1]}function i(t){return I.call(t)}function o(t){return(e=[]).concat.apply(e,t);var e}function s(t,e){return t.indexOf(e)!==-1}function a(t,e){return t[e>=0?e:t.length+e]}function l(t,e){for(var r=Math.min(t.length,e.length),n=new Array(r),i=0;i<r;i++)n[i]=[t[i],e[i]];return n}function u(t){for(var e=t.length,r=new Array(e),n=new Array(e),i=0;i<e;i++)o=t[i],r[i]=o[0],n[i]=o[1];return[r,n];var o}function c(t,e,r){void 0===r&&(r=1),null==e&&(e=t,t=0);for(var n=Math.max(Math.ceil((e-t)/r),0),i=Array(n),o=0;o<n;o++,t+=r)i[o]=t;return i}function _(t,e,r){void 0===r&&(r=100);for(var n=(e-t)/(r-1),i=new Array(r),o=0;o<r;o++)i[o]=t+n*o;return i}function h(t){for(var e=t.length,r=t[0].length,n=[],i=0;i<r;i++){n[i]=[];for(var o=0;o<e;o++)n[i][o]=t[o][i]}return n}function p(t){return t.reduce(function(t,e){return t+e},0)}function d(t){var e=[];return t.reduce(function(t,r,n){return e[n]=t+r},0),e}function f(t){for(var e,r=1/0,n=0,i=t.length;n<i;n++)e=t[n],e<r&&(r=e);return r}function y(t,e){if(0==t.length)throw new Error("minBy() called with an empty array");for(var r=t[0],n=e(r),i=1,o=t.length;i<o;i++){var s=t[i],a=e(s);a<n&&(r=s,n=a)}return r}function m(t){for(var e,r=-(1/0),n=0,i=t.length;n<i;n++)e=t[n],e>r&&(r=e);return r}function v(t,e){if(0==t.length)throw new Error("maxBy() called with an empty array");for(var r=t[0],n=e(r),i=1,o=t.length;i<o;i++){var s=t[i],a=e(s);a>n&&(r=s,n=a)}return r}function g(t){return y(c(t.length),function(e){return t[e]})}function b(t){return v(c(t.length),function(e){return t[e]})}function w(t,e){for(var r=0,n=t;r<n.length;r++){var i=n[r];if(!e(i))return!1}return!0}function x(t,e){for(var r=0,n=t;r<n.length;r++){var i=n[r];if(e(i))return!0}return!1}function k(t){return function(e,r){for(var n=e.length,i=t>0?0:n-1;i>=0&&i<n;i+=t)if(r(e[i]))return i;return-1}}function M(t,e){var n=r.findIndex(t,e);return n==-1?void 0:t[n]}function S(t,e){var n=r.findLastIndex(t,e);return n==-1?void 0:t[n]}function T(t,e){for(var r=0,n=t.length;r<n;){var i=Math.floor((r+n)/2);t[i]<e?r=i+1:n=i}return r}function O(t,e){var r=t.map(function(t,r){return{value:t,index:r,key:e(t)}});return r.sort(function(t,e){var r=t.key,n=e.key;if(r!==n){if(r>n||void 0===r)return 1;if(r<n||void 0===n)return-1}return t.index-e.index}),r.map(function(t){return t.value})}function P(t){for(var e=[],r=0,n=t;r<n.length;r++){var i=n[r];s(e,i)||e.push(i)}return e}function A(t,e){for(var r=[],n=[],i=0,o=t;i<o.length;i++){var a=o[i],l=e(a);s(n,l)||(n.push(l),r.push(a))}return r}function j(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return P(o(t))}function E(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=[];t:for(var i=0,o=t;i<o.length;i++){var a=o[i];if(!s(n,a)){for(var l=0,u=e;l<u.length;l++){var c=u[l];if(!s(c,a))continue t}n.push(a)}}return n}function z(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=o(e);return t.filter(function(t){return!s(n,t)})}function C(t,e){for(var r=0;r<t.length;)e(t[r])?t.splice(r,1):r++}function N(t){for(var e=t.length,r=new Array(e),n=0;n<e;n++){var i=F.randomIn(0,n);i!==n&&(r[n]=r[i]),r[i]=t[n]}return r}function D(t,e){for(var r=t.length,n=new Array(r-1),i=0;i<r-1;i++)n[i]=e(t[i],t[i+1]);return n}
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
Object.defineProperty(r,"__esModule",{value:!0});var F=t(27),I=Array.prototype.slice;r.last=n,r.copy=i,r.concat=o,r.contains=s,r.nth=a,r.zip=l,r.unzip=u,r.range=c,r.linspace=_,r.transpose=h,r.sum=p,r.cumsum=d,r.min=f,r.minBy=y,r.max=m,r.maxBy=v,r.argmin=g,r.argmax=b,r.all=w,r.any=x,r.findIndex=k(1),r.findLastIndex=k(-1),r.find=M,r.findLast=S,r.sortedIndex=T,r.sortBy=O,r.uniq=P,r.uniqBy=A,r.union=j,r.intersection=E,r.difference=z,r.removeBy=C,r.shuffle=N,r.pairwise=D},function(t,e,r){"use strict";function n(){return{minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)}}function i(){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:Math.min(t.minX,e.minX),maxX:Math.max(t.maxX,e.maxX),minY:Math.min(t.minY,e.minY),maxY:Math.max(t.maxY,e.maxY)}}Object.defineProperty(r,"__esModule",{value:!0}),r.empty=n,r.positive_x=i,r.positive_y=o,r.union=s;var a=function(){function t(t){null==t?(this.x0=1/0,this.y0=-(1/0),this.x1=1/0,this.y1=-(1/0)):(this.x0=t.x0,this.y0=t.y0,this.x1=t.x1,this.y1=t.y1)}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,"pt0",{get:function(){return[this.x0,this.y0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pt1",{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.x1},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}),t.prototype.contains=function(t,e){return t>=this.x0&&t<=this.x1&&e>=this.y0&&e<=this.y1},t.prototype.union=function(e){return new t({x0:Math.min(this.x0,e.x0),y0:Math.min(this.y0,e.y0),x1:Math.max(this.x1,e.x1),y1:Math.max(this.y1,e.y1)})},t}();r.BBox=a},function(t,e,r){"use strict";function n(t,e){return setTimeout(t,e)}function i(t){return a(t)}function o(t,e,r){void 0===r&&(r={});var n,i,o,s=null,a=0,l=function(){a=r.leading===!1?0:Date.now(),s=null,o=t.apply(n,i),s||(n=i=null)};return function(){var u=Date.now();a||r.leading!==!1||(a=u);var c=e-(u-a);return n=this,i=arguments,c<=0||c>e?(s&&(clearTimeout(s),s=null),a=u,o=t.apply(n,i),s||(n=i=null)):s||r.trailing===!1||(s=setTimeout(l,c)),o}}function s(t){var e,r=!1;return function(){return r||(r=!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(r,"__esModule",{value:!0}),r.delay=n;var a="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;r.defer=i,r.throttle=o,r.once=s},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,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}},i=function(t){return t.setImageSmoothingEnabled=function(e){return t.imageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.oImageSmoothingEnabled=e,t.webkitImageSmoothingEnabled=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 r;return r=t.html5MeasureText(e),r.ascent=1.6*t.html5MeasureText("m").width,r}},n=function(t){var e;if(e=function(e,r,n,i,o,s,a,l){var u,c,_;null==l&&(l=!1),u=.551784,t.translate(e,r),t.rotate(o),c=n,_=i,l&&(c=-n,_=-i),t.moveTo(-c,0),t.bezierCurveTo(-c,_*u,-c*u,_,0,_),t.bezierCurveTo(c*u,_,c,_*u,c,0),t.bezierCurveTo(c,-_*u,c*u,-_,0,-_),t.bezierCurveTo(-c*u,-_,-c,-_*u,-c,0),t.rotate(-o),t.translate(-e,-r)},!t.ellipse)return t.ellipse=e},r.fixup_ctx=function(t){return o(t),s(t),i(t),a(t),n(t)},r.get_scale_ratio=function(t,e,r){var n,i;return"svg"===r?1:e?(i=window.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1,i/n):1}},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},o=t(36);n=function(t){var e;return e=Number(t).toString(16),e=1===e.length?"0"+e:e},r.color2hex=function(t){var e,r,i,s;return t+="",0===t.indexOf("#")?t:null!=o[t]?o[t]:0===t.indexOf("rgb")?(i=t.replace(/^rgba?\(|\s+|\)$/g,"").split(","),e=function(){var t,e,r,o;for(r=i.slice(0,3),o=[],t=0,e=r.length;t<e;t++)s=r[t],o.push(n(s));return o}().join(""),4===i.length&&(e+=n(Math.floor(255*parseFloat(i.slice(3))))),r="#"+e.slice(0,8)):t},r.color2rgba=function(t,e){var n,i,o;if(null==e&&(e=1),!t)return[0,0,0,0];for(n=r.color2hex(t),n=n.replace(/ |#/g,""),n.length<=4&&(n=n.replace(/(.)/g,"$1$1")),n=n.match(/../g),o=function(){var t,e,r;for(r=[],t=0,e=n.length;t<e;t++)i=n[t],r.push(parseInt(i,16)/255);return r}();o.length<3;)o.push(0);return o.length<4&&o.push(e),o.slice(0,4)},r.valid_rgb=function(t){var e,r,n,o;switch(t.substring(0,4)){case"rgba":r={start:"rgba(",len:4,alpha:!0};break;case"rgb(":r={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(r.start,"").replace(")","").split(",").map(parseFloat),e.length!==r.len)throw new Error("color expects rgba "+expect_len+"-tuple, received "+t);if(r.alpha&&!(0<=(n=e[3])&&n<=1))throw new Error("color expects rgba 4-tuple to have alpha value between 0 and 1");if(i.call(function(){var t,r,n,i;for(n=e.slice(0,3),i=[],t=0,r=n.length;t<r;t++)o=n[t],i.push(0<=o&&o<=255);return i}(),!1)>=0)throw new Error("color expects rgb to have value between 0 and 255");return!0}},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(20),i=t(26),o=t(40),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 r=this._existing(t);null==r?this._dict[t]=e:o.isArray(r)?r.push(e):this._dict[t]=[r,e]},t.prototype.remove_value=function(t,e){var r=this._existing(t);if(o.isArray(r)){var s=n.difference(r,[e]);s.length>0?this._dict[t]=s:delete this._dict[t]}else i.isEqual(r,e)&&delete this._dict[t]},t.prototype.get_one=function(t,e){var r=this._existing(t);if(o.isArray(r)){if(1===r.length)return r[0];throw new Error(e)}return r},t}();r.MultiDict=s;var a=function(){function t(e){null==e?this.values=[]:e instanceof t?this.values=n.copy(e.values):this.values=this._compact(e)}return t.prototype._compact=function(t){for(var e=[],r=0,n=t;r<n.length;r++){var i=n[r];e.indexOf(i)===-1&&e.push(i)}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 r=new t,n=0,i=e.values;n<i.length;n++){var o=i[n];this.includes(o)&&e.includes(o)&&r.push(o)}return r},t.prototype.diff=function(e){e=new t(e);for(var r=new t,n=0,i=this.values;n<i.length;n++){var o=i[n];e.missing(o)&&r.push(o)}return r},t}();r.Set=a},function(t,e,r){"use strict";function n(t,e,r,i){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,c=e.constructor;if(u!==c&&!(o.isFunction(u)&&u instanceof u&&o.isFunction(c)&&c instanceof c)&&"constructor"in t&&"constructor"in e)return!1}r=r||[],i=i||[];for(var _=r.length;_--;)if(r[_]===t)return i[_]===e;if(r.push(t),i.push(e),l){if(_=t.length,_!==e.length)return!1;for(;_--;)if(!n(t[_],e[_],r,i))return!1}else{var h=Object.keys(t),p=void 0;if(_=h.length,Object.keys(e).length!==_)return!1;for(;_--;)if(p=h[_],!e.hasOwnProperty(p)||!n(t[p],e[p],r,i))return!1}return r.pop(),i.pop(),!0}function i(t,e){return n(t,e)}
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
Object.defineProperty(r,"__esModule",{value:!0});var o=t(40),s=Object.prototype.toString;r.isEqual=i},function(t,e,r){"use strict";function n(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}function i(t,e){return Math.abs(n(t-e))}function o(t,e,r,o){var s=n(t),a=i(e,r),l=i(e,s)<=a&&i(s,r)<=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 r,n;;)if(r=s(),n=s(),n=(2*n-1)*Math.sqrt(2*(1/Math.E)),-4*r*r*Math.log(r)>=n*n)break;var i=n/r;return i=t+e*i}function c(t,e,r){return t>r?r:t<e?e:t}Object.defineProperty(r,"__esModule",{value:!0}),r.angle_norm=n,r.angle_dist=i,r.angle_between=o,r.random=s,r.randomIn=a,r.atan2=l,r.rnorm=u,r.clamp=c},function(t,e,r){"use strict";function n(t){for(var e=Object.keys(t),r=e.length,n=new Array(r),i=0;i<r;i++)n[i]=t[e[i]];return n}function i(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0,i=e;n<i.length;n++){var o=i[n];for(var s in o)o.hasOwnProperty(s)&&(t[s]=o[s])}return t}function o(t){return i({},t)}function s(t,e){for(var r=Object.create(Object.prototype),n=u.concat([Object.keys(t),Object.keys(e)]),i=0,o=n;i<o.length;i++){var s=o[i],a=t.hasOwnProperty(s)?t[s]:[],l=e.hasOwnProperty(s)?e[s]:[];r[s]=u.union(a,l)}return r}function a(t){return Object.keys(t).length}function l(t){return 0===a(t)}Object.defineProperty(r,"__esModule",{value:!0});var u=t(20);r.keys=Object.keys,r.values=n,r.extend=i,r.clone=o,r.merge=s,r.size=a,r.isEmpty=l},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(338);r.proj4=n;var i=t(326),o=t(332),s=t(342),a=t(351);n.defaultDatum="WGS84",n.WGS84=new i("WGS84"),n.Proj=i,n.toPoint=o,n.defs=s,n.transform=a,r.mercator=s("GOOGLE"),r.wgs84=s("WGS84")},function(t,e,r){"use strict";function n(t,e){for(var r=Math.min(t.length,e.length),n=new Array(r),i=new Array(r),s=0;s<r;s++){var a=o.proj4(o.mercator,[t[s],e[s]]),l=a[0],u=a[1];n[s]=l,i[s]=u}return[n,i]}function i(t,e){for(var r=Math.min(t.length,e.length),i=new Array(r),o=new Array(r),s=0;s<r;s++){var a=n(t[s],e[s]),l=a[0],u=a[1];i[s]=l,o[s]=u}return[i,o]}Object.defineProperty(r,"__esModule",{value:!0});var o=t(29);r.project_xy=n,r.project_xsys=i},function(t,e,r){"use strict";function n(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 i(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(r,"__esModule",{value:!0});var o=t(7),s=t(40);r.create_ref=n,r.is_ref=i},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.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,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s,a,l,u=t(40);n={float32:Float32Array,float64:Float64Array,uint8:Uint8Array,int8:Int8Array,uint16:Uint16Array,int16:Int16Array,uint32:Uint32Array,int32:Int32Array},i={};for(a in n)l=n[a],i[l.name]=a;o=function(t){var e,r,n;return n=new Uint8Array(t),r=function(){var t,r,i;for(i=[],t=0,r=n.length;t<r;t++)e=n[t],i.push(String.fromCharCode(e));return i}(),btoa(r.join(""))},s=function(t){var e,r,n,i,o,s;for(e=atob(t),o=e.length,r=new Uint8Array(o),n=i=0,s=o;0<=s?i<s:i>s;n=0<=s?++i:--i)r[n]=e.charCodeAt(n);return r.buffer},r.decode_base64=function(t){var e,r,i,o;return r=s(t.__ndarray__),i=t.dtype,i in n&&(e=new n[i](r)),o=t.shape,[e,o]},r.encode_base64=function(t,e){var r,n,s;return r=o(t.buffer),s=i[t.constructor.name],n={__ndarray__:r,shape:e,dtype:s}},r.decode_column_data=function(t){var e,n,i,o,s,c,_,h,p,d;c={},i={};for(a in t)if(l=t[a],u.isArray(l)){for(n=[],d=[],o=0,s=l.length;o<s;o++)e=l[o],u.isObject(e)&&"__ndarray__"in e?(_=r.decode_base64(e),e=_[0],p=_[1],d.push(p),n.push(e)):u.isArray(e)&&(d.push([]),n.push(e));d.length>0?(c[a]=n,i[a]=d):c[a]=l}else u.isObject(l)&&"__ndarray__"in l?(h=r.decode_base64(l),e=h[0],p=h[1],c[a]=e,i[a]=p):(c[a]=l,i[a]=[]);return[c,i]},r.encode_column_data=function(t,e){var n,i,o,s,c,_,h;s={};for(a in t){if(l=t[a],(null!=l?l.buffer:void 0)instanceof ArrayBuffer)l=r.encode_base64(l,null!=e?e[a]:void 0);else if(u.isArray(l)){for(o=[],n=i=0,c=l.length;0<=c?i<c:i>c;n=0<=c?++i:--i)(null!=(_=l[n])?_.buffer:void 0)instanceof ArrayBuffer?o.push(r.encode_base64(l[n],null!=e&&null!=(h=e[a])?h[n]:void 0)):o.push(l[n]);l=o}s[a]=l}return s}},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(357),i=t(354),o=function(){function t(){}return t}();r.SpatialIndex=o;var s=function(t){function e(e){var r=t.call(this)||this;return r.index=i(),r.index.load(e),r}return n.__extends(e,t),Object.defineProperty(e.prototype,"bbox",{get:function(){var t=this.index.toJSON(),e=t.minX,r=t.minY,n=t.maxX,i=t.maxY;return{minX:e,minY:r,maxX:n,maxY:i}},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),r=e.length,n=new Array(r),i=0;i<r;i++)n[i]=e[i].i;return n},e}(o);r.RBush=s},function(t,e,r){"use strict";function n(t,e,r){return void 0===r&&(r=0),t.substr(r,e.length)==e}function i(){for(var t=new Array(32),e="0123456789ABCDEF",r=0;r<32;r++)t[r]=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=a.settings.dev?"j"+l++:i();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}})}Object.defineProperty(r,"__esModule",{value:!0});var a=t(17);r.startsWith=n,r.uuid4=i;var l=1e3;r.uniqueId=o,r.escape=s},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.indianred="#CD5C5C",r.lightcoral="#F08080",r.salmon="#FA8072",r.darksalmon="#E9967A",r.lightsalmon="#FFA07A",r.crimson="#DC143C",r.red="#FF0000",r.firebrick="#B22222",r.darkred="#8B0000",r.pink="#FFC0CB",r.lightpink="#FFB6C1",r.hotpink="#FF69B4",r.deeppink="#FF1493",r.mediumvioletred="#C71585",r.palevioletred="#DB7093",r.coral="#FF7F50",r.tomato="#FF6347",r.orangered="#FF4500",r.darkorange="#FF8C00",r.orange="#FFA500",r.gold="#FFD700",r.yellow="#FFFF00",r.lightyellow="#FFFFE0",r.lemonchiffon="#FFFACD",r.lightgoldenrodyellow="#FAFAD2",r.papayawhip="#FFEFD5",r.moccasin="#FFE4B5",r.peachpuff="#FFDAB9",r.palegoldenrod="#EEE8AA",r.khaki="#F0E68C",r.darkkhaki="#BDB76B",r.lavender="#E6E6FA",r.thistle="#D8BFD8",r.plum="#DDA0DD",r.violet="#EE82EE",r.orchid="#DA70D6",r.fuchsia="#FF00FF",r.magenta="#FF00FF",r.mediumorchid="#BA55D3",r.mediumpurple="#9370DB",r.blueviolet="#8A2BE2",r.darkviolet="#9400D3",r.darkorchid="#9932CC",r.darkmagenta="#8B008B",r.purple="#800080",r.indigo="#4B0082",r.slateblue="#6A5ACD",r.darkslateblue="#483D8B",r.mediumslateblue="#7B68EE",r.greenyellow="#ADFF2F",r.chartreuse="#7FFF00",r.lawngreen="#7CFC00",r.lime="#00FF00",r.limegreen="#32CD32",r.palegreen="#98FB98",r.lightgreen="#90EE90",r.mediumspringgreen="#00FA9A",r.springgreen="#00FF7F",r.mediumseagreen="#3CB371",r.seagreen="#2E8B57",r.forestgreen="#228B22",r.green="#008000",r.darkgreen="#006400",r.yellowgreen="#9ACD32",r.olivedrab="#6B8E23",r.olive="#808000",r.darkolivegreen="#556B2F",r.mediumaquamarine="#66CDAA",r.darkseagreen="#8FBC8F",r.lightseagreen="#20B2AA",r.darkcyan="#008B8B",r.teal="#008080",r.aqua="#00FFFF",r.cyan="#00FFFF",r.lightcyan="#E0FFFF",r.paleturquoise="#AFEEEE",r.aquamarine="#7FFFD4",r.turquoise="#40E0D0",r.mediumturquoise="#48D1CC",r.darkturquoise="#00CED1",r.cadetblue="#5F9EA0",r.steelblue="#4682B4",r.lightsteelblue="#B0C4DE",r.powderblue="#B0E0E6",r.lightblue="#ADD8E6",r.skyblue="#87CEEB",r.lightskyblue="#87CEFA",r.deepskyblue="#00BFFF",r.dodgerblue="#1E90FF",r.cornflowerblue="#6495ED",r.royalblue="#4169E1",r.blue="#0000FF",r.mediumblue="#0000CD",r.darkblue="#00008B",r.navy="#000080",r.midnightblue="#191970",r.cornsilk="#FFF8DC",r.blanchedalmond="#FFEBCD",r.bisque="#FFE4C4",r.navajowhite="#FFDEAD",r.wheat="#F5DEB3",r.burlywood="#DEB887",r.tan="#D2B48C",r.rosybrown="#BC8F8F",r.sandybrown="#F4A460",r.goldenrod="#DAA520",r.darkgoldenrod="#B8860B",r.peru="#CD853F",r.chocolate="#D2691E",r.saddlebrown="#8B4513",r.sienna="#A0522D",r.brown="#A52A2A",r.maroon="#800000",r.white="#FFFFFF",r.snow="#FFFAFA",r.honeydew="#F0FFF0",r.mintcream="#F5FFFA",r.azure="#F0FFFF",r.aliceblue="#F0F8FF",r.ghostwhite="#F8F8FF",r.whitesmoke="#F5F5F5",r.seashell="#FFF5EE",r.beige="#F5F5DC",r.oldlace="#FDF5E6",r.floralwhite="#FFFAF0",r.ivory="#FFFFF0",r.antiquewhite="#FAEBD7",r.linen="#FAF0E6",r.lavenderblush="#FFF0F5",r.mistyrose="#FFE4E1",r.gainsboro="#DCDCDC",r.lightgray="#D3D3D3",r.lightgrey="#D3D3D3",r.silver="#C0C0C0",r.darkgray="#A9A9A9",r.darkgrey="#A9A9A9",r.gray="#808080",r.grey="#808080",r.dimgray="#696969",r.dimgrey="#696969",r.lightslategray="#778899",r.lightslategrey="#778899",r.slategray="#708090",r.slategrey="#708090",r.darkslategray="#2F4F4F",r.darkslategrey="#2F4F4F",r.black="#000000"},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=t(355),o=t(325),s=t(356),a=t(35),l=t(40);n=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"}}(),i.sprintf(e,t)):""+t},r.replace_placeholders=function(t,e,r,l,u){return null==u&&(u={}),t=t.replace(/(^|[^\$])\$(\w+)/g,function(t){return function(t,e,r){return e+"@$"+r}}(this)),t=t.replace(/(^|[^@])@(?:(\$?\w+)|{([^{}]+)})(?:{([^{}]+)})?/g,function(t){return function(t,c,_,h,p){var d,f,y;if(_=null!=h?h:_,y="$"===_[0]?u[_.substring(1)]:null!=(d=e.get_column(_))?d[r]:void 0,f=null,null==y)f="???";else{if("safe"===p)return""+c+y;if(null!=p)if(null!=l&&_ in l)if("numeral"===l[_])f=o.format(y,p);else if("datetime"===l[_])f=s(y,p);else{if("printf"!==l[_])throw new Error("Unknown tooltip field formatter type '"+l[_]+"'");f=i.sprintf(p,y)}else f=o.format(y,p);else f=n(y)}return f=""+c+a.escape(f)}}(this))}},function(t,e,r){"use strict";function n(t){if(null!=o[t])return o[t];var e=i.span({style:{font:t}},"Hg"),r=i.div({style:{display:"inline-block",width:"1px",height:"0px"}}),n=i.div({},e,r);document.body.appendChild(n);try{r.style.verticalAlign="baseline";var s=i.offset(r).top-i.offset(e).top;r.style.verticalAlign="bottom";var a=i.offset(r).top-i.offset(e).top,l={height:a,ascent:s,descent:a-s};return o[t]=l,l}finally{document.body.removeChild(n)}}Object.defineProperty(r,"__esModule",{value:!0});var i=t(4),o={};r.get_text_height=n},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i;n=function(t){return t()},i=("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)||n,r.throttle=function(t,e){var r,n,o,s,a,l,u,c;return l=[null,null,null,null],n=l[0],r=l[1],c=l[2],u=l[3],a=0,s=!1,o=function(){return a=new Date,c=null,s=!1,u=t.apply(n,r)},function(){var t,l;return t=new Date,l=e-(t-a),n=this,r=arguments,l<=0&&!s?(clearTimeout(c),s=!0,i(o)):c||s||(c=setTimeout(function(){return i(o)},l)),u}}},function(t,e,r){"use strict";function n(t){return t===!0||t===!1||"[object Boolean]"===_.call(t)}function i(t){return"[object Number]"===_.call(t)}function o(t){return i(t)&&isFinite(t)&&Math.floor(t)===t}function s(t){return"[object String]"===_.call(t)}function a(t){return i(t)&&t!==+t}function l(t){return"[object Function]"===_.call(t)}function u(t){return Array.isArray(t)}function c(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(r,"__esModule",{value:!0});var _=Object.prototype.toString;r.isBoolean=n,r.isNumber=i,r.isInteger=o,r.isString=s,r.isStrictNaN=a,r.isFunction=l,r.isArray=u,r.isObject=c},function(t,e,r){"use strict";function n(t){var e=getComputedStyle(t).fontSize;return null!=e?parseInt(e,10):null}function i(t){var e=t.offsetParent||document.body;return n(e)||n(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*=i(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(r,"__esModule",{value:!0}),r.getDeltaY=s},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(27);r.scale_highlow=function(t,e,r){var n,i,o,s,a,l;return null==r&&(r=null),o=[t.start,t.end],i=o[0],n=o[1],s=null!=r?r:(n+i)/2,a=i-(i-s)*e,l=n-(n-s)*e,[a,l]},r.get_info=function(t,e){var r,n,i,o,s,a,l,u;l=e[0],u=e[1],n={};for(i in t)s=t[i],o=s.v_invert([l,u]),a=o[0],r=o[1],n[i]={start:a,end:r};return n},r.scale_range=function(t,e,i,o,s){var a,l,u,c,_,h,p,d,f,y;return null==i&&(i=!0),null==o&&(o=!0),null==s&&(s=null),e=n.clamp(e,-.9,.9),a=i?e:0,l=r.scale_highlow(t.h_range,a,null!=s?s.x:void 0),_=l[0],h=l[1],f=r.get_info(t.xscales,[_,h]),c=o?e:0,u=r.scale_highlow(t.v_range,c,null!=s?s.y:void 0),p=u[0],d=u[1],y=r.get_info(t.yscales,[p,d]),{xrs:f,yrs:y,factor:e}}},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(18),s=t(35);r.View=function(){function t(t){var e;if(null==t&&(t={}),this.removed=new o.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:s.uniqueId(),this.initialize(t)}return n(t.prototype,o.Signalable),t.getters=function(t){var e,r,n;n=[];for(r in t)e=t[r],n.push(Object.defineProperty(this.prototype,r,{get:e}));return n},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.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}}),t.prototype.connect_signals=function(){},t.prototype.disconnect_signals=function(){return o.Signal.disconnectReceiver(this)},t}()},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(14),a=t(24);n=function(){function t(t,e){var r,n,i,o,s;for(null==e&&(e=""),this.obj=t,this.prefix=e,this.cache={},n=t.properties[e+this.do_attr].spec,this.doit=null!==n.value,s=this.attrs,i=0,o=s.length;i<o;i++)r=s[i],this[r]=t.properties[e+r]}return t.prototype.warm_cache=function(t){var e,r,n,i,o,s;for(o=this.attrs,s=[],r=0,n=o.length;r<n;r++)e=o[r],i=this.obj.properties[this.prefix+e],void 0!==i.spec.value?s.push(this.cache[e]=i.spec.value):s.push(this.cache[e+"_array"]=i.array(t));return s},t.prototype.cache_select=function(t,e){var r;return r=this.obj.properties[this.prefix+t],void 0!==r.spec.value?this.cache[t]=r.spec.value:this.cache[t]=this.cache[t+"_array"][e]},t}(),r.Line=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.attrs=Object.keys(s.line()),e.prototype.do_attr="line_color",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}(n),r.Fill=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.attrs=Object.keys(s.fill()),e.prototype.do_attr="fill_color",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}(n),r.Text=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.attrs=Object.keys(s.text()),e.prototype.do_attr="text_color",e.prototype.cache_select=function(t,r){var n;return"font"===t?(n=e.__super__.cache_select.call(this,"text_font_style",r)+" "+e.__super__.cache_select.call(this,"text_font_size",r)+" "+e.__super__.cache_select.call(this,"text_font",r),this.cache.font=n):e.__super__.cache_select.call(this,t,r)},e.prototype.font_value=function(){var t,e,r;return t=this.text_font.value(),e=this.text_font_size.value(),r=this.text_font_style.value(),r+" "+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}(n),r.Visuals=function(){function t(t){var e,n,i,o,s,a,l,u,c;for(a=t.mixins,n=0,i=a.length;n<i;n++)c=a[n],l=c.split(":"),o=l[0],s=null!=(u=l[1])?u:"",e=function(){switch(o){case"line":return r.Line;case"fill":return r.Fill;case"text":return r.Text}}(),this[s+o]=new e(t,s)}return t.prototype.warm_cache=function(t){var e,r,i,s;i=this,s=[];for(e in i)o.call(i,e)&&(r=i[e],r instanceof n?s.push(r.warm_cache(t)):s.push(void 0));return s},t}()},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},a=t(0),l=t(241),u=t(12),c=t(7),_=t(18),h=t(31),p=t(33),d=t(25),f=t(20),y=t(28),m=t(26),v=t(40),g=t(134),b=t(168);n=function(){function t(t){this.document=t,this.session=null,this.subscribed_models=new d.Set}return t.prototype.send_event=function(t){var e;return null!=(e=this.session)?e.send_event(t):void 0},t.prototype.trigger=function(t){var e,r,n,i,o,s;for(o=this.subscribed_models.values,s=[],e=0,r=o.length;e<r;e++)i=o[e],null!==t.model_id&&t.model_id!==i||(n=this.document._all_models[i],s.push(null!=n?n._process_event(t):void 0));return s},t}(),r.DocumentChangedEvent=function(){function t(t){this.document=t}return t}(),r.ModelChangedEvent=function(t){function e(t,r,n,i,o,s){this.document=t,this.model=r,this.attr=n,this.old=i,this.new_=o,this.setter_id=s,e.__super__.constructor.call(this,this.document)}return i(e,t),e.prototype.json=function(t){var e,r,n,i;if("id"===this.attr)throw u.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");r=this.new_,n=this.model.constructor._value_to_json(this.attr,r,this.model),i={},c.HasProps._value_record_references(r,i,!0),this.model.id in i&&this.model!==r&&delete i[this.model.id];for(e in i)t[e]=i[e];return{kind:"ModelChanged",model:this.model.ref(),attr:this.attr,"new":n}},e}(r.DocumentChangedEvent),r.TitleChangedEvent=function(t){function e(t,r,n){this.document=t,this.title=r,this.setter_id=n,e.__super__.constructor.call(this,this.document)}return i(e,t),e.prototype.json=function(t){return{kind:"TitleChanged",title:this.title}},e}(r.DocumentChangedEvent),r.RootAddedEvent=function(t){function e(t,r,n){this.document=t,this.model=r,this.setter_id=n,e.__super__.constructor.call(this,this.document)}return i(e,t),e.prototype.json=function(t){return c.HasProps._value_record_references(this.model,t,!0),{kind:"RootAdded",model:this.model.ref()}},e}(r.DocumentChangedEvent),r.RootRemovedEvent=function(t){function e(t,r,n){this.document=t,this.model=r,this.setter_id=n,e.__super__.constructor.call(this,this.document)}return i(e,t),e.prototype.json=function(t){return{kind:"RootRemoved",model:this.model.ref()}},e}(r.DocumentChangedEvent),r.documents=[],r.DEFAULT_TITLE="Bokeh Application",r.Document=function(){function t(){r.documents.push(this),this._title=r.DEFAULT_TITLE,this._roots=[],this._all_models={},this._all_models_by_name=new d.MultiDict,this._all_models_freeze_count=0,this._callbacks=[],this.event_manager=new n(this),this.idle=new _.Signal(this,"idle"),this._idle_roots=new WeakMap}return Object.defineProperty(t.prototype,"layoutables",{get:function(){var t,e,r,n,i;for(r=this._roots,n=[],t=0,e=r.length;t<e;t++)i=r[t],i instanceof g.LayoutDOM&&n.push(i);return n}}),Object.defineProperty(t.prototype,"is_idle",{get:function(){var t,e,r,n;for(r=this.layoutables,t=0,e=r.length;t<e;t++)if(n=r[t],!this._idle_roots.has(n))return!1;return!0}}),t.prototype.notify_idle=function(t){if(this._idle_roots.set(t,!0),this.is_idle)return 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.destructively_move=function(t){var e,r,n,i,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,n=l.length;e<n;e++)a=l[e],u.push(a);for(this.clear(),r=0,i=u.length;r<i;r++)if(a=u[r],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(u.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,r,n,i,o,s,a,l,u,c,_,h,p,f,m,v,g,b,w,x,k;for(_=new d.Set,v=this._roots,r=0,i=v.length;r<i;r++)f=v[r],_=_.union(f.references());for(p=new d.Set(y.values(this._all_models)),k=p.diff(_),x=_.diff(p),m={},g=_.values,n=0,o=g.length;n<o;n++)l=g[n],m[l.id]=l;for(b=k.values,u=0,s=b.length;u<s;u++)e=b[u],e.detach_document(),c=e.name,null!==c&&this._all_models_by_name.remove_value(c,e);for(w=x.values,h=0,a=w.length;h<a;h++)t=w[h],t.attach_document(this),c=t.name,null!==c&&this._all_models_by_name.add_value(c,t);return this._all_models=m},t.prototype.roots=function(){return this._roots},t.prototype.add_root=function(t,e){if(u.logger.debug("Adding root: "+t),!(s.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 r.RootAddedEvent(this,t,e))}},t.prototype.remove_root=function(t,e){var n;if(n=this._roots.indexOf(t),!(n<0)){this._push_all_models_freeze();try{this._roots.splice(n,1)}finally{this._pop_all_models_freeze()}return this._trigger_on_change(new r.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 r.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(!(s.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,r,n,i,o;for(i=this._callbacks,o=[],r=0,n=i.length;r<n;r++)e=i[r],o.push(e(t));return o},t.prototype._notify_change=function(t,e,n,i,o){return"name"===e&&(this._all_models_by_name.remove_value(n,t),null!==i&&this._all_models_by_name.add_value(i,t)),this._trigger_on_change(new r.ModelChangedEvent(this,t,e,n,i,null!=o?o.setter_id:void 0))},t._references_json=function(t,e){var r,n,i,o,s;for(null==e&&(e=!0),s=[],r=0,n=t.length;r<n;r++)i=t[r],o=i.ref(),o.attributes=i.attributes_as_json(e),delete o.attributes.id,s.push(o);return s},t._instantiate_object=function(t,e,r){var n,i;return n=y.extend({},r,{id:t}),new(i=a.Models(e))(n,{silent:!0,defer_initialization:!0})},t._instantiate_references_json=function(e,r){var n,i,o,s,a,l,u,c;for(c={},i=0,o=e.length;i<o;i++)s=e[i],l=s.id,u=s.type,a=s.attributes,l in r?n=r[l]:(n=t._instantiate_object(l,u,a),"subtype"in s&&n.set_subtype(s.subtype)),c[n.id]=n;return c},t._resolve_refs=function(t,e,r){var n,i,o;return o=function(t){if(h.is_ref(t)){if(t.id in e)return e[t.id];if(t.id in r)return r[t.id];throw new Error("reference "+JSON.stringify(t)+" isn't known (not in Document?)")}return v.isArray(t)?n(t):v.isObject(t)?i(t):t},i=function(t){var e,r,n;r={};for(e in t)n=t[e],r[e]=o(n);return r},n=function(t){var e,r,n,i;for(n=[],e=0,r=t.length;e<r;e++)i=t[e],n.push(o(i));return n},o(t)},t._initialize_references_json=function(e,r,n){var i,o,s,a,l,u,_,h,p;for(h={},s=0,a=e.length;s<a;s++)l=e[s],_=l.id,u=l.attributes,p=!1,o=_ in r?r[_]:(p=!0,n[_]),u=t._resolve_refs(u,r,n),h[o.id]=[o,u,p];return i=function(t,e){var r,n,i,o,s;r={},n=function(e,i){var o,s,a,l,u,_,h,d,f,y;if(e instanceof c.HasProps){if(!(e.id in r)&&e.id in t){r[e.id]=!0,h=t[e.id],y=h[0],s=h[1],p=h[2];for(o in s)a=s[o],n(a,i);return i(e,s,p)}}else{if(v.isArray(e)){for(d=[],u=0,_=e.length;u<_;u++)a=e[u],d.push(n(a,i));return d}if(v.isObject(e)){f=[];for(l in e)a=e[l],f.push(n(a,i));return f}}},o=[];for(i in t)s=t[i],o.push(n(s[0],e));return o},i(h,function(t,e,r){if(r)return t.setv(e,{silent:!0})}),i(h,function(t,e,r){if(r)return t.finalize(e)})},t._event_for_attribute_change=function(t,e,r,n,i){var o,s;return o=n.get_model_by_id(t.id),o.attribute_is_serializable(e)?(s={kind:"ModelChanged",model:{id:t.id,type:t.type},attr:e,"new":r},c.HasProps._json_record_references(n,r,i,!0),s):null},t._events_to_sync_objects=function(e,r,n,i){var o,s,a,l,c,_,h,p,d,y,v,g,b,w,x;for(a=Object.keys(e.attributes),x=Object.keys(r.attributes),b=f.difference(a,x),o=f.difference(x,a),w=f.intersection(a,x),s=[],l=0,h=b.length;l<h;l++)c=b[l],u.logger.warn("Server sent key "+c+" but we don't seem to have it in our JSON");for(_=0,p=o.length;_<p;_++)c=o[_],v=r.attributes[c],s.push(t._event_for_attribute_change(e,c,v,n,i));for(y=0,d=w.length;y<d;y++)c=w[y],g=e.attributes[c],v=r.attributes[c],null===g&&null===v||(null===g||null===v?s.push(t._event_for_attribute_change(e,c,v,n,i)):m.isEqual(g,v)||s.push(t._event_for_attribute_change(e,c,v,n,i)));return s.filter(function(t){return null!==t})},t._compute_patch_since_json=function(e,r){var n,i,o,s,a,l,u,c,_,h,p,d,m,v,g,b,w,x,k,M,S,T;for(w=r.to_json(l=!1),b=function(t){var e,r,n,i,o;for(o={},i=t.roots.references,e=0,r=i.length;e<r;e++)n=i[e],o[n.id]=n;return o},i=b(e),s={},o=[],m=e.roots.root_ids,u=0,_=m.length;u<_;u++)d=m[u],s[d]=i[d],o.push(d);for(x=b(w),M={},k=[],v=w.roots.root_ids,c=0,h=v.length;c<h;c++)d=v[c],M[d]=x[d],k.push(d);if(o.sort(),k.sort(),f.difference(o,k).length>0||f.difference(k,o).length>0)throw new Error("Not implemented: computing add/remove of document roots");T={},n=[],g=r._all_models;for(a in g)p=g[a],a in i&&(S=t._events_to_sync_objects(i[a],x[a],r,T),n=n.concat(S));return{events:n,references:t._references_json(y.values(T),l=!1)}},t.prototype.to_json_string=function(t){return null==t&&(t=!0),JSON.stringify(this.to_json(t))},t.prototype.to_json=function(e){var r,n,i,o,s,a;for(null==e&&(e=!0),s=[],o=this._roots,r=0,n=o.length;r<n;r++)i=o[r],s.push(i.id);return a=y.values(this._all_models),{title:this._title,roots:{root_ids:s,references:t._references_json(a,e)}}},t.from_json_string=function(e){var r;if(null===e||null==e)throw new Error("JSON string is "+typeof e);return r=JSON.parse(e),t.from_json(r)},t.from_json=function(e){var r,n,i,o,s,a,c,_,h,p,d;if(u.logger.debug("Creating Document from JSON"),"object"!=typeof e)throw new Error("JSON object has wrong type "+typeof e);for(s=e.version,n=s.indexOf("+")!==-1||s.indexOf("-")!==-1,d="Library versions: JS ("+l.version+") / Python ("+s+")",n||l.version===s?u.logger.debug(d):(u.logger.warn("JS/Python version mismatch"),u.logger.warn(d)),p=e.roots,h=p.root_ids,_=p.references,c=t._instantiate_references_json(_,{}),t._initialize_references_json(_,{},c),r=new t,i=0,o=h.length;i<o;i++)a=h[i],r.add_root(c[a]);return r.set_title(e.title),r},t.prototype.replace_with_json=function(e){var r;return r=t.from_json(e),r.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 r,n,i,o,s,a;for(s={},i=[],n=0,o=e.length;n<o;n++){if(r=e[n],r.document!==this)throw u.logger.warn("Cannot create a patch using events from a different document, event had ",r.document," we are ",this),new Error("Cannot create a patch using events from a different document");i.push(r.json(s))}return a={events:i,references:t._references_json(y.values(s))}},t.prototype.apply_json_patch_string=function(t){return this.apply_json_patch(JSON.parse(t))},t.prototype.apply_json_patch=function(e,r){var n,i,o,s,a,l,c,_,h,d,f,y,m,v,g,w,x,k,M,S,T,O,P,A,j,E,z,C;for(O=e.references,l=e.events,T=t._instantiate_references_json(O,this._all_models),_=0,d=l.length;_<d;_++)if(a=l[_],"model"in a)if(y=a.model.id,y in this._all_models)T[y]=this._all_models[y];else if(!(y in T))throw u.logger.warn("Got an event for unknown model ",a.model),new Error("event model wasn't known");w={},v={};for(c in T)C=T[c],c in this._all_models?w[c]=C:v[c]=C;for(t._initialize_references_json(O,w,v),P=[],h=0,f=l.length;h<f;h++)switch(a=l[h],a.kind){case"ModelChanged":if(x=a.model.id,!(x in this._all_models))throw new Error("Cannot apply patch to "+x+" which is not in the document");k=this._all_models[x],n=a.attr,m=a.model.type,"data"===n&&"ColumnDataSource"===m?(S=p.decode_column_data(a["new"]),s=S[0],z=S[1],P.push(k.setv({_shapes:z,data:s},{setter_id:r}))):(C=t._resolve_refs(a["new"],w,v),P.push(k.setv((g={},g[""+n]=C,g),{setter_id:r})));break;case"ColumnsStreamed":if(o=a.column_source.id,!(o in this._all_models))throw new Error("Cannot stream to "+o+" which is not in the document");if(i=this._all_models[o],!(i instanceof b.ColumnDataSource))throw new Error("Cannot stream to non-ColumnDataSource");s=a.data,A=a.rollover,P.push(i.stream(s,A));break;case"ColumnsPatched":if(o=a.column_source.id,!(o in this._all_models))throw new Error("Cannot patch "+o+" which is not in the document");if(i=this._all_models[o],!(i instanceof b.ColumnDataSource))throw new Error("Cannot patch non-ColumnDataSource");M=a.patches,P.push(i.patch(M));break;case"RootAdded":j=a.model.id,E=T[j],P.push(this.add_root(E,r));break;case"RootRemoved":j=a.model.id,E=T[j],P.push(this.remove_root(E,r));break;case"TitleChanged":P.push(this.set_title(a.title,r));break;default:throw new Error("Unknown patch event "+JSON.stringify(a))}return P},t}()},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s,a,l,u,c,_,h,p,d=t(0),f=t(1),y=t(12),m=t(45),v=t(4);r.BOKEH_ROOT="bk-root",o=function(t){var e;if(y.logger.debug("handling notebook comms"),e=JSON.parse(t.content.data),"events"in e&&"references"in e)return this.apply_json_patch(e);if("doc"in e)return this.replace_with_json(e.doc);throw new Error("handling notebook comms message: ",t)},u=function(t,e,r){if(t===r.target_name)return r.on_msg(o.bind(e))},s=function(t,e){var r,n,i,s,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");y.logger.info("Registering Jupyter comms for target "+t),r=Jupyter.notebook.kernel.comm_manager,l=function(r){return u(t,e,r)},a=r.comms;for(i in a)s=a[i],s.then(l);try{return r.register_target(t,function(r,n){return y.logger.info("Registering Jupyter comms for target "+t),r.on_msg(o.bind(e))})}catch(c){return n=c,y.logger.warn("Jupyter comms failed to register. push_notebook() will not function. (exception reported: "+n+")")}},n=function(t){var e;return e=new t.default_view({model:t,parent:null}),d.index[t.id]=e,e},a=function(t,e,r){var i,o,s,a,l,u,c;c={},l=function(e){var r;return r=n(e),r.renderTo(t),c[e.id]=r},u=function(e){var r;if(e.id in c)return r=c[e.id],t.removeChild(r.el),delete c[e.id],delete d.index[e.id]},a=e.roots();for(i=0,o=a.length;i<o;i++)s=a[i],l(s);return r&&(window.document.title=e.title()),e.on_change(function(t){return t instanceof m.RootAddedEvent?l(t.model):t instanceof m.RootRemovedEvent?u(t.model):r&&t instanceof m.TitleChangedEvent?window.document.title=t.title:void 0}),c},h=function(t,e,r){var i,o;if(i=r.get_model_by_id(e),null==i)throw new Error("Model "+e+" was not in document "+r);return o=n(i),o.renderTo(t,!0)},r.add_document_static=function(t,e,r){return a(t,e,r)},r.add_document_standalone=function(t,e,r){return null==r&&(r=!1),a(e,t,r)},l={},i=function(t,e,r){var n;if(null==t)throw new Error("Missing websocket_url");return t in l||(l[t]={}),n=l[t],e in n||(n[e]=f.pull_session(t,e,r)),n[e]},c=function(t,e,r,n){var o,s;return o=window.location.search.substr(1),s=i(e,r,o),s.then(function(e){return a(t,e.document,n)},function(t){throw y.logger.error("Failed to load Bokeh session "+r+": "+t),t})},_=function(t,e,r,o){var s,a;return s=window.location.search.substr(1),a=i(e,o,s),a.then(function(e){var i,o;if(i=e.document.get_model_by_id(r),null==i)throw new Error("Did not find model "+r+" in session");return o=n(i),o.renderTo(t,!0)},function(t){throw y.logger.error("Failed to load Bokeh session "+o+": "+t),t})},r.inject_css=function(t){var e;return e=v.link({href:t,rel:"stylesheet",type:"text/css"}),document.body.appendChild(e)},r.inject_raw_css=function(t){var e;return e=v.style({},t),document.body.appendChild(e)},p=function(t,e){var r;return r=t.dataset,null!=r.bokehLogLevel&&r.bokehLogLevel.length>0&&y.set_log_level(r.bokehLogLevel),null!=r.bokehDocId&&r.bokehDocId.length>0&&(e.docid=r.bokehDocId),null!=r.bokehModelId&&r.bokehModelId.length>0&&(e.modelid=r.bokehModelId),null!=r.bokehSessionId&&r.bokehSessionId.length>0&&(e.sessionid=r.bokehSessionId),y.logger.info("Will inject Bokeh script tag with params "+JSON.stringify(e))},r.embed_items=function(t,e,n,i){var o,a,l,u,d,f,g,b,w,x,k,M,S,T,O;M="ws:","https:"===window.location.protocol&&(M="wss:"),x=null!=i?new URL(i):window.location,null!=n?"/"===n&&(n=""):n=x.pathname.replace(/\/+$/,""),O=M+"//"+x.host+n+"/ws",y.logger.debug("embed: computed ws url: "+O),u={};for(l in t)u[l]=m.Document.from_json(t[l]);for(S=[],g=0,w=e.length;g<w;g++){if(b=e[g],null!=b.notebook_comms_target&&s(b.notebook_comms_target,u[l]),f=b.elementid,d=document.getElementById(f),null==d)throw new Error("Error rendering Bokeh model: could not find tag with id: "+f);if(!document.body.contains(d))throw new Error("Error rendering Bokeh model: element with id '"+f+"' must be under <body>");if("SCRIPT"===d.tagName&&(p(d,b),a=v.div({"class":r.BOKEH_ROOT}),v.replaceWith(d,a),o=v.div(),a.appendChild(o),d=o),T=null!=b.use_for_title&&b.use_for_title,k=null,null!=b.modelid)if(null!=b.docid)h(d,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");k=_(d,O,b.modelid,b.sessionid)}else if(null!=b.docid)r.add_document_static(d,u[b.docid],T);else{if(null==b.sessionid)throw new Error("Error rendering Bokeh document to element "+f+": no document ID or session ID specified");k=c(d,O,b.sessionid,T)}null!==k?S.push(k.then(function(t){return console.log("Bokeh items were rendered successfully")},function(t){return console.log("Error rendering Bokeh items ",t)})):S.push(void 0)}return S}},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),t(239);var n=t(241);r.version=n.version;var i=t(46);r.embed=i;var o=t(12);r.logger=o.logger,r.set_log_level=o.set_log_level;var s=t(17);r.settings=s.settings;var a=t(0);r.Models=a.Models,r.index=a.index;var l=t(45);r.documents=l.documents;var u=t(240);r.safely=u.safely},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(7),s=t(13),a=t(40),l=t(28),u=t(12);r.Model=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="Model",e.define({tags:[s.Array,[]],name:[s.String],js_property_callbacks:[s.Any,{}],js_event_callbacks:[s.Any,{}],subscribed_events:[s.Array,[]]}),e.prototype.connect_signals=function(){var t,r,n,i,o,s,a,l,u;e.__super__.connect_signals.call(this),a=this.js_property_callbacks;for(i in a)for(r=a[i],l=i.split(":"),i=l[0],t=null!=(u=l[1])?u:null,o=0,s=r.length;o<s;o++)n=r[o],null!==t?this.connect(this.properties[t][i],function(){return n.execute(this)}):this.connect(this[i],function(){return n.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})},e.prototype._process_event=function(t){var e,r,n,i,o;if(t.is_applicable_to(this)){for(t=t._customize_event(this),o=null!=(i=this.js_event_callbacks[t.event_name])?i:[],r=0,n=o.length;r<n;r++)e=o[r],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 u.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(!l.isEmpty(this.js_event_callbacks)||!l.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(a.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}(o.HasProps)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(10),s=t(13),a=t(160);r.AnnotationView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._get_panel_offset=function(){var t,e;return t=this.model.panel._left.value,e=this.model.panel._bottom.value,{x:t,y:-e}},e.prototype._get_size=function(){return-1},e}(a.RendererView),r.Annotation=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="Annotation",e.prototype.default_view=r.AnnotationView,e.define({plot:[s.Instance]}),e.override({level:"annotation"}),e.prototype.add_panel=function(t){return this.panel=new o.SidePanel({side:t}),this.panel.attach_document(this.document),this.level="overlay"},e}(a.Renderer)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(49),s=t(51),a=t(168),l=t(13),u=t(27);r.ArrowView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),null==this.model.source&&(this.model.source=new a.ColumnDataSource),this.canvas=this.plot_model.canvas,this.set_data(this.model.source)},e.prototype.connect_signals=function(){return e.__super__.connect_signals.call(this),this.connect(this.model.change,function(t){return function(){return t.plot_view.request_render()}}(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(t){return e.__super__.set_data.call(this,t),this.visuals.warm_cache(t),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,r,n;return e="data"===this.model.start_units?this.plot_view.map_to_screen(this._x_start,this._y_start,r=this.model.x_range_name,n=this.model.y_range_name):[this.canvas.v_vx_to_sx(this._x_start),this.canvas.v_vy_to_sy(this._y_start)],t="data"===this.model.end_units?this.plot_view.map_to_screen(this._x_end,this._y_end,r=this.model.x_range_name,n=this.model.y_range_name):[this.canvas.v_vx_to_sx(this._x_end),this.canvas.v_vy_to_sy(this._y_end)],[e,t]},e.prototype.render=function(){var t,e;if(this.model.visible)return t=this.plot_view.canvas_view.ctx,t.save(),e=this._map_data(),this.start=e[0],this.end=e[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(),t.rect(0,0,this.canvas._width.value,this.canvas._height.value),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()},e.prototype._arrow_body=function(t){var e,r,n,i;if(this.visuals.line.doit){
for(i=[],e=r=0,n=this._x_start.length;0<=n?r<n:r>n;e=0<=n?++r:--r)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]),i.push(t.stroke());return i}},e.prototype._arrow_head=function(t,e,r,n,i){var o,s,a,l,c;for(c=[],s=a=0,l=this._x_start.length;0<=l?a<l:a>l;s=0<=l?++a:--a)o=Math.PI/2+u.atan2([n[0][s],n[1][s]],[i[0][s],i[1][s]]),t.save(),t.translate(i[0][s],i[1][s]),t.rotate(o),"render"===e?r.render(t):"clip"===e&&r.clip(t),c.push(t.restore());return c},e}(o.AnnotationView),r.Arrow=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.ArrowView,e.prototype.type="Arrow",e.mixins(["line"]),e.define({x_start:[l.NumberSpec],y_start:[l.NumberSpec],start_units:[l.String,"data"],start:[l.Instance,null],x_end:[l.NumberSpec],y_end:[l.NumberSpec],end_units:[l.String,"data"],end:[l.Instance,new s.OpenHead({})],source:[l.Instance],x_range_name:[l.String,"default"],y_range_name:[l.String,"default"]}),e}(o.Annotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(49),s=t(44),a=t(13);r.ArrowHead=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="ArrowHead",e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.visuals=new s.Visuals(this)},e.prototype.render=function(t,e){return null},e.prototype.clip=function(t,e){return null},e}(o.Annotation),r.OpenHead=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="OpenHead",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.mixins(["line"]),e.define({size:[a.Number,25]}),e}(r.ArrowHead),r.NormalHead=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="NormalHead",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.mixins(["line","fill"]),e.define({size:[a.Number,25]}),e.override({fill_color:"black"}),e}(r.ArrowHead),r.VeeHead=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="VeeHead",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.mixins(["line","fill"]),e.define({size:[a.Number,25]}),e.override({fill_color:"black"}),e}(r.ArrowHead),r.TeeHead=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="TeeHead",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.mixins(["line"]),e.define({size:[a.Number,25]}),e}(r.ArrowHead)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(49),s=t(168),a=t(13);r.BandView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.set_data(this.model.source)},e.prototype.connect_signals=function(){return e.__super__.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(t){return e.__super__.set_data.call(this,t),this.visuals.warm_cache(t),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,r,n,i,o,s,a,l,u,c,_;return c=this.plot_view.frame.xscales[this.model.x_range_name],_=this.plot_view.frame.yscales[this.model.y_range_name],l="height"===this.model.dimension?_:c,o="height"===this.model.dimension?c:_,r="data"===this.model.lower.units?l.v_compute(this._lower):this._lower,i="data"===this.model.upper.units?l.v_compute(this._upper):this._upper,t="data"===this.model.base.units?o.v_compute(this._base):this._base,u=this.model._normals(),s=u[0],a=u[1],e=[r,t],n=[i,t],this._lower_sx=this.plot_model.canvas.v_vx_to_sx(e[s]),this._lower_sy=this.plot_model.canvas.v_vy_to_sy(e[a]),this._upper_sx=this.plot_model.canvas.v_vx_to_sx(n[s]),this._upper_sy=this.plot_model.canvas.v_vy_to_sy(n[a])},e.prototype.render=function(){var t,e,r,n,i,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=r=0,s=this._lower_sx.length;0<=s?r<s:r>s;e=0<=s?++r:--r)t.lineTo(this._lower_sx[e],this._lower_sy[e]);for(e=n=a=this._upper_sx.length-1;a<=0?n<=0:n>=0;e=a<=0?++n:--n)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=i=0,l=this._lower_sx.length;0<=l?i<l:i>l;e=0<=l?++i:--i)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}(o.AnnotationView),r.Band=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.BandView,e.prototype.type="Band",e.mixins(["line","fill"]),e.define({lower:[a.DistanceSpec],upper:[a.DistanceSpec],base:[a.DistanceSpec],dimension:[a.Dimension,"height"],source:[a.Instance,function(){return new s.ColumnDataSource}],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]}),e.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3}),e.prototype._normals=function(){var t,e,r,n;return"height"===this.dimension?(r=[1,0],t=r[0],e=r[1]):(n=[0,1],t=n[0],e=n[1]),[t,e]},e}(o.Annotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(49),s=t(18),a=t(4),l=t(13),u=t(40);r.BoxAnnotationView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.plot_view.canvas_overlays.appendChild(this.el),this.el.classList.add("bk-shading"),a.hide(this.el)},e.prototype.connect_signals=function(){return e.__super__.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(t){return function(){return t.plot_view.request_render()}}(this)),this.connect(this.model.data_update,function(t){return function(){return t.plot_view.request_render()}}(this)))},e.prototype.render=function(){var t,e,r,n,i,o,s,l;if(this.model.visible||"css"!==this.model.render_mode||a.hide(this.el),this.model.visible)return null==this.model.left&&null==this.model.right&&null==this.model.top&&null==this.model.bottom?(a.hide(this.el),null):(e=this.plot_model.frame,t=this.plot_model.canvas,s=this.plot_view.frame.xscales[this.model.x_range_name],l=this.plot_view.frame.yscales[this.model.y_range_name],n=t.vx_to_sx(this._calc_dim(this.model.left,this.model.left_units,s,e.h_range.start)),i=t.vx_to_sx(this._calc_dim(this.model.right,this.model.right_units,s,e.h_range.end)),r=t.vy_to_sy(this._calc_dim(this.model.bottom,this.model.bottom_units,l,e.v_range.start)),o=t.vy_to_sy(this._calc_dim(this.model.top,this.model.top_units,l,e.v_range.end)),"css"===this.model.render_mode?this._css_box(n,i,r,o):this._canvas_box(n,i,r,o))},e.prototype._css_box=function(t,e,r,n){var i,o,s;return s=Math.abs(e-t),o=Math.abs(r-n),this.el.style.left=t+"px",this.el.style.width=s+"px",this.el.style.top=n+"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,i=this.model.line_dash,u.isArray(i)&&(i=i.length<2?"solid":"dashed"),u.isString(i)&&(this.el.style.borderStyle=i),a.show(this.el)},e.prototype._canvas_box=function(t,e,r,n){var i;return i=this.plot_view.canvas_view.ctx,i.save(),i.beginPath(),i.rect(t,n,e-t,r-n),this.visuals.fill.set_value(i),i.fill(),this.visuals.line.set_value(i),i.stroke(),i.restore()},e.prototype._calc_dim=function(t,e,r,n){var i;return i=null!=t?"data"===e?r.compute(t):t:n},e}(o.AnnotationView),r.BoxAnnotation=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.BoxAnnotationView,e.prototype.type="BoxAnnotation",e.mixins(["line","fill"]),e.define({render_mode:[l.RenderMode,"canvas"],x_range_name:[l.String,"default"],y_range_name:[l.String,"default"],top:[l.Number,null],top_units:[l.SpatialUnits,"data"],bottom:[l.Number,null],bottom_units:[l.SpatialUnits,"data"],left:[l.Number,null],left_units:[l.SpatialUnits,"data"],right:[l.Number,null],right_units:[l.SpatialUnits,"data"]}),e.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.data_update=new s.Signal(this,"data_update")},e.prototype.update=function(t){var e,r,n,i;return r=t.left,n=t.right,i=t.top,e=t.bottom,this.setv({left:r,right:n,top:i,bottom:e},{silent:!0}),this.data_update.emit()},e}(o.Annotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s=function(t,e){function r(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty,l=t(49),u=t(175),c=t(88),_=t(141),h=t(163),p=t(164),d=t(155),f=t(13),y=t(38),m=t(20),v=t(28),g=t(40);o=25,i=.3,n=.8,r.ColorBarView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this._set_canvas_image()},e.prototype.connect_signals=function(){if(e.__super__.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(t){return function(){return t.plot_view.request_render()}}(this)),this.connect(this.model.ticker.change,function(t){return function(){return t.plot_view.request_render()}}(this)),this.connect(this.model.formatter.change,function(t){return function(){return t.plot_view.request_render()}}(this)),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_panel_offset=function(){var t,e;return t=this.model.panel._left.value,e=this.model.panel._top.value,{x:t,y:-e}},e.prototype._get_size=function(){var t,e;if(null!=this.model.color_mapper)return 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,r,n,i,o,s,a,l,u,c,h,p;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":l=[1,a.length],p=l[0],i=l[1];break;case"horizontal":u=[a.length,1],p=u[0],i=u[1]}return r=document.createElement("canvas"),c=[p,i],r.width=c[0],r.height=c[1],o=r.getContext("2d"),s=o.getImageData(0,0,p,i),n=new _.LinearColorMapper({palette:a}),t=n.v_map_screen(function(){h=[];for(var t=0,e=a.length;0<=e?t<e:t>e;0<=e?t++:t--)h.push(t);return h}.apply(this)),e=new Uint8Array(t),s.data.set(e),o.putImageData(s,0,0),this.image=r}},e.prototype.compute_legend_dimensions=function(){var t,e,r,n,i,o,s,a,l,u;switch(t=this.model._computed_image_dimensions(),a=[t.height,t.width],e=a[0],r=a[1],n=this._get_label_extent(),u=this.model._title_extent(),l=this.model._tick_extent(),s=this.model.padding,this.model.orientation){case"vertical":i=e+u+2*s,o=r+l+n+2*s;break;case"horizontal":i=e+u+l+n+2*s,o=r+2*s}return{height:i,width:o}},e.prototype.compute_legend_location=function(){var t,e,r,n,i,o,s,a,l,u,c,_;if(e=this.compute_legend_dimensions(),s=[e.height,e.width],r=s[0],i=s[1],n=this.model.margin,o=this.model.location,t=this.plot_view.frame.h_range,u=this.plot_view.frame.v_range,g.isString(o))switch(o){case"top_left":c=t.start+n,_=u.end-n;break;case"top_center":c=(t.end+t.start)/2-i/2,_=u.end-n;break;case"top_right":c=t.end-n-i,_=u.end-n;break;case"center_right":c=t.end-n-i,_=(u.end+u.start)/2+r/2;break;case"bottom_right":c=t.end-n-i,_=u.start+n+r;break;case"bottom_center":c=(t.end+t.start)/2-i/2,_=u.start+n+r;break;case"bottom_left":c=t.start+n,_=u.start+n+r;break;case"center_left":c=t.start+n,_=(u.end+u.start)/2+r/2;break;case"center":c=(t.end+t.start)/2-i/2,_=(u.end+u.start)/2+r/2}else g.isArray(o)&&2===o.length&&(c=o[0],_=o[1]);return a=this.plot_view.canvas.vx_to_sx(c),l=this.plot_view.canvas.vy_to_sy(_),{sx:a,sy:l}},e.prototype.render=function(){var t,e,r,n,i,o;if(this.model.visible&&null!=this.model.color_mapper)return t=this.plot_view.canvas_view.ctx,t.save(),null!=this.model.panel&&(i=this._get_panel_offset(),t.translate(i.x,i.y),e=this._get_frame_offset(),t.translate(e.x,e.y)),n=this.compute_legend_location(),t.translate(n.sx,n.sy),this._draw_bbox(t),r=this._get_image_offset(),t.translate(r.x,r.y),this._draw_image(t),null!=this.model.color_mapper.low&&null!=this.model.color_mapper.high&&(o=this.model.tick_info(),this._draw_major_ticks(t,o),this._draw_minor_ticks(t,o),this._draw_major_labels(t,o)),this.model.title&&this._draw_title(t),t.restore()},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 r,n,i,o,s,a,l,u,c,_,h,p,d,f,y;if(this.visuals.major_tick_line.doit){for(a=this.model._normals(),o=a[0],s=a[1],n=this.model._computed_image_dimensions(),l=[n.width*o,n.height*s],f=l[0],y=l[1],u=e.coords.major,_=u[0],h=u[1],p=this.model.major_tick_in,d=this.model.major_tick_out,t.save(),t.translate(f,y),this.visuals.major_tick_line.set_value(t),r=i=0,c=_.length;0<=c?i<c:i>c;r=0<=c?++i:--i)t.beginPath(),t.moveTo(Math.round(_[r]+o*d),Math.round(h[r]+s*d)),t.lineTo(Math.round(_[r]-o*p),Math.round(h[r]-s*p)),t.stroke();return t.restore()}},e.prototype._draw_minor_ticks=function(t,e){var r,n,i,o,s,a,l,u,c,_,h,p,d,f,y;if(this.visuals.minor_tick_line.doit){for(a=this.model._normals(),o=a[0],s=a[1],n=this.model._computed_image_dimensions(),l=[n.width*o,n.height*s],f=l[0],y=l[1],u=e.coords.minor,_=u[0],h=u[1],p=this.model.minor_tick_in,d=this.model.minor_tick_out,t.save(),t.translate(f,y),this.visuals.minor_tick_line.set_value(t),r=i=0,c=_.length;0<=c?i<c:i>c;r=0<=c?++i:--i)t.beginPath(),t.moveTo(Math.round(_[r]+o*d),Math.round(h[r]+s*d)),t.lineTo(Math.round(_[r]-o*p),Math.round(h[r]-s*p)),t.stroke();return t.restore()}},e.prototype._draw_major_labels=function(t,e){var r,n,i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g;if(this.visuals.major_label_text.doit){for(l=this.model._normals(),s=l[0],a=l[1],i=this.model._computed_image_dimensions(),u=[i.width*s,i.height*a],y=u[0],v=u[1],p=this.model.label_standoff+this.model._tick_extent(),c=[p*s,p*a],m=c[0],g=c[1],_=e.coords.major,d=_[0],f=_[1],r=e.labels.major,this.visuals.major_label_text.set_value(t),t.save(),t.translate(y+m,v+g),n=o=0,h=d.length;0<=h?o<h:o>h;n=0<=h?++o:--o)t.fillText(r[n],Math.round(d[n]+s*this.model.label_standoff),Math.round(f[n]+a*this.model.label_standoff));return t.restore()}},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,r,n;if(n=this.model.tick_info().labels.major,null==this.model.color_mapper.low||null==this.model.color_mapper.high||v.isEmpty(n))r=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":r=m.max(function(){var r,i,o;for(o=[],r=0,i=n.length;r<i;r++)e=n[r],o.push(t.measureText(e.toString()).width);return o}());break;case"horizontal":r=y.get_text_height(this.visuals.major_label_text.font_value()).height}r+=this.model.label_standoff,t.restore()}return r},e.prototype._get_frame_offset=function(){var t,e,r,n,i;switch(r=[0,0],n=r[0],i=r[1],e=this.model.panel,t=this.plot_view.frame,e.side){case"left":case"right":i=Math.abs(e._top.value-t._top.value);break;case"above":case"below":n=Math.abs(t._left.value)}return{x:n,y:i}},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}(l.AnnotationView),r.ColorBar=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.default_view=r.ColorBarView,e.prototype.type="ColorBar",e.mixins(["text:major_label_","text:title_","line:major_tick_","line:minor_tick_","line:border_","line:bar_","fill:background_"]),e.define({location:[f.Any,"top_right"],orientation:[f.Orientation,"vertical"],title:[f.String],title_standoff:[f.Number,2],height:[f.Any,"auto"],width:[f.Any,"auto"],scale_alpha:[f.Number,1],ticker:[f.Instance,function(){return new u.BasicTicker}],formatter:[f.Instance,function(){return new c.BasicTickFormatter}],major_label_overrides:[f.Any,{}],color_mapper:[f.Instance],label_standoff:[f.Number,5],margin:[f.Number,30],padding:[f.Number,10],major_tick_in:[f.Number,5],major_tick_out:[f.Number,0],minor_tick_in:[f.Number,0],minor_tick_out:[f.Number,0]}),e.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"}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r)},e.prototype._normals=function(){var t,e,r,n;return"vertical"===this.orientation?(r=[1,0],t=r[0],e=r[1]):(n=[0,1],t=n[0],e=n[1]),[t,e]},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?y.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,r,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?r=t-2*this.padding-s:(r=m.max([this.color_mapper.palette.length*o,t*i]),r=m.min([r,t*n-2*this.padding-s])):r=this.height,a="auto"===this.width?o:this.width;break;case"horizontal":r="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*i]),a=m.min([a,e*n-2*this.padding])):a=this.width}return{height:r,width:a}},e.prototype._tick_coordinate_scale=function(t){var e,r;switch(e={source_range:new d.Range1d({start:this.color_mapper.low,end:this.color_mapper.high}),target_range:new d.Range1d({start:0,end:t})},this.color_mapper.type){case"LinearColorMapper":r=new h.LinearScale(e);break;case"LogColorMapper":r=new p.LogScale(e)}return r},e.prototype._format_major_labels=function(t,e){var r,n,i,o,s;for(o=t,r=this.formatter.doFormat(o,null),n=i=0,s=e.length;0<=s?i<s:i>s;n=0<=s?++i:--i)e[n]in this.major_label_overrides&&(r[n]=this.major_label_overrides[e[n]]);return r},e.prototype.tick_info=function(){var t,e,r,n,i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w;switch(o=this._computed_image_dimensions(),this.orientation){case"vertical":g=o.height;break;case"horizontal":g=o.width}for(v=this._tick_coordinate_scale(g),d=this._normals(),n=d[0],s=d[1],f=[this.color_mapper.low,this.color_mapper.high],b=f[0],r=f[1],w=this.ticker.get_ticks(b,r,null,null,this.ticker.desired_num_ticks),e={major:[[],[]],minor:[[],[]]},_=w.major,p=w.minor,c=e.major,h=e.minor,i=a=0,y=_.length;0<=y?a<y:a>y;i=0<=y?++a:--a)_[i]<b||_[i]>r||(c[n].push(_[i]),c[s].push(0));for(i=l=0,m=p.length;0<=m?l<m:l>m;i=0<=m?++l:--l)p[i]<b||p[i]>r||(h[n].push(p[i]),h[s].push(0));return u={major:this._format_major_labels(c[n].slice(0),_)},c[n]=v.v_compute(c[n]),h[n]=v.v_compute(h[n]),"vertical"===this.orientation&&(c[n]=new Float64Array(function(){var e,r,i,o;for(i=c[n],o=[],r=0,e=i.length;r<e;r++)t=i[r],o.push(g-t);return o}()),h[n]=new Float64Array(function(){var e,r,i,o;for(i=h[n],o=[],r=0,e=i.length;r<e;r++)t=i[r],o.push(g-t);return o}())),{ticks:w,coords:e,labels:u}},e}(l.Annotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(49);r.Annotation=n.Annotation;var i=t(50);r.Arrow=i.Arrow;var o=t(51);r.ArrowHead=o.ArrowHead;var s=t(51);r.OpenHead=s.OpenHead;var a=t(51);r.NormalHead=a.NormalHead;var l=t(51);r.TeeHead=l.TeeHead;var u=t(51);r.VeeHead=u.VeeHead;var c=t(52);r.Band=c.Band;var _=t(53);r.BoxAnnotation=_.BoxAnnotation;var h=t(54);r.ColorBar=h.ColorBar;var p=t(56);r.Label=p.Label;var d=t(57);r.LabelSet=d.LabelSet;var f=t(58);r.Legend=f.Legend;var y=t(59);r.LegendItem=y.LegendItem;var m=t(60);r.PolyAnnotation=m.PolyAnnotation;var v=t(61);r.Span=v.Span;var g=t(62);r.TextAnnotation=g.TextAnnotation;var b=t(63);r.Title=b.Title;var w=t(64);r.Tooltip=w.Tooltip;var x=t(65);r.Whisker=x.Whisker},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(62),s=t(4),a=t(13);r.LabelView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.canvas=this.plot_model.canvas,this.visuals.warm_cache(null)},e.prototype._get_size=function(){var t,e,r;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:r=t.measureText(this.model.text).width},e.prototype.render=function(){var t,e,r,n,i,o,a,l,u,c;if(this.model.visible||"css"!==this.model.render_mode||s.hide(this.el),this.model.visible){switch(u=this.plot_view.frame.xscales[this.model.x_range_name],c=this.plot_view.frame.yscales[this.model.y_range_name],e=this.plot_view.canvas_view.ctx,this.model.angle_units){case"rad":t=-1*this.model.angle;break;case"deg":t=-1*this.model.angle*Math.PI/180}return r=null!=(n=this.model.panel)?n:this.plot_view.frame,a="data"===this.model.x_units?u.compute(this.model.x):this.model.x+r._left.value,l="data"===this.model.y_units?c.compute(this.model.y):this.model.y+r._bottom.value,i=this.canvas.vx_to_sx(a),o=this.canvas.vy_to_sy(l),"canvas"===this.model.render_mode?this._canvas_text(e,this.model.text,i+this.model.x_offset,o-this.model.y_offset,t):this._css_text(e,this.model.text,i+this.model.x_offset,o-this.model.y_offset,t)}},e}(o.TextAnnotationView),r.Label=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.LabelView,e.prototype.type="Label",e.mixins(["text","line:border_","fill:background_"]),e.define({x:[a.Number],x_units:[a.SpatialUnits,"data"],y:[a.Number],y_units:[a.SpatialUnits,"data"],text:[a.String],angle:[a.Angle,0],angle_units:[a.AngleUnits,"rad"],x_offset:[a.Number,0],y_offset:[a.Number,0],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"],render_mode:[a.RenderMode,"canvas"]}),e.override({background_fill_color:null,border_line_color:null}),e}(o.TextAnnotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(62),s=t(168),a=t(4),l=t(13),u=t(40);r.LabelSetView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){var r,n,i,o;if(e.__super__.initialize.call(this,t),this.set_data(this.model.source),"css"===this.model.render_mode){for(o=[],r=n=0,i=this._text.length;0<=i?n<i:n>i;r=0<=i?++n:--n)this.title_div=a.div({"class":"bk-annotation-child",style:{display:"none"}}),o.push(this.el.appendChild(this.title_div));return o}},e.prototype.connect_signals=function(){return e.__super__.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(t){return e.__super__.set_data.call(this,t),this.visuals.warm_cache(t)},e.prototype._map_data=function(){var t,e,r,n,i,o;return i=this.plot_view.frame.xscales[this.model.x_range_name],o=this.plot_view.frame.yscales[this.model.y_range_name],r="data"===this.model.x_units?i.v_compute(this._x):this._x.slice(0),t=this.canvas.v_vx_to_sx(r),n="data"===this.model.y_units?o.v_compute(this._y):this._y.slice(0),e=this.canvas.v_vy_to_sy(n),[t,e]},e.prototype.render=function(){var t,e,r,n,i,o,s,l,u,c,_;if(this.model.visible||"css"!==this.model.render_mode||a.hide(this.el),this.model.visible){if(t=this.plot_view.canvas_view.ctx,i=this._map_data(),c=i[0],_=i[1],"canvas"===this.model.render_mode){for(l=[],e=r=0,o=this._text.length;0<=o?r<o:r>o;e=0<=o?++r:--r)l.push(this._v_canvas_text(t,e,this._text[e],c[e]+this._x_offset[e],_[e]-this._y_offset[e],this._angle[e]));return l}for(u=[],e=n=0,s=this._text.length;0<=s?n<s:n>s;e=0<=s?++n:--n)u.push(this._v_css_text(t,e,this._text[e],c[e]+this._x_offset[e],_[e]-this._y_offset[e],this._angle[e]));return u}},e.prototype._get_size=function(){var t,e,r,n;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),r=this.model.panel.side,"above"===r||"below"===r?e=t.measureText(this._text[0]).ascent:"left"===r||"right"===r?n=t.measureText(this._text[0]).width:void 0},e.prototype._v_canvas_text=function(t,e,r,n,i,o){var s;return this.visuals.text.set_vectorize(t,e),s=this._calculate_bounding_box_dimensions(t,r),t.save(),t.beginPath(),t.translate(n,i),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(r,0,0)),t.restore()},e.prototype._v_css_text=function(t,e,r,n,i,o){var s,l,c,_;return l=this.el.childNodes[e],l.textContent=r,this.visuals.text.set_vectorize(t,e),s=this._calculate_bounding_box_dimensions(t,r),c=this.visuals.border_line.line_dash.value(),u.isArray(c)&&(_=c.length<2?"solid":"dashed"),u.isString(c)&&(_=c),this.visuals.border_line.set_vectorize(t,e),this.visuals.background_fill.set_vectorize(t,e),l.style.position="absolute",l.style.left=n+s[0]+"px",l.style.top=i+s[1]+"px",l.style.color=""+this.visuals.text.text_color.value(),l.style.opacity=""+this.visuals.text.text_alpha.value(),l.style.font=""+this.visuals.text.font_value(),l.style.lineHeight="normal",o&&(l.style.transform="rotate("+o+"rad)"),this.visuals.background_fill.doit&&(l.style.backgroundColor=""+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(l.style.borderStyle=""+_,l.style.borderWidth=this.visuals.border_line.line_width.value()+"px",l.style.borderColor=""+this.visuals.border_line.color_value()),a.show(l)},e}(o.TextAnnotationView),r.LabelSet=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.LabelSetView,e.prototype.type="Label",e.mixins(["text","line:border_","fill:background_"]),e.define({x:[l.NumberSpec],y:[l.NumberSpec],x_units:[l.SpatialUnits,"data"],y_units:[l.SpatialUnits,"data"],text:[l.StringSpec,{field:"text"}],angle:[l.AngleSpec,0],x_offset:[l.NumberSpec,{value:0}],y_offset:[l.NumberSpec,{value:0}],source:[l.Instance,function(){return new s.ColumnDataSource}],x_range_name:[l.String,"default"],y_range_name:[l.String,"default"],render_mode:[l.RenderMode,"canvas"]}),e.override({background_fill_color:null,border_line_color:null}),e}(o.TextAnnotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){
function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(49),s=t(13),a=t(38),l=t(21),u=t(20),c=t(28),_=t(40);r.LegendView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t)},e.prototype.connect_signals=function(){return e.__super__.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(t){return function(){return t.plot_view.request_render()}}(this))},e.prototype.compute_legend_bbox=function(){var t,e,r,n,i,o,s,l,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A;for(d=this.model.get_legend_names(),e=this.model.glyph_height,r=this.model.glyph_width,o=this.model.label_height,l=this.model.label_width,this.max_label_height=u.max([a.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={},i=0,v=d.length;i<v;i++)w=d[i],this.text_widths[w]=u.max([t.measureText(w).width,l]);if(t.restore(),b=u.max(c.values(this.text_widths)),p=this.model.margin,f=this.model.padding,y=this.model.spacing,s=this.model.label_standoff,"vertical"===this.model.orientation)h=d.length*this.max_label_height+(d.length-1)*y+2*f,m=b+r+s+2*f;else{m=2*f+(d.length-1)*y,k=this.text_widths;for(w in k)O=k[w],m+=u.max([O,l])+r+s;h=this.max_label_height+2*f}if(x=null!=(M=this.model.panel)?M:this.plot_view.frame,n={start:x._left.value,end:x._right.value},T={start:x._bottom.value,end:x._top.value},g=this.model.location,_.isString(g))switch(g){case"top_left":P=n.start+p,A=T.end-p;break;case"top_center":P=(n.end+n.start)/2-m/2,A=T.end-p;break;case"top_right":P=n.end-p-m,A=T.end-p;break;case"center_right":P=n.end-p-m,A=(T.end+T.start)/2+h/2;break;case"bottom_right":P=n.end-p-m,A=T.start+p+h;break;case"bottom_center":P=(n.end+n.start)/2-m/2,A=T.start+p+h;break;case"bottom_left":P=n.start+p,A=T.start+p+h;break;case"center_left":P=n.start+p,A=(T.end+T.start)/2+h/2;break;case"center":P=(n.end+n.start)/2-m/2,A=(T.end+T.start)/2+h/2}else _.isArray(g)&&2===g.length&&(P=g[0],A=g[1],"left"===(S=x.side)||"right"===S||"above"===S||"below"===S?(P+=n.start,A+=T.end):(P+=n.start,A+=T.start));return P=this.plot_view.canvas.vx_to_sx(P),A=this.plot_view.canvas.vy_to_sy(A),{x:P,y:A,width:m,height:h}},e.prototype.bbox=function(){var t,e,r,n,i;return e=this.compute_legend_bbox(),n=e.x,i=e.y,r=e.width,t=e.height,new l.BBox({x0:n,y0:i,x1:n+r,y1:i+t})},e.prototype.on_hit=function(t,e){var r,n,i,o,s,a,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E,z,C,N,D;for(i=this.model.glyph_height,o=this.model.glyph_width,m=this.model.spacing,d=this.model.label_standoff,z=D=this.model.padding,y=this.compute_legend_bbox(),P="vertical"===this.model.orientation,k=this.model.items,a=0,v=k.length;a<v;a++)for(u=k[a],f=u.get_labels_list_from_label_prop(),n=u.get_field_from_label_prop(),c=0,g=f.length;c<g;c++){if(p=f[c],j=y.x+z,C=y.y+D,E=j+o,N=C+i,P?(M=[y.width-2*this.model.padding,this.max_label_height],A=M[0],s=M[1]):(S=[this.text_widths[p]+o+d,this.max_label_height],A=S[0],s=S[1]),r=new l.BBox({x0:j,y0:C,x1:j+A,y1:C+s}),r.contains(t,e)){switch(this.model.click_policy){case"hide":for(T=u.renderers,_=0,b=T.length;_<b;_++)x=T[_],x.visible=!x.visible;break;case"mute":for(O=u.renderers,h=0,w=O.length;h<w;h++)x=O[h],x.muted=!x.muted}return!0}P?D+=this.max_label_height+m:z+=this.text_widths[p]+o+d+m}return!1},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 r,n,i,o,s,a,l,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E,z;for(i=this.model.glyph_height,o=this.model.glyph_width,f=this.model.spacing,p=this.model.label_standoff,A=z=this.model.padding,M="vertical"===this.model.orientation,b=this.model.items,a=0,y=b.length;a<y;a++)if(l=b[a],d=l.get_labels_list_from_label_prop(),n=l.get_field_from_label_prop(),0!==d.length)for(r=function(){switch(this.model.click_policy){case"none":return!0;case"hide":return u.all(l.renderers,function(t){return t.visible});case"mute":return u.all(l.renderers,function(t){return!t.muted})}}.call(this),c=0,m=d.length;c<m;c++){for(h=d[c],O=e.x+A,j=e.y+z,P=O+o,E=j+i,M?z+=this.max_label_height+f:A+=this.text_widths[h]+o+p+f,this.visuals.label_text.set_value(t),t.fillText(h,P+p,j+this.max_label_height/2),w=l.renderers,_=0,v=w.length;_<v;_++)g=w[_],S=this.plot_view.renderer_views[g.id],S.draw_legend(t,O,P,j,E,n,h);r||(M?(x=[e.width-2*this.model.padding,this.max_label_height],T=x[0],s=x[1]):(k=[this.text_widths[h]+o+p,this.max_label_height],T=k[0],s=k[1]),t.beginPath(),t.rect(O,j,T,s),this.visuals.inactive_fill.set_value(t),t.fill())}return null},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:"left"===e||"right"===e?t.width:void 0},e}(o.AnnotationView),r.Legend=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.LegendView,e.prototype.type="Legend",e.prototype.cursor=function(){return"none"===this.click_policy?null:"pointer"},e.prototype.get_legend_names=function(){var t,e,r,n,i,o;for(n=[],o=this.items,t=0,i=o.length;t<i;t++)e=o[t],r=e.get_labels_list_from_label_prop(),n=n.concat(r);return n},e.mixins(["text:label_","fill:inactive_","line:border_","fill:background_"]),e.define({orientation:[s.Orientation,"vertical"],location:[s.Any,"top_right"],label_standoff:[s.Number,5],glyph_height:[s.Number,20],glyph_width:[s.Number,20],label_height:[s.Number,20],label_width:[s.Number,20],margin:[s.Number,10],padding:[s.Number,10],spacing:[s.Number,3],items:[s.Array,[]],click_policy:[s.Any,"none"]}),e.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:.9,label_text_font_size:"10pt",label_text_baseline:"middle"}),e}(o.Annotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){return function(){return t.apply(e,arguments)}},i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},a=t(48),l=t(13),u=t(12),c=t(20),_=t(168);r.LegendItem=function(t){function e(){return this.get_labels_list_from_label_prop=n(this.get_labels_list_from_label_prop,this),this.get_field_from_label_prop=n(this.get_field_from_label_prop,this),e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="LegendItem",e.prototype._check_data_sources_on_renderers=function(){var t,e,r,n,i,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(i=this.renderers,e=0,r=i.length;e<r;e++)if(n=i[e],n.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&&s.call(e.columns(),t)<0)return!1}return!0},e.prototype.initialize=function(t,r){var n,i;if(e.__super__.initialize.call(this,t,r),n=this._check_data_sources_on_renderers(),n||u.logger.error("Non matching data sources on legend item renderers"),i=this._check_field_label_on_data_source(),!i)return u.logger.error("Bad column name on label: "+this.label)},e.define({label:[l.StringSpec,null],renderers:[l.Array,[]]}),e.prototype.get_field_from_label_prop=function(){if(null!=this.label&&null!=this.label.field)return this.label.field},e.prototype.get_labels_list_from_label_prop=function(){var t,e,r;if(null!=this.label&&null!=this.label.value)return[this.label.value];if(e=this.get_field_from_label_prop(),null!=e){if(!this.renderers[0]||null==this.renderers[0].data_source)return["No source found"];if(r=this.renderers[0].data_source,r instanceof _.ColumnDataSource)return t=r.get_column(e),null!=t?c.uniq(t):["Invalid field"]}return[]},e}(a.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(49),s=t(18),a=t(13);r.PolyAnnotationView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.connect_signals=function(){return e.__super__.connect_signals.call(this),this.connect(this.model.change,function(t){return function(){return t.plot_view.request_render()}}(this)),this.connect(this.model.data_update,function(t){return function(){return t.plot_view.request_render()}}(this))},e.prototype.render=function(t){var e,r,n,i,o,s,a,l,u,c;if(this.model.visible){if(u=this.model.xs,c=this.model.ys,u.length!==c.length)return null;if(u.length<3||c.length<3)return null;for(e=this.plot_view.canvas,t=this.plot_view.canvas_view.ctx,r=n=0,i=u.length;0<=i?n<i:n>i;r=0<=i?++n:--n)"screen"===this.model.xs_units&&(a=u[r]),"screen"===this.model.ys_units&&(l=c[r]),o=e.vx_to_sx(a),s=e.vy_to_sy(l),0===r?(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}(o.AnnotationView),r.PolyAnnotation=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.PolyAnnotationView,e.prototype.type="PolyAnnotation",e.mixins(["line","fill"]),e.define({xs:[a.Array,[]],xs_units:[a.SpatialUnits,"data"],ys:[a.Array,[]],ys_units:[a.SpatialUnits,"data"],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]}),e.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.data_update=new s.Signal(this,"data_update")},e.prototype.update=function(t){var e,r;return e=t.xs,r=t.ys,this.setv({xs:e,ys:r},{silent:!0}),this.data_update.emit()},e}(o.Annotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(49),s=t(4),a=t(13);r.SpanView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.position="absolute",s.hide(this.el)},e.prototype.connect_signals=function(){return e.__super__.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(t){return function(){return t.plot_view.request_render()}}(this)),this.connect(this.model.properties.location.change,function(t){return function(){return t.plot_view.request_render()}}(this))):(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||s.hide(this.el),this.model.visible)return this._draw_span()},e.prototype._draw_span=function(){var t,e,r,n,i,o,a,l,u,c;return i=this.model.for_hover?this.model.computed_location:this.model.location,null==i?void s.hide(this.el):(r=this.plot_model.frame,t=this.plot_model.canvas,u=this.plot_view.frame.xscales[this.model.x_range_name],c=this.plot_view.frame.yscales[this.model.y_range_name],"width"===this.model.dimension?(a=t.vy_to_sy(this._calc_dim(i,c)),o=t.vx_to_sx(r._left.value),l=r._width.value,n=this.model.properties.line_width.value()):(a=t.vy_to_sy(r._top.value),o=t.vx_to_sx(this._calc_dim(i,u)),l=this.model.properties.line_width.value(),n=r._height.value),"css"===this.model.render_mode?(this.el.style.top=a+"px",this.el.style.left=o+"px",this.el.style.width=l+"px",this.el.style.height=n+"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(),s.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(o,a),"width"===this.model.dimension?e.lineTo(o+l,a):e.lineTo(o,a+n),e.stroke(),e.restore()):void 0)},e.prototype._calc_dim=function(t,e){var r;return r="data"===this.model.location_units?e.compute(t):t},e}(o.AnnotationView),r.Span=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.SpanView,e.prototype.type="Span",e.mixins(["line"]),e.define({render_mode:[a.RenderMode,"canvas"],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"],location:[a.Number,null],location_units:[a.SpatialUnits,"data"],dimension:[a.Dimension,"width"]}),e.override({line_color:"black"}),e.internal({for_hover:[a.Boolean,!1],computed_location:[a.Number,null]}),e}(o.Annotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(49),s=t(4),a=t(40),l=t(38);r.TextAnnotationView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){if(e.__super__.initialize.call(this,t),this.canvas=this.plot_model.canvas,this.frame=this.plot_model.frame,"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(){return e.__super__.connect_signals.call(this),"css"===this.model.render_mode?this.connect(this.model.change,function(){return this.render()}):this.connect(this.model.change,function(t){return function(){return t.plot_view.request_render()}}(this))},e.prototype._calculate_text_dimensions=function(t,e){var r,n;return n=t.measureText(e).width,r=l.get_text_height(this.visuals.text.font_value()).height,[n,r]},e.prototype._calculate_bounding_box_dimensions=function(t,e){var r,n,i,o,s;switch(n=this._calculate_text_dimensions(t,e),i=n[0],r=n[1],t.textAlign){case"left":o=0;break;case"center":o=-i/2;break;case"right":o=-i}switch(t.textBaseline){case"top":s=0;break;case"middle":s=-.5*r;break;case"bottom":s=-1*r;break;case"alphabetic":s=-.8*r;break;case"hanging":s=-.17*r;break;case"ideographic":s=-.83*r}return[o,s,i,r]},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,r,n,i){var o;return this.visuals.text.set_value(t),o=this._calculate_bounding_box_dimensions(t,e),t.save(),t.beginPath(),t.translate(r,n),i&&t.rotate(i),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,r,n,i){var o,l,u;return s.hide(this.el),this.visuals.text.set_value(t),o=this._calculate_bounding_box_dimensions(t,e),l=this.visuals.border_line.line_dash.value(),a.isArray(l)&&(u=l.length<2?"solid":"dashed"),a.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=r+o[0]+"px",this.el.style.top=n+o[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",i&&(this.el.style.transform="rotate("+i+"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,s.show(this.el)},e}(o.AnnotationView),r.TextAnnotation=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="TextAnnotation",e.prototype.default_view=r.TextAnnotationView,e}(o.Annotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(62),s=t(4),a=t(13),l=t(44);r.TitleView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){var r;return e.__super__.initialize.call(this,t),this.visuals.text=new l.Text(this.model),r=this.plot_view.canvas_view.ctx,r.save(),this.model.panel.apply_label_text_heuristics(r,"justified"),this.model.text_baseline=r.textBaseline,this.model.text_align=this.model.align,r.restore()},e.prototype._get_computed_location=function(){var t,e,r,n,i,o,s;switch(e=this._calculate_text_dimensions(this.plot_view.canvas_view.ctx,this.text),s=e[0],t=e[1],this.model.panel.side){case"left":i=this.model.panel._left.value,o=this._get_text_location(this.model.align,this.frame.v_range)+this.model.offset;break;case"right":i=this.model.panel._right.value,o=this.canvas._height.value-this._get_text_location(this.model.align,this.frame.v_range)-this.model.offset;break;case"above":i=this._get_text_location(this.model.align,this.frame.h_range)+this.model.offset,o=this.model.panel._top.value-10;break;case"below":i=this._get_text_location(this.model.align,this.frame.h_range)+this.model.offset,o=this.model.panel._bottom.value}return r=this.canvas.vx_to_sx(i),n=this.canvas.vy_to_sy(o),[r,n]},e.prototype._get_text_location=function(t,e){var r;switch(t){case"left":r=e.start;break;case"center":r=(e.end+e.start)/2;break;case"right":r=e.end}return r},e.prototype.render=function(){var t,e,r,n,i;if(this.model.visible||"css"!==this.model.render_mode||s.hide(this.el),this.model.visible&&(t=this.model.panel.get_label_angle_heuristic("parallel"),r=this._get_computed_location(),n=r[0],i=r[1],e=this.plot_view.canvas_view.ctx,""!==this.model.text&&null!==this.model.text))return"canvas"===this.model.render_mode?this._canvas_text(e,this.model.text,n,i,t):this._css_text(e,this.model.text,n,i,t)},e.prototype._get_size=function(){var t,e;return e=this.model.text,""===e||null===e?0:(t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),t.measureText(e).ascent+10)},e}(o.TextAnnotationView),r.Title=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.TitleView,e.prototype.type="Title",e.mixins(["line:border_","fill:background_"]),e.define({text:[a.String],text_font:[a.Font,"helvetica"],text_font_size:[a.FontSizeSpec,"10pt"],text_font_style:[a.FontStyle,"bold"],text_color:[a.ColorSpec,"#444444"],text_alpha:[a.NumberSpec,1],align:[a.TextAlign,"left"],offset:[a.Number,0],render_mode:[a.RenderMode,"canvas"]}),e.override({background_fill_color:null,border_line_color:null}),e.internal({text_align:[a.TextAlign,"left"],text_baseline:[a.TextBaseline,"bottom"]}),e}(o.TextAnnotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(49),s=t(4),a=t(13);r.TooltipView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.className="bk-tooltip",e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.zIndex=1010,s.hide(this.el)},e.prototype.connect_signals=function(){return e.__super__.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,r,n,i,o,a,l,u,c,_,h,p,d,f,y,m,v;if(i=this.model.data,s.empty(this.el),s.hide(this.el),this.model.custom?this.el.classList.add("bk-tooltip-custom"):this.el.classList.remove("bk-tooltip-custom"),0!==i.length){for(a=0,u=i.length;a<u;a++)f=i[a],y=f[0],m=f[1],n=f[2],this.model.inner_only&&!this.plot_view.frame.contains(y,m)||(p=s.div({},n),this.el.appendChild(p));switch(_=this.plot_view.model.canvas.vx_to_sx(y),h=this.plot_view.model.canvas.vy_to_sy(m),e=this.model.attachment){case"horizontal":v=this.plot_view.frame._width.value,l=this.plot_view.frame._left.value,c=y-l<v/2?"right":"left";break;case"vertical":o=this.plot_view.frame._height.value,r=this.plot_view.frame._bottom.value,c=m-r<o/2?"below":"above";break;default:c=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,s.show(this.el),c){case"right":this.el.classList.add("bk-left"),l=_+(this.el.offsetWidth-this.el.clientWidth)+t,d=h-this.el.offsetHeight/2;break;case"left":this.el.classList.add("bk-right"),l=_-this.el.offsetWidth-t,d=h-this.el.offsetHeight/2;break;case"above":this.el.classList.add("bk-above"),d=h+(this.el.offsetHeight-this.el.clientHeight)+t,l=Math.round(_-this.el.offsetWidth/2);break;case"below":this.el.classList.add("bk-below"),d=h-this.el.offsetHeight-t,l=Math.round(_-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=d+"px",this.el.style.left=l+"px"):s.hide(this.el)}},e}(o.AnnotationView),r.Tooltip=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.TooltipView,e.prototype.type="Tooltip",e.define({attachment:[a.String,"horizontal"],inner_only:[a.Bool,!0],show_arrow:[a.Bool,!0]}),e.override({level:"overlay"}),e.internal({data:[a.Any,[]],custom:[a.Any]}),e.prototype.clear=function(){return this.data=[]},e.prototype.add=function(t,e,r){var n;return n=this.data,n.push([t,e,r]),this.data=n,this.properties.data.change.emit()},e}(o.Annotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(49),s=t(168),a=t(51),l=t(13);r.WhiskerView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.set_data(this.model.source)},e.prototype.connect_signals=function(){return e.__super__.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(t){return e.__super__.set_data.call(this,t),this.visuals.warm_cache(t),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,r,n,i,o,s,a,l,u,c,_;return c=this.plot_view.frame.xscales[this.model.x_range_name],_=this.plot_view.frame.yscales[this.model.y_range_name],l="height"===this.model.dimension?_:c,o="height"===this.model.dimension?c:_,r="data"===this.model.lower.units?l.v_compute(this._lower):this._lower,i="data"===this.model.upper.units?l.v_compute(this._upper):this._upper,t="data"===this.model.base.units?o.v_compute(this._base):this._base,u=this.model._normals(),s=u[0],a=u[1],e=[r,t],n=[i,t],this._lower_sx=this.plot_model.canvas.v_vx_to_sx(e[s]),this._lower_sy=this.plot_model.canvas.v_vy_to_sy(e[a]),this._upper_sx=this.plot_model.canvas.v_vx_to_sx(n[s]),this._upper_sy=this.plot_model.canvas.v_vy_to_sy(n[a])},e.prototype.render=function(){var t,e,r,n,i,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(r=n=0,s=this._lower_sx.length;0<=s?n<s:n>s;r=0<=s?++n:--n)this.visuals.line.set_vectorize(e,r),e.beginPath(),e.moveTo(this._lower_sx[r],this._lower_sy[r]),e.lineTo(this._upper_sx[r],this._upper_sy[r]),e.stroke();if(t="height"===this.model.dimension?0:Math.PI/2,null!=this.model.lower_head)for(r=i=0,a=this._lower_sx.length;0<=a?i<a:i>a;r=0<=a?++i:--i)e.save(),e.translate(this._lower_sx[r],this._lower_sy[r]),e.rotate(t+Math.PI),this.model.lower_head.render(e,r),e.restore();if(null!=this.model.upper_head){for(u=[],r=o=0,l=this._upper_sx.length;0<=l?o<l:o>l;r=0<=l?++o:--o)e.save(),e.translate(this._upper_sx[r],this._upper_sy[r]),e.rotate(t),this.model.upper_head.render(e,r),u.push(e.restore());return u}}},e}(o.AnnotationView),r.Whisker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.WhiskerView,e.prototype.type="Whisker",e.mixins(["line"]),e.define({lower:[l.DistanceSpec],lower_head:[l.Instance,function(){return new a.TeeHead({level:"underlay",size:10})}],upper:[l.DistanceSpec],upper_head:[l.Instance,function(){return new a.TeeHead({level:"underlay",size:10})}],base:[l.DistanceSpec],dimension:[l.Dimension,"height"],source:[l.Instance,function(){return new s.ColumnDataSource}],x_range_name:[l.String,"default"],y_range_name:[l.String,"default"]}),e.override({level:"underlay"}),e.prototype._normals=function(){var t,e,r,n;return"height"===this.dimension?(r=[1,0],t=r[0],e=r[1]):(n=[0,1],t=n[0],e=n[1]),[t,e]},e}(o.Annotation)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(10),s=t(158),a=t(160),l=t(12),u=t(13),c=t(20),_=t(40);r.AxisView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.render=function(){var t,e,r;if(this.model.visible!==!1)return e={tick:this._tick_extent(),tick_label:this._tick_label_extents(),axis_label:this._axis_label_extent()},r=this.model.tick_coords,t=this.plot_view.canvas_view.ctx,t.save(),this._draw_rule(t,e),this._draw_major_ticks(t,e,r),this._draw_minor_ticks(t,e,r),this._draw_major_labels(t,e,r),this._draw_axis_label(t,e,r),null!=this._render&&this._render(t,e,r),t.restore()},e.prototype.connect_signals=function(){return e.__super__.connect_signals.call(this),this.connect(this.model.change,function(t){return function(){return t.plot_view.request_render()}}(this))},e.prototype._get_size=function(){return this._tick_extent()+this._tick_label_extent()+this._axis_label_extent()},e.prototype._draw_rule=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p,d,f,y,m;if(this.visuals.axis_line.doit){for(a=this.model.rule_coords,d=a[0],y=a[1],l=this.plot_view.map_to_screen(d,y,this.model.x_range_name,this.model.y_range_name),h=l[0],p=l[1],u=this.model.normals,o=u[0],s=u[1],c=this.model.offsets,f=c[0],m=c[1],this.visuals.axis_line.set_value(t),t.beginPath(),t.moveTo(Math.round(h[0]+o*f),Math.round(p[0]+s*m)),n=i=1,_=h.length;1<=_?i<_:i>_;n=1<=_?++i:--i)h=Math.round(h[n]+o*f),p=Math.round(p[n]+s*m),t.lineTo(h,p);t.stroke()}},e.prototype._draw_major_ticks=function(t,e,r){var n,i,o;n=this.model.major_tick_in,i=this.model.major_tick_out,o=this.visuals.major_tick_line,this._draw_ticks(t,r.major,n,i,o)},e.prototype._draw_minor_ticks=function(t,e,r){var n,i,o;n=this.model.minor_tick_in,i=this.model.minor_tick_out,o=this.visuals.minor_tick_line,this._draw_ticks(t,r.minor,n,i,o)},e.prototype._draw_major_labels=function(t,e,r){var n,i,o,s,a;n=r.major,i=this.model.compute_labels(n[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,i,n,o,this.model.panel_side,s,a)},e.prototype._draw_axis_label=function(t,e,r){var n,i,o,s,a,l,u,_;null!=this.model.axis_label&&(i=this.model.rule_coords,a=i[0],u=i[1],l=(a[0]+a[a.length-1])/2,_=(u[0]+u[u.length-1])/2,n=[[l],[_]],o=e.tick+c.sum(e.tick_label)+this.model.axis_label_standoff,s=this.visuals.axis_label_text,this._draw_oriented_labels(t,[this.model.axis_label],n,"parallel",this.model.panel_side,o,s))},e.prototype._draw_ticks=function(t,e,r,n,i){var o,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P;if(i.doit&&0!==e.length)for(S=e[0],O=e[1],p=this.plot_view.map_to_screen(S,O,this.model.x_range_name,this.model.y_range_name),w=p[0],M=p[1],d=this.model.normals,a=d[0],c=d[1],f=this.model.offsets,T=f[0],P=f[1],y=[a*(T-r),c*(P-r)],l=y[0],_=y[1],m=[a*(T+n),c*(P+n)],u=m[0],h=m[1],i.set_value(t),o=s=0,v=w.length;0<=v?s<v:s>v;o=0<=v?++s:--s)g=Math.round(w[o]+u),x=Math.round(M[o]+h),b=Math.round(w[o]+l),k=Math.round(M[o]+_),t.beginPath(),t.moveTo(g,x),t.lineTo(b,k),t.stroke()},e.prototype._draw_oriented_labels=function(t,e,r,n,i,o,s){var a,l,u,c,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T;if(s.doit&&0!==e.length)for(k=r[0],S=r[1],f=this.plot_view.map_to_screen(k,S,this.model.x_range_name,this.model.y_range_name),b=f[0],x=f[1],y=this.model.normals,c=y[0],p=y[1],m=this.model.offsets,M=m[0],T=m[1],h=c*(M+o),d=p*(T+o),s.set_value(t),this.model.panel.apply_label_text_heuristics(t,n),a=_.isString(n)?this.model.panel.get_label_angle_heuristic(n):-n,l=u=0,v=b.length;0<=v?u<v:u>v;l=0<=v?++u:--u)g=Math.round(b[l]+h),w=Math.round(x[l]+d),t.translate(g,w),t.rotate(a),t.fillText(e[l],0,0),t.rotate(-a),t.translate(-g,-w)},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 c.sum(this._tick_label_extents())},e.prototype._tick_label_extents=function(){var t,e,r,n,i;return t=this.model.tick_coords.major,e=this.model.compute_labels(t[this.model.dimension]),r=this.model.major_label_orientation,n=this.model.major_label_standoff,i=this.visuals.major_label_text,[this._oriented_labels_extent(e,r,this.model.panel_side,n,i)]},e.prototype._tick_label_extent=function(){return c.sum(this._tick_label_extents())},e.prototype._oriented_labels_extent=function(t,e,r,n,i){var o,s,a,l,u,c,h,p,d,f,y,m;if(0===t.length)return 0;for(a=this.plot_view.canvas_view.ctx,i.set_value(a),_.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,h=p=0,d=t.length;0<=d?p<d:p>d;h=0<=d?++p:--p)m=1.1*a.measureText(t[h]).width,u=.9*a.measureText(t[h]).ascent,y="above"===r||"below"===r?m*f+u/c*s:m*s+u/c*f,y>l&&(l=y);return l>0&&(l+=n),
l},e}(a.RendererView),r.Axis=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.AxisView,e.prototype.type="Axis",e.mixins(["line:axis_","line:major_tick_","line:minor_tick_","text:major_label_","text:axis_label_"]),e.define({bounds:[u.Any,"auto"],ticker:[u.Instance,null],formatter:[u.Instance,null],x_range_name:[u.String,"default"],y_range_name:[u.String,"default"],axis_label:[u.String,""],axis_label_standoff:[u.Int,5],major_label_standoff:[u.Int,5],major_label_orientation:[u.Any,"horizontal"],major_label_overrides:[u.Any,{}],major_tick_in:[u.Number,2],major_tick_out:[u.Number,6],minor_tick_in:[u.Number,0],minor_tick_out:[u.Number,4]}),e.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"}),e.internal({panel_side:[u.Any]}),e.prototype.compute_labels=function(t){var e,r,n,i;for(n=this.formatter.doFormat(t,this),e=r=0,i=t.length;0<=i?r<i:r>i;e=0<=i?++r:--r)t[e]in this.major_label_overrides&&(n[e]=this.major_label_overrides[t[e]]);return n},e.prototype.label_info=function(t){var e,r;return r=this.major_label_orientation,e={dim:this.dimension,coords:t,side:this.panel_side,orient:r,standoff:this.major_label_standoff}},e.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()}}),e.prototype.add_panel=function(t){return this.panel=new o.SidePanel({side:t}),this.panel.attach_document(this.document),this.panel_side=t},e.prototype._offsets=function(){var t,e,r,n,i;switch(r=this.panel_side,e=[0,0],n=e[0],i=e[1],t=this.plot.plot_canvas.frame,r){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]},e.prototype._ranges=function(){var t,e,r,n;return e=this.dimension,r=(e+1)%2,t=this.plot.plot_canvas.frame,n=[t.x_ranges[this.x_range_name],t.y_ranges[this.y_range_name]],[n[e],n[r]]},e.prototype._computed_bounds=function(){var t,e,r,n,i,o,s,a;return i=this.ranges,r=i[0],t=i[1],a=null!=(o=this.bounds)?o:"auto",n=[r.min,r.max],"auto"===a?n:_.isArray(a)?(Math.abs(a[0]-a[1])>Math.abs(n[0]-n[1])?(s=Math.max(Math.min(a[0],a[1]),n[0]),e=Math.min(Math.max(a[0],a[1]),n[1])):(s=Math.min(a[0],a[1]),e=Math.max(a[0],a[1])),[s,e]):(l.logger.error("user bounds '"+a+"' not understood"),null)},e.prototype._rule_coords=function(){var t,e,r,n,i,o,s,a,l,u,c;return n=this.dimension,i=(n+1)%2,s=this.ranges,o=s[0],e=s[1],a=this.computed_bounds,l=a[0],r=a[1],u=new Array(2),c=new Array(2),t=[u,c],t[n][0]=Math.max(l,o.min),t[n][1]=Math.min(r,o.max),t[n][0]>t[n][1]&&(t[n][0]=t[n][1]=NaN),t[i][0]=this.loc,t[i][1]=this.loc,t},e.prototype._tick_coords=function(){var t,e,r,n,i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M;for(n=this.dimension,o=(n+1)%2,y=this.ranges,p=y[0],e=y[1],m=this.computed_bounds,w=m[0],r=m[1],x=this.ticker.get_ticks(w,r,p,this.loc,{}),l=x.major,h=x.minor,k=[],M=[],t=[k,M],c=[],_=[],u=[c,_],v=[p.min,p.max],f=v[0],d=v[1],i=s=0,g=l.length;0<=g?s<g:s>g;i=0<=g?++s:--s)l[i]<f||l[i]>d||(t[n].push(l[i]),t[o].push(this.loc));for(i=a=0,b=h.length;0<=b?a<b:a>b;i=0<=b?++a:--a)h[i]<f||h[i]>d||(u[n].push(h[i]),u[o].push(this.loc));return{major:t,minor:u}},e.prototype._get_loc=function(){var t,e,r,n,i,o;switch(i=this.ranges,n=i[0],e=i[1],r=e.start,t=e.end,o=this.panel_side){case"left":case"below":return e.start;case"right":case"above":return e.end}},e}(s.GuideRenderer)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(66),s=t(89),a=t(176);r.CategoricalAxisView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._render=function(t,e,r){return this._draw_group_separators(t,e,r)},e.prototype._draw_group_separators=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O;if(v=this.model.ranges,m=v[0],o=v[1],g=this.model.computed_bounds,S=g[0],a=g[1],f=this.model.loc,O=this.model.ticker.get_ticks(S,a,m,f,{}),b=this.model.ranges,m=b[0],o=b[1],m.tops&&!(m.tops.length<2)&&this.visuals.separator_line.doit){for(s=this.model.dimension,n=(s+1)%2,i=[[],[]],c=0,u=h=0,w=m.tops.length-1;0<=w?h<w:h>w;u=0<=w?++h:--h){for(_=p=x=c,k=m.factors.length;x<=k?p<k:p>k;_=x<=k?++p:--p)if(m.factors[_][0]===m.tops[u+1]){M=[m.factors[_-1],m.factors[_]],l=M[0],d=M[1],c=_;break}y=(m.synthetic(l)+m.synthetic(d))/2,y>S&&y<a&&(i[s].push(y),i[n].push(this.model.loc))}T=this._tick_label_extent(),this._draw_ticks(t,i,-3,T-6,this.visuals.separator_line)}},e.prototype._draw_major_labels=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p,d,f;for(a=this._get_factor_info(),c=this.model.loc,o=this.model.dimension,n=(o+1)%2,d=e.tick+this.model.major_label_standoff,s=l=0,h=a.length;0<=h?l<h:l>h;s=0<=h?++l:--l)p=a[s],u=p[0],i=p[1],_=p[2],f=p[3],this._draw_oriented_labels(t,u,i,_,this.model.panel_side,d,f),d+=e.tick_label[s]},e.prototype._tick_label_extents=function(){var t,e,r,n,i,o,s,a,l,u;for(n=this._get_factor_info(),r=[],i=0,s=n.length;i<s;i++)l=n[i],o=l[0],t=l[1],a=l[2],u=l[3],e=this._oriented_labels_extent(o,a,this.model.panel_side,this.model.major_label_standoff,u),r.push(e);return r},e.prototype._get_factor_info=function(){var t,e,r,n,i,o,s,a,l,u,c,_,h;return l=this.model.ranges,a=l[0],e=l[1],u=this.model.computed_bounds,c=u[0],r=u[1],o=this.model.loc,_=this.model.ticker.get_ticks(c,r,a,o,{}),t=this.model.tick_coords,n=[],1===a.levels?n.push([_.major,t.major,this.model.major_label_orientation,this.visuals.major_label_text]):2===a.levels?(i=function(){var t,e,r,n;for(r=_.major,n=[],t=0,e=r.length;t<e;t++)h=r[t],n.push(h[1]);return n}(),n.push([i,t.major,this.model.major_label_orientation,this.visuals.major_label_text]),n.push([_.tops,t.tops,"parallel",this.visuals.group_text])):3===a.levels&&(i=function(){var t,e,r,n;for(r=_.major,n=[],t=0,e=r.length;t<e;t++)h=r[t],n.push(h[2]);return n}(),s=function(){var t,e,r,n;for(r=_.mids,n=[],t=0,e=r.length;t<e;t++)h=r[t],n.push(h[1]);return n}(),n.push([i,t.major,this.model.major_label_orientation,this.visuals.major_label_text]),n.push([s,t.mids,"parallel",this.visuals.subgroup_text]),n.push([_.tops,t.tops,"parallel",this.visuals.group_text])),n},e}(o.AxisView),r.CategoricalAxis=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.CategoricalAxisView,e.prototype.type="CategoricalAxis",e.mixins(["line:separator_","text:group_","text:subgroup_"]),e.override({ticker:function(){return new a.CategoricalTicker},formatter:function(){return new s.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"}),e.prototype._tick_coords=function(){var t,e,r,n,i,o,s,a,l,u,c;return n=this.dimension,i=(n+1)%2,s=this.ranges,o=s[0],e=s[1],a=this.computed_bounds,l=a[0],r=a[1],u=this.ticker.get_ticks(l,r,o,this.loc,{}),t={major:[[],[]],mids:[[],[]],tops:[[],[]],minor:[]},t.major[n]=u.major,t.major[i]=function(){var t,e,r,n;for(r=u.major,n=[],t=0,e=r.length;t<e;t++)c=r[t],n.push(this.loc);return n}.call(this),3===o.levels&&(t.mids[n]=u.mids,t.mids[i]=function(){var t,e,r,n;for(r=u.mids,n=[],t=0,e=r.length;t<e;t++)c=r[t],n.push(this.loc);return n}.call(this)),o.levels>1&&(t.tops[n]=u.tops,t.tops[i]=function(){var t,e,r,n;for(r=u.tops,n=[],t=0,e=r.length;t<e;t++)c=r[t],n.push(this.loc);return n}.call(this)),t},e}(o.Axis)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(66);r.ContinuousAxis=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="ContinuousAxis",e}(o.Axis)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(71),s=t(90),a=t(179);r.DatetimeAxisView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(o.LinearAxisView),r.DatetimeAxis=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.DatetimeAxisView,e.prototype.type="DatetimeAxis",e.override({ticker:function(){return new a.DatetimeTicker},formatter:function(){return new s.DatetimeTickFormatter}}),e}(o.LinearAxis)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(66);r.Axis=n.Axis;var i=t(67);r.CategoricalAxis=i.CategoricalAxis;var o=t(68);r.ContinuousAxis=o.ContinuousAxis;var s=t(69);r.DatetimeAxis=s.DatetimeAxis;var a=t(71);r.LinearAxis=a.LinearAxis;var l=t(72);r.LogAxis=l.LogAxis},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(66),s=t(68),a=t(88),l=t(175);r.LinearAxisView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(o.AxisView),r.LinearAxis=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.LinearAxisView,e.prototype.type="LinearAxis",e.override({ticker:function(){return new l.BasicTicker},formatter:function(){return new a.BasicTickFormatter}}),e}(s.ContinuousAxis)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(66),s=t(68),a=t(93),l=t(183);r.LogAxisView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(o.AxisView),r.LogAxis=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.LogAxisView,e.prototype.type="LogAxis",e.override({ticker:function(){return new l.LogTicker},formatter:function(){return new a.LogTickFormatter}}),e}(s.ContinuousAxis)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=[].slice,s=t(13),a=t(28),l=t(48);r.CustomJS=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return n(r,e),r.prototype.type="CustomJS",r.define({args:[s.Any,{}],code:[s.String,""]}),r.getters({values:function(){return this._make_values()},func:function(){return this._make_func()}}),r.prototype.execute=function(e,r){return this.func.apply(e,this.values.concat(e,r,t,{}))},r.prototype._make_values=function(){return a.values(this.args)},r.prototype._make_func=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(Function,o.call(Object.keys(this.args)).concat(["cb_obj"],["cb_data"],["require"],["exports"],[this.code]),function(){})},r}(l.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(73);r.CustomJS=n.CustomJS;var i=t(75);r.OpenURL=i.OpenURL},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(48),s=t(13),a=t(32),l=t(37);r.OpenURL=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="OpenURL",e.define({url:[s.String,"http://"]}),e.prototype.execute=function(t,e){var r,n,i,o,s;for(o=a.get_indices(e.source),n=0,i=o.length;n<i;n++)r=o[n],s=l.replace_placeholders(this.url,e.source,r),window.open(s);return null},e}(o.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(9),s=t(5),a=t(11),l=t(12),u=t(13),c=t(4),_=t(23),h=t(242);null!=window.CanvasPixelArray&&(CanvasPixelArray.prototype.set=function(t){var e,r,n,i;for(i=[],e=r=0,n=this.length;0<=n?r<n:r>n;e=0<=n?++r:--r)i.push(this[e]=t[e]);return i}),r.CanvasView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.className="bk-canvas-wrapper",e.prototype.initialize=function(t){switch(e.__super__.initialize.call(this,t),this.map_el=this.model.map?this.el.appendChild(c.div({"class":"bk-canvas-map"})):null,this.events_el=this.el.appendChild(c.div({"class":"bk-canvas-events"})),this.overlays_el=this.el.appendChild(c.div({"class":"bk-canvas-overlays"})),this.model.output_backend){case"canvas":case"webgl":this.canvas_el=this.el.appendChild(c.canvas({"class":"bk-canvas"})),this._ctx=this.canvas_el.getContext("2d");break;case"svg":this._ctx=new h,this.canvas_el=this.el.appendChild(this._ctx.getSvg())}return this.ctx=this.get_ctx(),_.fixup_ctx(this.ctx),l.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,r;return r=this.model._width.value,t=this.model._height.value,this.el.style.width=r+"px",this.el.style.height=t+"px",e=_.get_scale_ratio(this.ctx,this.model.use_hidpi,this.model.output_backend),this.model.pixel_ratio=e,this.canvas_el.style.width=r+"px",this.canvas_el.style.height=t+"px",this.canvas_el.setAttribute("width",r*e),this.canvas_el.setAttribute("height",t*e),l.logger.debug("Rendering CanvasView with width: "+r+", height: "+t+", pixel ratio: "+e)},e.prototype.set_dims=function(t){var e,r;if(r=t[0],e=t[1],0!==r&&0!==e)return null!=this._width_constraint&&this.solver.has_constraint(this._width_constraint)&&this.solver.remove_constraint(this._width_constraint),null!=this._height_constraint&&this.solver.has_constraint(this._height_constraint)&&this.solver.remove_constraint(this._height_constraint),this._width_constraint=a.EQ(this.model._width,-r),this.solver.add_constraint(this._width_constraint),this._height_constraint=a.EQ(this.model._height,-e),this.solver.add_constraint(this._height_constraint),this.solver.update_variables()},e}(s.DOMView),r.Canvas=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="Canvas",e.prototype.default_view=r.CanvasView,e.internal({map:[u.Boolean,!1],initial_width:[u.Number],initial_height:[u.Number],use_hidpi:[u.Boolean,!0],pixel_ratio:[u.Number,1],output_backend:[u.OutputBackend,"canvas"]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.panel=this},e.prototype.vx_to_sx=function(t){return t},e.prototype.vy_to_sy=function(t){return this._height.value-t},e.prototype.v_vx_to_sx=function(t){return new Float64Array(t)},e.prototype.v_vy_to_sy=function(t){var e,r,n,i,o,s;for(e=new Float64Array(t.length),r=this._height.value,n=i=0,o=t.length;i<o;n=++i)s=t[n],e[n]=r-s;return e},e.prototype.sx_to_vx=function(t){return t},e.prototype.sy_to_vy=function(t){return this._height.value-t},e.prototype.v_sx_to_vx=function(t){return new Float64Array(t)},e.prototype.v_sy_to_vy=function(t){var e,r,n,i,o,s;for(e=new Float64Array(t.length),r=this._height.value,n=i=0,o=t.length;i<o;n=++i)s=t[n],e[n]=r-s;return e},e}(o.LayoutCanvas)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(161),s=t(163),a=t(164),l=t(155),u=t(151),c=t(152),_=t(9),h=t(12),p=t(13);r.CartesianFrame=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="CartesianFrame",e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.panel=this,this._configure_scales(),this.connect(this.change,function(t){return function(){return t._configure_scales()}}(this)),null},e.prototype.contains=function(t,e){return t>=this._left.value&&t<=this._right.value&&e>=this._bottom.value&&e<=this._top.value},e.prototype.map_to_screen=function(t,e,r,n,i){var o,s,a,l;return null==n&&(n="default"),null==i&&(i="default"),a=this.xscales[n].v_compute(t),o=r.v_vx_to_sx(a),l=this.yscales[i].v_compute(e),s=r.v_vy_to_sy(l),[o,s]},e.prototype._get_ranges=function(t,e){var r,n,i;if(i={},i["default"]=t,null!=e)for(n in e)r=e[n],i[n]=r;return i},e.prototype._get_scales=function(t,e,r){var n,i,_,h;h={};for(n in e){if(i=e[n],i instanceof u.DataRange1d||i instanceof l.Range1d){if(!(t instanceof a.LogScale||t instanceof s.LinearScale))throw new Error("Range "+i.type+" is incompatible is Scale "+t.type);if(t instanceof o.CategoricalScale)throw new Error("Range "+i.type+" is incompatible is Scale "+t.type)}if(i instanceof c.FactorRange&&!(t instanceof o.CategoricalScale))throw new Error("Range "+i.type+" is incompatible is Scale "+t.type);t instanceof a.LogScale&&i instanceof u.DataRange1d&&(i.scale_hint="log"),_=t.clone(),_.setv({source_range:i,target_range:r}),h[n]=_}return h},e.prototype._configure_frame_ranges=function(){return this._h_range=new l.Range1d({start:this._left.value,end:this._left.value+this._width.value}),this._v_range=new l.Range1d({start:this._bottom.value,end:this._bottom.value+this._height.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_range),this._yscales=this._get_scales(this.y_scale,this._y_ranges,this._v_range)},e.prototype._update_scales=function(){var t,e,r,n;this._configure_frame_ranges(),e=this._xscales;for(t in e)n=e[t],n.target_range=this._h_range;r=this._yscales;for(t in r)n=r[t],n.target_range=this._v_range;return null},e.getters({h_range:function(){return this._h_range},v_range:function(){return this._v_range},x_ranges:function(){return this._x_ranges},y_ranges:function(){return this._y_ranges},xscales:function(){return this._xscales},yscales:function(){return this._yscales},x_mappers:function(){return h.logger.warn("x_mappers attr is deprecated, use xscales"),this._xscales},y_mappers:function(){return h.logger.warn("y_mappers attr is deprecated, use yscales"),this._yscales}}),e.internal({extra_x_ranges:[p.Any,{}],extra_y_ranges:[p.Any,{}],x_range:[p.Instance],y_range:[p.Instance],x_scale:[p.Instance],y_scale:[p.Instance]}),e}(_.LayoutCanvas)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(76);r.Canvas=n.Canvas;var i=t(77);r.CartesianFrame=i.CartesianFrame},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(48);r.Expression=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),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}(o.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(79);r.Expression=n.Expression;var i=t(81);r.Stack=i.Stack},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(79),s=t(13);r.Stack=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.define({fields:[s.Array,[]]}),e.prototype.v_compute=function(t){var e,r,n,i,o,s,a,l,u,c;for(u=new Float64Array(t.get_length()),a=this.fields,n=0,o=a.length;n<o;n++)for(e=a[n],l=t.data[e],r=i=0,s=l.length;i<s;r=++i)c=l[r],u[r]+=c;return u},e}(o.Expression)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(84),s=t(13),a=t(12),l=t(20),u=t(40);r.BooleanFilter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="BooleanFilter",e.define({booleans:[s.Array,null]}),e.prototype.compute_indices=function(t){var e,r,n;return(null!=(r=this.booleans)?r.length:void 0)>0?l.all(this.booleans,u.isBoolean)?(this.booleans.length!==t.get_length()&&a.logger.warn("BooleanFilter "+this.id+": length of booleans doesn't match data source"),function(){var t,r,n,i;for(n=l.range(0,this.booleans.length),i=[],t=0,r=n.length;t<r;t++)e=n[t],this.booleans[e]===!0&&i.push(e);return i}.call(this)):(a.logger.warn("BooleanFilter "+this.id+": booleans should be array of booleans, defaulting to no filtering"),null):(0===(null!=(n=this.booleans)?n.length:void 0)?a.logger.warn("BooleanFilter "+this.id+": booleans is empty, defaulting to no filtering"):a.logger.warn("BooleanFilter "+this.id+": booleans was not set, defaulting to no filtering"),null)},e}(o.Filter)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=[].slice,s=t(84),a=t(13),l=t(28);r.CustomJSFilter=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return n(r,e),r.prototype.type="CustomJSFilter",r.define({args:[a.Any,{}],code:[a.String,""]}),r.getters({values:function(){return this._make_values()},func:function(){return this._make_func()}}),r.prototype.compute_indices=function(e){return this.filter=this.func.apply(this,o.call(this.values).concat([e],[t],[{}])),r.__super__.compute_indices.call(this)},r.prototype._make_values=function(){return l.values(this.args)},r.prototype._make_func=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(Function,o.call(Object.keys(this.args)).concat(["source"],["require"],["exports"],[this.code]),function(){})},r}(s.Filter)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(48),s=t(13),a=t(40),l=t(20),u=t(12);r.Filter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="Filter",e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t)},e.define({filter:[s.Array,null]}),e.prototype.compute_indices=function(){var t,e;return(null!=(e=this.filter)?e.length:void 0)>=0?l.all(this.filter,a.isBoolean)?function(){var e,r,n,i;for(n=l.range(0,this.filter.length),i=[],e=0,r=n.length;e<r;e++)t=n[e],this.filter[t]===!0&&i.push(t);return i}.call(this):l.all(this.filter,a.isInteger)?this.filter:(u.logger.warn("Filter "+this.id+": filter should either be array of only booleans or only integers, defaulting to no filtering"),null):(u.logger.warn("Filter "+this.id+": filter was not set to be an array, defaulting to no filtering"),null)},e}(o.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(84),s=t(13),a=t(12);r.GroupFilter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="GroupFilter",e.define({column_name:[s.String],group:[s.String]}),e.prototype.compute_indices=function(t){var e,r;return e=t.get_column(this.column_name),null==e?(a.logger.warn("group filter: groupby column not found in data source"),null):(this.indices=function(){var n,i,o;for(o=[],r=n=0,i=t.get_length();0<=i?n<i:n>i;r=0<=i?++n:--n)e[r]===this.group&&o.push(r);return o}.call(this),0===this.indices.length&&a.logger.warn("group filter: group '"+this.group+"' did not match any values in column '"+this.column_name+"'"),this.indices)},e}(o.Filter)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(82);r.BooleanFilter=n.BooleanFilter;var i=t(83);r.CustomJSFilter=i.CustomJSFilter;var o=t(84);r.Filter=o.Filter;var s=t(85);r.GroupFilter=s.GroupFilter;var a=t(87);r.IndexFilter=a.IndexFilter},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(84),s=t(13),a=t(12),l=t(40),u=t(20);r.IndexFilter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="IndexFilter",e.define({indices:[s.Array,null]}),e.prototype.compute_indices=function(t){var e;return(null!=(e=this.indices)?e.length:void 0)>=0?u.all(this.indices,l.isInteger)?this.indices:(a.logger.warn("IndexFilter "+this.id+": indices should be array of integers, defaulting to no filtering"),null):(a.logger.warn("IndexFilter "+this.id+": indices was not set, defaulting to no filtering"),null)},e}(o.Filter)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(97),s=t(13),a=t(40);r.BasicTickFormatter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="BasicTickFormatter",e.define({precision:[s.Any,"auto"],use_scientific:[s.Bool,!0],power_limit_high:[s.Number,5],power_limit_low:[s.Number,-3]}),e.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)}}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.last_precision=3},e.prototype.doFormat=function(t,e){var r,n,i,o,s,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k;if(0===t.length)return[];if(k=0,t.length>=2&&(k=Math.abs(t[1]-t[0])/1e4),h=!1,this.use_scientific)for(i=0,u=t.length;i<u;i++)if(b=t[i],w=Math.abs(b),w>k&&(w>=this.scientific_limit_high||w<=this.scientific_limit_low)){h=!0;break}if(d=this.precision,null==d||a.isNumber(d)){if(l=new Array(t.length),h)for(r=o=0,f=t.length;0<=f?o<f:o>f;r=0<=f?++o:--o)l[r]=t[r].toExponential(d||void 0);else for(r=s=0,y=t.length;0<=y?s<y:s>y;r=0<=y?++s:--s)l[r]=t[r].toFixed(d||void 0).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"");return l}if("auto"===d)for(l=new Array(t.length),x=c=m=this.last_precision;m<=15?c<=15:c>=15;x=m<=15?++c:--c){if(n=!0,h){for(r=_=0,v=t.length;0<=v?_<v:_>v;r=0<=v?++_:--_)if(l[r]=t[r].toExponential(x),r>0&&l[r]===l[r-1]){n=!1;break}if(n)break}else{for(r=p=0,g=t.length;0<=g?p<g:p>g;r=0<=g?++p:--p)if(l[r]=t[r].toFixed(x).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,""),r>0&&l[r]===l[r-1]){n=!1;break}if(n)break}if(n)return this.last_precision=x,l}return l},e}(o.TickFormatter)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(97);r.CategoricalTickFormatter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="CategoricalTickFormatter",e.prototype.doFormat=function(t,e){return t},e}(o.TickFormatter)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s=function(t,e){function r(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty,l=t(355),u=t(356),c=t(97),_=t(12),h=t(13),p=t(20),d=t(40);o=function(t){return Math.round(t/1e3%1*1e6)},n=function(t){return u(t,"%Y %m %d %H %M %S").split(/\s+/).map(function(t){return parseInt(t,10)})},i=function(t,e){var r;return d.isFunction(e)?e(t):(r=l.sprintf("$1%06d",o(t)),e=e.replace(/((^|[^%])(%%)*)%f/,r),e.indexOf("%")===-1?e:u(t,e))},r.DatetimeTickFormatter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.type="DatetimeTickFormatter",e.define({microseconds:[h.Array,["%fus"]],milliseconds:[h.Array,["%3Nms","%S.%3Ns"]],seconds:[h.Array,["%Ss"]],minsec:[h.Array,[":%M:%S"]],minutes:[h.Array,[":%M","%Mm"]],hourmin:[h.Array,["%H:%M"]],hours:[h.Array,["%Hh","%H:%M"]],days:[h.Array,["%m/%d","%a%d"]],months:[h.Array,["%m/%Y","%b%y"]],years:[h.Array,["%Y"]]}),e.prototype.format_order=["microseconds","milliseconds","seconds","minsec","minutes","hourmin","hours","days","months","years"],e.prototype.strip_leading_zeros=!0,e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._update_width_formats()},e.prototype._update_width_formats=function(){var t,e;return e=u(new Date),t=function(t){var r,n,o;return n=function(){var n,o,s;for(s=[],n=0,o=t.length;n<o;n++)r=t[n],s.push(i(e,r).length);return s}(),o=p.sortBy(p.zip(n,t),function(t){var e,r;return r=t[0],e=t[1],r}),p.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 r;switch(r=1.1*t,!1){case!(r<.001):return"microseconds";case!(r<1):return"milliseconds";case!(r<60):return e>=60?"minsec":"seconds";case!(r<3600):return e>=3600?"hourmin":"minutes";case!(r<86400):return"hours";case!(r<2678400):return"days";case!(r<31536e3):return"months";default:return"years"}},e.prototype.doFormat=function(t,e,r,o,s,a){var l,u,c,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E,z,C,N,D,F;if(null==r&&(r=null),null==o&&(o=null),null==s&&(s=.3),null==a&&(a=null),0===t.length)return[];
if(E=Math.abs(t[t.length-1]-t[0])/1e3,M=a?a.resolution:E/(t.length-1),P=this._get_resolution_str(M,E),S=this._width_formats[P],F=S[0],h=S[1],c=h[0],o){for(p=[],f=y=0,T=F.length;0<=T?y<T:y>T;f=0<=T?++y:--y)F[f]*t.length<s*o&&p.push(this._width_formats[f]);p.length>0&&(c=p[p.length-1])}for(g=[],A=this.format_order.indexOf(P),N={},O=this.format_order,m=0,b=O.length;m<b;m++)u=O[m],N[u]=0;for(N.seconds=5,N.minsec=4,N.minutes=4,N.hourmin=3,N.hours=3,v=0,w=t.length;v<w;v++){C=t[v];try{D=n(C),j=i(C,c)}catch(I){l=I,_.logger.warn("unable to format tick for timestamp value "+C),_.logger.warn(" - "+l),g.push("ERR");continue}for(d=!1,k=A;0===D[N[this.format_order[k]]]&&(k+=1,k!==this.format_order.length);){if(("minsec"===P||"hourmin"===P)&&!d){if("minsec"===P&&0===D[4]&&0!==D[5]||"hourmin"===P&&0===D[3]&&0!==D[4]){x=this._width_formats[this.format_order[A-1]][1][0],j=i(C,x);break}d=!0}x=this._width_formats[this.format_order[k]][1][0],j=i(C,x)}this.strip_leading_zeros?(z=j.replace(/^0+/g,""),z!==j&&isNaN(parseInt(z))&&(z="0"+z),g.push(z)):g.push(j)}return g},e}(c.TickFormatter)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=[].slice,s=t(97),a=t(13),l=t(28);r.FuncTickFormatter=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return n(r,e),r.prototype.type="FuncTickFormatter",r.define({args:[a.Any,{}],code:[a.String,""]}),r.prototype._make_func=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(Function,["tick"].concat(o.call(Object.keys(this.args)),["require"],[this.code]),function(){})},r.prototype.doFormat=function(e,r){var n,i;return n=this._make_func(),function(){var r,s,a;for(a=[],r=0,s=e.length;r<s;r++)i=e[r],a.push(n.apply(null,[i].concat(o.call(l.values(this.args)),[t])));return a}.call(this)},r}(s.TickFormatter)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(88);r.BasicTickFormatter=n.BasicTickFormatter;var i=t(89);r.CategoricalTickFormatter=i.CategoricalTickFormatter;var o=t(90);r.DatetimeTickFormatter=o.DatetimeTickFormatter;var s=t(91);r.FuncTickFormatter=s.FuncTickFormatter;var a=t(93);r.LogTickFormatter=a.LogTickFormatter;var l=t(94);r.MercatorTickFormatter=l.MercatorTickFormatter;var u=t(95);r.NumeralTickFormatter=u.NumeralTickFormatter;var c=t(96);r.PrintfTickFormatter=c.PrintfTickFormatter;var _=t(97);r.TickFormatter=_.TickFormatter},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(88),s=t(97),a=t(12),l=t(13);r.LogTickFormatter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="LogTickFormatter",e.define({ticker:[l.Instance,null]}),e.prototype.initialize=function(t,r){if(e.__super__.initialize.call(this,t,r),this.basic_formatter=new o.BasicTickFormatter,null==this.ticker)return a.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 r,n,i,o,s,a;if(0===t.length)return[];for(r=null!=this.ticker?this.ticker.base:10,a=!1,o=new Array(t.length),n=i=0,s=t.length;0<=s?i<s:i>s;n=0<=s?++i:--i)if(o[n]=r+"^"+Math.round(Math.log(t[n])/Math.log(r)),n>0&&o[n]===o[n-1]){a=!0;break}return a&&(o=this.basic_formatter.doFormat(t)),o},e}(s.TickFormatter)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(88),s=t(13),a=t(29);r.MercatorTickFormatter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="MercatorTickFormatter",e.define({dimension:[s.LatLon]}),e.prototype.doFormat=function(t,r){var n,i,o,s,l,u,c,_,h,p;if(null==this.dimension)throw new Error("MercatorTickFormatter.dimension not configured");if(0===t.length)return[];if(u=new Array(t.length),"lon"===this.dimension)for(n=i=0,c=t.length;0<=c?i<c:i>c;n=0<=c?++i:--i)_=a.proj4(a.mercator).inverse([t[n],r.loc]),l=_[0],s=_[1],u[n]=l;else for(n=o=0,h=t.length;0<=h?o<h:o>h;n=0<=h?++o:--o)p=a.proj4(a.mercator).inverse([r.loc,t[n]]),l=p[0],s=p[1],u[n]=s;return e.__super__.doFormat.call(this,u,r)},e}(o.BasicTickFormatter)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(325),s=t(97),a=t(13);r.NumeralTickFormatter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="NumeralTickFormatter",e.define({format:[a.String,"0,0"],language:[a.String,"en"],rounding:[a.String,"round"]}),e.prototype.doFormat=function(t,e){var r,n,i,s,a;return r=this.format,i=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),n=function(){var e,n,l;for(l=[],e=0,n=t.length;e<n;e++)a=t[e],l.push(o.format(a,r,i,s));return l}()},e}(s.TickFormatter)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(355),s=t(97),a=t(13);r.PrintfTickFormatter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="PrintfTickFormatter",e.define({format:[a.String,"%s"]}),e.prototype.doFormat=function(t,e){var r,n,i;return r=this.format,n=function(){var e,n,s;for(s=[],e=0,n=t.length;e<n;e++)i=t[e],s.push(o.sprintf(r,i));return s}()},e}(s.TickFormatter)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(48);r.TickFormatter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="TickFormatter",e.prototype.doFormat=function(t,e){},e}(o.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(8),a=t(13),l=t(27);r.AnnularWedgeView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._map_data=function(){var t,e,r,n;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),n=[],t=e=0,r=this._start_angle.length;0<=r?e<r:e>r;t=0<=r?++e:--e)n.push(this._angle[t]=this._end_angle[t]-this._start_angle[t]);return n},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p;for(h=r.sx,p=r.sy,i=r._start_angle,n=r._angle,c=r.sinner_radius,_=r.souter_radius,o=this.model.properties.direction.value(),u=[],a=0,l=e.length;a<l;a++)s=e[a],isNaN(h[s]+p[s]+c[s]+_[s]+i[s]+n[s])||(t.translate(h[s],p[s]),t.rotate(i[s]),t.moveTo(_[s],0),t.beginPath(),t.arc(0,0,_[s],0,n[s],o),t.rotate(n[s]),t.lineTo(c[s],0),t.arc(0,0,c[s],0,-n[s],!o),t.closePath(),t.rotate(-n[s]-i[s]),t.translate(-h[s],-p[s]),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,s),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,s),u.push(t.stroke())):u.push(void 0));return u},e.prototype._hit_point=function(t){var e,r,n,i,o,a,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E,z,C,N,D,F,I,B;for(y=[t.vx,t.vy],O=y[0],j=y[1],C=this.renderer.xscale.invert(O),F=this.renderer.yscale.invert(j),"data"===this.model.properties.outer_radius.units?(N=C-this.max_outer_radius,D=C+this.max_outer_radius,I=F-this.max_outer_radius,B=F+this.max_outer_radius):(P=O-this.max_outer_radius,A=O+this.max_outer_radius,m=this.renderer.xscale.v_invert([P,A]),N=m[0],D=m[1],E=j-this.max_outer_radius,z=j+this.max_outer_radius,v=this.renderer.yscale.v_invert([E,z]),I=v[0],B=v[1]),n=[],r=s.validate_bbox_coords([N,D],[I,B]),g=this.index.indices(r),_=0,p=g.length;_<p;_++)u=g[_],f=Math.pow(this.souter_radius[u],2),c=Math.pow(this.sinner_radius[u],2),x=this.renderer.xscale.compute(C),k=this.renderer.xscale.compute(this._x[u]),S=this.renderer.yscale.compute(F),T=this.renderer.yscale.compute(this._y[u]),o=Math.pow(x-k,2)+Math.pow(S-T,2),o<=f&&o>=c&&n.push([u,o]);for(i=this.model.properties.direction.value(),a=[],h=0,d=n.length;h<d;h++)b=n[h],u=b[0],o=b[1],w=this.renderer.plot_view.canvas.vx_to_sx(O),M=this.renderer.plot_view.canvas.vy_to_sy(j),e=Math.atan2(M-this.sy[u],w-this.sx[u]),l.angle_between(-e,-this._start_angle[u],-this._end_angle[u],i)&&a.push([u,o]);return s.create_1d_hit_test_result(a)},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_area_legend(t,e,r,n,i,o)},e.prototype._scxy=function(t){var e,r;return r=(this.sinner_radius[t]+this.souter_radius[t])/2,e=(this._start_angle[t]+this._end_angle[t])/2,{x:this.sx[t]+r*Math.cos(e),y:this.sy[t]+r*Math.sin(e)}},e.prototype.scx=function(t){return this._scxy(t).x},e.prototype.scy=function(t){return this._scxy(t).y},e}(o.XYGlyphView),r.AnnularWedge=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.AnnularWedgeView,e.prototype.type="AnnularWedge",e.mixins(["line","fill"]),e.define({direction:[a.Direction,"anticlock"],inner_radius:[a.DistanceSpec],outer_radius:[a.DistanceSpec],start_angle:[a.AngleSpec],end_angle:[a.AngleSpec]}),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(8),a=t(13);r.AnnulusView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(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,r){var n,i,o,s,a,l,u,c,_,h,p,d,f;for(d=r.sx,f=r.sy,h=r.sinner_radius,p=r.souter_radius,_=[],s=0,l=e.length;s<l;s++)if(i=e[s],!isNaN(d[i]+f[i]+h[i]+p[i])){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,i),t.beginPath(),o)for(c=[!1,!0],a=0,u=c.length;a<u;a++)n=c[a],t.arc(d[i],f[i],h[i],0,Math.PI,n),t.arc(d[i],f[i],p[i],Math.PI,0,!n);else t.arc(d[i],f[i],h[i],0,2*Math.PI,!0),t.arc(d[i],f[i],p[i],2*Math.PI,0,!1);t.fill()}this.visuals.line.doit?(this.visuals.line.set_vectorize(t,i),t.beginPath(),t.arc(d[i],f[i],h[i],0,2*Math.PI),t.moveTo(d[i]+p[i],f[i]),t.arc(d[i],f[i],p[i],0,2*Math.PI),_.push(t.stroke())):_.push(void 0)}return _},e.prototype._hit_point=function(t){var e,r,n,i,o,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k;for(c=[t.vx,t.vy],y=c[0],m=c[1],v=this.renderer.xscale.invert(y),g=v-this.max_radius,b=v+this.max_radius,w=this.renderer.yscale.invert(m),x=w-this.max_radius,k=w+this.max_radius,n=[],e=s.validate_bbox_coords([g,b],[x,k]),_=this.index.indices(e),a=0,l=_.length;a<l;a++)i=_[a],u=Math.pow(this.souter_radius[i],2),o=Math.pow(this.sinner_radius[i],2),h=this.renderer.xscale.compute(v),p=this.renderer.xscale.compute(this._x[i]),d=this.renderer.yscale.compute(w),f=this.renderer.yscale.compute(this._y[i]),r=Math.pow(h-p,2)+Math.pow(d-f,2),r<=u&&r>=o&&n.push([i,r]);return s.create_1d_hit_test_result(n)},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){var s,a,l,u,c,_,h;return a=[o],_={},_[o]=(e+r)/2,h={},h[o]=(n+i)/2,l=.5*Math.min(Math.abs(r-e),Math.abs(i-n)),u={},u[o]=.4*l,c={},c[o]=.8*l,s={sx:_,sy:h,sinner_radius:u,souter_radius:c},this._render(t,a,s)},e}(o.XYGlyphView),r.Annulus=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.AnnulusView,e.prototype.type="Annulus",e.mixins(["line","fill"]),e.define({inner_radius:[a.DistanceSpec],outer_radius:[a.DistanceSpec]}),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(13);r.ArcView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(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,r){var n,i,o,s,a,l,u,c,_,h;if(_=r.sx,h=r.sy,c=r.sradius,i=r._start_angle,n=r._end_angle,this.visuals.line.doit){for(o=this.model.properties.direction.value(),u=[],a=0,l=e.length;a<l;a++)s=e[a],isNaN(_[s]+h[s]+c[s]+i[s]+n[s])||(t.beginPath(),t.arc(_[s],h[s],c[s],i[s],n[s],o),this.visuals.line.set_vectorize(t,s),u.push(t.stroke()));return u}},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_line_legend(t,e,r,n,i,o)},e}(o.XYGlyphView),r.Arc=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.ArcView,e.prototype.type="Arc",e.mixins(["line"]),e.define({direction:[s.Direction,"anticlock"],radius:[s.DistanceSpec],start_angle:[s.AngleSpec],end_angle:[s.AngleSpec]}),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(34),a=t(104);n=function(t,e,r,n,i,o,s,a){var l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M;for(x=[],_=[[],[]],p=y=0;y<=2;p=++y)if(0===p?(u=6*t-12*r+6*i,l=-3*t+9*r-9*i+3*s,h=3*r-3*t):(u=6*e-12*n+6*o,l=-3*e+9*n-9*o+3*a,h=3*n-3*e),Math.abs(l)<1e-12){if(Math.abs(u)<1e-12)continue;g=-h/u,0<g&&g<1&&x.push(g)}else c=u*u-4*h*l,v=Math.sqrt(c),c<0||(b=(-u+v)/(2*l),0<b&&b<1&&x.push(b),w=(-u-v)/(2*l),0<w&&w<1&&x.push(w));for(d=x.length,f=d;d--;)g=x[d],m=1-g,k=m*m*m*t+3*m*m*g*r+3*m*g*g*i+g*g*g*s,_[0][d]=k,M=m*m*m*e+3*m*m*g*n+3*m*g*g*o+g*g*g*a,_[1][d]=M;return _[0][f]=t,_[1][f]=e,_[0][f+1]=s,_[1][f+1]=a,[Math.min.apply(null,_[0]),Math.max.apply(null,_[1]),Math.max.apply(null,_[0]),Math.min.apply(null,_[1])]},r.BezierView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype._index_data=function(){var t,e,r,i,o,a,l,u,c;for(r=[],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]+this._cx0[t]+this._cy0[t]+this._cx1[t]+this._cy1[t])||(o=n(this._x0[t],this._y0[t],this._x1[t],this._y1[t],this._cx0[t],this._cy0[t],this._cx1[t],this._cy1[t]),a=o[0],u=o[1],l=o[2],c=o[3],r.push({minX:a,minY:u,maxX:l,maxY:c,i:t}));return new s.RBush(r)},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p,d,f;if(h=r.sx0,d=r.sy0,p=r.sx1,f=r.sy1,a=r.scx,l=r.scx0,c=r.scy0,u=r.scx1,_=r.scy1,this.visuals.line.doit){for(s=[],i=0,o=e.length;i<o;i++)n=e[i],isNaN(h[n]+d[n]+p[n]+f[n]+l[n]+c[n]+u[n]+_[n])||(t.beginPath(),t.moveTo(h[n],d[n]),t.bezierCurveTo(l[n],c[n],u[n],_[n],p[n],f[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke()));return s}},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_line_legend(t,e,r,n,i,o)},e}(a.GlyphView),r.Bezier=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.default_view=r.BezierView,e.prototype.type="Bezier",e.coords([["x0","y0"],["x1","y1"],["cx0","cy0"],["cx1","cy1"]]),e.mixins(["line"]),e}(a.Glyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(8),a=t(13);r.CircleView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(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,r,n,i;for(n=this._size,i=[],t=0,r=n.length;t<r;t++)e=n[t],i.push(e/2);return i}.call(this)},e.prototype._mask_data=function(t){var e,r,n,i,o,a,l,u,c,_,h,p,d,f,y;return r=this.renderer.plot_view.frame.h_range,h=this.renderer.plot_view.frame.v_range,null!=this._radius&&"data"===this.model.properties.radius.units?(l=r.start,u=r.end,n=this.renderer.xscale.v_invert([l,u]),p=n[0],d=n[1],p-=this.max_radius,d+=this.max_radius,c=h.start,_=h.end,i=this.renderer.yscale.v_invert([c,_]),f=i[0],y=i[1],f-=this.max_radius,y+=this.max_radius):(l=r.start-this.max_size,u=r.end+this.max_size,o=this.renderer.xscale.v_invert([l,u]),p=o[0],d=o[1],c=h.start-this.max_size,_=h.end+this.max_size,a=this.renderer.yscale.v_invert([c,_]),f=a[0],y=a[1]),e=s.validate_bbox_coords([p,d],[f,y]),this.index.indices(e)},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u;for(l=r.sx,u=r.sy,a=r.sradius,s=[],i=0,o=e.length;i<o;i++)n=e[i],isNaN(l[n]+u[n]+a[n])||(t.beginPath(),t.arc(l[n],u[n],a[n],0,2*Math.PI,!1),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,n),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,n),s.push(t.stroke())):s.push(void 0));return s},e.prototype._hit_point=function(t){var e,r,n,i,o,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E,z,C,N;if(h=[t.vx,t.vy],k=h[0],T=h[1],A=this.renderer.xscale.invert(k),z=this.renderer.yscale.invert(T),null!=this._radius&&"data"===this.model.properties.radius.units?(j=A-this.max_radius,E=A+this.max_radius,C=z-this.max_radius,N=z+this.max_radius):(M=k-this.max_size,S=k+this.max_size,p=this.renderer.xscale.v_invert([M,S]),j=p[0],E=p[1],d=[Math.min(j,E),Math.max(j,E)],j=d[0],E=d[1],O=T-this.max_size,P=T+this.max_size,f=this.renderer.yscale.v_invert([O,P]),C=f[0],N=f[1],y=[Math.min(C,N),Math.max(C,N)],C=y[0],N=y[1]),e=s.validate_bbox_coords([j,E],[C,N]),r=this.index.indices(e),i=[],null!=this._radius&&"data"===this.model.properties.radius.units)for(a=0,u=r.length;a<u;a++)o=r[a],_=Math.pow(this.sradius[o],2),v=this.renderer.xscale.compute(A),g=this.renderer.xscale.compute(this._x[o]),w=this.renderer.yscale.compute(z),x=this.renderer.yscale.compute(this._y[o]),n=Math.pow(v-g,2)+Math.pow(w-x,2),n<=_&&i.push([o,n]);else for(m=this.renderer.plot_view.canvas.vx_to_sx(k),b=this.renderer.plot_view.canvas.vy_to_sy(T),l=0,c=r.length;l<c;l++)o=r[l],_=Math.pow(this.sradius[o],2),n=Math.pow(this.sx[o]-m,2)+Math.pow(this.sy[o]-b,2),n<=_&&i.push([o,n]);return s.create_1d_hit_test_result(i)},e.prototype._hit_span=function(t){var e,r,n,i,o,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S;return u=[t.vx,t.vy],y=u[0],g=u[1],c=this.bounds(),o=c.minX,a=c.minY,n=c.maxX,i=c.maxY,f=s.create_hit_test_result(),"h"===t.direction?(M=a,S=i,null!=this._radius&&"data"===this.model.properties.radius.units?(m=y-this.max_radius,v=y+this.max_radius,_=this.renderer.xscale.v_invert([m,v]),x=_[0],k=_[1]):(l=this.max_size/2,m=y-l,v=y+l,h=this.renderer.xscale.v_invert([m,v]),x=h[0],k=h[1])):(x=o,k=n,null!=this._radius&&"data"===this.model.properties.radius.units?(b=g-this.max_radius,w=g+this.max_radius,p=this.renderer.yscale.v_invert([b,w]),M=p[0],S=p[1]):(l=this.max_size/2,b=g-l,w=g+l,d=this.renderer.yscale.v_invert([b,w]),M=d[0],S=d[1])),e=s.validate_bbox_coords([x,k],[M,S]),r=this.index.indices(e),f["1d"].indices=r,f},e.prototype._hit_rect=function(t){var e,r,n,i,o,a,l,u;return r=this.renderer.xscale.v_invert([t.vx0,t.vx1]),o=r[0],a=r[1],n=this.renderer.yscale.v_invert([t.vy0,t.vy1]),l=n[0],u=n[1],e=s.validate_bbox_coords([o,a],[l,u]),i=s.create_hit_test_result(),i["1d"].indices=this.index.indices(e),i},e.prototype._hit_poly=function(t){var e,r,n,i,o,a,l,u,c,_,h,p,d;for(a=[t.vx,t.vy],p=a[0],d=a[1],_=this.renderer.plot_view.canvas.v_vx_to_sx(p),h=this.renderer.plot_view.canvas.v_vy_to_sy(d),e=function(){c=[];for(var t=0,e=this.sx.length;0<=e?t<e:t>e;0<=e?t++:t--)c.push(t);return c}.apply(this),r=[],n=o=0,l=e.length;0<=l?o<l:o>l;n=0<=l?++o:--o)i=e[n],s.point_in_poly(this.sx[n],this.sy[n],_,h)&&r.push(i);return u=s.create_hit_test_result(),u["1d"].indices=r,u},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){var s,a,l,u,c;return a=[o],u={},u[o]=(e+r)/2,c={},c[o]=(n+i)/2,l={},l[o]=.2*Math.min(Math.abs(r-e),Math.abs(i-n)),s={sx:u,sy:c,sradius:l},this._render(t,a,s)},e}(o.XYGlyphView),r.Circle=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.CircleView,e.prototype.type="Circle",e.mixins(["line","fill"]),e.define({angle:[a.AngleSpec,0],size:[a.DistanceSpec,{units:"screen",value:4}],radius:[a.DistanceSpec,null],radius_dimension:[a.String,"x"]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.properties.radius.optional=!0},e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(13);r.EllipseView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(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,r){var n,i,o,s,a,l,u,c;for(u=r.sx,c=r.sy,l=r.sw,a=r.sh,s=[],i=0,o=e.length;i<o;i++)n=e[i],isNaN(u[n]+c[n]+l[n]+a[n]+this._angle[n])||(t.beginPath(),t.ellipse(u[n],c[n],l[n]/2,a[n]/2,this._angle[n],0,2*Math.PI),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,n),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,n),s.push(t.stroke())):s.push(void 0));return s},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){var s,a,l,u,c,_,h,p;return l=[o],h={},h[o]=(e+r)/2,p={},p[o]=(n+i)/2,u=this.sw[o]/this.sh[o],s=.8*Math.min(Math.abs(r-e),Math.abs(i-n)),_={},c={},u>1?(_[o]=s,c[o]=s/u):(_[o]=s*u,c[o]=s),a={sx:h,sy:p,sw:_,sh:c},this._render(t,l,a)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(o.XYGlyphView),r.Ellipse=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.EllipseView,e.prototype.type="Ellipse",e.mixins(["line","fill"]),e.define({angle:[s.AngleSpec,0],width:[s.DistanceSpec],height:[s.DistanceSpec]}),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(13),s=t(21),a=t(30),l=t(43),u=t(48),c=t(44),_=t(12),h=t(28),p=t(40),d=t(110);r.GlyphView=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return n(r,e),r.prototype.initialize=function(e){var n,i,o,s;if(r.__super__.initialize.call(this,e),this._nohit_warned={},this.renderer=e.renderer,this.visuals=new c.Visuals(this.model),i=this.renderer.plot_view.canvas_view.ctx,null!=i.glcanvas){try{s=t(418)}catch(a){if(o=a,"MODULE_NOT_FOUND"!==o.code)throw o;_.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&&(n=s[this.model.type+"GLGlyph"],null!=n))return this.glglyph=new n(i.glcanvas.gl,this)}},r.prototype.set_visuals=function(t){if(this.visuals.warm_cache(t),null!=this.glglyph)return this.glglyph.set_visuals_changed()},r.prototype.render=function(t,e,r){if(t.beginPath(),null==this.glglyph||!this.glglyph.render(t,e,r))return this._render(t,e,r)},r.prototype.has_finished=function(){return!0},r.prototype.notify_finished=function(){return this.renderer.notify_finished()},r.prototype.bounds=function(){return null==this.index?s.empty():this._bounds(this.index.bbox)},r.prototype.log_bounds=function(){var t,e,r,n,i,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,n=o.length;e<n;e++)l=o[e],l.minX<t.minX&&(t.minX=l.minX),l.maxX>t.maxX&&(t.maxX=l.maxX);for(r=0,i=a.length;r<i;r++)u=a[r],u.minY<t.minY&&(t.minY=u.minY),u.maxY>t.maxY&&(t.maxY=u.maxY);return this._bounds(t)},r.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}},r.prototype.get_anchor_point=function(t,e,r){var n,i;switch(n=r[0],i=r[1],t){case"center":return{x:this.scx(e,n,i),y:this.scy(e,n,i)};default:return null}},r.prototype.scx=function(t){return this.sx[t]},r.prototype.scy=function(t){return this.sy[t]},r.prototype.sdist=function(t,e,r,n,i){var o,s,a,l,u,c,_;return null==n&&(n="edge"),null==i&&(i=!1),null!=t.source_range.v_synthetic&&(e=t.source_range.v_synthetic(e)),"center"===n?(s=function(){var t,e,n;for(n=[],t=0,e=r.length;t<e;t++)o=r[t],n.push(o/2);return n}(),l=function(){var t,r,n;for(n=[],a=t=0,r=e.length;0<=r?t<r:t>r;a=0<=r?++t:--t)n.push(e[a]-s[a]);return n}(),u=function(){var t,r,n;for(n=[],a=t=0,r=e.length;0<=r?t<r:t>r;a=0<=r?++t:--t)n.push(e[a]+s[a]);return n}()):(l=e,u=function(){var t,e,n;for(n=[],a=t=0,e=l.length;0<=e?t<e:t>e;a=0<=e?++t:--t)n.push(l[a]+r[a]);return n}()),c=t.v_compute(l),_=t.v_compute(u),i?function(){var t,e,r;for(r=[],a=t=0,e=c.length;0<=e?t<e:t>e;a=0<=e?++t:--t)r.push(Math.ceil(Math.abs(_[a]-c[a])));return r}():function(){var t,e,r;for(r=[],a=t=0,e=c.length;0<=e?t<e:t>e;a=0<=e?++t:--t)r.push(Math.abs(_[a]-c[a]));return r}()},r.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return null},r.prototype._generic_line_legend=function(t,e,r,n,i,o){return t.save(),t.beginPath(),t.moveTo(e,(n+i)/2),t.lineTo(r,(n+i)/2),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,o),t.stroke()),t.restore()},r.prototype._generic_area_legend=function(t,e,r,n,i,o){var s,a,l,u,c,_,h,p,d;if(u=[o],d=Math.abs(r-e),a=.1*d,l=Math.abs(i-n),s=.1*l,c=e+a,_=r-a,h=n+s,p=i-s,this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,o),t.fillRect(c,h,_-c,p-h)),this.visuals.line.doit)return t.beginPath(),t.rect(c,h,_-c,p-h),this.visuals.line.set_vectorize(t,o),t.stroke()},r.prototype.hit_test=function(t){var e,r;return r=null,e="_hit_"+t.type,null!=this[e]?r=this[e](t):null==this._nohit_warned[t.type]&&(_.logger.debug("'"+t.type+"' selection not available for "+this.model.type),this._nohit_warned[t.type]=!0),r},r.prototype.set_data=function(t,e,r){var n,i,o,s,l,u,c,_,p,f,y,m,v,g,b;if(n=this.model.materialize_dataspecs(t),e&&!(this instanceof d.LineView)){i={};for(l in n)y=n[l],"_"===l.charAt(0)?i[l]=function(){var t,r,n;for(n=[],t=0,r=e.length;t<r;t++)o=e[t],n.push(y[o]);return n}():i[l]=y;n=i}if(h.extend(this,n),this.renderer.plot_view.model.use_map&&(null!=this._x&&(c=a.project_xy(this._x,this._y),this._x=c[0],this._y=c[1]),null!=this._xs&&(_=a.project_xsys(this._xs,this._ys),this._xs=_[0],this._ys=_[1])),null!=this.renderer.plot_view.frame.x_ranges)for(v=this.renderer.plot_view.frame.x_ranges[this.model.x_range_name],b=this.renderer.plot_view.frame.y_ranges[this.model.y_range_name],p=this.model._coords,s=0,u=p.length;s<u;s++)f=p[s],m=f[0],g=f[1],m="_"+m,g="_"+g,null!=v.v_synthetic&&(this[m]=v.v_synthetic(this[m])),null!=b.v_synthetic&&(this[g]=b.v_synthetic(this[g]));return null!=this.glglyph&&this.glglyph.set_data_changed(this._x.length),this._set_data(t,r),this.index=this._index_data()},r.prototype._set_data=function(){},r.prototype._index_data=function(){},r.prototype.mask_data=function(t){return null!=this.glglyph?t:this._mask_data(t)},r.prototype._mask_data=function(t){return t},r.prototype._bounds=function(t){return t},r.prototype.map_data=function(){var t,e,r,n,i,o,s,a,l,u,c,_,h,d,f,y,m,v,g;for(i=this.model._coords,e=0,n=i.length;e<n;e++)if(o=i[e],v=o[0],g=o[1],f="s"+v,m="s"+g,v="_"+v,g="_"+g,p.isArray(null!=(s=this[v])?s[0]:void 0)||(null!=(a=this[v])&&null!=(l=a[0])?l.buffer:void 0)instanceof ArrayBuffer)for(u=[[],[]],this[f]=u[0],this[m]=u[1],t=r=0,c=this[v].length;0<=c?r<c:r>c;t=0<=c?++r:--r)_=this.map_to_screen(this[v][t],this[g][t]),d=_[0],y=_[1],this[f].push(d),this[m].push(y);else h=this.map_to_screen(this[v],this[g]),this[f]=h[0],this[m]=h[1];return this._map_data()},r.prototype._map_data=function(){},r.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)},r}(l.View),r.Glyph=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._coords=[],e.coords=function(t){var e,r,n,i,s,a,l;for(e=this.prototype._coords.concat(t),this.prototype._coords=e,s={},r=0,n=t.length;r<n;r++)i=t[r],a=i[0],l=i[1],s[a]=[o.NumberSpec],s[l]=[o.NumberSpec];return this.define(s)},e.internal({x_range_name:[o.String,"default"],y_range_name:[o.String,"default"]}),e}(u.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(34),s=t(104),a=t(8),l=t(13);r.HBarView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._map_data=function(){var t,e,r,n,i,o;for(o=this.renderer.yscale.v_compute(this._y),this.sy=this.renderer.plot_view.canvas.v_vy_to_sy(o),i=this.renderer.xscale.v_compute(this._right),this.sright=this.renderer.plot_view.canvas.v_vx_to_sx(i),n=this.renderer.xscale.v_compute(this._left),this.sleft=this.renderer.plot_view.canvas.v_vx_to_sx(n),this.stop=[],this.sbottom=[],this.sh=this.sdist(this.renderer.yscale,this._y,this._height,"center"),t=e=0,r=this.sy.length;0<=r?e<r:e>r;t=0<=r?++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.prototype._index_data=function(){var t,e,r,n,i,s,a,l;for(i=[],e=r=0,a=this._y.length;0<=a?r<a:r>a;e=0<=a?++r:--r)n=Math.min(this._left[e],this._right[e]),
s=Math.max(this._left[e],this._right[e]),l=this._y[e]+.5*this._height[e],t=this._y[e]-.5*this._height[e],!isNaN(n+s+l+t)&&isFinite(n+s+l+t)&&i.push({minX:n,minY:t,maxX:s,maxY:l,i:e});return new o.RBush(i)},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c;for(l=r.sleft,u=r.sright,c=r.stop,a=r.sbottom,s=[],i=0,o=e.length;i<o;i++)n=e[i],isNaN(l[n]+c[n]+u[n]+a[n])||(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,n),t.fillRect(l[n],c[n],u[n]-l[n],a[n]-c[n])),this.visuals.line.doit?(t.beginPath(),t.rect(l[n],c[n],u[n]-l[n],a[n]-c[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke())):s.push(void 0));return s},e.prototype._hit_point=function(t){var e,r,n,i,o,s,l;return r=[t.vx,t.vy],i=r[0],o=r[1],s=this.renderer.xscale.invert(i),l=this.renderer.yscale.invert(o),e=this.index.indices({minX:s,minY:l,maxX:s,maxY:l}),n=a.create_hit_test_result(),n["1d"].indices=e,n},e.prototype.scx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_area_legend(t,e,r,n,i,o)},e}(s.GlyphView),r.HBar=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.HBarView,e.prototype.type="HBar",e.coords([["y","left"]]),e.mixins(["line","fill"]),e.define({height:[l.DistanceSpec],right:[l.NumberSpec]}),e.override({left:0}),e}(s.Glyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(123),a=t(141),l=t(13),u=t(20);r.ImageView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),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,r,n,i,o,s,a,l,c,_,h;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)),_=[],o=l=0,c=this._image.length;0<=c?l<c:l>c;o=0<=c?++l:--l)h=[],null!=this._image_shape&&(h=this._image_shape[o]),h.length>0?(a=this._image[o],this._height[o]=h[0],this._width[o]=h[1]):(a=u.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]?r=this.image_data[o]:(r=document.createElement("canvas"),r.width=this._width[o],r.height=this._height[o]),i=r.getContext("2d"),s=i.getImageData(0,0,this._width[o],this._height[o]),n=this.model.color_mapper,t=n.v_map_screen(a,!0),e=new Uint8Array(t),s.data.set(e),i.putImageData(s,0,0),this.image_data[o]=r,this.max_dw=0,"data"===this._dw.units&&(this.max_dw=u.max(this._dw)),this.max_dh=0,"data"===this._dh.units?_.push(this.max_dh=u.max(this._dh)):_.push(void 0);return _},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,r){var n,i,o,s,a,l,u,c,_,h;for(i=r.image_data,c=r.sx,_=r.sy,u=r.sw,l=r.sh,a=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),o=0,s=e.length;o<s;o++)n=e[o],null!=i[n]&&(isNaN(c[n]+_[n]+u[n]+l[n])||(h=_[n],t.translate(0,h),t.scale(1,-1),t.translate(0,-h),t.drawImage(i[n],0|c[n],0|_[n],u[n],l[n]),t.translate(0,h),t.scale(1,-1),t.translate(0,-h)));return t.setImageSmoothingEnabled(a)},e.prototype.bounds=function(){var t;return t=this.index.bbox,t.maxX+=this.max_dw,t.maxY+=this.max_dh,t},e}(s.XYGlyphView),n=function(){return[0,2434341,5395026,7566195,9868950,12434877,14277081,15790320,16777215]},r.Image=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.default_view=r.ImageView,e.prototype.type="Image",e.define({image:[l.NumberSpec],dw:[l.DistanceSpec],dh:[l.DistanceSpec],dilate:[l.Bool,!1],color_mapper:[l.Instance,function(){return new a.LinearColorMapper({palette:n()})}]}),e}(s.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(13),a=t(20);r.ImageRGBAView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._set_data=function(t,e){var r,n,i,o,s,l,u,c,_,h,p,d,f,y,m;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)),y=[],u=h=0,d=this._image.length;0<=d?h<d:h>d;u=0<=d?++h:--h)if(!(null!=e&&e.indexOf(u)<0)){if(m=[],null!=this._image_shape&&(m=this._image_shape[u]),m.length>0)r=this._image[u].buffer,this._height[u]=m[0],this._width[u]=m[1];else{for(l=a.concat(this._image[u]),r=new ArrayBuffer(4*l.length),o=new Uint32Array(r),_=p=0,f=l.length;0<=f?p<f:p>f;_=0<=f?++p:--p)o[_]=l[_];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]?i=this.image_data[u]:(i=document.createElement("canvas"),i.width=this._width[u],i.height=this._height[u]),s=i.getContext("2d"),c=s.getImageData(0,0,this._width[u],this._height[u]),n=new Uint8Array(r),c.data.set(n),s.putImageData(c,0,0),this.image_data[u]=i,this.max_dw=0,"data"===this._dw.units&&(this.max_dw=a.max(this._dw)),this.max_dh=0,"data"===this._dh.units?y.push(this.max_dh=a.max(this._dh)):y.push(void 0)}return y},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,r){var n,i,o,s,a,l,u,c,_,h;for(i=r.image_data,c=r.sx,_=r.sy,u=r.sw,l=r.sh,a=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),o=0,s=e.length;o<s;o++)n=e[o],isNaN(c[n]+_[n]+u[n]+l[n])||(h=_[n],t.translate(0,h),t.scale(1,-1),t.translate(0,-h),t.drawImage(i[n],0|c[n],0|_[n],u[n],l[n]),t.translate(0,h),t.scale(1,-1),t.translate(0,-h));return t.setImageSmoothingEnabled(a)},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),r.ImageRGBA=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.ImageRGBAView,e.prototype.type="ImageRGBA",e.define({image:[s.NumberSpec],dw:[s.DistanceSpec],dh:[s.DistanceSpec],dilate:[s.Bool,!1]}),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(104),s=t(12),a=t(13);r.ImageURLView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.connect(this.model.properties.global_alpha.change,function(t){return function(){return t.renderer.request_render()}}(this))},e.prototype._index_data=function(){},e.prototype._set_data=function(){var t,e,r,n,i,o,a;for(null!=this.image&&this.image.length===this._url.length||(this.image=function(){var t,r,n,i;for(n=this._url,i=[],t=0,r=n.length;t<r;t++)e=n[t],i.push(null);return i}.call(this)),o=this.model.retry_attempts,a=this.model.retry_timeout,this.retries=function(){var t,r,n,i;for(n=this._url,i=[],t=0,r=n.length;t<r;t++)e=n[t],i.push(o);return i}.call(this),i=[],t=r=0,n=this._url.length;0<=n?r<n:r>n;t=0<=n?++r:--r)null!=this._url[t]&&(e=new Image,e.onerror=function(t){return function(e,r){return function(){return t.retries[e]>0?(s.logger.trace("ImageURL failed to load "+t._url[e]+" image, retrying in "+a+" ms"),setTimeout(function(){return r.src=t._url[e]},a)):s.logger.warn("ImageURL unable to load "+t._url[e]+" image after "+o+" retries"),t.retries[e]-=1}}}(this)(t,e),e.onload=function(t){return function(e,r){return function(){return t.image[r]=e,t.renderer.request_render()}}}(this)(e,t),i.push(e.src=this._url[t]));return i},e.prototype.has_finished=function(){return e.__super__.has_finished.call(this)&&this._images_rendered===!0},e.prototype._map_data=function(){var t,e,r;switch(e=function(){var t,e,n,i;if(null!=this.model.w)return this._w;for(n=this._x,i=[],t=0,e=n.length;t<e;t++)r=n[t],i.push(NaN);return i}.call(this),t=function(){var t,e,n,i;if(null!=this.model.h)return this._h;for(n=this._x,i=[],t=0,e=n.length;t<e;t++)r=n[t],i.push(NaN);return i}.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,r){var n,i,o,s,a,l,u,c,_,h,p,d;for(i=r._url,l=r.image,p=r.sx,d=r.sy,h=r.sw,_=r.sh,n=r._angle,s=this.renderer.plot_view.frame,t.rect(s._left.value+1,s._bottom.value+1,s._width.value-2,s._height.value-2),t.clip(),o=!0,u=0,c=e.length;u<c;u++)a=e[u],isNaN(p[a]+d[a]+n[a])||this.retries[a]!==-1&&(null!=l[a]?this._render_image(t,a,l[a],p,d,h,_,n):o=!1);if(o&&!this._images_rendered)return this._images_rendered=!0,this.notify_finished()},e.prototype._final_sx_sy=function(t,e,r,n,i){switch(t){case"top_left":return[e,r];case"top_center":return[e-n/2,r];case"top_right":return[e-n,r];case"center_right":return[e-n,r-i/2];case"bottom_right":return[e-n,r-i];case"bottom_center":return[e-n/2,r-i];case"bottom_left":return[e,r-i];case"center_left":return[e,r-i/2];case"center":return[e-n/2,r-i/2]}},e.prototype._render_image=function(t,e,r,n,i,o,s,a){var l,u;return isNaN(o[e])&&(o[e]=r.width),isNaN(s[e])&&(s[e]=r.height),l=this.model.anchor,u=this._final_sx_sy(l,n[e],i[e],o[e],s[e]),n=u[0],i=u[1],t.save(),t.globalAlpha=this.model.global_alpha,a[e]?(t.translate(n,i),t.rotate(a[e]),t.drawImage(r,0,0,o[e],s[e]),t.rotate(-a[e]),t.translate(-n,-i)):t.drawImage(r,n,i,o[e],s[e]),t.restore()},e}(o.GlyphView),r.ImageURL=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.ImageURLView,e.prototype.type="ImageURL",e.coords([["x","y"]]),e.mixins([]),e.define({url:[a.StringSpec],anchor:[a.Anchor,"top_left"],global_alpha:[a.Number,1],angle:[a.AngleSpec,0],w:[a.DistanceSpec],h:[a.DistanceSpec],dilate:[a.Bool,!1],retry_attempts:[a.Number,0],retry_timeout:[a.Number,0]}),e}(o.Glyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(98);r.AnnularWedge=n.AnnularWedge;var i=t(99);r.Annulus=i.Annulus;var o=t(100);r.Arc=o.Arc;var s=t(101);r.Bezier=s.Bezier;var a=t(102);r.Circle=a.Circle;var l=t(103);r.Ellipse=l.Ellipse;var u=t(104);r.Glyph=u.Glyph;var c=t(105);r.HBar=c.HBar;var _=t(106);r.Image=_.Image;var h=t(107);r.ImageRGBA=h.ImageRGBA;var p=t(108);r.ImageURL=p.ImageURL;var d=t(110);r.Line=d.Line;var f=t(111);r.MultiLine=f.MultiLine;var y=t(112);r.Oval=y.Oval;var m=t(113);r.Patch=m.Patch;var v=t(114);r.Patches=v.Patches;var g=t(115);r.Quad=g.Quad;var b=t(116);r.Quadratic=b.Quadratic;var w=t(117);r.Ray=w.Ray;var x=t(118);r.Rect=x.Rect;var k=t(119);r.Segment=k.Segment;var M=t(120);r.Text=M.Text;var S=t(121);r.VBar=S.VBar;var T=t(122);r.Wedge=T.Wedge;var O=t(123);r.XYGlyph=O.XYGlyph},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(8);r.LineView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u;for(l=r.sx,u=r.sy,n=!1,this.visuals.line.set_value(t),s=null,o=0,a=e.length;o<a;o++){if(i=e[o],n){if(!isFinite(l[i]+u[i])){t.stroke(),t.beginPath(),n=!1,s=i;continue}null!==s&&i-s>1&&(t.stroke(),n=!1)}n?t.lineTo(l[i],u[i]):(t.beginPath(),t.moveTo(l[i],u[i]),n=!0),s=i}if(n)return t.stroke()},e.prototype._hit_point=function(t){var e,r,n,i,o,a,l,u,c,_,h;for(c=s.create_hit_test_result(),a={x:this.renderer.plot_view.canvas.vx_to_sx(t.vx),y:this.renderer.plot_view.canvas.vy_to_sy(t.vy)},_=9999,h=Math.max(2,this.visuals.line.line_width.value()/2),r=n=0,l=this.sx.length-1;0<=l?n<l:n>l;r=0<=l?++n:--n)u=[{x:this.sx[r],y:this.sy[r]},{x:this.sx[r+1],y:this.sy[r+1]}],i=u[0],o=u[1],e=s.dist_to_segment(a,i,o),e<h&&e<_&&(_=e,c["0d"].glyph=this.model,c["0d"].get_view=function(){return this}.bind(this),c["0d"].flag=!0,c["0d"].indices=[r]);return c},e.prototype._hit_span=function(t){var e,r,n,i,o,a,l,u,c;for(n=[t.vx,t.vy],u=n[0],c=n[1],o=s.create_hit_test_result(),"v"===t.direction?(a=this.renderer.yscale.invert(c),l=this._y):(a=this.renderer.xscale.invert(u),l=this._x),e=r=0,i=l.length-1;0<=i?r<i:r>i;e=0<=i?++r:--r)(l[e]<=a&&a<=l[e+1]||l[e+1]<=a&&a<=l[e])&&(o["0d"].glyph=this.model,o["0d"].get_view=function(){return this}.bind(this),o["0d"].flag=!0,o["0d"].indices.push(e));return o},e.prototype.get_interpolation_hit=function(t,e){var r,n,i,o,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w;return r=[e.vx,e.vy],h=r[0],p=r[1],n=[this._x[t],this._y[t],this._x[t+1],this._y[t+1]],y=n[0],b=n[1],m=n[2],w=n[3],"point"===e.type?(i=this.renderer.yscale.v_invert([p-1,p+1]),v=i[0],g=i[1],o=this.renderer.xscale.v_invert([h-1,h+1]),d=o[0],f=o[1]):"v"===e.direction?(a=this.renderer.yscale.v_invert([p,p]),v=a[0],g=a[1],l=[y,m],d=l[0],f=l[1]):(u=this.renderer.xscale.v_invert([h,h]),d=u[0],f=u[1],c=[b,w],v=c[0],g=c[1]),_=s.check_2_segments_intersect(d,v,f,g,y,b,m,w),[_.x,_.y]},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_line_legend(t,e,r,n,i,o)},e}(o.XYGlyphView),r.Line=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.LineView,e.prototype.type="Line",e.mixins(["line"]),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(34),s=t(8),a=t(20),l=t(40),u=t(104);r.MultiLineView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._index_data=function(){var t,e,r,n,i,s,u,c;for(r=[],t=e=0,n=this._xs.length;0<=n?e<n:e>n;t=0<=n?++e:--e)null!==this._xs[t]&&0!==this._xs[t].length&&(s=function(){var e,r,n,o;for(n=this._xs[t],o=[],e=0,r=n.length;e<r;e++)i=n[e],l.isStrictNaN(i)||o.push(i);return o}.call(this),c=function(){var e,r,n,i;for(n=this._ys[t],i=[],e=0,r=n.length;e<r;e++)u=n[e],l.isStrictNaN(u)||i.push(u);return i}.call(this),r.push({minX:a.min(s),minY:a.min(c),maxX:a.max(s),maxY:a.max(c),i:t}));return new o.RBush(r)},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p,d;for(h=r.sxs,d=r.sys,c=[],o=0,a=e.length;o<a;o++){for(n=e[o],l=[h[n],d[n]],_=l[0],p=l[1],this.visuals.line.set_vectorize(t,n),i=s=0,u=_.length;0<=u?s<u:s>u;i=0<=u?++s:--s)0!==i?isNaN(_[i])||isNaN(p[i])?(t.stroke(),t.beginPath()):t.lineTo(_[i],p[i]):(t.beginPath(),t.moveTo(_[i],p[i]));c.push(t.stroke())}return c},e.prototype._hit_point=function(t){var e,r,n,i,o,a,l,u,c,_,h,p,d,f,y,m;for(f=s.create_hit_test_result(),c={x:this.renderer.plot_view.canvas.vx_to_sx(t.vx),y:this.renderer.plot_view.canvas.vy_to_sy(t.vy)},y=9999,r={},n=o=0,h=this.sxs.length;0<=h?o<h:o>h;n=0<=h?++o:--o){for(m=Math.max(2,this.visuals.line.cache_select("line_width",n)/2),_=null,i=a=0,p=this.sxs[n].length-1;0<=p?a<p:a>p;i=0<=p?++a:--a)d=[{x:this.sxs[n][i],y:this.sys[n][i]},{x:this.sxs[n][i+1],y:this.sys[n][i+1]}],l=d[0],u=d[1],e=s.dist_to_segment(c,l,u),e<m&&e<y&&(y=e,_=[i]);_&&(r[n]=_)}return f["1d"].indices=function(){var t,e,i,o;for(i=Object.keys(r),o=[],e=0,t=i.length;e<t;e++)n=i[e],o.push(parseInt(n));return o}(),f["2d"].indices=r,f},e.prototype._hit_span=function(t){var e,r,n,i,o,a,l,u,c,_,h,p,d,f;for(l=[t.vx,t.vy],d=l[0],f=l[1],_=s.create_hit_test_result(),"v"===t.direction?(h=this.renderer.yscale.invert(f),p=this._ys):(h=this.renderer.xscale.invert(d),p=this._xs),e={},r=i=0,u=p.length;0<=u?i<u:i>u;r=0<=u?++i:--i){for(a=[],n=o=0,c=p[r].length-1;0<=c?o<c:o>c;n=0<=c?++o:--o)p[r][n]<=h&&h<=p[r][n+1]&&a.push(n);a.length>0&&(e[r]=a)}return _["1d"].indices=function(){var t,n,i,o;for(i=Object.keys(e),o=[],n=0,t=i.length;n<t;n++)r=i[n],o.push(parseInt(r));return o}(),_["2d"].indices=e,_},e.prototype.get_interpolation_hit=function(t,e,r){var n,i,o,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x;return n=[r.vx,r.vy],p=n[0],d=n[1],i=[this._xs[t][e],this._ys[t][e],this._xs[t][e+1],this._ys[t][e+1]],m=i[0],w=i[1],v=i[2],x=i[3],"point"===r.type?(o=this.renderer.yscale.v_invert([d-1,d+1]),g=o[0],b=o[1],a=this.renderer.xscale.v_invert([p-1,p+1]),f=a[0],y=a[1]):"v"===r.direction?(l=this.renderer.yscale.v_invert([d,d]),g=l[0],b=l[1],u=[m,v],f=u[0],y=u[1]):(c=this.renderer.xscale.v_invert([p,p]),f=c[0],y=c[1],_=[w,x],g=_[0],b=_[1]),h=s.check_2_segments_intersect(f,g,y,b,m,w,v,x),[h.x,h.y]},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_line_legend(t,e,r,n,i,o)},e}(u.GlyphView),r.MultiLine=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.MultiLineView,e.prototype.type="MultiLine",e.coords([["xs","ys"]]),e.mixins(["line"]),e}(u.Glyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(13);r.OvalView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(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,r){var n,i,o,s,a,l,u,c;for(u=r.sx,c=r.sy,l=r.sw,a=r.sh,s=[],i=0,o=e.length;i<o;i++)n=e[i],isNaN(u[n]+c[n]+l[n]+a[n]+this._angle[n])||(t.translate(u[n],c[n]),t.rotate(this._angle[n]),t.beginPath(),t.moveTo(0,-a[n]/2),t.bezierCurveTo(l[n]/2,-a[n]/2,l[n]/2,a[n]/2,0,a[n]/2),t.bezierCurveTo(-l[n]/2,a[n]/2,-l[n]/2,-a[n]/2,0,-a[n]/2),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,n),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,n),t.stroke()),t.rotate(-this._angle[n]),s.push(t.translate(-u[n],-c[n])));return s},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){var s,a,l,u,c,_,h,p;return l=[o],h={},h[o]=(e+r)/2,p={},p[o]=(n+i)/2,u=this.sw[o]/this.sh[o],s=.8*Math.min(Math.abs(r-e),Math.abs(i-n)),_={},c={},u>1?(_[o]=s,c[o]=s/u):(_[o]=s*u,c[o]=s),a={sx:h,sy:p,sw:_,sh:c},this._render(t,l,a)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(o.XYGlyphView),r.Oval=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.OvalView,e.prototype.type="Oval",e.mixins(["line","fill"]),e.define({angle:[s.AngleSpec,0],width:[s.DistanceSpec],height:[s.DistanceSpec]}),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123);r.PatchView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u;if(l=r.sx,u=r.sy,this.visuals.fill.doit){for(this.visuals.fill.set_value(t),i=0,s=e.length;i<s;i++)n=e[i],0!==n?isNaN(l[n]+u[n])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(l[n],u[n]):(t.beginPath(),t.moveTo(l[n],u[n]));t.closePath(),t.fill()}if(this.visuals.line.doit){for(this.visuals.line.set_value(t),o=0,a=e.length;o<a;o++)n=e[o],0!==n?isNaN(l[n]+u[n])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(l[n],u[n]):(t.beginPath(),t.moveTo(l[n],u[n]));return t.closePath(),t.stroke()}},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_area_legend(t,e,r,n,i,o)},e}(o.XYGlyphView),r.Patch=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.PatchView,e.prototype.type="Patch",e.mixins(["line","fill"]),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(34),s=t(104),a=t(20),l=t(40),u=t(8);r.PatchesView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._build_discontinuous_object=function(t){var e,r,n,i,o,s,u,c,_;for(r={},n=i=0,_=t.length;0<=_?i<_:i>_;n=0<=_?++i:--i)for(r[n]=[],u=a.copy(t[n]);u.length>0;)o=a.findLastIndex(u,function(t){return l.isStrictNaN(t)}),o>=0?c=u.splice(o):(c=u,u=[]),e=function(){var t,e,r;for(r=[],t=0,e=c.length;t<e;t++)s=c[t],l.isStrictNaN(s)||r.push(s);return r}(),r[n].push(e);return r},e.prototype._index_data=function(){var t,e,r,n,i,s,l,u,c,_,h;for(c=this._build_discontinuous_object(this._xs),h=this._build_discontinuous_object(this._ys),i=[],t=r=0,s=this._xs.length;0<=s?r<s:r>s;t=0<=s?++r:--r)for(e=n=0,l=c[t].length;0<=l?n<l:n>l;e=0<=l?++n:--n)u=c[t][e],_=h[t][e],0!==u.length&&i.push({minX:a.min(u),minY:a.min(_),maxX:a.max(u),maxY:a.max(_),i:t});return new o.RBush(i)},e.prototype._mask_data=function(t){var e,r,n,i,o,s,a,l,c;return s=this.renderer.plot_view.frame.x_ranges["default"],r=[s.min,s.max],i=r[0],o=r[1],c=this.renderer.plot_view.frame.y_ranges["default"],n=[c.min,c.max],a=n[0],l=n[1],e=u.validate_bbox_coords([i,o],[a,l]),this.index.indices(e)},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p,d,f,y;for(d=r.sxs,y=r.sys,this.renderer.sxss=this._build_discontinuous_object(d),this.renderer.syss=this._build_discontinuous_object(y),h=[],o=0,a=e.length;o<a;o++){if(n=e[o],u=[d[n],y[n]],p=u[0],f=u[1],this.visuals.fill.doit){for(this.visuals.fill.set_vectorize(t,n),i=s=0,c=p.length;0<=c?s<c:s>c;i=0<=c?++s:--s)0!==i?isNaN(p[i]+f[i])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(p[i],f[i]):(t.beginPath(),t.moveTo(p[i],f[i]));t.closePath(),t.fill()}if(this.visuals.line.doit){for(this.visuals.line.set_vectorize(t,n),i=l=0,_=p.length;0<=_?l<_:l>_;i=0<=_?++l:--l)0!==i?isNaN(p[i]+f[i])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(p[i],f[i]):(t.beginPath(),t.moveTo(p[i],f[i]));t.closePath(),h.push(t.stroke())}else h.push(void 0)}return h},e.prototype._hit_point=function(t){var e,r,n,i,o,s,a,l,c,_,h,p,d,f,y,m,v,g,b;for(l=[t.vx,t.vy],m=l[0],v=l[1],p=this.renderer.plot_view.canvas.vx_to_sx(m),f=this.renderer.plot_view.canvas.vy_to_sy(v),g=this.renderer.xscale.invert(m),b=this.renderer.yscale.invert(v),e=this.index.indices({minX:g,minY:b,maxX:g,maxY:b}),r=[],n=s=0,c=e.length;0<=c?s<c:s>c;n=0<=c?++s:--s)for(i=e[n],d=this.renderer.sxss[i],y=this.renderer.syss[i],o=a=0,_=d.length;0<=_?a<_:a>_;o=0<=_?++a:--a)u.point_in_poly(p,f,d[o],y[o])&&r.push(i);return h=u.create_hit_test_result(),h["1d"].indices=r,h},e.prototype._get_snap_coord=function(t){var e,r,n,i;for(i=0,e=0,r=t.length;e<r;e++)n=t[e],i+=n;return i/t.length},e.prototype.scx=function(t,e,r){var n,i,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],n=i=0,o=s.length;0<=o?i<o:i>o;n=0<=o?++i:--i)if(u.point_in_poly(e,r,s[n],a[n]))return this._get_snap_coord(s[n]);return null},e.prototype.scy=function(t,e,r){var n,i,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],n=i=0,o=s.length;0<=o?i<o:i>o;n=0<=o?++i:--i)if(u.point_in_poly(e,r,s[n],a[n]))return this._get_snap_coord(a[n])},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_area_legend(t,e,r,n,i,o)},e}(s.GlyphView),r.Patches=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.PatchesView,e.prototype.type="Patches",e.coords([["xs","ys"]]),e.mixins(["line","fill"]),e}(s.Glyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(34),s=t(104),a=t(8);r.QuadView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._index_data=function(){var t,e,r,n,i,s,a,l;for(i=[],e=r=0,a=this._left.length;0<=a?r<a:r>a;e=0<=a?++r:--r)n=this._left[e],s=this._right[e],l=this._top[e],t=this._bottom[e],!isNaN(n+s+l+t)&&isFinite(n+s+l+t)&&i.push({minX:n,minY:t,maxX:s,maxY:l,i:e});return new o.RBush(i)},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c;for(l=r.sleft,u=r.sright,c=r.stop,a=r.sbottom,s=[],i=0,o=e.length;i<o;i++)n=e[i],isNaN(l[n]+c[n]+u[n]+a[n])||(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,n),t.fillRect(l[n],c[n],u[n]-l[n],a[n]-c[n])),this.visuals.line.doit?(t.beginPath(),t.rect(l[n],c[n],u[n]-l[n],a[n]-c[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke())):s.push(void 0));return s},e.prototype._hit_point=function(t){var e,r,n,i,o,s,l;return r=[t.vx,t.vy],i=r[0],o=r[1],s=this.renderer.xscale.invert(i),l=this.renderer.yscale.invert(o),e=this.index.indices({minX:s,minY:l,maxX:s,maxY:l}),n=a.create_hit_test_result(),n["1d"].indices=e,n},e.prototype.get_anchor_point=function(t,e,r){var n,i,o,s;switch(i=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]),n=Math.max(this.sbottom[e],this.stop[e]),t){case"top_left":return{x:i,y:s};case"top_center":return{x:(i+o)/2,y:s};case"top_right":return{x:o,y:s};case"center_right":return{x:o,y:(s+n)/2};case"bottom_right":return{x:o,y:n};case"bottom_center":return{x:(i+o)/2,y:n};case"bottom_left":return{x:i,y:n};case"center_left":return{x:i,y:(s+n)/2};case"center":return{x:(i+o)/2,y:(s+n)/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.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_area_legend(t,e,r,n,i,o)},e}(s.GlyphView),r.Quad=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.QuadView,e.prototype.type="Quad",e.coords([["right","bottom"],["left","top"]]),e.mixins(["line","fill"]),e}(s.Glyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(34),a=t(104);n=function(t,e,r){var n,i;return e===(t+r)/2?[t,r]:(i=(t-e)/(t-2*e+r),n=t*Math.pow(1-i,2)+2*e*(1-i)*i+r*Math.pow(i,2),[Math.min(t,r,n),Math.max(t,r,n)])},r.QuadraticView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype._index_data=function(){var t,e,r,i,o,a,l,u,c,_;for(r=[],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]+this._cx[t]+this._cy[t])||(o=n(this._x0[t],this._cx[t],this._x1[t]),l=o[0],u=o[1],a=n(this._y0[t],this._cy[t],this._y1[t]),c=a[0],_=a[1],r.push({minX:l,minY:c,maxX:u,maxY:_,i:t}));return new s.RBush(r)},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c,_,h;if(u=r.sx0,_=r.sy0,c=r.sx1,h=r.sy1,a=r.scx,l=r.scy,this.visuals.line.doit){for(s=[],i=0,o=e.length;i<o;i++)n=e[i],isNaN(u[n]+_[n]+c[n]+h[n]+a[n]+l[n])||(t.beginPath(),t.moveTo(u[n],_[n]),t.quadraticCurveTo(a[n],l[n],c[n],h[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke()));return s}},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_line_legend(t,e,r,n,i,o)},e}(a.GlyphView),r.Quadratic=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.default_view=r.QuadraticView,e.prototype.type="Quadratic",e.coords([["x0","y0"],["x1","y1"],["cx","cy"]]),e.mixins(["line"]),e}(a.Glyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(13);r.RayView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._map_data=function(){return this.slength=this.sdist(this.renderer.xscale,this._x,this._length)},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p,d,f;if(p=r.sx,d=r.sy,h=r.slength,n=r._angle,this.visuals.line.doit){for(f=this.renderer.plot_view.frame._width.value,i=this.renderer.plot_view.frame._height.value,s=2*(f+i),o=a=0,c=h.length;0<=c?a<c:a>c;o=0<=c?++a:--a)0===h[o]&&(h[o]=s);for(_=[],l=0,u=e.length;l<u;l++)o=e[l],isNaN(p[o]+d[o]+n[o]+h[o])||(t.translate(p[o],d[o]),t.rotate(n[o]),t.beginPath(),t.moveTo(0,0),t.lineTo(h[o],0),this.visuals.line.set_vectorize(t,o),t.stroke(),t.rotate(-n[o]),_.push(t.translate(-p[o],-d[o])));return _}},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_line_legend(t,e,r,n,i,o)},e}(o.XYGlyphView),r.Ray=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.RayView,e.prototype.type="Ray",e.mixins(["line"]),e.define({length:[s.DistanceSpec],angle:[s.AngleSpec]}),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(8),a=t(13),l=t(20);r.RectView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(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,e,r,n;return t=this.renderer.plot_view.canvas,"data"===this.model.properties.width.units?(r=this._map_dist_corner_for_data_side_length(this._x,this._width,this.renderer.xscale,t,0),this.sw=r[0],this.sx0=r[1]):(this.sw=this._width,this.sx0=function(){var t,r,n;for(n=[],e=t=0,r=this.sx.length;0<=r?t<r:t>r;e=0<=r?++t:--t)n.push(this.sx[e]-this.sw[e]/2);return n}.call(this)),"data"===this.model.properties.height.units?(n=this._map_dist_corner_for_data_side_length(this._y,this._height,this.renderer.yscale,t,1),this.sh=n[0],this.sy1=n[1]):(this.sh=this._height,this.sy1=function(){var t,r,n;for(n=[],e=t=0,r=this.sy.length;0<=r?t<r:t>r;e=0<=r?++t:--t)n.push(this.sy[e]-this.sh[e]/2);return n}.call(this)),this.ssemi_diag=function(){var t,r,n;for(n=[],e=t=0,r=this.sw.length;0<=r?t<r:t>r;e=0<=r?++t:--t)n.push(Math.sqrt(this.sw[e]/2*this.sw[e]/2+this.sh[e]/2*this.sh[e]/2));return n}.call(this)},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p,d;if(_=r.sx,p=r.sy,h=r.sx0,d=r.sy1,c=r.sw,u=r.sh,n=r._angle,this.visuals.fill.doit)for(o=0,a=e.length;o<a;o++)i=e[o],isNaN(_[i]+p[i]+h[i]+d[i]+c[i]+u[i]+n[i])||(this.visuals.fill.set_vectorize(t,i),n[i]?(t.translate(_[i],p[i]),t.rotate(n[i]),t.fillRect(-c[i]/2,-u[i]/2,c[i],u[i]),t.rotate(-n[i]),t.translate(-_[i],-p[i])):t.fillRect(h[i],d[i],c[i],u[i]));if(this.visuals.line.doit){for(t.beginPath(),s=0,l=e.length;s<l;s++)i=e[s],isNaN(_[i]+p[i]+h[i]+d[i]+c[i]+u[i]+n[i])||0!==c[i]&&0!==u[i]&&(n[i]?(t.translate(_[i],p[i]),t.rotate(n[i]),t.rect(-c[i]/2,-u[i]/2,c[i],u[i]),t.rotate(-n[i]),t.translate(-_[i],-p[i])):t.rect(h[i],d[i],c[i],u[i]),this.visuals.line.set_vectorize(t,i),t.stroke(),t.beginPath());return t.stroke()}},e.prototype._hit_rect=function(t){var e,r,n,i,o,a,l,u;return r=this.renderer.xscale.v_invert([t.vx0,t.vx1]),o=r[0],a=r[1],n=this.renderer.yscale.v_invert([t.vy0,t.vy1]),l=n[0],u=n[1],e=s.validate_bbox_coords([o,a],[l,u]),i=s.create_hit_test_result(),i["1d"].indices=this.index.indices(e),i},e.prototype._hit_point=function(t){var e,r,n,i,o,a,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E;for(f=[t.vx,t.vy],k=f[0],M=f[1],T=this.renderer.xscale.invert(k),A=this.renderer.yscale.invert(M),g=function(){var t,e,r;for(r=[],a=t=0,e=this.sx0.length;0<=e?t<e:t>e;a=0<=e?++t:--t)r.push(this.sx0[a]+this.sw[a]/2);return r}.call(this),b=function(){var t,e,r;for(r=[],a=t=0,e=this.sy1.length;0<=e?t<e:t>e;a=0<=e?++t:--t)r.push(this.sy1[a]+this.sh[a]/2);return r}.call(this),_=l.max(this._ddist(0,g,this.ssemi_diag)),h=l.max(this._ddist(1,b,this.ssemi_diag)),O=T-_,P=T+_,j=A-h,E=A+h,o=[],e=s.validate_bbox_coords([O,P],[j,E]),y=this.index.indices(e),u=0,c=y.length;u<c;u++)a=y[u],w=this.renderer.plot_view.canvas.vx_to_sx(k),x=this.renderer.plot_view.canvas.vy_to_sy(M),this._angle[a]?(n=Math.sqrt(Math.pow(w-this.sx[a],2)+Math.pow(x-this.sy[a],2)),v=Math.sin(-this._angle[a]),r=Math.cos(-this._angle[a]),p=r*(w-this.sx[a])-v*(x-this.sy[a])+this.sx[a],d=v*(w-this.sx[a])+r*(x-this.sy[a])+this.sy[a],w=p,x=d,S=Math.abs(this.sx[a]-w)<=this.sw[a]/2,i=Math.abs(this.sy[a]-x)<=this.sh[a]/2):(S=w-this.sx0[a]<=this.sw[a]&&w-this.sx0[a]>=0,i=x-this.sy1[a]<=this.sh[a]&&x-this.sy1[a]>=0),i&&S&&o.push(a);return m=s.create_hit_test_result(),m["1d"].indices=o,m},e.prototype._map_dist_corner_for_data_side_length=function(t,e,r,n,i){var o,s,a,l,u,c,_,h;return null!=r.source_range.synthetic&&(t=function(){var e,n,i;for(i=[],e=0,n=t.length;e<n;e++)h=t[e],i.push(r.source_range.synthetic(h));return i}()),s=function(){var r,n,i;for(i=[],o=r=0,n=t.length;0<=n?r<n:r>n;o=0<=n?++r:--r)i.push(Number(t[o])-e[o]/2);return i}(),a=function(){var r,n,i;for(i=[],o=r=0,n=t.length;0<=n?r<n:r>n;o=0<=n?++r:--r)i.push(Number(t[o])+e[o]/2);return i}(),u=r.v_compute(s),c=r.v_compute(a),l=this.sdist(r,s,e,"edge",this.model.dilate),0===i?(_=u[0]<c[0]?u:c,[l,n.v_vx_to_sx(_)]):1===i?(_=u[0]<c[0]?c:u,[l,n.v_vy_to_sy(_)]):void 0},e.prototype._ddist=function(t,e,r){var n,i,o,s,a,l,u;return 0===t?(u=this.renderer.plot_view.canvas.v_sx_to_vx(e),s=this.renderer.xscale):(u=this.renderer.plot_view.canvas.v_vy_to_sy(e),s=this.renderer.yscale),a=u,l=function(){var t,e,i;for(i=[],n=t=0,e=a.length;0<=e?t<e:t>e;n=0<=e?++t:--t)i.push(a[n]+r[n]);return i}(),i=s.v_invert(a),o=s.v_invert(l),function(){var t,e,r;for(r=[],n=t=0,e=i.length;0<=e?t<e:t>e;n=0<=e?++t:--t)r.push(Math.abs(o[n]-i[n]));return r}()},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_area_legend(t,e,r,n,i,o)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(o.XYGlyphView),r.Rect=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.RectView,e.prototype.type="Rect",e.mixins(["line","fill"]),e.define({angle:[a.AngleSpec,0],width:[a.DistanceSpec],height:[a.DistanceSpec],dilate:[a.Bool,!1]}),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(8),s=t(34),a=t(104);r.SegmentView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._index_data=function(){var t,e,r,n;for(r=[],t=e=0,n=this._x0.length;0<=n?e<n:e>n;t=0<=n?++e:--e)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t])||r.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 s.RBush(r)},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c;if(a=r.sx0,u=r.sy0,l=r.sx1,c=r.sy1,this.visuals.line.doit){for(s=[],i=0,o=e.length;i<o;i++)n=e[i],isNaN(a[n]+u[n]+l[n]+c[n])||(t.beginPath(),t.moveTo(a[n],u[n]),t.lineTo(l[n],c[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke()));return s}},e.prototype._hit_point=function(t){var e,r,n,i,s,a,l,u,c,_,h,p,d,f,y,m,v;for(_=[t.vx,t.vy],f=_[0],y=_[1],m=this.renderer.xscale.invert(f,!0),v=this.renderer.yscale.invert(y,!0),c={x:this.renderer.plot_view.canvas.vx_to_sx(f),y:this.renderer.plot_view.canvas.vy_to_sy(y)},n=[],e=this.index.indices({minX:m,minY:v,maxX:m,maxY:v}),s=0,a=e.length;s<a;s++)i=e[s],d=Math.max(2,this.visuals.line.cache_select("line_width",i)/2),h=[{x:this.sx0[i],y:this.sy0[i]},{x:this.sx1[i],y:this.sy1[i]}],l=h[0],u=h[1],r=o.dist_to_segment(c,l,u),r<d&&n.push(i);return p=o.create_hit_test_result(),p["1d"].indices=n,p},e.prototype._hit_span=function(t){var e,r,n,i,s,a,l,u,c,_,h,p,d,f,y,m;for(n=this.renderer.plot_view.frame.h_range,f=this.renderer.plot_view.frame.v_range,l=[t.vx,t.vy],y=l[0],m=l[1],"v"===t.direction?(d=this.renderer.yscale.invert(m),u=[this._y0,this._y1],h=u[0],p=u[1]):(d=this.renderer.xscale.invert(y),c=[this._x0,this._x1],h=c[0],p=c[1]),r=[],e=this.index.indices({minX:this.renderer.xscale.invert(n.min),minY:this.renderer.yscale.invert(f.min),maxX:this.renderer.xscale.invert(n.max),maxY:this.renderer.yscale.invert(f.max)}),s=0,a=e.length;s<a;s++)i=e[s],(h[i]<=d&&d<=p[i]||p[i]<=d&&d<=h[i])&&r.push(i);return _=o.create_hit_test_result(),_["1d"].indices=r,_},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,r,n,i,o){return this._generic_line_legend(t,e,r,n,i,o)},e}(a.GlyphView),r.Segment=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.SegmentView,e.prototype.type="Segment",e.coords([["x0","y0"],["x1","y1"]]),e.mixins(["line"]),e}(a.Glyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(13);r.TextView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c,_,h;for(_=r.sx,h=r.sy,o=r._x_offset,s=r._y_offset,n=r._angle,i=r._text,c=[],l=0,u=e.length;l<u;l++)a=e[l],isNaN(_[a]+h[a]+o[a]+s[a]+n[a])||null==i[a]||(this.visuals.text.doit?(t.save(),t.translate(_[a]+o[a],h[a]+s[a]),t.rotate(n[a]),this.visuals.text.set_vectorize(t,a),t.fillText(i[a],0,0),c.push(t.restore())):c.push(void 0));return c},e.prototype.draw_legend_for_index=function(t,e,r,n,i,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,(i+y2)/2),t.restore()},e}(o.XYGlyphView),r.Text=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.TextView,e.prototype.type="Text",e.mixins(["text"]),e.define({text:[s.StringSpec,{field:"text"}],angle:[s.AngleSpec,0],x_offset:[s.NumberSpec,0],y_offset:[s.NumberSpec,0]}),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(34),s=t(104),a=t(8),l=t(13);r.VBarView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._map_data=function(){var t,e,r,n,i;for(this.sx=this.renderer.xscale.v_compute(this._x),i=this.renderer.yscale.v_compute(this._top),this.stop=this.renderer.plot_view.canvas.v_vy_to_sy(i),n=this.renderer.yscale.v_compute(this._bottom),this.sbottom=this.renderer.plot_view.canvas.v_vy_to_sy(n),this.sleft=[],this.sright=[],this.sw=this.sdist(this.renderer.xscale,this._x,this._width,"center"),t=e=0,r=this.sx.length;0<=r?e<r:e>r;t=0<=r?++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.prototype._index_data=function(){var t,e,r,n,i,s,a,l;for(i=[],e=r=0,a=this._x.length;0<=a?r<a:r>a;e=0<=a?++r:--r)n=this._x[e]-this._width[e]/2,s=this._x[e]+this._width[e]/2,l=Math.max(this._top[e],this._bottom[e]),t=Math.min(this._top[e],this._bottom[e]),!isNaN(n+s+l+t)&&isFinite(n+s+l+t)&&i.push({minX:n,minY:t,maxX:s,maxY:l,i:e});return new o.RBush(i)},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c;for(l=r.sleft,u=r.sright,c=r.stop,a=r.sbottom,s=[],i=0,o=e.length;i<o;i++)n=e[i],isNaN(l[n]+c[n]+u[n]+a[n])||(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,n),t.fillRect(l[n],c[n],u[n]-l[n],a[n]-c[n])),this.visuals.line.doit?(t.beginPath(),t.rect(l[n],c[n],u[n]-l[n],a[n]-c[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke())):s.push(void 0));return s},e.prototype._hit_point=function(t){var e,r,n,i,o,s,l;return r=[t.vx,t.vy],i=r[0],o=r[1],s=this.renderer.xscale.invert(i),l=this.renderer.yscale.invert(o),e=this.index.indices({minX:s,minY:l,maxX:s,maxY:l}),n=a.create_hit_test_result(),n["1d"].indices=e,n},e.prototype.scy=function(t){return(this.stop[t]+this.sbottom[t])/2},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_area_legend(t,e,r,n,i,o)},e}(s.GlyphView),r.VBar=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.VBarView,e.prototype.type="VBar",e.coords([["x","bottom"]]),e.mixins(["line","fill"]),e.define({width:[l.DistanceSpec],top:[l.NumberSpec]}),e.override({bottom:0}),e}(s.Glyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(8),a=t(13),l=t(27);r.WedgeView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(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,r){var n,i,o,s,a,l,u,c,_,h;for(_=r.sx,h=r.sy,c=r.sradius,i=r._start_angle,n=r._end_angle,o=this.model.properties.direction.value(),u=[],a=0,l=e.length;a<l;a++)s=e[a],isNaN(_[s]+h[s]+c[s]+i[s]+n[s])||(t.beginPath(),t.arc(_[s],h[s],c[s],i[s],n[s],o),t.lineTo(_[s],h[s]),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,s),t.fill()),this.visuals.line.doit?(this.visuals.line.set_vectorize(t,s),u.push(t.stroke())):u.push(void 0));return u},e.prototype._hit_point=function(t){var e,r,n,i,o,a,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E,z,C,N,D,F,I;for(f=[t.vx,t.vy],T=f[0],A=f[1],z=this.renderer.xscale.invert(T),D=this.renderer.yscale.invert(A),"data"===this.model.properties.radius.units?(C=z-this.max_radius,N=z+this.max_radius,F=D-this.max_radius,I=D+this.max_radius):(O=T-this.max_radius,P=T+this.max_radius,y=this.renderer.xscale.v_invert([O,P]),C=y[0],N=y[1],j=A-this.max_radius,E=A+this.max_radius,m=this.renderer.yscale.v_invert([j,E]),F=m[0],I=m[1]),n=[],r=s.validate_bbox_coords([C,N],[F,I]),v=this.index.indices(r),c=0,h=v.length;c<h;c++)u=v[c],d=Math.pow(this.sradius[u],2),w=this.renderer.xscale.compute(z),x=this.renderer.xscale.compute(this._x[u]),M=this.renderer.yscale.compute(D),S=this.renderer.yscale.compute(this._y[u]),o=Math.pow(w-x,2)+Math.pow(M-S,2),o<=d&&n.push([u,o]);for(i=this.model.properties.direction.value(),a=[],_=0,p=n.length;_<p;_++)g=n[_],u=g[0],o=g[1],b=this.renderer.plot_view.canvas.vx_to_sx(T),k=this.renderer.plot_view.canvas.vy_to_sy(A),e=Math.atan2(k-this.sy[u],b-this.sx[u]),l.angle_between(-e,-this._start_angle[u],-this._end_angle[u],i)&&a.push([u,o]);return s.create_1d_hit_test_result(a)},e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){return this._generic_area_legend(t,e,r,n,i,o)},e}(o.XYGlyphView),r.Wedge=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.WedgeView,e.prototype.type="Wedge",e.mixins(["line","fill"]),e.define({direction:[a.Direction,"anticlock"],radius:[a.DistanceSpec],start_angle:[a.AngleSpec],end_angle:[a.AngleSpec]}),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(34),s=t(104);r.XYGlyphView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._index_data=function(){var t,e,r,n,i,s;for(r=[],t=e=0,n=this._x.length;0<=n?e<n:e>n;t=0<=n?++e:--e)i=this._x[t],s=this._y[t],!isNaN(i+s)&&isFinite(i+s)&&r.push({minX:i,minY:s,maxX:i,maxY:s,i:t});return new o.RBush(r)},e}(s.GlyphView),r.XYGlyph=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="XYGlyph",e.prototype.default_view=r.XYGlyphView,e.coords([["x","y"]]),e}(s.Glyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(48),s=t(20),a=t(8);r.GraphHitTestPolicy=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.do_selection=function(t,e,r,n){return!1},e.prototype.do_inspection=function(t,e,r,n){return!1},e}(o.Model),r.NodesOnly=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="NodesOnly",e.prototype._do=function(t,e,r,n){var i,o;return o=e.node_view,i=o.glyph.hit_test(t),null!==i&&(this._node_selector.update(i,r,n),!this._node_selector.indices.is_empty())},e.prototype.do_selection=function(t,e,r,n){var i;return this._node_selector=e.node_view.model.data_source.selection_manager.selector,i=this._do(t,e,r,n),e.node_view.model.data_source.selected=this._node_selector.indices,e.node_view.model.data_source.select.emit(),i},e.prototype.do_inspection=function(t,e,r,n){var i;return this._node_selector=e.model.get_selection_manager().get_or_create_inspector(e.node_view.model),i=this._do(t,e,r,n),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}]),i},e}(r.GraphHitTestPolicy),r.NodesAndLinkedEdges=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="NodesAndLinkedEdges",e.prototype._do=function(t,e,r,n){var i,o,l,u,c,_,h,p,d,f,y,m,v;if(m=[e.node_view,e.edge_view],y=m[0],l=m[1],u=y.glyph.hit_test(t),null===u)return!1;for(this._node_selector.update(u,r,n),f=function(){var t,e,r,n;for(r=u["1d"].indices,n=[],t=0,e=r.length;t<e;t++)c=r[t],n.push(y.model.data_source.data.index[c]);return n}(),o=l.model.data_source,i=[],c=_=0,v=o.data.start.length;0<=v?_<v:_>v;c=0<=v?++_:--_)(s.contains(f,o.data.start[c])||s.contains(f,o.data.end[c]))&&i.push(c);for(d=a.create_hit_test_result(),h=0,p=i.length;h<p;h++)c=i[h],d["2d"].indices[c]=[0];return this._edge_selector.update(d,r,n),!this._node_selector.indices.is_empty()},e.prototype.do_selection=function(t,e,r,n){var i;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,i=this._do(t,e,r,n),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(),i},e.prototype.do_inspection=function(t,e,r,n){var i;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),i=this._do(t,e,r,n),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}]),i},e}(r.GraphHitTestPolicy),r.EdgesAndLinkedNodes=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="EdgesAndLinkedNodes",e.prototype._do=function(t,e,r,n){var i,o,l,u,c,_,h,p,d,f,y;if(y=[e.node_view,e.edge_view],d=y[0],o=y[1],l=o.glyph.hit_test(t),null===l)return!1;for(this._edge_selector.update(l,r,n),i=function(){var t,e,r,n;for(r=Object.keys(l["2d"].indices),n=[],t=0,e=r.length;t<e;t++)u=r[t],n.push(parseInt(u));return n}(),f=[],c=0,_=i.length;c<_;c++)u=i[c],f.push(o.model.data_source.data.start[u]),f.push(o.model.data_source.data.end[u]);return p=function(){var t,e,r,n;for(r=s.uniq(f),n=[],t=0,e=r.length;t<e;t++)u=r[t],n.push(d.model.data_source.data.index.indexOf(u));return n}(),h=a.create_hit_test_result(),h["1d"].indices=p,this._node_selector.update(h,r,n),!this._edge_selector.indices.is_empty()},e.prototype.do_selection=function(t,e,r,n){var i;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,i=this._do(t,e,r,n),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(),i},e.prototype.do_inspection=function(t,e,r,n){var i;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),i=this._do(t,e,r,n),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}]),i},e}(r.GraphHitTestPolicy)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(357);n.__exportStar(t(124),r),n.__exportStar(t(126),r),n.__exportStar(t(127),r)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(48);r.LayoutProvider=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.get_node_coordinates=function(t){return[[],[]]},e.prototype.get_edge_coordinates=function(t){return[[],[]]},e}(o.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(126),s=t(13);r.StaticLayoutProvider=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="StaticLayoutProvider",e.prototype.get_node_coordinates=function(t){var e,r,n,i,o,s,a,l,u;for(i=[[],[]],a=i[0],u=i[1],o=t.data.index,r=0,n=o.length;r<n;r++)e=o[r],s=null!=this.graph_layout[e]?this.graph_layout[e][0]:NaN,l=null!=this.graph_layout[e]?this.graph_layout[e][1]:NaN,a.push(s),u.push(l);return[a,u]},e.prototype.get_edge_coordinates=function(t){var e,r,n,i,o,s,a,l,u,c,_,h;for(o=[[],[]],_=o[0],h=o[1],c=t.data.start,r=t.data.end,n=i=0,s=c.length;0<=s?i<s:i>s;n=0<=s?++i:--i)null!=this.graph_layout[c[n]]&&null!=this.graph_layout[r[n]]?(a=[this.graph_layout[c[n]],this.graph_layout[r[n]]],u=a[0],e=a[1]):(l=[[NaN,NaN],[NaN,NaN]],u=l[0],e=l[1]),_.push([u[0],e[0]]),h.push([u[1],e[1]]);return[_,h]},e.define({graph_layout:[s.Any,{}]}),e}(o.LayoutProvider)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(158),s=t(160),a=t(13),l=t(40);r.GridView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),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 e.__super__.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype._draw_regions=function(t){var e,r,n,i,o,s,a,l,u,c,_,h;if(this.visuals.band_fill.doit)for(n=this.model.grid_coords("major",!1),_=n[0],h=n[1],this.visuals.band_fill.set_value(t),e=r=0,i=_.length-1;0<=i?r<i:r>i;e=0<=i?++r:--r)e%2===1&&(o=this.plot_view.map_to_screen(_[e],h[e],this._x_range_name,this._y_range_name),a=o[0],u=o[1],s=this.plot_view.map_to_screen(_[e+1],h[e+1],this._x_range_name,this._y_range_name),l=s[0],c=s[1],t.fillRect(a[0],u[0],l[1]-a[0],c[1]-u[0]),t.fill())},e.prototype._draw_grids=function(t){var e,r,n;if(this.visuals.grid_line.doit)return e=this.model.grid_coords("major"),r=e[0],n=e[1],this._draw_grid_helper(t,this.visuals.grid_line,r,n)},e.prototype._draw_minor_grids=function(t){var e,r,n;if(this.visuals.minor_grid_line.doit)return e=this.model.grid_coords("minor"),r=e[0],n=e[1],this._draw_grid_helper(t,this.visuals.minor_grid_line,r,n)},e.prototype._draw_grid_helper=function(t,e,r,n){var i,o,s,a,l,u,c,_;for(e.set_value(t),i=o=0,a=r.length;0<=a?o<a:o>a;i=0<=a?++o:--o){for(l=this.plot_view.map_to_screen(r[i],n[i],this._x_range_name,this._y_range_name),c=l[0],_=l[1],t.beginPath(),t.moveTo(Math.round(c[0]),Math.round(_[0])),i=s=1,u=c.length;1<=u?s<u:s>u;i=1<=u?++s:--s)t.lineTo(Math.round(c[i]),Math.round(_[i]));t.stroke()}},e}(s.RendererView),r.Grid=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.GridView,e.prototype.type="Grid",e.mixins(["line:grid_","line:minor_grid_","fill:band_"]),e.define({bounds:[a.Any,"auto"],dimension:[a.Number,0],ticker:[a.Instance],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]}),e.override({level:"underlay",band_fill_color:null,band_fill_alpha:0,grid_line_color:"#e5e5e5",minor_grid_line_color:null}),e.prototype.ranges=function(){var t,e,r,n;return e=this.dimension,r=(e+1)%2,t=this.plot.plot_canvas.frame,n=[t.x_ranges[this.x_range_name],t.y_ranges[this.y_range_name]],[n[e],n[r]]},e.prototype.computed_bounds=function(){var t,e,r,n,i,o,s;return i=this.ranges(),r=i[0],t=i[1],s=this.bounds,n=[r.min,r.max],l.isArray(s)?(o=Math.min(s[0],s[1]),e=Math.max(s[0],s[1]),o<n[0]?o=n[0]:o>n[1]&&(o=null),e>n[1]?e=n[1]:e<n[0]&&(e=null)):(o=n[0],e=n[1]),[o,e]},e.prototype.grid_coords=function(t,e){var r,n,i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T;for(null==e&&(e=!0),c=this.dimension,h=(c+1)%2,b=this.ranges(),g=b[0],s=b[1],w=this.computed_bounds(),M=w[0],u=w[1],T=Math.min(M,u),u=Math.max(M,u),M=T,S=this.ticker.get_ticks(M,u,g,s.min,{})[t],m=g.min,y=g.max,i=s.min,n=s.max,o=[[],[]],_=p=0,x=S.length;0<=x?p<x:p>x;_=0<=x?++p:--p)if(S[_]!==m&&S[_]!==y||!e){for(a=[],l=[],r=2,v=d=0,k=r;0<=k?d<k:d>k;v=0<=k?++d:--d)f=i+(n-i)/(r-1)*v,a.push(S[_]),l.push(f);o[c].push(a),o[h].push(l)}return o},e}(o.GuideRenderer)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(128);r.Grid=n.Grid},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(357);n.__exportStar(t(55),r),n.__exportStar(t(70),r),n.__exportStar(t(74),r),n.__exportStar(t(78),r),n.__exportStar(t(80),r),n.__exportStar(t(86),r),n.__exportStar(t(92),r),n.__exportStar(t(109),r),n.__exportStar(t(125),r),n.__exportStar(t(129),r),n.__exportStar(t(133),r),n.__exportStar(t(140),r),n.__exportStar(t(233),r),n.__exportStar(t(143),r),n.__exportStar(t(147),r),n.__exportStar(t(153),r),n.__exportStar(t(159),r),n.__exportStar(t(162),r),n.__exportStar(t(172),r),n.__exportStar(t(182),r),n.__exportStar(t(194),r),n.__exportStar(t(221),r)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},s=t(11),a=t(13),l=t(20),u=t(28),c=t(134);r.BoxView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.className="bk-grid",e.prototype.connect_signals=function(){return e.__super__.connect_signals.call(this),this.connect(this.model.properties.children.change,function(t){return function(){return t.rebuild_child_views()}}(this))},e.prototype.get_height=function(){var t,e,r;return e=this.model.get_layoutable_children(),t=e.map(function(t){return t._height.value}),r=this.model._horizontal?l.max(t):l.sum(t)},e.prototype.get_width=function(){var t,e,r;return e=this.model.get_layoutable_children(),t=e.map(function(t){return t._width.value}),r=this.model._horizontal?l.sum(t):l.max(t)},e}(c.LayoutDOMView),r.Box=function(t){function e(t,r){e.__super__.constructor.call(this,t,r),this._child_equal_size_width=new s.Variable(this.toString()+".child_equal_size_width"),this._child_equal_size_height=new s.Variable(this.toString()+".child_equal_size_height"),this._box_equal_size_top=new s.Variable(this.toString()+".box_equal_size_top"),this._box_equal_size_bottom=new s.Variable(this.toString()+".box_equal_size_bottom"),this._box_equal_size_left=new s.Variable(this.toString()+".box_equal_size_left"),this._box_equal_size_right=new s.Variable(this.toString()+".box_equal_size_right"),this._box_cell_align_top=new s.Variable(this.toString()+".box_cell_align_top"),this._box_cell_align_bottom=new s.Variable(this.toString()+".box_cell_align_bottom"),this._box_cell_align_left=new s.Variable(this.toString()+".box_cell_align_left"),this._box_cell_align_right=new s.Variable(this.toString()+".box_cell_align_right")}return n(e,t),e.prototype.default_view=r.BoxView,e.define({children:[a.Array,[]]}),e.internal({spacing:[a.Number,6]}),e.prototype.get_layoutable_children=function(){return this.children},e.prototype.get_constrained_variables=function(){return u.extend({},e.__super__.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 t,e,r,n,i,o,a,l,u,c,_,h;if(r=[],e=this.get_layoutable_children(),0===e.length)return r;for(i=0,l=e.length;i<l;i++)t=e[i],h=t.get_constrained_variables(),c=this._child_rect(h),this._horizontal?null!=h.height&&r.push(s.EQ(c.height,[-1,this._height])):null!=h.width&&r.push(s.EQ(c.width,[-1,this._width])),this._horizontal?null!=h.box_equal_size_left&&null!=h.box_equal_size_right&&null!=h.width&&r.push(s.EQ([-1,h.box_equal_size_left],[-1,h.box_equal_size_right],h.width,this._child_equal_size_width)):null!=h.box_equal_size_top&&null!=h.box_equal_size_bottom&&null!=h.height&&r.push(s.EQ([-1,h.box_equal_size_top],[-1,h.box_equal_size_bottom],h.height,this._child_equal_size_height));for(a=this._info(e[0].get_constrained_variables()),r.push(s.EQ(a.span.start,0)),n=o=1,_=e.length;1<=_?o<_:o>_;n=1<=_?++o:--o)u=this._info(e[n].get_constrained_variables()),a.span.size&&r.push(s.EQ(a.span.start,a.span.size,[-1,u.span.start])),r.push(s.WEAK_EQ(a.whitespace.after,u.whitespace.before,0-this.spacing)),r.push(s.GE(a.whitespace.after,u.whitespace.before,0-this.spacing)),a=u;return this._horizontal?null!=h.width&&r.push(s.EQ(a.span.start,a.span.size,[-1,this._width])):null!=h.height&&r.push(s.EQ(a.span.start,a.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,r;return r=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:r}},e.prototype._flatten_cell_edge_variables=function(t){var r,n,i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x;for(w=t?e._top_bottom_inner_cell_edge_variables:e._left_right_inner_cell_edge_variables,r=t!==this._horizontal,l=this.get_layoutable_children(),i=l.length,c={},o=0,_=0,f=l.length;_<f;_++){for(a=l[_],s=a instanceof e?a._flatten_cell_edge_variables(t):{},n=a.get_constrained_variables(),h=0,y=w.length;h<y;h++)m=w[h],m in n&&(s[m]=[n[m]]);for(p in s)x=s[p],r?(g=p.split(" "),d=g[0],b=g.length>1?g[1]:"",u=this._horizontal?"row":"col",v=d+" "+u+"-"+i+"-"+o+"-"+b):v=p,v in c?c[v]=c[v].concat(x):c[v]=x;o+=1}return c},e.prototype._align_inner_cell_edges_constraints=function(){var t,e,r,n,i,a,l,u;if(t=[],
null!=this.document&&o.call(this.document.roots(),this)>=0){e=this._flatten_cell_edge_variables(this._horizontal);for(i in e)if(u=e[i],u.length>1)for(a=u[0],r=n=1,l=u.length;1<=l?n<l:n>l;r=1<=l?++n:--n)t.push(s.EQ(u[r],[-1,a]))}return t},e.prototype._find_edge_leaves=function(t){var r,n,i,o,s,a,l,u;if(i=this.get_layoutable_children(),a=[[],[]],i.length>0)if(this._horizontal===t)u=i[0],o=i[i.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=i.length;s<l;s++)r=i[s],r instanceof e?(n=r._find_edge_leaves(t),a[0]=a[0].concat(n[0]),a[1]=a[1].concat(n[1])):(a[0].push(r),a[1].push(r));return a},e.prototype._align_outer_edges_constraints=function(t){var e,r,n,i,o,a,l,u,c,_;return a=this._find_edge_leaves(t),c=a[0],i=a[1],t?(_="on_edge_align_left",o="on_edge_align_right"):(_="on_edge_align_top",o="on_edge_align_bottom"),r=function(t,e){var r,n,i,o,s;for(r=[],n=0,o=t.length;n<o;n++)i=t[n],s=i.get_constrained_variables(),e in s&&r.push(s[e]);return r},u=r(c,_),n=r(i,o),l=[],e=function(t){var e,r,n,i,o;if(t.length>1){for(r=t[0],n=i=1,o=t.length;1<=o?i<o:i>o;n=1<=o?++i:--i)e=t[n],l.push(s.EQ([-1,r],e));return null}},e(u),e(n),l},e.prototype._box_insets_from_child_insets=function(t,e,r,n){var i,o,a,l,u,c,_,h,p;return c=this._find_edge_leaves(t),h=c[0],o=c[1],t?(p=e+"_left",a=e+"_right",u=this[r+"_left"],l=this[r+"_right"]):(p=e+"_top",a=e+"_bottom",u=this[r+"_top"],l=this[r+"_bottom"]),_=[],i=function(t,e,r){var i,o,a,l,u;for(i=[],o=0,l=e.length;o<l;o++)a=e[o],u=a.get_constrained_variables(),r in u&&(n?_.push(s.GE([-1,t],u[r])):_.push(s.EQ([-1,t],u[r])));return null},i(u,h,p),i(l,o,a),_},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._left_right_inner_cell_edge_variables=["box_cell_align_left","box_cell_align_right"],e._top_bottom_inner_cell_edge_variables=["box_cell_align_top","box_cell_align_bottom"],e}(c.LayoutDOM)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(131);r.ColumnView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.className="bk-grid-column",e}(o.BoxView),r.Column=function(t){function e(t,r){e.__super__.constructor.call(this,t,r),this._horizontal=!1}return n(e,t),e.prototype.type="Column",e.prototype.default_view=r.ColumnView,e}(o.Box)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(131);r.Box=n.Box;var i=t(132);r.Column=i.Column;var o=t(134);r.LayoutDOM=o.LayoutDOM;var s=t(135);r.Row=s.Row;var a=t(136);r.Spacer=a.Spacer;var l=t(137);r.WidgetBox=l.WidgetBox},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(48),s=t(4),a=t(13),l=t(9),u=t(11),c=t(3),_=t(5),h=t(12);r.LayoutDOMView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.is_root&&(this._solver=new u.Solver),this.child_views={},this.build_child_views(),this.connect_signals()},e.prototype.remove=function(){var t,r,n;r=this.child_views;for(t in r)n=r[t],n.remove();return this.child_views={},e.__super__.remove.call(this)},e.prototype.has_finished=function(){var t,r,n;if(!e.__super__.has_finished.call(this))return!1;n=this.child_views;for(t in n)if(r=n[t],!r.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:e.__super__.notify_finished.call(this)},e.prototype._calc_width_height=function(){var t,e,r,n;for(e=this.el;;){if(e=e.parentNode,null==e){h.logger.warn("detached element"),n=t=null;break}if(r=e.getBoundingClientRect(),n=r.width,t=r.height,0!==t)break}return[n,t]},e.prototype._init_solver=function(){var t,e,r,n,i,o,s,a,l;for(this._root_width=new u.Variable(this.toString()+".root_width"),this._root_height=new u.Variable(this.toString()+".root_height"),this._solver.add_edit_variable(this._root_width),this._solver.add_edit_variable(this._root_height),n=this.model.get_all_editables(),i=0,s=n.length;i<s;i++)r=n[i],this._solver.add_edit_variable(r,u.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 l=this.model.get_constrained_variables(),null!=l.width&&this._solver.add_constraint(u.EQ(l.width,this._root_width)),null!=l.height&&this._solver.add_constraint(u.EQ(l.height,this._root_height)),this._solver.update_variables()},e.prototype._suggest_dims=function(t,e){var r,n;if(n=this.model.get_constrained_variables(),null!=n.width||null!=n.height)return null!==t&&null!==e||(r=this._calc_width_height(),t=r[0],e=r[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()},e.prototype.resize=function(t,e){return null==t&&(t=null),null==e&&(e=null),this.is_root?this._do_layout(!1,t,e):this.root.resize(t,e)},e.prototype.layout=function(t){return null==t&&(t=!0),this.is_root?this._do_layout(t):this.root.layout(t)},e.prototype._do_layout=function(t,e,r){return null==e&&(e=null),null==r&&(r=null),t&&(this._solver.clear(),this._init_solver()),this._suggest_dims(e,r),this._layout(),this._layout(),this._layout(!0),this.notify_finished()},e.prototype._layout=function(t){var e,r,n,i,o;for(null==t&&(t=!1),o=this.model.get_layoutable_children(),n=0,i=o.length;n<i;n++)e=o[n],r=this.child_views[e.id],null!=r._layout&&r._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,r,n,i,o;for(r=this.model.get_layoutable_children(),c.build_views(this.child_views,r,{parent:this}),s.empty(this.el),o=[],n=0,i=r.length;n<i;n++)t=r[n],e=this.child_views[t.id],o.push(this.el.appendChild(e.el));return o},e.prototype.connect_signals=function(){return e.__super__.connect_signals.call(this),this.is_root&&window.addEventListener("resize",function(t){return function(){return t.resize()}}(this)),this.connect(this.model.properties.sizing_mode.change,function(t){return function(){return t.layout()}}(this))},e.prototype._render_classes=function(){var t,e,r,n,i;if(this.el.className="",null!=this.className&&this.el.classList.add(this.className),null!=this.model.sizing_mode&&this.el.classList.add("bk-layout-"+this.model.sizing_mode),null!=this.model.css_classes){for(n=this.model.css_classes,i=[],e=0,r=n.length;e<r;e++)t=n[e],i.push(this.el.classList.add(t));return i}},e.prototype.render=function(){var t,e;switch(this._render_classes(),this.model.sizing_mode){case"fixed":return 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),this.solver.update_variables(),this.el.style.position="relative",this.el.style.left="",this.el.style.top="",this.el.style.width=e+"px",this.el.style.height=t+"px";case"scale_width":return t=this.get_height(),this.solver.suggest_value(this.model._height,t),this.solver.update_variables(),this.el.style.position="relative",this.el.style.left="",this.el.style.top="",this.el.style.width=this.model._width.value+"px",this.el.style.height=this.model._height.value+"px";case"scale_height":return e=this.get_width(),this.solver.suggest_value(this.model._width,e),this.solver.update_variables(),this.el.style.position="relative",this.el.style.left="",this.el.style.top="",this.el.style.width=this.model._width.value+"px",this.el.style.height=this.model._height.value+"px";case"stretch_both":return 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.get_height=function(){return null},e.prototype.get_width=function(){return null},e}(_.DOMView),r.LayoutDOM=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="LayoutDOM",e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._width=new u.Variable(this.toString()+".width"),this._height=new u.Variable(this.toString()+".height"),this._left=new u.Variable(this.toString()+".left"),this._right=new u.Variable(this.toString()+".right"),this._top=new u.Variable(this.toString()+".top"),this._bottom=new u.Variable(this.toString()+".bottom"),this._dom_top=new u.Variable(this.toString()+".dom_top"),this._dom_left=new u.Variable(this.toString()+".dom_left"),this._width_minus_right=new u.Variable(this.toString()+".width_minus_right"),this._height_minus_bottom=new u.Variable(this.toString()+".height_minus_bottom"),this._whitespace_top=new u.Variable(this.toString()+".whitespace_top"),this._whitespace_bottom=new u.Variable(this.toString()+".whitespace_bottom"),this._whitespace_left=new u.Variable(this.toString()+".whitespace_left"),this._whitespace_right=new u.Variable(this.toString()+".whitespace_right")},e.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}}}),e.prototype.dump_layout=function(){var t,e,r,n,i;for(console.log(this.toString(),this.layout_bbox),n=this.get_layoutable_children(),i=[],e=0,r=n.length;e<r;e++)t=n[e],i.push(t.dump_layout());return i},e.prototype.get_all_constraints=function(){var t,e,r,n,i;for(e=this.get_constraints(),i=this.get_layoutable_children(),r=0,n=i.length;r<n;r++)t=i[r],e=t instanceof l.LayoutCanvas?e.concat(t.get_constraints()):e.concat(t.get_all_constraints());return e},e.prototype.get_all_editables=function(){var t,e,r,n,i;for(e=this.get_editables(),i=this.get_layoutable_children(),r=0,n=i.length;r<n;r++)t=i[r],e=t instanceof l.LayoutCanvas?e.concat(t.get_editables()):e.concat(t.get_all_editables());return e},e.prototype.get_constraints=function(){return[u.GE(this._dom_left),u.GE(this._dom_top),u.GE(this._left),u.GE(this._width,[-1,this._right]),u.GE(this._top),u.GE(this._height,[-1,this._bottom]),u.EQ(this._width_minus_right,[-1,this._width],this._right),u.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];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.define({height:[a.Number],width:[a.Number],disabled:[a.Bool,!1],sizing_mode:[a.SizingMode,"fixed"],css_classes:[a.Array]}),e}(o.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(131);r.RowView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.className="bk-grid-row",e}(o.BoxView),r.Row=function(t){function e(t,r){e.__super__.constructor.call(this,t,r),this._horizontal=!0}return n(e,t),e.prototype.type="Row",e.prototype.default_view=r.RowView,e}(o.Box)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(134),s=t(28);r.SpacerView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.className="bk-spacer-box",e.prototype.render=function(){if(e.__super__.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}(o.LayoutDOMView),r.Spacer=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="Spacer",e.prototype.default_view=r.SpacerView,e.prototype.get_constrained_variables=function(){return s.extend({},e.__super__.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}(o.LayoutDOM)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(12),s=t(13),a=t(28),l=t(134);r.WidgetBoxView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.className="bk-widget-box",e.prototype.connect_signals=function(){return e.__super__.connect_signals.call(this),this.connect(this.model.properties.children.change,function(t){return function(){return t.rebuild_child_views()}}(this))},e.prototype.render=function(){var t,e,r;return this._render_classes(),"fixed"!==this.model.sizing_mode&&"scale_height"!==this.model.sizing_mode||(r=this.get_width(),this.model._width.value!==r&&this.solver.suggest_value(this.model._width,r)),"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,r,n;e=0,n=this.child_views;for(r in n)i.call(n,r)&&(t=n[r],e+=t.el.scrollHeight);return e+20},e.prototype.get_width=function(){var t,e,r,n,o;if(null!=this.model.width)return this.model.width;o=this.el.scrollWidth+20,n=this.child_views;for(r in n)i.call(n,r)&&(t=n[r],e=t.el.scrollWidth,e>o&&(o=e));return o},e}(l.LayoutDOMView),r.WidgetBox=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="WidgetBox",e.prototype.default_view=r.WidgetBoxView,e.prototype.initialize=function(t){if(e.__super__.initialize.call(this,t),"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 t;return t=a.extend({},e.__super__.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&&(t.box_equal_size_left=this._left,t.box_equal_size_right=this._width_minus_right),t},e.prototype.get_layoutable_children=function(){return this.children},e.define({children:[s.Array,[]]}),e}(l.LayoutDOM)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(139),a=t(13),l=t(20),u=t(40);n=function(t,e){var r,n,i;if(t.length!==e.length)return!1;for(r=n=0,i=t.length;0<=i?n<i:n>i;r=0<=i?++n:--n)if(t[r]!==e[r])return!1;return!0},r.CategoricalColorMapper=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="CategoricalColorMapper",e.define({factors:[a.Array],start:[a.Number,0],end:[a.Number]}),e.prototype._get_values=function(t,e){var r,i,o,s,a,c;for(c=[],o=0,a=t.length;o<a;o++)i=t[o],u.isString(i)?s=this.factors.indexOf(i):(null!=this.start?i=null!=this.end?i.slice(this.start,this.end):i.slice(this.start):null!=this.end&&(i=i.slice(0,this.end)),s=1===i.length?this.factors.indexOf(i[0]):l.findIndex(this.factors,function(t){return n(t,i)})),r=s<0||s>=e.length?this.nan_color:e[s],c.push(r);return c},e}(s.ColorMapper)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(13),s=t(238),a=t(40);r.ColorMapper=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="ColorMapper",e.define({palette:[o.Any],nan_color:[o.Color,"gray"]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),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){var r,n,i,o,s,a,l,u,c,_;if(null==e&&(e=!1),_=this._get_values(t,this._palette,e),r=new ArrayBuffer(4*t.length),this._little_endian)for(n=new Uint8Array(r),i=s=0,l=t.length;0<=l?s<l:s>l;i=0<=l?++s:--s)c=_[i],o=4*i,n[o]=Math.floor(c/4278190080*255),n[o+1]=(16711680&c)>>16,n[o+2]=(65280&c)>>8,n[o+3]=255&c;else for(n=new Uint32Array(r),i=a=0,u=t.length;0<=u?a<u:a>u;i=0<=u?++a:--a)c=_[i],n[i]=c<<8|255;return r},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,r){return null==r&&(r=!1),[]},e.prototype._is_little_endian=function(){var t,e,r,n;return t=new ArrayBuffer(4),r=new Uint8Array(t),e=new Uint32Array(t),e[1]=168496141,n=!0,10===r[4]&&11===r[5]&&12===r[6]&&13===r[7]&&(n=!1),n},e.prototype._build_palette=function(t){var e,r,n,i,o;for(i=new Uint32Array(t.length),e=function(t){return a.isNumber(t)?t:(9!==t.length&&(t+="ff"),parseInt(t.slice(1),16))},r=n=0,o=t.length;0<=o?n<o:n>o;r=0<=o?++n:--n)i[r]=e(t[r]);return i},e}(s.Transform)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(138);r.CategoricalColorMapper=n.CategoricalColorMapper;var i=t(139);r.ColorMapper=i.ColorMapper;var o=t(141);r.LinearColorMapper=o.LinearColorMapper;var s=t(142);r.LogColorMapper=s.LogColorMapper},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(13),s=t(24),a=t(20),l=t(139);r.LinearColorMapper=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="LinearColorMapper",e.define({high:[o.Number],low:[o.Number],high_color:[o.Color],low_color:[o.Color]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._nan_color=this._build_palette([s.color2hex(this.nan_color)])[0],this._high_color=null!=this.high_color?this._build_palette([s.color2hex(this.high_color)])[0]:void 0,this._low_color=null!=this.low_color?this._build_palette([s.color2hex(this.low_color)])[0]:void 0},e.prototype._get_values=function(t,e,r){var n,i,o,s,l,u,c,_,h,p,d,f,y,m,v,g;for(null==r&&(r=!1),c=null!=(m=this.low)?m:a.min(t),i=null!=(v=this.high)?v:a.max(t),h=e.length-1,g=[],p=r?this._nan_color:this.nan_color,_=r?this._low_color:this.low_color,o=r?this._high_color:this.high_color,d=1/(i-c),y=1/e.length,s=0,u=t.length;s<u;s++)n=t[s],isNaN(n)?g.push(p):n!==i?(f=(n-c)*d,l=Math.floor(f/y),l<0?null!=this.low_color?g.push(_):g.push(e[0]):l>h?null!=this.high_color?g.push(o):g.push(e[h]):g.push(e[l])):g.push(e[h]);return g},e}(l.ColorMapper)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o=function(t,e){function r(){this.constructor=t}for(var n in e)s.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},s={}.hasOwnProperty,a=t(13),l=t(24),u=t(20),c=t(139);n=null!=(i=Math.log1p)?i:function(t){return Math.log(1+t)},r.LogColorMapper=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return o(e,t),e.prototype.type="LogColorMapper",e.define({high:[a.Number],low:[a.Number],high_color:[a.Color],low_color:[a.Color]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._nan_color=this._build_palette([l.color2hex(this.nan_color)])[0],this._high_color=null!=this.high_color?this._build_palette([l.color2hex(this.high_color)])[0]:void 0,this._low_color=null!=this.low_color?this._build_palette([l.color2hex(this.low_color)])[0]:void 0},e.prototype._get_values=function(t,e,r){var i,o,s,a,l,c,_,h,p,d,f,y,m,v,g,b;for(null==r&&(r=!1),f=e.length,h=null!=(m=this.low)?m:u.min(t),o=null!=(v=this.high)?v:u.max(t),g=f/(n(o)-n(h)),d=e.length-1,b=[],y=r?this._nan_color:this.nan_color,s=r?this._high_color:this.high_color,p=r?this._low_color:this.low_color,a=0,c=t.length;a<c;a++)i=t[a],isNaN(i)?b.push(y):i>o?null!=this.high_color?b.push(s):b.push(e[d]):i!==o?i<h?null!=this.low_color?b.push(p):b.push(e[0]):(_=n(i)-n(h),l=Math.floor(_*g),l>d&&(l=d),b.push(e[l])):b.push(e[d]);return b},e}(c.ColorMapper)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w=function(t,e){function r(){this.constructor=t}for(var n in e)x.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},x={}.hasOwnProperty,k=t(144);n=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 r,i;return i=e*n,r=i/3,t.moveTo(-e,r),t.lineTo(e,r),t.lineTo(0,r-i),t.closePath()},u=function(t,e,r,n,i,s,a){var u;u=.65*i,o(t,i),l(t,u),s.doit&&(s.set_vectorize(t,e),t.stroke())},c=function(t,e,r,n,i,s,a){t.arc(0,0,i,0,2*Math.PI,!1),a.doit&&(a.set_vectorize(t,e),t.fill()),s.doit&&(s.set_vectorize(t,e),o(t,i),t.stroke())},_=function(t,e,r,n,i,o,s){t.arc(0,0,i,0,2*Math.PI,!1),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),l(t,i),t.stroke())},h=function(t,e,r,n,i,s,a){o(t,i),s.doit&&(s.set_vectorize(t,e),t.stroke())},p=function(t,e,r,n,i,o,a){s(t,i),a.doit&&(a.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},d=function(t,e,r,n,i,a,l){s(t,i),l.doit&&(l.set_vectorize(t,e),t.fill()),a.doit&&(a.set_vectorize(t,e),o(t,i),t.stroke())},f=function(t,e,r,n,i,o,s){t.rotate(Math.PI),a(t,i),t.rotate(-Math.PI),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},y=function(t,e,r,n,i,o,s){var a;a=2*i,t.rect(-i,-i,a,a),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},m=function(t,e,r,n,i,s,a){var l;l=2*i,t.rect(-i,-i,l,l),a.doit&&(a.set_vectorize(t,e),t.fill()),s.doit&&(s.set_vectorize(t,e),o(t,i),t.stroke())},v=function(t,e,r,n,i,o,s){var a;a=2*i,t.rect(-i,-i,a,a),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),l(t,i),t.stroke())},g=function(t,e,r,n,i,o,s){a(t,i),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},b=function(t,e,r,n,i,o,s){l(t,i),o.doit&&(o.set_vectorize(t,e),t.stroke())},i=function(t,e){var r,n;return n=function(t){function r(){return r.__super__.constructor.apply(this,arguments)}return w(r,t),r.prototype._render_one=e,r}(k.MarkerView),r=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return w(r,e),r.prototype.default_view=n,r.prototype.type=t,r}(k.Marker)},r.Asterisk=i("Asterisk",u),r.CircleCross=i("CircleCross",c),r.CircleX=i("CircleX",_),r.Cross=i("Cross",h),r.Diamond=i("Diamond",p),r.DiamondCross=i("DiamondCross",d),r.InvertedTriangle=i("InvertedTriangle",f),r.Square=i("Square",y),r.SquareCross=i("SquareCross",m),r.SquareX=i("SquareX",v),r.Triangle=i("Triangle",g),r.X=i("X",b)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(123),s=t(8),a=t(13);r.MarkerView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.draw_legend_for_index=function(t,e,r,n,i,o){var s,a,l,u,c,_;return l=[o],c={},c[o]=(e+r)/2,_={},_[o]=(n+i)/2,u={},u[o]=.4*Math.min(Math.abs(r-e),Math.abs(i-n)),s={},s[o]=this._angle[o],a={sx:c,sy:_,_size:u,_angle:s},this._render(t,l,a)},e.prototype._render=function(t,e,r){var n,i,o,s,a,l,u,c,_;for(c=r.sx,_=r.sy,i=r._size,n=r._angle,u=[],s=0,a=e.length;s<a;s++)o=e[s],isNaN(c[o]+_[o]+i[o]+n[o])||(l=i[o]/2,t.beginPath(),t.translate(c[o],_[o]),n[o]&&t.rotate(n[o]),this._render_one(t,o,c[o],_[o],l,this.visuals.line,this.visuals.fill),n[o]&&t.rotate(-n[o]),u.push(t.translate(-c[o],-_[o])));return u},e.prototype._mask_data=function(t){var e,r,n,i,o,a,l,u,c,_,h,p,d;return r=this.renderer.plot_view.frame.h_range,a=r.start-this.max_size,l=r.end+this.max_size,n=this.renderer.xscale.v_invert([a,l]),_=n[0],h=n[1],o=this.renderer.plot_view.frame.v_range,u=o.start-this.max_size,c=o.end+this.max_size,i=this.renderer.yscale.v_invert([u,c]),p=i[0],d=i[1],e=s.validate_bbox_coords([_,h],[p,d]),this.index.indices(e)},e.prototype._hit_point=function(t){var e,r,n,i,o,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M;for(u=[t.vx,t.vy],f=u[0],v=u[1],p=this.renderer.plot_view.canvas.vx_to_sx(f),d=this.renderer.plot_view.canvas.vy_to_sy(v),y=f-this.max_size,m=f+this.max_size,c=this.renderer.xscale.v_invert([y,m]),w=c[0],x=c[1],g=v-this.max_size,b=v+this.max_size,_=this.renderer.yscale.v_invert([g,b]),k=_[0],M=_[1],e=s.validate_bbox_coords([w,x],[k,M]),r=this.index.indices(e),i=[],a=0,l=r.length;a<l;a++)o=r[a],h=this._size[o]/2,n=Math.abs(this.sx[o]-p)+Math.abs(this.sy[o]-d),Math.abs(this.sx[o]-p)<=h&&Math.abs(this.sy[o]-d)<=h&&i.push([o,n]);return s.create_1d_hit_test_result(i)},e.prototype._hit_span=function(t){var e,r,n,i,o,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k;return u=[t.vx,t.vy],d=u[0],m=u[1],c=this.bounds(),o=c.minX,a=c.minY,n=c.maxX,i=c.maxY,p=s.create_hit_test_result(),"h"===t.direction?(x=a,k=i,l=this.max_size/2,f=d-l,y=d+l,_=this.renderer.xscale.v_invert([f,y]),b=_[0],w=_[1]):(b=o,w=n,l=this.max_size/2,v=m-l,g=m+l,h=this.renderer.yscale.v_invert([v,g]),x=h[0],k=h[1]),e=s.validate_bbox_coords([b,w],[x,k]),r=this.index.indices(e),p["1d"].indices=r,p},e.prototype._hit_rect=function(t){var e,r,n,i,o,a,l,u;return r=this.renderer.xscale.v_invert([t.vx0,t.vx1]),o=r[0],a=r[1],n=this.renderer.yscale.v_invert([t.vy0,t.vy1]),l=n[0],u=n[1],e=s.validate_bbox_coords([o,a],[l,u]),i=s.create_hit_test_result(),i["1d"].indices=this.index.indices(e),i},e.prototype._hit_poly=function(t){var e,r,n,i,o,a,l,u,c,_,h,p,d;for(a=[t.vx,t.vy],p=a[0],d=a[1],_=this.renderer.plot_view.canvas.v_vx_to_sx(p),h=this.renderer.plot_view.canvas.v_vy_to_sy(d),e=function(){c=[];for(var t=0,e=this.sx.length;0<=e?t<e:t>e;0<=e?t++:t--)c.push(t);return c}.apply(this),r=[],n=o=0,l=e.length;0<=l?o<l:o>l;n=0<=l?++o:--o)i=e[n],s.point_in_poly(this.sx[n],this.sy[n],_,h)&&r.push(i);return u=s.create_hit_test_result(),u["1d"].indices=r,u},e}(o.XYGlyphView),r.Marker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.mixins(["line","fill"]),e.define({size:[a.DistanceSpec,{units:"screen",value:4}],angle:[a.AngleSpec,0]}),e}(o.XYGlyph)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(12),s=t(146),a=t(148),l=t(13),u=t(48);r.MapOptions=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="MapOptions",e.define({lat:[l.Number],lng:[l.Number],zoom:[l.Number,12]}),e}(u.Model),r.GMapOptions=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="GMapOptions",e.define({map_type:[l.String,"roadmap"],scale_control:[l.Bool,!1],styles:[l.String]}),e}(r.MapOptions),r.GMapPlotView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(a.PlotView),r.GMapPlot=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="GMapPlot",e.prototype.default_view=r.GMapPlotView,e.prototype.initialize=function(t){if(e.__super__.initialize.call(this,t),!this.api_key)return o.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 s.GMapPlotCanvas({plot:this})},e.define({map_options:[l.Instance],api_key:[l.String]}),e}(a.Plot)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o=function(t,e){return function(){return t.apply(e,arguments)}},s=function(t,e){function r(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty,l=t(29),u=t(149),c=t(18);n=new c.Signal(this,"gmaps_ready"),i=function(t){var e;return window._bokeh_gmaps_callback=function(){return n.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)},r.GMapPlotCanvasView=function(t){function e(){return this._set_bokeh_ranges=o(this._set_bokeh_ranges,this),this._get_projected_bounds=o(this._get_projected_bounds,this),this._get_latlon_bounds=o(this._get_latlon_bounds,this),e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.initialize=function(t){var r,o;return this.pause(),e.__super__.initialize.call(this,t),this._tiles_loaded=!1,this.zoom_count=0,r=this.model.plot.map_options,this.initial_zoom=r.zoom,this.initial_lat=r.lat,this.initial_lng=r.lng,this.canvas_view.map_el.style.position="absolute",null==(null!=(o=window.google)?o.maps:void 0)&&(null==window._bokeh_gmaps_callback&&i(this.model.plot.api_key),n.connect(function(t){return function(){return t.request_render()}}(this))),this.unpause()},e.prototype.update_range=function(t){var r,n,i,o,s,a,l,u,c;if(null==t)r=this.model.plot.map_options,this.map.setCenter({lat:this.initial_lat,lng:this.initial_lng}),this.map.setOptions({zoom:this.initial_zoom}),e.__super__.update_range.call(this,null);else if(null!=t.sdx||null!=t.sdy)this.map.panBy(t.sdx,t.sdy),e.__super__.update_range.call(this,t);else if(null!=t.factor){if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,this.pause(),e.__super__.update_range.call(this,t),c=t.factor<0?-1:1,i=this.map.getZoom(),n=i+c,n>=2&&(this.map.setZoom(n),u=this._get_projected_bounds(),s=u[0],o=u[1],l=u[2],a=u[3],o-s<0&&this.map.setZoom(i)),this.unpause()}return this._set_bokeh_ranges()},e.prototype._build_map=function(){var t,e,r;return e=window.google.maps,this.map_types={satellite:e.MapTypeId.SATELLITE,terrain:e.MapTypeId.TERRAIN,roadmap:e.MapTypeId.ROADMAP,hybrid:e.MapTypeId.HYBRID},r=this.model.plot.map_options,t={center:new e.LatLng(r.lat,r.lng),zoom:r.zoom,disableDefaultUI:!0,mapTypeId:this.map_types[r.map_type],scaleControl:r.scale_control},null!=r.styles&&(t.styles=JSON.parse(r.styles)),this.map=new e.Map(this.canvas_view.map_el,t),e.event.addListener(this.map,"idle",function(t){return function(){return t._set_bokeh_ranges()}}(this)),e.event.addListener(this.map,"bounds_changed",function(t){return function(){return t._set_bokeh_ranges()}}(this)),e.event.addListenerOnce(this.map,"tilesloaded",function(t){return function(){return t._render_finished()}}(this)),this.connect(this.model.plot.properties.map_options.change,function(t){return function(){return t._update_options()}}(this)),this.connect(this.model.plot.map_options.properties.styles.change,function(t){return function(){return t._update_styles()}}(this)),this.connect(this.model.plot.map_options.properties.lat.change,function(t){return function(){return t._update_center("lat")}}(this)),this.connect(this.model.plot.map_options.properties.lng.change,function(t){return function(){return t._update_center("lng")}}(this)),this.connect(this.model.plot.map_options.properties.zoom.change,function(t){return function(){return t._update_zoom()}}(this)),this.connect(this.model.plot.map_options.properties.map_type.change,function(t){return function(){return t._update_map_type()}}(this)),this.connect(this.model.plot.map_options.properties.scale_control.change,function(t){return function(){return t._update_scale_control()}}(this))},e.prototype._render_finished=function(){return this._tiles_loaded=!0,this.notify_finished()},e.prototype.has_finished=function(){return e.__super__.has_finished.call(this)&&this._tiles_loaded===!0},e.prototype._get_latlon_bounds=function(){var t,e,r,n,i,o,s;return e=this.map.getBounds(),r=e.getNorthEast(),t=e.getSouthWest(),i=t.lng(),n=r.lng(),s=t.lat(),o=r.lat(),[i,n,s,o]},e.prototype._get_projected_bounds=function(){var t,e,r,n,i,o,s,a,u,c,_;return i=this._get_latlon_bounds(),u=i[0],a=i[1],_=i[2],c=i[3],o=l.proj4(l.mercator,[u,_]),e=o[0],n=o[1],s=l.proj4(l.mercator,[a,c]),t=s[0],r=s[1],[e,t,n,r]},e.prototype._set_bokeh_ranges=function(){var t,e,r,n,i;return i=this._get_projected_bounds(),e=i[0],t=i[1],n=i[2],r=i[3],this.frame.x_range.setv({start:e,end:t}),this.frame.y_range.setv({start:n,end:r})},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 r,n,i,o,s;if(n=e[0],o=e[1],s=e[2],r=e[3],this.canvas_view.map_el.style.top=o+"px",this.canvas_view.map_el.style.left=n+"px",this.canvas_view.map_el.style.width=s+"px",this.canvas_view.map_el.style.height=r+"px",null==this.map&&null!=(null!=(i=window.google)?i.maps:void 0))return this._build_map()},e.prototype._paint_empty=function(t,e){var r,n,i,o,s,a;return s=this.canvas._width.value,o=this.canvas._height.value,i=e[0],a=e[1],n=e[2],r=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(i,a),t.lineTo(i+n,a),t.lineTo(i+n,a+r),t.lineTo(i,a+r),t.lineTo(i,a),t.closePath(),t.fillStyle=this.model.plot.border_fill_color,t.fill()},e}(u.PlotCanvasView),r.GMapPlotCanvas=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.type="GMapPlotCanvas",e.prototype.default_view=r.GMapPlotCanvasView,e.prototype.initialize=function(t,r){return this.use_map=!0,e.__super__.initialize.call(this,t,r)},e}(u.PlotCanvas)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(145);r.MapOptions=n.MapOptions;var i=t(145);r.GMapOptions=i.GMapOptions;var o=t(145);r.GMapPlot=o.GMapPlot;var s=t(146);r.GMapPlotCanvas=s.GMapPlotCanvas;var a=t(148);r.Plot=a.Plot;var l=t(149);r.PlotCanvas=l.PlotCanvas},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=[].slice,s=t(11),a=t(12),l=t(13),u=t(28),c=t(40),_=t(134),h=t(63),p=t(163),d=t(228),f=t(149),y=t(168),m=t(156),v=t(2);r.PlotView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.className="bk-plot-layout",e.prototype.connect_signals=function(){var t;return e.__super__.connect_signals.call(this),t="Title object cannot be replaced. Try changing properties on title to update it after initialization.",this.connect(this.model.properties.title.change,function(e){return function(){return a.logger.warn(t)}}(this))},e.prototype.render=function(){var t,r,n;if(e.__super__.render.call(this),"scale_both"===this.model.sizing_mode)return r=this.get_width_height(),n=r[0],t=r[1],this.solver.suggest_value(this.model._width,n),this.solver.suggest_value(this.model._height,t),this.solver.update_variables(),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.get_width_height=function(){var t,e,r,n,i,o,s,a,l;return s=this.el.parentNode.clientHeight,a=this.el.parentNode.clientWidth,t=this.model.get_aspect_ratio(),i=a,r=a/t,o=s*t,n=s,i<o?(l=i,e=r):(l=o,e=n),[l,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.getters({plot_canvas_view:function(){var t;return function(){var e,r,n,i;for(n=u.values(this.child_views),i=[],e=0,r=n.length;e<r;e++)t=n[e],t instanceof f.PlotCanvasView&&i.push(t);return i}.call(this)[0]}}),e}(_.LayoutDOMView),r.Plot=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="Plot",e.prototype.default_view=r.PlotView,e.prototype.initialize=function(t){var r,n,i,o,s,a,l,_,p,d,f,y,m,v,g,b,w,x,k,M;for(e.__super__.initialize.call(this,t),y=u.values(this.extra_x_ranges).concat(this.x_range),n=0,l=y.length;n<l;n++)k=y[n],f=k.plots,c.isArray(f)&&(f=f.concat(this),k.setv("plots",f,{silent:!0}));for(m=u.values(this.extra_y_ranges).concat(this.y_range),i=0,_=m.length;i<_;i++)M=m[i],f=M.plots,c.isArray(f)&&(f=f.concat(this),M.setv("plots",f,{silent:!0}));for(this._horizontal="left"===(v=this.toolbar_location)||"right"===v,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)),null!=this.title&&(x=c.isString(this.title)?new h.Title({text:this.title}):this.title,this.add_layout(x,this.title_location)),this._plot_canvas=this._init_plot_canvas(),this.toolbar.toolbar_location=this.toolbar_location,this.toolbar.toolbar_sticky=this.toolbar_sticky,this.plot_canvas.toolbar=this.toolbar,null==this.width&&(this.width=this.plot_width),null==this.height&&(this.height=this.plot_height),g=["above","below","left","right"],o=0,p=g.length;o<p;o++)for(w=g[o],a=this.getv(w),s=0,d=a.length;s<d;s++)b=a[s],b.add_panel(w);return r=function(t){return function(e){return e._sizeable=t._horizontal?e._width:e._height}}(this),r(this),r(this.plot_canvas)},e.prototype._init_plot_canvas=function(){return new f.PlotCanvas({plot:this})},e.getters({plot_canvas:function(){return this._plot_canvas}}),e.prototype._doc_attached=function(){return this.plot_canvas.attach_document(this.document),e.__super__._doc_attached.call(this)},e.prototype.add_renderers=function(){var t,e;return t=1<=arguments.length?o.call(arguments,0):[],e=this.renderers,e=e.concat(t),this.renderers=e},e.prototype.add_layout=function(t,e){var r;return null==e&&(e="center"),null!=t.props.plot&&(t.plot=this),"center"!==e&&(r=this.getv(e),r.push(t),t.add_panel(e)),this.add_renderers(t)},e.prototype.add_glyph=function(t,e,r){var n;return null==r&&(r={}),null==e&&(e=new y.ColumnDataSource),r=u.extend({},r,{data_source:e,glyph:t}),n=new m.GlyphRenderer(r),this.add_renderers(n),n},e.prototype.add_tools=function(){var t,e,r,n;for(n=1<=arguments.length?o.call(arguments,0):[],t=0,e=n.length;t<e;t++)r=n[t],null!=r.overlay&&this.add_renderers(r.overlay);return this.toolbar.tools=this.toolbar.tools.concat(n)},e.prototype.get_aspect_ratio=function(){return this.width/this.height},e.prototype.get_layoutable_children=function(){var t;return t=[this.plot_canvas],null!=this.toolbar_location&&(t=[this.toolbar,this.plot_canvas]),t},e.prototype.get_editables=function(){var t;return t=e.__super__.get_editables.call(this),"scale_both"===this.sizing_mode&&(t=t.concat([this._width,this._height])),t},e.prototype.get_constraints=function(){var t,r,n,i;return t=e.__super__.get_constraints.call(this),null!=this.toolbar_location&&(this.toolbar_sticky?t.push(s.EQ(this._sizeable,[-1,this.plot_canvas._sizeable])):t.push(s.EQ(this._sizeable,[-1,this.plot_canvas._sizeable],[-1,this.toolbar._sizeable])),this._horizontal?t.push(s.EQ(this._height,[-1,this.plot_canvas._height])):t.push(s.EQ(this._width,[-1,this.plot_canvas._width])),"above"===this.toolbar_location&&(i=this.toolbar_sticky?this.plot_canvas._top:this.plot_canvas._dom_top,t.push(s.EQ(i,[-1,this.toolbar._dom_top],[-1,this.toolbar._height]))),"below"===this.toolbar_location&&(this.toolbar_sticky?(t.push(s.GE(this.plot_canvas.below_panel._height,[-1,this.toolbar._height])),t.push(s.WEAK_EQ(this.toolbar._dom_top,[-1,this.plot_canvas._height],this.plot_canvas.below_panel._height))):t.push(s.EQ(this.toolbar._dom_top,[-1,this.plot_canvas._height],this.toolbar._bottom,[-1,this.toolbar._height]))),"left"===this.toolbar_location&&(i=this.toolbar_sticky?this.plot_canvas._left:this.plot_canvas._dom_left,t.push(s.EQ(i,[-1,this.toolbar._dom_left],[-1,this.toolbar._width]))),"right"===this.toolbar_location&&(this.toolbar_sticky?(t.push(s.GE(this.plot_canvas.right_panel._width,[-1,this.toolbar._width])),t.push(s.WEAK_EQ(this.toolbar._dom_left,[-1,this.plot_canvas._width],this.plot_canvas.right_panel._width))):t.push(s.EQ(this.toolbar._dom_left,[-1,this.plot_canvas._width],this.toolbar._right,[-1,this.toolbar._width]))),"above"!==(r=this.toolbar_location)&&"below"!==r||t.push(s.EQ(this._width,[-1,this.toolbar._width],[-1,this.plot_canvas._width_minus_right])),"left"!==(n=this.toolbar_location)&&"right"!==n||(t.push(s.EQ(this._height,[-1,this.toolbar._height],[-1,this.plot_canvas.above_panel._height])),t.push(s.EQ(this.toolbar._dom_top,[-1,this.plot_canvas.above_panel._height])))),null==this.toolbar_location&&(t.push(s.EQ(this._width,[-1,this.plot_canvas._width])),t.push(s.EQ(this._height,[-1,this.plot_canvas._height]))),t},e.prototype.get_constrained_variables=function(){var t;return t=u.extend({},e.__super__.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&&(t.box_equal_size_left=this.plot_canvas._left,t.box_equal_size_right=this.plot_canvas._width_minus_right),t},e.mixins(["line:outline_","fill:background_","fill:border_"]),e.define({toolbar:[l.Instance,function(){return new d.Toolbar}],toolbar_location:[l.Location,"right"],toolbar_sticky:[l.Bool,!0],plot_width:[l.Number,600],plot_height:[l.Number,600],title:[l.Any,function(){return new h.Title({text:""})}],title_location:[l.Location,"above"],h_symmetry:[l.Bool,!0],v_symmetry:[l.Bool,!1],above:[l.Array,[]],below:[l.Array,[]],left:[l.Array,[]],right:[l.Array,[]],renderers:[l.Array,[]],x_range:[l.Instance],extra_x_ranges:[l.Any,{}],y_range:[l.Instance],extra_y_ranges:[l.Any,{}],x_scale:[l.Instance,function(){return new p.LinearScale}],y_scale:[l.Instance,function(){return new p.LinearScale}],lod_factor:[l.Number,10],lod_interval:[l.Number,300],lod_threshold:[l.Number,2e3],lod_timeout:[l.Number,500],hidpi:[l.Bool,!0],output_backend:[l.OutputBackend,"canvas"],min_border:[l.Number,5],min_border_top:[l.Number,null],min_border_left:[l.Number,null],min_border_bottom:[l.Number,null],min_border_right:[l.Number,null],inner_width:[l.Number],inner_height:[l.Number],layout_width:[l.Number],layout_height:[l.Number],match_aspect:[l.Bool,!1],aspect_scale:[l.Number,1]}),e.override({outline_line_color:"#e5e5e5",border_fill_color:"#ffffff",background_fill_color:"#ffffff"}),e.getters({all_renderers:function(){var t,e,r,n,i;for(n=this.renderers,r=this.toolbar.tools,t=0,e=r.length;t<e;t++)i=r[t],n=n.concat(i.synthetic_renderers);return n},x_mapper_type:function(){return log.warning("x_mapper_type attr is deprecated, use x_scale"),this.x_scale},y_mapper_type:function(){return log.warning("y_mapper_type attr is deprecated, use y_scale"),this.y_scale},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}}),e}(_.LayoutDOM),v.register_with_event(v.UIEvent,r.Plot)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s,a,l=function(t,e){function r(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},u={}.hasOwnProperty,c=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},_=t(76),h=t(77),p=t(151),d=t(156),f=t(134),y=t(18),m=t(3),v=t(19),g=t(2),b=t(9),w=t(44),x=t(5),k=t(11),M=t(12),S=t(6),T=t(13),O=t(39),P=t(40),A=t(20),j=t(28),E=t(10);a=null,r.PlotCanvasView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.className="bk-plot-wrapper",e.prototype.state={history:[],index:-1},e.prototype.view_options=function(){return j.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(null==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,e.__super__.remove.call(this)},e.prototype.initialize=function(t){var r,n,i,o;for(this.pause(),e.__super__.initialize.call(this,t),this.force_paint=new y.Signal(this,"force_paint"),this.state_changed=new y.Signal(this,"state_changed"),this.lod_started=!1,this.visuals=new w.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=O.throttle(function(t){return function(){return t.force_paint.emit()}}(this),15),this.ui_event_bus=new v.UIEvents(this,this.model.toolbar,this.canvas_view.el,this.model.plot),this.levels={},o=S.RenderLevel,r=0,n=o.length;r<n;r++)i=o[r],this.levels[i]={};return this.renderer_views={},this.tool_views={},this.build_levels(),this.build_tools(),this.connect_signals(),this.update_dataranges(),this.unpause(!0),M.logger.debug("PlotView initialized"),this},e.prototype.set_cursor=function(t){return null==t&&(t="default"),this.canvas_view.el.style.cursor=t},e.getters({canvas_overlays:function(){return this.canvas_view.overlays_el},is_paused:function(){return null!=this._is_paused&&0!==this._is_paused}}),e.prototype.init_webgl=function(){var t,e,r;return t=this.canvas_view.ctx,e=a,null==e&&(a=e=document.createElement("canvas"),r={premultipliedAlpha:!0},e.gl=e.getContext("webgl",r)||e.getContext("experimental-webgl",r)),null!=e.gl?t.glcanvas=e:M.logger.warn("WebGL is not supported, falling back to 2D canvas.")},e.prototype.prepare_webgl=function(t,e){var r,n,i,o;if(n=this.canvas_view.ctx,r=this.canvas_view.get_canvas_element(),n.glcanvas)return n.glcanvas.width=r.width,n.glcanvas.height=r.height,o=n.glcanvas.gl,o.viewport(0,0,n.glcanvas.width,n.glcanvas.height),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT||o.DEPTH_BUFFER_BIT),o.enable(o.SCISSOR_TEST),i=n.glcanvas.height-t*(e[1]+e[3]),o.scissor(t*e[0],i,t*e[2],t*e[3]),o.enable(o.BLEND),o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE_MINUS_DST_ALPHA,o.ONE)},e.prototype.blit_webgl=function(t){var e;if(e=this.canvas_view.ctx,e.glcanvas)return M.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,r,n,i,o,s,a,l,u,c,_,h,d,f,y,m,v,g,b,w,x,k,S,T,O,P,A,E,z,C,N,D,F,I,B;for(o=this.model.frame,e={},v={},n=!1,k=j.values(o.x_ranges).concat(j.values(o.y_ranges)),l=0,_=k.length;l<_;l++)x=k[l],x instanceof p.DataRange1d&&"log"===x.scale_hint&&(n=!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),n&&(m=null!=(O=C.glyph)&&"function"==typeof O.log_bounds?O.log_bounds():void 0,null!=m&&(v[u]=m));if(i=!1,s=!1,this.model.plot.match_aspect!==!1&&0!==this.frame._width.value&&0!==this.frame._height.value){x=1/this.model.plot.aspect_scale*(this.frame._width.value/this.frame._height.value);for(u in e)C=e[u],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<x*a?N=x*a:a=N/x,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(P=j.values(o.x_ranges),c=0,h=P.length;c<h;c++)F=P[c],F instanceof p.DataRange1d&&(r="log"===F.scale_hint?v:e,F.update(r,0,this.model.id),F.follow&&(i=!0)),null!=F.bounds&&(s=!0);for(A=j.values(o.y_ranges),g=0,d=A.length;g<d;g++)B=A[g],B instanceof p.DataRange1d&&(r="log"===B.scale_hint?v:e,B.update(r,1,this.model.id),B.follow&&(i=!0)),null!=B.bounds&&(s=!0);if(i&&s){for(M.logger.warn("Follow enabled so bounds are unset."),E=j.values(o.x_ranges),b=0,f=E.length;b<f;b++)F=E[b],F.bounds=null;for(z=j.values(o.y_ranges),w=0,y=z.length;w<y;w++)B=z[w],B.bounds=null}return this.range_update_timestamp=Date.now()},e.prototype.map_to_screen=function(t,e,r,n){return null==r&&(r="default"),null==n&&(n="default"),this.frame.map_to_screen(t,e,this.canvas,r,n)},e.prototype.push_state=function(t,e){var r,n;return r=(null!=(n=this.state.history[this.state.index])?n.info:void 0)||{},e=j.extend({},this._initial_state_info,r,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,r;if(e=(null!=(r=this.state.history[t])?r.info:void 0)||this._initial_state_info,null!=e.range&&this.update_range(e.range),null!=e.selection&&this.update_selection(e.selection),null!=e.dimensions)return this.canvas_view.set_dims([e.dimensions.width,e.dimensions.height])},e.prototype.reset_dimensions=function(){return this.update_dimensions(this.canvas.initial_width,this.canvas.initial_height)},e.prototype.update_dimensions=function(t,e){return this.pause(),this.model.plot.width=t,this.model.plot.height=e,this.parent.layout(),this.unpause()},e.prototype.get_selection=function(){var t,e,r,n,i,o;for(o=[],r=this.model.plot.renderers,t=0,e=r.length;t<e;t++)n=r[t],n instanceof d.GlyphRenderer&&(i=n.data_source.selected,o[n.id]=i);return o},e.prototype.update_selection=function(t){var e,r,n,i,o,s,a;for(i=this.model.plot.renderers,a=[],r=0,n=i.length;r<n;r++)s=i[r],s instanceof d.GlyphRenderer&&(e=s.data_source,null!=t?(o=s.id,c.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,r,n,i,o,s,a,l,u,c;for(c=1,e=0,n=t.length;e<n;e++)s=t[e],u=s[0],o=s[1],c=Math.min(c,this._get_weight_to_constrain_interval(u,o));if(c<1){for(l=[],r=0,i=t.length;r<i;r++)a=t[r],u=a[0],o=a[1],o.start=c*o.start+(1-c)*u.start,l.push(o.end=c*o.end+(1-c)*u.end);return l}},e.prototype._update_ranges_individually=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p,d,f,y,m;for(n=!1,i=0,s=t.length;i<s;i++)h=t[i],y=h[0],_=h[1],f=y.start>y.end,r||(m=this._get_weight_to_constrain_interval(y,_),m<1&&(_.start=m*_.start+(1-m)*y.start,_.end=m*_.end+(1-m)*y.end)),null!=y.bounds&&(u=y.bounds[0],l=y.bounds[1],c=Math.abs(_.end-_.start),f?(null!=u&&u>=_.end&&(n=!0,_.end=u,null==e&&null==r||(_.start=u+c)),null!=l&&l<=_.start&&(n=!0,_.start=l,null==e&&null==r||(_.end=l-c))):(null!=u&&u>=_.start&&(n=!0,_.start=u,null==e&&null==r||(_.end=u+c)),null!=l&&l<=_.end&&(n=!0,_.end=l,null==e&&null==r||(_.start=l-c))));if(!r||!n){for(d=[],o=0,a=t.length;o<a;o++)p=t[o],y=p[0],_=p[1],y.have_updated_interactively=!0,y.start!==_.start||y.end!==_.end?d.push(y.setv(_)):d.push(void 0);return d}},e.prototype._get_weight_to_constrain_interval=function(t,e){var r,n,i,o,s,a,l,u,c;return s=t.min_interval,n=t.max_interval,c=1,null!=t.bounds&&(u=t.bounds,o=u[0],r=u[1],null!=o&&null!=r&&(i=Math.abs(r-o),n=null!=n?Math.min(n,i):i)),null==s&&null==n||(l=Math.abs(t.end-t.start),a=Math.abs(e.end-e.start),s>0&&a<s&&(c=(l-s)/(l-a)),n>0&&a>n&&(c=(n-l)/(a-l)),c=Math.max(0,Math.min(1,c))),c},e.prototype.update_range=function(t,e,r){var n,i,o,s,a,l,u;if(this.pause(),null==t){o=this.frame.x_ranges;for(n in o)u=o[n],u.reset();s=this.frame.y_ranges;for(n in s)u=s[n],u.reset();this.update_dataranges()}else{i=[],a=this.frame.x_ranges;for(n in a)u=a[n],i.push([u,t.xrs[n]]);l=this.frame.y_ranges;for(n in l)u=l[n],i.push([u,t.yrs[n]]);r&&this._update_ranges_together(i),this._update_ranges_individually(i,e,r)}return this.unpause()},e.prototype.reset_range=function(){return this.update_range(null)},e.prototype.build_levels=function(){var t,e,r,n,i,o,s,a,l,u,c;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,r;for(r=[],t=0,e=l.length;t<e;t++)o=l[t],r.push(o.id);return r}()),e=0,n=u.length;e<n;e++)t=u[e],delete this.levels.glyph[t];for(r=0,i=s.length;r<i;r++)c=s[r],this.levels[c.model.level][c.model.id]=c,c.connect_signals();return this},e.prototype.get_renderer_views=function(){var t,e,r,n,i;for(n=this.model.plot.renderers,i=[],t=0,e=n.length;t<e;t++)r=n[t],i.push(this.levels[r.level][r.id]);return i},e.prototype.build_tools=function(){var t,e,r,n,i,o;for(i=this.model.plot.toolbar.tools,r=m.build_views(this.tool_views,i,this.view_options()),n=[],t=0,e=r.length;t<e;t++)o=r[t],o.connect_signals(),n.push(this.ui_event_bus.register_tool(o));return n},e.prototype.connect_signals=function(){var t,r,n,i;e.__super__.connect_signals.call(this),this.connect(this.force_paint,function(t){return function(){return t.paint()}}(this)),r=this.model.frame.x_ranges;for(t in r)i=r[t],this.connect(i.change,function(){return this.request_render()});n=this.model.frame.y_ranges;for(t in n)i=n[t],this.connect(i.change,function(){return this.request_render()});return this.connect(this.model.plot.properties.renderers.change,function(t){return function(){return t.build_levels()}}(this)),this.connect(this.model.plot.toolbar.properties.tools.change,function(t){return function(){return t.build_levels(),t.build_tools()}}(this)),this.connect(this.model.plot.change,function(){return this.request_render()})},e.prototype.set_initial_range=function(){var t,e,r,n,i,o,s;t=!0,o={},r=this.frame.x_ranges;for(e in r){if(i=r[e],null==i.start||null==i.end||P.isStrictNaN(i.start+i.end)){t=!1;break}o[e]={start:i.start,end:i.end}}if(t){s={},n=this.frame.y_ranges;for(e in n){if(i=n[e],null==i.start||null==i.end||P.isStrictNaN(i.start+i.end)){t=!1;break}s[e]={start:i.start,end:i.end}}}return t?(this._initial_state_info.range=this.initial_range_info={xrs:o,yrs:s},M.logger.debug("initial ranges set")):M.logger.warn("could not set initial ranges")},e.prototype.update_constraints=function(){var t,e,r;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)r=e[t],null!=r.model.panel&&E.update_panel_constraints(r);return this.solver.update_variables()},e.prototype._layout=function(t){if(null==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.request_paint()},e.prototype.has_finished=function(){var t,r,n,i;if(!e.__super__.has_finished.call(this))return!1;r=this.levels;for(t in r){n=r[t];for(t in n)if(i=n[t],!i.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.paint=function(){var t,e,r,n,i,o,s,a,l,u,c;if(!this.is_paused){M.logger.trace("PlotCanvas.render() for "+this.model.id),this.canvas_view.prepare_canvas(),Date.now()-this.interactive_timestamp<this.model.plot.lod_interval?(this.lod_started||(this.model.plot.trigger_event(new g.LODStart({})),this.lod_started=!0),this.interactive=!0,i=this.model.plot.lod_timeout,setTimeout(function(t){return function(){return t.interactive&&Date.now()-t.interactive_timestamp>i&&(t.interactive=!1),t.request_render()}}(this),i)):(this.interactive=!1,this.lod_started&&(this.model.plot.trigger_event(new g.LODEnd({})),this.lod_started=!1)),s=this.renderer_views;for(n in s)if(a=s[n],null==this.range_update_timestamp||a.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=o=this.canvas.pixel_ratio,t.save(),t.scale(o,o),t.translate(.5,.5),e=[this.canvas.vx_to_sx(this.frame._left.value),this.canvas.vy_to_sy(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(o,e),t.save(),this.visuals.outline_line.doit&&(this.visuals.outline_line.set_value(t),u=e[0],c=e[1],l=e[2],r=e[3],u+l===this.canvas._width.value&&(l-=1),c+r===this.canvas._height.value&&(r-=1),t.strokeRect(u,c,l,r)),t.restore(),this._paint_levels(t,["image","underlay","glyph"],e),this.blit_webgl(o),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,r){var n,i,o,s,a,l,u,c,_,h,p,d,f,y;for(t.save(),null!=r&&"canvas"===this.model.plot.output_backend&&(t.beginPath(),t.rect.apply(t,r),t.clip()),i={},h=this.model.plot.renderers,n=o=0,a=h.length;o<a;n=++o)p=h[n],i[p.id]=n;for(y=function(t){return i[t.model.id]},s=0,l=e.length;s<l;s++)for(c=e[s],f=A.sortBy(j.values(this.levels[c]),y),_=0,u=f.length;_<u;_++)d=f[_],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,r,n,i,o,s,a;return"canvas"===(o=this.model.plot.output_backend)||"webgl"===o?(r=this.canvas_view.get_canvas_element(),null!=r.msToBlob?(e=r.msToBlob(),window.navigator.msSaveBlob(e,t)):(i=document.createElement("a"),i.href=r.toDataURL("image/png"),i.download=t+".png",i.target="_blank",
i.dispatchEvent(new MouseEvent("click")))):"svg"===this.model.plot.output_backend?(s=this.canvas_view.ctx.getSerializedSvg(!0),a=new Blob([s],{type:"text/plain"}),n=document.createElement("a"),n.download=t+".svg",n.innerHTML="Download svg",n.href=window.URL.createObjectURL(a),n.onclick=function(t){return document.body.removeChild(t.target)},n.style.display="none",document.body.appendChild(n),n.click()):void 0},e}(x.DOMView),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="AbovePanel",e}(b.LayoutCanvas),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="BelowPanel",e}(b.LayoutCanvas),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="LeftPanel",e}(b.LayoutCanvas),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="RightPanel",e}(b.LayoutCanvas),r.PlotCanvas=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="PlotCanvas",e.prototype.default_view=r.PlotCanvasView,e.prototype.initialize=function(t,r){var a;return e.__super__.initialize.call(this,t,r),this.canvas=new _.Canvas({map:null!=(a=this.use_map)&&a,initial_width:this.plot.plot_width,initial_height:this.plot.plot_height,use_hidpi:this.plot.hidpi,output_backend:this.plot.output_backend}),this.frame=new h.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 n,this.below_panel=new i,this.left_panel=new o,this.right_panel=new s,M.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),e.__super__._doc_attached.call(this),M.logger.debug("PlotCanvas attached to document")},e.override({sizing_mode:"stretch_both"}),e.internal({plot:[T.Instance],toolbar:[T.Instance],canvas:[T.Instance],frame:[T.Instance]}),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 r,n,i,o;for(o=[],r=0,n=e.length;r<n;r++)i=e[r],null!=i.panel?o.push(t.push(i.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 e.__super__.get_constraints.call(this).concat(this._get_constant_constraints(),this._get_side_constraints())},e.prototype._get_constant_constraints=function(){return[k.GE(this.above_panel._height,-this.plot.min_border_top),k.GE(this.below_panel._height,-this.plot.min_border_bottom),k.GE(this.left_panel._width,-this.plot.min_border_left),k.GE(this.right_panel._width,-this.plot.min_border_right),k.EQ(this.above_panel._top,[-1,this.canvas._top]),k.EQ(this.above_panel._bottom,[-1,this.frame._top]),k.EQ(this.below_panel._bottom,[-1,this.canvas._bottom]),k.EQ(this.below_panel._top,[-1,this.frame._bottom]),k.EQ(this.left_panel._left,[-1,this.canvas._left]),k.EQ(this.left_panel._right,[-1,this.frame._left]),k.EQ(this.right_panel._right,[-1,this.canvas._right]),k.EQ(this.right_panel._left,[-1,this.frame._right]),k.EQ(this.above_panel._height,[-1,this._top]),k.EQ(this.above_panel._height,[-1,this.canvas._top],this.frame._top),k.EQ(this.below_panel._height,[-1,this._height],this._bottom),k.EQ(this.below_panel._height,[-1,this.frame._bottom]),k.EQ(this.left_panel._width,[-1,this._left]),k.EQ(this.left_panel._width,[-1,this.frame._left]),k.EQ(this.right_panel._width,[-1,this._width],this._right),k.EQ(this.right_panel._width,[-1,this.canvas._right],this.frame._right)]},e.prototype._get_side_constraints=function(){var t,e,r,n,i,o,s,a,l;return t=[this.frame].concat(this.plot.above),e=[this.frame].concat(this.plot.below),a=[this.frame].concat(this.plot.left),l=[this.frame].concat(this.plot.right),r=A.pairwise(t,function(t,e){return k.EQ(t.panel._top,[-1,e.panel._bottom])}),n=A.pairwise(e,function(t,e){return k.EQ(t.panel._bottom,[-1,e.panel._top])}),i=A.pairwise(a,function(t,e){return k.EQ(t.panel._left,[-1,e.panel._right])}),s=A.pairwise(l,function(t,e){return k.EQ(t.panel._right,[-1,e.panel._left])}),o=[].concat(r,n,i,s),this.plot.above.length>0&&o.push(k.EQ(A.last(this.plot.above).panel._top,[-1,this.above_panel._top])),this.plot.below.length>0&&o.push(k.EQ(A.last(this.plot.below).panel._bottom,[-1,this.below_panel._bottom])),this.plot.left.length>0&&o.push(k.EQ(A.last(this.plot.left).panel._left,[-1,this.left_panel._left])),this.plot.right.length>0&&o.push(k.EQ(A.last(this.plot.right).panel._right,[-1,this.right_panel._right])),o},e}(f.LayoutDOM)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(154),s=t(13);r.DataRange=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="DataRange",e.define({names:[s.Array,[]],renderers:[s.Array,[]]}),e}(o.Range)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(150),s=t(156),a=t(12),l=t(13),u=t(21);r.DataRange1d=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="DataRange1d",e.define({start:[l.Number],end:[l.Number],range_padding:[l.Number,.1],range_padding_units:[l.PaddingUnits,"percent"],flipped:[l.Bool,!1],follow:[l.StartEnd],follow_interval:[l.Number],default_span:[l.Number,2],bounds:[l.Any],min_interval:[l.Any],max_interval:[l.Any]}),e.internal({scale_hint:[l.String,"auto"]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),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.getters({min:function(){return Math.min(this.start,this.end)},max:function(){return Math.max(this.start,this.end)}}),e.prototype.computed_renderers=function(){var t,e,r,n,i,o,l,u,c,_,h;if(o=this.names,_=this.renderers,0===_.length)for(c=this.plots,e=0,n=c.length;e<n;e++)l=c[e],t=l.renderers,h=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)u=t[e],u instanceof s.GlyphRenderer&&n.push(u);return n}(),_=_.concat(h);for(o.length>0&&(_=function(){var t,e,r;for(r=[],t=0,e=_.length;t<e;t++)u=_[t],o.indexOf(u.name)>=0&&r.push(u);return r}()),a.logger.debug("computed "+_.length+" renderers for DataRange1d "+this.id),r=0,i=_.length;r<i;r++)u=_[r],a.logger.trace(" - "+u.type+" "+u.id);return _},e.prototype._compute_plot_bounds=function(t,e){var r,n,i,o;for(o=u.empty(),r=0,n=t.length;r<n;r++)i=t[r],null!=e[i.id]&&(o=u.union(o,e[i.id]));return o},e.prototype._compute_min_max=function(t,e){var r,n,i,o,s,a,l;o=u.empty();for(r in t)l=t[r],o=u.union(o,l);return 0===e?(s=[o.minX,o.maxX],i=s[0],n=s[1]):(a=[o.minY,o.maxY],i=a[0],n=a[1]),[i,n]},e.prototype._compute_range=function(t,e){var r,n,i,o,s,l,u,c,_,h,p,d,f;return u=null!=(c=this.range_padding)?c:0,"log"===this.scale_hint?((isNaN(t)||!isFinite(t)||t<=0)&&(t=isNaN(e)||!isFinite(e)||e<=0?.1:e/100,a.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,a.logger.warn("could not determine maximum data value for log axis, DataRange1d using value "+e)),e===t?(d=this.default_span+.001,r=Math.log(t)/Math.log(10)):("percent"===this.range_padding_units?(l=Math.log(t)/Math.log(10),s=Math.log(e)/Math.log(10),d=(s-l)*(1+u)):(l=Math.log(t-u)/Math.log(10),s=Math.log(e+u)/Math.log(10),d=s-l),r=(l+s)/2),_=[Math.pow(10,r-d/2),Math.pow(10,r+d/2)],f=_[0],n=_[1]):(d=e===t?this.default_span:"percent"===this.range_padding_units?(e-t)*(1+u):e-t+2*u,r=(e+t)/2,h=[r-d/2,r+d/2],f=h[0],n=h[1]),o=1,this.flipped&&(p=[n,f],f=p[0],n=p[1],o=-1),i=this.follow_interval,null!=i&&Math.abs(f-n)>i&&("start"===this.follow?n=f+o*i:"end"===this.follow&&(f=n-o*i)),[f,n]},e.prototype.update=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p;if(!this.have_updated_interactively)return h=this.computed_renderers(),this.plot_bounds[r]=this._compute_plot_bounds(h,t),u=this._compute_min_max(this.plot_bounds,e),a=u[0],s=u[1],c=this._compute_range(a,s),p=c[0],o=c[1],null!=this._initial_start&&("log"===this.scale_hint?this._initial_start>0&&(p=this._initial_start):p=this._initial_start),null!=this._initial_end&&("log"===this.scale_hint?this._initial_end>0&&(o=this._initial_end):o=this._initial_end),_=[this.start,this.end],i=_[0],n=_[1],p===i&&o===n||(l={},p!==i&&(l.start=p),o!==n&&(l.end=o),this.setv(l)),"auto"===this.bounds&&this.setv({bounds:[p,o]},{silent:!0}),this.change.emit()},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}(o.DataRange)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(154),s=t(13),a=t(20),l=t(40);r.map_one_level=function(t,e,r){var n,i,o,s,a;for(null==r&&(r=0),a={},i=o=0,s=t.length;o<s;i=++o){if(n=t[i],n in a)throw new Error("duplicate factor or subfactor "+n);a[n]={value:.5+i*(1+e)+r}}return[a,(t.length-1)*e]},r.map_two_levels=function(t,e,n,i){var o,s,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x;for(null==i&&(i=0),h={},b={},w=[],l=0,c=t.length;l<c;l++)d=t[l],o=d[0],s=d[1],o in b||(b[o]=[],w.push(o)),b[o].push(s);for(m=i,x=0,u=0,_=w.length;u<_;u++)o=w[u],p=b[o].length,f=r.map_one_level(b[o],n,m),y=f[0],v=f[1],x+=v,g=a.sum(function(){var t,e,r,n;for(r=b[o],n=[],t=0,e=r.length;t<e;t++)s=r[t],n.push(y[s].value);return n}()),h[o]={value:g/p,mapping:y},m+=p+e+v;return[h,w,(w.length-1)*e+x]},r.map_three_levels=function(t,e,n,i,o){var s,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P;for(null==o&&(o=0),y={},T={},O=[],c=0,p=t.length;c<p;c++)g=t[c],s=g[0],l=g[1],u=g[2],s in T||(T[s]=[],O.push(s)),T[s].push([l,u]);for(m=[],k=o,P=0,_=0,d=O.length;_<d;_++){for(s=O[_],v=T[s].length,b=r.map_two_levels(T[s],n,i,k),w=b[0],x=b[1],M=b[2],h=0,f=x.length;h<f;h++)l=x[h],m.push([s,l]);P+=M,S=a.sum(function(){var t,e,r,n,i;for(r=T[s],i=[],e=0,t=r.length;e<t;e++)n=r[e],l=n[0],u=n[1],i.push(w[l].value);return i}()),y[s]={value:S/v,mapping:w},k+=v+e+M}return[y,O,m,(O.length-1)*e+P]},r.FactorRange=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="FactorRange",e.define({factors:[s.Array,[]],factor_padding:[s.Number,0],subgroup_padding:[s.Number,.8],group_padding:[s.Number,1.4],range_padding:[s.Number,0],range_padding_units:[s.PaddingUnits,"percent"],start:[s.Number],end:[s.Number],bounds:[s.Any],min_interval:[s.Any],max_interval:[s.Any]}),e.getters({min:function(){return this.start},max:function(){return this.end}}),e.internal({levels:[s.Number],mids:[s.Array],tops:[s.Array],tops_groups:[s.Array]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),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 l.isNumber(t)?t:l.isString(t)?this._lookup([t]):(e=0,l.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,r;return e=function(){var e,n,i;for(i=[],e=0,n=t.length;e<n;e++)r=t[e],i.push(this.synthetic(r));return i}.call(this)},e.prototype._init=function(){var t,e,n,i,o,s,u,c;if(a.all(this.factors,l.isString))i=1,o=r.map_one_level(this.factors,this.factor_padding),this._mapping=o[0],n=o[1];else if(a.all(this.factors,function(t){return l.isArray(t)&&2===t.length&&l.isString(t[0])&&l.isString(t[1])}))i=2,s=r.map_two_levels(this.factors,this.group_padding,this.factor_padding),this._mapping=s[0],this.tops=s[1],n=s[2];else{if(!a.all(this.factors,function(t){return l.isArray(t)&&3===t.length&&l.isString(t[0])&&l.isString(t[1])&&l.isString(t[2])}))throw new Error("");i=3,u=r.map_three_levels(this.factors,this.group_padding,this.subgroup_padding,this.factor_padding),this._mapping=u[0],this.tops=u[1],this.mids=u[2],n=u[3]}if(c=0,t=this.factors.length+n,"percent"===this.range_padding_units?(e=(t-c)*this.range_padding/2,c-=e,t+=e):(c-=this.range_padding,t+=this.range_padding),this.setv({start:c,end:t,levels:i},{silent:!0}),"auto"===this.bounds)return this.setv({bounds:[c,t]},{silent:!0})},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}(o.Range)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(150);r.DataRange=n.DataRange;var i=t(151);r.DataRange1d=i.DataRange1d;var o=t(152);r.FactorRange=o.FactorRange;var s=t(154);r.Range=s.Range;var a=t(155);r.Range1d=a.Range1d},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(48),s=t(13);r.Range=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="Range",e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.connect(this.change,function(){var t;return null!=(t=this.callback)?t.execute(this):void 0})},e.define({callback:[s.Instance]}),e.internal({plots:[s.Array,[]]}),e.prototype.reset=function(){return this.change.emit()},e}(o.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(154),s=t(13);r.Range1d=function(t){function e(){var t,r;return this instanceof e?e.__super__.constructor.apply(this,arguments):(r=arguments[0],t=arguments[1],new e({start:r,end:t}))}return n(e,t),e.prototype.type="Range1d",e.define({start:[s.Number,0],end:[s.Number,1],bounds:[s.Any],min_interval:[s.Any],max_interval:[s.Any]}),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(t,r){return e.__super__.initialize.call(this,t,r),this._initial_start=this.start,this._initial_end=this.end,this._set_auto_bounds()},e.getters({min:function(){return Math.min(this.start,this.end)},max:function(){return Math.max(this.start,this.end)}}),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}(o.Range)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},s=t(160),a=t(110),l=t(173),u=t(167),c=t(12),_=t(13),h=t(20),p=t(28);r.GlyphRendererView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){var r,n,i,s,a,u,c,_,h,d;if(e.__super__.initialize.call(this,t),r=this.model.glyph,s=o.call(r.mixins,"fill")>=0,a=o.call(r.mixins,"line")>=0,i=p.clone(r.attributes),delete i.id,c=function(t){var e;return e=p.clone(i),s&&p.extend(e,t.fill),a&&p.extend(e,t.line),new r.constructor(e)},this.glyph=this.build_glyph_view(r),d=this.model.selection_glyph,null==d?d=c({fill:{},line:{}}):"auto"===d&&(d=c(this.model.selection_defaults)),this.selection_glyph=this.build_glyph_view(d),h=this.model.nonselection_glyph,null==h?h=c({fill:{},line:{}}):"auto"===h&&(h=c(this.model.nonselection_defaults)),this.nonselection_glyph=this.build_glyph_view(h),u=this.model.hover_glyph,null!=u&&(this.hover_glyph=this.build_glyph_view(u)),_=this.model.muted_glyph,null!=_&&(this.muted_glyph=this.build_glyph_view(_)),n=c(this.model.decimated_defaults),this.decimated_glyph=this.build_glyph_view(n),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 l.RemoteDataSource)return this.model.data_source.setup()},e.getters({xmapper:function(){return log.warning("xmapper attr is deprecated, use xscale"),this.xscale},ymapper:function(){return log.warning("ymapper attr is deprecated, use yscale"),this.yscale}}),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 e.__super__.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){var r,n,i,o,s,a,l;for(null==t&&(t=!0),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=[],n=i=0,s=Math.floor(this.all_indices.length/o);0<=s?i<s:i>s;n=0<=s?++i:--i)this.decimated.push(this.all_indices[n*o]);if(r=Date.now()-l,c.logger.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): set_data finished in "+r+"ms"),this.set_data_timestamp=Date.now(),t)return this.request_render()},e.prototype.render=function(){var t,e,r,n,i,s,l,u,_,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A;if(this.model.visible){if(S=Date.now(),l=this.glyph.glglyph,T=Date.now(),this.glyph.map_data(),e=Date.now()-S,O=Date.now(),p=this.glyph.mask_data(this.all_indices),r=Date.now()-O,t=this.plot_view.canvas_view.ctx,t.save(),x=this.model.data_source.selected,x=x&&0!==x.length?x["0d"].glyph?this.glyph instanceof a.LineView?p:this.model.view.convert_indices_from_subset(p):x["1d"].indices.length>0?x["1d"].indices:function(){var t,e,r,n;for(r=Object.keys(x["2d"].indices),n=[],t=0,e=r.length;t<e;t++)_=r[t],n.push(parseInt(_));return n}():[],d=this.model.data_source.inspected,d=d&&0!==d.length?d["0d"].glyph?this.glyph instanceof a.LineView?p:this.model.view.convert_indices_from_subset(p):d["1d"].indices.length>0?d["1d"].indices:function(){var t,e,r,n;for(r=Object.keys(d["2d"].indices),n=[],t=0,e=r.length;t<e;t++)_=r[t],n.push(parseInt(_));return n}():[],d=function(){var t,e,r,n;for(n=[],t=0,e=p.length;t<e;t++)_=p[t],r=this.all_indices[_],o.call(d,r)>=0&&n.push(_);return n}.call(this),g=this.plot_model.plot.lod_threshold,this.plot_view.interactive&&!l&&null!=g&&this.all_indices.length>g?(p=this.decimated,u=this.decimated_glyph,w=this.decimated_glyph,M=this.selection_glyph):(u=this.model.muted&&null!=this.muted_glyph?this.muted_glyph:this.glyph,w=this.nonselection_glyph,M=this.selection_glyph),null!=this.hover_glyph&&d.length&&(p=h.difference(p,d)),x.length&&this.have_selection_glyphs()){for(A=Date.now(),k={},f=0,m=x.length;f<m;f++)_=x[f],k[_]=!0;for(x=new Array,b=new Array,y=0,v=p.length;y<v;y++)_=p[y],this.glyph instanceof a.LineView?null!=k[_]?x.push(_):b.push(_):null!=k[this.all_indices[_]]?x.push(_):b.push(_);i=Date.now()-A,P=Date.now(),w.render(t,b,this.glyph),M.render(t,x,this.glyph),null!=this.hover_glyph&&this.hover_glyph.render(t,d,this.glyph),n=Date.now()-P}else P=Date.now(),u.render(t,p,this.glyph),this.hover_glyph&&d.length&&this.hover_glyph.render(t,d,this.glyph),n=Date.now()-P;return this.last_dtrender=n,s=Date.now()-S,c.logger.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): render finished in "+s+"ms"),c.logger.trace(" - map_data finished in : "+e+"ms"),null!=r&&c.logger.trace(" - mask_data finished in : "+r+"ms"),null!=i&&c.logger.trace(" - selection mask finished in : "+i+"ms"),c.logger.trace(" - glyph renders finished in : "+n+"ms"),t.restore()}},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.prototype.draw_legend=function(t,e,r,n,i,o,s){var a;return a=this.model.get_reference_point(o,s),this.glyph.draw_legend_for_index(t,e,r,n,i,a)},e.prototype.hit_test=function(t,e,r,n){return null==n&&(n="select"),this.model.hit_test_helper(t,this,e,r,n)},e}(s.RendererView),r.GlyphRenderer=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.GlyphRendererView,e.prototype.type="GlyphRenderer",e.prototype.initialize=function(t){if(e.__super__.initialize.call(this,t),null==this.view.source)return this.view.source=this.data_source,this.view.compute_indices()},e.prototype.get_reference_point=function(t,e){var r,n,i;return i=0,null!=t&&null!=this.data_source.get_column&&(r=this.data_source.get_column(t),r&&(n=r.indexOf(e),n>0&&(i=n))),i},e.prototype.hit_test_helper=function(t,e,r,n,i){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"===i?(l=this.data_source.selection_manager.selector,l.update(s,r,n),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.define({x_range_name:[_.String,"default"],y_range_name:[_.String,"default"],data_source:[_.Instance],view:[_.Instance,function(){return new u.CDSView}],glyph:[_.Instance],hover_glyph:[_.Instance],nonselection_glyph:[_.Any,"auto"],selection_glyph:[_.Any,"auto"],muted_glyph:[_.Instance],muted:[_.Bool,!1]}),e.override({level:"glyph"}),e.prototype.selection_defaults={fill:{},line:{}},e.prototype.decimated_defaults={fill:{fill_alpha:.3,fill_color:"grey"},line:{line_alpha:.3,line_color:"grey"}},e.prototype.nonselection_defaults={fill:{fill_alpha:.2,line_alpha:.2},line:{}},e}(s.Renderer)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(160),s=t(124),a=t(13),l=t(3);r.GraphRendererView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){var r;return e.__super__.initialize.call(this,t),this.xscale=this.plot_view.frame.xscales["default"],this.yscale=this.plot_view.frame.yscales["default"],this._renderer_views={},r=l.build_views(this._renderer_views,[this.model.node_renderer,this.model.edge_renderer],this.plot_view.view_options()),this.node_view=r[0],this.edge_view=r[1],this.set_data()},e.prototype.connect_signals=function(){return e.__super__.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.edge_renderer.data_source.select,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.inspect,function(){return this.set_data()})},e.prototype.set_data=function(t){var e,r;if(null==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],r=this.model.layout_provider.get_edge_coordinates(this.model.edge_renderer.data_source),this.edge_view.glyph._xs=r[0],this.edge_view.glyph._ys=r[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()},e.prototype.render=function(){return this.edge_view.render(),this.node_view.render()},e.prototype.hit_test=function(t,e,r,n){var i,o,s;return null==n&&(n="select"),!!this.model.visible&&(i=!1,i="select"===n?null!=(o=this.model.selection_policy)?o.do_selection(t,this,e,r):void 0:null!=(s=this.model.inspection_policy)?s.do_inspection(t,this,e,r):void 0)},e}(o.RendererView),r.GraphRenderer=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.GraphRendererView,e.prototype.type="GraphRenderer",e.prototype.get_selection_manager=function(){return this.node_renderer.data_source.selection_manager},e.define({x_range_name:[a.String,"default"],y_range_name:[a.String,"default"],layout_provider:[a.Instance],node_renderer:[a.Instance],edge_renderer:[a.Instance],selection_policy:[a.Instance,function(){return new s.NodesOnly}],inspection_policy:[a.Instance,function(){return new s.NodesOnly}]}),e.override({level:"glyph"}),e}(o.Renderer)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(160),s=t(13);r.GuideRenderer=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="GuideRenderer",e.define({plot:[s.Instance]}),e.override({level:"overlay"}),e}(o.Renderer)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(156);r.GlyphRenderer=n.GlyphRenderer;var i=t(157);r.GraphRenderer=i.GraphRenderer;var o=t(158);r.GuideRenderer=o.GuideRenderer;var s=t(160);r.Renderer=s.Renderer},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(5),s=t(44),a=t(13),l=t(30),u=t(28),c=t(48);r.RendererView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.plot_view=t.plot_view,this.visuals=new s.Visuals(this.model),this._has_finished=!0},e.getters({plot_model:function(){return this.plot_view.model}}),e.prototype.request_render=function(){return this.plot_view.request_render()},e.prototype.set_data=function(t){var e,r,n;if(e=this.model.materialize_dataspecs(t),u.extend(this,e),this.plot_model.use_map&&(null!=this._x&&(r=l.project_xy(this._x,this._y),this._x=r[0],this._y=r[1]),null!=this._xs))return n=l.project_xsys(this._xs,this._ys),this._xs=n[0],this._ys=n[1],n},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}(o.DOMView),r.Renderer=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="Renderer",e.define({level:[a.RenderLevel,null],visible:[a.Bool,!0]}),e}(c.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(163);r.CategoricalScale=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="CategoricalScale",e.prototype.compute=function(t){return e.__super__.compute.call(this,this.source_range.synthetic(t))},e.prototype.v_compute=function(t){return e.__super__.v_compute.call(this,this.source_range.v_synthetic(t))},e}(o.LinearScale)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(161);r.CategoricalScale=n.CategoricalScale;var i=t(163);r.LinearScale=i.LinearScale;var o=t(164);r.LogScale=o.LogScale;var s=t(165);r.Scale=s.Scale},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(165);r.LinearScale=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="LinearScale",e.prototype.compute=function(t){var e,r,n;return n=this._compute_state(),e=n[0],r=n[1],e*t+r},e.prototype.v_compute=function(t){var e,r,n,i,o,s,a,l;for(s=this._compute_state(),e=s[0],o=s[1],a=new Float64Array(t.length),n=r=0,i=t.length;r<i;n=++r)l=t[n],a[n]=e*l+o;return a},e.prototype.invert=function(t){var e,r,n;return n=this._compute_state(),e=n[0],r=n[1],(t-r)/e},e.prototype.v_invert=function(t){var e,r,n,i,o,s,a,l;for(s=this._compute_state(),
e=s[0],o=s[1],a=new Float64Array(t.length),n=r=0,i=t.length;r<i;n=++r)l=t[n],a[n]=(l-o)/e;return a},e.prototype._compute_state=function(){var t,e,r,n,i,o;return n=this.source_range.start,r=this.source_range.end,o=this.target_range.start,i=this.target_range.end,t=(i-o)/(r-n),e=-(t*n)+o,[t,e]},e}(o.Scale)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(165);r.LogScale=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="LogScale",e.prototype.compute=function(t){var e,r,n,i,o,s,a;return s=this._compute_state(),r=s[0],o=s[1],n=s[2],i=s[3],0===n?a=0:(e=(Math.log(t)-i)/n,a=isFinite(e)?e*r+o:NaN),a},e.prototype.v_compute=function(t){var e,r,n,i,o,s,a,l,u,c,_,h,p;if(u=this._compute_state(),r=u[0],l=u[1],i=u[2],o=u[3],h=new Float64Array(t.length),0===i)for(n=s=0,c=t.length;0<=c?s<c:s>c;n=0<=c?++s:--s)h[n]=0;else for(n=a=0,_=t.length;0<=_?a<_:a>_;n=0<=_?++a:--a)e=(Math.log(t[n])-o)/i,p=isFinite(e)?e*r+l:NaN,h[n]=p;return h},e.prototype.invert=function(t){var e,r,n,i,o,s;return o=this._compute_state(),e=o[0],i=o[1],r=o[2],n=o[3],s=(t-i)/e,Math.exp(r*s+n)},e.prototype.v_invert=function(t){var e,r,n,i,o,s,a,l,u,c;for(a=this._compute_state(),e=a[0],s=a[1],n=a[2],i=a[3],u=new Float64Array(t.length),r=o=0,l=t.length;0<=l?o<l:o>l;r=0<=l?++o:--o)c=(t[r]-s)/e,u[r]=Math.exp(n*c+i);return u},e.prototype._get_safe_factor=function(t,e){var r,n,i,o;return o=t<0?0:t,r=e<0?0:e,o===r&&(0===o?(i=[1,10],o=i[0],r=i[1]):(n=Math.log(o)/Math.log(10),o=Math.pow(10,Math.floor(n)),r=Math.ceil(n)!==Math.floor(n)?Math.pow(10,Math.ceil(n)):Math.pow(10,Math.ceil(n)+1))),[o,r]},e.prototype._compute_state=function(){var t,e,r,n,i,o,s,a,l,u,c,_;return l=this.source_range.start,a=this.source_range.end,_=this.target_range.start,c=this.target_range.end,s=c-_,o=this._get_safe_factor(l,a),u=o[0],t=o[1],0===u?(r=Math.log(t),n=0):(r=Math.log(t)-Math.log(u),n=Math.log(u)),e=s,i=_,[e,i,r,n]},e}(o.Scale)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(233),s=t(13);r.Scale=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.internal({source_range:[s.Any],target_range:[s.Any]}),e.prototype.map_to_target=function(t){return this.compute(t)},e.prototype.v_map_to_target=function(t){return this.v_compute(t)},e.prototype.map_from_target=function(t){return this.invert(t)},e.prototype.v_map_from_target=function(t){return this.v_invert(t)},e}(o.Transform)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){return function(){return t.apply(e,arguments)}},i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(173),a=t(12),l=t(13);r.AjaxDataSource=function(t){function e(){return this.get_data=n(this.get_data,this),this.setup=n(this.setup,this),this.destroy=n(this.destroy,this),e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="AjaxDataSource",e.define({mode:[l.String,"replace"],content_type:[l.String,"application/json"],http_headers:[l.Any,{}],max_size:[l.Number],method:[l.String,"POST"],if_modified:[l.Bool,!1]}),e.prototype.destroy=function(){if(null!=this.interval)return clearInterval(this.interval)},e.prototype.setup=function(){if(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,e,r){var n,i,o,s;null==e&&(e=0),null==r&&(r=!1),s=new XMLHttpRequest,s.open(this.method,this.data_url,!0),s.withCredentials=!1,s.setRequestHeader("Content-Type",this.content_type),i=this.http_headers;for(n in i)o=i[n],s.setRequestHeader(n,o);return s.addEventListener("load",function(r){return function(){var n,i,o,a,l,u;if(200===s.status)switch(i=JSON.parse(s.responseText),t){case"replace":return r.data=i;case"append":for(l=r.data,u=r.columns(),o=0,a=u.length;o<a;o++)n=u[o],i[n]=l[n].concat(i[n]).slice(-e);return r.data=i}}}(this)),s.addEventListener("error",function(t){return function(){return a.logger.error("Failed to fetch JSON from "+t.data_url+" with code "+s.status)}}(this)),s.send(),null},e}(s.RemoteDataSource)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(48),s=t(13),a=t(20),l=t(169);r.CDSView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="CDSView",e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.compute_indices()},e.define({filters:[s.Array,[]],source:[s.Instance]}),e.internal({indices:[s.Array,[]],indices_map:[s.Any,{}]}),e.prototype.connect_signals=function(){var t,r,n;if(e.__super__.connect_signals.call(this),this.connect(this.properties.filters.change,function(){return this.compute_indices(),this.change.emit()}),null!=(null!=(t=this.source)?t.change:void 0)&&this.connect(this.source.change,function(){return this.compute_indices()}),null!=(null!=(r=this.source)?r.streaming:void 0)&&this.connect(this.source.streaming,function(){return this.compute_indices()}),null!=(null!=(n=this.source)?n.patching:void 0))return this.connect(this.source.patching,function(){return this.compute_indices()})},e.prototype.compute_indices=function(){var t,e,r,n;return e=function(){var e,r,n,i;for(n=this.filters,i=[],e=0,r=n.length;e<r;e++)t=n[e],i.push(t.compute_indices(this.source));return i}.call(this),e=function(){var t,n,i;for(i=[],t=0,n=e.length;t<n;t++)r=e[t],null!=r&&i.push(r);return i}(),e.length>0?this.indices=a.intersection.apply(this,e):this.source instanceof l.ColumnarDataSource&&(this.indices=null!=(n=this.source)?n.get_indices():void 0),this.indices_map_to_subset()},e.prototype.indices_map_to_subset=function(){var t,e,r,n;for(this.indices_map={},n=[],t=e=0,r=this.indices.length;0<=r?e<r:e>r;t=0<=r?++e:--e)n.push(this.indices_map[this.indices[t]]=t);return n},e.prototype.convert_selection_from_subset=function(t){var e,r;return r=function(){var r,n,i,o;for(i=t["1d"].indices,o=[],r=0,n=i.length;r<n;r++)e=i[r],o.push(this.indices[e]);return o}.call(this),t["1d"].indices=r,t},e.prototype.convert_selection_to_subset=function(t){var e,r;return r=function(){var r,n,i,o;for(i=t["1d"].indices,o=[],r=0,n=i.length;r<n;r++)e=i[r],o.push(this.indices_map[e]);return o}.call(this),t["1d"].indices=r,t},e.prototype.convert_indices_from_subset=function(t){var e;return function(){var r,n,i;for(i=[],r=0,n=t.length;r<n;r++)e=t[r],i.push(this.indices[e]);return i}.call(this)},e}(o.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(169),s=t(7),a=t(13),l=t(25),u=t(33),c=t(40);r.concat_typed_arrays=function(t,e){var r;return r=new t.constructor(t.length+e.length),r.set(t,0),r.set(e,t.length),r},r.stream_to_column=function(t,e,n){var i,o,s,a,l,u,c,_,h,p;if(null!=t.concat)return t=t.concat(e),t.length>n&&(t=t.slice(-n)),t;if(p=t.length+e.length,null!=n&&p>n){for(_=p-n,i=t.length,t.length<n&&(h=new t.constructor(n),h.set(t,0),t=h),o=s=l=_,u=i;l<=u?s<u:s>u;o=l<=u?++s:--s)t[o-_]=t[o];for(o=a=0,c=e.length;0<=c?a<c:a>c;o=0<=c?++a:--a)t[o+(i-_)]=e[o];return t}return h=new t.constructor(e),r.concat_typed_arrays(t,h)},r.slice=function(t,e){var r,n,i,o,s,a,l;return c.isObject(t)?[null!=(r=t.start)?r:0,null!=(n=t.stop)?n:e,null!=(i=t.step)?i:1]:(o=[t,t+1,1],s=o[0],l=o[1],a=o[2],o)},r.patch_to_column=function(t,e,n){var i,o,s,a,u,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E,z,C;for(w=new l.Set,x=!1,m=0,v=e.length;m<v;m++)for(k=e[m],s=k[0],C=k[1],c.isArray(s)?(w.push(s[0]),z=n[s[0]],h=t[s[0]]):(c.isNumber(s)?(C=[C],w.push(s)):x=!0,s=[0,0,s],z=[1,t.length],h=t),2===s.length&&(z=[1,z[0]],s=[s[0],0,s[1]]),i=0,M=r.slice(s[1],z[0]),a=M[0],_=M[1],u=M[2],S=r.slice(s[2],z[1]),d=S[0],y=S[1],f=S[2],o=g=T=a,O=_,P=u;P>0?g<O:g>O;o=g+=P)for(p=b=A=d,j=y,E=f;E>0?b<j:b>j;p=b+=E)x&&w.push(p),h[o*z[1]+p]=C[i],i++;return w},r.ColumnDataSource=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="ColumnDataSource",e.prototype.initialize=function(t){var r;return e.__super__.initialize.call(this,t),r=u.decode_column_data(this.data),this.data=r[0],this._shapes=r[1],r},e.define({data:[a.Any,{}]}),e.prototype.attributes_as_json=function(t,r){var n,o,s,a;null==t&&(t=!0),null==r&&(r=e._value_to_json),n={},s=this.serializable_attributes();for(o in s)i.call(s,o)&&(a=s[o],"data"===o&&(a=u.encode_column_data(a,this._shapes)),t?n[o]=a:o in this._set_after_defaults&&(n[o]=a));return r("attributes",n,this)},e._value_to_json=function(t,e,r){return c.isObject(e)&&"data"===t?u.encode_column_data(e,r._shapes):s.HasProps._value_to_json(t,e,r)},e.prototype.stream=function(t,e){var n,i,o;n=this.data;for(i in t)o=t[i],n[i]=r.stream_to_column(n[i],t[i],e);return this.setv("data",n,{silent:!0}),this.streaming.emit()},e.prototype.patch=function(t){var e,n,i,o;e=this.data,o=new l.Set;for(n in t)i=t[n],o=o.union(r.patch_to_column(e[n],i,this._shapes[n]));return this.setv("data",e,{silent:!0}),this.patching.emit(o.values)},e}(o.ColumnarDataSource)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(170),s=t(18),a=t(12),l=t(15),u=t(13),c=t(20);r.ColumnarDataSource=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="ColumnarDataSource",e.define({column_names:[u.Array,[]]}),e.internal({selection_manager:[u.Instance,function(t){return new l.SelectionManager({source:t})}],inspected:[u.Any],_shapes:[u.Any,{}]}),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.select=new s.Signal(this,"select"),this.inspect=new s.Signal(this,"inspect"),this.streaming=new s.Signal(this,"streaming"),this.patching=new s.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){var e,r,n,i;switch(null==t&&(t=!0),r=c.uniq(function(){var t,r;t=this.data,r=[];for(e in t)i=t[e],r.push(i.length);return r}.call(this)),r.length){case 0:return null;case 1:return r[0];default:if(n="data source has columns of inconsistent lengths",t)return a.logger.warn(n),r.sort()[0];throw new Error(n)}},e.prototype.get_indices=function(){var t,e;return t=this.get_length(),null==t&&(t=1),function(){e=[];for(var r=0;0<=t?r<t:r>t;0<=t?r++:r--)e.push(r);return e}.apply(this)},e}(o.DataSource)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(48),s=t(8),a=t(13),l=t(40);r.DataSource=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="DataSource",e.define({selected:[a.Any,s.create_hit_test_result()],callback:[a.Any]}),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.connect(this.properties.selected.change,function(t){return function(){var e;if(e=t.callback,null!=e)return l.isFunction(e)?e(t):e.execute(t)}}(this))},e}(o.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(169),s=t(12),a=t(13);r.GeoJSONDataSource=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="GeoJSONDataSource",e.define({geojson:[a.Any]}),e.internal({data:[a.Any,{}]}),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this._update_data(),this.connect(this.properties.geojson.change,function(t){return function(){return t._update_data()}}(this))},e.prototype._update_data=function(){return this.data=this.geojson_to_column_data()},e.prototype._get_new_list_array=function(t){var e,r,n,i;for(i=[],e=r=0,n=t;0<=n?r<n:r>n;e=0<=n?++r:--r)i.push([]);return i},e.prototype._get_new_nan_array=function(t){var e,r,n,i;for(i=[],e=r=0,n=t;0<=n?r<n:r>n;e=0<=n?++r:--r)i.push(NaN);return i},e.prototype._flatten_function=function(t,e){return t.concat([[NaN,NaN,NaN]]).concat(e)},e.prototype._add_properties=function(t,e,r,n){var i,o;o=[];for(i in t.properties)e.hasOwnProperty(i)||(e[i]=this._get_new_nan_array(n)),o.push(e[i][r]=t.properties[i]);return o},e.prototype._add_geometry=function(t,e,r){var n,i,o,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j;switch(t.type){case"Point":return i=t.coordinates,e.x[r]=i[0],e.y[r]=i[1],e.z[r]=null!=(w=i[2])?w:NaN;case"LineString":for(n=t.coordinates,O=[],u=c=0,h=n.length;c<h;u=++c)i=n[u],e.xs[r][u]=i[0],e.ys[r][u]=i[1],O.push(e.zs[r][u]=null!=(x=i[2])?x:NaN);return O;case"Polygon":for(t.coordinates.length>1&&s.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),o=t.coordinates[0],P=[],u=_=0,p=o.length;_<p;u=++_)i=o[u],e.xs[r][u]=i[0],e.ys[r][u]=i[1],P.push(e.zs[r][u]=null!=(k=i[2])?k:NaN);return P;case"MultiPoint":return s.logger.warn("MultiPoint not supported in Bokeh");case"MultiLineString":for(l=t.coordinates.reduce(this._flatten_function),A=[],u=m=0,d=l.length;m<d;u=++m)i=l[u],e.xs[r][u]=i[0],e.ys[r][u]=i[1],A.push(e.zs[r][u]=null!=(M=i[2])?M:NaN);return A;case"MultiPolygon":for(a=[],S=t.coordinates,v=0,f=S.length;v<f;v++)b=S[v],b.length>1&&s.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=g=0,y=l.length;g<y;u=++g)i=l[u],e.xs[r][u]=i[0],e.ys[r][u]=i[1],j.push(e.zs[r][u]=null!=(T=i[2])?T:NaN);return j;default:throw new Error("Invalid type "+t.type)}},e.prototype._get_items_length=function(t){var e,r,n,i,o,s,a,l,u,c,_;for(e=0,i=a=0,u=t.length;a<u;i=++a)if(o=t[i],n="Feature"===o.type?o.geometry:o,"GeometryCollection"===n.type)for(_=n.geometries,s=l=0,c=_.length;l<c;s=++l)r=_[s],e+=1;else e+=1;return e},e.prototype.geojson_to_column_data=function(){var t,e,r,n,i,o,s,a,l,u,c,_,h,p,d,f;if(n=JSON.parse(this.geojson),"GeometryCollection"!==(d=n.type)&&"FeatureCollection"!==d)throw new Error("Bokeh only supports type GeometryCollection and FeatureCollection at top level");if("GeometryCollection"===n.type){if(null==n.geometries)throw new Error("No geometries found in GeometryCollection");if(0===n.geometries.length)throw new Error("geojson.geometries must have one or more items");l=n.geometries}if("FeatureCollection"===n.type){if(null==n.features)throw new Error("No features found in FeaturesCollection");if(0===n.features.length)throw new Error("geojson.features must have one or more items");l=n.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=c=0,h=l.length;c<h;o=++c)if(s=l[o],i="Feature"===s.type?s.geometry:s,"GeometryCollection"===i.type)for(f=i.geometries,u=_=0,p=f.length;_<p;u=++_)r=f[u],this._add_geometry(r,e,t),"Feature"===s.type&&this._add_properties(s,e,t,a),t+=1;else this._add_geometry(i,e,t),"Feature"===s.type&&this._add_properties(s,e,t,a),t+=1;return e},e}(o.ColumnarDataSource)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(166);r.AjaxDataSource=n.AjaxDataSource;var i=t(168);r.ColumnDataSource=i.ColumnDataSource;var o=t(169);r.ColumnarDataSource=o.ColumnarDataSource;var s=t(167);r.CDSView=s.CDSView;var a=t(170);r.DataSource=a.DataSource;var l=t(171);r.GeoJSONDataSource=l.GeoJSONDataSource;var u=t(173);r.RemoteDataSource=u.RemoteDataSource},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(168),s=t(13);r.RemoteDataSource=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="RemoteDataSource",e.define({data_url:[s.String],polling_interval:[s.Number]}),e}(o.ColumnDataSource)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o=function(t,e){function r(){this.constructor=t}for(var n in e)s.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},s={}.hasOwnProperty,a=[].slice,l=t(178),u=t(13),c=t(20);n=function(t,e,r){return Math.max(e,Math.min(r,t))},i=function(t,e){return null==e&&(e=Math.E),Math.log(t)/Math.log(e)},r.AdaptiveTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return o(e,t),e.prototype.type="AdaptiveTicker",e.define({base:[u.Number,10],mantissas:[u.Array,[1,2,5]],min_interval:[u.Number,0],max_interval:[u.Number]}),e.prototype.initialize=function(t,r){var n,i;return e.__super__.initialize.call(this,t,r),n=c.nth(this.mantissas,-1)/this.base,i=c.nth(this.mantissas,0)*this.base,this.extended_mantissas=[n].concat(a.call(this.mantissas),[i]),this.base_factor=0===this.get_min_interval()?1:this.get_min_interval()},e.prototype.get_interval=function(t,e,r){var o,s,a,l,u,_,h,p,d;return a=e-t,u=this.get_ideal_interval(t,e,r),d=Math.floor(i(u/this.base_factor,this.base)),_=Math.pow(this.base,d)*this.base_factor,h=u/_,s=this.extended_mantissas,l=s.map(function(t){return Math.abs(r-a/(t*_))}),o=s[c.argmin(l)],p=o*_,n(p,this.get_min_interval(),this.get_max_interval())},e}(l.ContinuousTicker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(174);r.BasicTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="BasicTicker",e}(o.AdaptiveTicker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(187);r.CategoricalTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="CategoricalTicker",e.prototype.get_ticks=function(t,e,r,n,i){var o,s,a,l,u,c;return o=i.desired_n_ticks,s=this._collect(r.factors,r,t,e),c=this._collect(null!=(l=r.tops)?l:[],r,t,e),a=this._collect(null!=(u=r.mids)?u:[],r,t,e),{major:s,tops:c,mids:a,minor:[]}},e.prototype._collect=function(t,e,r,n){var i,o,s,a,l;for(l=[],s=0,a=t.length;s<a;s++)o=t[s],i=e.synthetic(o),i>r&&i<n&&l.push(o);return l},e}(o.Ticker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(178),s=t(13),a=t(20),l=t(28);r.CompositeTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="CompositeTicker",e.define({tickers:[s.Array,[]]}),e.getters({min_intervals:function(){var t,e,r,n,i;for(r=this.tickers,n=[],t=0,e=r.length;t<e;t++)i=r[t],n.push(i.get_min_interval());return n},max_intervals:function(){var t,e,r,n,i;for(r=this.tickers,n=[],t=0,e=r.length;t<e;t++)i=r[t],n.push(i.get_max_interval());return n},min_interval:function(){return this.min_intervals[0]},max_interval:function(){return this.max_intervals[0]}}),e.prototype.get_best_ticker=function(t,e,r){var n,i,o,s,u,c,_,h;return s=e-t,c=this.get_ideal_interval(t,e,r),h=[a.sortedIndex(this.min_intervals,c)-1,a.sortedIndex(this.max_intervals,c)],_=[this.min_intervals[h[0]],this.max_intervals[h[1]]],u=_.map(function(t){return Math.abs(r-s/t)}),l.isEmpty(u.filter(function(t){return!isNaN(t)}))?i=this.tickers[0]:(n=a.argmin(u),o=h[n],i=this.tickers[o]),i},e.prototype.get_interval=function(t,e,r){var n;return n=this.get_best_ticker(t,e,r),n.get_interval(t,e,r)},e.prototype.get_ticks_no_defaults=function(t,e,r,n){var i,o;return i=this.get_best_ticker(t,e,n),o=i.get_ticks_no_defaults(t,e,r,n)},e}(o.ContinuousTicker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(187),s=t(13);r.ContinuousTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="ContinuousTicker",e.define({num_minor_ticks:[s.Number,5],desired_num_ticks:[s.Number,6]}),e.prototype.get_interval=void 0,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,r){var n;return n=e-t,n/r},e}(o.Ticker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s,a,l=function(t,e){function r(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},u={}.hasOwnProperty,c=t(20),_=t(174),h=t(177),p=t(180),d=t(185),f=t(189),y=t(188);i=y.ONE_MILLI,a=y.ONE_SECOND,o=y.ONE_MINUTE,n=y.ONE_HOUR,s=y.ONE_MONTH,r.DatetimeTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="DatetimeTicker",e.override({num_minor_ticks:0,tickers:function(){return[new _.AdaptiveTicker({mantissas:[1,2,5],base:10,min_interval:0,max_interval:500*i,num_minor_ticks:0}),new _.AdaptiveTicker({mantissas:[1,2,5,10,15,20,30],base:60,min_interval:a,max_interval:30*o,num_minor_ticks:0}),new _.AdaptiveTicker({mantissas:[1,2,4,6,8,12],base:24,min_interval:n,max_interval:12*n,num_minor_ticks:0}),new p.DaysTicker({days:c.range(1,32)}),new p.DaysTicker({days:c.range(1,31,3)}),new p.DaysTicker({days:[1,8,15,22]}),new p.DaysTicker({days:[1,15]}),new d.MonthsTicker({months:c.range(0,12,1)}),new d.MonthsTicker({months:c.range(0,12,2)}),new d.MonthsTicker({months:c.range(0,12,4)}),new d.MonthsTicker({months:c.range(0,12,6)}),new f.YearsTicker({})]}}),e}(h.CompositeTicker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty,u=t(186),c=t(188),_=t(13),h=t(20);i=c.copy_date,s=c.last_month_no_later_than,n=c.ONE_DAY,o=function(t,e){var r,n,o,a,l;for(l=s(new Date(t)),o=s(new Date(e)),a=i(o),o.setUTCMonth(o.getUTCMonth()+1),n=[],r=l;;)if(n.push(i(r)),r.setUTCMonth(r.getUTCMonth()+1),r>o)break;return n},r.DaysTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="DaysTicker",e.define({days:[_.Array,[]]}),e.prototype.initialize=function(t,r){var i,o;return t.num_minor_ticks=0,e.__super__.initialize.call(this,t,r),i=this.days,o=i.length>1?(i[1]-i[0])*n:31*n,this.interval=o},e.prototype.get_ticks_no_defaults=function(t,e,r,n){var s,a,l,u,c,_,p,d,f;return d=o(t,e),c=this.days,_=function(t){return function(t,e){var r,n,o,s,a,l;for(r=[],a=0,l=c.length;a<l;a++)n=c[a],o=i(t),o.setUTCDate(n),s=new Date(o.getTime()+e/2),s.getUTCMonth()===t.getUTCMonth()&&r.push(o);return r}}(this),p=this.interval,u=h.concat(function(){var t,e,r;for(r=[],t=0,e=d.length;t<e;t++)a=d[t],r.push(_(a,p));return r}()),s=function(){var t,e,r;for(r=[],t=0,e=u.length;t<e;t++)l=u[t],r.push(l.getTime());return r}(),f=s.filter(function(r){return t<=r&&r<=e}),{major:f,minor:[]}},e}(u.SingleIntervalTicker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(178),s=t(13);r.FixedTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="FixedTicker",e.define({ticks:[s.Array,[]]}),e.prototype.get_ticks_no_defaults=function(t,e,r,n){return{major:this.ticks,minor:[]}},e}(o.ContinuousTicker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(174);r.AdaptiveTicker=n.AdaptiveTicker;var i=t(175);r.BasicTicker=i.BasicTicker;var o=t(176);r.CategoricalTicker=o.CategoricalTicker;var s=t(177);r.CompositeTicker=s.CompositeTicker;var a=t(178);r.ContinuousTicker=a.ContinuousTicker;var l=t(179);r.DatetimeTicker=l.DatetimeTicker;var u=t(180);r.DaysTicker=u.DaysTicker;var c=t(181);r.FixedTicker=c.FixedTicker;var _=t(183);r.LogTicker=_.LogTicker;var h=t(184);r.MercatorTicker=h.MercatorTicker;var p=t(185);r.MonthsTicker=p.MonthsTicker;var d=t(186);r.SingleIntervalTicker=d.SingleIntervalTicker;var f=t(187);r.Ticker=f.Ticker;var y=t(189);r.YearsTicker=y.YearsTicker},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(20),s=t(174);r.LogTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="LogTicker",e.override({mantissas:[1,5]}),e.prototype.get_ticks_no_defaults=function(t,e,r,n){var i,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E,z,C,N,D,F;if(A=this.num_minor_ticks,O=[],i=this.base,k=Math.log(t)/Math.log(i),w=Math.log(e)/Math.log(i),x=w-k,isFinite(x)){if(x<2){if(_=this.get_interval(t,e,n),z=Math.floor(t/_),s=Math.ceil(e/_),u=o.range(z,s+1),D=function(){var t,e,r;for(r=[],t=0,e=u.length;t<e;t++)l=u[t],0!==l&&r.push(l*_);return r}(),D=D.filter(function(r){return t<=r&&r<=e}),A>0&&D.length>0){for(S=_/A,T=function(){var t,e,r;for(r=[],c=t=0,e=A;0<=e?t<e:t>e;c=0<=e?++t:--t)r.push(c*S);return r}(),E=T.slice(1,+T.length+1||9e9),h=0,f=E.length;h<f;h++)F=E[h],O.push(D[0]-F);for(p=0,y=D.length;p<y;p++)for(N=D[p],d=0,m=T.length;d<m;d++)F=T[d],O.push(N+F)}}else if(C=Math.ceil(.999999*k),a=Math.floor(1.000001*w),_=Math.ceil((a-C)/9),D=o.range(C,a+1,_),D=D.map(function(t){return Math.pow(i,t)}),D=D.filter(function(r){return t<=r&&r<=e}),A>0&&D.length>0){for(S=Math.pow(i,_)/A,T=function(){var t,e,r;for(r=[],c=t=1,e=A;1<=e?t<=e:t>=e;c=1<=e?++t:--t)r.push(c*S);return r}(),M=0,v=T.length;M<v;M++)F=T[M],O.push(D[0]/F);for(O.push(D[0]),P=0,g=D.length;P<g;P++)for(N=D[P],j=0,b=T.length;j<b;j++)F=T[j],O.push(N*F)}}else D=[];return{major:D,minor:O}},e}(s.AdaptiveTicker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(175),s=t(13),a=t(29);r.MercatorTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="MercatorTicker",e.define({dimension:[s.LatLon]}),e.prototype.get_ticks_no_defaults=function(t,r,n,i){var o,s,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E,z,C,N;if(null==this.dimension)throw new Error("MercatorTicker.dimension not configured");if("lon"===this.dimension?(w=a.proj4(a.mercator).inverse([t,n]),g=w[0],m=w[1],x=a.proj4(a.mercator).inverse([r,n]),v=x[0],m=x[1]):(S=a.proj4(a.mercator).inverse([n,t]),m=S[0],g=S[1],T=a.proj4(a.mercator).inverse([n,r]),m=T[0],v=T[1]),b=e.__super__.get_ticks_no_defaults.call(this,g,v,n,i),N={major:[],minor:[]},"lon"===this.dimension){for(O=b.major,s=0,h=O.length;s<h;s++)C=O[s],P=a.proj4(a.mercator).forward([C,m]),y=P[0],o=P[1],N.major.push(y);for(A=b.minor,l=0,p=A.length;l<p;l++)C=A[l],j=a.proj4(a.mercator).forward([C,m]),y=j[0],o=j[1],N.minor.push(y)}else{for(E=b.major,u=0,d=E.length;u<d;u++)C=E[u],z=a.proj4(a.mercator).forward([m,C]),o=z[0],_=z[1],N.major.push(_);for(k=b.minor,c=0,f=k.length;c<f;c++)C=k[c],M=a.proj4(a.mercator).forward([m,C]),o=M[0],_=M[1],N.minor.push(_)}return N},e}(o.BasicTicker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty,u=t(186),c=t(188),_=t(13),h=t(20);i=c.copy_date,s=c.last_year_no_later_than,n=c.ONE_MONTH,o=function(t,e){var r,n,o,a;for(a=s(new Date(t)),o=s(new Date(e)),o.setUTCFullYear(o.getUTCFullYear()+1),n=[],r=a;;)if(n.push(i(r)),r.setUTCFullYear(r.getUTCFullYear()+1),r>o)break;return n},r.MonthsTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="MonthsTicker",e.define({months:[_.Array,[]]}),e.prototype.initialize=function(t,r){var i,o;return e.__super__.initialize.call(this,t,r),o=this.months,i=o.length>1?(o[1]-o[0])*n:12*n,this.interval=i},e.prototype.get_ticks_no_defaults=function(t,e,r,n){var s,a,l,u,c,_,p,d;return d=o(t,e),c=this.months,_=function(t){return c.map(function(e){var r;return r=i(t),r.setUTCMonth(e),r})},u=h.concat(function(){var t,e,r;for(r=[],t=0,e=d.length;t<e;t++)a=d[t],r.push(_(a));return r}()),s=function(){var t,e,r;for(r=[],t=0,e=u.length;t<e;t++)l=u[t],r.push(l.getTime());return r}(),p=s.filter(function(r){return t<=r&&r<=e}),{major:p,minor:[]}},e}(u.SingleIntervalTicker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(178),s=t(13);r.SingleIntervalTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="SingleIntervalTicker",e.define({interval:[s.Number]}),e.getters({min_interval:function(){return this.interval},max_interval:function(){return this.interval}}),e.prototype.get_interval=function(t,e,r){return this.interval},e}(o.ContinuousTicker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(48),s=t(20),a=t(40);r.Ticker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="Ticker",e.prototype.get_ticks=function(t,e,r,n,i){var o;return o=i.desired_n_ticks,
this.get_ticks_no_defaults(t,e,n,this.desired_num_ticks)},e.prototype.get_ticks_no_defaults=function(t,e,r,n){var i,o,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S;if(c=this.get_interval(t,e,n),x=Math.floor(t/c),i=Math.ceil(e/c),l=a.isStrictNaN(x)||a.isStrictNaN(i)?[]:s.range(x,i+1),M=function(){var t,e,r;for(r=[],t=0,e=l.length;t<e;t++)o=l[t],r.push(o*c);return r}(),M=M.filter(function(r){return t<=r&&r<=e}),b=this.num_minor_ticks,g=[],b>0&&M.length>0){for(m=c/b,v=function(){var t,e,r;for(r=[],u=t=0,e=b;0<=e?t<e:t>e;u=0<=e?++t:--t)r.push(u*m);return r}(),w=v.slice(1,+v.length+1||9e9),_=0,d=w.length;_<d;_++)S=w[_],g.push(M[0]-S);for(h=0,f=M.length;h<f;h++)for(k=M[h],p=0,y=v.length;p<y;p++)S=v[p],g.push(k+S)}return{major:M,minor:g}},e}(o.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_MILLI=1,r.ONE_SECOND=1e3,r.ONE_MINUTE=60*r.ONE_SECOND,r.ONE_HOUR=60*r.ONE_MINUTE,r.ONE_DAY=24*r.ONE_HOUR,r.ONE_MONTH=30*r.ONE_DAY,r.ONE_YEAR=365*r.ONE_DAY,r.copy_date=function(t){return new Date(t.getTime())},r.last_month_no_later_than=function(t){return t=r.copy_date(t),t.setUTCDate(1),t.setUTCHours(0),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),t},r.last_year_no_later_than=function(t){return t=r.last_month_no_later_than(t),t.setUTCMonth(0),t}},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o=function(t,e){function r(){this.constructor=t}for(var n in e)s.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},s={}.hasOwnProperty,a=t(175),l=t(186),u=t(188);i=u.last_year_no_later_than,n=u.ONE_YEAR,r.YearsTicker=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return o(e,t),e.prototype.type="YearsTicker",e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.interval=n,this.basic_ticker=new a.BasicTicker({num_minor_ticks:0})},e.prototype.get_ticks_no_defaults=function(t,e,r,n){var o,s,a,l,u,c;return a=i(new Date(t)).getUTCFullYear(),s=i(new Date(e)).getUTCFullYear(),c=this.basic_ticker.get_ticks_no_defaults(a,s,r,n).major,o=function(){var t,e,r;for(r=[],t=0,e=c.length;t<e;t++)u=c[t],r.push(Date.UTC(u,0,1));return r}(),l=o.filter(function(r){return t<=r&&r<=e}),{major:l,minor:[]}},e}(l.SingleIntervalTicker)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(195),s=t(13);r.BBoxTileSource=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="BBoxTileSource",e.define({use_latlon:[s.Bool,!1]}),e.prototype.get_image_url=function(t,e,r){var n,i,o,s,a,l,u;return n=this.string_lookup_replace(this.url,this.extra_url_vars),this.use_latlon?(i=this.get_tile_geographic_bounds(t,e,r),a=i[0],u=i[1],s=i[2],l=i[3]):(o=this.get_tile_meter_bounds(t,e,r),a=o[0],u=o[1],s=o[2],l=o[3]),n.replace("{XMIN}",a).replace("{YMIN}",u).replace("{XMAX}",s).replace("{YMAX}",l)},e}(o.MercatorTileSource)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){return function(){return t.apply(e,arguments)}},i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(160),a=t(12),l=t(13);r.DynamicImageView=function(t){function e(){return this._on_image_error=n(this._on_image_error,this),this._on_image_load=n(this._on_image_load,this),e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.connect_signals=function(){return e.__super__.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 e;if(e=t.target.image_data,e.img=t.target,e.loaded=!0,this.lastImage=e,this.get_extent().join(":")===e.cache_key)return this.request_render()},e.prototype._on_image_error=function(t){var e;return a.logger.error("Error loading image: "+t.target.src),e=t.target.image_data,this.model.image_source.remove_image(e)},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,r){var n,i;return null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),n=this.get_extent(),this.render_timer&&clearTimeout(this.render_timer),i=this.model.image_source.images[n.join(":")],null!=i&&i.loaded?void this._draw_image(n.join(":")):(null!=this.lastImage&&this._draw_image(this.lastImage.cache_key),null==i?this.render_timer=setTimeout(function(t){return function(){return t._create_image(n)}}(this),125):void 0)},e.prototype._draw_image=function(t){var e,r,n,i,o,s,a,l,u,c,_;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,r=this.plot_view.frame.map_to_screen([e.bounds[0]],[e.bounds[3]],this.plot_view.canvas),l=r[0],_=r[1],n=this.plot_view.frame.map_to_screen([e.bounds[2]],[e.bounds[1]],this.plot_view.canvas),a=n[0],c=n[1],l=l[0],_=_[0],a=a[0],c=c[0],o=a-l,i=c-_,s=l,u=_,this.map_canvas.drawImage(e.img,s,u,o,i),this.map_canvas.restore()},e.prototype._set_rect=function(){var t,e,r,n,i;return r=this.plot_model.plot.properties.outline_line_width.value(),e=this.plot_view.canvas.vx_to_sx(this.map_frame._left.value)+r/2,n=this.plot_view.canvas.vy_to_sy(this.map_frame._top.value)+r/2,i=this.map_frame._width.value-r,t=this.map_frame._height.value-r,this.map_canvas.rect(e,n,i,t),this.map_canvas.clip()},e}(s.RendererView),r.DynamicImageRenderer=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.default_view=r.DynamicImageView,e.prototype.type="DynamicImageRenderer",e.define({alpha:[l.Number,1],image_source:[l.Instance],render_parents:[l.Bool,!0]}),e.override({level:"underlay"}),e}(s.Renderer)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.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,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(13),s=t(48);r.ImageSource=function(t){function e(t){null==t&&(t={}),e.__super__.constructor.apply(this,arguments),this.images={},this.normalize_case()}return n(e,t),e.prototype.type="ImageSource",e.define({url:[o.String,""],extra_url_vars:[o.Any,{}]}),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 r,n,i;n=t;for(r in e)i=e[r],n=n.replace("{"+r+"}",i.toString());return n},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,r,n,i,o){var s;return s=this.string_lookup_replace(this.url,this.extra_url_vars),s.replace("{XMIN}",t).replace("{YMIN}",e).replace("{XMAX}",r).replace("{YMAX}",n).replace("{WIDTH}",o).replace("{HEIGHT}",i)},e}(s.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(190);r.BBoxTileSource=n.BBoxTileSource;var i=t(191);r.DynamicImageRenderer=i.DynamicImageRenderer;var o=t(193);r.ImageSource=o.ImageSource;var s=t(195);r.MercatorTileSource=s.MercatorTileSource;var a=t(196);r.QUADKEYTileSource=a.QUADKEYTileSource;var l=t(197);r.TileRenderer=l.TileRenderer;var u=t(198);r.TileSource=u.TileSource;var c=t(200);r.TMSTileSource=c.TMSTileSource;var _=t(201);r.WMTSTileSource=_.WMTSTileSource},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},s=t(198),a=t(13);r.MercatorTileSource=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="MercatorTileSource",e.define({wrap_around:[a.Bool,!0]}),e.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097}),e.prototype.initialize=function(t){var r;return e.__super__.initialize.call(this,t),this._resolutions=function(){var t,e,n,i;for(i=[],r=t=e=this.min_zoom,n=this.max_zoom;e<=n?t<=n:t>=n;r=e<=n?++t:--t)i.push(this.get_resolution(r));return i}.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,r){return!(!this.wrap_around&&(t<0||t>=Math.pow(2,r)))&&!(e<0||e>=Math.pow(2,r))},e.prototype.retain_children=function(t){var e,r,n,i,o,s,a;i=t.quadkey,n=i.length,r=n+3,o=this.tiles,s=[];for(e in o)a=o[e],0===a.quadkey.indexOf(i)&&a.quadkey.length>n&&a.quadkey.length<=r?s.push(a.retain=!0):s.push(void 0);return s},e.prototype.retain_neighbors=function(t){var e,r,n,i,s,a,l,u,c,_,h,p,d,f,y;r=4,s=t.tile_coords,h=s[0],p=s[1],d=s[2],n=function(){var t,e,n,i;for(i=[],f=t=e=h-r,n=h+r;e<=n?t<=n:t>=n;f=e<=n?++t:--t)i.push(f);return i}(),i=function(){var t,e,n,i;for(i=[],y=t=e=p-r,n=p+r;e<=n?t<=n:t>=n;y=e<=n?++t:--t)i.push(y);return i}(),a=this.tiles,c=[];for(e in a)_=a[e],_.tile_coords[2]===d&&(l=_.tile_coords[0],o.call(n,l)>=0)&&(u=_.tile_coords[1],o.call(i,u)>=0)?c.push(_.retain=!0):c.push(void 0);return c},e.prototype.retain_parents=function(t){var e,r,n,i,o;r=t.quadkey,n=this.tiles,i=[];for(e in n)o=n[e],i.push(o.retain=0===r.indexOf(o.quadkey));return i},e.prototype.children_by_tile_xyz=function(t,e,r){var n,i,o,s,a,l,u,c,_;for(_=this.calculate_world_x_by_tile_xyz(t,e,r),0!==_&&(l=this.normalize_xyz(t,e,r),t=l[0],e=l[1],r=l[2]),a=this.tile_xyz_to_quadkey(t,e,r),i=[],o=s=0;s<=3;o=s+=1)u=this.quadkey_to_tile_xyz(a+o.toString()),t=u[0],e=u[1],r=u[2],0!==_&&(c=this.denormalize_xyz(t,e,r,_),t=c[0],e=c[1],r=c[2]),n=this.get_tile_meter_bounds(t,e,r),null!=n&&i.push([t,e,r,n]);return i},e.prototype.parent_by_tile_xyz=function(t,e,r){var n,i;return i=this.tile_xyz_to_quadkey(t,e,r),n=i.substring(0,i.length-1),this.quadkey_to_tile_xyz(n)},e.prototype.get_resolution=function(t){return this._computed_initial_resolution()/Math.pow(2,t)},e.prototype.get_resolution_by_extent=function(t,e,r){var n,i;return n=(t[2]-t[0])/r,i=(t[3]-t[1])/e,[n,i]},e.prototype.get_level_by_extent=function(t,e,r){var n,i,o,s,a,l,u,c;for(u=(t[2]-t[0])/r,c=(t[3]-t[1])/e,l=Math.max(u,c),n=0,a=this._resolutions,i=0,o=a.length;i<o;i++){if(s=a[i],l>s){if(0===n)return 0;if(n>0)return n-1}n+=1}},e.prototype.get_closest_level_by_extent=function(t,e,r){var n,i,o,s,a;return s=(t[2]-t[0])/r,a=(t[3]-t[1])/e,i=Math.max(s,a),o=this._resolutions,n=this._resolutions.reduce(function(t,e){return Math.abs(e-i)<Math.abs(t-i)?e:t}),this._resolutions.indexOf(n)},e.prototype.snap_to_zoom=function(t,e,r,n){var i,o,s,a,l,u,c,_,h;return i=this._resolutions[n],o=r*i,s=e*i,u=t[0],h=t[1],l=t[2],_=t[3],a=(o-(l-u))/2,c=(s-(_-h))/2,[u-a,h-c,l+a,_+c]},e.prototype.tms_to_wmts=function(t,e,r){"Note this works both ways";return[t,Math.pow(2,r)-1-e,r]},e.prototype.wmts_to_tms=function(t,e,r){"Note this works both ways";return[t,Math.pow(2,r)-1-e,r]},e.prototype.pixels_to_meters=function(t,e,r){var n,i,o;return o=this.get_resolution(r),n=t*o-this.x_origin_offset,i=e*o-this.y_origin_offset,[n,i]},e.prototype.meters_to_pixels=function(t,e,r){var n,i,o;return o=this.get_resolution(r),n=(t+this.x_origin_offset)/o,i=(e+this.y_origin_offset)/o,[n,i]},e.prototype.pixels_to_tile=function(t,e){var r,n;return r=Math.ceil(t/parseFloat(this.tile_size)),r=0===r?r:r-1,n=Math.max(Math.ceil(e/parseFloat(this.tile_size))-1,0),[r,n]},e.prototype.pixels_to_raster=function(t,e,r){var n;return n=this.tile_size<<r,[t,n-e]},e.prototype.meters_to_tile=function(t,e,r){var n,i,o;return o=this.meters_to_pixels(t,e,r),n=o[0],i=o[1],this.pixels_to_tile(n,i)},e.prototype.get_tile_meter_bounds=function(t,e,r){var n,i,o,s,a,l;return n=this.pixels_to_meters(t*this.tile_size,e*this.tile_size,r),s=n[0],l=n[1],i=this.pixels_to_meters((t+1)*this.tile_size,(e+1)*this.tile_size,r),o=i[0],a=i[1],null!=s&&null!=l&&null!=o&&null!=a?[s,l,o,a]:void 0},e.prototype.get_tile_geographic_bounds=function(t,e,r){var n,i,o,s,a,l;return n=this.get_tile_meter_bounds(t,e,r),l=this.utils.meters_extent_to_geographic(n),a=l[0],s=l[1],o=l[2],i=l[3],[a,s,o,i]},e.prototype.get_tiles_by_extent=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w;for(null==r&&(r=1),g=t[0],w=t[1],v=t[2],b=t[3],o=this.meters_to_tile(g,w,e),d=o[0],m=o[1],s=this.meters_to_tile(v,b,e),p=s[0],y=s[1],d-=r,m-=r,p+=r,y+=r,_=[],f=n=a=y,l=m;n>=l;f=n+=-1)for(h=i=u=d,c=p;i<=c;h=i+=1)this.is_valid_tile(h,f,e)&&_.push([h,f,e,this.get_tile_meter_bounds(h,f,e)]);return _=this.sort_tiles_from_center(_,[d,m,p,y])},e.prototype.quadkey_to_tile_xyz=function(t){"Computes tile x, y and z values based on quadKey.";var e,r,n,i,o,s,a,l;for(o=0,s=0,a=t.length,e=r=i=a;r>0;e=r+=-1)switch(l=t.charAt(a-e),n=1<<e-1,l){case"0":continue;case"1":o|=n;break;case"2":s|=n;break;case"3":o|=n,s|=n;break;default:throw new TypeError("Invalid Quadkey: "+t)}return[o,s,a]},e.prototype.tile_xyz_to_quadkey=function(t,e,r){"Computes quadkey value based on tile x, y and z values.";var n,i,o,s,a,l;for(a="",i=o=l=r;o>0;i=o+=-1)n=0,s=1<<i-1,0!==(t&s)&&(n+=1),0!==(e&s)&&(n+=2),a+=n.toString();return a},e.prototype.children_by_tile_xyz=function(t,e,r){var n,i,o,s,a,l;for(a=this.tile_xyz_to_quadkey(t,e,r),i=[],o=s=0;s<=3;o=s+=1)l=this.quadkey_to_tile_xyz(a+o.toString()),t=l[0],e=l[1],r=l[2],n=this.get_tile_meter_bounds(t,e,r),null!=n&&i.push([t,e,r,n]);return i},e.prototype.parent_by_tile_xyz=function(t,e,r){var n,i;return i=this.tile_xyz_to_quadkey(t,e,r),n=i.substring(0,i.length-1),this.quadkey_to_tile_xyz(n)},e.prototype.get_closest_parent_by_tile_xyz=function(t,e,r){var n,i,o,s,a;for(a=this.calculate_world_x_by_tile_xyz(t,e,r),i=this.normalize_xyz(t,e,r),t=i[0],e=i[1],r=i[2],n=this.tile_xyz_to_quadkey(t,e,r);n.length>0;)if(n=n.substring(0,n.length-1),o=this.quadkey_to_tile_xyz(n),t=o[0],e=o[1],r=o[2],s=this.denormalize_xyz(t,e,r,a),t=s[0],e=s[1],r=s[2],this.tile_xyz_to_key(t,e,r)in this.tiles)return[t,e,r];return[0,0,0]},e.prototype.normalize_xyz=function(t,e,r){var n;return this.wrap_around?(n=Math.pow(2,r),[(t%n+n)%n,e,r]):[t,e,r]},e.prototype.denormalize_xyz=function(t,e,r,n){return[t+n*Math.pow(2,r),e,r]},e.prototype.denormalize_meters=function(t,e,r,n){return[t+2*n*Math.PI*6378137,e]},e.prototype.calculate_world_x_by_tile_xyz=function(t,e,r){return Math.floor(t/Math.pow(2,r))},e}(s.TileSource)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(195);r.QUADKEYTileSource=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="QUADKEYTileSource",e.prototype.get_image_url=function(t,e,r){var n,i,o;return n=this.string_lookup_replace(this.url,this.extra_url_vars),o=this.tms_to_wmts(t,e,r),t=o[0],e=o[1],r=o[2],i=this.tile_xyz_to_quadkey(t,e,r),n.replace("{Q}",i)},e}(o.MercatorTileSource)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){return function(){return t.apply(e,arguments)}},i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},a=t(192),l=t(201),u=t(160),c=t(4),_=t(13),h=t(40);r.TileRendererView=function(t){function e(){return this._update=n(this._update,this),this._prefetch_tiles=n(this._prefetch_tiles,this),this._on_tile_error=n(this._on_tile_error,this),this._on_tile_cache_load=n(this._on_tile_cache_load,this),this._on_tile_load=n(this._on_tile_load,this),this._add_attribution=n(this._add_attribution,this),e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.initialize=function(t){return this.attributionEl=null,this._tiles=[],e.__super__.initialize.apply(this,arguments)},e.prototype.connect_signals=function(){return e.__super__.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 a.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,e,r,n,i,o;if(t=this.model.tile_source.attribution,h.isString(t)&&t.length>0)return null==this.attributionEl&&(e=this.map_plot.outline_line_width,r=this.map_plot.min_border_bottom+e,o=this.map_frame._right.value-this.map_frame._width.value,n=this.map_frame._width.value-e,this.attributionEl=c.div({"class":"bk-tile-attribution",style:{position:"absolute",bottom:r+"px",right:o+"px","max-width":n+"px","background-color":"rgba(255,255,255,0.8)","font-size":"9pt","font-family":"sans-serif"}}),i=this.plot_view.canvas_view.events_el,i.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 e;return e=t.target.tile_data,e.img=t.target,e.current=!0,e.loaded=!0,this.request_render()},e.prototype._on_tile_cache_load=function(t){var e;return e=t.target.tile_data,e.img=t.target,e.loaded=!0,e.finished=!0,this.notify_finished()},e.prototype._on_tile_error=function(t){var e;return e=t.target.tile_data,e.finished=!0},e.prototype._create_tile=function(t,e,r,n,i){var o,s,a;return null==i&&(i=!1),o=this.model.tile_source.normalize_xyz(t,e,r),a=this.pool.pop(),i?a.onload=this._on_tile_cache_load:a.onload=this._on_tile_load,a.onerror=this._on_tile_error,a.alt="",a.tile_data={tile_coords:[t,e,r],normalized_coords:o,quadkey:this.model.tile_source.tile_xyz_to_quadkey(t,e,r),cache_key:this.model.tile_source.tile_xyz_to_key(t,e,r),bounds:n,loaded:!1,finished:!1,x_coord:n[0],y_coord:n[3]},this.model.tile_source.tiles[a.tile_data.cache_key]=a.tile_data,a.src=(s=this.model.tile_source).get_image_url.apply(s,o),this._tiles.push(a),a},e.prototype._enforce_aspect_ratio=function(){var t,e,r;return(this._last_height!==this.map_frame._height.value||this._last_width!==this.map_frame._width.value)&&(t=this.get_extent(),r=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,r),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 t,r,n,i;if(!e.__super__.has_finished.call(this))return!1;if(0===this._tiles.length)return!1;for(n=this._tiles,t=0,r=n.length;t<r;t++)if(i=n[t],!i.tile_data.finished)return!1;return!0},e.prototype.render=function(t,e,r){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,r,n,i,o,s,a,l,u,c,_;if(_=this.model.tile_source.tiles[t],null!=_)return e=this.plot_view.frame.map_to_screen([_.bounds[0]],[_.bounds[3]],this.plot_view.canvas),a=e[0],c=e[1],r=this.plot_view.frame.map_to_screen([_.bounds[2]],[_.bounds[1]],this.plot_view.canvas),s=r[0],u=r[1],a=a[0],c=c[0],s=s[0],u=u[0],i=s-a,n=u-c,o=a,l=c,this.map_canvas.drawImage(_.img,o,l,i,n)},e.prototype._set_rect=function(){var t,e,r,n,i;return r=this.plot_model.plot.properties.outline_line_width.value(),e=this.plot_view.canvas.vx_to_sx(this.map_frame._left.value)+r/2,n=this.plot_view.canvas.vy_to_sy(this.map_frame._top.value)+r/2,i=this.map_frame._width.value-r,t=this.map_frame._height.value-r,this.map_canvas.rect(e,n,i,t),this.map_canvas.clip()},e.prototype._render_tiles=function(t){var e,r,n;for(this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha,e=0,r=t.length;e<r;e++)n=t[e],this._draw_tile(n);return this.map_canvas.restore()},e.prototype._prefetch_tiles=function(){var t,e,r,n,i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g;for(p=this.model.tile_source,a=this.get_extent(),l=this.map_frame._height.value,f=this.map_frame._width.value,g=this.model.tile_source.get_level_by_extent(a,l,f),d=this.model.tile_source.get_tiles_by_extent(a,g),_=[],h=u=0,c=Math.min(10,d.length);u<=c;h=u+=1)y=h[0],m=h[1],v=h[2],t=h[3],n=this.model.tile_source.children_by_tile_xyz(y,m,v),_.push(function(){var t,a,l;for(l=[],t=0,a=n.length;t<a;t++)e=n[t],i=e[0],o=e[1],s=e[2],r=e[3],p.tile_xyz_to_key(i,o,s)in p.tiles||l.push(this._create_tile(i,o,s,r,!0));return l}.call(this));return _},e.prototype._fetch_tiles=function(t){var e,r,n,i,o,s,a,l;for(i=[],r=0,n=t.length;r<n;r++)o=t[r],s=o[0],a=o[1],l=o[2],e=o[3],i.push(this._create_tile(s,a,l,e));return i},e.prototype._update=function(){var t,e,r,n,i,o,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E,z,C,N,D,F,I,B,R;for(z=this.model.tile_source,b=z.min_zoom,g=z.max_zoom,z.update(),c=this.get_extent(),R=this.extent[2]-this.extent[0]<c[2]-c[0],_=this.map_frame._height.value,N=this.map_frame._width.value,B=z.get_level_by_extent(c,_,N),A=!1,B<b?(c=this.extent,B=b,A=!0):B>g&&(c=this.extent,B=g,A=!0),A&&(this.x_range.setv({x_range:{start:c[0],end:c[2]}}),this.y_range.setv({start:c[1],end:c[3]}),this.extent=c),this.extent=c,C=z.get_tiles_by_extent(c,B),M=[],w=[],r=[],o=[],h=0,y=C.length;h<y;h++){if(j=C[h],D=j[0],F=j[1],I=j[2],t=j[3],f=z.tile_xyz_to_key(D,F,I),E=z.tiles[f],null!=E&&E.loaded===!0)r.push(f);else if(this.model.render_parents&&(P=z.get_closest_parent_by_tile_xyz(D,F,I),S=P[0],T=P[1],O=P[2],x=z.tile_xyz_to_key(S,T,O),k=z.tiles[x],null!=k&&k.loaded&&s.call(M,x)<0&&M.push(x),R))for(o=z.children_by_tile_xyz(D,F,I),p=0,m=o.length;p<m;p++)e=o[p],a=e[0],l=e[1],u=e[2],n=e[3],i=z.tile_xyz_to_key(a,l,u),i in z.tiles&&o.push(i);null==E&&w.push(j)}for(this._render_tiles(M),this._render_tiles(o),this._render_tiles(r),d=0,v=r.length;d<v;d++)j=r[d],z.tiles[j].current=!0;return null!=this.render_timer&&clearTimeout(this.render_timer),this.render_timer=setTimeout(function(t){return function(){return t._fetch_tiles(w)}}(this),65)},e}(u.RendererView),r.TileRenderer=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.default_view=r.TileRendererView,e.prototype.type="TileRenderer",e.define({alpha:[_.Number,1],x_range_name:[_.String,"default"],y_range_name:[_.String,"default"],tile_source:[_.Instance,function(){return new l.WMTSTileSource}],render_parents:[_.Bool,!0]}),e.override({level:"underlay"}),e}(u.Renderer)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(192),s=t(199),a=t(12),l=t(13),u=t(48);r.TileSource=function(t){function e(t){null==t&&(t={}),e.__super__.constructor.apply(this,arguments),this.utils=new s.ProjectionUtils,this.pool=new o.ImagePool,this.tiles={},this.normalize_case()}return n(e,t),e.prototype.type="TileSource",e.define({url:[l.String,""],tile_size:[l.Number,256],max_zoom:[l.Number,30],min_zoom:[l.Number,0],extra_url_vars:[l.Any,{}],attribution:[l.String,""],x_origin_offset:[l.Number],y_origin_offset:[l.Number],initial_resolution:[l.Number]}),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.normalize_case()},e.prototype.string_lookup_replace=function(t,e){var r,n,i;n=t;for(r in e)i=e[r],n=n.replace("{"+r+"}",i.toString());return n},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,r,n;a.logger.debug("TileSource: tile cache count: "+Object.keys(this.tiles).length),e=this.tiles,r=[];for(t in e)n=e[t],n.current=!1,r.push(n.retain=!1);return r},e.prototype.tile_xyz_to_key=function(t,e,r){var n;return n=t+":"+e+":"+r},e.prototype.key_to_tile_xyz=function(t){var e;return function(){var r,n,i,o;for(i=t.split(":"),o=[],r=0,n=i.length;r<n;r++)e=i[r],o.push(parseInt(e));return o}()},e.prototype.sort_tiles_from_center=function(t,e){var r,n,i,o,s,a;return o=e[0],a=e[1],i=e[2],s=e[3],r=(i-o)/2+o,n=(s-a)/2+a,t.sort(function(t,e){var i,o;return i=Math.sqrt(Math.pow(r-t[0],2)+Math.pow(n-t[1],2)),o=Math.sqrt(Math.pow(r-e[0],2)+Math.pow(n-e[1],2)),i-o}),t},e.prototype.prune_tiles=function(){var t,e,r,n,i;e=this.tiles;for(t in e)i=e[t],i.retain=i.current||i.tile_coords[2]<3,i.current&&(this.retain_neighbors(i),this.retain_children(i),this.retain_parents(i));r=this.tiles,n=[];for(t in r)i=r[t],i.retain?n.push(void 0):n.push(this.remove_tile(t));return n},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,r){var n;return n=this.string_lookup_replace(this.url,this.extra_url_vars),n.replace("{X}",t).replace("{Y}",e).replace("{Z}",r)},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,r){throw new Error("Not Implemented")},e.prototype.quadkey_to_tile_xyz=function(t){throw new Error("Not Implemented")},e}(u.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(29);r.ProjectionUtils=function(){function t(){this.origin_shift=2*Math.PI*6378137/2}return t.prototype.geographic_to_meters=function(t,e){return n.proj4(n.wgs84,n.mercator,[t,e])},t.prototype.meters_to_geographic=function(t,e){return n.proj4(n.mercator,n.wgs84,[t,e])},t.prototype.geographic_extent_to_meters=function(t){var e,r,n,i,o,s;return i=t[0],s=t[1],n=t[2],o=t[3],e=this.geographic_to_meters(i,s),i=e[0],s=e[1],r=this.geographic_to_meters(n,o),n=r[0],o=r[1],[i,s,n,o]},t.prototype.meters_extent_to_geographic=function(t){var e,r,n,i,o,s;return i=t[0],s=t[1],n=t[2],o=t[3],e=this.meters_to_geographic(i,s),i=e[0],s=e[1],r=this.meters_to_geographic(n,o),n=r[0],o=r[1],[i,s,n,o]},t}()},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(195);r.TMSTileSource=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="TMSTileSource",e.prototype.get_image_url=function(t,e,r){var n;return n=this.string_lookup_replace(this.url,this.extra_url_vars),n.replace("{X}",t).replace("{Y}",e).replace("{Z}",r)},e}(o.MercatorTileSource)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(195);r.WMTSTileSource=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="WMTSTileSource",e.prototype.get_image_url=function(t,e,r){var n,i;return n=this.string_lookup_replace(this.url,this.extra_url_vars),i=this.tms_to_wmts(t,e,r),t=i[0],e=i[1],r=i[2],n.replace("{X}",t).replace("{Y}",e).replace("{Z}",r)},e}(o.MercatorTileSource)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(210),s=t(18);r.ActionToolButtonView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._clicked=function(){return this.model["do"].emit()},e}(o.ButtonToolButtonView),r.ActionToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.connect(this.model["do"],function(){return this.doit()})},e}(o.ButtonToolView),r.ActionTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this["do"]=new s.Signal(this,"do")},e}(o.ButtonTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(202),s=t(13);r.HelpToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.doit=function(){return window.open(this.model.redirect)},e}(o.ActionToolView),r.HelpTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.HelpToolView,
e.prototype.type="HelpTool",e.prototype.tool_name="Help",e.prototype.icon="bk-tool-icon-help",e.define({help_tooltip:[s.String,"Click the question mark to learn more about Bokeh plot tools."],redirect:[s.String,"https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#built-in-tools"]}),e.getters({tooltip:function(){return this.help_tooltip}}),e}(o.ActionTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(202);r.RedoToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.connect(this.plot_view.state_changed,function(t){return function(){return t.model.disabled=!t.plot_view.can_redo()}}(this))},e.prototype.doit=function(){return this.plot_view.redo()},e}(o.ActionToolView),r.RedoTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.RedoToolView,e.prototype.type="RedoTool",e.prototype.tool_name="Redo",e.prototype.icon="bk-tool-icon-redo",e.override({disabled:!0}),e}(o.ActionTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(202),s=t(13);r.ResetToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.doit=function(){if(this.plot_view.clear_state(),this.plot_view.reset_range(),this.plot_view.reset_selection(),this.model.reset_size)return this.plot_view.reset_dimensions()},e}(o.ActionToolView),r.ResetTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.ResetToolView,e.prototype.type="ResetTool",e.prototype.tool_name="Reset",e.prototype.icon="bk-tool-icon-reset",e.define({reset_size:[s.Bool,!0]}),e}(o.ActionTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(202);r.SaveToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.doit=function(){return this.plot_view.save("bokeh_plot")},e}(o.ActionToolView),r.SaveTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.SaveToolView,e.prototype.type="SaveTool",e.prototype.tool_name="Save",e.prototype.icon="bk-tool-icon-save",e}(o.ActionTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(202);r.UndoToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.connect(this.plot_view.state_changed,function(t){return function(){return t.model.disabled=!t.plot_view.can_undo()}}(this))},e.prototype.doit=function(){return this.plot_view.undo()},e}(o.ActionToolView),r.UndoTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.UndoToolView,e.prototype.type="UndoTool",e.prototype.tool_name="Undo",e.prototype.icon="bk-tool-icon-undo",e.override({disabled:!0}),e}(o.ActionTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(202),s=t(42),a=t(13);r.ZoomInToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.doit=function(){var t,e,r,n,i;return e=this.plot_model.frame,t=this.model.dimensions,r="width"===t||"both"===t,n="height"===t||"both"===t,i=s.scale_range(e,this.model.factor,r,n),this.plot_view.push_state("zoom_out",{range:i}),this.plot_view.update_range(i,!1,!0),this.plot_view.interactive_timestamp=Date.now(),null},e}(o.ActionToolView),r.ZoomInTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.ZoomInToolView,e.prototype.type="ZoomInTool",e.prototype.tool_name="Zoom In",e.prototype.icon="bk-tool-icon-zoom-in",e.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),e.define({factor:[a.Percent,.1],dimensions:[a.Dimensions,"both"]}),e}(o.ActionTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(202),s=t(42),a=t(13);r.ZoomOutToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.doit=function(){var t,e,r,n,i;return e=this.plot_model.frame,t=this.model.dimensions,r="width"===t||"both"===t,n="height"===t||"both"===t,i=s.scale_range(e,-this.model.factor,r,n),this.plot_view.push_state("zoom_out",{range:i}),this.plot_view.update_range(i,!1,!0),this.plot_view.interactive_timestamp=Date.now(),null},e}(o.ActionToolView),r.ZoomOutTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.ZoomOutToolView,e.prototype.type="ZoomOutTool",e.prototype.tool_name="Zoom Out",e.prototype.icon="bk-tool-icon-zoom-out",e.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),e.define({factor:[a.Percent,.1],dimensions:[a.Dimensions,"both"]}),e}(o.ActionTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(5),s=t(226),a=t(4),l=t(13);r.ButtonToolButtonView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.className="bk-toolbar-button",e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.connect(this.model.change,function(t){return function(){return t.render()}}(this)),this.el.addEventListener("click",function(t){return function(e){return t._clicked(e)}}(this)),this.render()},e.prototype.render=function(){var t,e;return a.empty(this.el),this.el.disabled=this.model.disabled,t=a.div({"class":["bk-btn-icon",this.model.icon]}),e=a.span({"class":"bk-tip"},this.model.tooltip),this.el.appendChild(t),this.el.appendChild(e)},e.prototype._clicked=function(t){},e}(o.DOMView),r.ButtonToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(s.ToolView),r.ButtonTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.icon=null,e.getters({tooltip:function(){return this.tool_name}}),e.internal({disabled:[l.Boolean,!1]}),e}(s.Tool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(217),a=t(53),l=t(13);r.BoxSelectToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype._pan_start=function(t){var e;return e=this.plot_view.canvas,this._baseboint=[e.sx_to_vx(t.bokeh.sx),e.sy_to_vy(t.bokeh.sy)],null},e.prototype._pan=function(t){var e,r,n,i,o,s,a,l,u;return r=this.plot_view.canvas,n=[r.sx_to_vx(t.bokeh.sx),r.sy_to_vy(t.bokeh.sy)],o=this.plot_model.frame,i=this.model.dimensions,s=this.model._get_dim_limits(this._baseboint,n,o,i),l=s[0],u=s[1],this.model.overlay.update({left:l[0],right:l[1],top:u[1],bottom:u[0]}),this.model.select_every_mousemove&&(e=null!=(a=t.srcEvent.shiftKey)&&a,this._do_select(l,u,!1,e)),null},e.prototype._pan_end=function(t){var e,r,n,i,o,s,a,l,u;return r=this.plot_view.canvas,n=[r.sx_to_vx(t.bokeh.sx),r.sy_to_vy(t.bokeh.sy)],o=this.plot_model.frame,i=this.model.dimensions,s=this.model._get_dim_limits(this._baseboint,n,o,i),l=s[0],u=s[1],e=null!=(a=t.srcEvent.shiftKey)&&a,this._do_select(l,u,!0,e),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._baseboint=null,this.plot_view.push_state("box_select",{selection:this.plot_view.get_selection()}),null},e.prototype._do_select=function(t,e,r,n){var i,o,s,a,l;return o=t[0],s=t[1],a=e[0],l=e[1],null==n&&(n=!1),i={type:"rect",vx0:o,vx1:s,vy0:a,vy1:l},this._select(i,r,n)},e.prototype._emit_callback=function(t){var e,r,n,i,o;n=this.computed_renderers[0],e=this.plot_model.canvas,r=this.plot_model.frame,t.sx0=e.vx_to_sx(t.vx0),t.sx1=e.vx_to_sx(t.vx1),t.sy0=e.vy_to_sy(t.vy0),t.sy1=e.vy_to_sy(t.vy1),i=r.xscales[n.x_range_name],o=r.yscales[n.y_range_name],t.x0=i.invert(t.vx0),t.x1=i.invert(t.vx1),t.y0=o.invert(t.vy0),t.y1=o.invert(t.vy1),this.model.callback.execute(this.model,{geometry:t})},e}(s.SelectToolView),n=function(){return new a.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]}})},r.BoxSelectTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.default_view=r.BoxSelectToolView,e.prototype.type="BoxSelectTool",e.prototype.tool_name="Box Select",e.prototype.icon="bk-tool-icon-box-select",e.prototype.event_type="pan",e.prototype.default_order=30,e.define({dimensions:[l.Dimensions,"both"],select_every_mousemove:[l.Bool,!1],callback:[l.Instance],overlay:[l.Instance,n]}),e.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),e}(s.SelectTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(213),a=t(53),l=t(13);r.BoxZoomToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype._match_aspect=function(t,e,r){var n,i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b;return s=r.h_range.end,a=r.h_range.start,d=r.v_range.end,y=r.v_range.start,v=s-a,o=d-y,n=v/o,m=Math.abs(t[0]-e[0]),f=Math.abs(t[1]-e[1]),p=0===f?0:m/f,p>=n?(u=[1,p/n],g=u[0],b=u[1]):(c=[n/p,1],g=c[0],b=c[1]),t[0]<=e[0]?(l=t[0],_=t[0]+m*g,_>s&&(_=s)):(_=t[0],l=t[0]-m*g,l<a&&(l=a)),m=Math.abs(_-l),t[1]<=e[1]?(i=t[1],h=t[1]+m/n,h>d&&(h=d)):(h=t[1],i=t[1]-m/n,i<y&&(i=y)),f=Math.abs(h-i),t[0]<=e[0]?_=t[0]+n*f:l=t[0]-n*f,[[l,_],[i,h]]},e.prototype._pan_start=function(t){var e;return e=this.plot_view.canvas,this._baseboint=[e.sx_to_vx(t.bokeh.sx),e.sy_to_vy(t.bokeh.sy)],null},e.prototype._pan=function(t){var e,r,n,i,o,s,a,l;return e=this.plot_view.canvas,r=[e.sx_to_vx(t.bokeh.sx),e.sy_to_vy(t.bokeh.sy)],i=this.plot_model.frame,n=this.model.dimensions,this.model.match_aspect&&"both"===n?(o=this._match_aspect(this._baseboint,r,i),a=o[0],l=o[1]):(s=this.model._get_dim_limits(this._baseboint,r,i,n),a=s[0],l=s[1]),this.model.overlay.update({left:a[0],right:a[1],top:l[1],bottom:l[0]}),null},e.prototype._pan_end=function(t){var e,r,n,i,o,s,a,l;return e=this.plot_view.canvas,r=[e.sx_to_vx(t.bokeh.sx),e.sy_to_vy(t.bokeh.sy)],i=this.plot_model.frame,n=this.model.dimensions,this.model.match_aspect&&"both"===n?(o=this._match_aspect(this._baseboint,r,i),a=o[0],l=o[1]):(s=this.model._get_dim_limits(this._baseboint,r,i,n),a=s[0],l=s[1]),this._update(a,l),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._baseboint=null,null},e.prototype._update=function(t,e){var r,n,i,o,s,a,l,u,c,_,h;if(!(Math.abs(t[1]-t[0])<=5||Math.abs(e[1]-e[0])<=5)){c={},i=this.plot_view.frame.xscales;for(n in i)l=i[n],o=l.v_invert(t),u=o[0],r=o[1],c[n]={start:u,end:r};_={},s=this.plot_view.frame.yscales;for(n in s)l=s[n],a=l.v_invert(e),u=a[0],r=a[1],_[n]={start:u,end:r};return h={xrs:c,yrs:_},this.plot_view.push_state("box_zoom",{range:h}),this.plot_view.update_range(h)}},e}(s.GestureToolView),n=function(){return new a.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]}})},r.BoxZoomTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.default_view=r.BoxZoomToolView,e.prototype.type="BoxZoomTool",e.prototype.tool_name="Box Zoom",e.prototype.icon="bk-tool-icon-box-zoom",e.prototype.event_type="pan",e.prototype.default_order=20,e.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),e.define({dimensions:[l.Dimensions,"both"],overlay:[l.Instance,n],match_aspect:[l.Bool,!1]}),e}(s.GestureTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(210);r.GestureToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(o.ButtonToolView),r.GestureTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.event_type=null,e.prototype.default_order=null,e}(o.ButtonTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(217),a=t(60),l=t(13);r.LassoSelectToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),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,r,n;return e=this.plot_view.canvas,r=e.sx_to_vx(t.bokeh.sx),n=e.sy_to_vy(t.bokeh.sy),this.data={vx:[r],vy:[n]},null},e.prototype._pan=function(t){var e,r,n,i,o,s,a,l;if(r=this.plot_view.canvas,a=r.sx_to_vx(t.bokeh.sx),l=r.sy_to_vy(t.bokeh.sy),n=this.plot_model.frame.h_range,s=this.plot_model.frame.v_range,a>n.end&&(a=n.end),a<n.start&&(a=n.start),l>s.end&&(l=s.end),l<s.start&&(l=s.start),this.data.vx.push(a),this.data.vy.push(l),i=this.model.overlay,i.update({xs:this.data.vx,ys:this.data.vy}),this.model.select_every_mousemove)return e=null!=(o=t.srcEvent.shiftKey)&&o,this._do_select(this.data.vx,this.data.vy,!1,e)},e.prototype._pan_end=function(t){var e,r;return this._clear_overlay(),e=null!=(r=t.srcEvent.shiftKey)&&r,this._do_select(this.data.vx,this.data.vy,!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,r,n){var i;return i={type:"poly",vx:t,vy:e},this._select(i,r,n)},e.prototype._emit_callback=function(t){var e,r,n,i,o;n=this.computed_renderers[0],e=this.plot_model.canvas,r=this.plot_model.frame,t.sx=e.v_vx_to_sx(t.vx),t.sy=e.v_vy_to_sy(t.vy),i=r.xscales[n.x_range_name],o=r.yscales[n.y_range_name],t.x=i.v_invert(t.vx),t.y=o.v_invert(t.vy),this.model.callback.execute(this.model,{geometry:t})},e}(s.SelectToolView),n=function(){return new a.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]}})},r.LassoSelectTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.default_view=r.LassoSelectToolView,e.prototype.type="LassoSelectTool",e.prototype.tool_name="Lasso Select",e.prototype.icon="bk-tool-icon-lasso-select",e.prototype.event_type="pan",e.prototype.default_order=12,e.define({select_every_mousemove:[l.Bool,!0],callback:[l.Instance],overlay:[l.Instance,n]}),e}(s.SelectTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(213),s=t(13);r.PanToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._pan_start=function(t){var e,r,n,i,o,s;return this.last_dx=0,this.last_dy=0,e=this.plot_view.canvas,r=this.plot_view.frame,o=e.sx_to_vx(t.bokeh.sx),s=e.sy_to_vy(t.bokeh.sy),r.contains(o,s)||(n=r.h_range,i=r.v_range,(o<n.start||o>n.end)&&(this.v_axis_only=!0),(s<i.start||s>i.end)&&(this.h_axis_only=!0)),this.plot_view.interactive_timestamp=Date.now()},e.prototype._pan=function(t){return this._update(t.deltaX,-t.deltaY),this.plot_view.interactive_timestamp=Date.now()},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 r,n,i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P;i=this.plot_view.frame,l=t-this.last_dx,u=e-this.last_dy,o=i.h_range,w=o.start-l,b=o.end-l,T=i.v_range,S=T.start-u,M=T.end-u,r=this.model.dimensions,"width"!==r&&"both"!==r||this.v_axis_only?(v=o.start,g=o.end,f=0):(v=w,g=b,f=-l),"height"!==r&&"both"!==r||this.h_axis_only?(x=T.start,k=T.end,y=0):(x=S,k=M,y=u),this.last_dx=t,this.last_dy=e,O={},c=i.xscales;for(a in c)d=c[a],_=d.v_invert([v,g]),m=_[0],n=_[1],O[a]={start:m,end:n};P={},h=i.yscales;for(a in h)d=h[a],p=d.v_invert([x,k]),m=p[0],n=p[1],P[a]={start:m,end:n};return this.pan_info={xrs:O,yrs:P,sdx:f,sdy:y},this.plot_view.update_range(this.pan_info,s=!0),null},e}(o.GestureToolView),r.PanTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.PanToolView,e.prototype.type="PanTool",e.prototype.tool_name="Pan",e.prototype.event_type="pan",e.prototype.default_order=10,e.define({dimensions:[s.Dimensions,"both"]}),e.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}}),e}(o.GestureTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(217),a=t(60),l=t(13),u=t(20);r.PolySelectToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.connect(this.model.properties.active.change,function(){return this._active_change()}),this.data={vx:[],vy:[]}},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,r;return e=null!=(r=t.srcEvent.shiftKey)&&r,this._do_select(this.data.vx,this.data.vy,!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={vx:[],vy:[]},this.model.overlay.update({xs:[],ys:[]})},e.prototype._tap=function(t){var e,r,n;return e=this.plot_view.canvas,r=e.sx_to_vx(t.bokeh.sx),n=e.sy_to_vy(t.bokeh.sy),this.data.vx.push(r),this.data.vy.push(n),this.model.overlay.update({xs:u.copy(this.data.vx),ys:u.copy(this.data.vy)})},e.prototype._do_select=function(t,e,r,n){var i;return i={type:"poly",vx:t,vy:e},this._select(i,r,n)},e.prototype._emit_callback=function(t){var e,r,n,i,o;n=this.computed_renderers[0],e=this.plot_model.canvas,r=this.plot_model.frame,t.sx=e.v_vx_to_sx(t.vx),t.sy=e.v_vx_to_sx(t.vy),i=r.xscales[n.x_range_name],o=r.yscales[n.y_range_name],t.x=i.v_invert(t.vx),t.y=i.v_invert(t.vy),this.model.callback.execute(this.model,{geometry:t})},e}(s.SelectToolView),n=function(){return new a.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]}})},r.PolySelectTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.default_view=r.PolySelectToolView,e.prototype.type="PolySelectTool",e.prototype.tool_name="Poly Select",e.prototype.icon="bk-tool-icon-polygon-select",e.prototype.event_type="tap",e.prototype.default_order=11,e.define({callback:[l.Instance],overlay:[l.Instance,n]}),e}(s.SelectTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(213),s=t(156),a=t(157),l=t(12),u=t(13),c=t(28),_=t(2);r.SelectToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.getters({computed_renderers:function(){var t,e,r,n;return n=this.model.renderers,e=this.model.names,0===n.length&&(t=this.plot_model.plot.renderers,n=function(){var e,n,i;for(i=[],e=0,n=t.length;e<n;e++)r=t[e],(r instanceof s.GlyphRenderer||r instanceof a.GraphRenderer)&&i.push(r);return i}()),e.length>0&&(n=function(){var t,i,o;for(o=[],t=0,i=n.length;t<i;t++)r=n[t],e.indexOf(r.name)>=0&&o.push(r);return o}()),n}}),e.prototype._computed_renderers_by_data_source=function(){var t,e,r,n,i,o;for(i={},n=this.computed_renderers,t=0,e=n.length;t<e;t++)r=n[t],r instanceof a.GraphRenderer?o=r.node_renderer.data_source.id:r instanceof s.GlyphRenderer&&(o=r.data_source.id),o in i?i[o]=i[o].concat([r]):i[o]=[r];return i},e.prototype._keyup=function(t){var e,r,n,i,o,s,a;if(27===t.keyCode){for(o=this.computed_renderers,s=[],r=0,n=o.length;r<n;r++)i=o[r],e=i.data_source,a=e.selection_manager,s.push(a.clear());return s}},e.prototype._select=function(t,e,r){var n,i,o,s,a,l;a=this._computed_renderers_by_data_source();for(n in a)s=a[n],l=s[0].get_selection_manager(),o=function(){var t,e,r;for(r=[],t=0,e=s.length;t<e;t++)i=s[t],r.push(this.plot_view.renderer_views[i.id]);return r}.call(this),l.select(o,t,e,r);return null!=this.model.callback&&this._emit_callback(t),this._emit_selection_event(t,e),null},e.prototype._emit_selection_event=function(t,e){var r,n,i,o,s,a;switch(null==e&&(e=!0),r=c.clone(t),s=this.plot_view.frame.xscales["default"],a=this.plot_view.frame.yscales["default"],r.type){case"point":r.x=s.invert(r.vx),r.y=a.invert(r.vy);break;case"rect":r.x0=s.invert(r.vx0),r.y0=a.invert(r.vy0),r.x1=s.invert(r.vx1),r.y1=a.invert(r.vy1);break;case"poly":for(r.x=new Array(r.vx.length),r.y=new Array(r.vy.length),n=i=0,o=r.vx.length;0<=o?i<o:i>o;n=0<=o?++i:--i)r.x[n]=s.invert(r.vx[n]),r.y[n]=a.invert(r.vy[n]);break;default:l.logger.debug("Unrecognized selection geometry type: '"+r.type+"'")}return this.plot_model.plot.trigger_event(new _.SelectionGeometry({geometry:r,"final":e}))},e}(o.GestureToolView),r.SelectTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.define({renderers:[u.Array,[]],names:[u.Array,[]]}),e.internal({multi_select_modifier:[u.String,"shift"]}),e}(o.GestureTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(217),s=t(13),a=t(40);r.TapToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._tap=function(t){var e,r,n,i,o;return r=this.plot_view.canvas,i=r.sx_to_vx(t.bokeh.sx),o=r.sy_to_vy(t.bokeh.sy),e=null!=(n=t.srcEvent.shiftKey)&&n,this._select(i,o,!0,e)},e.prototype._select=function(t,e,r,n){var i,o,s,l,u,c,_,h,p,d,f,y,m;if(u={type:"point",vx:t,vy:e},o=this.model.callback,s={geometries:u},"select"===this.model.behavior){y=this._computed_renderers_by_data_source();for(i in y)f=y[i],m=f[0].get_selection_manager(),p=function(){var t,e,r;for(r=[],t=0,e=f.length;t<e;t++)h=f[t],r.push(this.plot_view.renderer_views[h.id]);return r}.call(this),l=m.select(p,u,r,n),l&&null!=o&&(s.source=m.source,a.isFunction(o)?o(this,s):o.execute(this,s));this._emit_selection_event(u),this.plot_view.push_state("tap",{selection:this.plot_view.get_selection()})}else for(d=this.computed_renderers,c=0,_=d.length;c<_;c++)h=d[c],m=h.get_selection_manager(),l=m.inspect(this.plot_view.renderer_views[h.id],u),l&&null!=o&&(s.source=m.source,a.isFunction(o)?o(this,s):o.execute(this,s));return null},e}(o.SelectToolView),r.TapTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.TapToolView,e.prototype.type="TapTool",e.prototype.tool_name="Tap",e.prototype.icon="bk-tool-icon-tap-select",e.prototype.event_type="tap",e.prototype.default_order=10,e.define({behavior:[s.String,"select"],callback:[s.Any]}),e}(o.SelectTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(213),s=t(13);r.WheelPanToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(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,r,n,i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w,x,k,M,S,T;switch(r=this.plot_model.frame,n=r.h_range,v=r.v_range,s=[n.start,n.end],b=s[0],g=s[1],a=[v.start,v.end],k=a[0],x=a[1],this.model.dimension){case"height":M=Math.abs(x-k),d=b,f=g,y=k+M*t,m=x+M*t;break;case"width":w=Math.abs(g-b),d=b-w*t,f=g-w*t,y=k,m=x}S={},l=r.xscales;for(i in l)h=l[i],u=h.v_invert([d,f]),p=u[0],e=u[1],S[i]={start:p,end:e};T={},c=r.yscales;for(i in c)h=c[i],_=h.v_invert([y,m]),p=_[0],e=_[1],T[i]={start:p,end:e};return o={xrs:S,yrs:T,factor:t},this.plot_view.push_state("wheel_pan",{range:o}),this.plot_view.update_range(o,!1,!0),this.plot_view.interactive_timestamp=Date.now(),null},e}(o.GestureToolView),r.WheelPanTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="WheelPanTool",e.prototype.default_view=r.WheelPanToolView,e.prototype.tool_name="Wheel Pan",e.prototype.icon="bk-tool-icon-wheel-pan",e.prototype.event_type="scroll",e.prototype.default_order=12,e.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimension)}}),e.define({dimension:[s.Dimension,"width"]}),e.internal({speed:[s.Number,.001]}),e}(o.GestureTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(213),a=t(42),l=t(13);"undefined"!=typeof n&&null!==n||(n={}),r.WheelZoomToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(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,r,n,i,o,s,l,u,c,_;return n=this.plot_model.frame,o=n.h_range,l=n.v_range,u=this.plot_view.canvas.sx_to_vx(t.bokeh.sx),c=this.plot_view.canvas.sy_to_vy(t.bokeh.sy),e=this.model.dimensions,i=("width"===e||"both"===e)&&o.min<u&&u<o.max,s=("height"===e||"both"===e)&&l.min<c&&c<l.max,r=this.model.speed*t.bokeh.delta,_=a.scale_range(n,r,i,s,{x:u,y:c}),this.plot_view.push_state("wheel_zoom",{range:_}),this.plot_view.update_range(_,!1,!0),this.plot_view.interactive_timestamp=Date.now(),null},e}(s.GestureToolView),r.WheelZoomTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.default_view=r.WheelZoomToolView,e.prototype.type="WheelZoomTool",e.prototype.tool_name="Wheel Zoom",e.prototype.icon="bk-tool-icon-wheel-zoom",e.prototype.event_type="ontouchstart"in window||navigator.maxTouchPoints>0?"pinch":"scroll",e.prototype.default_order=10,e.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),e.define({dimensions:[l.Dimensions,"both"]}),e.internal({speed:[l.Number,1/600]}),e}(s.GestureTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(202);r.ActionTool=n.ActionTool;var i=t(203);r.HelpTool=i.HelpTool;var o=t(204);r.RedoTool=o.RedoTool;var s=t(205);r.ResetTool=s.ResetTool;var a=t(206);r.SaveTool=a.SaveTool;var l=t(207);r.UndoTool=l.UndoTool;var u=t(208);r.ZoomInTool=u.ZoomInTool;var c=t(209);r.ZoomOutTool=c.ZoomOutTool;var _=t(210);r.ButtonTool=_.ButtonTool;var h=t(211);r.BoxSelectTool=h.BoxSelectTool;var p=t(212);r.BoxZoomTool=p.BoxZoomTool;var d=t(213);r.GestureTool=d.GestureTool;var f=t(214);r.LassoSelectTool=f.LassoSelectTool;var y=t(215);r.PanTool=y.PanTool;var m=t(216);r.PolySelectTool=m.PolySelectTool;var v=t(217);r.SelectTool=v.SelectTool;var g=t(218);r.TapTool=g.TapTool;var b=t(219);r.WheelPanTool=b.WheelPanTool;var w=t(220);r.WheelZoomTool=w.WheelZoomTool;var x=t(222);r.CrosshairTool=x.CrosshairTool;var k=t(223);r.HoverTool=k.HoverTool;var M=t(224);r.InspectTool=M.InspectTool;var S=t(226);r.Tool=S.Tool;var T=t(227);r.ToolProxy=T.ToolProxy;var O=t(228);r.Toolbar=O.Toolbar;var P=t(229);r.ToolbarBase=P.ToolbarBase;var A=t(230);r.ToolbarBoxToolbar=A.ToolbarBoxToolbar;var j=t(230);r.ToolbarBox=j.ToolbarBox},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(224),s=t(61),a=t(13),l=t(28);r.CrosshairToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype._move=function(t){var e,r,n,i;if(this.model.active)return r=this.plot_model.frame,e=this.plot_model.canvas,n=e.sx_to_vx(t.bokeh.sx),i=e.sy_to_vy(t.bokeh.sy),r.contains(n,i)||(n=i=null),this._update_spans(n,i)},e.prototype._move_exit=function(t){return this._update_spans(null,null)},e.prototype._update_spans=function(t,e){var r;if(r=this.model.dimensions,"width"!==r&&"both"!==r||(this.model.spans.width.computed_location=e),
"height"===r||"both"===r)return this.model.spans.height.computed_location=t},e}(o.InspectToolView),r.CrosshairTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.default_view=r.CrosshairToolView,e.prototype.type="CrosshairTool",e.prototype.tool_name="Crosshair",e.prototype.icon="bk-tool-icon-crosshair",e.define({dimensions:[a.Dimensions,"both"],line_color:[a.Color,"black"],line_width:[a.Number,1],line_alpha:[a.Number,1]}),e.internal({location_units:[a.SpatialUnits,"screen"],render_mode:[a.RenderMode,"css"],spans:[a.Any]}),e.getters({tooltip:function(){return this._get_dim_tooltip("Crosshair",this.dimensions)},synthetic_renderers:function(){return l.values(this.spans)}}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.spans={width:new s.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 s.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}(o.InspectTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty,s=t(224),a=t(64),l=t(156),u=t(157),c=t(8),_=t(37),h=t(4),p=t(13),d=t(28),f=t(40),y=t(3);n=function(t){var e,r,n,i,o;return"#"===t.substr(0,1)?t:(r=/(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(t),i=parseInt(r[2]),n=parseInt(r[3]),e=parseInt(r[4]),o=e|n<<8|i<<16,r[1]+"#"+o.toString(16))},r.HoverToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.ttviews={}},e.prototype.remove=function(){return y.remove_views(this.ttviews),e.__super__.remove.call(this)},e.prototype.connect_signals=function(){var t,r,n,i;for(e.__super__.connect_signals.call(this),i=this.computed_renderers,t=0,r=i.length;t<r;t++)n=i[t],n instanceof l.GlyphRenderer?this.connect(n.data_source.inspect,this._update):n instanceof u.GraphRenderer&&(this.connect(n.node_renderer.data_source.inspect,this._update),this.connect(n.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,r,n;return n=this.model.renderers,e=this.model.names,0===n.length&&(t=this.plot_model.plot.renderers,n=function(){var e,n,i;for(i=[],e=0,n=t.length;e<n;e++)r=t[e],(r instanceof l.GlyphRenderer||r instanceof u.GraphRenderer)&&i.push(r);return i}()),e.length>0&&(n=function(){var t,i,o;for(o=[],t=0,i=n.length;t<i;t++)r=n[t],e.indexOf(r.name)>=0&&o.push(r);return o}()),n},e.prototype._compute_ttmodels=function(){var t,e,r,n,i,o,s,c,_,h,p;if(h={},_=this.model.tooltips,null!=_)for(s=this.computed_renderers,t=0,r=s.length;t<r;t++)o=s[t],o instanceof l.GlyphRenderer?(c=new a.Tooltip({custom:f.isString(_)||f.isFunction(_),attachment:this.model.attachment,show_arrow:this.model.show_arrow}),h[o.id]=c):o instanceof u.GraphRenderer&&(c=new a.Tooltip({custom:f.isString(_)||f.isFunction(_),attachment:this.model.attachment,show_arrow:this.model.show_arrow}),h[o.node_renderer.id]=c,h[o.edge_renderer.id]=c);for(i=y.build_views(this.ttviews,d.values(h),{parent:this,plot_view:this.plot_view}),e=0,n=i.length;e<n;e++)p=i[e],p.connect_signals();return h},e.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}}),e.prototype._clear=function(){var t,e,r,n;this._inspect(Infinity,Infinity),t=this.ttmodels,e=[];for(r in t)n=t[r],e.push(n.clear());return e},e.prototype._move=function(t){var e,r,n;if(this.model.active)return e=this.plot_view.canvas,r=e.sx_to_vx(t.bokeh.sx),n=e.sy_to_vy(t.bokeh.sy),this.plot_view.frame.contains(r,n)?this._inspect(r,n):this._clear()},e.prototype._move_exit=function(){return this._clear()},e.prototype._inspect=function(t,e,r){var n,i,o,s,a,l;for(n={type:"point",vx:t,vy:e},"mouse"===this.model.mode?n.type="point":(n.type="span","vline"===this.model.mode?n.direction="h":n.direction="v"),a=this.computed_renderers,i=0,o=a.length;i<o;i++)s=a[i],l=s.get_selection_manager(),l.inspect(this.plot_view.renderer_views[s.id],n);null!=this.model.callback&&this._emit_callback(n)},e.prototype._update=function(t){var e,r,n,i,o,s,a,l,u,_,h,p,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E,z,C,N,D,F,I,B,R,L,V,G,U,q,Y,X,W,H,Q,J,$,Z,K,tt;if(L=t[0],S=t[1],p=S.geometry,this.model.active&&(W=null!=(T=this.ttmodels[L.model.id])?T:null,null!=W&&(W.clear(),m=L.model.get_selection_manager().inspectors[L.model.id].indices,_=L.model.get_selection_manager().source,!m.is_empty()))){for(Q=p.vx,J=p.vy,e=this.plot_model.canvas,h=this.plot_model.frame,Y=e.vx_to_sx(Q),X=e.vy_to_sy(J),Z=h.xscales[L.model.x_range_name],tt=h.yscales[L.model.y_range_name],$=Z.invert(Q),K=tt.invert(J),z=m["0d"].indices,b=0,x=z.length;b<x;b++){switch(f=z[b],s=L.glyph._x[f+1],a=L.glyph._y[f+1],y=f,this.model.line_policy){case"interp":C=L.glyph.get_interpolation_hit(f,p),s=C[0],a=C[1],V=Z.compute(s),G=tt.compute(a);break;case"prev":V=e.sx_to_vx(L.glyph.sx[f]),G=e.sy_to_vy(L.glyph.sy[f]);break;case"next":V=e.sx_to_vx(L.glyph.sx[f+1]),G=e.sy_to_vy(L.glyph.sy[f+1]),y=f+1;break;case"nearest":r=L.glyph.sx[f],n=L.glyph.sy[f],l=c.dist_2_pts(r,n,Y,X),i=L.glyph.sx[f+1],o=L.glyph.sy[f+1],u=c.dist_2_pts(i,o,Y,X),l<u?(N=[r,n],U=N[0],q=N[1]):(D=[i,o],U=D[0],q=D[1],y=f+1),s=L.glyph._x[f],a=L.glyph._y[f],V=e.sx_to_vx(U),G=e.sy_to_vy(q);break;default:F=[Q,J],V=F[0],G=F[1]}H={index:y,x:$,y:K,vx:Q,vy:J,sx:Y,sy:X,data_x:s,data_y:a,rx:V,ry:G},W.add(V,G,this._render_tooltips(_,y,H))}for(I=m["1d"].indices,w=0,k=I.length;w<k;w++)if(f=I[w],d.isEmpty(m["2d"].indices))s=null!=(A=L.glyph._x)?A[f]:void 0,a=null!=(j=L.glyph._y)?j[f]:void 0,"snap_to_data"===this.model.point_policy?(M=L.glyph.get_anchor_point(this.model.anchor,f,[Y,X]),null==M&&(M=L.glyph.get_anchor_point("center",f,[Y,X])),V=e.sx_to_vx(M.x),G=e.sy_to_vy(M.y)):(E=[Q,J],V=E[0],G=E[1]),H={index:f,x:$,y:K,vx:Q,vy:J,sx:Y,sy:X,data_x:s,data_y:a},W.add(V,G,this._render_tooltips(_,f,H));else{B=m["2d"].indices;for(f in B){switch(v=B[f][0],s=L.glyph._xs[f][v],a=L.glyph._ys[f][v],g=v,this.model.line_policy){case"interp":R=L.glyph.get_interpolation_hit(f,v,p),s=R[0],a=R[1],V=Z.compute(s),G=tt.compute(a);break;case"prev":V=e.sx_to_vx(L.glyph.sxs[f][v]),G=e.sy_to_vy(L.glyph.sys[f][v]);break;case"next":V=e.sx_to_vx(L.glyph.sxs[f][v+1]),G=e.sy_to_vy(L.glyph.sys[f][v+1]),g=v+1;break;case"nearest":r=L.glyph.sxs[f][v],n=L.glyph.sys[f][v],l=c.dist_2_pts(r,n,Y,X),i=L.glyph.sxs[f][v+1],o=L.glyph.sys[f][v+1],u=c.dist_2_pts(i,o,Y,X),l<u?(O=[r,n],U=O[0],q=O[1]):(P=[i,o],U=P[0],q=P[1],g=v+1),s=L.glyph._xs[f][v],a=L.glyph._ys[f][v],V=e.sx_to_vx(U),G=e.sy_to_vy(q)}H={index:f,segment_index:g,x:$,y:K,vx:Q,vy:J,sx:Y,sy:X,data_x:s,data_y:a},W.add(V,G,this._render_tooltips(_,f,H))}}return null}},e.prototype._emit_callback=function(t){var e,r,n,i,o,s,a,l,u,c;a=this.computed_renderers[0],o=this.plot_view.renderer_views[a.id].hit_test(t),r=this.plot_model.canvas,i=this.plot_model.frame,t.sx=r.vx_to_sx(t.vx),t.sy=r.vy_to_sy(t.vy),u=i.xscales[a.x_range_name],c=i.yscales[a.y_range_name],t.x=u.invert(t.vx),t.y=c.invert(t.vy),e=this.model.callback,l=[e,{index:o,geometry:t,renderer:a}],s=l[0],n=l[1],f.isFunction(e)?e(s,n):e.execute(s,n)},e.prototype._render_tooltips=function(t,e,r){var i,o,s,a,l,u,c,p,d,y,m,v,g,b,w,x,k,M;if(k=this.model.tooltips,f.isString(k))return l=h.div(),l.innerHTML=_.replace_placeholders(k,t,e,this.model.formatters,r),l;if(f.isFunction(k))return k(t,r);for(w=h.div({style:{display:"table",borderSpacing:"2px"}}),c=0,d=k.length;c<d;c++)if(v=k[c],p=v[0],M=v[1],b=h.div({style:{display:"table-row"}}),w.appendChild(b),i=h.div({style:{display:"table-cell"},"class":"bk-tooltip-row-label"},p+": "),b.appendChild(i),i=h.div({style:{display:"table-cell"},"class":"bk-tooltip-row-value"}),b.appendChild(i),M.indexOf("$color")>=0){if(g=M.match(/\$color(\[.*\])?:(\w*)/),y=g[0],m=g[1],o=g[2],a=t.get_column(o),null==a){l=h.span({},o+" unknown"),i.appendChild(l);continue}if(u=(null!=m?m.indexOf("hex"):void 0)>=0,x=(null!=m?m.indexOf("swatch"):void 0)>=0,s=a[e],null==s){l=h.span({},"(null)"),i.appendChild(l);continue}u&&(s=n(s)),l=h.span({},s),i.appendChild(l),x&&(l=h.span({"class":"bk-tooltip-color-block",style:{backgroundColor:s}}," "),i.appendChild(l))}else M=M.replace("$~","$data_"),l=h.span(),l.innerHTML=_.replace_placeholders(M,t,e,this.model.formatters,r),i.appendChild(l);return w},e}(s.InspectToolView),r.HoverTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.default_view=r.HoverToolView,e.prototype.type="HoverTool",e.prototype.tool_name="Hover",e.prototype.icon="bk-tool-icon-hover",e.define({tooltips:[p.Any,[["index","$index"],["data (x, y)","($x, $y)"],["canvas (x, y)","($sx, $sy)"]]],formatters:[p.Any,{}],renderers:[p.Array,[]],names:[p.Array,[]],mode:[p.String,"mouse"],point_policy:[p.String,"snap_to_data"],line_policy:[p.String,"nearest"],show_arrow:[p.Boolean,!0],anchor:[p.String,"center"],attachment:[p.String,"horizontal"],callback:[p.Any]}),e}(s.InspectTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(13),s=t(210);r.InspectToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(s.ButtonToolView),r.InspectTool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.event_type="move",e.define({toggleable:[o.Bool,!0]}),e.override({active:!0}),e}(s.ButtonTool)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(210);r.OnOffButtonView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.render=function(){return e.__super__.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}(o.ButtonToolButtonView)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(13),s=t(43),a=t(20),l=t(48);r.ToolView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.plot_view=t.plot_view},e.getters({plot_model:function(){return this.plot_view.model}}),e.prototype.connect_signals=function(){return e.__super__.connect_signals.call(this),this.connect(this.model.properties.active.change,function(t){return function(){return t.model.active?t.activate():t.deactivate()}}(this))},e.prototype.activate=function(){},e.prototype.deactivate=function(){},e}(s.View),r.Tool=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.getters({synthetic_renderers:function(){return[]}}),e.internal({active:[o.Boolean,!1]}),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,r,n){var i,o,s,l,u,c,_,h;return s=t[0],c=t[1],l=e[0],_=e[1],i=r.h_range,"width"===n||"both"===n?(u=[a.min([s,l]),a.max([s,l])],u=[a.max([u[0],i.min]),a.min([u[1],i.max])]):u=[i.min,i.max],o=r.v_range,"height"===n||"both"===n?(h=[a.min([c,_]),a.max([c,_])],h=[a.max([h[0],o.min]),a.min([h[1],o.max])]):h=[o.min,o.max],[u,h]},e}(l.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(13),s=t(18),a=t(48);r.ToolProxy=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this["do"]=new s.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,r,n;for(r=this.tools,t=0,e=r.length;t<e;t++)n=r[t],n["do"].emit();return null},e.prototype.set_active=function(){var t,e,r,n;for(r=this.tools,t=0,e=r.length;t<e;t++)n=r[t],n.active=this.active;return null},e.define({tools:[o.Array,[]],active:[o.Bool,!1],tooltip:[o.String],tool_name:[o.String],disabled:[o.Bool,!1],event_type:[o.String],icon:[o.String]}),e.prototype._clicked=function(){var t;return t=this.model.active,this.model.active=!t},e}(a.Model)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},s=t(13),a=t(20),l=t(202),u=t(203),c=t(213),_=t(224),h=t(229);r.Toolbar=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="Toolbar",e.prototype.default_view=h.ToolbarBaseView,e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.connect(this.properties.tools.change,function(){return this._init_tools()}),this._init_tools()},e.prototype._init_tools=function(){var t,e,r,n,i,s,h;for(n=this.tools,e=0,r=n.length;e<r;e++)if(s=n[e],s instanceof _.InspectTool)a.any(this.inspectors,function(t){return function(t){return t.id===s.id}}(this))||(this.inspectors=this.inspectors.concat([s]));else if(s instanceof u.HelpTool)a.any(this.help,function(t){return function(t){return t.id===s.id}}(this))||(this.help=this.help.concat([s]));else if(s instanceof l.ActionTool)a.any(this.actions,function(t){return function(t){return t.id===s.id}}(this))||(this.actions=this.actions.concat([s]));else if(s instanceof c.GestureTool){if(t=s.event_type,!(t in this.gestures)){logger.warn("Toolbar: unknown event type '"+t+"' for tool: "+s.type+" ("+s.id+")");continue}a.any(this.gestures[t].tools,function(t){return function(t){return t.id===s.id}}(this))||(this.gestures[t].tools=this.gestures[t].tools.concat([s])),this.connect(s.properties.active.change,this._active_change.bind(null,s))}"auto"===this.active_inspect||(this.active_inspect instanceof _.InspectTool?this.inspectors.map(function(t){return function(e){if(e!==t.active_inspect)return e.active=!1}}(this)):this.active_inspect instanceof Array?this.inspectors.map(function(t){return function(e){if(o.call(t.active_inspect,e)<0)return e.active=!1}}(this)):null===this.active_inspect&&this.inspectors.map(function(t){return t.active=!1})),i=[];for(t in this.gestures)if(h=this.gestures[t].tools,0!==h.length){if(this.gestures[t].tools=a.sortBy(h,function(t){return t.default_order}),"tap"===t){if(null===this.active_tap)continue;"auto"===this.active_tap?this.gestures[t].tools[0].active=!0:this.active_tap.active=!0}if("pan"===t){if(null===this.active_drag)continue;"auto"===this.active_drag?this.gestures[t].tools[0].active=!0:this.active_drag.active=!0}if("pinch"===t||"scroll"===t){if(null===this.active_scroll||"auto"===this.active_scroll)continue;i.push(this.active_scroll.active=!0)}else i.push(void 0)}return i},e.define({active_drag:[s.Any,"auto"],active_inspect:[s.Any,"auto"],active_scroll:[s.Any,"auto"],active_tap:[s.Any,"auto"]}),e}(h.ToolbarBase)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=function(t,e){return function(){return t.apply(e,arguments)}},s=t(12),a=t(11),l=t(4),u=t(13),c=t(134),_=t(202),h=t(225);r.ToolbarBaseView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.className="bk-toolbar-wrapper",e.prototype.template=function(){var t,e,r;return null!=this.model.logo?(t="grey"===this.model.logo?"bk-grey":null,e=l.a({href:"https://bokeh.pydata.org/",target:"_blank","class":["bk-logo","bk-logo-small",t]})):e=null,r=this.model.toolbar_sticky?"sticky":"not-sticky",l.div({"class":["bk-toolbar-"+this.model.toolbar_location,"bk-toolbar-"+r]},e,l.div({"class":"bk-button-bar"},l.div({"class":"bk-button-bar-list",type:"pan"}),l.div({"class":"bk-button-bar-list",type:"scroll"}),l.div({"class":"bk-button-bar-list",type:"pinch"}),l.div({"class":"bk-button-bar-list",type:"tap"}),l.div({"class":"bk-button-bar-list",type:"press"}),l.div({"class":"bk-button-bar-list",type:"rotate"}),l.div({"class":"bk-button-bar-list",type:"actions"}),l.div({"class":"bk-button-bar-list",type:"inspectors"}),l.div({"class":"bk-button-bar-list",type:"help"})))},e.prototype.render=function(){var t,e,r,n,i,o,s,a,u,c,p,d,f,y,m,v;for(l.empty(this.el),"fixed"!==this.model.sizing_mode&&(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"),this.el.appendChild(this.template()),t=this.el.querySelector(".bk-button-bar-list[type='inspectors']"),f=this.model.inspectors,n=0,a=f.length;n<a;n++)d=f[n],d.toggleable&&t.appendChild(new h.OnOffButtonView({model:d,parent:this}).el);for(t=this.el.querySelector(".bk-button-bar-list[type='help']"),y=this.model.help,i=0,u=y.length;i<u;i++)d=y[i],t.appendChild(new _.ActionToolButtonView({model:d,parent:this}).el);for(t=this.el.querySelector(".bk-button-bar-list[type='actions']"),m=this.model.actions,o=0,c=m.length;o<c;o++)d=m[o],t.appendChild(new _.ActionToolButtonView({model:d,parent:this}).el);r=this.model.gestures;for(e in r)for(t=this.el.querySelector(".bk-button-bar-list[type='"+e+"']"),v=r[e].tools,s=0,p=v.length;s<p;s++)d=v[s],t.appendChild(new h.OnOffButtonView({model:d,parent:this}).el);return this},e}(c.LayoutDOMView),r.ToolbarBase=function(t){function e(){return this._active_change=o(this._active_change,this),e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="ToolbarBase",e.prototype.default_view=r.ToolbarBaseView,e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._set_sizeable(),this.connect(this.properties.toolbar_location.change,function(t){return function(){return t._set_sizeable()}}(this))},e.prototype._set_sizeable=function(){var t,e;return t="left"===(e=this.toolbar_location)||"right"===e,this._sizeable=t?this._width:this._height},e.prototype._active_change=function(t){var e,r;return r=t.event_type,t.active?(e=this.gestures[r].active,null!=e&&(s.logger.debug("Toolbar: deactivating tool: "+e.type+" ("+e.id+") for event type '"+r+"'"),e.active=!1),this.gestures[r].active=t,s.logger.debug("Toolbar: activating tool: "+t.type+" ("+t.id+") for event type '"+r+"'")):this.gestures[r].active=null,null},e.prototype.get_constraints=function(){return e.__super__.get_constraints.call(this).concat(a.EQ(this._sizeable,-30))},e.define({tools:[u.Array,[]],logo:[u.String,"normal"]}),e.internal({gestures:[u.Any,function(){return{pan:{tools:[],active:null},tap:{tools:[],active:null},doubletap:{tools:[],active:null},scroll:{tools:[],active:null},pinch:{tools:[],active:null},press:{tools:[],active:null},rotate:{tools:[],active:null}}}],actions:[u.Array,[]],inspectors:[u.Array,[]],help:[u.Array,[]],toolbar_location:[u.Location,"right"],toolbar_sticky:[u.Bool]}),e.override({sizing_mode:null}),e}(c.LayoutDOM)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},s=t(13),a=t(20),l=t(202),u=t(203),c=t(213),_=t(224),h=t(229),p=t(227),d=t(131);r.ToolbarBoxToolbar=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="ToolbarBoxToolbar",e.prototype.default_view=h.ToolbarBaseView,e.prototype.initialize=function(t){if(e.__super__.initialize.call(this,t),this._init_tools(),this.merge_tools===!0)return this._merge_tools()},e.define({merge_tools:[s.Bool,!0]}),e.prototype._init_tools=function(){var t,e,r,n,i,o;for(n=this.tools,i=[],e=0,r=n.length;e<r;e++)o=n[e],o instanceof _.InspectTool?a.any(this.inspectors,function(t){return function(t){return t.id===o.id}}(this))?i.push(void 0):i.push(this.inspectors=this.inspectors.concat([o])):o instanceof u.HelpTool?a.any(this.help,function(t){return function(t){return t.id===o.id}}(this))?i.push(void 0):i.push(this.help=this.help.concat([o])):o instanceof l.ActionTool?a.any(this.actions,function(t){return function(t){return t.id===o.id}}(this))?i.push(void 0):i.push(this.actions=this.actions.concat([o])):o instanceof c.GestureTool?(t=o.event_type,a.any(this.gestures[t].tools,function(t){return function(t){return t.id===o.id}}(this))?i.push(void 0):i.push(this.gestures[t].tools=this.gestures[t].tools.concat([o]))):i.push(void 0);return i},e.prototype._merge_tools=function(){var t,e,r,n,i,s,l,u,c,_,h,d,f,y,m,v,g,b,w,x,k,M,S,T,O,P,A,j,E,z,C;for(c={},t={},i={},b=[],w=[],k=this.help,l=0,f=k.length;l<f;l++)s=k[l],M=s.redirect,o.call(w,M)<0&&(b.push(s),w.push(s.redirect));this.help=b,S=this.gestures;for(n in S){u=S[n],n in i||(i[n]={}),T=u.tools;for(_=0,y=T.length;_<y;_++)E=T[_],E.type in i[n]||(i[n][E.type]=[]),i[n][E.type].push(E)}for(O=this.inspectors,h=0,m=O.length;h<m;h++)E=O[h],E.type in c||(c[E.type]=[]),c[E.type].push(E);for(P=this.actions,d=0,v=P.length;d<v;d++)E=P[d],E.type in t||(t[E.type]=[]),t[E.type].push(E);g=function(t,e){return null==e&&(e=!1),new p.ToolProxy({tools:t,event_type:t[0].event_type,tooltip:t[0].tool_name,tool_name:t[0].tool_name,icon:t[0].icon,active:e})};for(n in i){this.gestures[n].tools=[],A=i[n];for(z in A)C=A[z],C.length>0&&(x=g(C),this.gestures[n].tools.push(x),this.connect(x.properties.active.change,this._active_change.bind(null,x)))}this.actions=[];for(z in t)C=t[z],C.length>0&&this.actions.push(g(C));this.inspectors=[];for(z in c)C=c[z],C.length>0&&this.inspectors.push(g(C,e=!0));j=[];for(r in this.gestures)C=this.gestures[r].tools,0!==C.length&&(this.gestures[r].tools=a.sortBy(C,function(t){return t.default_order}),"pinch"!==r&&"scroll"!==r?j.push(this.gestures[r].tools[0].active=!0):j.push(void 0));return j},e}(h.ToolbarBase),r.ToolbarBoxView=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.className="bk-toolbar-box",e.prototype.get_width=function(){return this.model._horizontal===!0?30:null},e.prototype.get_height=function(){return 30},e}(d.BoxView),r.ToolbarBox=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.type="ToolbarBox",e.prototype.default_view=r.ToolbarBoxView,e.prototype.initialize=function(t){var n;return e.__super__.initialize.call(this,t),this._toolbar=new r.ToolbarBoxToolbar(t),this._horizontal="left"===(n=this.toolbar_location)||"right"===n,this._sizeable=this._horizontal?this._width:this._height},e.prototype._doc_attached=function(){return this._toolbar.attach_document(this.document),e.__super__._doc_attached.call(this)},e.prototype.get_layoutable_children=function(){return[this._toolbar]},e.define({toolbar_location:[s.Location,"right"],merge_tools:[s.Bool,!0],tools:[s.Any,[]],logo:[s.String,"normal"]}),e}(d.Box)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=[].slice,s=t(238),a=t(13),l=t(28);r.CustomJSTransform=function(e){function i(){return i.__super__.constructor.apply(this,arguments)}return n(i,e),i.prototype.type="CustomJSTransform",i.define({args:[a.Any,{}],func:[a.String,""],v_func:[a.String,""]}),i.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)}}),i.prototype.compute=function(e){return this.scalar_transform.apply(this,o.call(this.values).concat([e],[t],[r]))},i.prototype.v_compute=function(e){return this.vector_transform.apply(this,o.call(this.values).concat([e],[t],[r]))},i.prototype._make_transform=function(t,e){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(Function,o.call(Object.keys(this.args)).concat([t],["require"],["exports"],[e]),function(){})},i.prototype._make_values=function(){return l.values(this.args)},i}(s.Transform)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(238),s=t(13);r.Dodge=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.define({value:[s.Number,0],range:[s.Instance]}),e.prototype.compute=function(t,e){var r;return null==e&&(e=!0),null!=(null!=(r=this.range)?r.synthetic:void 0)&&e&&(t=this.range.synthetic(t)),t+this.value},e}(o.Transform)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(231);r.CustomJSTransform=n.CustomJSTransform;var i=t(232);r.Dodge=i.Dodge;var o=t(234);r.Interpolator=o.Interpolator;var s=t(235);r.Jitter=s.Jitter;var a=t(236);r.LinearInterpolator=a.LinearInterpolator;var l=t(237);r.StepInterpolator=l.StepInterpolator;var u=t(238);r.Transform=u.Transform},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},s=t(238),a=t(13);r.Interpolator=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._x_sorted=[],this._y_sorted=[],this._sorted_dirty=!0,this.connect(this.change,function(){return this._sorted_dirty=!0})},e.define({x:[a.Any],y:[a.Any],data:[a.Any],clip:[a.Bool,!0]}),e.prototype.sort=function(t){var e,r,n,i,s,a,l,u,c,_,h;if(null==t&&(t=!1),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(_=[],h=[],"string"==typeof this.x){if(r=this.data,e=r.columns(),l=this.x,o.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,o.call(e,u)<0)throw new Error("The x parameter does not correspond to a valid column name defined in the data parameter");_=r.get_column(this.x),h=r.get_column(this.y)}else _=this.x,h=this.y;if(_.length!==h.length)throw new Error("The length for x and y do not match");if(_.length<2)throw new Error("x and y must have at least two elements to support interpolation");a=[];for(i in _)a.push({x:_[i],y:h[i]});for(t===!0?a.sort(function(t,e){var r,n;return null!=(r=t.x<e.x)?r:-{1:null!=(n=t.x===e.x)?n:{0:1}}}):a.sort(function(t,e){var r,n;return null!=(r=t.x>e.x)?r:-{1:null!=(n=t.x===e.x)?n:{0:1}}}),s=n=0,c=a.length;0<=c?n<c:n>c;s=0<=c?++n:--n)this._x_sorted[s]=a[s].x,this._y_sorted[s]=a[s].y;return this._sorted_dirty=!1}},e}(s.Transform)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(238),s=t(13),a=t(27);r.Jitter=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.define({mean:[s.Number,0],width:[s.Number,1],distribution:[s.Distribution,"uniform"],range:[s.Instance]}),e.prototype.compute=function(t,e){var r;return null==e&&(e=!0),null!=(null!=(r=this.range)?r.synthetic:void 0)&&e&&(t=this.range.synthetic(t)),"uniform"===this.distribution?t+this.mean+(a.random()-.5)*this.width:"normal"===this.distribution?t+a.rnorm(this.mean,this.width):void 0},e}(o.Transform)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(20),s=t(234);r.LinearInterpolator=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.compute=function(t){var e,r,n,i,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]:(r=o.findLastIndex(this._x_sorted,function(e){return e<t}),i=this._x_sorted[r],s=this._x_sorted[r+1],a=this._y_sorted[r],l=this._y_sorted[r+1],n=a+(t-i)/(s-i)*(l-a))},e.prototype.v_compute=function(t){var e,r,n,i,o;for(i=new Float64Array(t.length),r=e=0,n=t.length;e<n;r=++e)o=t[r],i[r]=this.compute(o);return i},e}(s.Interpolator)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(234),s=t(13),a=t(20);r.StepInterpolator=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.define({mode:[s.TransformStepMode,"after"]}),e.prototype.compute=function(t){var e,r,n,i,o,s;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 n=-1,"after"===this.mode&&(n=a.findLastIndex(this._x_sorted,function(e){
return t>=e})),"before"===this.mode&&(n=a.findIndex(this._x_sorted,function(e){return t<=e})),"center"===this.mode&&(r=function(){var e,r,n,i;for(n=this._x_sorted,i=[],e=0,r=n.length;e<r;e++)s=n[e],i.push(Math.abs(s-t));return i}.call(this),i=a.min(r),n=a.findIndex(r,function(t){return i===t})),o=n!==-1?this._y_sorted[n]:null},e.prototype.v_compute=function(t){var e,r,n,i,o;for(i=new Float64Array(t.length),r=e=0,n=t.length;e<n;r=++e)o=t[r],i[r]=this.compute(o);return i},e}(o.Interpolator)},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=t(48);r.Transform=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.v_compute=function(t){var e,r,n,i,o,s;for(null!=(null!=(i=this.range)?i.v_synthetic:void 0)&&(t=this.range.v_synthetic(t)),o=new Float64Array(t.length),r=e=0,n=t.length;e<n;r=++e)s=t[r],o[r]=this.compute(s,!1);return o},e}(o.Model)},function(t,e,r){"use strict";"function"!=typeof WeakMap&&t(306),"function"!=typeof Set&&t(296);var n=String.prototype;n.repeat||(n.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 r="";1==(1&t)&&(r+=e),t>>>=1,0!=t;)e+=e;return r})},function(t,e,r){"use strict";function n(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 r=document.createElement("span");r.style.backgroundColor="#a94442",r.style.borderRadius="0px 4px 0px 0px",r.style.color="white",r.style.cursor="pointer",r.style.cssFloat="right",r.style.fontSize="0.8em",r.style.margin="-6px -6px 0px 0px",r.style.padding="2px 5px 4px 5px",r.title="close",r.setAttribute("aria-label","close"),r.appendChild(document.createTextNode("x")),r.addEventListener("click",function(){return o.removeChild(e)});var n=document.createElement("h3");n.style.color="#a94442",n.style.margin="8px 0px 0px 0px",n.style.padding="0px",n.appendChild(document.createTextNode("Bokeh Error"));var i=document.createElement("pre");i.style.whiteSpace="unset",i.style.overflowX="auto",i.appendChild(document.createTextNode(t.message||t)),e.appendChild(r),e.appendChild(n),e.appendChild(i);var o=document.getElementsByTagName("body")[0];o.insertBefore(e,o.firstChild)}function i(t,e){void 0===e&&(e=!1);try{return t()}catch(r){if(n(r),e)return;throw r}}Object.defineProperty(r,"__esModule",{value:!0}),r.safely=i},function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.version="0.12.7"},function(t,e,r){!function(){"use strict";function t(t,e){var r,n=Object.keys(e);for(r=0;r<n.length;r++)t=t.replace(new RegExp("\\{"+n[r]+"\\}","gi"),e[n[r]]);return t}function r(t){var e,r,n;if(!t)throw new Error("cannot create a random attribute name for an undefined object");e="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",r="";do for(r="",n=0;n<12;n++)r+=e[Math.floor(Math.random()*e.length)];while(t[r]);return r}function n(t,e){var r,n,i,o={};for(t=t.split(","),e=e||10,r=0;r<t.length;r+=2)n="&"+t[r+1]+";",i=parseInt(t[r],e),o[n]="&#"+i+";";return o["\\xa0"]="&#160;",o}function i(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,c;c=n("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,r){var n,i,o=this.__ctx.__createElement("stop");o.setAttribute("offset",e),r.indexOf("rgba")!==-1?(n=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi,i=n.exec(r),o.setAttribute("stop-color",t("rgb({r},{g},{b})",{r:i[1],g:i[2],b:i[3]})),o.setAttribute("stop-opacity",i[4])):o.setAttribute("stop-color",r),this.__root.appendChild(o)},u=function(t,e){this.__root=t,this.__ctx=e},a=function(t){var e,r={width:500,height:500,enableMirroring:!1};return arguments.length>1?(e=r,e.width=arguments[0],e.height=arguments[1]):e=t?t:r,this instanceof a?(this.width=e.width||r.width,this.height=e.height||r.height,this.enableMirroring=void 0!==e.enableMirroring?e.enableMirroring:r.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,r){"undefined"==typeof e&&(e={});var n,i,o=this.__document.createElementNS("http://www.w3.org/2000/svg",t),s=Object.keys(e);for(r&&(o.setAttribute("fill","none"),o.setAttribute("stroke","none")),n=0;n<s.length;n++)i=s[n],o.setAttribute(i,e[i]);return o},a.prototype.__setDefaultStyles=function(){var t,e,r=Object.keys(s);for(t=0;t<r.length;t++)e=r[t],this[e]=s[e].canvas},a.prototype.__applyStyleState=function(t){var e,r,n=Object.keys(t);for(e=0;e<n.length;e++)r=n[e],this[r]=t[r]},a.prototype.__getStyleState=function(){var t,e,r={},n=Object.keys(s);for(t=0;t<n.length;t++)e=n[t],r[e]=this[e];return r},a.prototype.__applyStyleToCurrentElement=function(e){var r=this.__currentElement,n=this.__currentElementsToStyle;n&&(r.setAttribute(e,""),r=n.element,n.children.forEach(function(t){t.setAttribute(e,"")}));var i,o,a,c,_,h,p=Object.keys(s);for(i=0;i<p.length;i++)if(o=s[p[i]],a=this[p[i]],o.apply)if(a instanceof u){if(a.__ctx)for(;a.__ctx.__defs.childNodes.length;)c=a.__ctx.__defs.childNodes[0].getAttribute("id"),this.__ids[c]=c,this.__defs.appendChild(a.__ctx.__defs.childNodes[0]);r.setAttribute(o.apply,t("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof l)r.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[i]&&(d=e+"-"+o.svgAttr,r.getAttribute(d)))continue;r.setAttribute(d,a)}else{_=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi,h=_.exec(a),r.setAttribute(o.svgAttr,t("rgb({r},{g},{b})",{r:h[1],g:h[2],b:h[3]}));var f=h[4],y=this.globalAlpha;null!=y&&(f*=y),r.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,r,n,i,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(c),r=0;r<e.length;r++)n=e[r],i=c[n],o=new RegExp(n,"gi"),o.test(a)&&(a=a.replace(o,i));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 r=this.__createElement("g");e.appendChild(r),this.__currentElement=r}var n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)},a.prototype.scale=function(e,r){void 0===r&&(r=e),this.__addTransform(t("scale({x},{y})",{x:e,y:r}))},a.prototype.rotate=function(e){var r=180*e/Math.PI;this.__addTransform(t("rotate({angle},{cx},{cy})",{angle:r,cx:0,cy:0}))},a.prototype.translate=function(e,r){this.__addTransform(t("translate({x},{y})",{x:e,y:r}))},a.prototype.transform=function(e,r,n,i,o,s){this.__addTransform(t("matrix({a},{b},{c},{d},{e},{f})",{a:e,b:r,c:n,d:i,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,r){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:r},this.__addPathCommand(t("M {x} {y}",{x:e,y:r}))},a.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand("Z")},a.prototype.lineTo=function(e,r){this.__currentPosition={x:e,y:r},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(t("L {x} {y}",{x:e,y:r})):this.__addPathCommand(t("M {x} {y}",{x:e,y:r}))},a.prototype.bezierCurveTo=function(e,r,n,i,o,s){this.__currentPosition={x:o,y:s},this.__addPathCommand(t("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:e,cp1y:r,cp2x:n,cp2y:i,x:o,y:s}))},a.prototype.quadraticCurveTo=function(e,r,n,i){this.__currentPosition={x:n,y:i},this.__addPathCommand(t("Q {cpx} {cpy} {x} {y}",{cpx:e,cpy:r,x:n,y:i}))};var _=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,r,n,i){var o=this.__currentPosition&&this.__currentPosition.x,s=this.__currentPosition&&this.__currentPosition.y;if("undefined"!=typeof o&&"undefined"!=typeof s){if(i<0)throw new Error("IndexSizeError: The radius provided ("+i+") is negative.");if(o===t&&s===e||t===r&&e===n||0===i)return void this.lineTo(t,e);var a=_([o-t,s-e]),l=_([r-t,n-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],c=Math.acos(Math.abs(u)),h=_([a[0]+l[0],a[1]+l[1]]),p=i/Math.sin(c/2),d=t+p*h[0],f=e+p*h[1],y=[-a[1],a[0]],m=[l[1],-l[0]],v=function(t){var e=t[0],r=t[1];return r>=0?Math.acos(e):-Math.acos(e)},g=v(y),b=v(m);this.lineTo(d+y[0]*i,f+y[1]*i),this.arc(d,f,i,g,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,r,n){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+r,e),this.lineTo(t+r,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()},a.prototype.fillRect=function(t,e,r,n){var i,o;i=this.__createElement("rect",{x:t,y:e,width:r,height:n},!0),o=this.__closestGroupOrSvg(),o.appendChild(i),this.__currentElement=i,this.__applyStyleToCurrentElement("fill")},a.prototype.strokeRect=function(t,e,r,n){var i,o;i=this.__createElement("rect",{x:t,y:e,width:r,height:n},!0),o=this.__closestGroupOrSvg(),o.appendChild(i),this.__currentElement=i,this.__applyStyleToCurrentElement("stroke")},a.prototype.__clearCanvas=function(){for(var t=this.__closestGroupOrSvg(),e=t.getAttribute("transform"),r=this.__root.childNodes[1],n=r.childNodes,i=n.length-1;i>=0;i--)n[i]&&r.removeChild(n[i]);this.__currentElement=r,this.__groupStack=[],e&&this.__addTransform(e)},a.prototype.clearRect=function(t,e,r,n){if(0===t&&0===e&&r===this.width&&n===this.height)return void this.__clearCanvas();var i,o=this.__closestGroupOrSvg();i=this.__createElement("rect",{x:t,y:e,width:r,height:n,fill:"#FFFFFF"},!0),o.appendChild(i)},a.prototype.createLinearGradient=function(t,e,n,i){var o=this.__createElement("linearGradient",{id:r(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(o),new l(o,this)},a.prototype.createRadialGradient=function(t,e,n,i,o,s){var a=this.__createElement("radialGradient",{id:r(this.__ids),cx:i+"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),r={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&&(r.decoration="underline"),this.__fontHref&&(r.href=this.__fontHref),r},a.prototype.__wrapTextLink=function(t,e){if(t.href){var r=this.__createElement("a");return r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),r.appendChild(e),r}return e},a.prototype.__applyText=function(t,e,r,n){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:r,"text-anchor":i(this.textAlign),"dominant-baseline":o(this.textBaseline)},!0);l.appendChild(this.__document.createTextNode(t)),this.__currentElement=l,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(s,l))},a.prototype.fillText=function(t,e,r){this.__applyText(t,e,r,"fill")},a.prototype.strokeText=function(t,e,r){this.__applyText(t,e,r,"stroke")},a.prototype.measureText=function(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)},a.prototype.arc=function(e,r,n,i,o,s){if(i!==o){i%=2*Math.PI,o%=2*Math.PI,i===o&&(o=(o+2*Math.PI-.001*(s?-1:1))%(2*Math.PI));var a=e+n*Math.cos(o),l=r+n*Math.sin(o),u=e+n*Math.cos(i),c=r+n*Math.sin(i),_=s?0:1,h=0,p=o-i;p<0&&(p+=2*Math.PI),h=s?p>Math.PI?0:1:p>Math.PI?1:0,this.lineTo(u,c),this.__addPathCommand(t("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:h,sweepFlag:_,endX:a,endY:l})),this.__currentPosition={x:a,y:l}}},a.prototype.clip=function(){var e=this.__closestGroupOrSvg(),n=this.__createElement("clipPath"),i=r(this.__ids),o=this.__createElement("g");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),n.setAttribute("id",i),n.appendChild(this.__currentElement),this.__defs.appendChild(n),e.setAttribute("clip-path",t("url(#{id})",{id:i})),e.appendChild(o),this.__currentElement=o},a.prototype.drawImage=function(){var t,e,r,n,i,o,s,l,u,c,_,h,p,d,f,y=Array.prototype.slice.call(arguments),m=y[0],v=0,g=0;if(3===y.length)t=y[1],e=y[2],i=m.width,o=m.height,r=i,n=o;else if(5===y.length)t=y[1],e=y[2],r=y[3],n=y[4],i=m.width,o=m.height;else{if(9!==y.length)throw new Error("Inavlid number of arguments passed to drawImage: "+arguments.length);v=y[1],g=y[2],i=y[3],o=y[4],t=y[5],e=y[6],r=y[7],n=y[8]}s=this.__closestGroupOrSvg(),_=this.__currentElement;var b="translate("+t+", "+e+")";if(m instanceof a){if(l=m.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(c=l.childNodes[1]){var w,x=c.getAttribute("transform");w=x?x+" "+b:b,c.setAttribute("transform",w),s.appendChild(c)}}}else"IMG"===m.nodeName?(h=this.__createElement("image"),h.setAttribute("width",r),h.setAttribute("height",n),h.setAttribute("preserveAspectRatio","none"),(v||g||i!==m.width||o!==m.height)&&(p=this.__document.createElement("canvas"),p.width=r,p.height=n,d=p.getContext("2d"),d.drawImage(m,v,g,i,o,0,0,r,n),m=p),h.setAttribute("transform",b),h.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===m.nodeName?m.toDataURL():m.getAttribute("src")),s.appendChild(h)):"CANVAS"===m.nodeName&&(h=this.__createElement("image"),h.setAttribute("width",r),h.setAttribute("height",n),h.setAttribute("preserveAspectRatio","none"),p=this.__document.createElement("canvas"),p.width=r,p.height=n,d=p.getContext("2d"),d.imageSmoothingEnabled=!1,d.mozImageSmoothingEnabled=!1,d.oImageSmoothingEnabled=!1,d.webkitImageSmoothingEnabled=!1,d.drawImage(m,v,g,i,o,0,0,r,n),m=p,h.setAttribute("transform",b),h.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",m.toDataURL()),s.appendChild(h))},a.prototype.createPattern=function(t,e){var n,i=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),o=r(this.__ids);return i.setAttribute("id",o),i.setAttribute("width",t.width),i.setAttribute("height",t.height),"CANVAS"===t.nodeName||"IMG"===t.nodeName?(n=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),n.setAttribute("width",t.width),n.setAttribute("height",t.height),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===t.nodeName?t.toDataURL():t.getAttribute("src")),i.appendChild(n),this.__defs.appendChild(i)):t instanceof a&&(i.appendChild(t.__root.childNodes[1]),this.__defs.appendChild(i)),new u(i,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,r){"use strict";var n,i=t(266),o=t(276),s=t(280),a=t(275),l=t(280),u=t(282),c=Function.prototype.bind,_=Object.defineProperty,h=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,o=u(e)&&l(e.value);return n=i(e),delete n.writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,t)?o:(e.value=c.call(o,r.resolveContext?r.resolveContext(this):this),_(this,t,e),this[t])},n},e.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,r){return n(r,t,e)})}},function(t,e,r){"use strict";var n,i=t(263),o=t(276),s=t(269),a=t(283);n=e.exports=function(t,e){var r,n,s,l,u;return arguments.length<2||"string"!=typeof t?(l=e,e=t,t=null):l=arguments[2],null==t?(r=s=!0,n=!1):(r=a.call(t,"c"),n=a.call(t,"e"),s=a.call(t,"w")),u={value:e,configurable:r,enumerable:n,writable:s},l?i(o(l),u):u},n.gs=function(t,e,r){var n,l,u,c;return"string"!=typeof t?(u=r,r=e,e=t,t=null):u=arguments[3],null==e?e=void 0:s(e)?null==r?r=void 0:s(r)||(u=r,r=void 0):(u=e,e=r=void 0),null==t?(n=!0,l=!1):(n=a.call(t,"c"),l=a.call(t,"e")),c={get:e,set:r,configurable:n,enumerable:l},u?i(o(u),c):c}},function(t,e,r){"use strict";var n=t(282);e.exports=function(){return n(this).length=0,this}},function(t,e,r){"use strict";var n=t(257),i=t(261),o=t(282),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,l=Math.abs,u=Math.floor;e.exports=function(t){var e,r,c,_;if(!n(t))return s.apply(this,arguments);for(r=i(o(this).length),c=arguments[1],c=isNaN(c)?0:c>=0?u(c):i(this.length)-u(l(c)),e=c;e<r;++e)if(a.call(this,e)&&(_=this[e],n(_)))return e;return-1}},function(t,e,r){"use strict";e.exports=t(248)()?Array.from:t(249)},function(t,e,r){"use strict";e.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&(t=["raz","dwa"],e=r(t),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,r){"use strict";var n=t(301).iterator,i=t(250),o=t(251),s=t(261),a=t(280),l=t(282),u=t(271),c=t(286),_=Array.isArray,h=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(t){var e,r,f,y,m,v,g,b,w,x,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(i(t))return m=t.length,1!==m?Array.apply(null,t):(y=new Array(1),y[0]=t[0],y);if(_(t)){for(y=new Array(m=t.length),r=0;r<m;++r)y[r]=t[r];return y}}y=[]}if(!_(t))if(void 0!==(w=t[n])){for(g=a(w).call(t),e&&(y=new e),b=g.next(),r=0;!b.done;)x=k?h.call(k,M,b.value,r):b.value,e?(p.value=x,d(y,r,p)):y[r]=x,b=g.next(),++r;m=r}else if(c(t)){for(m=t.length,e&&(y=new e),r=0,f=0;r<m;++r)x=t[r],r+1<m&&(v=x.charCodeAt(0),v>=55296&&v<=56319&&(x+=t[++r])),x=k?h.call(k,M,x,f):x,e?(p.value=x,d(y,f,p)):y[f]=x,++f;m=f}if(void 0===m)for(m=s(t.length),e&&(y=new e(m)),r=0;r<m;++r)x=k?h.call(k,M,t[r],r):t[r],e?(p.value=x,d(y,r,p)):y[r]=x;return e&&(p.value=null,y.length=m),y}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call(function(){return arguments}());e.exports=function(t){return n.call(t)===i}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call(t(252));e.exports=function(t){return"function"==typeof t&&n.call(t)===i}},function(t,e,r){"use strict";e.exports=function(){}},function(t,e,r){e.exports=function(){return this}()},function(t,e,r){"use strict";e.exports=t(255)()?Math.sign:t(256)},function(t,e,r){"use strict";e.exports=function(){var t=Math.sign;return"function"==typeof t&&(1===t(10)&&t(-20)===-1)}},function(t,e,r){"use strict";e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,r){"use strict";e.exports=t(258)()?Number.isNaN:t(259)},function(t,e,r){"use strict";e.exports=function(){var t=Number.isNaN;return"function"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},function(t,e,r){"use strict";e.exports=function(t){return t!==t}},function(t,e,r){"use strict";var n=t(254),i=Math.abs,o=Math.floor;e.exports=function(t){return isNaN(t)?0:(t=Number(t),0!==t&&isFinite(t)?n(t)*o(i(t)):t)}},function(t,e,r){"use strict";var n=t(260),i=Math.max;e.exports=function(t){return i(0,n(t))}},function(t,e,r){"use strict";var n=t(280),i=t(282),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(r,u){var c,_=arguments[2],h=arguments[3];return r=Object(i(r)),n(u),c=a(r),h&&c.sort("function"==typeof h?o.call(h,r):void 0),"function"!=typeof t&&(t=c[t]),s.call(t,c,function(t,n){return l.call(r,t)?s.call(u,_,r[t],t,r,n):e})}}},function(t,e,r){"use strict";e.exports=t(264)()?Object.assign:t(265)},function(t,e,r){"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,r){"use strict";var n=t(272),i=t(282),o=Math.max;e.exports=function(t,e){var r,s,a,l=o(arguments.length,2);for(t=Object(i(t)),a=function(n){try{t[n]=e[n]}catch(i){r||(r=i)}},s=1;s<l;++s)e=arguments[s],n(e).forEach(a);if(void 0!==r)throw r;return t}},function(t,e,r){"use strict";var n=t(247),i=t(263),o=t(282);e.exports=function(t){var e=Object(o(t)),r=arguments[1],s=Object(arguments[2]);if(e!==t&&!r)return e;var a={};return r?n(r,function(e){(s.ensure||e in t)&&(a[e]=t[e])}):i(a,t),a}},function(t,e,r){"use strict";var n,i=Object.create;t(278)()||(n=t(279)),e.exports=function(){var t,e,r;return n?1!==n.level?i:(t={},e={},r={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]=r)}),Object.defineProperties(t,e),Object.defineProperty(n,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:t}),function(e,r){return i(null===e?t:e,r)}):i}()},function(t,e,r){"use strict";e.exports=t(262)("forEach")},function(t,e,r){"use strict";e.exports=function(t){return"function"==typeof t}},function(t,e,r){"use strict";var n=t(271),i={"function":!0,object:!0};e.exports=function(t){return n(t)&&i[typeof t]||!1}},function(t,e,r){"use strict";var n=t(252)();e.exports=function(t){return t!==n&&null!==t}},function(t,e,r){"use strict";e.exports=t(273)()?Object.keys:t(274)},function(t,e,r){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,r){"use strict";var n=t(271),i=Object.keys;e.exports=function(t){return i(n(t)?Object(t):t)}},function(t,e,r){"use strict";var n=t(280),i=t(268),o=Function.prototype.call;e.exports=function(t,e){var r={},s=arguments[2];return n(e),i(t,function(t,n,i,a){r[n]=o.call(e,s,t,n,i,a)}),r}},function(t,e,r){"use strict";var n=t(271),i=Array.prototype.forEach,o=Object.create,s=function(t,e){var r;for(r in t)e[r]=t[r]};e.exports=function(t){var e=o(null);return i.call(arguments,function(t){n(t)&&s(Object(t),e)}),e}},function(t,e,r){"use strict";e.exports=t(278)()?Object.setPrototypeOf:t(279)},function(t,e,r){"use strict";var n=Object.create,i=Object.getPrototypeOf,o={};e.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||n;return"function"==typeof t&&i(t(e(null),o))===o}},function(t,e,r){"use strict";var n,i=t(270),o=t(282),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,l={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(o(t),null===e||i(e))return t;throw new TypeError("Prototype must be null or an object")},e.exports=function(t){var e,r;return t?(2===t.level?t.set?(r=t.set,e=function(t,e){return r.call(n(t,e),e),t}):e=function(t,e){return n(t,e).__proto__=e,t}:e=function i(t,e){var r;return n(t,e),r=s.call(i.nullPolyfill,t),r&&delete i.nullPolyfill.__proto__,null===e&&(e=i.nullPolyfill),t.__proto__=e,r&&a(i.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),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{t=n.set,t.call(e,r)}catch(i){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:(e={},e.__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}()),t(267)},function(t,e,r){"use strict";e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,r){"use strict";var n=t(270);e.exports=function(t){if(!n(t))throw new TypeError(t+" is not an Object");return t}},function(t,e,r){"use strict";var n=t(271);e.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,r){"use strict";e.exports=t(284)()?String.prototype.contains:t(285)},function(t,e,r){"use strict";var n="razdwatrzy";e.exports=function(){return"function"==typeof n.contains&&(n.contains("dwa")===!0&&n.contains("foo")===!1)}},function(t,e,r){"use strict";var n=String.prototype.indexOf;e.exports=function(t){return n.call(this,t,arguments[1])>-1}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===i)||!1}},function(t,e,r){"use strict";var n=Object.create(null),i=Math.random;e.exports=function(){var t;do t=i().toString(36).slice(2);while(n[t]);return t}},function(t,e,r){"use strict";var n,i=t(277),o=t(283),s=t(244),a=t(291),l=Object.defineProperty;n=e.exports=function(t,e){return this instanceof n?(a.call(this,t),e=e?o.call(e,"key+value")?"key+value":o.call(e,"key")?"key":"value":"value",void l(this,"__kind__",s("",e))):new n(t,e)},i&&i(n,a),n.prototype=Object.create(a.prototype,{constructor:s(n),_resolve:s(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}),toString:s(function(){return"[object Array Iterator]"})})},function(t,e,r){"use strict";var n=t(250),i=t(280),o=t(286),s=t(290),a=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;
e.exports=function(t,e){var r,c,_,h,p,d,f,y,m=arguments[2];if(a(t)||n(t)?r="array":o(t)?r="string":t=s(t),i(e),_=function(){h=!0},"array"===r)return void u.call(t,function(t){if(l.call(e,m,t,_),h)return!0});if("string"!==r)for(c=t.next();!c.done;){if(l.call(e,m,c.value,_),h)return;c=t.next()}else for(d=t.length,p=0;p<d&&(f=t[p],p+1<d&&(y=f.charCodeAt(0),y>=55296&&y<=56319&&(f+=t[++p])),l.call(e,m,f,_),!h);++p);}},function(t,e,r){"use strict";var n=t(250),i=t(286),o=t(288),s=t(293),a=t(294),l=t(301).iterator;e.exports=function(t){return"function"==typeof a(t)[l]?t[l]():n(t)?new o(t):i(t)?new s(t):new o(t)}},function(t,e,r){"use strict";var n,i=t(245),o=t(263),s=t(280),a=t(282),l=t(244),u=t(243),c=t(301),_=Object.defineProperty,h=Object.defineProperties;e.exports=n=function(t,e){return this instanceof n?(h(this,{__list__:l("w",a(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),void(e&&(s(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear)))):new n(t,e)},h(n.prototype,o({constructor:l(n),_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 Iterator]"})},u({_onAdd:l(function(t){if(!(t>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void _(this,"__redo__",l("c",[t]));this.__redo__.forEach(function(e,r){e>=t&&(this.__redo__[r]=++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,r){e>t&&(this.__redo__[r]=--e)},this)))}),_onClear:l(function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0})}))),_(n.prototype,c.iterator,l(function(){return this})),_(n.prototype,c.toStringTag,l("","Iterator"))},function(t,e,r){"use strict";var n=t(250),i=t(286),o=t(301).iterator,s=Array.isArray;e.exports=function(t){return null!=t&&(!!s(t)||(!!i(t)||(!!n(t)||"function"==typeof t[o])))}},function(t,e,r){"use strict";var n,i=t(277),o=t(244),s=t(291),a=Object.defineProperty;n=e.exports=function(t){return this instanceof n?(t=String(t),s.call(this,t),void a(this,"__length__",o("",t.length))):new n(t)},i&&i(n,s),n.prototype=Object.create(s.prototype,{constructor:o(n),_next:o(function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()}),_resolve:o(function(t){var e,r=this.__list__[t];return this.__nextIndex__===this.__length__?r:(e=r.charCodeAt(0),e>=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r)}),toString:o(function(){return"[object String Iterator]"})})},function(t,e,r){"use strict";var n=t(292);e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},function(e,r,n){/*!
* @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 n(t){return"function"==typeof t||"object"==typeof t&&null!==t}function i(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 c(){var t=0,e=new $(p),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}function _(){var t=new MessageChannel;return t.port1.onmessage=p,function(){t.port2.postMessage(0)}}function h(){return function(){setTimeout(p,1)}}function p(){for(var t=0;t<W;t+=2){var e=tt[t],r=tt[t+1];e(r),tt[t]=void 0,tt[t+1]=void 0}W=0}function d(){try{var t=e,r=t("vertx");return U=r.runOnLoop||r.runOnContext,u()}catch(n){return h()}}function f(){}function y(){return new TypeError("You cannot resolve a promise with itself")}function m(){return new TypeError("A promises callback cannot return that same promise.")}function v(t){try{return t.then}catch(e){return it.error=e,it}}function g(t,e,r,n){try{t.call(e,r,n)}catch(i){return i}}function b(t,e,r){H(function(t){var n=!1,i=g(r,e,function(r){n||(n=!0,e!==r?k(t,r):S(t,r))},function(e){n||(n=!0,T(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,T(t,i))},t)}function w(t,e){e._state===rt?S(t,e._result):e._state===nt?T(t,e._result):O(e,void 0,function(e){k(t,e)},function(e){T(t,e)})}function x(t,e){if(e.constructor===t.constructor)w(t,e);else{var r=v(e);r===it?T(t,it.error):void 0===r?S(t,e):i(r)?b(t,e,r):S(t,e)}}function k(t,e){t===e?T(t,y()):n(e)?x(t,e):S(t,e)}function M(t){t._onerror&&t._onerror(t._result),P(t)}function S(t,e){t._state===et&&(t._result=e,t._state=rt,0!==t._subscribers.length&&H(P,t))}function T(t,e){t._state===et&&(t._state=nt,t._result=e,H(M,t))}function O(t,e,r,n){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+rt]=r,i[o+nt]=n,0===o&&t._state&&H(P,t)}function P(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,i,o=t._result,s=0;s<e.length;s+=3)n=e[s],i=e[s+r],n?E(r,n,i,o):i(o);t._subscribers.length=0}}function A(){this.error=null}function j(t,e){try{return t(e)}catch(r){return ot.error=r,ot}}function E(t,e,r,n){var o,s,a,l,u=i(r);if(u){if(o=j(r,n),o===ot?(l=!0,s=o.error,o=null):a=!0,e===o)return void T(e,m())}else o=n,a=!0;e._state!==et||(u&&a?k(e,o):l?T(e,s):t===rt?S(e,o):t===nt&&T(e,o))}function z(t,e){try{e(function(e){k(t,e)},function(e){T(t,e)})}catch(r){T(t,r)}}function C(t,e){var r=this;r._instanceConstructor=t,r.promise=new t(f),r._validateInput(e)?(r._input=e,r.length=e.length,r._remaining=e.length,r._init(),0===r.length?S(r.promise,r._result):(r.length=r.length||0,r._enumerate(),0===r._remaining&&S(r.promise,r._result))):T(r.promise,r._validationError())}function N(t){return new st(this,t).promise}function D(t){function e(t){k(i,t)}function r(t){T(i,t)}var n=this,i=new n(f);if(!X(t))return T(i,new TypeError("You must pass an array to race.")),i;for(var o=t.length,s=0;i._state===et&&s<o;s++)O(n.resolve(t[s]),void 0,e,r);return i}function F(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(f);return k(r,t),r}function I(t){var e=this,r=new e(f);return T(r,t),r}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=_t++,this._state=void 0,this._result=void 0,this._subscribers=[],f!==t&&(i(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 r=t.Promise;r&&"[object Promise]"===Object.prototype.toString.call(r.resolve())&&!r.cast||(t.Promise=ht)}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())}),Q="undefined"!=typeof window?window:void 0,J=Q||{},$=J.MutationObserver||J.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():$?c():K?_():void 0===Q&&"function"==typeof e?d():h();var et=void 0,rt=1,nt=2,it=new A,ot=new A;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,r=t.promise,n=t._input,i=0;r._state===et&&i<e;i++)t._eachEntry(n[i],i)},C.prototype._eachEntry=function(t,e){var r=this,n=r._instanceConstructor;o(t)?t.constructor===n&&t._state!==et?(t._onerror=null,r._settledAt(t._state,e,t._result)):r._willSettleAt(n.resolve(t),e):(r._remaining--,r._result[e]=t)},C.prototype._settledAt=function(t,e,r){var n=this,i=n.promise;i._state===et&&(n._remaining--,t===nt?T(i,r):n._result[e]=r),0===n._remaining&&S(i,n._result)},C.prototype._willSettleAt=function(t,e){var r=this;O(t,void 0,function(t){r._settledAt(rt,e,t)},function(t){r._settledAt(nt,e,t)})};var at=N,lt=D,ut=F,ct=I,_t=0,ht=L;L.all=at,L.race=lt,L.resolve=ut,L.reject=ct,L._setScheduler=s,L._setAsap=a,L._asap=H,L.prototype={constructor:L,then:function(t,e){var r=this,n=r._state;if(n===rt&&!t||n===nt&&!e)return this;var i=new this.constructor(f),o=r._result;if(n){var s=arguments[n-1];H(function(){E(n,i,s,o)})}else O(r,i,t,e);return i},"catch":function(t){return this.then(null,t)}};var pt=V,dt={Promise:ht,polyfill:pt};"function"==typeof t&&t.amd?t(function(){return dt}):"undefined"!=typeof r&&r.exports?r.exports=dt:"undefined"!=typeof this&&(this.ES6Promise=dt),pt()}).call(this)},function(t,e,r){"use strict";t(297)()||Object.defineProperty(t(253),"Set",{value:t(300),configurable:!0,enumerable:!1,writable:!0})},function(t,e,r){"use strict";e.exports=function(){var t,e,r;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(),r=e.next(),r.done===!1&&"raz"===r.value)))))))))))}},function(t,e,r){"use strict";e.exports=function(){return"undefined"!=typeof Set&&"[object Set]"===Object.prototype.toString.call(Set.prototype)}()},function(t,e,r){"use strict";var n,i=t(277),o=t(283),s=t(244),a=t(291),l=t(301).toStringTag,u=Object.defineProperty;n=e.exports=function(t,e){return this instanceof n?(a.call(this,t.__setData__,t),e=e&&o.call(e,"key+value")?"key+value":"value",void u(this,"__kind__",s("",e))):new n(t,e)},i&&i(n,a),n.prototype=Object.create(a.prototype,{constructor:s(n),_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(n.prototype,l,s("c","Set Iterator"))},function(t,e,r){"use strict";var n,i,o,s=t(245),a=t(246),l=t(277),u=t(280),c=t(244),_=t(310),h=t(301),p=t(294),d=t(289),f=t(299),y=t(298),m=Function.prototype.call,v=Object.defineProperty,g=Object.getPrototypeOf;y&&(o=Set),e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=y&&l?l(new o,g(this)):this,null!=e&&p(e),v(t,"__setData__",c("c",[])),e?(d(e,function(t){a.call(this,t)===-1&&this.push(t)},t.__setData__),t):t},y&&(l&&l(n,o),n.prototype=Object.create(o.prototype,{constructor:c(n)})),_(Object.defineProperties(n.prototype,{add:c(function(t){return this.has(t)?this:(this.emit("_add",this.__setData__.push(t)-1,t),this)}),clear:c(function(){this.__setData__.length&&(s.call(this.__setData__),this.emit("_clear"))}),"delete":c(function(t){var e=a.call(this.__setData__,t);return e!==-1&&(this.__setData__.splice(e,1),this.emit("_delete",e,t),!0)}),entries:c(function(){return new f(this,"key+value")}),forEach:c(function(t){var e,r,n,i=arguments[1];for(u(t),e=this.values(),r=e._next();void 0!==r;)n=e._resolve(r),m.call(t,i,n,n,this),r=e._next()}),has:c(function(t){return a.call(this.__setData__,t)!==-1}),keys:c(i=function(){return this.values()}),size:c.gs(function(){return this.__setData__.length}),values:c(function(){return new f(this)}),toString:c(function(){return"[object Set]"})})),v(n.prototype,h.iterator,c(i)),v(n.prototype,h.toStringTag,c("c","Set"))},function(t,e,r){"use strict";e.exports=t(302)()?Symbol:t(304)},function(t,e,r){"use strict";var n={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!!n[typeof Symbol.iterator]&&(!!n[typeof Symbol.toPrimitive]&&!!n[typeof Symbol.toStringTag])}},function(t,e,r){"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,r){"use strict";var n,i,o,s,a=t(244),l=t(305),u=Object.create,c=Object.defineProperties,_=Object.defineProperty,h=Object.prototype,p=u(null);if("function"==typeof Symbol){n=Symbol;try{String(n()),s=!0}catch(d){}}var f=function(){var t=u(null);return function(e){for(var r,n,i=0;t[e+(i||"")];)++i;return e+=i||"",t[e]=!0,r="@@"+e,_(h,r,a.gs(null,function(t){n||(n=!0,_(this,r,a(t)),n=!1)})),r}}();o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(t)},e.exports=i=function y(t){var e;if(this instanceof y)throw new TypeError("Symbol is not a constructor");return s?n(t):(e=u(o.prototype),t=void 0===t?"":String(t),c(e,{__description__:a("",t),__name__:a("",f(t))}))},c(i,{"for":a(function(t){return p[t]?p[t]:p[t]=i(String(t))}),keyFor:a(function(t){var e;l(t);for(e in p)if(p[e]===t)return e}),hasInstance:a("",n&&n.hasInstance||i("hasInstance")),isConcatSpreadable:a("",n&&n.isConcatSpreadable||i("isConcatSpreadable")),iterator:a("",n&&n.iterator||i("iterator")),match:a("",n&&n.match||i("match")),replace:a("",n&&n.replace||i("replace")),search:a("",n&&n.search||i("search")),species:a("",n&&n.species||i("species")),split:a("",n&&n.split||i("split")),toPrimitive:a("",n&&n.toPrimitive||i("toPrimitive")),toStringTag:a("",n&&n.toStringTag||i("toStringTag")),unscopables:a("",n&&n.unscopables||i("unscopables"))}),c(o.prototype,{constructor:a(i),toString:a("",function(){return this.__name__})}),c(i.prototype,{toString:a(function(){return"Symbol ("+l(this).__description__+")"}),valueOf:a(function(){return l(this)})}),_(i.prototype,i.toPrimitive,a("",function(){var t=l(this);return"symbol"==typeof t?t:t.toString()})),_(i.prototype,i.toStringTag,a("c","Symbol")),_(o.prototype,i.toStringTag,a("c",i.prototype[i.toStringTag])),_(o.prototype,i.toPrimitive,a("c",i.prototype[i.toPrimitive]))},function(t,e,r){"use strict";var n=t(303);e.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,r){"use strict";t(307)()||Object.defineProperty(t(253),"WeakMap",{value:t(309),configurable:!0,enumerable:!1,writable:!0})},function(t,e,r){"use strict";e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(r){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,r){"use strict";e.exports=function(){return"function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}()},function(t,e,r){"use strict";var n,i=t(277),o=t(281),s=t(282),a=t(287),l=t(244),u=t(290),c=t(289),_=t(301).toStringTag,h=t(308),p=Array.isArray,d=Object.defineProperty,f=Object.prototype.hasOwnProperty,y=Object.getPrototypeOf;e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=h&&i&&WeakMap!==n?i(new WeakMap,y(this)):this,null!=e&&(p(e)||(e=u(e))),d(t,"__weakMapData__",l("c","$weakMap$"+a())),e?(c(e,function(e){s(e),t.set(e[0],e[1])}),t):t},h&&(i&&i(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:l(n)})),Object.defineProperties(n.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(n.prototype,_,l("c","WeakMap"))},function(t,e,r){"use strict";var n,i,o,s,a,l,u,c=t(244),_=t(280),h=Function.prototype.apply,p=Function.prototype.call,d=Object.create,f=Object.defineProperty,y=Object.defineProperties,m=Object.prototype.hasOwnProperty,v={configurable:!0,enumerable:!1,writable:!0};n=function(t,e){var r;return _(e),m.call(this,"__ee__")?r=this.__ee__:(r=v.value=d(null),f(this,"__ee__",v),v.value=null),r[t]?"object"==typeof r[t]?r[t].push(e):r[t]=[r[t],e]:r[t]=e,this},i=function(t,e){var r,i;return _(e),i=this,n.call(this,t,r=function(){o.call(i,t,r),h.call(e,this,arguments)}),r.__eeOnceListener__=e,this},o=function(t,e){var r,n,i,o;if(_(e),!m.call(this,"__ee__"))return this;if(r=this.__ee__,!r[t])return this;if(n=r[t],"object"==typeof n)for(o=0;i=n[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===n.length?r[t]=n[o?0:1]:n.splice(o,1));else n!==e&&n.__eeOnceListener__!==e||delete r[t];return this},s=function(t){var e,r,n,i,o;if(m.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(r=arguments.length,o=new Array(r-1),e=1;e<r;++e)o[e-1]=arguments[e];for(i=i.slice(),e=0;n=i[e];++e)h.call(n,this,o)}else switch(arguments.length){case 1:p.call(i,this);break;case 2:p.call(i,this,arguments[1]);break;case 3:p.call(i,this,arguments[1],arguments[2]);break;default:for(r=arguments.length,o=new Array(r-1),e=1;e<r;++e)o[e-1]=arguments[e];h.call(i,this,o)}},a={on:n,once:i,off:o,emit:s},l={on:c(n),once:c(i),off:c(o),emit:c(s)},u=y({},l),e.exports=r=function(t){return null==t?d(u):y(Object(t),l)},r.methods=a},function(e,r,n){/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */
!function(e,n,i,o){"use strict";function s(t,e,r){return setTimeout(_(t,r),e)}function a(t,e,r){return!!Array.isArray(t)&&(l(t,r[e],r),!0)}function l(t,e,r){var n;if(t)if(t.forEach)t.forEach(e,r);else if(t.length!==o)for(n=0;n<t.length;)e.call(r,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(r,t[n],n,t)}function u(t,r,n){var i="DEPRECATED METHOD: "+r+"\n"+n+" AT \n";return function(){var r=new Error("get-stack-trace"),n=r&&r.stack?r.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,i,n),t.apply(this,arguments)}}function c(t,e,r){var n,i=e.prototype;n=t.prototype=Object.create(i),n.constructor=t,n._super=i,r&&pt(n,r)}function _(t,e){return function(){return t.apply(e,arguments)}}function h(t,e){return typeof t==yt?t.apply(e?e[0]||o:o,e):t}function p(t,e){return t===o?e:t}function d(t,e,r){l(v(e),function(e){t.addEventListener(e,r,!1)})}function f(t,e,r){l(v(e),function(e){t.removeEventListener(e,r,!1)})}function y(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function m(t,e){return t.indexOf(e)>-1}function v(t){return t.trim().split(/\s+/g)}function g(t,e,r){if(t.indexOf&&!r)return t.indexOf(e);for(var n=0;n<t.length;){if(r&&t[n][r]==e||!r&&t[n]===e)return n;n++}return-1}function b(t){return Array.prototype.slice.call(t,0)}function w(t,e,r){for(var n=[],i=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];g(i,s)<0&&n.push(t[o]),i[o]=s,o++}return r&&(n=e?n.sort(function(t,r){return t[e]>r[e]}):n.sort()),n}function x(t,e){for(var r,n,i=e[0].toUpperCase()+e.slice(1),s=0;s<dt.length;){if(r=dt[s],n=r?r+i:e,n in t)return n;s++}return o}function k(){return xt++}function M(t){var r=t.ownerDocument||t;return r.defaultView||r.parentWindow||e}function S(t,e){var r=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){h(t.options.enable,[t])&&r.handler(e)},this.init()}function T(t){var e,r=t.options.inputClass;return new(e=r?r:St?L:Tt?U:Mt?Y:R)(t,O)}function O(t,e,r){var n=r.pointers.length,i=r.changedPointers.length,o=e&zt&&n-i===0,s=e&(Nt|Dt)&&n-i===0;r.isFirst=!!o,r.isFinal=!!s,o&&(t.session={}),r.eventType=e,P(t,r),t.emit("hammer.input",r),t.recognize(r),t.session.prevInput=r}function P(t,e){var r=t.session,n=e.pointers,i=n.length;r.firstInput||(r.firstInput=E(e)),i>1&&!r.firstMultiple?r.firstMultiple=E(e):1===i&&(r.firstMultiple=!1);var o=r.firstInput,s=r.firstMultiple,a=s?s.center:o.center,l=e.center=z(n);e.timeStamp=gt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=F(a,l),e.distance=D(a,l),A(r,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=vt(u.x)>vt(u.y)?u.x:u.y,e.scale=s?B(s.pointers,n):1,e.rotation=s?I(s.pointers,n):0,e.maxPointers=r.prevInput?e.pointers.length>r.prevInput.maxPointers?e.pointers.length:r.prevInput.maxPointers:e.pointers.length,j(r,e);var c=t.element;y(e.srcEvent.target,c)&&(c=e.srcEvent.target),e.target=c}function A(t,e){var r=e.center,n=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};e.eventType!==zt&&o.eventType!==Nt||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=t.offsetDelta={x:r.x,y:r.y}),e.deltaX=i.x+(r.x-n.x),e.deltaY=i.y+(r.y-n.y)}function j(t,e){var r,n,i,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=Dt&&(l>Et||a.velocity===o)){var u=e.deltaX-a.deltaX,c=e.deltaY-a.deltaY,_=C(l,u,c);n=_.x,i=_.y,r=vt(_.x)>vt(_.y)?_.x:_.y,s=N(u,c),t.lastInterval=e}else r=a.velocity,n=a.velocityX,i=a.velocityY,s=a.direction;e.velocity=r,e.velocityX=n,e.velocityY=i,e.direction=s}function E(t){for(var e=[],r=0;r<t.pointers.length;)e[r]={clientX:mt(t.pointers[r].clientX),clientY:mt(t.pointers[r].clientY)},r++;return{timeStamp:gt(),pointers:e,center:z(e),deltaX:t.deltaX,deltaY:t.deltaY}}function z(t){var e=t.length;if(1===e)return{x:mt(t[0].clientX),y:mt(t[0].clientY)};for(var r=0,n=0,i=0;i<e;)r+=t[i].clientX,n+=t[i].clientY,i++;return{x:mt(r/e),y:mt(n/e)}}function C(t,e,r){return{x:e/t||0,y:r/t||0}}function N(t,e){return t===e?Ft:vt(t)>=vt(e)?t<0?It:Bt:e<0?Rt:Lt}function D(t,e,r){r||(r=qt);var n=e[r[0]]-t[r[0]],i=e[r[1]]-t[r[1]];return Math.sqrt(n*n+i*i)}function F(t,e,r){r||(r=qt);var n=e[r[0]]-t[r[0]],i=e[r[1]]-t[r[1]];return 180*Math.atan2(i,n)/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 r=b(t.touches),n=b(t.changedTouches);return e&(Nt|Dt)&&(r=w(r.concat(n),"identifier",!0)),[r,n]}function U(){this.evTarget=ne,this.targetIds={},S.apply(this,arguments)}function q(t,e){var r=b(t.touches),n=this.targetIds;if(e&(zt|Ct)&&1===r.length)return n[r[0].identifier]=!0,[r,r];var i,o,s=b(t.changedTouches),a=[],l=this.target;if(o=r.filter(function(t){return y(t.target,l)}),e===zt)for(i=0;i<o.length;)n[o[i].identifier]=!0,i++;for(i=0;i<s.length;)n[s[i].identifier]&&a.push(s[i]),e&(Nt|Dt)&&delete n[s[i].identifier],i++;return a.length?[w(o.concat(a),"identifier",!0),a]:void 0}function Y(){S.apply(this,arguments);var t=_(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 r={x:e.clientX,y:e.clientY};this.lastTouches.push(r);var n=this.lastTouches,i=function(){var t=n.indexOf(r);t>-1&&n.splice(t,1)};setTimeout(i,ie)}}function H(t){for(var e=t.srcEvent.clientX,r=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var i=this.lastTouches[n],o=Math.abs(e-i.x),s=Math.abs(r-i.y);if(o<=oe&&s<=oe)return!0}return!1}function Q(t,e){this.manager=t,this.set(e)}function J(t){if(m(t,_e))return _e;var e=m(t,he),r=m(t,pe);return e&&r?_e:e||r?e?he:pe:m(t,ce)?ce:ue}function $(){if(!ae)return!1;var t={},r=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(n){t[n]=!r||e.CSS.supports("touch-action",n)}),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&ve?"end":t&me?"move":t&ye?"start":""}function tt(t){return t==Lt?"down":t==Rt?"up":t==It?"left":t==Bt?"right":""}function et(t,e){var r=e.manager;return r?r.get(t):t}function rt(){Z.apply(this,arguments)}function nt(){rt.apply(this,arguments),this.pX=null,this.pY=null}function it(){rt.apply(this,arguments)}function ot(){Z.apply(this,arguments),this._timer=null,this._input=null}function st(){rt.apply(this,arguments)}function at(){rt.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 ct(t,e)}function ct(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 Q(this,this.options.touchAction),_t(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 _t(t,e){var r=t.element;if(r.style){var n;l(t.options.cssProps,function(i,o){n=x(r.style,o),e?(t.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=t.oldCssProps[n]||""}),e||(t.oldCssProps={})}}function ht(t,e){var r=n.createEvent("Event");r.initEvent(t,!0,!0),r.gesture=e,e.target.dispatchEvent(r)}var pt,dt=["","webkit","Moz","MS","ms","o"],ft=n.createElement("div"),yt="function",mt=Math.round,vt=Math.abs,gt=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),r=1;r<arguments.length;r++){var n=arguments[r];if(n!==o&&null!==n)for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])}return e}:Object.assign;var bt=u(function(t,e,r){for(var n=Object.keys(e),i=0;i<n.length;)(!r||r&&t[n[i]]===o)&&(t[n[i]]=e[n[i]]),i++;return t},"extend","Use `assign`."),wt=u(function(t,e){return bt(t,e,!0)},"merge","Use `assign`."),xt=1,kt=/mobile|tablet|ip(ad|hone|od)|android/i,Mt="ontouchstart"in e,St=x(e,"PointerEvent")!==o,Tt=Mt&&kt.test(navigator.userAgent),Ot="touch",Pt="pen",At="mouse",jt="kinect",Et=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";c(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:At,srcEvent:t}))}});var Qt={pointerdown:zt,pointermove:Ct,pointerup:Nt,pointercancel:Dt,pointerout:Dt},Jt={2:Ot,3:Pt,4:At,5:jt},$t="pointerdown",Zt="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&($t="MSPointerDown",Zt="MSPointerMove MSPointerUp MSPointerCancel"),c(L,S,{handler:function(t){var e=this.store,r=!1,n=t.type.toLowerCase().replace("ms",""),i=Qt[n],o=Jt[t.pointerType]||t.pointerType,s=o==Ot,a=g(e,t.pointerId,"pointerId");i&zt&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):i&(Nt|Dt)&&(r=!0),a<0||(e[a]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),r&&e.splice(a,1))}});var Kt={touchstart:zt,touchmove:Ct,touchend:Nt,touchcancel:Dt},te="touchstart",ee="touchstart touchmove touchend touchcancel";c(V,S,{handler:function(t){var e=Kt[t.type];if(e===zt&&(this.started=!0),this.started){var r=G.call(this,t,e);e&(Nt|Dt)&&r[0].length-r[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:r[0],changedPointers:r[1],pointerType:Ot,srcEvent:t})}}});var re={touchstart:zt,touchmove:Ct,touchend:Nt,touchcancel:Dt},ne="touchstart touchmove touchend touchcancel";c(U,S,{handler:function(t){var e=re[t.type],r=q.call(this,t,e);r&&this.callback(this.manager,e,{pointers:r[0],changedPointers:r[1],pointerType:Ot,srcEvent:t})}});var ie=2500,oe=25;c(Y,S,{handler:function(t,e,r){var n=r.pointerType==Ot,i=r.pointerType==At;if(!(i&&r.sourceCapabilities&&r.sourceCapabilities.firesTouchEvents)){if(n)X.call(this,e,r);else if(i&&H.call(this,r))return;this.callback(t,e,r)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var se=x(ft.style,"touchAction"),ae=se!==o,le="compute",ue="auto",ce="manipulation",_e="none",he="pan-x",pe="pan-y",de=$();Q.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){h(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),J(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,r=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var n=this.actions,i=m(n,_e)&&!de[_e],o=m(n,pe)&&!de[pe],s=m(n,he)&&!de[he];if(i){var a=1===t.pointers.length,l=t.distance<2,u=t.deltaTime<250;if(a&&l&&u)return}return s&&o?void 0:i||o&&r&Vt||s&&r&Gt?this.preventSrc(e):void 0},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var fe=1,ye=2,me=4,ve=8,ge=ve,be=16,we=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),g(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=g(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){r.manager.emit(e,t)}var r=this,n=this.state;n<ve&&e(r.options.event+K(n)),e(r.options.event),t.additionalEvent&&e(t.additionalEvent),n>=ve&&e(r.options.event+K(n))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=we)},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(we|fe)))return!1;t++}return!0},recognize:function(t){var e=pt({},t);return h(this.options.enable,[this,e])?(this.state&(ge|be|we)&&(this.state=fe),this.state=this.process(e),void(this.state&(ye|me|ve|be)&&this.tryEmit(e))):(this.reset(),void(this.state=we))},process:function(t){},getTouchAction:function(){},reset:function(){}},c(rt,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,r=t.eventType,n=e&(ye|me),i=this.attrTest(t);return n&&(r&Dt||!i)?e|be:n||i?r&Nt?e|ve:e&ye?e|me:ye:we}}),c(nt,rt,{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(he),e},directionTest:function(t){var e=this.options,r=!0,n=t.distance,i=t.direction,o=t.deltaX,s=t.deltaY;return i&e.direction||(e.direction&Vt?(i=0===o?Ft:o<0?It:Bt,r=o!=this.pX,n=Math.abs(t.deltaX)):(i=0===s?Ft:s<0?Rt:Lt,r=s!=this.pY,n=Math.abs(t.deltaY))),t.direction=i,r&&n>e.threshold&&i&e.direction},attrTest:function(t){return rt.prototype.attrTest.call(this,t)&&(this.state&ye||!(this.state&ye)&&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)}}),c(it,rt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[_e]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ye)},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)}}),c(ot,Z,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ue]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,n=t.distance<e.threshold,i=t.deltaTime>e.time;if(this._input=t,!n||!r||t.eventType&(Nt|Dt)&&!i)this.reset();else if(t.eventType&zt)this.reset(),this._timer=s(function(){this.state=ge,this.tryEmit()},e.time,this);else if(t.eventType&Nt)return ge;return we},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===ge&&(t&&t.eventType&Nt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=gt(),this.manager.emit(this.options.event,this._input)))}}),c(st,rt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[_e]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ye)}}),c(at,rt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Vt|Gt,pointers:1},getTouchAction:function(){return nt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,r=this.options.direction;return r&(Vt|Gt)?e=t.overallVelocity:r&Vt?e=t.overallVelocityX:r&Gt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&r&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&vt(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)}}),c(lt,Z,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ce]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,n=t.distance<e.threshold,i=t.deltaTime<e.time;if(this.reset(),t.eventType&zt&&0===this.count)return this.failTimeout();if(n&&i&&r){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=ge,this.tryEmit()},e.interval,this),ye):ge}return we},failTimeout:function(){return this._timer=s(function(){this.state=we},this.options.interval,this),we},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ge&&(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}],[it,{enable:!1},["rotate"]],[at,{direction:Vt}],[nt,{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 xe=1,ke=2;ct.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:xe},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var r,n=this.recognizers,i=e.curRecognizer;(!i||i&&i.state&ge)&&(i=e.curRecognizer=null);for(var o=0;o<n.length;)r=n[o],e.stopped===ke||i&&r!=i&&!r.canRecognizeWith(i)?r.reset():r.recognize(t),!i&&r.state&(ye|me|ve)&&(i=e.curRecognizer=r),o++}},get:function(t){if(t instanceof Z)return t;for(var e=this.recognizers,r=0;r<e.length;r++)if(e[r].options.event==t)return e[r];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,r=g(e,t);r!==-1&&(e.splice(r,1),this.touchAction.update())}return this},on:function(t,e){if(t!==o&&e!==o){var r=this.handlers;return l(v(t),function(t){r[t]=r[t]||[],r[t].push(e)}),this}},off:function(t,e){if(t!==o){var r=this.handlers;return l(v(t),function(t){e?r[t]&&r[t].splice(g(r[t],e),1):delete r[t]}),this}},emit:function(t,e){this.options.domEvents&&ht(t,e);var r=this.handlers[t]&&this.handlers[t].slice();if(r&&r.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var n=0;n<r.length;)r[n](e),n++}},destroy:function(){this.element&&_t(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:ye,STATE_CHANGED:me,STATE_ENDED:ve,STATE_RECOGNIZED:ge,STATE_CANCELLED:be,STATE_FAILED:we,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:ct,Input:S,TouchAction:Q,TouchInput:U,MouseInput:R,PointerEventInput:L,TouchMouseInput:Y,SingleTouchInput:V,Recognizer:Z,AttrRecognizer:rt,Tap:lt,Pan:nt,Swipe:at,Pinch:it,Rotate:st,Press:ot,on:d,off:f,each:l,merge:wt,extend:bt,assign:pt,inherit:c,bindFn:_,prefixed:x});var Me="undefined"!=typeof e?e:"undefined"!=typeof self?self:{};Me.Hammer=ut,"function"==typeof t&&t.amd?t(function(){return ut}):"undefined"!=typeof r&&r.exports?r.exports=ut:e[i]=ut}(window,document,"Hammer")},function(t,e,r){"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(r,"__esModule",{value:!0});var n,i=t(317);!function(t){t[t.Le=0]="Le",t[t.Ge=1]="Ge",t[t.Eq=2]="Eq"}(n=r.Operator||(r.Operator={}));var o=function(){function t(t,e,r){void 0===r&&(r=i.Strength.required),this._id=s++,this._operator=e,this._expression=t,this._strength=i.Strength.clip(r)}return t.Compare=function(t,e){return t.id-e.id},t.prototype.toString=function(){var t=this,e=function(){switch(t._operator){case n.Le:return"<=";case n.Ge:return">=";case n.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}();r.Constraint=o;var s=0},function(t,e,r){"use strict";function n(t){for(var e=0,r=function(){return 0},n=s.createMap(o.Variable.Compare),i=0,a=t.length;i<a;++i){var l=t[i];if("number"==typeof l)e+=l;else if(l instanceof o.Variable)n.setDefault(l,r).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],c=l[1];if("number"!=typeof u)throw new Error("array item 0 must be a number");if(!(c instanceof o.Variable))throw new Error("array item 1 must be a variable");n.setDefault(c,r).second+=u}}return{terms:n,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(r,"__esModule",{value:!0});var i=t(321),o=t(324),s=t(315),a=function(){function t(){var t=n(arguments);this._terms=t.terms,this._constant=t.constant}return t.prototype.toString=function(){var t=[];i.forEach(this._terms,function(e){t.push([e.first,e.second])});for(var e=!0,r="",n=0,o=t;n<o.length;n++){var s=o[n],a=s[0],l=s[1];e?(e=!1,r+=1==l?""+a:l==-1?"-"+a:l+"*"+a):r+=1==l?" + "+a:l==-1?" - "+a:l>=0?" + "+l+a:" - "+-l+a}var u=this.constant;return u<0?r+=" - "+-u:u>0&&(r+=" + "+u),r},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 i.forEach(this._terms,function(e){t+=e.first.value*e.second}),t},enumerable:!0,configurable:!0}),t}();r.Expression=a},function(t,e,r){"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 n(t){for(var e in t)r.hasOwnProperty(e)||(r[e]=t[e])}Object.defineProperty(r,"__esModule",{value:!0}),n(t(324)),n(t(313)),n(t(312)),n(t(317)),n(t(316))},function(t,e,r){"use strict";function n(t){return new i.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(r,"__esModule",{value:!0});var i=t(321);r.createMap=n},function(t,e,r){"use strict";function n(t){var e=1e-8;return t<0?-t<e:t<e}function i(){return h.createMap(c.Constraint.Compare)}function o(){return h.createMap(y.Compare)}function s(){return h.createMap(l.Variable.Compare)}function a(){return h.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(r,"__esModule",{value:!0});var l=t(324),u=t(313),c=t(312),_=t(317),h=t(315),p=t(321),d=function(){function t(){this._cnMap=i(),this._rowMap=o(),this._varMap=s(),this._editMap=a(),this._infeasibleRows=[],this._objective=new v,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 r=this._createRow(t),i=r.row,o=r.tag,s=this._chooseSubject(i,o);if(s.type()===f.Invalid&&i.allDummies()){if(!n(i.constant())){for(var a=[],l=0,u=t.expression.terms._array;l<u.length;l++){var c=u[l];a.push(c.first.name)}var _=["LE","GE","EQ"][t.op];throw new Error("unsatisfiable constraint ["+a.join(",")+"] operator: "+_)}s=o.marker}if(s.type()===f.Invalid){if(!this._addWithArtificialVariable(i))throw new Error("unsatisfiable constraint")}else i.solveFor(s),this._substitute(s,i),this._rowMap.insert(s,i);this._cnMap.insert(t,o),this._optimize(this._objective)},t.prototype.removeConstraint=function(t,e){void 0===e&&(e=!1);var r=this._cnMap.erase(t);if(void 0===r){if(e)return;throw new Error("unknown constraint")}this._removeConstraintEffects(t,r.second);var n=r.second.marker,i=this._rowMap.erase(n);if(void 0===i){var o=this._getMarkerLeavingSymbol(n);if(o.type()===f.Invalid)throw new Error("failed to find leaving row");i=this._rowMap.erase(o),i.second.solveForEx(o,n),this._substitute(n,i.second)}this._optimize(this._objective)},t.prototype.hasConstraint=function(t){return this._cnMap.contains(t)},t.prototype.addEditVariable=function(t,e){var r=this._editMap.find(t);if(void 0!==r)throw new Error("duplicate edit variable: "+t.name);if(e=_.Strength.clip(e),e===_.Strength.required)throw new Error("bad required strength");var n=new u.Expression(t),i=new c.Constraint(n,c.Operator.Eq,e);this.addConstraint(i);var o=this._cnMap.find(i).second,s={tag:o,constraint:i,constant:0};this._editMap.insert(t,s)},t.prototype.removeEditVariable=function(t,e){void 0===e&&(e=!1);var r=this._editMap.erase(t);if(void 0===r){if(e)return;throw new Error("unknown edit variable: "+t.name)}this.removeConstraint(r.second.constraint,e)},t.prototype.hasEditVariable=function(t){return this._editMap.contains(t)},t.prototype.suggestValue=function(t,e){var r=this._editMap.find(t);if(void 0===r)throw new Error("unknown edit variable: "+t.name);var n=this._rowMap,i=r.second,o=e-i.constant;i.constant=e;var s=i.tag.marker,a=n.find(s);if(void 0!==a)return a.second.add(-o)<0&&this._infeasibleRows.push(s),void this._dualOptimize();var l=i.tag.other;if(a=n.find(l),void 0!==a)return a.second.add(o)<0&&this._infeasibleRows.push(l),void this._dualOptimize();for(var u=0,c=n.size();u<c;++u){var _=n.itemAt(u),h=_.second,p=h.coefficientFor(s);0!==p&&h.add(o*p)<0&&_.first.type()!==f.External&&this._infeasibleRows.push(_.first)}this._dualOptimize()},t.prototype.updateVariables=function(){for(var t=this._varMap,e=this._rowMap,r=0,n=t.size();r<n;++r){var i=t.itemAt(r),o=e.find(i.second),s=0;void 0!==o&&(s=o.second.constant(),s===-0&&(s=0)),i.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,r=function(){return e._makeSymbol(f.External)};return this._varMap.setDefault(t,r).second},t.prototype._createRow=function(t){for(var e=t.expression,r=new v(e.constant),i=e.terms,o=0,s=i.size();o<s;++o){var a=i.itemAt(o);if(!n(a.second)){var l=this._getVarSymbol(a.first),u=this._rowMap.find(l);void 0!==u?r.insertRow(u.second,a.second):r.insertSymbol(l,a.second)}}var h=this._objective,p=t.strength,d={marker:m,other:m};switch(t.op){case c.Operator.Le:case c.Operator.Ge:var y=t.op===c.Operator.Le?1:-1,g=this._makeSymbol(f.Slack);if(d.marker=g,r.insertSymbol(g,y),p<_.Strength.required){var b=this._makeSymbol(f.Error);d.other=b,r.insertSymbol(b,-y),h.insertSymbol(b,p)}break;case c.Operator.Eq:if(p<_.Strength.required){var w=this._makeSymbol(f.Error),x=this._makeSymbol(f.Error);d.marker=w,d.other=x,r.insertSymbol(w,-1),r.insertSymbol(x,1),h.insertSymbol(w,p),h.insertSymbol(x,p)}else{var k=this._makeSymbol(f.Dummy);d.marker=k,r.insertSymbol(k)}}return r.constant()<0&&r.reverseSign(),{row:r,tag:d}},t.prototype._chooseSubject=function(t,e){for(var r=t.cells(),n=0,i=r.size();n<i;++n){var o=r.itemAt(n);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:m)},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 r=n(this._artificial.constant());this._artificial=null;var i=this._rowMap.erase(e);if(void 0!==i){var o=i.second;if(o.isConstant())return r;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),r},t.prototype._substitute=function(t,e){for(var r=this._rowMap,n=0,i=r.size();n<i;++n){var o=r.itemAt(n);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 r=this._getLeavingSymbol(e);if(r.type()===f.Invalid)throw new Error("the objective is unbounded");var n=this._rowMap.erase(r).second;n.solveForEx(r,e),this._substitute(e,n),this._rowMap.insert(e,n)}},t.prototype._dualOptimize=function(){for(var t=this._rowMap,e=this._infeasibleRows;0!==e.length;){var r=e.pop(),n=t.find(r);if(void 0!==n&&n.second.constant()<0){var i=this._getDualEnteringSymbol(n.second);if(i.type()===f.Invalid)throw new Error("dual optimize failed");var o=n.second;t.erase(r),o.solveForEx(r,i),this._substitute(i,o),t.insert(i,o)}}},t.prototype._getEnteringSymbol=function(t){for(var e=t.cells(),r=0,n=e.size();r<n;++r){var i=e.itemAt(r),o=i.first;if(i.second<0&&o.type()!==f.Dummy)return o}return m},t.prototype._getDualEnteringSymbol=function(t){for(var e=Number.MAX_VALUE,r=m,n=t.cells(),i=0,o=n.size();i<o;++i){var s=n.itemAt(i),a=s.first,l=s.second;if(l>0&&a.type()!==f.Dummy){var u=this._objective.coefficientFor(a),c=u/l;c<e&&(e=c,r=a)}}return r},t.prototype._getLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,r=m,n=this._rowMap,i=0,o=n.size();i<o;++i){var s=n.itemAt(i),a=s.first;if(a.type()!==f.External){var l=s.second,u=l.coefficientFor(t);if(u<0){var c=-l.constant()/u;c<e&&(e=c,r=a)}}}return r},t.prototype._getMarkerLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,r=e,n=e,i=m,o=i,s=i,a=i,l=this._rowMap,u=0,c=l.size();u<c;++u){var _=l.itemAt(u),h=_.second,p=h.coefficientFor(t);if(0!==p){var d=_.first;if(d.type()===f.External)a=d;else if(p<0){var y=-h.constant()/p;y<r&&(r=y,o=d)}else{var y=h.constant()/p;y<n&&(n=y,s=d)}}}return o!==i?o:s!==i?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 r=this._rowMap.find(t);void 0!==r?this._objective.insertRow(r.second,-e):this._objective.insertSymbol(t,-e)},t.prototype._anyPivotableSymbol=function(t){for(var e=t.cells(),r=0,n=e.size();r<n;++r){var i=e.itemAt(r),o=i.first.type();if(o===f.Slack||o===f.Error)return i.first}return m},t.prototype._makeSymbol=function(t){return new y(t,(this._idTick++))},t}();r.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 y=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}(),m=new y(f.Invalid,(-1)),v=function(){function t(t){void 0===t&&(t=0),this._cellMap=h.createMap(y.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,r=t.size();e<r;++e){var n=t.itemAt(e);if(n.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 r=this._cellMap.setDefault(t,function(){return 0});n(r.second+=e)&&this._cellMap.erase(t)},t.prototype.insertRow=function(t,e){void 0===e&&(e=1),this._constant+=t._constant*e;for(var r=t._cellMap,n=0,i=r.size();n<i;++n){var o=r.itemAt(n);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,r=t.size();e<r;++e){var n=t.itemAt(e);n.second=-n.second}},t.prototype.solveFor=function(t){var e=this._cellMap,r=e.erase(t),n=-1/r.second;this._constant*=n;for(var i=0,o=e.size();i<o;++i)e.itemAt(i).second*=n},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 r=this._cellMap.erase(t);void 0!==r&&this.insertRow(e,r.second)},t}()},function(t,e,r){"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(r,"__esModule",{value:!0});var n;!function(t){function e(t,e,r,n){void 0===n&&(n=1);var i=0;return i+=1e6*Math.max(0,Math.min(1e3,t*n)),i+=1e3*Math.max(0,Math.min(1e3,e*n)),i+=Math.max(0,Math.min(1e3,r*n))}function r(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=r}(n=r.Strength||(r.Strength={}))},function(t,e,r){"use strict";function n(t,e,r){for(var n,i,o=0,s=t.length;s>0;)n=s>>1,i=o+n,r(t[i],e)<0?(o=i+1,s-=n+1):s=n;return o}function i(t,e,r){var i=n(t,e,r);if(i===t.length)return-1;var o=t[i];return 0!==r(o,e)?-1:i}function o(t,e,r){var i=n(t,e,r);if(i!==t.length){var o=t[i];if(0===r(o,e))return o}}function s(t,e){var r=p.asArray(t),n=r.length;if(n<=1)return r;r.sort(e);for(var i=[r[0]],o=1,s=0;o<n;++o){var a=r[o];0!==e(i[s],a)&&(i.push(a),++s)}return i}function a(t,e,r){for(var n=0,i=0,o=t.length,s=e.length;n<o&&i<s;){var a=r(t[n],e[i]);if(a<0)++n;else{if(!(a>0))return!1;++i}}return!0}function l(t,e,r){var n=t.length,i=e.length;if(n>i)return!1;for(var o=0,s=0;o<n&&s<i;){var a=r(t[o],e[s]);if(a<0)return!1;a>0?++s:(++o,++s)}return!(o<n)}function u(t,e,r){for(var n=0,i=0,o=t.length,s=e.length,a=[];n<o&&i<s;){var l=t[n],u=e[i],c=r(l,u);c<0?(a.push(l),++n):c>0?(a.push(u),++i):(a.push(l),++n,++i)}for(;n<o;)a.push(t[n]),++n;for(;i<s;)a.push(e[i]),++i;return a}function c(t,e,r){for(var n=0,i=0,o=t.length,s=e.length,a=[];n<o&&i<s;){var l=t[n],u=e[i],c=r(l,u);c<0?++n:c>0?++i:(a.push(l),++n,++i)}return a}function _(t,e,r){for(var n=0,i=0,o=t.length,s=e.length,a=[];n<o&&i<s;){var l=t[n],u=e[i],c=r(l,u);c<0?(a.push(l),++n):c>0?++i:(++n,++i)}for(;n<o;)a.push(t[n]),++n;return a}function h(t,e,r){for(var n=0,i=0,o=t.length,s=e.length,a=[];n<o&&i<s;){var l=t[n],u=e[i],c=r(l,u);c<0?(a.push(l),++n):c>0?(a.push(u),++i):(++n,++i)}for(;n<o;)a.push(t[n]),++n;for(;i<s;)a.push(e[i]),++i;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(r,"__esModule",{value:!0});var p=t(322);r.lowerBound=n,r.binarySearch=i,r.binaryFind=o,r.asSet=s,r.setIsDisjoint=a,r.setIsSubset=l,r.setUnion=u,r.setIntersection=c,r.setDifference=_,r.setSymmetricDifference=h},function(t,e,r){"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(r,"__esModule",{value:!0});var n=t(322),i=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 n.iter(this._array)},t.prototype.__reversed__=function(){return n.reversed(this._array)},t}();r.ArrayBase=i},function(t,e,r){"use strict";function n(t){return function(e,r){return t(e.first,r)}}function i(t,e,r){for(var n=0,i=0,o=t.length,s=e.length,a=[];n<o&&i<s;){var l=t[n],u=e[i],c=r(l.first,u.first);c<0?(a.push(l.copy()),++n):c>0?(a.push(u.copy()),++i):(a.push(u.copy()),++n,++i)}for(;n<o;)a.push(t[n].copy()),++n;for(;i<s;)a.push(e[i].copy()),++i;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 r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=t(323),a=t(319),l=t(318),u=t(322),c=function(t){function e(e){var r=t.call(this)||this;return r._compare=e,r._wrapped=n(e),r}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 r=this._array,n=l.lowerBound(r,t,this._wrapped);if(n===r.length){var i=new s.Pair(t,e());return r.push(i),i}var o=r[n];if(0!==this._compare(o.first,t)){var i=new s.Pair(t,e());return r.splice(n,0,i),i}return o},e.prototype.insert=function(t,e){var r=this._array,n=l.lowerBound(r,t,this._wrapped);if(n===r.length){var i=new s.Pair(t,e);return r.push(i),i}var o=r[n];if(0!==this._compare(o.first,t)){var i=new s.Pair(t,e);return r.splice(n,0,i),i}return o.second=e,o},e.prototype.update=function(t){var r=this;t instanceof e?this._array=i(this._array,t._array,this._compare):u.forEach(t,function(t){r.insert(t.first,t.second)})},e.prototype.erase=function(t){var e=this._array,r=l.binarySearch(e,t,this._wrapped);if(!(r<0))return e.splice(r,1)[0]},e.prototype.copy=function(){for(var t=new e(this._compare),r=t._array,n=this._array,i=0,o=n.length;i<o;++i)r.push(n[i].copy());return t},e}(a.ArrayBase);r.AssociativeArray=c},function(t,e,r){"use strict";function n(t){for(var e in t)r.hasOwnProperty(e)||(r[e]=t[e])}Object.defineProperty(r,"__esModule",{value:!0}),n(t(318)),n(t(319)),n(t(320)),n(t(322)),n(t(323))},function(t,e,r){"use strict";function n(t){return t instanceof Array?new c(t):t.__iter__()}function i(t){return t instanceof Array?new _(t):t.__reversed__()}function o(t){return t.__next__()}function s(t){if(t instanceof Array)return t.slice();for(var e,r=[],n=t.__iter__();void 0!==(e=n.__next__());)r.push(e);return r}function a(t,e){if(t instanceof Array){for(var r=0,n=t.length;r<n;++r)if(e(t[r])===!1)return}else for(var i,o=t.__iter__();void 0!==(i=o.__next__());)if(e(i)===!1)return}function l(t,e){var r=[];if(t instanceof Array)for(var n=0,i=t.length;n<i;++n)r.push(e(t[n]));else for(var o,s=t.__iter__();void 0!==(o=s.__next__());)r.push(e(o));return r}function u(t,e){var r,n=[];if(t instanceof Array)for(var i=0,o=t.length;i<o;++i)r=t[i],e(r)&&n.push(r);else for(var s=t.__iter__();void 0!==(r=s.__next__());)e(r)&&n.push(r);return n}/*-----------------------------------------------------------------------------
| 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(r,"__esModule",{value:!0});var c=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}();r.ArrayIterator=c;var _=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}();r.ReverseArrayIterator=_,r.iter=n,r.reversed=i,r.next=o,r.asArray=s,r.forEach=a,r.map=l,r.filter=u},function(t,e,r){"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(r,"__esModule",{value:!0});var n=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.copy=function(){return new t(this.first,this.second)},t}();r.Pair=n},function(t,e,r){"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(r,"__esModule",{value:!0});var n=function(){function t(t){void 0===t&&(t=""),this._value=0,this._context=null,this._id=i++,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}();r.Variable=n;var i=0},function(t,e,r){function n(t){this._value=t}function i(t){var e,r="";for(e=0;e<t;e++)r+="0";return r}function o(t,e){var r,n,o,s,a;return a=t.toString(),r=a.split("e")[0],s=a.split("e")[1],n=r.split(".")[0],o=r.split(".")[1]||"",a=n+o+i(s-o.length),e>0&&(a+="."+i(e)),a}function s(t,e,r,n){var i,s,a=Math.pow(10,e);return s=t.toFixed(0).search("e")>-1?o(t,e):(r(t*a)/a).toFixed(e),n&&(i=new RegExp("0{1,"+n+"}$"),s=s.replace(i,"")),s}function a(t,e,r){var n;return n=e.indexOf("$")>-1?l(t,e,r):e.indexOf("%")>-1?u(t,e,r):e.indexOf(":")>-1?c(t):_(t,e,r)}function l(t,e,r){var n,i,o=e,s=o.indexOf("$"),a=o.indexOf("("),l=o.indexOf("+"),u=o.indexOf("-"),c="",h="";if(o.indexOf("$")===-1?"infix"===m[g].currency.position?(h=m[g].currency.symbol,m[g].currency.spaceSeparated&&(h=" "+h+" ")):m[g].currency.spaceSeparated&&(c=" "):o.indexOf(" $")>-1?(c=" ",o=o.replace(" $","")):o.indexOf("$ ")>-1?(c=" ",o=o.replace("$ ","")):o=o.replace("$",""),i=_(t,o,r,h),e.indexOf("$")===-1)switch(m[g].currency.position){case"postfix":i.indexOf(")")>-1?(i=i.split(""),i.splice(-1,0,c+m[g].currency.symbol),i=i.join("")):i=i+c+m[g].currency.symbol;break;case"infix":break;case"prefix":i.indexOf("(")>-1||i.indexOf("-")>-1?(i=i.split(""),n=Math.max(a,u)+1,i.splice(n,0,m[g].currency.symbol+c),i=i.join("")):i=m[g].currency.symbol+c+i;break;default:throw Error('Currency position should be among ["prefix", "infix", "postfix"]')}else s<=1?i.indexOf("(")>-1||i.indexOf("+")>-1||i.indexOf("-")>-1?(i=i.split(""),n=1,(s<a||s<l||s<u)&&(n=0),i.splice(n,0,m[g].currency.symbol+c),i=i.join("")):i=m[g].currency.symbol+c+i:i.indexOf(")")>-1?(i=i.split(""),i.splice(-1,0,c+m[g].currency.symbol),i=i.join("")):i=i+c+m[g].currency.symbol;return i}function u(t,e,r){var n,i="";return t=100*t,e.indexOf(" %")>-1?(i=" ",e=e.replace(" %","")):e=e.replace("%",""),n=_(t,e,r),n.indexOf(")")>-1?(n=n.split(""),n.splice(-1,0,i+"%"),n=n.join("")):n=n+i+"%",n}function c(t){var e=Math.floor(t/60/60),r=Math.floor((t-60*e*60)/60),n=Math.round(t-60*e*60-60*r);return e+":"+(r<10?"0"+r:r)+":"+(n<10?"0"+n:n)}function _(t,e,r,n){var i,o,a,l,u,c,_,h,p,d,f,y,v,w,x,k,M,S,T=!1,O=!1,P=!1,A="",j=!1,E=!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 "}"');y=e.slice(1,q),e=e.slice(q+1)}else y="";if(e.indexOf("}")===e.length-1){var Y=e.indexOf("{");if(Y===-1)throw Error('Format should also contain a "{"');v=e.slice(Y+1,-1),e=e.slice(0,Y+1)}else v="";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,E=e.indexOf("aM")>=0,z=e.indexOf("aB")>=0,C=e.indexOf("aT")>=0,N=j||E||z||C,e.indexOf(" a")>-1?(A=" ",e=e.replace(" a","")):e=e.replace("a",""),u=Math.floor(Math.log(I)/Math.LN10)+1,_=u%3,_=0===_?3:_,d&&0!==I&&(c=Math.floor(Math.log(I)/Math.LN10)+1-d,h=3*~~((Math.min(d,u)-_)/3),I/=Math.pow(10,h),e.indexOf(".")===-1&&d>3))for(e+="[.]",k=0===c?0:3*~~(c/3)-c,k=k<0?k+3:k,i=0;i<k;i++)e+="0";Math.floor(Math.log(Math.abs(t))/Math.LN10)+1!==d&&(I>=Math.pow(10,12)&&!N||C?(A+=m[g].abbreviations.trillion,t/=Math.pow(10,12)):I<Math.pow(10,12)&&I>=Math.pow(10,9)&&!N||z?(A+=m[g].abbreviations.billion,t/=Math.pow(10,9)):I<Math.pow(10,9)&&I>=Math.pow(10,6)&&!N||E?(A+=m[g].abbreviations.million,t/=Math.pow(10,6)):(I<Math.pow(10,6)&&I>=Math.pow(10,3)&&!N||j)&&(A+=m[g].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",""),m[g].ordinal&&(F+=m[g].ordinal(t))),e.indexOf("[.]")>-1&&(P=!0,e=e.replace("[.]",".")),p=t.toString().split(".")[0],f=e.split(".")[1],w=e.indexOf(","),f){if(f.indexOf("*")!==-1?L=s(t,t.toString().split(".")[1].length,r):f.indexOf("[")>-1?(f=f.replace("]",""),f=f.split("["),L=s(t,f[0].length+f[1].length,r,f[1].length)):L=s(t,f.length,r),p=L.split(".")[0],L.split(".")[1].length){var W=n?A+n:m[g].delimiters.decimal;L=W+L.split(".")[1]}else L="";P&&0===Number(L.slice(1))&&(L="")}else p=s(t,null,r);return p.indexOf("-")>-1&&(p=p.slice(1),G=!0),p.length<S&&(p=new Array(S-p.length+1).join("0")+p),w>-1&&(p=p.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[g].delimiters.thousands)),0===e.indexOf(".")&&(p=""),x=e.indexOf("("),M=e.indexOf("-"),U=x<M?(T&&G?"(":"")+(V&&G||!T&&G?"-":""):(V&&G||!T&&G?"-":"")+(T&&G?"(":""),y+U+(!G&&O&&0!==t?"+":"")+p+L+(F?F:"")+(A&&!n?A:"")+(D?D:"")+(T&&G?")":"")+v}function h(t,e){m[t]=e}function p(t){g=t;var e=m[t].defaults;e&&e.format&&f.defaultFormat(e.format),e&&e.currencyFormat&&f.defaultCurrencyFormat(e.currencyFormat)}function d(t,e,r,n){return null!=r&&r!==f.culture()&&f.setCulture(r),a(Number(t),null!=e?e:w,null==n?Math.round:n)}/*!
* numbro.js
* version : 1.6.2
* author : Företagsplatsen AB
* license : MIT
* http://www.foretagsplatsen.se
*/
var f,y="1.6.2",m={},v=m,g="en-US",b=null,w="0,0",x="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 n(Number(t))},f.version=y,f.isNumbro=function(t){return t instanceof n},f.setLanguage=function(t,e){console.warn("`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead");var r=t,n=t.split("-")[0],i=null;v[r]||(Object.keys(v).forEach(function(t){i||t.split("-")[0]!==n||(i=t)}),r=i||e||"en-US"),p(r)},f.setCulture=function(t,e){var r=t,n=t.split("-")[1],i=null;m[r]||(n&&Object.keys(m).forEach(function(t){i||t.split("-")[1]!==n||(i=t)}),r=i||e||"en-US"),p(r)},f.language=function(t,e){if(console.warn("`language` is deprecated since version 1.6.0. Use `culture` instead"),!t)return g;if(t&&!e){if(!v[t])throw new Error("Unknown language : "+t);p(t)}return!e&&v[t]||h(t,e),f},f.culture=function(t,e){if(!t)return g;if(t&&!e){if(!m[t])throw new Error("Unknown culture : "+t);p(t)}return!e&&m[t]||h(t,e),f},f.languageData=function(t){if(console.warn("`languageData` is deprecated since version 1.6.0. Use `cultureData` instead"),!t)return v[g];if(!v[t])throw new Error("Unknown language : "+t);return v[t]},f.cultureData=function(t){if(!t)return m[g];if(!m[t])throw new Error("Unknown culture : "+t);return m[t]},f.culture("en-US",k),f.languages=function(){return console.warn("`languages` is deprecated since version 1.6.0. Use `cultures` instead"),v},f.cultures=function(){return m},f.zeroFormat=function(t){b="string"==typeof t?t:null},f.defaultFormat=function(t){w="string"==typeof t?t:"0.0"},f.defaultCurrencyFormat=function(t){x="string"==typeof t?t:"0$"},f.validate=function(t,e){var r,n,i,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(c){l=f.cultureData(f.culture())}return i=l.currency.symbol,s=l.abbreviations,r=l.delimiters.decimal,n="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,u=t.match(/^[^\d]+/),(null===u||(t=t.substr(1),u[0]===i))&&(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(n+"{2}"),!t.match(/[^\d.,]/g)&&(o=t.split(r),!(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,r){function n(t,e){if(!(this instanceof n))return new n(t);e=e||function(t){if(t)throw t};var r=i(t);if("object"!=typeof r)return void e(t);var s=n.projections.get(r.projName);if(!s)return void e(t);if(r.datumCode&&"none"!==r.datumCode){var c=l[r.datumCode];c&&(r.datum_params=c.towgs84?c.towgs84.split(","):null,r.ellps=c.ellipse,r.datumName=c.datumName?c.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu";var _=a.sphere(r.a,r.b,r.rf,r.ellps,r.sphere),h=a.eccentricity(_.a,_.b,_.rf,r.R_A),p=r.datum||u(r.datumCode,r.datum_params,_.a,_.b,h.es,h.ep2);o(this,r),o(this,s),this.a=_.a,this.b=_.b,this.rf=_.rf,this.sphere=_.sphere,this.es=h.es,this.e=h.e,this.ep2=h.ep2,this.datum=p,this.init(),e(null,this)}var i=t(346),o=t(344),s=t(348),a=t(343),l=t(334),u=t(339);n.projections=s,n.projections.start(),e.exports=n},function(t,e,r){e.exports=function(t,e,r){var n,i,o,s=r.x,a=r.y,l=r.z||0,u={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==r.z)switch(0===o?(n=s,i="x"):1===o?(n=a,i="y"):(n=l,i="z"),t.axis[o]){case"e":u[i]=n;break;case"w":u[i]=-n;break;case"n":u[i]=n;break;case"s":u[i]=-n;break;case"u":void 0!==r[i]&&(u.z=n);break;case"d":void 0!==r[i]&&(u.z=-n);break;default:return null}return u}},function(t,e,r){var n=2*Math.PI,i=3.14159265359,o=t(331);e.exports=function(t){return Math.abs(t)<=i?t:t-o(t)*n}},function(t,e,r){e.exports=function(t,e,r){var n=t*e;return r/Math.sqrt(1-n*n)}},function(t,e,r){var n=Math.PI/2;e.exports=function(t,e){for(var r,i,o=.5*t,s=n-2*Math.atan(e),a=0;a<=15;a++)if(r=t*Math.sin(s),i=n-2*Math.atan(e*Math.pow((1-r)/(1+r),o))-s,s+=i,Math.abs(i)<=1e-10)return s;return-9999}},function(t,e,r){e.exports=function(t){return t<0?-1:1}},function(t,e,r){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,r){var n=Math.PI/2;e.exports=function(t,e,r){var i=t*r,o=.5*t;return i=Math.pow((1-i)/(1+i),o),Math.tan(.5*(n-e))/i}},function(t,e,r){r.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},r.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},r.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},r.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},r.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},r.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},r.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},r.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},r.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},r.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},r.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},r.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},r.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},r.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},r.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},r.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,r){r.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},r.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},r.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},r.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},r.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},r.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},r.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},r.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},r.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},r.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},r.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},r.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},r.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},r.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},r.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},r.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},r.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},r.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},r.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},r.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},r.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},r.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},r.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},r.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},r.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},r.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},r.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},r.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},r.hough={a:6378270,rf:297,ellipseName:"Hough"},r.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},r.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},r.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},r.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},r.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},r.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},r.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},r.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},r.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},r.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},r.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},r.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"},r.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"},r.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},function(t,e,r){r.greenwich=0,r.lisbon=-9.131906111111,r.paris=2.337229166667,r.bogota=-74.080916666667,r.madrid=-3.687938888889,r.rome=12.452333333333,r.bern=7.439583333333,r.jakarta=106.807719444444,r.ferro=-17.666666666667,r.brussels=4.367975,r.stockholm=18.058277777778,r.athens=23.7163375,r.oslo=10.722916666667},function(t,e,r){r.ft={to_meter:.3048},r["us-ft"]={to_meter:1200/3937}},function(t,e,r){function n(t,e,r){var n;return Array.isArray(r)?(n=a(t,e,r),3===r.length?[n.x,n.y,n.z]:[n.x,n.y]):a(t,e,r)}function i(t){return t instanceof s?t:t.oProj?t.oProj:s(t)}function o(t,e,r){t=i(t);var o,s=!1;return"undefined"==typeof e?(e=t,t=l,s=!0):("undefined"!=typeof e.x||Array.isArray(e))&&(r=e,e=t,t=l,s=!0),e=i(e),r?n(t,e,r):(o={forward:function(r){return n(t,e,r)},inverse:function(r){return n(e,t,r)}},s&&(o.oProj=e),o)}var s=t(326),a=t(351),l=s("WGS84");e.exports=o},function(t,e,r){function n(t,e,r,n,u,c){var _={};return _.datum_type=s,t&&"none"===t&&(_.datum_type=a),e&&(_.datum_params=e.map(parseFloat),0===_.datum_params[0]&&0===_.datum_params[1]&&0===_.datum_params[2]||(_.datum_type=i),_.datum_params.length>3&&(0===_.datum_params[3]&&0===_.datum_params[4]&&0===_.datum_params[5]&&0===_.datum_params[6]||(_.datum_type=o,_.datum_params[3]*=l,_.datum_params[4]*=l,_.datum_params[5]*=l,_.datum_params[6]=_.datum_params[6]/1e6+1))),_.a=r,_.b=n,_.es=u,_.ep2=c,_}var i=1,o=2,s=4,a=5,l=484813681109536e-20;e.exports=n},function(t,e,r){"use strict";var n=1,i=2,o=Math.PI/2;r.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===n?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!==i||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]))},r.geodeticToGeocentric=function(t,e,r){var n,i,s,a,l=t.x,u=t.y,c=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),i=Math.sin(u),a=Math.cos(u),s=i*i,n=r/Math.sqrt(1-e*s),{x:(n+c)*a*Math.cos(l),y:(n+c)*a*Math.sin(l),z:(n*(1-e)+c)*i}},r.geocentricToGeodetic=function(t,e,r,n){var i,s,a,l,u,c,_,h,p,d,f,y,m,v,g,b,w=1e-12,x=w*w,k=30,M=t.x,S=t.y,T=t.z?t.z:0;if(i=Math.sqrt(M*M+S*S),s=Math.sqrt(M*M+S*S+T*T),i/r<w){if(v=0,s/r<w)return g=o,b=-n,{x:t.x,y:t.y,z:t.z}}else v=Math.atan2(S,M);a=T/s,l=i/s,u=1/Math.sqrt(1-e*(2-e)*l*l),h=l*(1-e)*u,p=a*u,m=0;do m++,_=r/Math.sqrt(1-e*p*p),b=i*h+T*p-_*(1-e*p*p),c=e*_/(_+b),u=1/Math.sqrt(1-c*(2-c)*l*l),d=l*(1-c)*u,f=a*u,y=f*h-d*p,h=d,p=f;while(y*y>x&&m<k);return g=Math.atan(f/Math.abs(d)),{x:v,y:g,z:b}},r.geocentricToWgs84=function(t,e,r){if(e===n)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===i){var o=r[0],s=r[1],a=r[2],l=r[3],u=r[4],c=r[5],_=r[6];return{x:_*(t.x-c*t.y+u*t.z)+o,y:_*(c*t.x+t.y-l*t.z)+s,z:_*(-u*t.x+l*t.y+t.z)+a}}},r.geocentricFromWgs84=function(t,e,r){if(e===n)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===i){var o=r[0],s=r[1],a=r[2],l=r[3],u=r[4],c=r[5],_=r[6],h=(t.x-o)/_,p=(t.y-s)/_,d=(t.z-a)/_;return{x:h+c*p-u*d,y:-c*h+p+l*d,z:u*h-l*p+d}}}},function(t,e,r){function n(t){return t===i||t===o}var i=1,o=2,s=5,a=t(340);e.exports=function(t,e,r){return a.compareDatums(t,e)?r:t.datum_type===s||e.datum_type===s?r:t.es!==e.es||t.a!==e.a||n(t.datum_type)||n(e.datum_type)?(r=a.geodeticToGeocentric(r,t.es,t.a),n(t.datum_type)&&(r=a.geocentricToWgs84(r,t.datum_type,t.datum_params)),n(e.datum_type)&&(r=a.geocentricFromWgs84(r,e.datum_type,e.datum_params)),a.geocentricToGeodetic(r,e.es,e.a,e.b)):r}},function(t,e,r){function n(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?n[t]=o(arguments[1]):n[t]=s(arguments[1]):n[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?n.apply(e,t):n(t)});if("string"==typeof t){if(t in n)return n[t]}else"EPSG"in t?n["EPSG:"+t.EPSG]=t:"ESRI"in t?n["ESRI:"+t.ESRI]=t:"IAU2000"in t?n["IAU2000:"+t.IAU2000]=t:console.log(t);return}}var i=t(345),o=t(347),s=t(352);i(n),e.exports=n},function(t,e,r){var n=.16666666666666666,i=.04722222222222222,o=.022156084656084655,s=1e-10,a=t(335);r.eccentricity=function(t,e,r,s){var a=t*t,l=e*e,u=(a-l)/a,c=0;s?(t*=1-u*(n+u*(i+u*o)),a=t*t,u=0):c=Math.sqrt(u);var _=(a-l)/l;return{es:u,e:c,ep2:_}},r.sphere=function(t,e,r,n,i){if(!t){var o=a[n];o||(o=a.WGS84),t=o.a,e=o.b,r=o.rf}return r&&!e&&(e=(1-1/r)*t),(0===r||Math.abs(t-e)<s)&&(i=!0,e=t),{a:t,b:e,rf:r,sphere:i}}},function(t,e,r){e.exports=function(t,e){t=t||{};var r,n;if(!e)return t;for(n in e)r=e[n],void 0!==r&&(t[n]=r);return t}},function(t,e,r){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,r){function n(t){return"string"==typeof t}function i(t){return t in l}function o(t){return _.some(function(e){return t.indexOf(e)>-1})}function s(t){return"+"===t[0]}function a(t){return n(t)?i(t)?l[t]:o(t)?u(t):s(t)?c(t):void 0:t}var l=t(342),u=t(352),c=t(347),_=["GEOGCS","GEOCCS","PROJCS","LOCAL_CS"];e.exports=a},function(t,e,r){var n=.017453292519943295,i=t(336),o=t(337);e.exports=function(t){var e,r,s,a={},l=t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var r=e.split("=");return r.push(!0),t[r[0].toLowerCase()]=r[1],t},{}),u={proj:"projName",datum:"datumCode",rf:function(t){a.rf=parseFloat(t)},lat_0:function(t){a.lat0=t*n},lat_1:function(t){a.lat1=t*n},lat_2:function(t){a.lat2=t*n},lat_ts:function(t){a.lat_ts=t*n},lon_0:function(t){a.long0=t*n},lon_1:function(t){a.long1=t*n},lon_2:function(t){a.long2=t*n},alpha:function(t){a.alpha=parseFloat(t)*n},lonc:function(t){a.longc=t*n},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*n},pm:function(t){a.from_greenwich=(i[t]?i[t]:parseFloat(t))*n},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)r=l[e],e in u?(s=u[e],"function"==typeof s?s(r):a[s]=r):a[e]=r;return"string"==typeof a.datumCode&&"WGS84"!==a.datumCode&&(a.datumCode=a.datumCode.toLowerCase()),a}},function(t,e,r){function n(t,e){var r=s.length;return t.names?(s[r]=t,t.names.forEach(function(t){o[t.toLowerCase()]=r}),this):(console.log(e),!0)}var i=[t(350),t(349)],o={},s=[];r.add=n,r.get=function(t){if(!t)return!1;var e=t.toLowerCase();return"undefined"!=typeof o[e]&&s[o[e]]?s[o[e]]:void 0},r.start=function(){i.forEach(n)}},function(t,e,r){function n(t){return t}r.init=function(){},r.forward=n,r.inverse=n,r.names=["longlat","identity"]},function(t,e,r){var n=t(329),i=Math.PI/2,o=1e-10,s=57.29577951308232,a=t(328),l=Math.PI/4,u=t(333),c=t(330);r.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=n(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},r.forward=function(t){var e=t.x,r=t.y;if(r*s>90&&r*s<-90&&e*s>180&&e*s<-180)return null;var n,c;if(Math.abs(Math.abs(r)-i)<=o)return null;if(this.sphere)n=this.x0+this.a*this.k0*a(e-this.long0),c=this.y0+this.a*this.k0*Math.log(Math.tan(l+.5*r));else{var _=Math.sin(r),h=u(this.e,r,_);n=this.x0+this.a*this.k0*a(e-this.long0),c=this.y0-this.a*this.k0*Math.log(h)}return t.x=n,t.y=c,t},r.inverse=function(t){var e,r,n=t.x-this.x0,o=t.y-this.y0;if(this.sphere)r=i-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var s=Math.exp(-o/(this.a*this.k0));if(r=c(this.e,s),r===-9999)return null}return e=a(this.long0+n/(this.a*this.k0)),t.x=e,t.y=r,t},r.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},function(t,e,r){function n(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 i=.017453292519943295,o=57.29577951308232,s=1,a=2,l=t(341),u=t(327),c=t(326),_=t(332);e.exports=function h(t,e,r){var s;return Array.isArray(r)&&(r=_(r)),t.datum&&e.datum&&n(t,e)&&(s=new c("WGS84"),r=h(t,s,r),t=s),"enu"!==t.axis&&(r=u(t,!1,r)),"longlat"===t.projName?r={x:r.x*i,y:r.y*i}:(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter}),r=t.inverse(r)),t.from_greenwich&&(r.x+=t.from_greenwich),r=l(t.datum,e.datum,r),e.from_greenwich&&(r={x:r.x-e.grom_greenwich,y:r.y}),"longlat"===e.projName?r={x:r.x*o,y:r.y*o}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter})),"enu"!==e.axis?u(e,!0,r):r}},function(t,e,r){function n(t,e,r){t[e]=r.map(function(t){var e={};return i(t,e),e}).reduce(function(t,e){return u(t,e)},{})}function i(t,e){var r;return Array.isArray(t)?(r=t.shift(),"PARAMETER"===r&&(r=t.shift()),1===t.length?Array.isArray(t[0])?(e[r]={},i(t[0],e[r])):e[r]=t[0]:t.length?"TOWGS84"===r?e[r]=t:(e[r]={},["UNIT","PRIMEM","VERT_DATUM"].indexOf(r)>-1?(e[r]={name:t[0].toLowerCase(),convert:t[1]},3===t.length&&(e[r].auth=t[2])):"SPHEROID"===r?(e[r]={name:t[0],a:t[1],rf:t[2]},4===t.length&&(e[r].auth=t[3])):["GEOGCS","GEOCCS","DATUM","VERT_CS","COMPD_CS","LOCAL_CS","FITTED_CS","LOCAL_DATUM"].indexOf(r)>-1?(t[0]=["name",t[0]],n(e,r,t)):t.every(function(t){return Array.isArray(t)})?n(e,r,t):i(t,e[r])):e[r]=!0,void 0):void(e[t]=!0)}function o(t,e){var r=e[0],n=e[1];!(r in t)&&n in t&&(t[r]=t[n],3===e.length&&(t[r]=e[2](t[r])))}function s(t){return t*l}function a(t){function e(e){var r=t.to_meter||1;return parseFloat(e,10)*r}"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 r=function(e){return o(t,e)},n=[["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"]];n.forEach(r),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(344);e.exports=function(t,e){var r=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".+/,"")),n=r.shift(),o=r.shift();r.unshift(["name",o]),r.unshift(["type",n]),r.unshift("output");var s={};return i(r,s),a(s.output),u(e,s.output)}},function(t,e,r){"use strict";function n(t,e,r,s,a){for(r=r||0,s=s||t.length-1,a=a||o;s>r;){if(s-r>600){var l=s-r+1,u=e-r+1,c=Math.log(l),_=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*_*(l-_)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(e-u*_/l+h)),d=Math.min(s,Math.floor(e+(l-u)*_/l+h));n(t,e,p,d,a)}var f=t[e],y=r,m=s;for(i(t,r,e),a(t[s],f)>0&&i(t,r,s);y<m;){for(i(t,y,m),y++,m--;a(t[y],f)<0;)y++;for(;a(t[m],f)>0;)m--}0===a(t[r],f)?i(t,r,m):(m++,i(t,m,s)),m<=e&&(r=m+1),e<=m&&(s=m-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function o(t,e){return t<e?-1:t>e?1:0}e.exports=n},function(t,e,r){"use strict";function n(t,e){return this instanceof n?(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 n(t,e)}function i(t,e,r){if(!r)return e.indexOf(t);for(var n=0;n<e.length;n++)if(r(t,e[n]))return n;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,r,n,i){i||(i=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-(1/0),i.maxY=-(1/0);for(var o,s=e;s<r;s++)o=t.children[s],a(i,t.leaf?n(o):o);return i}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 c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function _(t){return t.maxX-t.minX+(t.maxY-t.minY)}function h(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 r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}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 y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)}}function m(t,e,r,n,i){for(var o,s=[e,r];s.length;)r=s.pop(),e=s.pop(),r-e<=n||(o=e+Math.ceil((r-e)/n/2)*n,v(t,o,e,r,i),s.push(e,o,o,r))}e.exports=n;var v=t(353);n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!f(t,e))return r;for(var i,o,s,a,l=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],a=e.leaf?n(s):s,f(t,a)&&(e.leaf?r.push(s):d(t,a)?this._all(s,r):l.push(s));e=l.pop()}return r},collides:function(t){var e=this.data,r=this.toBBox;if(!f(t,e))return!1;for(var n,i,o,s,a=[];e;){for(n=0,i=e.children.length;n<i;n++)if(o=e.children[n],s=e.leaf?r(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,r=t.length;e<r;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=y([]),this},remove:function(t,e){if(!t)return this;for(var r,n,o,s,a=this.data,l=this.toBBox(t),u=[],c=[];a||u.length;){if(a||(a=u.pop(),n=u[u.length-1],r=c.pop(),s=!0),a.leaf&&(o=i(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)?n?(r++,a=n.children[r],s=!1):a=null:(u.push(a),c.push(r),r=0,n=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 r=[];t;)t.leaf?e.push.apply(e,t.children):r.push.apply(r,t.children),t=r.pop();return e},_build:function(t,e,r,n){var i,s=r-e+1,a=this._maxEntries;if(s<=a)return i=y(t.slice(e,r+1)),o(i,this.toBBox),i;n||(n=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,n-1))),i=y([]),i.leaf=!1,i.height=n;var l,u,c,_,h=Math.ceil(s/a),p=h*Math.ceil(Math.sqrt(a));for(m(t,e,r,p,this.compareMinX),l=e;l<=r;l+=p)for(c=Math.min(l+p-1,r),m(t,l,c,h,this.compareMinY),u=l;u<=c;u+=h)_=Math.min(u+h-1,c),i.children.push(this._build(t,u,_,n-1));return o(i,this.toBBox),i},_chooseSubtree:function(t,e,r,n){for(var i,o,s,a,l,u,_,p;;){if(n.push(e),e.leaf||n.length-1===r)break;for(_=p=1/0,i=0,o=e.children.length;i<o;i++)s=e.children[i],l=c(s),u=h(t,s)-l,u<p?(p=u,_=l<_?l:_,a=s):u===p&&l<_&&(_=l,a=s);e=a||e.children[0]}return e},_insert:function(t,e,r){var n=this.toBBox,i=r?t:n(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),a(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var s=this._chooseSplitIndex(r,i,n),a=y(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,o(r,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)},_splitRoot:function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,i,o,a,l,u,_,h;for(u=_=1/0,n=e;n<=r-e;n++)i=s(t,0,n,this.toBBox),o=s(t,n,r,this.toBBox),a=p(i,o),l=c(i)+c(o),a<u?(u=a,h=n,_=l<_?l:_):a===u&&l<_&&(_=l,h=n);return h},_chooseSplitAxis:function(t,e,r){var n=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:u,o=this._allDistMargin(t,e,r,n),s=this._allDistMargin(t,e,r,i);o<s&&t.children.sort(n)},_allDistMargin:function(t,e,r,n){t.children.sort(n);var i,o,l=this.toBBox,u=s(t,0,e,l),c=s(t,r-e,r,l),h=_(u)+_(c);for(i=e;i<r-e;i++)o=t.children[i],a(u,t.leaf?l(o):o),h+=_(u);for(i=r-e-1;i>=e;i--)o=t.children[i],a(c,t.leaf?l(o):o),h+=_(c);return h},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)a(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children,e.splice(e.indexOf(t[r]),1)):this.clear():o(t[r],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,r,n){!function(){"use strict";function e(t){return i(o(t),arguments)}function r(t,r){return e.apply(null,[t].concat(r||[]))}function i(t,r){var n,i,o,a,l,u,c,_,h,p=1,d=t.length,f="";for(i=0;i<d;i++)if("string"==typeof t[i])f+=t[i];else if(Array.isArray(t[i])){if(a=t[i],a[2])for(n=r[p],o=0;o<a[2].length;o++){if(!n.hasOwnProperty(a[2][o]))throw new Error(e('[sprintf] property "%s" does not exist',a[2][o]));n=n[a[2][o]]}else n=a[1]?r[a[1]]:r[p++];if(s.not_type.test(a[8])&&s.not_primitive.test(a[8])&&n instanceof Function&&(n=n()),s.numeric_arg.test(a[8])&&"number"!=typeof n&&isNaN(n))throw new TypeError(e("[sprintf] expecting number but found %T",n));switch(s.number.test(a[8])&&(_=n>=0),a[8]){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,a[6]?parseInt(a[6]):0);break;case"e":n=a[7]?parseFloat(n).toExponential(a[7]):parseFloat(n).toExponential();break;case"f":n=a[7]?parseFloat(n).toFixed(a[7]):parseFloat(n);break;case"g":n=a[7]?String(Number(n.toPrecision(a[7]))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=a[7]?n.substring(0,a[7]):n;break;case"t":n=String(!!n),n=a[7]?n.substring(0,a[7]):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=a[7]?n.substring(0,a[7]):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=a[7]?n.substring(0,a[7]):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}s.json.test(a[8])?f+=n:(!s.number.test(a[8])||_&&!a[3]?h="":(h=_?"+":"-",n=n.toString().replace(s.sign,"")),u=a[4]?"0"===a[4]?"0":a[4].charAt(1):" ",c=a[6]-(h+n).length,l=a[6]&&c>0?u.repeat(c):"",f+=a[5]?h+n+l:"0"===u?h+l+n:l+h+n)}return f}function o(t){if(a[t])return a[t];for(var e,r=t,n=[],i=0;r;){if(null!==(e=s.text.exec(r)))n.push(e[0]);else if(null!==(e=s.modulo.exec(r)))n.push("%");else{if(null===(e=s.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){i|=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 i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push(e)}r=r.substring(e[0].length)}return a[t]=n}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 n&&(n.sprintf=e,n.vsprintf=r),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=r,"function"==typeof t&&t.amd&&t(function(){return{sprintf:e,vsprintf:r}}))}()},function(e,r,n){!function(e){"object"==typeof r&&r.exports?r.exports=e():"function"==typeof t?t(e):this.tz=e()}(function(){function t(t,e,r){var n,i=e.day[1];do n=new Date(Date.UTC(r,e.month,Math.abs(i++)));while(e.day[0]<7&&n.getUTCDay()!=e.day[0]);return n={clock:e.clock,sort:n.getTime(),rule:e,save:6e4*e.save,offset:t.offset},n[n.clock]=n.sort+6e4*e.time,n.posix?n.wallclock=n[n.clock]+(t.offset+e.saved):n.posix=n[n.clock]-(t.offset+e.saved),n}function e(e,r,n){var i,o,s,a,l,u,c,_=e[e.zone],h=[],p=new Date(n).getUTCFullYear(),d=1;for(i=1,o=_.length;i<o&&!(_[i][r]<=n);i++);if(s=_[i],s.rules){for(u=e[s.rules],c=p+1;c>=p-d;--c)for(i=0,o=u.length;i<o;i++)u[i].from<=c&&c<=u[i].to?h.push(t(s,u[i],c)):u[i].to<c&&1==d&&(d=c-u[i].to);for(h.sort(function(t,e){return t.sort-e.sort}),i=0,o=h.length;i<o;i++)n>=h[i][r]&&h[i][h[i].clock]>s[h[i].clock]&&(a=h[i])}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 r(t,r){return"UTC"==t.zone?r:(t.entry=e(t,"posix",r),r+t.entry.offset+t.entry.save)}function n(t,r){if("UTC"==t.zone)return r;var n,i;return t.entry=n=e(t,"wallclock",r),i=r-n.wallclock,0<i&&i<n.save?null:r-n.offset-n.save}function i(t,e,i){var o,s=+(i[1]+1),a=i[2]*s,l=u.indexOf(i[3].toLowerCase());if(l>9)e+=a*_[l-10];else{if(o=new Date(r(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=n(t,o.getTime()))&&(e=n(t,o.getTime()+864e5*s)-864e5*s)}return e}function o(t){if(!t.length)return"1.0.6";var e,o,s,a,l,u=Object.create(this),_=[];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=c.exec(a))?_.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(o=!l[7],e=0;e<11;e++)l[e]=+(l[e]||0);--l[1],l=Date.UTC.apply(Date.UTC,l.slice(0,8))+-l[7]*(36e5*l[8]+6e4*l[9]+1e3*l[10])}else l=Math.floor(l);if(!isNaN(l)){if(o&&(l=n(u,l)),null==l)return l;for(e=0,o=_.length;e<o;e++)l=i(u,l,_[e]);return u.format?(s=new Date(r(u,l)),u.format.replace(/%([-0_^]?)(:{0,3})(\d*)(.)/g,function(t,e,r,n,i){var o,a,c="0";if(o=u[i]){for(t=String(o.call(u,s,l,e,r.length)),"_"==(e||o.style)&&(c=" "),a="-"==e?0:o.pad||0;t.length<a;)t=c+t;for(a="-"==e?0:n||o.pad;t.length<a;)t=c+t;"N"==i&&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 r,n,i;return n=new Date(Date.UTC(t.getUTCFullYear(),0)),r=Math.floor((t.getTime()-n.getTime())/864e5),n.getUTCDay()==e?i=0:(i=7-n.getUTCDay()+e,8==i&&(i=1)),r>=i?Math.floor((r-i)/7)+1:0}function a(t){var e,r,n;return r=t.getUTCFullYear(),e=new Date(Date.UTC(r,0)).getUTCDay(),n=s(t,1)+(e>1&&e<=4?1:0),n?53!=n||4==e||3==e&&29==new Date(r,1,29).getDate()?[n,t.getUTCFullYear()]:[1,t.getUTCFullYear()+1]:(r=t.getUTCFullYear()-1,e=new Date(Date.UTC(r,0)).getUTCDay(),n=4==e||3==e&&29==new Date(r,1,29).getDate()?53:52,[n,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,r,n){var i,o,s=this.entry.offset+this.entry.save,a=Math.abs(s/1e3),l=[],u=3600;for(i=0;i<3;i++)l.push(("0"+Math.floor(a/u)).slice(-2)),a%=u,u/=60;return"^"!=r||s?("^"==r&&(n=3),3==n?(o=l.join(":"),o=o.replace(/:00$/,""),"^"!=r&&(o=o.replace(/:00$/,""))):n?(o=l.slice(0,n+1).join(":"),"^"==r&&(o=o.replace(/:00$/,""))):o=l.slice(0,2).join(""),o=(s<0?"-":"+")+o,o=o.replace(/([-+])(0)/,{_:" $1","-":"$1"}[r]||"$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",c=new RegExp("^\\s*([+-])(\\d+)\\s+("+u+")s?\\s*$","i"),_=[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,r,n){/*! *****************************************************************************
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 i,o,s,a,l,u,c,_,h,p,d,f,y,m,v,g;!function(e){function n(t,e){return function(r,n){return t[r]=e?e(r,n):n}}var i="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:{};"function"==typeof t&&t.amd?t("tslib",["exports"],function(t){e(n(i,n(t)))}):e("object"==typeof r&&"object"==typeof r.exports?n(i,n(r.exports)):n(i))}(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};i=function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)},o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},s=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&(r[n[i]]=t[n[i]]);return r},a=function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},l=function(t,e){return function(r,n){e(r,n,t)}},u=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},c=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{l(n.next(t))}catch(e){o(e)}}function a(t){try{l(n["throw"](t))}catch(e){o(e)}}function l(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,a)}l((n=n.apply(t,e||[])).next())})},_=function(t,e){function r(t){return function(e){return n([t,e])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,o&&(s=o[2&r[0]?"return":r[0]?"throw":"next"])&&!(s=s.call(o,r[1])).done)return s;switch(o=0,s&&(r=[0,s.value]),r[0]){case 0:case 1:s=r;break;case 4:return l.label++,{value:r[1],done:!1};case 5:l.label++,o=r[1],r=[0];continue;case 7:r=l.ops.pop(),l.trys.pop();continue;default:if(s=l.trys,!(s=s.length>0&&s[s.length-1])&&(6===r[0]||2===r[0])){l=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){l.label=r[1];break}if(6===r[0]&&l.label<s[1]){l.label=s[1],s=r;break}if(s&&l.label<s[2]){l.label=s[2],l.ops.push(r);break}s[2]&&l.ops.pop(),l.trys.pop();continue}r=e.call(t,l)}catch(n){r=[6,n],o=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,s,a,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:r(0),"throw":r(1),"return":r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a},h=function(t,e){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])},p=function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}},d=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(a){i={error:a}}finally{try{n&&!n.done&&(r=o["return"])&&r.call(o)}finally{if(i)throw i.error}}return s},f=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t},y=function(t){return this instanceof y?(this.v=t,this):new y(t)},m=function(t,e,r){function n(t){c[t]&&(u[t]=function(e){return new Promise(function(r,n){_.push([t,e,r,n])>1||i(t,e)})})}function i(t,e){try{o(c[t](e))}catch(r){l(_[0][3],r)}}function o(t){t.value instanceof y?Promise.resolve(t.value.v).then(s,a):l(_[0][2],t)}function s(t){i("next",t)}function a(t){i("throw",t)}function l(t,e){t(e),_.shift(),_.length&&i(_[0][0],_[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u,c=r.apply(t,e||[]),_=[];return u={},n("next"),n("throw"),n("return"),u[Symbol.asyncIterator]=function(){return this},u},v=function(t){function e(e,i){t[e]&&(r[e]=function(r){return(n=!n)?{value:y(t[e](r)),done:"return"===e}:i?i(r):r})}var r,n;return r={},e("next"),e("throw",function(t){throw t}),e("return"),r[Symbol.iterator]=function(){return this},r},g=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]()},t("__extends",i),t("__assign",o),t("__rest",s),t("__decorate",a),t("__param",l),t("__metadata",u),t("__awaiter",c),t("__generator",_),t("__exportStar",h),t("__values",p),t("__read",d),t("__spread",f),t("__await",y),t("__asyncGenerator",m),t("__asyncDelegator",v),t("__asyncValues",g)})}],{base:0,client:1,"core/bokeh_events":2,"core/build_views":3,"core/dom":4,"core/dom_view":5,"core/enums":6,"core/has_props":7,"core/hittest":8,"core/layout/layout_canvas":9,"core/layout/side_panel":10,"core/layout/solver":11,"core/logging":12,"core/properties":13,"core/property_mixins":14,"core/selection_manager":15,"core/selector":16,"core/settings":17,"core/signaling":18,"core/ui_events":19,"core/util/array":20,"core/util/bbox":21,"core/util/callback":22,"core/util/canvas":23,"core/util/color":24,"core/util/data_structures":25,"core/util/eq":26,"core/util/math":27,"core/util/object":28,"core/util/proj4":29,"core/util/projections":30,"core/util/refs":31,"core/util/selection":32,"core/util/serialization":33,"core/util/spatial":34,"core/util/string":35,"core/util/svg_colors":36,"core/util/templating":37,"core/util/text":38,"core/util/throttle":39,"core/util/types":40,"core/util/wheel":41,"core/util/zoom":42,"core/view":43,"core/visuals":44,document:45,embed:46,main:47,model:48,"models/annotations/annotation":49,"models/annotations/arrow":50,"models/annotations/arrow_head":51,"models/annotations/band":52,"models/annotations/box_annotation":53,"models/annotations/color_bar":54,"models/annotations/index":55,"models/annotations/label":56,"models/annotations/label_set":57,"models/annotations/legend":58,"models/annotations/legend_item":59,"models/annotations/poly_annotation":60,"models/annotations/span":61,"models/annotations/text_annotation":62,"models/annotations/title":63,"models/annotations/tooltip":64,"models/annotations/whisker":65,"models/axes/axis":66,"models/axes/categorical_axis":67,"models/axes/continuous_axis":68,"models/axes/datetime_axis":69,"models/axes/index":70,"models/axes/linear_axis":71,"models/axes/log_axis":72,"models/callbacks/customjs":73,"models/callbacks/index":74,"models/callbacks/open_url":75,"models/canvas/canvas":76,"models/canvas/cartesian_frame":77,"models/canvas/index":78,"models/expressions/expression":79,"models/expressions/index":80,"models/expressions/stack":81,"models/filters/boolean_filter":82,"models/filters/customjs_filter":83,"models/filters/filter":84,"models/filters/group_filter":85,"models/filters/index":86,"models/filters/index_filter":87,"models/formatters/basic_tick_formatter":88,"models/formatters/categorical_tick_formatter":89,"models/formatters/datetime_tick_formatter":90,"models/formatters/func_tick_formatter":91,"models/formatters/index":92,"models/formatters/log_tick_formatter":93,"models/formatters/mercator_tick_formatter":94,"models/formatters/numeral_tick_formatter":95,"models/formatters/printf_tick_formatter":96,"models/formatters/tick_formatter":97,"models/glyphs/annular_wedge":98,"models/glyphs/annulus":99,"models/glyphs/arc":100,"models/glyphs/bezier":101,"models/glyphs/circle":102,"models/glyphs/ellipse":103,"models/glyphs/glyph":104,"models/glyphs/hbar":105,"models/glyphs/image":106,"models/glyphs/image_rgba":107,"models/glyphs/image_url":108,"models/glyphs/index":109,"models/glyphs/line":110,"models/glyphs/multi_line":111,"models/glyphs/oval":112,"models/glyphs/patch":113,"models/glyphs/patches":114,"models/glyphs/quad":115,"models/glyphs/quadratic":116,"models/glyphs/ray":117,"models/glyphs/rect":118,"models/glyphs/segment":119,"models/glyphs/text":120,"models/glyphs/vbar":121,"models/glyphs/wedge":122,"models/glyphs/xy_glyph":123,"models/graphs/graph_hit_test_policy":124,"models/graphs/index":125,"models/graphs/layout_provider":126,"models/graphs/static_layout_provider":127,"models/grids/grid":128,"models/grids/index":129,"models/index":130,"models/layouts/box":131,"models/layouts/column":132,"models/layouts/index":133,"models/layouts/layout_dom":134,"models/layouts/row":135,"models/layouts/spacer":136,"models/layouts/widget_box":137,"models/mappers/categorical_color_mapper":138,"models/mappers/color_mapper":139,"models/mappers/index":140,"models/mappers/linear_color_mapper":141,"models/mappers/log_color_mapper":142,"models/markers/index":143,"models/markers/marker":144,"models/plots/gmap_plot":145,"models/plots/gmap_plot_canvas":146,"models/plots/index":147,"models/plots/plot":148,"models/plots/plot_canvas":149,"models/ranges/data_range":150,"models/ranges/data_range1d":151,"models/ranges/factor_range":152,"models/ranges/index":153,"models/ranges/range":154,"models/ranges/range1d":155,"models/renderers/glyph_renderer":156,"models/renderers/graph_renderer":157,"models/renderers/guide_renderer":158,"models/renderers/index":159,"models/renderers/renderer":160,"models/scales/categorical_scale":161,"models/scales/index":162,"models/scales/linear_scale":163,"models/scales/log_scale":164,"models/scales/scale":165,"models/sources/ajax_data_source":166,"models/sources/cds_view":167,"models/sources/column_data_source":168,"models/sources/columnar_data_source":169,"models/sources/data_source":170,"models/sources/geojson_data_source":171,"models/sources/index":172,"models/sources/remote_data_source":173,"models/tickers/adaptive_ticker":174,"models/tickers/basic_ticker":175,"models/tickers/categorical_ticker":176,"models/tickers/composite_ticker":177,"models/tickers/continuous_ticker":178,"models/tickers/datetime_ticker":179,"models/tickers/days_ticker":180,"models/tickers/fixed_ticker":181,"models/tickers/index":182,"models/tickers/log_ticker":183,"models/tickers/mercator_ticker":184,"models/tickers/months_ticker":185,"models/tickers/single_interval_ticker":186,"models/tickers/ticker":187,"models/tickers/util":188,"models/tickers/years_ticker":189,"models/tiles/bbox_tile_source":190,"models/tiles/dynamic_image_renderer":191,"models/tiles/image_pool":192,"models/tiles/image_source":193,"models/tiles/index":194,"models/tiles/mercator_tile_source":195,"models/tiles/quadkey_tile_source":196,"models/tiles/tile_renderer":197,"models/tiles/tile_source":198,"models/tiles/tile_utils":199,"models/tiles/tms_tile_source":200,"models/tiles/wmts_tile_source":201,"models/tools/actions/action_tool":202,"models/tools/actions/help_tool":203,"models/tools/actions/redo_tool":204,"models/tools/actions/reset_tool":205,"models/tools/actions/save_tool":206,"models/tools/actions/undo_tool":207,"models/tools/actions/zoom_in_tool":208,"models/tools/actions/zoom_out_tool":209,"models/tools/button_tool":210,"models/tools/gestures/box_select_tool":211,"models/tools/gestures/box_zoom_tool":212,"models/tools/gestures/gesture_tool":213,"models/tools/gestures/lasso_select_tool":214,"models/tools/gestures/pan_tool":215,"models/tools/gestures/poly_select_tool":216,"models/tools/gestures/select_tool":217,"models/tools/gestures/tap_tool":218,"models/tools/gestures/wheel_pan_tool":219,"models/tools/gestures/wheel_zoom_tool":220,"models/tools/index":221,"models/tools/inspectors/crosshair_tool":222,"models/tools/inspectors/hover_tool":223,"models/tools/inspectors/inspect_tool":224,"models/tools/on_off_button":225,"models/tools/tool":226,"models/tools/tool_proxy":227,"models/tools/toolbar":228,"models/tools/toolbar_base":229,"models/tools/toolbar_box":230,"models/transforms/customjs_transform":231,"models/transforms/dodge":232,"models/transforms/index":233,"models/transforms/interpolator":234,"models/transforms/jitter":235,"models/transforms/linear_interpolator":236,"models/transforms/step_interpolator":237,"models/transforms/transform":238,polyfill:239,safely:240,version:241},47)});/*!
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