274 lines
876 KiB
JavaScript
274 lines
876 KiB
JavaScript
|
window.Bokeh=Bokeh=function(){var t=void 0;return function e(t,r,n){function o(i){if(!r[i]){if(!t[i]){var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var a=r[i]={exports:{}},l=function(e){var r=t[i][1][e];return o(r?r:e)};l.modules=o.modules,t[i][0].call(a.exports,l,a,a.exports,e,t,r,n)}return r[i].exports}o.modules=t;for(var i=null,s=0;s<n.length;s++)i=o(n[s]);return i}({base:[function(t,e,r){var n,o,i,s,a,l,u,h,c,p={}.hasOwnProperty;o=t("underscore"),u=t("./core/logging").logger,t("./core/util/underscore").patch(),l=t("./common/models"),c={},h=function(t){var e,r,n,i,s,a,l,u,h;s={};for(n in t)if(a=t[n],o.isArray(a)){u=a[0],h=null!=(i=a[1])?i:"";for(l in u)e=u[l],r=l+h,s[r]=e}else s[n]=a;return s},s=null,i=function(){return null==s&&(s=h(l)),s},n=function(t){var e,r;if(r=i(),c[t])return c[t];if(e=r[t],null==e)throw new Error("Module `"+t+"' does not exists. The problem may be two fold. Either a model was requested that's available in an extra bundle, e.g. a widget, or a custom model was requested, but it wasn't registered before first usage.");return e.Model},n.register=function(t,e){return c[t]=e},n.unregister=function(t){return delete c[t]},n.register_locations=function(t,e,r){var n,o,s,a,l;null==e&&(e=!1),null==r&&(r=null),o=i(),n=h(t),l=[];for(a in n)p.call(n,a)&&(s=n[a],e||!o.hasOwnProperty(a)?l.push(o[a]=s):l.push("function"==typeof r?r(a):void 0));return l},n.registered_names=function(){return Object.keys(i())},a={},e.exports={overrides:c,index:a,Models:n}},{"./common/models":"common/models","./core/logging":"core/logging","./core/util/underscore":"core/util/underscore",underscore:"underscore"}],client:[function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y;d=t("underscore"),c=t("es6-promise").Promise,l=t("./core/has_props"),f=t("./core/logging").logger,y=t("./document"),a=y.Document,h=y.ModelChangedEvent,p=y.RootAddedEvent,_=y.RootRemovedEvent,i="ws://localhost:5006/ws",s="default",u=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 o,i,s,a,l;try{return a=JSON.parse(e),l=JSON.parse(r),o=JSON.parse(n),new t(a,l,o)}catch(s){throw i=s,f.error("Failure parsing json "+i+" "+e+" "+r+" "+n,i),i}},t.create_header=function(t,e){var r;return r={msgid:d.uniqueId(),msgtype:t},d.extend(r,e)},t.create=function(e,r,n){var o;return null==n&&(n={}),o=t.create_header(e,r),new t(o,{},n)},t.prototype.send=function(t){var e,r,n,o,i;try{return o=JSON.stringify(this.header),i=JSON.stringify(this.metadata),e=JSON.stringify(this.content),t.send(o),t.send(i),t.send(e)}catch(n){throw r=n,f.error("Error sending ",this,r),r}},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}(),m={"PATCH-DOC":function(t,e){return t._for_session(function(t){return t._handle_patch(e)})},OK:function(t,e){return f.debug("Unhandled OK reply to "+e.reqid())},ERROR:function(t,e){return f.error("Unhandled ERROR reply to "+e.reqid()+": "+e.content.text)}},n=function(){function t(e,r,n,o){this.url=e,this.id=r,this._on_have_session_hook=n,this._on_closed_permanently_hook=o,this._number=t._connection_count,t._connection_count=this._number+1,null==this.url&&(this.url=i),null==this.id&&(this.id=s),f.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._pend
|
||
|
t["0d"].glyph=this.get("indices")["0d"].glyph||t["0d"].glyph,t["1d"].indices=i.union(this.get("indices")["1d"].indices,t["1d"].indices),t["2d"].indices=i.union(this.get("indices")["2d"].indices,t["2d"].indices)),this.set("indices",t,{silent:n})},e.prototype.clear=function(){return this.set("timestamp",new Date),this.set("final",!0),this.set("indices",s.create_hit_test_result())},e.internal({indices:[l.Any,function(){return s.create_hit_test_result()}],"final":[l.Boolean],timestamp:[l.Any]}),e}(n),e.exports=o},{"../core/has_props":"core/has_props","../core/logging":"core/logging","../core/properties":"core/properties","./hittest":"common/hittest",underscore:"underscore"}],"common/tool_events":[function(t,e,r){var n,o,i,s,a,l=function(t,e){function r(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},u={}.hasOwnProperty;i=t("underscore"),n=t("../model"),s=t("../core/logging").logger,a=t("../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="ToolEvents",e.define({geometries:[a.Array,[]]}),e}(n),e.exports={Model:o}},{"../core/logging":"core/logging","../core/properties":"core/properties","../model":"model",underscore:"underscore"}],"common/ui_events":[function(t,e,r){var n,o,i,s,a,l,u=function(t,e){function r(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},h={}.hasOwnProperty;n=t("jquery"),o=t("backbone"),i=t("hammerjs"),l=t("jquery-mousewheel")(n),a=t("../core/logging").logger,s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this._hammer_element()},e.prototype._hammer_element=function(){var t;return t=this.get("hit_area"),this.hammer=new i(t[0]),this.hammer.get("doubletap").recognizeWith("tap"),this.hammer.get("tap").requireFailure("doubletap"),this.hammer.get("doubletap").dropRequireFailure("tap"),this.hammer.on("doubletap",function(t){return function(e){return t._doubletap(e)}}(this)),this.hammer.on("tap",function(t){return function(e){return t._tap(e)}}(this)),this.hammer.on("press",function(t){return function(e){return t._press(e)}}(this)),this.hammer.get("pan").set({direction:i.DIRECTION_ALL}),this.hammer.on("panstart",function(t){return function(e){return t._pan_start(e)}}(this)),this.hammer.on("pan",function(t){return function(e){return t._pan(e)}}(this)),this.hammer.on("panend",function(t){return function(e){return t._pan_end(e)}}(this)),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("pinchstart",function(t){return function(e){return t._pinch_start(e)}}(this)),this.hammer.on("pinch",function(t){return function(e){return t._pinch(e)}}(this)),this.hammer.on("pinchend",function(t){return function(e){return t._pinch_end(e)}}(this)),this.hammer.get("rotate").set({enable:!0}),this.hammer.on("rotatestart",function(t){return function(e){return t._rotate_start(e)}}(this)),this.hammer.on("rotate",function(t){return function(e){return t._rotate(e)}}(this)),this.hammer.on("rotateend",function(t){return function(e){return t._rotate_end(e)}}(this)),t.mousemove(function(t){return function(e){return t._mouse_move(e)}}(this)),t.mouseenter(function(t){return function(e){return t._mouse_enter(e)}}(this)),t.mouseleave(function(t){return function(e){return t._mouse_exit(e)}}(this)),t.mousewheel(function(t){return function(e,r){return t._mouse_wheel(e,r)}}(this)),n(document).keydown(function(t){return function(e){return t._key_down(e)}}(this)),n(document).keyup(function(t){return function(e){return t._key_up(e)}}(this))},e.prototype.register_tool=function(t){var e,r,n;return e=t.model.event_type,r=t.model.id,n=t.model.type,null==e?void a.debug("Button tool: "+n):("pan"===e||"pinch"===e||"rotate"===e?(a.debug("Registering tool: "+n+" for event '"+e+"'"),null!=t["_"+e+"_start"]&&t.listenTo(this,e+":start:"+r,t["_"+e+"_start"]),t["_"+e]&&t.listenTo(this,e+
|
||
|
C=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("RenderMode",G.RenderMode)),N=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("SizingMode",G.SizingMode)),O=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("SpatialUnits",G.SpatialUnits)),y=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("Distribution",G.DistributionTypes)),F=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(L("TransformStepMode",G.TransformStepModes)),Y=function(t,e,r){var n;return n=function(n){function o(){return o.__super__.constructor.apply(this,arguments)}return X(o,n),o.prototype.toString=function(){return t+"(obj: "+this.get(obj).id+", spec: "+JSON.stringify(this.spec)+")"},o.prototype.init=function(){var n;if(null==this.spec.units&&(this.spec.units=r),this.units=this.spec.units,n=this.spec.units,W.call(e,n)<0)throw new Error(t+" units must be one of "+e+", given invalid value: "+n)},o}(S)},o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.transform=function(t){var r;return"deg"===this.spec.units&&(t=function(){var e,n,o;for(o=[],e=0,n=t.length;e<n;e++)r=t[e],o.push(r*Math.PI/180);return o}()),t=function(){var e,n,o;for(o=[],e=0,n=t.length;e<n;e++)r=t[e],o.push(-r);return o}(),e.__super__.transform.call(this,t)},e}(Y("Angle",G.AngleUnits,"rad")),m=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e}(Y("Distance",G.SpatialUnits,"data")),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(o),p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(c),f=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(m),g=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(m),b=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(q),z=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(S),D=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return X(e,t),e.prototype.dataspec=!0,e}(q),e.exports={Property:E,simple_prop:V,enum_prop:L,units_prop:Y,Anchor:n,Any:a,Angle:o,AngleUnits:s,Array:l,Bool:h,Boolean:h,Color:c,Dimension:_,Direction:d,Distance:m,Font:v,FontStyle:x,Instance:w,LegendLocation:M,LineCap:k,LineJoin:j,Location:T,Number:S,Int:S,Orientation:P,RenderLevel:A,RenderMode:C,SizingMode:N,SpatialUnits:O,String:q,TextAlign:I,TextBaseline:R,Distribution:y,TransformStepMode:F,AngleSpec:i,ColorSpec:p,DirectionSpec:f,DistanceSpec:g,FontSizeSpec:b,NumberSpec:z,StringSpec:D}},{"./enums":"core/enums","./util/color":"core/util/color","./util/svg_colors":"core/util/svg_colors",backbone:"backbone",underscore:"underscore"}],"core/property_mixins":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p;n=t("underscore"),c=t("./properties"),i=function(t,e){var r,n,o;n={},null==e&&(e="");for(r in t)o=t[r],n[e+r]=o;return n},s={line_color:[c.ColorSpec,"black"],line_width:[c.NumberSpec,1],line_alpha:[c.NumberSpec,1],line_join:[c.LineJoin,"miter"],line_cap:[c.LineCap,"butt"],line_dash:[c.Array,[]],line_dash_offset:[c.Number,0]},h=function(t){return i(s,t)},o={fill_color:[c.ColorSpec,"gray"],fill_alpha:[c.NumberSpec,1]},u=function(t){return i(o,t)},a={text_font:[c.Font,"helvetica"],text_font_size:[c.FontSizeSpec,"12pt"],text_font_style:[c.FontStyle,"normal"],text_color:[c.ColorSpec,"#444444"],text_alpha:[c.NumberSpec,1],text_align:[c.TextAlign,"left"],text_baseline:[c.TextBaseline,"bottom"]},p=function(t){return i(a,t)},l=function(t){var e,r,o,i,s,a,l;for(l={},r=0,i=t.length;r<i;r++){if(e=t[r],a=e.split(":"),o=a[0],s=a[1],null==this[o])throw
|
||
|
var o,i,s,a,c,_,d;d={},c=function(e){var r;return r=p(e),d[e.id]=r,n(t).append(r.$el)},_=function(e){var r;if(e.id in d)return r=d[e.id],n(t).remove(r.$el),delete d[e.id],delete k.index[e.id]},a=e.roots();for(o=0,i=a.length;o<i;o++)s=a[o],c(s);return r&&(window.document.title=e.title()),e.on_change(function(t){return t instanceof l?c(t.model):t instanceof u?_(t.model):r&&t instanceof h?window.document.title=t.title:void 0}),d},M=function(t,e,r){var o,i;if(o=r.get_model_by_id(e),null==o)throw new Error("Model "+e+" was not in document "+r);return i=p(o),c.delay(function(){return n(t).replaceWith(i.$el)})},x=function(t,e,r){return c.delay(function(){return m(n(t),e,r)})},b=function(t,e,r){return null==r&&(r=!1),m(n(e),t,r)},g={},_=function(t,e){var r;if(null==t||null===t)throw new Error("Missing websocket_url");return t in g||(g[t]={}),r=g[t],e in r||(r[e]=E(t,e)),r[e]},v=function(t,e,r,n){var o;return o=_(e,r),o.then(function(e){return m(t,e.document,n)},function(t){throw P.error("Failed to load Bokeh session "+r+": "+t),t})},w=function(t,e,r,o){var i;return i=_(e,o),i.then(function(e){var o,i;if(o=e.document.get_model_by_id(r),null==o)throw new Error("Did not find model "+r+" in session");return i=p(o),n(t).replaceWith(i.$el)},function(t){throw P.error("Failed to load Bokeh session "+o+": "+t),t})},S=function(t){var e;return e=n("<link href='"+t+"' rel='stylesheet' type='text/css'>"),n("body").append(e)},z=function(t){var e;return e=n("<style>").html(t),n("body").append(e)},T=function(t,e){var r;return r=t.data(),null!=r.bokehLogLevel&&r.bokehLogLevel.length>0&&N(r.bokehLogLevel),null!=r.bokehDocId&&r.bokehDocId.length>0&&(e.docid=r.bokehDocId),null!=r.bokehModelId&&r.bokehModelId.length>0&&(e.modelid=r.bokehModelId),null!=r.bokehSessionId&&r.bokehSessionId.length>0&&(e.sessionid=r.bokehSessionId),P.info("Will inject Bokeh script tag with params "+JSON.stringify(e))},j=function(t,e,r){var i,a,l,u,h,c,p,_,d,m,g;null==r&&(r=null),l={};for(a in t)l[a]=s.from_json(t[a]);for(m=[],c=0,_=e.length;c<_;c++){if(p=e[c],null!=p.notebook_comms_target&&f(p.notebook_comms_target,l[a]),h=p.elementid,u=n("#"+h),0===u.length)throw new Error("Error rendering Bokeh model: could not find tag with id: "+h);if(u.length>1)throw new Error("Error rendering Bokeh model: found too many tags with id: "+h);if(!document.body.contains(u[0]))throw new Error("Error rendering Bokeh model: element with id '"+h+"' must be under <body>");if("SCRIPT"===u.prop("tagName")&&(T(u,p),i=n("<div>",{"class":o}),u.replaceWith(i),u=i),g=null!=p.use_for_title&&p.use_for_title,d=null,null!=p.modelid)if(null!=p.docid)M(u,p.modelid,l[p.docid]);else{if(null==p.sessionid)throw new Error("Error rendering Bokeh model "+p.modelid+" to element "+h+": no document ID or session ID specified");d=w(u,r,p.modelid,p.sessionid)}else if(null!=p.docid)x(u,l[p.docid],g);else{if(null==p.sessionid)throw new Error("Error rendering Bokeh document to element "+h+": no document ID or session ID specified");d=v(u,r,p.sessionid,g)}null!==d?m.push(d.then(function(t){return console.log("Bokeh items were rendered successfully")},function(t){return console.log("Error rendering Bokeh items ",t)})):m.push(void 0)}return m},e.exports={embed_items:j,add_document_static:x,add_document_standalone:b,inject_css:S,inject_raw_css:z,BOKEH_ROOT:o}},{"./base":"base","./client":"client","./core/logging":"core/logging","./document":"document",backbone:"backbone","es6-promise":"es6-promise",jquery:"jquery",underscore:"underscore"}],main:[function(t,e,r){var n,o,i;o=t("underscore"),n={},n.require=t,n.version=t("./version"),n._=t("underscore"),n.$=t("jquery"),n.Backbone=t("backbone"),n.Backbone.$=n.$,i=t("./core/logging"),n.logger=i.logger,n.set_log_level=i.set_log_level,n.index=t("./base").index,n.embed=t("./embed"),n.safely=t("./safely"),n.Models=t("./base").Models,n.Bokeh=n,e.exports=n},{"./base":"base","./core/logging":"core/logging","./embed":"embed","./safely":"safely","./version":"version",backbone:"backbone",jquery:"jquery",underscore:"underscore"}],model:[function(t,e,r){var n,o,i,s,a=function(t,e){function
|
||
|
s.push(this.title_div.appendTo(this.$el));return s}},e.prototype.bind_bokeh_events=function(){return"css"===this.model.render_mode?(this.listenTo(this.model,"change",function(){return this.set_data(),this.render()}),this.listenTo(this.model.source,"change",function(){return this.set_data(),this.render()})):(this.listenTo(this.model,"change",function(){return this.set_data(),this.plot_view.request_render()}),this.listenTo(this.model.source,"change",function(){return this.set_data(),this.plot_view.request_render()}))},e.prototype.set_data=function(){return e.__super__.set_data.call(this,this.model.source),this.set_visuals(this.model.source)},e.prototype._map_data=function(){var t,e,r,n;return r="data"===this.model.x_units?this.xmapper.v_map_to_target(this._x):this._x.slice(0),t=this.canvas.v_vx_to_sx(r),n="data"===this.model.y_units?this.ymapper.v_map_to_target(this._y):this._y.slice(0),e=this.canvas.v_vy_to_sy(n),[t,e]},e.prototype.render=function(){var t,e,r,n,o,i,s,a,l,u,h;if(t=this.plot_view.canvas_view.ctx,o=this._map_data(),u=o[0],h=o[1],"canvas"===this.model.render_mode){for(a=[],e=r=0,i=this._text.length;0<=i?r<i:r>i;e=0<=i?++r:--r)a.push(this._v_canvas_text(t,e,this._text[e],u[e]+this._x_offset[e],h[e]-this._y_offset[e],this._angle[e]));return a}for(l=[],e=n=0,s=this._text.length;0<=s?n<s:n>s;e=0<=s?++n:--n)l.push(this._v_css_text(t,e,this._text[e],u[e]+this._x_offset[e],h[e]-this._y_offset[e],this._angle[e]));return l},e.prototype._get_size=function(){var t,e,r,n;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),r=this.model.panel.side,"above"===r||"below"===r?e=t.measureText(this._text[0]).ascent:"left"===r||"right"===r?n=t.measureText(this._text[0]).width:void 0},e.prototype._v_canvas_text=function(t,e,r,n,o,i){var s;return this.visuals.text.set_vectorize(t,e),s=this._calculate_bounding_box_dimensions(t,r),t.save(),t.beginPath(),t.translate(n,o),t.rotate(i),t.rect(s[0],s[1],s[2],s[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_vectorize(t,e),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_vectorize(t,e),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_vectorize(t,e),t.fillText(r,0,0)),t.restore()},e.prototype._v_css_text=function(t,e,r,n,o,i){var s,a,u,h;return this.visuals.text.set_vectorize(t,e),s=this._calculate_bounding_box_dimensions(t,r),u=this.visuals.border_line.line_dash.value(),l.isArray(u)&&(h=u.length<2?"solid":"dashed"),l.isString(u)&&(h=u),this.visuals.border_line.set_vectorize(t,e),this.visuals.background_fill.set_vectorize(t,e),a={position:"absolute",left:n+s[0]+"px",top:o+s[1]+"px",color:""+this.visuals.text.text_color.value(),opacity:""+this.visuals.text.text_alpha.value(),font:""+this.visuals.text.font_value(),"line-height":"normal"},i&&l.extend(a,{transform:"rotate("+i+"rad)"}),this.visuals.background_fill.doit&&l.extend(a,{"background-color":""+this.visuals.background_fill.color_value()}),this.visuals.border_line.doit&&l.extend(a,{"border-style":""+h,"border-width":""+this.visuals.border_line.line_width.value(),"border-color":""+this.visuals.border_line.color_value()}),this.$el.children().eq(e).html(r).css(a).show()},e}(a.View),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=s,e.prototype.type="Label",e.mixins(["text","line:border_","fill:background_"]),e.coords([["x","y"]]),e.define({x_units:[u.SpatialUnits,"data"],y_units:[u.SpatialUnits,"data"],text:[u.StringSpec,{field:"text"}],angle:[u.AngleSpec,0],x_offset:[u.NumberSpec,{value:0}],y_offset:[u.NumberSpec,{value:0}],source:[u.Instance,function(){return new o.Model}],x_range_name:[u.String,"default"],y_range_name:[u.String,"default"],render_mode:[u.RenderMode,"canvas"]}),e.override({background_fill_color:null,border_line_color:null}),e}(a.Model),e.exports={Model:i,View:s}},{"../../core/properties":"core/properties","../sources/column_data_source":"models/sources/column_data_source","./text_annotation":"models/annotations/text_annotation",jquery:"jquery",underscore:"underscore"}],"models/a
|
||
|
e=Math.max(a[0],a[1])),[s,e]):(h.error("user bounds '"+a+"' not understood"),null)},e.prototype._rule_coords=function(){var t,e,r,n,o,i,s,a,l,u,h,c;return n=this.get("dimension"),o=(n+1)%2,a=this.get("ranges"),s=a[0],e=a[1],l=this.get("computed_bounds"),u=l[0],r=l[1],h=new Array(2),c=new Array(2),t=[h,c],i=this._get_loc(e),t[n][0]=Math.max(u,s.get("min")),t[n][1]=Math.min(r,s.get("max")),t[n][0]>t[n][1]&&(t[n][0]=t[n][1]=NaN),t[o][0]=i,t[o][1]=i,t},e.prototype._tick_coords=function(){var t,e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S;if(n=this.get("dimension"),i=(n+1)%2,y=this.get("ranges"),f=y[0],e=y[1],v=this.get("computed_bounds"),k=v[0],r=v[1],j=this.get("ticker").get_ticks(k,r,f,{}),h=j.major,d=j.minor,l=this._get_loc(e),T=[],S=[],t=[T,S],p=[],_=[],c=[p,_],"FactorRange"===f.type)for(o=s=0,b=h.length;0<=b?s<b:s>b;o=0<=b?++s:--s)t[n].push(h[o]),t[i].push(l);else{for(x=[f.get("min"),f.get("max")],g=x[0],m=x[1],o=a=0,w=h.length;0<=w?a<w:a>w;o=0<=w?++a:--a)h[o]<g||h[o]>m||(t[n].push(h[o]),t[i].push(l));for(o=u=0,M=d.length;0<=M?u<M:u>M;o=0<=M?++u:--u)d[o]<g||d[o]>m||(c[n].push(d[o]),c[i].push(l))}return{major:t,minor:c}},e.prototype._get_loc=function(t){var e,r,n,o;return r=t.get("start"),e=t.get("end"),o=this.get("panel_side"),"left"===o||"below"===o?n="start":"right"!==o&&"above"!==o||(n="end"),t.get(n)},e}(s.Model),e.exports={Model:n,View:o}},{"../../core/layout/side_panel":"core/layout/side_panel","../../core/layout/solver":"core/layout/solver","../../core/logging":"core/logging","../../core/properties":"core/properties","../renderers/guide_renderer":"models/renderers/guide_renderer","../renderers/renderer":"models/renderers/renderer",underscore:"underscore"}],"models/axes/categorical_axis":[function(t,e,r){var n,o,i,s,a,l,u,h=function(t,e){function r(){this.constructor=t}for(var n in e)c.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},c={}.hasOwnProperty;l=t("underscore"),n=t("./axis"),s=t("../formatters/categorical_tick_formatter"),a=t("../tickers/categorical_ticker"),u=t("../../core/logging").logger,i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=i,e.prototype.type="CategoricalAxis",e.override({ticker:function(){return new a.Model},formatter:function(){return new s.Model}}),e.prototype._computed_bounds=function(){var t,e,r,n,o,i;return n=this.get("ranges"),e=n[0],t=n[1],i=null!=(o=this.get("bounds"))?o:"auto",r=[e.get("min"),e.get("max")],"auto"!==i&&u.warn("Categorical Axes only support user_bounds='auto', ignoring"),r},e}(n.Model),e.exports={Model:o,View:i}},{"../../core/logging":"core/logging","../formatters/categorical_tick_formatter":"models/formatters/categorical_tick_formatter","../tickers/categorical_ticker":"models/tickers/categorical_ticker","./axis":"models/axes/axis",underscore:"underscore"}],"models/axes/continuous_axis":[function(t,e,r){var n,o,i=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;n=t("./axis"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.type="ContinuousAxis",e}(n.Model),e.exports={Model:o}},{"./axis":"models/axes/axis"}],"models/axes/datetime_axis":[function(t,e,r){var n,o,i,s,a,l,u=function(t,e){function r(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},h={}.hasOwnProperty;l=t("underscore"),a=t("./axis"),i=t("../formatters/datetime_tick_formatter"),s=t("../tickers/datetime_ticker"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e}(a.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.default_view=o,e.prototype.type="DatetimeAxis",e.override({ticker:function(){return ne
|
||
|
m=Math.pow(this.souter_radius[h],2),c=Math.pow(this.sinner_radius[h],2),j=this.renderer.xmapper.map_to_target(D,!0),T=this.renderer.xmapper.map_to_target(this._x[h],!0),z=this.renderer.ymapper.map_to_target(F,!0),P=this.renderer.ymapper.map_to_target(this._y[h],!0),i=Math.pow(j-T,2)+Math.pow(z-P,2),i<=m&&i>=c&&n.push([h,i]);for(o=this.model.properties.direction.value(),u=[],_=0,f=n.length;_<f;_++)w=n[_],h=w[0],i=w[1],k=this.renderer.plot_view.canvas.vx_to_sx(E),S=this.renderer.plot_view.canvas.vy_to_sy(N),e=Math.atan2(S-this.sy[h],k-this.sx[h]),a(-e,-this._start_angle[h],-this._end_angle[h],o)&&u.push([h,i]);return M=l.create_hit_test_result(),M["1d"].indices=s.chain(u).sortBy(function(t){return t[1]}).map(function(t){return t[0]}).value(),M},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_area_legend(t,e,r,n,o)},e.prototype._scxy=function(t){var e,r;return r=(this.sinner_radius[t]+this.souter_radius[t])/2,e=(this._start_angle[t]+this._end_angle[t])/2,{x:this.sx[t]+r*Math.cos(e),y:this.sy[t]+r*Math.sin(e)}},e.prototype.scx=function(t){return this._scxy(t).x},e.prototype.scy=function(t){return this._scxy(t).y},e}(i.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=o,e.prototype.type="AnnularWedge",e.coords([["x","y"]]),e.mixins(["line","fill"]),e.define({direction:[u.Direction,"anticlock"],inner_radius:[u.DistanceSpec],outer_radius:[u.DistanceSpec],start_angle:[u.AngleSpec],end_angle:[u.AngleSpec]}),e}(i.Model),e.exports={Model:n,View:o}},{"../../common/hittest":"common/hittest","../../core/properties":"core/properties","../../core/util/math":"core/util/math","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/annulus":[function(t,e,r){var n,o,i,s,a,l,u=function(t,e){function r(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},h={}.hasOwnProperty;s=t("underscore"),i=t("./glyph"),a=t("../../common/hittest"),l=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._map_data=function(){return"data"===this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xmapper,this._x,this._inner_radius):this.sinner_radius=this._inner_radius,"data"===this.model.properties.outer_radius.units?this.souter_radius=this.sdist(this.renderer.xmapper,this._x,this._outer_radius):this.souter_radius=this._outer_radius},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f;for(d=r.sx,f=r.sy,p=r.sinner_radius,_=r.souter_radius,c=[],s=0,l=e.length;s<l;s++)if(o=e[s],!isNaN(d[o]+f[o]+p[o]+_[o])){if(i=navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>0||navigator.userAgent.indexOf("Edge")>0,this.visuals.fill.doit){if(this.visuals.fill.set_vectorize(t,o),t.beginPath(),i)for(h=[!1,!0],a=0,u=h.length;a<u;a++)n=h[a],t.arc(d[o],f[o],p[o],0,Math.PI,n),t.arc(d[o],f[o],_[o],Math.PI,0,!n);else t.arc(d[o],f[o],p[o],0,2*Math.PI,!0),t.arc(d[o],f[o],_[o],2*Math.PI,0,!1);t.fill()}this.visuals.line.doit?(this.visuals.line.set_vectorize(t,o),t.beginPath(),t.arc(d[o],f[o],p[o],0,2*Math.PI),t.moveTo(d[o]+_[o],f[o]),t.arc(d[o],f[o],_[o],0,2*Math.PI),c.push(t.stroke())):c.push(void 0)}return c},e.prototype._hit_point=function(t){var e,r,n,o,i,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T;for(p=[t.vx,t.vy],v=p[0],b=p[1],x=this.renderer.xmapper.map_from_target(v,!0),w=x-this.max_radius,M=x+this.max_radius,k=this.renderer.ymapper.map_from_target(b,!0),j=k-this.max_radius,T=k+this.max_radius,n=[],e=a.validate_bbox_coords([w,M],[j,T]),_=function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)c=n[t],o.push(c.i);return o}.call(this),l=0,u=_.length;l<u;l++)o=_[l],h=Math.pow(this.souter_radius[o],2),i=Math.pow(this.sinner_radius[o],2),f=this.renderer.xmapper.map_to_target(x),m=this.renderer.xmapper.map_to_target(this._x[o]),g=this.renderer.ymapper.map_to_target(k),y=thi
|
||
|
underscore:"underscore"}],"models/glyphs/image_rgba":[function(t,e,r){var n,o,i,s,a,l=function(t,e){function r(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},u={}.hasOwnProperty;s=t("underscore"),n=t("./glyph"),a=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._set_data=function(t,e){var r,n,o,i,a,l,u,h,c,p,_,d,f,m;for(null!=this.image_data&&this.image_data.length===this._image.length||(this.image_data=new Array(this._image.length)),null!=this._width&&this._width.length===this._image.length||(this._width=new Array(this._image.length)),null!=this._height&&this._height.length===this._image.length||(this._height=new Array(this._image.length)),m=[],u=p=0,d=this._image.length;0<=d?p<d:p>d;u=0<=d?++p:--p)if(null==e||u===e){if(null!=this._rows?(this._height[u]=this._rows[u],this._width[u]=this._cols[u]):(this._height[u]=this._image[u].length,this._width[u]=this._image[u][0].length),o=document.createElement("canvas"),o.width=this._width[u],o.height=this._height[u],a=o.getContext("2d"),h=a.getImageData(0,0,this._width[u],this._height[u]),null!=this._rows)h.data.set(new Uint8ClampedArray(this._image[u]));else{for(l=s.flatten(this._image[u]),r=new ArrayBuffer(4*l.length),i=new Uint32Array(r),c=_=0,f=l.length;0<=f?_<f:_>f;c=0<=f?++_:--_)i[c]=l[c];n=new Uint8ClampedArray(r),h.data.set(n)}a.putImageData(h,0,0),this.image_data[u]=o,this.max_dw=0,"data"===this._dw.units&&(this.max_dw=s.max(this._dw)),this.max_dh=0,"data"===this._dh.units?m.push(this.max_dh=s.max(this._dh)):m.push(void 0)}return m},e.prototype._map_data=function(){switch(this.model.properties.dw.units){case"data":this.sw=this.sdist(this.renderer.xmapper,this._x,this._dw,"edge",this.mget("dilate"));break;case"screen":this.sw=this._dw}switch(this.model.properties.dh.units){case"data":return this.sh=this.sdist(this.renderer.ymapper,this._y,this._dh,"edge",this.mget("dilate"));case"screen":return this.sh=this._dh}},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p;for(o=r.image_data,h=r.sx,c=r.sy,u=r.sw,l=r.sh,a=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),i=0,s=e.length;i<s;i++)n=e[i],isNaN(h[n]+c[n]+u[n]+l[n])||(p=c[n],t.translate(0,p),t.scale(1,-1),t.translate(0,-p),t.drawImage(o[n],0|h[n],0|c[n],u[n],l[n]),t.translate(0,p),t.scale(1,-1),t.translate(0,-p));return t.setImageSmoothingEnabled(a)},e.prototype.bounds=function(){var t;return t=this.index.data,{minX:t.minX,minY:t.minY,maxX:t.maxX+this.max_dw,maxY:t.maxY+this.max_dh}},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="ImageRGBA",e.coords([["x","y"]]),e.mixins([]),e.define({image:[a.NumberSpec],rows:[a.NumberSpec],cols:[a.NumberSpec],dw:[a.DistanceSpec],dh:[a.DistanceSpec],dilate:[a.Bool,!1]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.properties.rows.optional=!0,this.properties.cols.optional=!0},e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/image_url":[function(t,e,r){var n,o,i,s,a,l,u=function(t,e){function r(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},h={}.hasOwnProperty;s=t("underscore"),n=t("./glyph"),a=t("../../core/logging").logger,l=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.listenTo(this.model,"change:global_alpha",this.renderer.request_render)},e.prototype._index_data=function(){},e.prototype._set_data=function(){var t,e,r,n,o,i,s;for(null!=this.image&&this.image.length===this._url.length||(this.image=function(){var t,r,n,o;for(n=this._url,o=[],t=0,r=
|
||
|
t.prototype=new r,t.__super__=e.prototype,t},u={}.hasOwnProperty;s=t("underscore"),a=t("rbush"),n=t("./glyph"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._index_data=function(){var t,e,r,n,o;for(e=a(),n=[],t=r=0,o=this._x0.length;0<=o?r<o:r>o;t=0<=o?++r:--r)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t])||n.push({minX:Math.min(this._x0[t],this._x1[t]),minY:Math.min(this._y0[t],this._y1[t]),maxX:Math.max(this._x0[t],this._x1[t]),maxY:Math.max(this._y0[t],this._y1[t]),i:t});return e.load(n),e},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h;if(a=r.sx0,u=r.sy0,l=r.sx1,h=r.sy1,this.visuals.line.doit){for(s=[],o=0,i=e.length;o<i;o++)n=e[o],isNaN(a[n]+u[n]+l[n]+h[n])||(t.beginPath(),t.moveTo(a[n],u[n]),t.lineTo(l[n],h[n]),this.visuals.line.set_vectorize(t,n),s.push(t.stroke()));return s}},e.prototype.draw_legend=function(t,e,r,n,o){return this._generic_line_legend(t,e,r,n,o)},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="Segment",e.coords([["x0","y0"],["x1","y1"]]),e.mixins(["line"]),e}(n.Model),e.exports={Model:o,View:i}},{"./glyph":"models/glyphs/glyph",rbush:"rbush",underscore:"underscore"}],"models/glyphs/text":[function(t,e,r){var n,o,i,s,a,l=function(t,e){function r(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},u={}.hasOwnProperty;s=t("underscore"),n=t("./glyph"),a=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype._index_data=function(){return this._xy_index()},e.prototype._render=function(t,e,r){var n,o,i,s,a,l,u,h,c,p;for(c=r.sx,p=r.sy,i=r._x_offset,s=r._y_offset,n=r._angle,o=r._text,h=[],l=0,u=e.length;l<u;l++)a=e[l],isNaN(c[a]+p[a]+i[a]+s[a]+n[a])||null==o[a]||(this.visuals.text.doit?(t.save(),t.translate(c[a]+i[a],p[a]+s[a]),t.rotate(n[a]),this.visuals.text.set_vectorize(t,a),t.fillText(o[a],0,0),h.push(t.restore())):h.push(void 0));return h},e.prototype.draw_legend=function(t,e,r,n,o){return t.save(),this.text_props.set_value(t),t.font=this.text_props.font_value(),t.font=t.font.replace(/\b[\d\.]+[\w]+\b/,"10pt"),t.textAlign="right",t.textBaseline="middle",t.fillText("text",r,(n+o)/2),t.restore()},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.default_view=i,e.prototype.type="Text",e.coords([["x","y"]]),e.mixins(["text"]),e.define({text:[a.StringSpec,{field:"text"}],angle:[a.AngleSpec,0],x_offset:[a.NumberSpec,0],y_offset:[a.NumberSpec,0]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../core/properties":"core/properties","./glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/glyphs/vbar":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p=function(t,e){function r(){this.constructor=t}for(var n in e)_.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},_={}.hasOwnProperty;l=t("underscore"),c=t("rbush"),i=t("./quad"),o=t("./glyph"),n=t("../mappers/categorical_mapper"),u=t("../../common/hittest"),h=t("../../core/properties"),a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e.prototype._map_data=function(){var t,e,r,n,o;for(this.sx=this.renderer.xmapper.v_map_to_target(this._x),o=this.renderer.ymapper.v_map_to_target(this._top),n=this.renderer.ymapper.v_map_to_target(this._bottom),this.stop=this.plot_view.canvas.v_vy_to_sy(o),this.sbottom=this.plot_view.canvas.v_vy_to_sy(n),this.sleft=[],this.sright=[],this.sw=this.sdist(this.renderer.xmapper,this._x,this._width,"center"),t=e=0,r=this.sx.length;0<=r?e<r:e>r;t=0<=r?++e:--e)this.sleft.push(this.sx[t]-this.sw[t]/2),this.sright.push(this.sx[t]+this.sw[t]/2);return null},e.prototype._index_data=function(){var t,e,r,o,i,s,a,l,u,h,p,_,d,f;for(a=function(t,e){return t instanceof n.Model?t.v_map_to_target(e,!0):e},f=a(this.renderer.xmapper,this._x),d=a(this.renderer.xm
|
||
|
this.prog.set_attribute("a_angles","vec2",u.vbo_angles,0,2*c),this.prog.set_attribute("a_texcoord","vec2",u.vbo_texcoord,0,2*c),this.index_buffer.set_size(2*x.length),this.index_buffer.set_data(0,x),g.push(this.prog.draw(this.gl.TRIANGLES,this.index_buffer)));return g},e.prototype._set_data=function(){return this._bake(),this.vbo_position.set_size(4*this.V_position.length),this.vbo_position.set_data(0,this.V_position),this.vbo_tangents.set_size(4*this.V_tangents.length),this.vbo_tangents.set_data(0,this.V_tangents),this.vbo_angles.set_size(4*this.V_angles.length),this.vbo_angles.set_data(0,this.V_angles),this.vbo_texcoord.set_size(4*this.V_texcoord.length),this.vbo_texcoord.set_data(0,this.V_texcoord)},e.prototype._set_visuals=function(){var t,e,r,n,o,i,s;return e=l(this.glyph.visuals.line.line_color.value(),this.glyph.visuals.line.line_alpha.value()),t=this.CAPS[this.glyph.visuals.line.line_cap.value()],i=this.JOINS[this.glyph.visuals.line.line_join.value()],this.prog.set_uniform("u_color","vec4",e),this.prog.set_uniform("u_linewidth","float",[this.glyph.visuals.line.line_width.value()]),this.prog.set_uniform("u_antialias","float",[.9]),this.prog.set_uniform("u_linecaps","vec2",[t,t]),this.prog.set_uniform("u_linejoin","float",[i]),this.prog.set_uniform("u_miter_limit","float",[10]),n=this.glyph.visuals.line.line_dash.value(),r=0,o=1,n.length&&(s=this.dash_atlas.get_atlas_data(n),r=s[0],o=s[1]),this.prog.set_uniform("u_dash_index","float",[r]),this.prog.set_uniform("u_dash_phase","float",[this.glyph.visuals.line.line_dash_offset.value()]),this.prog.set_uniform("u_dash_period","float",[o]),this.prog.set_uniform("u_dash_caps","vec2",[t,t]),this.prog.set_uniform("u_closed","float",[0])},e.prototype._bake=function(){var t,e,r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N,O,q,D,I,R,F,B,L;for(x=this.nvertices,_=new Float64Array(this.glyph._x),d=new Float64Array(this.glyph._y),i=c=new Float32Array(2*x),n=new Float32Array(2*x),a=p=new Float32Array(4*x),u=new Float32Array(2*x),m=v=0,S=x;0<=S?v<S:v>S;m=0<=S?++v:--v)i[2*m+0]=_[m]+this._baked_offset[0],i[2*m+1]=d[m]+this._baked_offset[1];for(this.tangents=r=new Float32Array(2*x-2),m=k=0,z=x-1;0<=z?k<z:k>z;m=0<=z?++k:--k)r[2*m+0]=c[2*(m+1)+0]-c[2*m+0],r[2*m+1]=c[2*(m+1)+1]-c[2*m+1];for(m=j=0,P=x-1;0<=P?j<P:j>P;m=0<=P?++j:--j)a[4*(m+1)+0]=r[2*m+0],a[4*(m+1)+1]=r[2*m+1],a[4*m+2]=r[2*m+0],a[4*m+3]=r[2*m+1];for(a[0]=r[0],a[1]=r[1],a[4*(x-1)+2]=r[2*(x-2)+0],a[4*(x-1)+3]=r[2*(x-2)+1],t=new Float32Array(x),m=T=0,E=x;0<=E?T<E:T>E;m=0<=E?++T:--T)t[m]=Math.atan2(p[4*m+0]*p[4*m+3]-p[4*m+1]*p[4*m+2],p[4*m+0]*p[4*m+2]+p[4*m+1]*p[4*m+3]);for(m=D=0,A=x-1;0<=A?D<A:D>A;m=0<=A?++D:--D)n[2*m+0]=t[m],n[2*m+1]=t[m+1];for(b=4*x-4,this.V_position=s=new Float32Array(2*b),this.V_angles=o=new Float32Array(2*b),this.V_tangents=l=new Float32Array(4*b),this.V_texcoord=h=new Float32Array(2*b),M=2,m=I=0,C=x;0<=C?I<C:I>C;m=0<=C?++I:--I)for(g=R=0;R<4;g=++R){for(y=F=0;F<2;y=++F)s[2*(4*m+g-M)+y]=i[2*m+y],o[2*(4*m+g)+y]=n[2*m+y];for(y=B=0;B<4;y=++B)l[4*(4*m+g-M)+y]=a[4*m+y]}for(m=L=0,N=x;0<=N?L<=N:L>=N;m=0<=N?++L:--L)h[2*(4*m+0)+0]=-1,h[2*(4*m+1)+0]=-1,h[2*(4*m+2)+0]=1,h[2*(4*m+3)+0]=1,h[2*(4*m+0)+1]=-1,h[2*(4*m+1)+1]=1,h[2*(4*m+2)+1]=-1,h[2*(4*m+3)+1]=1;for(w=6*(x-1),this.I_triangles=e=new Uint32Array(w),q=[],m=f=0,O=x;0<=O?f<O:f>O;m=0<=O?++f:--f)e[6*m+0]=0+4*m,e[6*m+1]=1+4*m,e[6*m+2]=3+4*m,e[6*m+3]=2+4*m,e[6*m+4]=0+4*m,q.push(e[6*m+5]=3+4*m);return q},e.prototype._update_scale=function(t,e){var r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v;for(p=this.nvertices,c=4*p-4,n=this.tangents,r=new Float32Array(p-1),o=new Float32Array(2*p),this.V_segment=i=new Float32Array(2*c),a=h=0,m=p-1;0<=m?h<m:h>m;a=0<=m?++h:--h)r[a]=Math.sqrt(Math.pow(n[2*a+0]*t,2)+Math.pow(n[2*a+1]*e,2));for(s=0,a=_=0,g=p-1;0<=g?_<g:_>g;a=0<=g?++_:--_)s+=r[a],o[2*(a+1)+0]=s,o[2*a+1]=s;for(a=d=0,y=p;0<=y?d<y:d>y;a=0<=y?++d:--d)for(l=f=0;f<4;l=++f)for(u=v=0;v<2;u=++v)i[2*(4*a+l)+u]=o[2*a+u];return this.cumsum=s,this.vbo_segment.set_size(4*this.V_segment.length),this.vbo_segment.set_data(0,this.V_segment)},e}(n),e.exports={LineGLGlyph:i}},{"../../
|
||
|
r.push(h(l.whitespace.after,p.whitespace.before,0-this.spacing)),r.push(s(l.whitespace.after,p.whitespace.before,0-this.spacing)),l=p;return this._horizontal?this._has_var("width",f)&&r.push(i(l.span.start,l.span.size,[-1,this._width])):this._has_var("height",f)&&r.push(i(l.span.start,l.span.size,[-1,this._height])),r=r.concat(this._align_outer_edges_constraints(!0)),r=r.concat(this._align_outer_edges_constraints(!1)),r=r.concat(this._align_inner_cell_edges_constraints()),r=r.concat(this._box_equal_size_bounds(!0)),r=r.concat(this._box_equal_size_bounds(!1)),r=r.concat(this._box_cell_align_bounds(!0)),r=r.concat(this._box_cell_align_bounds(!1)),r=r.concat(this._box_whitespace(!0)),r=r.concat(this._box_whitespace(!1))},e.prototype._has_var=function(t,e){var r;return r="string"==typeof t?[t]:t,c.every(r,function(t){return m.call(e,t)>=0})},e.prototype._test_layoutable=function(t){var e,r,n,o,i;if(o=["origin-x","origin-y","whitespace-top","whitespace-right","whitespace-bottom","whitespace-left"],null==t.get_constrained_variables)throw new Error(t+" is missing get_constrained_variables method");for(i=t.get_constrained_variables(),e=0,n=o.length;e<n;e++){if(r=o[e],m.call(c.keys(i),r)<0)throw new Error(t+" is missing constrained_variable "+r);if(!i[r]instanceof u)throw new Error(t+" "+r+" is not a solver Variable")}return!0},e.prototype._child_rect=function(t){var e,r,n,o,i;return n=t.width,e=t.height,r=[t["origin-x"],t["origin-y"]],o=r[0],i=r[1],{x:o,y:i,width:n,height:e}},e.prototype._span=function(t){return this._horizontal?{start:t.x,size:t.width}:{start:t.y,size:t.height}},e.prototype._info=function(t){var e,r;return r=this._horizontal?{before:t["whitespace-left"],after:t["whitespace-right"]}:{before:t["whitespace-top"],after:t["whitespace-bottom"]},e=this._span(this._child_rect(t)),{span:e,whitespace:r}},e.prototype._flatten_cell_edge_variables=function(t){var r,n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w;for(x=t?e._top_bottom_inner_cell_edge_variables:e._left_right_inner_cell_edge_variables,r=t!==this._horizontal,l=this.get_layoutable_children(),o=l.length,h={},i=0,c=0,f=l.length;c<f;c++){for(a=l[c],s=a instanceof e?a._flatten_cell_edge_variables(t):{},n=a.get_constrained_variables(),p=0,m=x.length;p<m;p++)g=x[p],g in n&&(s[g]=[n[g]]);for(_ in s)w=s[_],r?(v=_.split(" "),d=v[0],b=v.length>1?v[1]:"",u=this._horizontal?"row":"col",y=d+" "+u+"-"+o+"-"+i+"-"+b):y=_,y in h?h[y]=h[y].concat(w):h[y]=w;i+=1}return h},e.prototype._align_inner_cell_edges_constraints=function(){var t,e,r,n,o,s,a,l;if(t=[],this._is_root){e=this._flatten_cell_edge_variables(this._horizontal);for(o in e)if(l=e[o],l.length>1)for(s=l[0],r=n=1,a=l.length;1<=a?n<a:n>a;r=1<=a?++n:--n)t.push(i(l[r],[-1,s]))}return t},e.prototype._find_edge_leaves=function(t){var r,n,o,i,s,a,l,u;if(o=this.get_layoutable_children(),a=[[],[]],o.length>0)if(this._horizontal===t)u=o[0],i=o[o.length-1],u instanceof e?a[0]=a[0].concat(u._find_edge_leaves(t)[0]):a[0].push(u),i instanceof e?a[1]=a[1].concat(i._find_edge_leaves(t)[1]):a[1].push(i);else for(s=0,l=o.length;s<l;s++)r=o[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,o,s,a,l,u,h,c;return a=this._find_edge_leaves(t),h=a[0],o=a[1],t?(c="on-edge-align-left",s="on-edge-align-right"):(c="on-edge-align-top",s="on-edge-align-bottom"),r=function(t,e){var r,n,o,i,s;for(r=[],n=0,i=t.length;n<i;n++)o=t[n],s=o.get_constrained_variables(),e in s&&r.push(s[e]);return r},u=r(h,c),n=r(o,s),l=[],e=function(t){var e,r,n,o,s;if(t.length>1){for(r=t[0],n=o=1,s=t.length;1<=s?o<s:o>s;n=1<=s?++o:--o)e=t[n],l.push(i([-1,r],e));return null}},e(u),e(n),l},e.prototype._box_insets_from_child_insets=function(t,e,r,n){var o,a,l,u,h,c,p,_,d;return c=this._find_edge_leaves(t),_=c[0],a=c[1],t?(d=e+"-left",l=e+"-right",h=this[r+"_left"],u=this[r+"_right"]):(d=e+"-top",l=e+"-bottom",h=this[r+"_top"],u=this[r+"_bottom"]),p=[],o=function(t,e,r){var o,a,l,u,h;for(o=[],a=0,u=e.length;a<u;a++)l=e[a],h=l.get_constrained_v
|
||
|
this._render_one(t,i,h[i],c[i],l,this.visuals.line,this.visuals.fill),n[i]&&t.rotate(-n[i]),u.push(t.translate(-h[i],-c[i])));return u},e.prototype._index_data=function(){return this._xy_index()},e.prototype._mask_data=function(t){var e,r,n,o,i,s,l,u,h,c,p,_,d,f;return r=this.renderer.plot_view.frame.get("h_range"),s=r.get("start")-this.max_size,l=r.get("end")+this.max_size,n=this.renderer.xmapper.v_map_from_target([s,l],!0),p=n[0],_=n[1],i=this.renderer.plot_view.frame.get("v_range"),u=i.get("start")-this.max_size,h=i.get("end")+this.max_size,o=this.renderer.ymapper.v_map_from_target([u,h],!0),d=o[0],f=o[1],e=a.validate_bbox_coords([p,_],[d,f]),function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)c=n[t],o.push(c.i);return o}.call(this)},e.prototype._hit_point=function(t){var e,r,n,o,i,l,u,h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S;for(h=[t.vx,t.vy],g=h[0],b=h[1],f=this.renderer.plot_view.canvas.vx_to_sx(g),m=this.renderer.plot_view.canvas.vy_to_sy(b),y=g-this.max_size,v=g+this.max_size,c=this.renderer.xmapper.v_map_from_target([y,v],!0),k=c[0],j=c[1],x=b-this.max_size,w=b+this.max_size,p=this.renderer.ymapper.v_map_from_target([x,w],!0),T=p[0],S=p[1],e=a.validate_bbox_coords([k,j],[T,S]),r=function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)M=n[t],o.push(M.i);return o}.call(this),o=[],l=0,u=r.length;l<u;l++)i=r[l],d=this._size[i]/2,n=Math.abs(this.sx[i]-f)+Math.abs(this.sy[i]-m),Math.abs(this.sx[i]-f)<=d&&Math.abs(this.sy[i]-m)<=d&&o.push([i,n]);return _=a.create_hit_test_result(),_["1d"].indices=s.chain(o).sortBy(function(t){return t[1]}).map(function(t){return t[0]}).value(),_},e.prototype._hit_rect=function(t){var e,r,n,o,i,s,l,u,h;return r=this.renderer.xmapper.v_map_from_target([t.vx0,t.vx1],!0),s=r[0],l=r[1],n=this.renderer.ymapper.v_map_from_target([t.vy0,t.vy1],!0),u=n[0],h=n[1],e=a.validate_bbox_coords([s,l],[u,h]),o=a.create_hit_test_result(),o["1d"].indices=function(){var t,r,n,o;for(n=this.index.search(e),o=[],t=0,r=n.length;t<r;t++)i=n[t],o.push(i.i);return o}.call(this),o},e.prototype._hit_poly=function(t){var e,r,n,o,i,s,l,u,h,c,p,_,d;for(s=[t.vx,t.vy],_=s[0],d=s[1],c=this.renderer.plot_view.canvas.v_vx_to_sx(_),p=this.renderer.plot_view.canvas.v_vy_to_sy(d),e=function(){h=[];for(var t=0,e=this.sx.length;0<=e?t<e:t>e;0<=e?t++:t--)h.push(t);return h}.apply(this),r=[],n=i=0,l=e.length;0<=l?i<l:i>l;n=0<=l?++i:--i)o=e[n],a.point_in_poly(this.sx[n],this.sy[n],c,p)&&r.push(o);return u=a.create_hit_test_result(),u["1d"].indices=r,u},e}(n.View),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.coords([["x","y"]]),e.mixins(["line","fill"]),e.define({size:[l.DistanceSpec,{units:"screen",value:4}],angle:[l.AngleSpec,0]}),e}(n.Model),e.exports={Model:o,View:i}},{"../../common/hittest":"common/hittest","../../core/properties":"core/properties","../glyphs/glyph":"models/glyphs/glyph",underscore:"underscore"}],"models/plots/gmap_plot":[function(t,e,r){var n,o,i,s,a,l,u,h,c,p=function(t,e){function r(){this.constructor=t}for(var n in e)_.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},_={}.hasOwnProperty;a=t("underscore"),h=t("proj4"),c=h.defs("GOOGLE"),l=t("../../core/logging").logger,o=t("./gmap_plot_canvas"),s=t("./plot"),u=t("../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e}(s.View),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return p(e,t),e.prototype.type="GMapPlot",e.prototype.default_view=i,e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.api_key||l.error("api_key is required. See https://developers.google.com/maps/documentation/javascript/get-api-key for more information on how to obtain your own."),this._plot_canvas=new o.Model({plot:this}),this.plot_canvas.toolbar=this.toolbar},e.define({map_options:[u.Any],api_key:[u.String]}),e}(s.Model),e.exports={Model:n,View:i}},{"../../core/logging":"core/logging","../../core/properties":"core/
|
||
|
}},e.prototype.resize=function(){var t,e,r,n;n=this.model._width._value,e=this.model._height._value,this.canvas_view.set_dims([n,e],!0),this.canvas_view.prepare_canvas();try{this.update_constraints()}catch(t){r=t}return this.$el.css({position:"absolute",left:this.model._dom_left._value,top:this.model._dom_top._value,width:this.model._width._value,height:this.model._height._value})},e.prototype.update_constraints=function(){var t,e,r,n;r=this.model.document.solver(),r.suggest_value(this.frame._width,this.canvas.get("width")-1),r.suggest_value(this.frame._height,this.canvas.get("height")-1),e=this.renderer_views;for(t in e)n=e[t],null!=n.model.panel&&k(n);return r.update_variables(!1)},e.prototype._render_levels=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,g;for(t.save(),null!=r&&(t.beginPath(),t.rect.apply(t,r),t.clip(),t.beginPath()),o={},p=this.model.plot.renderers,n=i=0,a=p.length;i<a;n=++i)_=p[n],o[_.id]=n;for(g=function(t){return o[t.model.id]},s=0,l=e.length;s<l;s++)for(h=e[s],f=m.sortBy(m.values(this.levels[h]),g),c=0,u=f.length;c<u;c++)d=f[c],d.render();return t.restore()},e.prototype._map_hook=function(t,e){},e.prototype._paint_empty=function(t,e){if(t.clearRect(0,0,this.canvas_view.mget("width"),this.canvas_view.mget("height")),this.visuals.border_fill.doit&&(this.visuals.border_fill.set_value(t),t.fillRect(0,0,this.canvas_view.mget("width"),this.canvas_view.mget("height")),t.clearRect.apply(t,e)),this.visuals.background_fill.doit)return this.visuals.background_fill.set_value(t),t.fillRect.apply(t,e)},e}(d.View),p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return T(e,t),e.prototype.type="PlotCanvas",e.prototype.default_view=_,e.prototype.initialize=function(t,r){var n;return e.__super__.initialize.call(this,t,r),this.canvas=new o.Model({map:null!=(n=this.use_map)&&n,initial_width:this.plot.plot_width,initial_height:this.plot.plot_height,use_hidpi:this.plot.hidpi}),this.frame=new i.Model({x_range:this.plot.x_range,extra_x_ranges:this.plot.extra_x_ranges,x_mapper_type:this.plot.x_mapper_type,y_range:this.plot.y_range,extra_y_ranges:this.plot.extra_y_ranges,y_mapper_type:this.plot.y_mapper_type}),this.above_panel=new h.Model,this.below_panel=new h.Model,this.left_panel=new h.Model,this.right_panel=new h.Model,b.debug("PlotCanvas initialized")},e.prototype.add_renderer_to_canvas_side=function(t,e){if("center"!==e)return t.add_panel(e)},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),b.debug("PlotCanvas attached to document")},e.override({sizing_mode:"stretch_both"}),e.internal({plot:[x.Instance],toolbar:[x.Instance],canvas:[x.Instance],frame:[x.Instance]}),e.prototype.get_layoutable_children=function(){var t,e,r,n,o,i,s,a,l;for(t=[this.above_panel,this.below_panel,this.left_panel,this.right_panel,this.canvas,this.frame],a=["above","below","left","right"],e=0,o=a.length;e<o;e++)for(l=a[e],n=this.plot.get(l),r=0,i=n.length;r<i;r++)s=n[r],null!=s.panel&&t.push(s.panel);return t},e.prototype.get_edit_variables=function(){var t,e,r,n,o;for(e=[],o=this.get_layoutable_children(),r=0,n=o.length;r<n;r++)t=o[r],e=e.concat(t.get_edit_variables());return e},e.prototype.get_constraints=function(){var t,r,n,o,i;for(r=e.__super__.get_constraints.call(this),r=r.concat(this._get_constant_constraints()),r=r.concat(this._get_side_constraints()),i=this.get_layoutable_children(),n=0,o=i.length;n<o;n++)t=i[n],r=r.concat(t.get_constraints());return r},e.prototype._get_constant_constraints=function(){var t,e,r,n,o;return o=this.plot.min_border_top,e=this.plot.min_border_bottom,r=this.plot.min_border_left,n=this.plot.min_border_right,t=[],t.push(l(this.above_panel._height,-o)),t.push(l(this.below_panel._height,-e)),t.push(l(this.left_panel._width,-r)),t.push(l(this.right_panel._width,-n)),t.push(a(this.above_panel._top,[-1,this.canvas._t
|
||
|
for(l=r.get("data"),u=r.columns(),i=0,s=u.length;i<s;i++)o=u[i],n[o]=l[o].concat(n[o]).slice(-e);r.set("data",n)}else a.error("unsupported mode: "+t);return a.trace(n),null}}(this)).error(function(){return a.error(arguments)}),null},e}(i.Model),e.exports={Model:o}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","./remote_data_source":"models/sources/remote_data_source",jquery:"jquery",underscore:"underscore"}],"models/sources/column_data_source":[function(t,e,r){var n,o,i,s,a,l,u,h=function(t,e){function r(){this.constructor=t}for(var n in e)c.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},c={}.hasOwnProperty;s=t("underscore"),o=t("./data_source"),a=t("../../common/hittest"),i=t("../../common/selection_manager"),l=t("../../core/logging").logger,u=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.type="ColumnDataSource",e.define({data:[u.Any,{}],column_names:[u.Array,[]]}),e.internal({selection_manager:[u.Instance,function(t){return new i({source:t})}],inspected:[u.Any]}),e.prototype.get_column=function(t){var e;return null!=(e=this.get("data")[t])?e:null},e.prototype.get_length=function(){var t,e,r,n;return t=this.get("data"),0===s.keys(t).length?null:(r=s.uniq(function(){var r;r=[];for(e in t)n=t[e],r.push(n.length);return r}()),r.length>1&&l.debug("data source has columns of inconsistent lengths"),r[0])},e.prototype.columns=function(){return s.keys(this.get("data"))},e.prototype.stream=function(t,e){var r,n,o;r=this.get("data");for(n in t)o=t[n],r[n]=r[n].concat(t[n]),r[n].length>e&&(r[n]=r[n].slice(-e));return this.set("data",r,{silent:!0}),this.trigger("stream")},e.prototype.patch=function(t){var e,r,n,o,i,s,a,l,u;e=this.get("data");for(i in t)for(s=t[i],r=o=0,a=s.length;0<=a?o<a:o>a;r=0<=a?++o:--o)l=s[r],n=l[0],u=l[1],e[i][n]=u;return this.set("data",e,{silent:!0}),this.trigger("patch")},e}(o.Model),e.exports={Model:n}},{"../../common/hittest":"common/hittest","../../common/selection_manager":"common/selection_manager","../../core/logging":"core/logging","../../core/properties":"core/properties","./data_source":"models/sources/data_source",underscore:"underscore"}],"models/sources/data_source":[function(t,e,r){var n,o,i,s,a,l=function(t,e){function r(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},u={}.hasOwnProperty;i=t("underscore"),o=t("../../model"),s=t("../../common/hittest"),a=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="DataSource",e.define({selected:[a.Any,s.create_hit_test_result()],callback:[a.Any]}),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.listenTo(this,"change:selected",function(t){return function(){var e;if(e=t.get("callback"),null!=e)return i.isFunction(e)?e(t):e.execute(t)}}(this))},e}(o),e.exports={Model:n}},{"../../common/hittest":"common/hittest","../../core/properties":"core/properties","../../model":"model",underscore:"underscore"}],"models/sources/geojson_data_source":[function(t,e,r){var n,o,i,s,a,l=function(t,e){function r(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},u={}.hasOwnProperty;i=t("underscore"),n=t("./column_data_source"),s=t("../../core/logging").logger,a=t("../../core/properties"),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.type="GeoJSONDataSource",e.define({geojson:[a.Any]}),e.prototype.initialize=function(t){return e.__super__.initialize.call(this,t),this.geojson_to_column_data(),this.define_computed_property("data",this.geojson_to_column_data,!0),this.add_dependencies("data",this,["geojson"])},e.prototype._get_new_list_array=function(t){var e,r;return e=new Array(t),r=i.map(e,function(t){return[]})},e.prototype._get_new_nan_array=function(t){
|
||
|
s.replace("{XMIN}",t).replace("{YMIN}",e).replace("{XMAX}",r).replace("{YMAX}",n).replace("{WIDTH}",i).replace("{HEIGHT}",o)},e}(o),e.exports={Model:n}},{"../../core/logging":"core/logging","../../core/properties":"core/properties","../../model":"model",underscore:"underscore"}],"models/tiles/mercator_tile_source":[function(t,e,r){var n,o,i,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;i=t("underscore"),o=t("./tile_source"),s=t("../../core/properties"),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.prototype.type="MercatorTileSource",e.define({wrap_around:[s.Bool,!0]}),e.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097}),e.prototype.initialize=function(t){var r;return e.__super__.initialize.call(this,t),this._resolutions=function(){var t,e;for(e=[],r=t=0;t<=30;r=++t)e.push(this.get_resolution(r));return e}.call(this)},e.prototype._computed_initial_resolution=function(){return null!=this.get("initial_resolution")?this.get("initial_resolution"):2*Math.PI*6378137/this.get("tile_size")},e.prototype.is_valid_tile=function(t,e,r){return!(!this.get("wrap_around")&&(t<0||t>=Math.pow(2,r)))&&!(e<0||e>=Math.pow(2,r))},e.prototype.retain_children=function(t){var e,r,n,o,i,s,a;o=t.quadkey,n=o.length,r=n+3,i=this.tiles,s=[];for(e in i)a=i[e],0===a.quadkey.indexOf(o)&&a.quadkey.length>n&&a.quadkey.length<=r?s.push(a.retain=!0):s.push(void 0);return s},e.prototype.retain_neighbors=function(t){var e,r,n,o,s,a,l,u,h,c,p,_,d;r=4,s=t.tile_coords,h=s[0],c=s[1],p=s[2],n=function(){var t,e,n,o;for(o=[],_=t=e=h-r,n=h+r;e<=n?t<=n:t>=n;_=e<=n?++t:--t)o.push(_);return o}(),o=function(){var t,e,n,o;for(o=[],d=t=e=c-r,n=c+r;e<=n?t<=n:t>=n;d=e<=n?++t:--t)o.push(d);return o}(),a=this.tiles,l=[];for(e in a)u=a[e],u.tile_coords[2]===p&&i.contains(n,u.tile_coords[0])&&i.contains(o,u.tile_coords[1])?l.push(u.retain=!0):l.push(void 0);return l},e.prototype.retain_parents=function(t){var e,r,n,o,i;r=t.quadkey,n=this.tiles,o=[];for(e in n)i=n[e],o.push(i.retain=0===r.indexOf(i.quadkey));return o},e.prototype.children_by_tile_xyz=function(t,e,r){var n,o,i,s,a,l,u,h,c;for(c=this.calculate_world_x_by_tile_xyz(t,e,r),0!==c&&(l=this.normalize_xyz(t,e,r),t=l[0],e=l[1],r=l[2]),a=this.tile_xyz_to_quadkey(t,e,r),o=[],i=s=0;s<=3;i=s+=1)u=this.quadkey_to_tile_xyz(a+i.toString()),t=u[0],e=u[1],r=u[2],0!==c&&(h=this.denormalize_xyz(t,e,r,c),t=h[0],e=h[1],r=h[2]),n=this.get_tile_meter_bounds(t,e,r),null!=n&&o.push([t,e,r,n]);return o},e.prototype.parent_by_tile_xyz=function(t,e,r){var n,o;return o=this.tile_xyz_to_quadkey(t,e,r),n=o.substring(0,o.length-1),this.quadkey_to_tile_xyz(n)},e.prototype.get_resolution=function(t){return this._computed_initial_resolution()/Math.pow(2,t)},e.prototype.get_resolution_by_extent=function(t,e,r){var n,o;return n=(t[2]-t[0])/r,o=(t[3]-t[1])/e,[n,o]},e.prototype.get_level_by_extent=function(t,e,r){var n,o,i,s,a,l,u,h;for(u=(t[2]-t[0])/r,h=(t[3]-t[1])/e,l=Math.max(u,h),n=0,a=this._resolutions,o=0,i=a.length;o<i;o++){if(s=a[o],l>s){if(0===n)return 0;if(n>0)return n-1}n+=1}},e.prototype.get_closest_level_by_extent=function(t,e,r){var n,o,i,s,a;return s=(t[2]-t[0])/r,a=(t[3]-t[1])/e,o=Math.max(s,a),i=this._resolutions,n=this._resolutions.reduce(function(t,e){return Math.abs(e-o)<Math.abs(t-o)?e:t}),this._resolutions.indexOf(n)},e.prototype.snap_to_zoom=function(t,e,r,n){var o,i,s,a,l,u,h,c,p;return o=this._resolutions[n],i=r*o,s=e*o,u=t[0],p=t[1],l=t[2],c=t[3],a=(i-(l-u))/2,h=(s-(c-p))/2,[u-a,p-h,l+a,c+h]},e.prototype.tms_to_wmts=function(t,e,r){"Note this works both ways";return[t,Math.pow(2,r)-1-e,r]},e.prototype.wmts_to_tms=function(t,e,r){"Note this works both ways";return[t,Math.pow(2,r)-1-e,r]},e.prototype.pixels_to_meters=function(t,e,r){var n,o,i;return i=this.get_resolution(r),n=t*i-this.get("x_origin_offset"),o=e*i-this.get("y_origin_offset"),[n,o]},e.prototype.meters_to_pixels=function(t,e
|
||
|
this.mget("overlay").update({left:null,right:null,top:null,bottom:null}),this._baseboint=null,this.plot_view.push_state("box_select",{selection:this.plot_view.get_selection()}),null},e.prototype._select=function(t,e,r,n){var o,i,s,a,l,u,h,c,p,_,d;for(c=t[0],p=t[1],_=e[0],d=e[1],null==n&&(n=!1),i={type:"rect",vx0:c,vx1:p,vy0:_,vy1:d},u=this.mget("computed_renderers"),s=0,a=u.length;s<a;s++)l=u[s],o=l.get("data_source"),h=o.get("selection_manager"),h.select(this,this.plot_view.renderer_views[l.id],i,r,n);return null!=this.mget("callback")&&this._emit_callback(i),this._save_geometry(i,r,n),null},e.prototype._emit_callback=function(t){var e,r,n,o,i;n=this.mget("computed_renderers")[0],e=this.plot_model.get("canvas"),r=this.plot_model.get("frame"),t.sx0=e.vx_to_sx(t.vx0),t.sx1=e.vx_to_sx(t.vx1),t.sy0=e.vy_to_sy(t.vy0),t.sy1=e.vy_to_sy(t.vy1),o=r.get("x_mappers")[n.get("x_range_name")],i=r.get("y_mappers")[n.get("y_range_name")],t.x0=o.map_from_target(t.vx0),t.x1=o.map_from_target(t.vx1),t.y0=i.map_from_target(t.vy0),t.y1=i.map_from_target(t.vy1),this.mget("callback").execute(this.model,{geometry:t})},e}(a.View),s=function(){return new n.Model({level:"overlay",render_mode:"css",top_units:"screen",left_units:"screen",bottom_units:"screen",right_units:"screen",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]})},o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype.default_view=i,e.prototype.type="BoxSelectTool",e.prototype.tool_name="Box Select",e.prototype.icon="bk-tool-icon-box-select",e.prototype.event_type="pan",e.prototype.default_order=30,e.define({dimensions:[u.Array,["width","height"]],select_every_mousemove:[u.Bool,!1],callback:[u.Instance],overlay:[u.Instance,s]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.override_computed_property("tooltip",function(){return this._get_dim_tooltip(this.tool_name,this._check_dims(this.get("dimensions"),"box select tool"))},!1),this.add_dependencies("tooltip",this,["dimensions"])},e}(a.Model),e.exports={Model:o,View:i}},{"../../../core/properties":"core/properties","../../annotations/box_annotation":"models/annotations/box_annotation","./select_tool":"models/tools/gestures/select_tool",underscore:"underscore"}],"models/tools/gestures/box_zoom_tool":[function(t,e,r){var n,o,i,s,a,l,u,h=function(t,e){function r(){this.constructor=t}for(var n in e)c.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},c={}.hasOwnProperty;l=t("underscore"),a=t("./gesture_tool"),n=t("../../annotations/box_annotation"),u=t("../../../core/properties"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e.prototype._match_aspect=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_,d,f,m,g,y,v,b;return s=r.get("h_range").get("end"),a=r.get("h_range").get("start"),d=r.get("v_range").get("end"),m=r.get("v_range").get("start"),y=s-a,i=d-m,n=y/i,g=Math.abs(t[0]-e[0]),f=Math.abs(t[1]-e[1]),_=0===f?0:g/f,_>=n?(u=[1,_/n],v=u[0],b=u[1]):(h=[n/_,1],v=h[0],b=h[1]),t[0]<=e[0]?(l=t[0],c=t[0]+g*v,c>s&&(c=s)):(c=t[0],l=t[0]-g*v,l<a&&(l=a)),g=Math.abs(c-l),t[1]<=e[1]?(o=t[1],p=t[1]+g/n,p>d&&(p=d)):(p=t[1],o=t[1]-g/n,o<m&&(o=m)),f=Math.abs(p-o),t[0]<=e[0]?c=t[0]+n*f:l=t[0]-n*f,[[l,c],[o,p]]},e.prototype._pan_start=function(t){var e;return e=this.plot_view.canvas,this._baseboint=[e.sx_to_vx(t.bokeh.sx),e.sy_to_vy(t.bokeh.sy)],null},e.prototype._pan=function(t){var e,r,n,o,i,s,a,l;return e=this.plot_view.canvas,r=[e.sx_to_vx(t.bokeh.sx),e.sy_to_vy(t.bokeh.sy)],o=this.plot_model.get("frame"),n=this.mget("dimensions"),this.mget("match_aspect")&&2===n.length?(i=this._match_aspect(this._baseboint,r,o),a=i[0],l=i[1]):(s=this.model._get_dim_limits(this._baseboint,r,o,n),a=s[0],l=s[1]),this.mget("overlay").update({left:a[0],right:a[1],top:l[1],bottom:l[0]}),null},e.prototype._pan_end=function(t){var e,r,n,o,i,s,a,l;return e=this.plot_view.canvas,r=[e.sx_to_vx(t.bokeh.sx),e.sy_to_vy(t.bokeh.sy)],o=this.plot_model.get("
|
||
|
},J.add(U,Y,this._render_tooltips(n,y,Q));return null}},e.prototype._emit_callback=function(t){var e,r,n,o,i,s,a,l,u,c;a=this.mget("computed_renderers")[0],i=this.plot_view.renderer_views[a.id].hit_test(t),r=this.plot_model.canvas,o=this.plot_model.frame,t.sx=r.vx_to_sx(t.vx),t.sy=r.vy_to_sy(t.vy),u=o.get("x_mappers")[a.get("x_range_name")],c=o.get("y_mappers")[a.get("y_range_name")],t.x=u.map_from_target(t.vx),t.y=c.map_from_target(t.vy),e=this.model.callback,l=[e,{index:i,geometry:t}],s=l[0],n=l[1],h.isFunction(e)?e(s,n):e.execute(s,n)},e.prototype._render_tooltips=function(t,e,r){var o,i,s,a,l,p,_,d,f,m,g,y,v,b,x,w,M,k;if(M=this.mget("tooltips"),h.isString(M))return n("<div>").html(u.replace_placeholders(M,t,e,r));if(h.isFunction(M))return M(t,r);for(x=n("<table></table>"),l=0,_=M.length;l<_;l++){if(m=M[l],p=m[0],k=m[1],y=n("<tr></tr>"),y.append(n("<td class='bk-tooltip-row-label'>").text(p+": ")),w=n("<td class='bk-tooltip-row-value'></td>"),k.indexOf("$color")>=0){if(g=k.match(/\$color(\[.*\])?:(\w*)/),d=g[0],f=g[1],o=g[2],s=t.get_column(o),null==s){v=n("<span>").text(o+" unknown"),w.append(v);continue}if(a=(null!=f?f.indexOf("hex"):void 0)>=0,b=(null!=f?f.indexOf("swatch"):void 0)>=0,i=s[e],null==i){v=n("<span>(null)</span>"),w.append(v);continue}a&&(i=c(i)),v=n("<span>").text(i),w.append(v),b&&(v=n("<span class='bk-tooltip-color-block'> </span>"),v.css({backgroundColor:i})),w.append(v)}else k=k.replace("$~","$data_"),k=u.replace_placeholders(k,t,e,r),w.append(n("<span>").html(k));y.append(w),x.append(y)}return x},e}(a.View),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,t),e.prototype.default_view=s,e.prototype.type="HoverTool",e.prototype.tool_name="Hover Tool",e.prototype.icon="bk-tool-icon-hover",e.define({tooltips:[d.Any,[["index","$index"],["data (x, y)","($x, $y)"],["canvas (x, y)","($sx, $sy)"]]],renderers:[d.Array,[]],names:[d.Array,[]],mode:[d.String,"mouse"],point_policy:[d.String,"snap_to_data"],line_policy:[d.String,"prev"],show_arrow:[d.Boolean,!0],anchor:[d.String,"center"],attachment:[d.String,"horizontal"],callback:[d.Any]}),e.prototype.initialize=function(t,r){return e.__super__.initialize.call(this,t,r),this.define_computed_property("computed_renderers",function(){var t,e,r,n;return n=this.get("renderers"),e=this.get("names"),0===n.length&&(t=this.get("plot").get("renderers"),n=function(){var e,n,i;for(i=[],e=0,n=t.length;e<n;e++)r=t[e],r instanceof o.Model&&i.push(r);return i}()),e.length>0&&(n=function(){var t,o,i;for(i=[],t=0,o=n.length;t<o;t++)r=n[t],e.indexOf(r.get("name"))>=0&&i.push(r);return i}()),n},!0),this.add_dependencies("computed_renderers",this,["renderers","names","plot"]),this.add_dependencies("computed_renderers",this.get("plot"),["renderers"]),this.define_computed_property("ttmodels",function(){var t,e,r,n,o,i,s;if(s={},i=this.get("tooltips"),null!=i)for(n=this.get("computed_renderers"),t=0,e=n.length;t<e;t++)r=n[t],o=new l.Model({custom:h.isString(i)||h.isFunction(i),attachment:this.attachment,show_arrow:this.show_arrow}),s[r.id]=o;return s},!0),this.add_dependencies("ttmodels",this,["computed_renderers","tooltips"]),this.override_computed_property("synthetic_renderers",function(){return h.values(this.get("ttmodels"))},!0),this.add_dependencies("synthetic_renderers",this,["ttmodels"])},e}(a.Model),e.exports={Model:i,View:s}},{"../../../common/hittest":"common/hittest","../../../core/logging":"core/logging","../../../core/properties":"core/properties","../../../util/util":"util/util","../../annotations/tooltip":"models/annotations/tooltip","../../renderers/glyph_renderer":"models/renderers/glyph_renderer","./inspect_tool":"models/tools/inspectors/inspect_tool",jquery:"jquery",underscore:"underscore"}],"models/tools/inspectors/inspect_tool":[function(t,e,r){var n,o,i,s,a,l,u,h=function(t,e){function r(){this.constructor=t}for(var n in e)c.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},c={}.hasOwnProperty;l=t("underscore"),n=t("backbone"),a=t("../tool"),u=t("./inspect_tool_list_item_t
|
||
|
},PuRd:{PuRd3:[14490743,13210823,15196655],PuRd4:[13505110,14640560,14136792,15855350],PuRd5:[9961539,14490743,14640560,14136792,15855350],PuRd6:[9961539,14490743,14640560,13210823,13941210,15855350],PuRd7:[9502783,13505110,15149450,14640560,13210823,13941210,15855350],PuRd8:[9502783,13505110,15149450,14640560,13210823,13941210,15196655,16250105],PuRd9:[6750239,9961539,13505110,15149450,14640560,13210823,13941210,15196655,16250105]},OrRd:{OrRd3:[14895667,16628612,16705736],OrRd4:[14102559,16551257,16632970,16707801],OrRd5:[11730944,14895667,16551257,16632970,16707801],OrRd6:[11730944,14895667,16551257,16628612,16635038,16707801],OrRd7:[10027008,14102559,15689032,16551257,16628612,16635038,16707801],OrRd8:[10027008,14102559,15689032,16551257,16628612,16635038,16705736,16775148],OrRd9:[8323072,11730944,14102559,15689032,16551257,16628612,16635038,16705736,16775148]},YlOrRd:{YlOrRd3:[15743776,16691788,16772512],YlOrRd4:[14883356,16616764,16698460,16777138],YlOrRd5:[12386342,15743776,16616764,16698460,16777138],YlOrRd6:[12386342,15743776,16616764,16691788,16701814,16777138],YlOrRd7:[11599910,14883356,16535082,16616764,16691788,16701814,16777138],YlOrRd8:[11599910,14883356,16535082,16616764,16691788,16701814,16772512,16777164],YlOrRd9:[8388646,12386342,14883356,16535082,16616764,16691788,16701814,16772512,16777164]},YlOrBr:{YlOrBr3:[14245646,16696399,16775100],YlOrBr4:[13388802,16685353,16701838,16777172],YlOrBr5:[10040324,14245646,16685353,16701838,16777172],YlOrBr6:[10040324,14245646,16685353,16696399,16704401,16777172],YlOrBr7:[9186564,13388802,15495188,16685353,16696399,16704401,16777172],YlOrBr8:[9186564,13388802,15495188,16685353,16696399,16704401,16775100,16777189],YlOrBr9:[6694150,10040324,13388802,15495188,16685353,16696399,16704401,16775100,16777189]},Purples:{Purples3:[7695281,12369372,15724021],Purples4:[6967715,10394312,13355490,15921399],Purples5:[5515151,7695281,10394312,13355490,15921399],Purples6:[5515151,7695281,10394312,12369372,14342891,15921399],Purples7:[4854918,6967715,8420794,10394312,12369372,14342891,15921399],Purples8:[4854918,6967715,8420794,10394312,12369372,14342891,15724021,16579581],Purples9:[4128893,5515151,6967715,8420794,10394312,12369372,14342891,15724021,16579581]},Blues:{Blues3:[3244733,10406625,14609399],Blues4:[2191797,7057110,12441575,15725567],Blues5:[545180,3244733,7057110,12441575,15725567],Blues6:[545180,3244733,7057110,10406625,13032431,15725567],Blues7:[542100,2191797,4362950,7057110,10406625,13032431,15725567],Blues8:[542100,2191797,4362950,7057110,10406625,13032431,14609399,16251903],Blues9:[536683,545180,2191797,4362950,7057110,10406625,13032431,14609399,16251903]},Greens:{Greens3:[3253076,10607003,15070688],Greens4:[2329413,7652470,12248243,15595753],Greens5:[27948,3253076,7652470,12248243,15595753],Greens6:[27948,3253076,7652470,10607003,13101504,15595753],Greens7:[23090,2329413,4303709,7652470,10607003,13101504,15595753],Greens8:[23090,2329413,4303709,7652470,10607003,13101504,15070688,16252149],Greens9:[17435,27948,2329413,4303709,7652470,10607003,13101504,15070688,16252149]},Oranges:{Oranges3:[15095053,16625259,16705230],Oranges4:[14239489,16616764,16629381,16707038],Oranges5:[10892803,15095053,16616764,16629381,16707038],Oranges6:[10892803,15095053,16616764,16625259,16634018,16707038],Oranges7:[9186564,14239745,15821075,16616764,16625259,16634018,16707038],Oranges8:[9186564,14239745,15821075,16616764,16625259,16634018,16705230,16774635],Oranges9:[8333060,10892803,14239745,15821075,16616764,16625259,16634018,16705230,16774635]},Reds:{Reds3:[14560550,16552562,16703698],Reds4:[13309981,16476746,16559761,16704985],Reds5:[10817301,14560550,16476746,16559761,16704985],Reds6:[10817301,14560550,16476746,16552562,16563105,16704985],Reds7:[10027021,13309981,15678252,16476746,16552562,16563105,16704985],Reds8:[10027021,13309981,15678252,16476746,16552562,16563105,16703698,16774640],Reds9:[6750221,10817301,13309981,15678252,16476746,16552562,16563105,16703698,16774640]},Greys:{Greys3:[6513507,12434877,15790320],Greys4:[5395026,9868950,13421772,16250871],Greys5:[2434341,6513507,9868
|
||
|
e.exports=n.extend({},o,o.YlGn,o.YlGnBu,o.GnBu,o.BuGn,o.PuBuGn,o.PuBu,o.BuPu,o.RdPu,o.PuRd,o.OrRd,o.YlOrRd,o.YlOrBr,o.Purples,o.Blues,o.Greens,o.Oranges,o.Reds,o.Greys,o.PuOr,o.BrBG,o.PRGn,o.PiYG,o.RdBu,o.RdGy,o.RdYlBu,o.Spectral,o.RdYlGn,o.Inferno,o.Magma,o.Plasma,o.Viridis)},{underscore:"underscore"}],safely:[function(t,e,r){var n,o;n=function(t){var e,r,n,o,i,s;return r=document.createElement("div"),r.style["background-color"]="#f2dede",r.style.border="1px solid #a94442",r.style["border-radius"]="4px",r.style.display="inline-block",r.style["font-family"]="sans-serif",r.style["margin-top"]="5px",r.style["min-width"]="200px",r.style.padding="5px 5px 5px 10px",n=document.createElement("span"),n.style["background-color"]="#a94442",n.style["border-radius"]="0px 4px 0px 0px",n.style.color="white",n.style.cursor="pointer",n.style["float"]="right",n.style["font-size"]="0.8em",n.style.margin="-6px -6px 0px 0px",n.style.padding="2px 5px 4px 5px",n.title="close",n.setAttribute("aria-label","close"),n.appendChild(document.createTextNode("x")),n.addEventListener("click",function(){return e.removeChild(r)}),s=document.createElement("h3"),s.style.color="#a94442",s.style.margin="8px 0px 0px 0px",s.style.padding="0px",s.appendChild(document.createTextNode("Bokeh Error")),o=document.createElement("pre"),o.style["white-space"]="unset",o.appendChild(document.createTextNode(null!=(i=t.message)?i:t)),r.appendChild(n),r.appendChild(s),r.appendChild(o),e=document.getElementsByTagName("body")[0],e.insertBefore(r,e.firstChild)},o=function(t,e){var r,o;null==e&&(e=!1);try{return t()}catch(o){if(r=o,n(r),!e)throw r}},e.exports=o},{}],"util/bezier":[function(t,e,r){var n,o;o=function(t,e,r,n,o,i,s,a){var l,u,h,c,p,_,d,f,m,g,y,v;return l=a*o,u=-s*i,h=s*o,c=a*i,_=.5*(n-r),p=8/3*Math.sin(.5*_)*Math.sin(.5*_)/Math.sin(_),d=t+Math.cos(r)-p*Math.sin(r),g=e+Math.sin(r)+p*Math.cos(r),m=t+Math.cos(n),v=e+Math.sin(n),f=m+p*Math.sin(n),y=v-p*Math.cos(n),[l*d+u*g,h*d+c*g,l*f+u*y,h*f+c*y,l*m+u*v,h*m+c*v]},n=function(t,e,r,n,i,s,a,l,u){var h,c,p,_,d,f,m,g,y,v,b,x,w,M,k,j,T,S,z,P,E,A,C,N,O,q,D,I,R;return S=i*(Math.PI/180),T=Math.sin(S),d=Math.cos(S),x=Math.abs(r),w=Math.abs(n),y=d*(t-l)*.5+T*(e-u)*.5,v=d*(e-u)*.5-T*(t-l)*.5,g=y*y/(x*x)+v*v/(w*w),g>1&&(g=Math.sqrt(g),x*=g,w*=g),h=d/x,c=T/x,p=-T/w,_=d/w,N=h*t+c*e,D=p*t+_*e,O=h*l+c*u,I=p*l+_*u,f=(O-N)*(O-N)+(I-D)*(I-D),j=1/f-.25,j<0&&(j=0),k=Math.sqrt(j),a===s&&(k=-k),q=.5*(N+O)-k*(I-D),R=.5*(D+I)+k*(O-N),z=Math.atan2(D-R,N-q),P=Math.atan2(I-R,O-q),C=P-z,C<0&&1===a?C+=2*Math.PI:C>0&&0===a&&(C-=2*Math.PI),M=Math.ceil(Math.abs(C/(.5*Math.PI+.001))),b=function(){var t,e,r;for(r=[],m=t=0,e=M;0<=e?t<e:t>e;m=0<=e?++t:--t)E=z+m*C/M,A=z+(m+1)*C/M,r.push(o(q,R,E,A,x,w,T,d));return r}()},e.exports={arc_to_bezier:n,segment_to_bezier:o}},{}],"util/util":[function(t,e,r){var n,o,i,s,a,l;i=t("underscore"),o=t("sprintf"),n=t("numbro"),s=function(t){var e;return i.isNumber(t)?(e=function(){switch(!1){case Math.floor(t)!==t:return"%d";case!(Math.abs(t)>.1&&Math.abs(t)<1e3):return"%0.3f";default:return"%0.3e"}}(),o.sprintf(e,t)):""+t},l=function(t,e,r,o){return null==o&&(o={}),t=t.replace(/(^|[^\$])\$(\w+)/g,function(t){return function(t,e,r){return e+"@$"+r}}(this)),t=t.replace(/(^|[^@])@(?:(\$?\w+)|{([^{}]+)})(?:{([^{}]+)})?/g,function(t){return function(t,a,l,u,h){var c,p,_;return l=null!=u?u:l,_="$"===l[0]?o[l.substring(1)]:null!=(c=e.get_column(l))?c[r]:void 0,p=null==_?"???":null!=h?n.format(_,h):s(_),""+a+i.escape(p)}}(this))},a=function(t){var e;return e=t.get("selected"),e["0d"].glyph?e["0d"].indices:e["1d"].indices.length>0?e["1d"].indices:e["2d"].indices.length>0?e["2d"].indices:[]},e.exports={replace_placeholders:l,get_indices:a}},{numbro:"numbro/numbro",sprintf:"sprintf",underscore:"underscore"}],version:[function(t,e,r){var n;n="0.12.2",e.exports=n},{}],backbone:[function(e,r,n){(function(r){
|
||
|
// (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
|
// Backbone may be freely distributed under the MIT license.
|
||
|
!function(o){var i="object"==typeof self&&self.self===self&&self||"object"==typeof r&&r.global===r&&r;if("function"==typeof t&&t.amd)t(["underscore","jquery","exports"],function(t,e,r){i.Backbone=o(i,r,t,e)});else if("undefined"!=typeof n){var s,a=e("underscore");try{s=e("jquery")}catch(l){}o(i,n,a,s)}else i.Backbone=o(i,{},i._,i.jQuery||i.Zepto||i.ender||i.$)}(function(t,e,r,n){var o=t.Backbone,i=Array.prototype.slice;e.VERSION="1.3.3",e.$=n,e.noConflict=function(){return t.Backbone=o,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s=function(t,e,n){switch(t){case 1:return function(){return r[e](this[n])};case 2:return function(t){return r[e](this[n],t)};case 3:return function(t,o){return r[e](this[n],l(t,this),o)};case 4:return function(t,o,i){return r[e](this[n],l(t,this),o,i)};default:return function(){var t=i.call(arguments);return t.unshift(this[n]),r[e].apply(r,t)}}},a=function(t,e,n){r.each(e,function(e,o){r[o]&&(t.prototype[o]=s(e,o,n))})},l=function(t,e){return r.isFunction(t)?t:r.isObject(t)&&!e._isModel(t)?u(t):r.isString(t)?function(e){return e.get(t)}:t},u=function(t){var e=r.matches(t);return function(t){return e(t.attributes)}},h=e.Events={},c=/\s+/,p=function(t,e,n,o,i){var s,a=0;if(n&&"object"==typeof n){void 0!==o&&"context"in i&&void 0===i.context&&(i.context=o);for(s=r.keys(n);a<s.length;a++)e=p(t,e,s[a],n[s[a]],i)}else if(n&&c.test(n))for(s=n.split(c);a<s.length;a++)e=t(e,s[a],o,i);else e=t(e,n,o,i);return e};h.on=function(t,e,r){return _(this,t,e,r)};var _=function(t,e,r,n,o){if(t._events=p(d,t._events||{},e,r,{context:n,ctx:t,listening:o}),o){var i=t._listeners||(t._listeners={});i[o.id]=o}return t};h.listenTo=function(t,e,n){if(!t)return this;var o=t._listenId||(t._listenId=r.uniqueId("l")),i=this._listeningTo||(this._listeningTo={}),s=i[o];if(!s){var a=this._listenId||(this._listenId=r.uniqueId("l"));s=i[o]={obj:t,objId:o,id:a,listeningTo:i,count:0}}return _(t,e,n,this,s),this};var d=function(t,e,r,n){if(r){var o=t[e]||(t[e]=[]),i=n.context,s=n.ctx,a=n.listening;a&&a.count++,o.push({callback:r,context:i,ctx:i||s,listening:a})}return t};h.off=function(t,e,r){return this._events?(this._events=p(f,this._events,t,e,{context:r,listeners:this._listeners}),this):this},h.stopListening=function(t,e,n){var o=this._listeningTo;if(!o)return this;for(var i=t?[t._listenId]:r.keys(o),s=0;s<i.length;s++){var a=o[i[s]];if(!a)break;a.obj.off(e,n,this)}return this};var f=function(t,e,n,o){if(t){var i,s=0,a=o.context,l=o.listeners;if(e||n||a){for(var u=e?[e]:r.keys(t);s<u.length;s++){e=u[s];var h=t[e];if(!h)break;for(var c=[],p=0;p<h.length;p++){var _=h[p];n&&n!==_.callback&&n!==_.callback._callback||a&&a!==_.context?c.push(_):(i=_.listening,i&&0===--i.count&&(delete l[i.id],delete i.listeningTo[i.objId]))}c.length?t[e]=c:delete t[e]}return t}for(var d=r.keys(l);s<d.length;s++)i=l[d[s]],delete l[i.id],delete i.listeningTo[i.objId]}};h.once=function(t,e,n){var o=p(m,{},t,e,r.bind(this.off,this));return"string"==typeof t&&null==n&&(e=void 0),this.on(o,e,n)},h.listenToOnce=function(t,e,n){var o=p(m,{},e,n,r.bind(this.stopListening,this,t));return this.listenTo(t,o)};var m=function(t,e,n,o){if(n){var i=t[e]=r.once(function(){o(e,i),n.apply(this,arguments)});i._callback=n}return t};h.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),r=Array(e),n=0;n<e;n++)r[n]=arguments[n+1];return p(g,this._events,t,void 0,r),this};var g=function(t,e,r,n){if(t){var o=t[e],i=t.all;o&&i&&(i=i.slice()),o&&y(o,n),i&&y(i,[e].concat(n))}return t},y=function(t,e){var r,n=-1,o=t.length,i=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++n<o;)(r=t[n]).callback.call(r.ctx);return;case 1:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i);return;case 2:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i,s);return;case 3:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i,s,a);return;default:for(;++n<o;)(r=t[n]).callback.apply(r.ctx,e);return}};h.bind=h.on,h.unbind=h.off,r.extend(e,h);var v=e.Model=function(t,e){var n=t||{};e||(e={}),this.cid=r.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.pa
|
||
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
||
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
||
|
* @license Licensed under MIT license
|
||
|
* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
|
||
|
* @version 3.0.2
|
||
|
*/
|
||
|
(function(){"use strict";function i(t){return"function"==typeof t||"object"==typeof t&&null!==t}function s(t){return"function"==typeof t}function a(t){return"object"==typeof t&&null!==t}function l(t){H=t}function u(t){J=t}function h(){return function(){n.nextTick(f)}}function c(){return function(){Y(f)}}function p(){var t=0,e=new Z(f),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}function _(){var t=new MessageChannel;return t.port1.onmessage=f,function(){t.port2.postMessage(0)}}function d(){return function(){setTimeout(f,1)}}function f(){for(var t=0;t<W;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}W=0}function m(){try{var t=e,r=t("vertx");return Y=r.runOnLoop||r.runOnContext,c()}catch(n){return d()}}function g(){}function y(){return new TypeError("You cannot resolve a promise with itself")}function v(){return new TypeError("A promises callback cannot return that same promise.")}function b(t){try{return t.then}catch(e){return st.error=e,st}}function x(t,e,r,n){try{t.call(e,r,n)}catch(o){return o}}function w(t,e,r){J(function(t){var n=!1,o=x(r,e,function(r){n||(n=!0,e!==r?j(t,r):S(t,r))},function(e){n||(n=!0,z(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&o&&(n=!0,z(t,o))},t)}function M(t,e){e._state===ot?S(t,e._result):e._state===it?z(t,e._result):P(e,void 0,function(e){j(t,e)},function(e){z(t,e)})}function k(t,e){if(e.constructor===t.constructor)M(t,e);else{var r=b(e);r===st?z(t,st.error):void 0===r?S(t,e):s(r)?w(t,e,r):S(t,e)}}function j(t,e){t===e?z(t,y()):i(e)?k(t,e):S(t,e)}function T(t){t._onerror&&t._onerror(t._result),E(t)}function S(t,e){t._state===nt&&(t._result=e,t._state=ot,0!==t._subscribers.length&&J(E,t))}function z(t,e){t._state===nt&&(t._state=it,t._result=e,J(T,t))}function P(t,e,r,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+ot]=r,o[i+it]=n,0===i&&t._state&&J(E,t)}function E(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,o,i=t._result,s=0;s<e.length;s+=3)n=e[s],o=e[s+r],n?N(r,n,o,i):o(i);t._subscribers.length=0}}function A(){this.error=null}function C(t,e){try{return t(e)}catch(r){return at.error=r,at}}function N(t,e,r,n){var o,i,a,l,u=s(r);if(u){if(o=C(r,n),o===at?(l=!0,i=o.error,o=null):a=!0,e===o)return void z(e,v())}else o=n,a=!0;e._state!==nt||(u&&a?j(e,o):l?z(e,i):t===ot?S(e,o):t===it&&z(e,o))}function O(t,e){try{e(function(e){j(t,e)},function(e){z(t,e)})}catch(r){z(t,r)}}function q(t,e){var r=this;r._instanceConstructor=t,r.promise=new t(g),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))):z(r.promise,r._validationError())}function D(t){return new lt(this,t).promise}function I(t){function e(t){j(o,t)}function r(t){z(o,t)}var n=this,o=new n(g);if(!$(t))return z(o,new TypeError("You must pass an array to race.")),o;for(var i=t.length,s=0;o._state===nt&&s<i;s++)P(n.resolve(t[s]),void 0,e,r);return o}function R(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(g);return j(r,t),r}function F(t){var e=this,r=new e(g);return z(r,t),r}function B(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function L(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function G(t){this._id=_t++,this._state=void 0,this._result=void 0,this._subscribers=[],g!==t&&(s(t)||B(),this instanceof G||L(),O(this,t))}function V(){var t;if("undefined"!=typeof o)t=o;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=dt)}var U;U=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var Y,H,X,$=U,W=0,J=({}.toString,function(t,e){rt[W]=t
|
||
|
* http://hammerjs.github.io/
|
||
|
*
|
||
|
* Copyright (c) 2016 Jorik Tangelder;
|
||
|
* Licensed under the MIT license */
|
||
|
!function(e,n,o,i){"use strict";function s(t,e,r){return setTimeout(c(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!==i)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 o="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",i=e.console&&(e.console.warn||e.console.log);return i&&i.call(e.console,o,n),t.apply(this,arguments)}}function h(t,e,r){var n,o=e.prototype;n=t.prototype=Object.create(o),n.constructor=t,n._super=o,r&&_t(n,r)}function c(t,e){return function(){return t.apply(e,arguments)}}function p(t,e){return typeof t==mt?t.apply(e?e[0]||i:i,e):t}function _(t,e){return t===i?e:t}function d(t,e,r){l(y(e),function(e){t.addEventListener(e,r,!1)})}function f(t,e,r){l(y(e),function(e){t.removeEventListener(e,r,!1)})}function m(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function g(t,e){return t.indexOf(e)>-1}function y(t){return t.trim().split(/\s+/g)}function v(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 x(t,e,r){for(var n=[],o=[],i=0;i<t.length;){var s=e?t[i][e]:t[i];v(o,s)<0&&n.push(t[i]),o[i]=s,i++}return r&&(n=e?n.sort(function(t,r){return t[e]>r[e]}):n.sort()),n}function w(t,e){for(var r,n,o=e[0].toUpperCase()+e.slice(1),s=0;s<dt.length;){if(r=dt[s],n=r?r+o:e,n in t)return n;s++}return i}function M(){return wt++}function k(t){var r=t.ownerDocument||t;return r.defaultView||r.parentWindow||e}function j(t,e){var r=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){p(t.options.enable,[t])&&r.handler(e)},this.init()}function T(t){var e,r=t.options.inputClass;return new(e=r?r:jt?B:Tt?V:kt?Y:F)(t,S)}function S(t,e,r){var n=r.pointers.length,o=r.changedPointers.length,i=e&Ct&&n-o===0,s=e&(Ot|qt)&&n-o===0;r.isFirst=!!i,r.isFinal=!!s,i&&(t.session={}),r.eventType=e,z(t,r),t.emit("hammer.input",r),t.recognize(r),t.session.prevInput=r}function z(t,e){var r=t.session,n=e.pointers,o=n.length;r.firstInput||(r.firstInput=A(e)),o>1&&!r.firstMultiple?r.firstMultiple=A(e):1===o&&(r.firstMultiple=!1);var i=r.firstInput,s=r.firstMultiple,a=s?s.center:i.center,l=e.center=C(n);e.timeStamp=vt(),e.deltaTime=e.timeStamp-i.timeStamp,e.angle=D(a,l),e.distance=q(a,l),P(r,e),e.offsetDirection=O(e.deltaX,e.deltaY);var u=N(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=yt(u.x)>yt(u.y)?u.x:u.y,e.scale=s?R(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,E(r,e);var h=t.element;m(e.srcEvent.target,h)&&(h=e.srcEvent.target),e.target=h}function P(t,e){var r=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},i=t.prevInput||{};e.eventType!==Ct&&i.eventType!==Ot||(o=t.prevDelta={x:i.deltaX||0,y:i.deltaY||0},n=t.offsetDelta={x:r.x,y:r.y}),e.deltaX=o.x+(r.x-n.x),e.deltaY=o.y+(r.y-n.y)}function E(t,e){var r,n,o,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=qt&&(l>At||a.velocity===i)){var u=e.deltaX-a.deltaX,h=e.deltaY-a.deltaY,c=N(l,u,h);n=c.x,o=c.y,r=yt(c.x)>yt(c.y)?c.x:c.y,s=O(u,h),t.lastInterval=e}else r=a.velocity,n=a.velocityX,o=a.velocityY,s=a.direction;e.velocity=r,e.velocityX=n,e.velocityY=o,e.direction=s}function A(t){for(var e=[],r=0;r<t.pointers.length;)e[r]={clientX:gt(t.pointers[r].clientX),clientY:gt(t.pointers[r].clientY)},r++;return{timeStamp:vt(),pointers:e,center:C(e),deltaX:t.deltaX,deltaY:t.deltaY}}function C(t){var e=t.length;if(1===e)return{x:gt(t[0].clientX),y:gt(t[0].clientY)};for(var r=0,n=0,o=0;o<e;)r+=t[o].clientX,n+=t[o].clientY,o++;return{x:gt(r/e),y:gt(n/e)}}function N(t
|
||
|
* jQuery Mousewheel 3.1.13
|
||
|
*
|
||
|
* Copyright jQuery Foundation and other contributors
|
||
|
* Released under the MIT license
|
||
|
* http://jquery.org/license
|
||
|
*/
|
||
|
!function(e){"function"==typeof t&&t.amd?t(["jquery"],e):"object"==typeof n?r.exports=e:e(jQuery)}(function(t){function e(e){var s=e||window.event,a=l.call(arguments,1),u=0,c=0,p=0,_=0,d=0,f=0;if(e=t.event.fix(s),e.type="mousewheel","detail"in s&&(p=s.detail*-1),"wheelDelta"in s&&(p=s.wheelDelta),"wheelDeltaY"in s&&(p=s.wheelDeltaY),"wheelDeltaX"in s&&(c=s.wheelDeltaX*-1),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(c=p*-1,p=0),u=0===p?c:p,"deltaY"in s&&(p=s.deltaY*-1,u=p),"deltaX"in s&&(c=s.deltaX,0===p&&(u=c*-1)),0!==p||0!==c){if(1===s.deltaMode){var m=t.data(this,"mousewheel-line-height");u*=m,p*=m,c*=m}else if(2===s.deltaMode){var g=t.data(this,"mousewheel-page-height");u*=g,p*=g,c*=g}if(_=Math.max(Math.abs(p),Math.abs(c)),(!i||_<i)&&(i=_,n(s,_)&&(i/=40)),n(s,_)&&(u/=40,c/=40,p/=40),u=Math[u>=1?"floor":"ceil"](u/i),c=Math[c>=1?"floor":"ceil"](c/i),p=Math[p>=1?"floor":"ceil"](p/i),h.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();d=e.clientX-y.left,f=e.clientY-y.top}return e.deltaX=c,e.deltaY=p,e.deltaFactor=i,e.offsetX=d,e.offsetY=f,e.deltaMode=0,a.unshift(e,u,c,p),o&&clearTimeout(o),o=setTimeout(r,200),(t.event.dispatch||t.event.handle).apply(this,a)}}function r(){i=null}function n(t,e){return h.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120===0}var o,i,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],a="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(t.event.fixHooks)for(var u=s.length;u;)t.event.fixHooks[s[--u]]=t.event.mouseHooks;var h=t.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var r=a.length;r;)this.addEventListener(a[--r],e,!1);else this.onmousewheel=e;t.data(this,"mousewheel-line-height",h.getLineHeight(this)),t.data(this,"mousewheel-page-height",h.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var r=a.length;r;)this.removeEventListener(a[--r],e,!1);else this.onmousewheel=null;t.removeData(this,"mousewheel-line-height"),t.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var r=t(e),n=r["offsetParent"in t.fn?"offsetParent":"parent"]();return n.length||(n=t("body")),parseInt(n.css("fontSize"),10)||parseInt(r.css("fontSize"),10)||16},getPageHeight:function(e){return t(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};t.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})})},{}],jquery:[function(e,r,n){/*!
|
||
|
* jQuery JavaScript Library v2.2.4
|
||
|
* http://jquery.com/
|
||
|
*
|
||
|
* Includes Sizzle.js
|
||
|
* http://sizzlejs.com/
|
||
|
*
|
||
|
* Copyright jQuery Foundation and other contributors
|
||
|
* Released under the MIT license
|
||
|
* http://jquery.org/license
|
||
|
*
|
||
|
* Date: 2016-05-20T17:23Z
|
||
|
*/
|
||
|
!function(t,e){"object"==typeof r&&"object"==typeof r.exports?r.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(e,r){function n(t){var e=!!t&&"length"in t&&t.length,r=st.type(t);return"function"!==r&&!st.isWindow(t)&&("array"===r||0===e||"number"==typeof e&&e>0&&e-1 in t)}function o(t,e,r){if(st.isFunction(e))return st.grep(t,function(t,n){return!!e.call(t,n,t)!==r});if(e.nodeType)return st.grep(t,function(t){return t===e!==r});if("string"==typeof e){if(mt.test(e))return st.filter(e,t,r);e=st.filter(e,t)}return st.grep(t,function(t){return tt.call(e,t)>-1!==r})}function i(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function s(t){var e={};return st.each(t.match(wt)||[],function(t,r){e[r]=!0}),e}function a(){J.removeEventListener("DOMContentLoaded",a),e.removeEventListener("load",a),st.ready()}function l(){this.expando=st.expando+l.uid++}function u(t,e,r){var n;if(void 0===r&&1===t.nodeType)if(n="data-"+e.replace(Pt,"-$&").toLowerCase(),r=t.getAttribute(n),"string"==typeof r){try{r="true"===r||"false"!==r&&("null"===r?null:+r+""===r?+r:zt.test(r)?st.parseJSON(r):r)}catch(o){}St.set(t,e,r)}else r=void 0;return r}function h(t,e,r,n){var o,i=1,s=20,a=n?function(){return n.cur()}:function(){return st.css(t,e,"")},l=a(),u=r&&r[3]||(st.cssNumber[e]?"":"px"),h=(st.cssNumber[e]||"px"!==u&&+l)&&At.exec(st.css(t,e));if(h&&h[3]!==u){u=u||h[3],r=r||[],h=+l||1;do i=i||".5",h/=i,st.style(t,e,h+u);while(i!==(i=a()/l)&&1!==i&&--s)}return r&&(h=+h||+l||0,o=r[1]?h+(r[1]+1)*r[2]:+r[2],n&&(n.unit=u,n.start=h,n.end=o)),o}function c(t,e){var r="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!=typeof t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&st.nodeName(t,e)?st.merge([t],r):r}function p(t,e){for(var r=0,n=t.length;r<n;r++)Tt.set(t[r],"globalEval",!e||Tt.get(e[r],"globalEval"))}function _(t,e,r,n,o){for(var i,s,a,l,u,h,_=e.createDocumentFragment(),d=[],f=0,m=t.length;f<m;f++)if(i=t[f],i||0===i)if("object"===st.type(i))st.merge(d,i.nodeType?[i]:i);else if(Rt.test(i)){for(s=s||_.appendChild(e.createElement("div")),a=(qt.exec(i)||["",""])[1].toLowerCase(),l=It[a]||It._default,s.innerHTML=l[1]+st.htmlPrefilter(i)+l[2],h=l[0];h--;)s=s.lastChild;st.merge(d,s.childNodes),s=_.firstChild,s.textContent=""}else d.push(e.createTextNode(i));for(_.textContent="",f=0;i=d[f++];)if(n&&st.inArray(i,n)>-1)o&&o.push(i);else if(u=st.contains(i.ownerDocument,i),s=c(_.appendChild(i),"script"),u&&p(s),r)for(h=0;i=s[h++];)Dt.test(i.type||"")&&r.push(i);return _}function d(){return!0}function f(){return!1}function m(){try{return J.activeElement}catch(t){}}function g(t,e,r,n,o,i){var s,a;if("object"==typeof e){"string"!=typeof r&&(n=n||r,r=void 0);for(a in e)g(t,a,r,n,e[a],i);return t}if(null==n&&null==o?(o=r,n=r=void 0):null==o&&("string"==typeof r?(o=n,n=void 0):(o=n,n=r,r=void 0)),o===!1)o=f;else if(!o)return t;return 1===i&&(s=o,o=function(t){return st().off(t),s.apply(this,arguments)},o.guid=s.guid||(s.guid=st.guid++)),t.each(function(){st.event.add(this,e,o,n,r)})}function y(t,e){return st.nodeName(t,"table")&&st.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function v(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function b(t){var e=Yt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function x(t,e){var r,n,o,i,s,a,l,u;if(1===e.nodeType){if(Tt.hasData(t)&&(i=Tt.access(t),s=Tt.set(e,i),u=i.events)){delete s.handle,s.events={};for(o in u)for(r=0,n=u[o].length;r<n;r++)st.event.add(e,o,u[o][r])}St.hasData(t)&&(a=St.access(t),l=st.extend({},a),St.set(e,l))}}function w(t,e){var r=e.nodeName.toLowerCase();"input"===r&&Ot.test(t.type)?e.checked=t.checked:"input"!==r&&"textarea"!==r||(e.defaultValue=t.defaultValue)}function M(t,e,r,n){e=K.apply([],e);var o,i,s,a,l,u,h=0,p=t.length,d=p-1,f=e[0],m=st.isFunction(f);if(m||p>1&&"string"==typeof f&&!ot.checkClone&
|
||
|
* Sizzle CSS Selector Engine v2.2.1
|
||
|
* http://sizzlejs.com/
|
||
|
*
|
||
|
* Copyright jQuery Foundation and other contributors
|
||
|
* Released under the MIT license
|
||
|
* http://jquery.org/license
|
||
|
*
|
||
|
* Date: 2015-10-17
|
||
|
*/
|
||
|
function(t){function e(t,e,r,n){var o,i,s,a,l,u,c,_,d=e&&e.ownerDocument,f=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==f&&9!==f&&11!==f)return r;if(!n&&((e?e.ownerDocument||e:B)!==C&&A(e),e=e||C,O)){if(11!==f&&(u=gt.exec(t)))if(o=u[1]){if(9===f){if(!(s=e.getElementById(o)))return r;if(s.id===o)return r.push(s),r}else if(d&&(s=d.getElementById(o))&&R(e,s)&&s.id===o)return r.push(s),r}else{if(u[2])return K.apply(r,e.getElementsByTagName(t)),r;if((o=u[3])&&x.getElementsByClassName&&e.getElementsByClassName)return K.apply(r,e.getElementsByClassName(o)),r}if(x.qsa&&!Y[t+" "]&&(!q||!q.test(t))){if(1!==f)d=e,_=t;else if("object"!==e.nodeName.toLowerCase()){for((a=e.getAttribute("id"))?a=a.replace(vt,"\\$&"):e.setAttribute("id",a=F),c=j(t),i=c.length,l=pt.test(a)?"#"+a:"[id='"+a+"']";i--;)c[i]=l+" "+p(c[i]);_=c.join(","),d=yt.test(t)&&h(e.parentNode)||e}if(_)try{return K.apply(r,d.querySelectorAll(_)),r}catch(m){}finally{a===F&&e.removeAttribute("id")}}}return S(t.replace(at,"$1"),e,r,n)}function r(){function t(r,n){return e.push(r+" ")>w.cacheLength&&delete t[e.shift()],t[r+" "]=n}var e=[];return t}function n(t){return t[F]=!0,t}function o(t){var e=C.createElement("div");try{return!!t(e)}catch(r){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function i(t,e){for(var r=t.split("|"),n=r.length;n--;)w.attrHandle[r[n]]=e}function s(t,e){var r=e&&t,n=r&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||X)-(~t.sourceIndex||X);if(n)return n;if(r)for(;r=r.nextSibling;)if(r===e)return-1;return t?1:-1}function a(t){return function(e){var r=e.nodeName.toLowerCase();return"input"===r&&e.type===t}}function l(t){return function(e){var r=e.nodeName.toLowerCase();return("input"===r||"button"===r)&&e.type===t}}function u(t){return n(function(e){return e=+e,n(function(r,n){for(var o,i=t([],r.length,e),s=i.length;s--;)r[o=i[s]]&&(r[o]=!(n[o]=r[o]))})})}function h(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function c(){}function p(t){for(var e=0,r=t.length,n="";e<r;e++)n+=t[e].value;return n}function _(t,e,r){var n=e.dir,o=r&&"parentNode"===n,i=G++;return e.first?function(e,r,i){for(;e=e[n];)if(1===e.nodeType||o)return t(e,r,i)}:function(e,r,s){var a,l,u,h=[L,i];if(s){for(;e=e[n];)if((1===e.nodeType||o)&&t(e,r,s))return!0}else for(;e=e[n];)if(1===e.nodeType||o){if(u=e[F]||(e[F]={}),l=u[e.uniqueID]||(u[e.uniqueID]={}),(a=l[n])&&a[0]===L&&a[1]===i)return h[2]=a[2];if(l[n]=h,h[2]=t(e,r,s))return!0}}}function d(t){return t.length>1?function(e,r,n){for(var o=t.length;o--;)if(!t[o](e,r,n))return!1;return!0}:t[0]}function f(t,r,n){for(var o=0,i=r.length;o<i;o++)e(t,r[o],n);return n}function m(t,e,r,n,o){for(var i,s=[],a=0,l=t.length,u=null!=e;a<l;a++)(i=t[a])&&(r&&!r(i,n,o)||(s.push(i),u&&e.push(a)));return s}function g(t,e,r,o,i,s){return o&&!o[F]&&(o=g(o)),i&&!i[F]&&(i=g(i,s)),n(function(n,s,a,l){var u,h,c,p=[],_=[],d=s.length,g=n||f(e||"*",a.nodeType?[a]:a,[]),y=!t||!n&&e?g:m(g,p,t,a,l),v=r?i||(n?t:d||o)?[]:s:y;if(r&&r(y,v,a,l),o)for(u=m(v,_),o(u,[],a,l),h=u.length;h--;)(c=u[h])&&(v[_[h]]=!(y[_[h]]=c));if(n){if(i||t){if(i){for(u=[],h=v.length;h--;)(c=v[h])&&u.push(y[h]=c);i(null,v=[],u,l)}for(h=v.length;h--;)(c=v[h])&&(u=i?tt(n,c):p[h])>-1&&(n[u]=!(s[u]=c))}}else v=m(v===s?v.splice(d,v.length):v),i?i(null,s,v,l):K.apply(s,v)})}function y(t){for(var e,r,n,o=t.length,i=w.relative[t[0].type],s=i||w.relative[" "],a=i?1:0,l=_(function(t){return t===e},s,!0),u=_(function(t){return tt(e,t)>-1},s,!0),h=[function(t,r,n){var o=!i&&(n||r!==z)||((e=r).nodeType?l(t,r,n):u(t,r,n));return e=null,o}];a<o;a++)if(r=w.relative[t[a].type])h=[_(d(h),r)];else{if(r=w.filter[t[a].type].apply(null,t[a].matches),r[F]){for(n=++a;n<o&&!w.relative[t[n].type];n++);return g(a>1&&d(h),a>1&&p(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(at,"$1"),r,a<n&&y(t.slice(a,n)),n<o&&y(t=t.slice(n)),n<o&&p(t))}h.push(r)}return d(h)}function v(t,r){var o=r.length>0,i=t.length>0,s=function(n,s,a,l,u){var h,c,p,_=0,d="0",f=n&&[],g=[],y=z,v=n||i&&w.find.TAG("*",u),b=L+=null==y?1:Math.random()||.1,x=v.length;for(u&&(z=s===C||s||u);d!=
|
||
|
h.selector&&p.delegateCount--,c.remove&&c.remove.call(t,h));s&&!p.length&&(c.teardown&&c.teardown.call(t,d,m.handle)!==!1||st.removeEvent(t,_,m.handle),delete l[_])}else for(_ in l)st.event.remove(t,_+e[u],r,n,!0);st.isEmptyObject(l)&&Tt.remove(t,"handle events")}},dispatch:function(t){t=st.event.fix(t);var e,r,n,o,i,s=[],a=Q.call(arguments),l=(Tt.get(this,"events")||{})[t.type]||[],u=st.event.special[t.type]||{};if(a[0]=t,t.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,t)!==!1){for(s=st.event.handlers.call(this,t,l),e=0;(o=s[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,r=0;(i=o.handlers[r++])&&!t.isImmediatePropagationStopped();)t.rnamespace&&!t.rnamespace.test(i.namespace)||(t.handleObj=i,t.data=i.data,n=((st.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,a),void 0!==n&&(t.result=n)===!1&&(t.preventDefault(),t.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,t),t.result}},handlers:function(t,e){var r,n,o,i,s=[],a=e.delegateCount,l=t.target;if(a&&l.nodeType&&("click"!==t.type||isNaN(t.button)||t.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==t.type)){for(n=[],r=0;r<a;r++)i=e[r],o=i.selector+" ",void 0===n[o]&&(n[o]=i.needsContext?st(o,this).index(l)>-1:st.find(o,this,null,[l]).length),n[o]&&n.push(i);n.length&&s.push({elem:l,handlers:n})}return a<e.length&&s.push({elem:this,handlers:e.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var r,n,o,i=e.button;return null==t.pageX&&null!=e.clientX&&(r=t.target.ownerDocument||J,n=r.documentElement,o=r.body,t.pageX=e.clientX+(n&&n.scrollLeft||o&&o.scrollLeft||0)-(n&&n.clientLeft||o&&o.clientLeft||0),t.pageY=e.clientY+(n&&n.scrollTop||o&&o.scrollTop||0)-(n&&n.clientTop||o&&o.clientTop||0)),t.which||void 0===i||(t.which=1&i?1:2&i?3:4&i?2:0),t}},fix:function(t){if(t[st.expando])return t;var e,r,n,o=t.type,i=t,s=this.fixHooks[o];for(s||(this.fixHooks[o]=s=Bt.test(o)?this.mouseHooks:Ft.test(o)?this.keyHooks:{}),n=s.props?this.props.concat(s.props):this.props,t=new st.Event(i),e=n.length;e--;)r=n[e],t[r]=i[r];return t.target||(t.target=J),3===t.target.nodeType&&(t.target=t.target.parentNode),s.filter?s.filter(t,i):t},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==m()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===m()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&st.nodeName(this,"input"))return this.click(),!1},_default:function(t){return st.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},st.removeEvent=function(t,e,r){t.removeEventListener&&t.removeEventListener(e,r)},st.Event=function(t,e){return this instanceof st.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&t.returnValue===!1?d:f):this.type=t,e&&st.extend(this,e),this.timeStamp=t&&t.timeStamp||st.now(),void(this[st.expando]=!0)):new st.Event(t,e)},st.Event.prototype={constructor:st.Event,isDefaultPrevented:f,isPropagationStopped:f,isImmediatePropagationStopped:f,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=d,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=d,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=d,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},st.each({mouseenter:"
|
||
|
for(s in o)a.setRequestHeader(s,o[s]);r=function(t){return function(){r&&(r=n=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?i(0,"error"):i(a.status,a.statusText):i(qe[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=r(),n=a.onerror=r("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){r&&n()})},r=r("abort");try{a.send(t.hasContent&&t.data||null)}catch(l){if(r)throw l}},abort:function(){r&&r()}}}),st.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return st.globalEval(t),t}}}),st.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),st.ajaxTransport("script",function(t){if(t.crossDomain){var e,r;return{send:function(n,o){e=st("<script>").prop({charset:t.scriptCharset,src:t.url}).on("load error",r=function(t){e.remove(),r=null,t&&o("error"===t.type?404:200,t.type)}),J.head.appendChild(e[0])},abort:function(){r&&r()}}}});var Ie=[],Re=/(=)\?(?=&|$)|\?\?/;st.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ie.pop()||st.expando+"_"+ye++;return this[t]=!0,t}}),st.ajaxPrefilter("json jsonp",function(t,r,n){var o,i,s,a=t.jsonp!==!1&&(Re.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Re.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=st.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Re,"$1"+o):t.jsonp!==!1&&(t.url+=(ve.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return s||st.error(o+" was not called"),s[0]},t.dataTypes[0]="json",i=e[o],e[o]=function(){s=arguments},n.always(function(){void 0===i?st(e).removeProp(o):e[o]=i,t[o]&&(t.jsonpCallback=r.jsonpCallback,Ie.push(o)),s&&st.isFunction(i)&&i(s[0]),s=i=void 0}),"script"}),st.parseHTML=function(t,e,r){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(r=e,e=!1),e=e||J;var n=ft.exec(t),o=!r&&[];return n?[e.createElement(n[1])]:(n=_([t],e,o),o&&o.length&&st(o).remove(),st.merge([],n.childNodes))};var Fe=st.fn.load;st.fn.load=function(t,e,r){if("string"!=typeof t&&Fe)return Fe.apply(this,arguments);var n,o,i,s=this,a=t.indexOf(" ");return a>-1&&(n=st.trim(t.slice(a)),t=t.slice(0,a)),st.isFunction(e)?(r=e,e=void 0):e&&"object"==typeof e&&(o="POST"),s.length>0&&st.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done(function(t){i=arguments,s.html(n?st("<div>").append(st.parseHTML(t)).find(n):t)}).always(r&&function(t,e){s.each(function(){r.apply(this,i||[t.responseText,e,t])})}),this},st.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){st.fn[e]=function(t){return this.on(e,t)}}),st.expr.filters.animated=function(t){return st.grep(st.timers,function(e){return t===e.elem}).length},st.offset={setOffset:function(t,e,r){var n,o,i,s,a,l,u,h=st.css(t,"position"),c=st(t),p={};"static"===h&&(t.style.position="relative"),a=c.offset(),i=st.css(t,"top"),l=st.css(t,"left"),u=("absolute"===h||"fixed"===h)&&(i+l).indexOf("auto")>-1,u?(n=c.position(),s=n.top,o=n.left):(s=parseFloat(i)||0,o=parseFloat(l)||0),st.isFunction(e)&&(e=e.call(t,r,st.extend({},a))),null!=e.top&&(p.top=e.top-a.top+s),null!=e.left&&(p.left=e.left-a.left+o),"using"in e?e.using.call(t,p):c.css(p)}},st.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){st.offset.setOffset(this,t,e)});var e,r,n=this[0],o={top:0,left:0},i=n&&n.ownerDocument;if(i)return e=i.documentElement,st.contains(e,n)?(o=n.getBoundingClientRect(),r=$(i),{top:o.top+r.pageYOffset-e.clientTop,left:o.left+r.pageXOffset-e.clientLeft}):o},position:function(){if(this[0]){var t,e,r=this[0],n={top:0,left:0};return"fixed"===st.css(r,"position")?e=r.g
|
||
|
* JSNLog 2.20.0
|
||
|
* Open source under the MIT License.
|
||
|
* Copyright 2016 Mattijs Perdeck All rights reserved.
|
||
|
*/
|
||
|
var n,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};!function(t){function e(t,e,r){if(void 0!==e[t])return null===e[t]?void delete r[t]:void(r[t]=e[t])}function r(e){if(null!=t.enabled&&!t.enabled)return!1;if(null!=t.maxMessages&&t.maxMessages<1)return!1;try{if(e.userAgentRegex&&!new RegExp(e.userAgentRegex).test(navigator.userAgent))return!1}catch(r){}try{if(e.ipRegex&&t.clientIP&&!new RegExp(e.ipRegex).test(t.clientIP))return!1}catch(r){}return!0}function n(t,e){try{if(t.disallow&&new RegExp(t.disallow).test(e))return!1}catch(r){}return!0}function i(t){return"function"==typeof t?t instanceof RegExp?t.toString():t():t}function s(t){var e,r=i(t);switch(typeof r){case"string":return new v(r,null,r);case"number":return e=r.toString(),new v(e,null,e);case"boolean":return e=r.toString(),new v(e,null,e);case"undefined":return new v("undefined",null,"undefined");case"object":return r instanceof RegExp||r instanceof String||r instanceof Number||r instanceof Boolean?(e=r.toString(),new v(e,null,e)):new v(null,r,JSON.stringify(r));default:return new v("unknown",null,"unknown")}}function a(t){return e("enabled",t,this),e("maxMessages",t,this),e("defaultAjaxUrl",t,this),e("clientIP",t,this),e("requestId",t,this),e("defaultBeforeSend",t,this),this}function l(){return-2147483648}function u(){return 1e3}function h(){return 2e3}function c(){return 3e3}function p(){return 4e3}function _(){return 5e3}function d(){return 6e3}function f(){return 2147483647}function m(t){return t<=1e3?"trace":t<=2e3?"debug":t<=3e3?"info":t<=4e3?"warn":t<=5e3?"error":"fatal"}function g(t){return new M(t)}function y(t){return new k(t)}t.requestId="";var v=function(){function t(t,e,r){this.msg=t,this.meta=e,this.finalString=r}return t}();t.setOptions=a,t.getAllLevel=l,t.getTraceLevel=u,t.getDebugLevel=h,t.getInfoLevel=c,t.getWarnLevel=p,t.getErrorLevel=_,t.getFatalLevel=d,t.getOffLevel=f;var b=function(){function t(t,e){this.inner=e,this.name="JL.Exception",this.message=s(t).finalString}return t}();t.Exception=b,b.prototype=new Error;var x=function(){function t(t,e,r,n){this.l=t,this.m=e,this.n=r,this.t=n}return t}();t.LogItem=x;var w=function(){function o(e,r){this.appenderName=e,this.sendLogItems=r,this.level=t.getTraceLevel(),this.sendWithBufferLevel=2147483647,this.storeInBufferLevel=-2147483648,this.bufferSize=0,this.batchSize=1,this.buffer=[],this.batchBuffer=[]}return o.prototype.setOptions=function(t){return e("level",t,this),e("ipRegex",t,this),e("userAgentRegex",t,this),e("disallow",t,this),e("sendWithBufferLevel",t,this),e("storeInBufferLevel",t,this),e("bufferSize",t,this),e("batchSize",t,this),this.bufferSize<this.buffer.length&&(this.buffer.length=this.bufferSize),this},o.prototype.log=function(t,e,o,i,s,a,l){var u;if(r(this)&&n(this,a)&&!(s<this.storeInBufferLevel))return u=new x(s,a,l,(new Date).getTime()),s<this.level?void(this.bufferSize>0&&(this.buffer.push(u),this.buffer.length>this.bufferSize&&this.buffer.shift())):(s<this.sendWithBufferLevel?this.batchBuffer.push(u):(this.buffer.length&&(this.batchBuffer=this.batchBuffer.concat(this.buffer),this.buffer.length=0),this.batchBuffer.push(u)),this.batchBuffer.length>=this.batchSize?void this.sendBatch():void 0)},o.prototype.sendBatch=function(){0!=this.batchBuffer.length&&(null!=t.maxMessages&&t.maxMessages<1||(null!=t.maxMessages&&(t.maxMessages-=this.batchBuffer.length),this.sendLogItems(this.batchBuffer),this.batchBuffer.length=0))},o}();t.Appender=w;var M=function(r){function n(t){r.call(this,t,n.prototype.sendLogItemsAjax)}return o(n,r),n.prototype.setOptions=function(t){return e("url",t,this),e("beforeSend",t,this),r.prototype.setOptions.call(this,t),this},n.prototype.sendLogItemsAjax=function(e){try{var r="/jsnlog.logger";null!=t.defaultAjaxUrl&&(r=t.defaultAjaxUrl),this.url&&(r=this.url);var n=this.getXhr(r),o={r:t.requestId,lg:e};"function"==typeof this.beforeSend?this.beforeSend.call(this,n,o):"function"==typeof t.defaultBeforeSend&&t.default
|
||
|
* numbro.js
|
||
|
* version : 1.6.2
|
||
|
* author : Företagsplatsen AB
|
||
|
* license : MIT
|
||
|
* http://www.foretagsplatsen.se
|
||
|
*/
|
||
|
var f,m=t("underscore"),g="1.6.2",y={},v=y,b="en-US",x=null,w="0,0",M="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=g,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],o=null;v[r]||(Object.keys(v).forEach(function(t){o||t.split("-")[0]!==n||(o=t)}),r=o||e||"en-US"),_(r)},f.setCulture=function(t,e){var r=t,n=t.split("-")[1],o=null;y[r]||(n&&Object.keys(y).forEach(function(t){o||t.split("-")[1]!==n||(o=t)}),r=o||e||"en-US"),_(r)},f.language=function(t,e){if(console.warn("`language` is deprecated since version 1.6.0. Use `culture` instead"),!t)return b;if(t&&!e){if(!v[t])throw new Error("Unknown language : "+t);_(t)}return!e&&v[t]||p(t,e),f},f.culture=function(t,e){if(!t)return b;if(t&&!e){if(!y[t])throw new Error("Unknown culture : "+t);_(t)}return!e&&y[t]||p(t,e),f},f.languageData=function(t){if(console.warn("`languageData` is deprecated since version 1.6.0. Use `cultureData` instead"),!t)return v[b];if(!v[t])throw new Error("Unknown language : "+t);return v[t]},f.cultureData=function(t){if(!t)return y[b];if(!y[t])throw new Error("Unknown culture : "+t);return y[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 y},f.zeroFormat=function(t){x="string"==typeof t?t:null},f.defaultFormat=function(t){w="string"==typeof t?t:"0.0"},f.defaultCurrencyFormat=function(t){M="string"==typeof t?t:"0$"},f.validate=function(t,e){var r,n,o,i,s,a,l,u;if("string"!=typeof t&&(t+="",console.warn&&console.warn("Numbro.js: Value is not string. It has been co-erced to: ",t)),t=t.trim(),t.match(/^\d+$/))return!0;if(""===t)return!1;try{l=f.cultureData(e)}catch(h){l=f.cultureData(f.culture())}return o=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]===o))&&(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)&&(i=t.split(r),!(i.length>2)&&(i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/)))))},e.exports={format:d}},{underscore:"underscore"}],_process:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(t){if(c===setTimeout)return setTimeout(t,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function s(t){if(p===clearTimeout)return clearTimeout(t);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function a(){m&&d&&(m=!1,d.length?f=d.concat(f):g=-1,f.length&&l())}function l(){if(!m){var t=i(a);m=!0;for(var e=f.length;e;){for(d=f,f=[];++g<e;)d&&d[g].run();g=-1,e=f.length}d=null,m=!1,s(t)}}function u(t,e){this.fun=t,this.array=e}function h(){}var c,p,_=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(t){c=n}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(t){p=o}}();var d,f=[],m=!1,g=-1;_.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>
|
||
|
b=l(this.es),x=u(this.es),w=h(this.es),Math.abs(this.sin_p12-1)<=i?(M=this.a*s(v,b,x,w,o),e=Math.sqrt(t.x*t.x+t.y*t.y),k=M-e,g=_(k/this.a,v,b,x,w),m=n(this.long0+Math.atan2(t.x,-1*t.y)),t.x=m,t.y=g,t):Math.abs(this.sin_p12+1)<=i?(M=this.a*s(v,b,x,w,o),e=Math.sqrt(t.x*t.x+t.y*t.y),k=e-M,g=_(k/this.a,v,b,x,w),m=n(this.long0+Math.atan2(t.x,t.y)),t.x=m,t.y=g,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),S=Math.atan2(t.x,t.y),j=c(this.a,this.e,this.sin_p12),z=Math.cos(S),P=this.e*this.cos_p12*z,E=-P*P/(1-this.es),A=3*this.es*(1-E)*this.sin_p12*this.cos_p12*z/(1-this.es),C=e/j,N=C-E*(1+E)*Math.pow(C,3)/6-A*(1+3*E)*Math.pow(C,4)/24,O=1-E*N*N/2-C*N*N*N/6,T=Math.asin(this.sin_p12*Math.cos(N)+this.cos_p12*Math.sin(N)*z),m=n(this.long0+Math.asin(Math.sin(S)*Math.sin(N)/Math.cos(T))),g=Math.atan((1-this.es*O*this.sin_p12/Math.sin(T))*Math.tan(T)/(1-this.es)),t.x=m,t.y=g,t)},r.names=["Azimuthal_Equidistant","aeqd"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/asinz":"proj4/lib/common/asinz","../common/e0fn":"proj4/lib/common/e0fn","../common/e1fn":"proj4/lib/common/e1fn","../common/e2fn":"proj4/lib/common/e2fn","../common/e3fn":"proj4/lib/common/e3fn","../common/gN":"proj4/lib/common/gN","../common/imlfn":"proj4/lib/common/imlfn","../common/mlfn":"proj4/lib/common/mlfn"}],"proj4/lib/projections/cass":[function(t,e,r){var n=t("../common/mlfn"),o=t("../common/e0fn"),i=t("../common/e1fn"),s=t("../common/e2fn"),a=t("../common/e3fn"),l=t("../common/gN"),u=t("../common/adjust_lon"),h=t("../common/adjust_lat"),c=t("../common/imlfn"),p=Math.PI/2,_=1e-10;r.init=function(){this.sphere||(this.e0=o(this.es),this.e1=i(this.es),this.e2=s(this.es),this.e3=a(this.es),this.ml0=this.a*n(this.e0,this.e1,this.e2,this.e3,this.lat0))},r.forward=function(t){var e,r,o=t.x,i=t.y;if(o=u(o-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(o)),r=this.a*(Math.atan2(Math.tan(i),Math.cos(o))-this.lat0);else{var s=Math.sin(i),a=Math.cos(i),h=l(this.a,this.e,s),c=Math.tan(i)*Math.tan(i),p=o*Math.cos(i),_=p*p,d=this.es*a*a/(1-this.es),f=this.a*n(this.e0,this.e1,this.e2,this.e3,i);e=h*p*(1-_*c*(1/6-(8-c+8*d)*_/120)),r=f-this.ml0+h*s/a*_*(.5+(5-c+6*d)*_/24)}return t.x=e+this.x0,t.y=r+this.y0,t},r.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,r,n=t.x/this.a,o=t.y/this.a;if(this.sphere){var i=o+this.lat0;e=Math.asin(Math.sin(i)*Math.cos(n)),r=Math.atan2(Math.tan(n),Math.cos(i))}else{var s=this.ml0/this.a+o,a=c(s,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-p)<=_)return t.x=this.long0,t.y=p,o<0&&(t.y*=-1),t;var d=l(this.a,this.e,Math.sin(a)),f=d*d*d/this.a/this.a*(1-this.es),m=Math.pow(Math.tan(a),2),g=n*this.a/d,y=g*g;e=a-d*Math.tan(a)/f*g*g*(.5-(1+3*m)*g*g/24),r=g*(1-y*(m/3+(1+3*m)*m*y/15))/Math.cos(a)}return t.x=u(r+this.long0),t.y=h(e),t},r.names=["Cassini","Cassini_Soldner","cass"]},{"../common/adjust_lat":"proj4/lib/common/adjust_lat","../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/e0fn":"proj4/lib/common/e0fn","../common/e1fn":"proj4/lib/common/e1fn","../common/e2fn":"proj4/lib/common/e2fn","../common/e3fn":"proj4/lib/common/e3fn","../common/gN":"proj4/lib/common/gN","../common/imlfn":"proj4/lib/common/imlfn","../common/mlfn":"proj4/lib/common/mlfn"}],"proj4/lib/projections/cea":[function(t,e,r){var n=t("../common/adjust_lon"),o=t("../common/qsfnz"),i=t("../common/msfnz"),s=t("../common/iqsfnz");r.init=function(){this.sphere||(this.k0=i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},r.forward=function(t){var e,r,i=t.x,s=t.y,a=n(i-this.long0);if(this.sphere)e=this.x0+this.a*a*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts);else{var l=o(this.e,Math.sin(s));e=this.x0+this.a*this.k0*a,r=this.y0+this.a*l*.5/this.k0}return t.x=e,t.y=r,t},r.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,r;return this.sphere?(e=n(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=s(this.e,2*t.y*this.k0/this.a),e=n(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},r.names=["cea"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/iqsfnz":"pr
|
||
|
this.ms1=s(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-n,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},r.forward=function(t){var e,r,i,s,l,h,c=t.x,p=t.y,_=Math.sin(p),d=Math.cos(p),f=u(c-this.long0);return Math.abs(Math.abs(c-this.long0)-Math.PI)<=o&&Math.abs(p+this.lat0)<=o?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*_+this.coslat0*d*Math.cos(f)),t.x=this.a*e*d*Math.sin(f)+this.x0,t.y=this.a*e*(this.coslat0*_-this.sinlat0*d*Math.cos(f))+this.y0,t):(r=2*Math.atan(this.ssfn_(p,_,this.e))-n,s=Math.cos(r),i=Math.sin(r),Math.abs(this.coslat0)<=o?(l=a(this.e,p*this.con,this.con*_),h=2*this.a*this.k0*l/this.cons,t.x=this.x0+h*Math.sin(c-this.long0),t.y=this.y0-this.con*h*Math.cos(c-this.long0),t):(Math.abs(this.sinlat0)<o?(e=2*this.a*this.k0/(1+s*Math.cos(f)),t.y=e*i):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*i+this.cosX0*s*Math.cos(f))),t.y=e*(this.cosX0*i-this.sinX0*s*Math.cos(f))+this.y0),t.x=e*s*Math.sin(f)+this.x0,t))},r.inverse=function(t){t.x-=this.x0,t.y-=this.y0;var e,r,i,s,a,h=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var c=2*Math.atan(h/(.5*this.a*this.k0));return e=this.long0,r=this.lat0,h<=o?(t.x=e,t.y=r,t):(r=Math.asin(Math.cos(c)*this.sinlat0+t.y*Math.sin(c)*this.coslat0/h),e=u(Math.abs(this.coslat0)<o?this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y):this.long0+Math.atan2(t.x*Math.sin(c),h*this.coslat0*Math.cos(c)-t.y*this.sinlat0*Math.sin(c))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=o){if(h<=o)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,i=h*this.cons/(2*this.a*this.k0),r=this.con*l(this.e,i),e=this.con*u(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else s=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,h<=o?a=this.X0:(a=Math.asin(Math.cos(s)*this.sinX0+t.y*Math.sin(s)*this.cosX0/h),e=u(this.long0+Math.atan2(t.x*Math.sin(s),h*this.cosX0*Math.cos(s)-t.y*this.sinX0*Math.sin(s)))),r=-1*l(this.e,Math.tan(.5*(n+a)));return t.x=e,t.y=r,t},r.names=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","../common/msfnz":"proj4/lib/common/msfnz","../common/phi2z":"proj4/lib/common/phi2z","../common/sign":"proj4/lib/common/sign","../common/tsfnz":"proj4/lib/common/tsfnz"}],"proj4/lib/projections/sterea":[function(t,e,r){var n=t("./gauss"),o=t("../common/adjust_lon");r.init=function(){n.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},r.forward=function(t){var e,r,i,s;return t.x=o(t.x-this.long0),n.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),i=Math.cos(t.x),s=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*i),t.x=s*r*Math.sin(t.x),t.y=s*(this.cosc0*e-this.sinc0*r*i),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},r.inverse=function(t){var e,r,i,s,a;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,a=Math.sqrt(t.x*t.x+t.y*t.y)){var l=2*Math.atan2(a,this.R2);e=Math.sin(l),r=Math.cos(l),s=Math.asin(r*this.sinc0+t.y*e*this.cosc0/a),i=Math.atan2(t.x*e,a*this.cosc0*r-t.y*this.sinc0*e)}else s=this.phic0,i=0;return t.x=i,t.y=s,n.inverse.apply(this,[t]),t.x=o(t.x+this.long0),t},r.names=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative"]},{"../common/adjust_lon":"proj4/lib/common/adjust_lon","./gauss":"proj4/lib/projections/gauss"}],"proj4/lib/projections/tmerc":[function(t,e,r){var n=t("../common/e0fn"),o=t("../common/e1fn"),i=t("../common/e2fn"),s=t("../common/e3fn"),a=t("../common/mlfn"),l=t("../common/adjust_lon"),u=Math.PI/2,h=1e-10,c=t("../common/sign"),p=t("../common/asinz");r.init=function(){this.e0=n(this.es),this.e1=o(this.es),this.e2=i(this.es),this.e3=s(this.es),this.ml0=this.a*a(this.e0,this.e1,this.e2,this.e3,this.lat0)},r.forward=function(t){var e,r,n,o=t.x,i=t.y,s=l(o-this.long0),u=Math.sin(i),h=Math.cos(i);if(this.sphere){var c=h*Math.sin(s);if(Ma
|
||
|
sprintf() for JavaScript 0.7-beta1
|
||
|
http://www.diveintojavascript.com/projects/javascript-sprintf
|
||
|
|
||
|
Copyright (c) Alexandru Marasteanu <alexaholic [at) gmail (dot] com>
|
||
|
All rights reserved.
|
||
|
|
||
|
Redistribution and use in source and binary forms, with or without
|
||
|
modification, are permitted provided that the following conditions are met:
|
||
|
* Redistributions of source code must retain the above copyright
|
||
|
notice, this list of conditions and the following disclaimer.
|
||
|
* Redistributions in binary form must reproduce the above copyright
|
||
|
notice, this list of conditions and the following disclaimer in the
|
||
|
documentation and/or other materials provided with the distribution.
|
||
|
* Neither the name of sprintf() for JavaScript nor the
|
||
|
names of its contributors may be used to endorse or promote products
|
||
|
derived from this software without specific prior written permission.
|
||
|
|
||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||
|
DISCLAIMED. IN NO EVENT SHALL Alexandru Marasteanu BE LIABLE FOR ANY
|
||
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
|
|
||
|
|
||
|
Changelog:
|
||
|
2010.11.07 - 0.7-beta1-node
|
||
|
- converted it to a node.js compatible module
|
||
|
|
||
|
2010.09.06 - 0.7-beta1
|
||
|
- features: vsprintf, support for named placeholders
|
||
|
- enhancements: format cache, reduced global namespace pollution
|
||
|
|
||
|
2010.05.22 - 0.6:
|
||
|
- reverted to 0.4 and fixed the bug regarding the sign of the number 0
|
||
|
Note:
|
||
|
Thanks to Raphael Pigulla <raph (at] n3rd [dot) org> (http://www.n3rd.org/)
|
||
|
who warned me about a bug in 0.5, I discovered that the last update was
|
||
|
a regress. I appologize for that.
|
||
|
|
||
|
2010.05.09 - 0.5:
|
||
|
- bug fix: 0 is now preceeded with a + sign
|
||
|
- bug fix: the sign was not at the right position on padded results (Kamal Abdali)
|
||
|
- switched from GPL to BSD license
|
||
|
|
||
|
2007.10.21 - 0.4:
|
||
|
- unit test and patch (David Baird)
|
||
|
|
||
|
2007.09.17 - 0.3:
|
||
|
- bug fix: no longer throws exception on empty paramenters (Hans Pufal)
|
||
|
|
||
|
2007.09.11 - 0.2:
|
||
|
- feature: added argument swapping
|
||
|
|
||
|
2007.04.03 - 0.1:
|
||
|
- initial release
|
||
|
**/
|
||
|
var n=function(){function t(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function e(t,e){for(var r=[];e>0;r[--e]=t);return r.join("")}var r=function(){return r.cache.hasOwnProperty(arguments[0])||(r.cache[arguments[0]]=r.parse(arguments[0])),r.format.call(null,r.cache[arguments[0]],arguments)};return r.object_stringify=function(t,e,n,o){var i="";if(null!=t)switch(typeof t){case"function":return"[Function"+(t.name?": "+t.name:"")+"]";case"object":if(t instanceof Error)return"["+t.toString()+"]";if(e>=n)return"[Object]";if(o&&(o=o.slice(0),o.push(t)),null!=t.length){i+="[";var s=[];for(var a in t)o&&o.indexOf(t[a])>=0?s.push("[Circular]"):s.push(r.object_stringify(t[a],e+1,n,o));i+=s.join(", ")+"]"}else{if("getMonth"in t)return"Date("+t+")";i+="{";var s=[];for(var l in t)t.hasOwnProperty(l)&&(o&&o.indexOf(t[l])>=0?s.push(l+": [Circular]"):s.push(l+": "+r.object_stringify(t[l],e+1,n,o)));i+=s.join(", ")+"}"}return i;case"string":return'"'+t+'"'}return""+t},r.format=function(o,i){var s,a,l,u,h,c,p,_=1,d=o.length,f="",m=[];for(a=0;a<d;a++)if(f=t(o[a]),"string"===f)m.push(o[a]);else if("array"===f){if(u=o[a],u[2])for(s=i[_],l=0;l<u[2].length;l++){if(!s.hasOwnProperty(u[2][l]))throw new Error(n('[sprintf] property "%s" does not exist',u[2][l]));s=s[u[2][l]]}else s=u[1]?i[u[1]]:i[_++];if(/[^sO]/.test(u[8])&&"number"!=t(s))throw new Error(n('[sprintf] expecting number but found %s "'+s+'"',t(s)));switch(u[8]){case"b":s=s.toString(2);break;case"c":s=String.fromCharCode(s);break;case"d":s=parseInt(s,10);break;case"e":s=u[7]?s.toExponential(u[7]):s.toExponential();break;case"f":s=u[7]?parseFloat(s).toFixed(u[7]):parseFloat(s);break;case"O":s=r.object_stringify(s,0,parseInt(u[7])||5);break;case"o":s=s.toString(8);break;case"s":s=(s=String(s))&&u[7]?s.substring(0,u[7]):s;break;case"u":s=Math.abs(s);break;case"x":s=s.toString(16);break;case"X":s=s.toString(16).toUpperCase()}s=/[def]/.test(u[8])&&u[3]&&s>=0?"+"+s:s,c=u[4]?"0"==u[4]?"0":u[4].charAt(1):" ",p=u[6]-String(s).length,h=u[6]?e(c,p):"",m.push(u[5]?s+h:h+s)}return m.join("")},r.cache={},r.parse=function(t){for(var e=t,r=[],n=[],o=0;e;){if(null!==(r=/^[^\x25]+/.exec(e)))n.push(r[0]);else if(null!==(r=/^\x25{2}/.exec(e)))n.push("%");else{if(null===(r=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosOuxX])/.exec(e)))throw new Error("[sprintf] "+e);if(r[2]){o|=1;var i=[],s=r[2],a=[];if(null===(a=/^([a-z_][a-z_\d]*)/i.exec(s)))throw new Error("[sprintf] "+s);for(i.push(a[1]);""!==(s=s.substring(a[0].length));)if(null!==(a=/^\.([a-z_][a-z_\d]*)/i.exec(s)))i.push(a[1]);else{if(null===(a=/^\[(\d+)\]/.exec(s)))throw new Error("[sprintf] "+s);i.push(a[1])}r[2]=i}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push(r)}e=e.substring(r[0].length)}return n},r}(),o=function(t,e){var r=e.slice();return r.unshift(t),n.apply(null,r)};e.exports=n,n.sprintf=n,n.vsprintf=o},{}],"timezone/index":[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,o=e.day[1];do n=new Date(Date.UTC(r,e.month,Math.abs(o++)));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 o,i,s,a,l,u,h,c=e[e.zone],p=[],_=new Date(n).getUTCFullYear(),d=1;for(o=1,i=c.length;o<i&&!(c[o][r]<=n);o++);if(s=c[o],s.rules){for(u=e[s.rules],h=_+1;h>=_-d;--h)for(o=0,i=u.length;o<i;o++)u[o].from<=h&&h<=u[o].to?p.push(t(s,u[o],h)):u[o].to<h&&1==d&&(d=h-u[o].to);for(p.sort(function(t,e){return t.sort-e.sort}),o=0,i=p.length;o<i;o++)n>=p[o][r]&&p[o][p[o].clock]>s[p[o].clock]&&(a=p[o])}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.zo
|
||
|
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
|
// Underscore may be freely distributed under the MIT license.
|
||
|
(function(){function e(t){function e(e,r,n,o,i,s){for(;i>=0&&i<s;i+=t){var a=o?o[i]:i;n=r(n,e[a],a,e)}return n}return function(r,n,o,i){n=w(n,i,4);var s=!P(r)&&x.keys(r),a=(s||r).length,l=t>0?0:a-1;return arguments.length<3&&(o=r[s?s[l]:l],l+=t),e(r,n,o,s,l,a)}}function o(t){return function(e,r,n){r=M(r,n);for(var o=z(e),i=t>0?0:o-1;i>=0&&i<o;i+=t)if(r(e[i],i,e))return i;return-1}}function i(t,e,r){return function(n,o,i){var s=0,a=z(n);if("number"==typeof i)t>0?s=i>=0?i:Math.max(i+a,s):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(n,o),n[i]===o?i:-1;if(o!==o)return i=e(_.call(n,s,a),x.isNaN),i>=0?i+s:-1;for(i=t>0?s:a-1;i>=0&&i<a;i+=t)if(n[i]===o)return i;return-1}}function s(t,e){var r=O.length,n=t.constructor,o=x.isFunction(n)&&n.prototype||h,i="constructor";for(x.has(t,i)&&!x.contains(e,i)&&e.push(i);r--;)i=O[r],i in t&&t[i]!==o[i]&&!x.contains(e,i)&&e.push(i)}var a=this,l=a._,u=Array.prototype,h=Object.prototype,c=Function.prototype,p=u.push,_=u.slice,d=h.toString,f=h.hasOwnProperty,m=Array.isArray,g=Object.keys,y=c.bind,v=Object.create,b=function(){},x=function(t){return t instanceof x?t:this instanceof x?void(this._wrapped=t):new x(t)};"undefined"!=typeof n?("undefined"!=typeof r&&r.exports&&(n=r.exports=x),n._=x):a._=x,x.VERSION="1.8.3";var w=function(t,e,r){if(void 0===e)return t;switch(null==r?3:r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)};case 4:return function(r,n,o,i){return t.call(e,r,n,o,i)}}return function(){return t.apply(e,arguments)}},M=function(t,e,r){return null==t?x.identity:x.isFunction(t)?w(t,e,r):x.isObject(t)?x.matcher(t):x.property(t)};x.iteratee=function(t,e){return M(t,e,1/0)};var k=function(t,e){return function(r){var n=arguments.length;if(n<2||null==r)return r;for(var o=1;o<n;o++)for(var i=arguments[o],s=t(i),a=s.length,l=0;l<a;l++){var u=s[l];e&&void 0!==r[u]||(r[u]=i[u])}return r}},j=function(t){if(!x.isObject(t))return{};if(v)return v(t);b.prototype=t;var e=new b;return b.prototype=null,e},T=function(t){return function(e){return null==e?void 0:e[t]}},S=Math.pow(2,53)-1,z=T("length"),P=function(t){var e=z(t);return"number"==typeof e&&e>=0&&e<=S};x.each=x.forEach=function(t,e,r){e=w(e,r);var n,o;if(P(t))for(n=0,o=t.length;n<o;n++)e(t[n],n,t);else{var i=x.keys(t);for(n=0,o=i.length;n<o;n++)e(t[i[n]],i[n],t)}return t},x.map=x.collect=function(t,e,r){e=M(e,r);for(var n=!P(t)&&x.keys(t),o=(n||t).length,i=Array(o),s=0;s<o;s++){var a=n?n[s]:s;i[s]=e(t[a],a,t)}return i},x.reduce=x.foldl=x.inject=e(1),x.reduceRight=x.foldr=e(-1),x.find=x.detect=function(t,e,r){var n;if(n=P(t)?x.findIndex(t,e,r):x.findKey(t,e,r),void 0!==n&&n!==-1)return t[n]},x.filter=x.select=function(t,e,r){var n=[];return e=M(e,r),x.each(t,function(t,r,o){e(t,r,o)&&n.push(t)}),n},x.reject=function(t,e,r){return x.filter(t,x.negate(M(e)),r)},x.every=x.all=function(t,e,r){e=M(e,r);for(var n=!P(t)&&x.keys(t),o=(n||t).length,i=0;i<o;i++){var s=n?n[i]:i;if(!e(t[s],s,t))return!1}return!0},x.some=x.any=function(t,e,r){e=M(e,r);for(var n=!P(t)&&x.keys(t),o=(n||t).length,i=0;i<o;i++){var s=n?n[i]:i;if(e(t[s],s,t))return!0}return!1},x.contains=x.includes=x.include=function(t,e,r,n){return P(t)||(t=x.values(t)),("number"!=typeof r||n)&&(r=0),x.indexOf(t,e,r)>=0},x.invoke=function(t,e){var r=_.call(arguments,2),n=x.isFunction(e);return x.map(t,function(t){var o=n?e:t[e];return null==o?o:o.apply(t,r)})},x.pluck=function(t,e){return x.map(t,x.property(e))},x.where=function(t,e){return x.filter(t,x.matcher(e))},x.findWhere=function(t,e){return x.find(t,x.matcher(e))},x.max=function(t,e,r){var n,o,i=-(1/0),s=-(1/0);if(null==e&&null!=t){t=P(t)?t:x.values(t);for(var a=0,l=t.length;a<l;a++)n=t[a],n>i&&(i=n)}else e=M(e,r),x.each(t,function(t,r,n){o=e(t,r,n),(o>s||o===-(1/0)&&i===-(1/0))&&(i=t,s=o)});return i},x.min=function(t,e,r){var n,o,i=1/0,s=1/0;if(null==e&&null!=t){t=P(t)?t:x.values(t);for(var a=0,l=t.length;a<l;a++)n=t[a],n<i&&(i=n)}else e=M(e,r),x.each(t,function(t,r,n){o=e(t,r,n),(o<s||o===1/0&&i===1/0)&&(i=t,s=o)});return
|
||
|
t.prototype._target=null,t.prototype._usage=35048,t.prototype._create=function(){return this.handle=this._gl.createBuffer(),this._buffer_size=0,null},t.prototype["delete"]=function(){return this._gl.deleteBuffer(this.handle),null},t.prototype.activate=function(){return this._gl.bindBuffer(this._target,this.handle),null},t.prototype.deactivate=function(){return this._gl.bindBuffer(this._target,null),null},t.prototype.set_size=function(t){return d(t,this._buffer_size)||(this.activate(),this._gl.bufferData(this._target,t,this._usage),this._buffer_size=t),null},t.prototype.set_data=function(t,e){return this.activate(),this._gl.bufferSubData(this._target,t,e),null},a=function(){f(this,arguments)},a.prototype=Object.create(t.prototype),a.prototype._base_class=t.prototype,a.prototype._class_name="VertexBuffer",a.prototype._target=34962,n=function(){f(this,arguments)},n.prototype=Object.create(t.prototype),n.prototype._base_class=t.prototype,n.prototype._class_name="IndexBuffer",n.prototype._target=34963,i=function(){f(this,arguments)},i.prototype=Object.create(r.prototype),i.prototype._base_class=r.prototype,i.prototype._class_name="Texture2D",i.prototype._target=3553,i.prototype._types={Int8Array:5120,Uint8Array:5121,Int16Array:5122,Uint16Array:5123,Int32Array:5124,Uint32Array:5125,Float32Array:5126},i.prototype._create=function(){return this.handle=this._gl.createTexture(),this._shape_format=null,null},i.prototype["delete"]=function(){return this._gl.deleteTexture(this.handle),null},i.prototype.activate=function(){return this._gl.bindTexture(this._target,this.handle),null},i.prototype.deactivate=function(){return this._gl.bindTexture(this._target,0),null},i.prototype._get_alignment=function(t){var e,r,n,o;for(r=[4,8,2,1],n=r,"object"!=typeof n||Array.isArray(n)||(n=Object.keys(n)),o=0;o<n.length;o+=1)if(e=n[o],d(t%e,0))return e;return null},i.prototype.set_wrapping=function(t,e){return this.activate(),this._gl.texParameterf(this._target,this._gl.TEXTURE_WRAP_S,t),this._gl.texParameterf(this._target,this._gl.TEXTURE_WRAP_T,e),null},i.prototype.set_interpolation=function(t,e){return this.activate(),this._gl.texParameterf(this._target,this._gl.TEXTURE_MIN_FILTER,t),this._gl.texParameterf(this._target,this._gl.TEXTURE_MAG_FILTER,e),null},i.prototype.set_size=function(t,e){var r,n,o;return n=t,r=n[0],o=n[1],d([r,o,e],this._shape_format)||(this._shape_format=[r,o,e],this.activate(),this._gl.texImage2D(this._target,0,e,o,r,0,e,this._gl.UNSIGNED_BYTE,null)),this.u_shape=[r,o],null},i.prototype.set_data=function(t,e,r){var n,o,i,s,a,l,u,h,c,p,_;if(d(e.length,2)&&(e=[e[0],e[1],1]),this.activate(),s=this._shape_format[2],u=e,l=u[0],c=u[1],n=u[2],h=t,_=h[0],p=h[1],a=v.call(this._types,r.constructor.name,null),null===a)throw i=new Error("ValueError:"+("Type "+r.constructor.name+" not allowed for texture")),i.name="ValueError",i;return o=this._get_alignment(m(e[e.length-2],e[e.length-1])),d(o,4)||this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,o),this._gl.texSubImage2D(this._target,0,p,_,c,l,s,a,r),d(o,4)||this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,4),null},s=function(){f(this,arguments)},s.prototype=Object.create(i.prototype),s.prototype._base_class=i.prototype,s.prototype._class_name="Texture3DLike",s.prototype.GLSL_SAMPLE_NEAREST="\n vec4 sample3D(sampler2D tex, vec3 texcoord, vec3 shape, vec2 tiles) {\n shape.xyz = shape.zyx; // silly row-major convention\n float nrows = tiles.y, ncols = tiles.x;\n // Don't let adjacent frames be interpolated into this one\n texcoord.x = min(texcoord.x * shape.x, shape.x - 0.5);\n texcoord.x = max(0.5, texcoord.x) / shape.x;\n texcoord.y = min(texcoord.y * shape.y, shape.y - 0.5);\n texcoord.y = max(0.5, texcoord.y) / shape.y;\n\n float zindex = floor(texcoord.z * shape.z);\n\n // Do a lookup in the 2D texture\n float u = (mod(zindex, ncols) + texcoord.x) / ncols;\n float v = (floor(zindex / ncols) + texcoord.y) / nrows;\n\n return texture2D(tex, vec2(u,v));\n
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
var n;!function(t){function e(t){return t instanceof Array?new l(t):t.__iter__()}function r(t){return t instanceof Array?new u(t):t.__reversed__()}function n(t){return t.__next__()}function o(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 i(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 o,i=t.__iter__();void 0!==(o=i.__next__());)if(e(o)===!1)return}function s(t,e){var r=[];if(t instanceof Array)for(var n=0,o=t.length;n<o;++n)r.push(e(t[n]));else for(var i,s=t.__iter__();void 0!==(i=s.__next__());)r.push(e(i));return r}function a(t,e){var r,n=[];if(t instanceof Array)for(var o=0,i=t.length;o<i;++o)r=t[o],e(r)&&n.push(r);else for(var s=t.__iter__();void 0!==(r=s.__next__());)e(r)&&n.push(r);return n}var l=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}();t.ArrayIterator=l;var u=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}();t.ReverseArrayIterator=u,t.iter=e,t.reversed=r,t.next=n,t.asArray=o,t.forEach=i,t.map=s,t.filter=a}(n||(n={}));/*-----------------------------------------------------------------------------
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
var n;!function(t){var e=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.copy=function(){return new t(this.first,this.second)},t}();t.Pair=e}(n||(n={}));/*-----------------------------------------------------------------------------
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
var n;!function(t){function e(t,e,r){for(var n,o,i=0,s=t.length;s>0;)n=s>>1,o=i+n,r(t[o],e)<0?(i=o+1,s-=n+1):s=n;return i}function r(t,r,n){var o=e(t,r,n);if(o===t.length)return-1;var i=t[o];return 0!==n(i,r)?-1:o}function n(t,r,n){var o=e(t,r,n);if(o!==t.length){var i=t[o];if(0===n(i,r))return i}}function o(e,r){var n=t.asArray(e),o=n.length;if(o<=1)return n;n.sort(r);for(var i=[n[0]],s=1,a=0;s<o;++s){var l=n[s];0!==r(i[a],l)&&(i.push(l),++a)}return i}function i(t,e,r){for(var n=0,o=0,i=t.length,s=e.length;n<i&&o<s;){var a=r(t[n],e[o]);if(a<0)++n;else{if(!(a>0))return!1;++o}}return!0}function s(t,e,r){var n=t.length,o=e.length;if(n>o)return!1;for(var i=0,s=0;i<n&&s<o;){var a=r(t[i],e[s]);if(a<0)return!1;a>0?++s:(++i,++s)}return!(i<n)}function a(t,e,r){for(var n=0,o=0,i=t.length,s=e.length,a=[];n<i&&o<s;){var l=t[n],u=e[o],h=r(l,u);h<0?(a.push(l),++n):h>0?(a.push(u),++o):(a.push(l),++n,++o)}for(;n<i;)a.push(t[n]),++n;for(;o<s;)a.push(e[o]),++o;return a}function l(t,e,r){for(var n=0,o=0,i=t.length,s=e.length,a=[];n<i&&o<s;){var l=t[n],u=e[o],h=r(l,u);h<0?++n:h>0?++o:(a.push(l),++n,++o)}return a}function u(t,e,r){for(var n=0,o=0,i=t.length,s=e.length,a=[];n<i&&o<s;){var l=t[n],u=e[o],h=r(l,u);h<0?(a.push(l),++n):h>0?++o:(++n,++o)}for(;n<i;)a.push(t[n]),++n;return a}function h(t,e,r){for(var n=0,o=0,i=t.length,s=e.length,a=[];n<i&&o<s;){var l=t[n],u=e[o],h=r(l,u);h<0?(a.push(l),++n):h>0?(a.push(u),++o):(++n,++o)}for(;n<i;)a.push(t[n]),++n;for(;o<s;)a.push(e[o]),++o;return a}t.lowerBound=e,t.binarySearch=r,t.binaryFind=n,t.asSet=o,t.setIsDisjoint=i,t.setIsSubset=s,t.setUnion=a,t.setIntersection=l,t.setDifference=u,t.setSymmetricDifference=h}(n||(n={}));/*-----------------------------------------------------------------------------
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
var n;!function(t){var e=function(){function e(){this._array=[]}return e.prototype.size=function(){return this._array.length},e.prototype.empty=function(){return 0===this._array.length},e.prototype.itemAt=function(t){return this._array[t]},e.prototype.takeAt=function(t){return this._array.splice(t,1)[0]},e.prototype.clear=function(){this._array=[]},e.prototype.swap=function(t){var e=this._array;this._array=t._array,t._array=e},e.prototype.__iter__=function(){return t.iter(this._array)},e.prototype.__reversed__=function(){return t.reversed(this._array)},e}();t.ArrayBase=e}(n||(n={}));/*-----------------------------------------------------------------------------
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
var n,o=this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);r.prototype=e.prototype,t.prototype=new r};!function(t){function e(t){return function(e,r){return t(e.first,r)}}function r(t,e,r){for(var n=0,o=0,i=t.length,s=e.length,a=[];n<i&&o<s;){var l=t[n],u=e[o],h=r(l.first,u.first);h<0?(a.push(l.copy()),++n):h>0?(a.push(u.copy()),++o):(a.push(u.copy()),++n,++o)}for(;n<i;)a.push(t[n].copy()),++n;for(;o<s;)a.push(e[o].copy()),++o;return a}var n=function(n){function i(t){n.call(this),this._compare=t,this._wrapped=e(t)}return o(i,n),i.prototype.comparitor=function(){return this._compare},i.prototype.indexOf=function(e){return t.binarySearch(this._array,e,this._wrapped)},i.prototype.contains=function(e){return t.binarySearch(this._array,e,this._wrapped)>=0},i.prototype.find=function(e){return t.binaryFind(this._array,e,this._wrapped)},i.prototype.setDefault=function(e,r){var n=this._array,o=t.lowerBound(n,e,this._wrapped);if(o===n.length){var i=new t.Pair(e,r());return n.push(i),i}var s=n[o];if(0!==this._compare(s.first,e)){var i=new t.Pair(e,r());return n.splice(o,0,i),i}return s},i.prototype.insert=function(e,r){var n=this._array,o=t.lowerBound(n,e,this._wrapped);if(o===n.length){var i=new t.Pair(e,r);return n.push(i),i}var s=n[o];if(0!==this._compare(s.first,e)){var i=new t.Pair(e,r);return n.splice(o,0,i),i}return s.second=r,s},i.prototype.update=function(e){var n=this;if(e instanceof i){var o=e;this._array=r(this._array,o._array,this._compare)}else t.forEach(e,function(t){n.insert(t.first,t.second)})},i.prototype.erase=function(e){var r=this._array,n=t.binarySearch(r,e,this._wrapped);if(!(n<0))return r.splice(n,1)[0]},i.prototype.copy=function(){for(var t=new i(this._compare),e=t._array,r=this._array,n=0,o=r.length;n<o;++n)e.push(r[n].copy());return t},i}(t.ArrayBase);t.AssociativeArray=n}(n||(n={}));/*-----------------------------------------------------------------------------
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
var n;!function(t){function e(e,n){return e instanceof r?e._array:t.asSet(e,n)}var r=function(r){function n(t){r.call(this),this._compare=t}return o(n,r),n.prototype.comparitor=function(){return this._compare},n.prototype.indexOf=function(e){return t.binarySearch(this._array,e,this._compare)},n.prototype.contains=function(e){return t.binarySearch(this._array,e,this._compare)>=0},n.prototype.insert=function(e){var r=this._array,n=t.lowerBound(r,e,this._compare);return n===r.length?(r.push(e),!0):0!==this._compare(r[n],e)&&(r.splice(n,0,e),!0)},n.prototype.erase=function(e){var r=this._array,n=t.binarySearch(r,e,this._compare);return!(n<0)&&(r.splice(n,1),!0)},n.prototype.copy=function(){var t=new n(this._compare);return t._array=this._array.slice(),t},n.prototype.isDisjoint=function(r){var n=this._compare,o=e(r,n);return t.setIsDisjoint(this._array,o,n)},n.prototype.isSubset=function(r){var n=this._compare,o=e(r,n);return t.setIsSubset(this._array,o,n)},n.prototype.isSuperset=function(r){var n=this._compare,o=e(r,n);return t.setIsSubset(o,this._array,n)},n.prototype.union=function(r){var o=this._compare,i=new n(o),s=e(r,o);return i._array=t.setUnion(this._array,s,o),i},n.prototype.intersection=function(r){var o=this._compare,i=new n(o),s=e(r,o);return i._array=t.setIntersection(this._array,s,o),i},n.prototype.difference=function(r){var o=this._compare,i=new n(o),s=e(r,o);return i._array=t.setDifference(this._array,s,o),i},n.prototype.symmetricDifference=function(r){var o=this._compare,i=new n(o),s=e(r,o);return i._array=t.setSymmetricDifference(this._array,s,o),i},n.prototype.unionUpdate=function(r){var n=this._compare,o=e(r,n);this._array=t.setUnion(this._array,o,n)},n.prototype.intersectionUpdate=function(r){var n=this._compare,o=e(r,n);this._array=t.setIntersection(this._array,o,n)},n.prototype.differenceUpdate=function(r){var n=this._compare,o=e(r,n);this._array=t.setDifference(this._array,o,n)},n.prototype.symmetricDifferenceUpdate=function(r){var n=this._compare,o=e(r,n);this._array=t.setSymmetricDifference(this._array,o,n)},n}(t.ArrayBase);t.UniqueArray=r}(n||(n={}));/*-----------------------------------------------------------------------------
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
/*-----------------------------------------------------------------------------
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
var i;!function(t){!function(t){t[t.Le=0]="Le",t[t.Ge=1]="Ge",t[t.Eq=2]="Eq"}(t.Operator||(t.Operator={}));var e=(t.Operator,function(){function e(e,n,o){"undefined"==typeof o&&(o=t.Strength.required),this._id=r++,this._operator=n,this._expression=e,this._strength=t.Strength.clip(o)}return e.Compare=function(t,e){return t.id()-e.id()},e.prototype.id=function(){return this._id},e.prototype.expression=function(){return this._expression},e.prototype.op=function(){return this._operator},e.prototype.strength=function(){return this._strength},e}());t.Constraint=e;var r=0}(i||(i={}));/*-----------------------------------------------------------------------------
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
var i;!function(t){function e(t){return new n.AssociativeArray(t)}t.createMap=e}(i||(i={}));/*-----------------------------------------------------------------------------
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
var i;!function(t){var e=function(){function t(t){"undefined"==typeof t&&(t=""),this._value=0,this._context=null,this._id=r++,this._name=t}return t.Compare=function(t,e){return t.id()-e.id()},t.prototype.id=function(){return this._id},t.prototype.name=function(){return this._name},t.prototype.setName=function(t){this._name=t},t.prototype.context=function(){return this._context},t.prototype.setContext=function(t){this._context=t},t.prototype.value=function(){return this._value},t.prototype.setValue=function(t){this._value=t},t}();t.Variable=e;var r=0}(i||(i={}));/*-----------------------------------------------------------------------------
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
var i;!function(t){function e(e){for(var r=0,n=function(){return 0},o=t.createMap(t.Variable.Compare),i=0,s=e.length;i<s;++i){var a=e[i];if("number"==typeof a)r+=a;else if(a instanceof t.Variable)o.setDefault(a,n).second+=1;else{if(!(a instanceof Array))throw new Error("invalid Expression argument: "+a);if(2!==a.length)throw new Error("array must have length 2");var l=a[0],u=a[1];if("number"!=typeof l)throw new Error("array item 0 must be a number");if(!(u instanceof t.Variable))throw new Error("array item 1 must be a variable");o.setDefault(u,n).second+=l}}return{terms:o,constant:r}}var r=function(){function t(){var t=e(arguments);this._terms=t.terms,this._constant=t.constant}return t.prototype.terms=function(){return this._terms},t.prototype.constant=function(){return this._constant},t.prototype.value=function(){var t=this._constant;return n.forEach(this._terms,function(e){t+=e.first.value()*e.second}),t},t}();t.Expression=r}(i||(i={}));/*-----------------------------------------------------------------------------
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
var i;!function(t){!function(t){function e(t,e,r,n){"undefined"==typeof n&&(n=1);var o=0;return o+=1e6*Math.max(0,Math.min(1e3,t*n)),o+=1e3*Math.max(0,Math.min(1e3,e*n)),o+=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}(t.Strength||(t.Strength={}));t.Strength}(i||(i={}));/*-----------------------------------------------------------------------------
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
var i;!function(t){function e(t){var e=1e-8;return t<0?-t<e:t<e}function r(){return t.createMap(t.Constraint.Compare)}function n(){return t.createMap(l.Compare)}function o(){return t.createMap(t.Variable.Compare)}function i(){return t.createMap(t.Variable.Compare)}var s=function(){function s(){this._cnMap=r(),this._rowMap=n(),this._varMap=o(),this._editMap=i(),this._infeasibleRows=[],this._objective=new h,this._artificial=null,this._idTick=0}return s.prototype.addConstraint=function(t){var r=this._cnMap.find(t);if(void 0!==r)throw new Error("duplicate constraint");var n=this._createRow(t),o=n.row,i=n.tag,s=this._chooseSubject(o,i);if(0===s.type()&&o.allDummies()){if(!e(o.constant()))throw new Error("unsatisfiable constraint");s=i.marker}if(0===s.type()){if(!this._addWithArtificialVariable(o)){for(var a,l="",u=0;a=t._expression._terms._array[u];u++)l+=a.first._name,l+=", ";var h=["LE","GE","EQ"];throw new Error("Unsatisfiable constraint ["+l.slice(0,-2)+"] operator: "+h[t._operator])}}else o.solveFor(s),this._substitute(s,o),this._rowMap.insert(s,o);this._cnMap.insert(t,i),this._optimize(this._objective)},s.prototype.removeConstraint=function(t){var e=this._cnMap.erase(t);if(void 0===e)throw new Error("unknown constraint");this._removeConstraintEffects(t,e.second);var r=e.second.marker,n=this._rowMap.erase(r);if(void 0===n){var o=this._getMarkerLeavingSymbol(r);if(0===o.type())throw new Error("failed to find leaving row");n=this._rowMap.erase(o),n.second.solveForEx(o,r),this._substitute(r,n.second)}this._optimize(this._objective)},s.prototype.hasConstraint=function(t){return this._cnMap.contains(t)},s.prototype.addEditVariable=function(e,r){var n=this._editMap.find(e);if(void 0!==n)throw new Error("duplicate edit variable");if(r=t.Strength.clip(r),r===t.Strength.required)throw new Error("bad required strength");var o=new t.Expression(e),i=new t.Constraint(o,2,r);this.addConstraint(i);var s=this._cnMap.find(i).second,a={tag:s,constraint:i,constant:0};this._editMap.insert(e,a)},s.prototype.removeEditVariable=function(t){var e=this._editMap.erase(t);if(void 0===e)throw new Error("unknown edit variable");this.removeConstraint(e.second.constraint)},s.prototype.hasEditVariable=function(t){return this._editMap.contains(t)},s.prototype.suggestValue=function(t,e){var r=this._editMap.find(t);if(void 0===r)throw new Error("unknown edit variable");var n=this._rowMap,o=r.second,i=e-o.constant;o.constant=e;var s=o.tag.marker,a=n.find(s);if(void 0!==a)return a.second.add(-i)<0&&this._infeasibleRows.push(s),void this._dualOptimize();var l=o.tag.other,a=n.find(l);if(void 0!==a)return a.second.add(i)<0&&this._infeasibleRows.push(l),void this._dualOptimize();for(var u=0,h=n.size();u<h;++u){var a=n.itemAt(u),c=a.second,p=c.coefficientFor(s);0!==p&&c.add(i*p)<0&&1!==a.first.type()&&this._infeasibleRows.push(a.first)}this._dualOptimize()},s.prototype.updateVariables=function(){for(var t=this._varMap,e=this._rowMap,r=0,n=t.size();r<n;++r){var o=t.itemAt(r),i=e.find(o.second);void 0!==i?o.first.setValue(i.second.constant()):o.first.setValue(0)}},s.prototype._getVarSymbol=function(t){var e=this,r=function(){return e._makeSymbol(1)};return this._varMap.setDefault(t,r).second},s.prototype._createRow=function(r){for(var n=r.expression(),o=new h(n.constant()),i=n.terms(),s=0,a=i.size();s<a;++s){var l=i.itemAt(s);if(!e(l.second)){var c=this._getVarSymbol(l.first),p=this._rowMap.find(c);void 0!==p?o.insertRow(p.second,l.second):o.insertSymbol(c,l.second)}}var _=this._objective,d=r.strength(),f={marker:u,other:u};switch(r.op()){case 0:case 1:var m=0===r.op()?1:-1,g=this._makeSymbol(2);if(f.marker=g,o.insertSymbol(g,m),d<t.Strength.required){var y=this._makeSymbol(3);f.other=y,o.insertSymbol(y,-m),_.insertSymbol(y,d)}break;case 2:if(d<t.Strength.required){var v=this._makeSymbol(3),b=this._makeSymbol(3);f.marker=v,f.other=b,o.insertSymbol(v,-1),o.insertSymbol(b,1),_.insertSymbol(v,d),_.insertSymbol(b,d)}else{var x=this._makeSymbol(4);f.marker=x,o.insertSymbol(x)}}return o.constant()<0&&o.reverseSign(),{row:o,tag:f}},s.prototype._chooseSubject=function(t,
|
||
|
| Copyright (c) 2014, Nucleic Development Team.
|
||
|
|
|
||
|
| Distributed under the terms of the Modified BSD License.
|
||
|
|
|
||
|
| The full license is in the file COPYING.txt, distributed with this software.
|
||
|
|----------------------------------------------------------------------------*/
|
||
|
e.exports=i},{}]},{},["main"])}();/*
|
||
|
Copyright (c) 2012, Continuum Analytics, Inc.
|
||
|
All rights reserved.
|
||
|
|
||
|
Redistribution and use in source and binary forms, with or without modification,
|
||
|
are permitted provided that the following conditions are met:
|
||
|
|
||
|
Redistributions of source code must retain the above copyright notice,
|
||
|
this list of conditions and the following disclaimer.
|
||
|
|
||
|
Redistributions in binary form must reproduce the above copyright notice,
|
||
|
this list of conditions and the following disclaimer in the documentation
|
||
|
and/or other materials provided with the distribution.
|
||
|
|
||
|
Neither the name of Continuum Analytics nor the names of any contributors
|
||
|
may be used to endorse or promote products derived from this software
|
||
|
without specific prior written permission.
|
||
|
|
||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||
|
THE POSSIBILITY OF SUCH DAMAGE.
|
||
|
*/
|