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

  1. !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="+t
  2. 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"===
  3. },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
  4. // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  5. // Underscore may be freely distributed under the MIT license.
  6. 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}}
  7. // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  8. // Underscore may be freely distributed under the MIT license.
  9. 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=t
  10. // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  11. // Underscore may be freely distributed under the MIT license.
  12. 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?(_=
  13. // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  14. // Underscore may be freely distributed under the MIT license.
  15. 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}/*!
  16. * jQuery Mousewheel 3.1.13
  17. *
  18. * Copyright jQuery Foundation and other contributors
  19. * Released under the MIT license
  20. * http://jquery.org/license
  21. */
  22. 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=t
  23. 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=funct
  24. 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,
  25. 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})
  26. 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.
  27. 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(
  28. 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_
  29. 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())re
  30. 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;re
  31. 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
  32. 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.me
  33. 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_ca
  34. 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.pr
  35. "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 nu
  36. 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,5
  37. 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){/*!
  38. * @overview es6-promise - a tiny implementation of Promises/A+.
  39. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  40. * @license Licensed under MIT license
  41. * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
  42. * @version 3.0.2
  43. */
  44. (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,funct
  45. * http://hammerjs.github.io/
  46. *
  47. * Copyright (c) 2016 Jorik Tangelder;
  48. * Licensed under the MIT license */
  49. !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
  50. | Copyright (c) 2014, Nucleic Development Team.
  51. |
  52. | Distributed under the terms of the Modified BSD License.
  53. |
  54. | The full license is in the file COPYING.txt, distributed with this software.
  55. |----------------------------------------------------------------------------*/
  56. 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}}/*-----------------------------------------------------------------------------
  57. | Copyright (c) 2014, Nucleic Development Team.
  58. |
  59. | Distributed under the terms of the Modified BSD License.
  60. |
  61. | The full license is in the file COPYING.txt, distributed with this software.
  62. |----------------------------------------------------------------------------*/
  63. 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";/*-----------------------------------------------------------------------------
  64. | Copyright (c) 2014, Nucleic Development Team.
  65. |
  66. | Distributed under the terms of the Modified BSD License.
  67. |
  68. | The full license is in the file COPYING.txt, distributed with this software.
  69. |----------------------------------------------------------------------------*/
  70. 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)}/*-----------------------------------------------------------------------------
  71. | Copyright (c) 2014, Nucleic Development Team.
  72. |
  73. | Distributed under the terms of the Modified BSD License.
  74. |
  75. | The full license is in the file COPYING.txt, distributed with this software.
  76. |----------------------------------------------------------------------------*/
  77. 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)}/*-----------------------------------------------------------------------------
  78. | Copyright (c) 2014, Nucleic Development Team.
  79. |
  80. | Distributed under the terms of the Modified BSD License.
  81. |
  82. | The full license is in the file COPYING.txt, distributed with this software.
  83. |----------------------------------------------------------------------------*/
  84. 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.Err
  85. | Copyright (c) 2014, Nucleic Development Team.
  86. |
  87. | Distributed under the terms of the Modified BSD License.
  88. |
  89. | The full license is in the file COPYING.txt, distributed with this software.
  90. |----------------------------------------------------------------------------*/
  91. 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}/*-----------------------------------------------------------------------------
  92. | Copyright (c) 2014, Nucleic Development Team.
  93. |
  94. | Distributed under the terms of the Modified BSD License.
  95. |
  96. | The full license is in the file COPYING.txt, distributed with this software.
  97. |----------------------------------------------------------------------------*/
  98. 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";/*-----------------------------------------------------------------------------
  99. | Copyright (c) 2014, Nucleic Development Team.
  100. |
  101. | Distributed under the terms of the Modified BSD License.
  102. |
  103. | The full license is in the file COPYING.txt, distributed with this software.
  104. |----------------------------------------------------------------------------*/
  105. 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}/*-----------------------------------------------------------------------------
  106. | Copyright (c) 2014, Nucleic Development Team.
  107. |
  108. | Distributed under the terms of the Modified BSD License.
  109. |
  110. | The full license is in the file COPYING.txt, distributed with this software.
  111. |----------------------------------------------------------------------------*/
  112. 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}/*-----------------------------------------------------------------------------
  113. | Copyright (c) 2014, Nucleic Development Team.
  114. |
  115. | Distributed under the terms of the Modified BSD License.
  116. |
  117. | The full license is in the file COPYING.txt, distributed with this software.
  118. |----------------------------------------------------------------------------*/
  119. 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";/*-----------------------------------------------------------------------------
  120. | Copyright (c) 2014, Nucleic Development Team.
  121. |
  122. | Distributed under the terms of the Modified BSD License.
  123. |
  124. | The full license is in the file COPYING.txt, distributed with this software.
  125. |----------------------------------------------------------------------------*/
  126. 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";/*-----------------------------------------------------------------------------
  127. | Copyright (c) 2014, Nucleic Development Team.
  128. |
  129. | Distributed under the terms of the Modified BSD License.
  130. |
  131. | The full license is in the file COPYING.txt, distributed with this software.
  132. |----------------------------------------------------------------------------*/
  133. 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(
  134. * numbro.js
  135. * version : 1.6.2
  136. * author : Företagsplatsen AB
  137. * license : MIT
  138. * http://www.foretagsplatsen.se
  139. */
  140. 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=
  141. 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,
  142. Copyright (c) Microsoft Corporation. All rights reserved.
  143. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  144. this file except in compliance with the License. You may obtain a copy of the
  145. License at http://www.apache.org/licenses/LICENSE-2.0
  146. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  147. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  148. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  149. MERCHANTABLITY OR NON-INFRINGEMENT.
  150. See the Apache Version 2.0 License for specific language governing permissions
  151. and limitations under the License.
  152. ***************************************************************************** */
  153. 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
  154. Copyright (c) 2012, Anaconda, Inc.
  155. All rights reserved.
  156. Redistribution and use in source and binary forms, with or without modification,
  157. are permitted provided that the following conditions are met:
  158. Redistributions of source code must retain the above copyright notice,
  159. this list of conditions and the following disclaimer.
  160. Redistributions in binary form must reproduce the above copyright notice,
  161. this list of conditions and the following disclaimer in the documentation
  162. and/or other materials provided with the distribution.
  163. Neither the name of Anaconda nor the names of any contributors
  164. may be used to endorse or promote products derived from this software
  165. without specific prior written permission.
  166. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  167. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  168. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  169. ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  170. LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  171. CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  172. SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  173. INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  174. CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  175. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  176. THE POSSIBILITY OF SUCH DAMAGE.
  177. */
  178. //# sourceMappingURL=bokeh.min.js.map