Skip to content

Instantly share code, notes, and snippets.

@johncant
Last active September 23, 2018 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johncant/ae189388657025e48accf8dce835a574 to your computer and use it in GitHub Desktop.
Save johncant/ae189388657025e48accf8dce835a574 to your computer and use it in GitHub Desktop.
Broken holoviews example
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# This notebook reproduces a bug in Holoviews\n",
"\n",
"On `DynamicMap`s that map views that were composed with the `*`, event streams are not working"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"\n",
"(function(root) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
"\n",
" var force = true;\n",
"\n",
" if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
" root._bokeh_onload_callbacks = [];\n",
" root._bokeh_is_loading = undefined;\n",
" }\n",
"\n",
" var JS_MIME_TYPE = 'application/javascript';\n",
" var HTML_MIME_TYPE = 'text/html';\n",
" var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n",
" var CLASS_NAME = 'output_bokeh rendered_html';\n",
"\n",
" /**\n",
" * Render data to the DOM node\n",
" */\n",
" function render(props, node) {\n",
" var script = document.createElement(\"script\");\n",
" node.appendChild(script);\n",
" }\n",
"\n",
" /**\n",
" * Handle when an output is cleared or removed\n",
" */\n",
" function handleClearOutput(event, handle) {\n",
" var cell = handle.cell;\n",
"\n",
" var id = cell.output_area._bokeh_element_id;\n",
" var server_id = cell.output_area._bokeh_server_id;\n",
" // Clean up Bokeh references\n",
" if (id != null && id in Bokeh.index) {\n",
" Bokeh.index[id].model.document.clear();\n",
" delete Bokeh.index[id];\n",
" }\n",
"\n",
" if (server_id !== undefined) {\n",
" // Clean up Bokeh references\n",
" var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n",
" cell.notebook.kernel.execute(cmd, {\n",
" iopub: {\n",
" output: function(msg) {\n",
" var id = msg.content.text.trim();\n",
" if (id in Bokeh.index) {\n",
" Bokeh.index[id].model.document.clear();\n",
" delete Bokeh.index[id];\n",
" }\n",
" }\n",
" }\n",
" });\n",
" // Destroy server and session\n",
" var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n",
" cell.notebook.kernel.execute(cmd);\n",
" }\n",
" }\n",
"\n",
" /**\n",
" * Handle when a new output is added\n",
" */\n",
" function handleAddOutput(event, handle) {\n",
" var output_area = handle.output_area;\n",
" var output = handle.output;\n",
"\n",
" // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n",
" if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n",
" return\n",
" }\n",
"\n",
" var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n",
"\n",
" if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n",
" toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n",
" // store reference to embed id on output_area\n",
" output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n",
" }\n",
" if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n",
" var bk_div = document.createElement(\"div\");\n",
" bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n",
" var script_attrs = bk_div.children[0].attributes;\n",
" for (var i = 0; i < script_attrs.length; i++) {\n",
" toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n",
" }\n",
" // store reference to server id on output_area\n",
" output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n",
" }\n",
" }\n",
"\n",
" function register_renderer(events, OutputArea) {\n",
"\n",
" function append_mime(data, metadata, element) {\n",
" // create a DOM node to render to\n",
" var toinsert = this.create_output_subarea(\n",
" metadata,\n",
" CLASS_NAME,\n",
" EXEC_MIME_TYPE\n",
" );\n",
" this.keyboard_manager.register_events(toinsert);\n",
" // Render to node\n",
" var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n",
" render(props, toinsert[toinsert.length - 1]);\n",
" element.append(toinsert);\n",
" return toinsert\n",
" }\n",
"\n",
" /* Handle when an output is cleared or removed */\n",
" events.on('clear_output.CodeCell', handleClearOutput);\n",
" events.on('delete.Cell', handleClearOutput);\n",
"\n",
" /* Handle when a new output is added */\n",
" events.on('output_added.OutputArea', handleAddOutput);\n",
"\n",
" /**\n",
" * Register the mime type and append_mime function with output_area\n",
" */\n",
" OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n",
" /* Is output safe? */\n",
" safe: true,\n",
" /* Index of renderer in `output_area.display_order` */\n",
" index: 0\n",
" });\n",
" }\n",
"\n",
" // register the mime type if in Jupyter Notebook environment and previously unregistered\n",
" if (root.Jupyter !== undefined) {\n",
" var events = require('base/js/events');\n",
" var OutputArea = require('notebook/js/outputarea').OutputArea;\n",
"\n",
" if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n",
" register_renderer(events, OutputArea);\n",
" }\n",
" }\n",
"\n",
" \n",
" if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n",
" root._bokeh_timeout = Date.now() + 5000;\n",
" root._bokeh_failed_load = false;\n",
" }\n",
"\n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
"\n",
" function display_loaded() {\n",
" var el = document.getElementById(null);\n",
" if (el != null) {\n",
" el.textContent = \"BokehJS is loading...\";\n",
" }\n",
" if (root.Bokeh !== undefined) {\n",
" if (el != null) {\n",
" el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
" }\n",
" } else if (Date.now() < root._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
"\n",
"\n",
" function run_callbacks() {\n",
" try {\n",
" root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" }\n",
" finally {\n",
" delete root._bokeh_onload_callbacks\n",
" }\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
"\n",
" function load_libs(js_urls, callback) {\n",
" root._bokeh_onload_callbacks.push(callback);\n",
" if (root._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" root._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" root._bokeh_is_loading--;\n",
" if (root._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };\n",
"\n",
" var js_urls = [];\n",
"\n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" /* BEGIN bokeh.min.js */\n",
" /*!\n",
" * Copyright (c) 2012, Anaconda, Inc.\n",
" * All rights reserved.\n",
" * \n",
" * Redistribution and use in source and binary forms, with or without modification,\n",
" * are permitted provided that the following conditions are met:\n",
" * \n",
" * Redistributions of source code must retain the above copyright notice,\n",
" * this list of conditions and the following disclaimer.\n",
" * \n",
" * Redistributions in binary form must reproduce the above copyright notice,\n",
" * this list of conditions and the following disclaimer in the documentation\n",
" * and/or other materials provided with the distribution.\n",
" * \n",
" * Neither the name of Anaconda nor the names of any contributors\n",
" * may be used to endorse or promote products derived from this software\n",
" * without specific prior written permission.\n",
" * \n",
" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n",
" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n",
" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n",
" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n",
" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n",
" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n",
" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n",
" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n",
" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n",
" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\n",
" * THE POSSIBILITY OF SUCH DAMAGE.\n",
" */\n",
" !function(t,e){var o,s,r,a,l;t.Bokeh=(o=[function(t,e,i){var n=t(148),r=t(32);i.overrides={};var o=r.clone(n);i.Models=function(t){var e=i.overrides[t]||o[t];if(null==e)throw new Error(\"Model '\"+t+\"' does not exist. This could be due to a widget\\n or a custom model not being registered before first usage.\");return e},i.Models.register=function(t,e){i.overrides[t]=e},i.Models.unregister=function(t){delete i.overrides[t]},i.Models.register_models=function(t,e,i){if(void 0===e&&(e=!1),null!=t)for(var n in t){var r=t[n];e||!o.hasOwnProperty(n)?o[n]=r:null!=i?i(n):console.warn(\"Model '\"+n+\"' was already registered\")}},i.register_models=i.Models.register_models,i.Models.registered_names=function(){return Object.keys(o)},i.index={}},function(t,e,o){var s=t(326),a=t(14),l=t(50),h=t(269),c=t(270),u=t(2);o.DEFAULT_SERVER_WEBSOCKET_URL=\"ws://localhost:5006/ws\",o.DEFAULT_SESSION_ID=\"default\";var _=0,p=function(){function t(t,e,i,n,r){void 0===t&&(t=o.DEFAULT_SERVER_WEBSOCKET_URL),void 0===e&&(e=o.DEFAULT_SESSION_ID),void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=null),this.url=t,this.id=e,this.args_string=i,this._on_have_session_hook=n,this._on_closed_permanently_hook=r,this._number=_++,this.socket=null,this.session=null,this.closed_permanently=!1,this._current_handler=null,this._pending_ack=null,this._pending_replies={},this._receiver=new c.Receiver,a.logger.debug(\"Creating websocket \"+this._number+\" to '\"+this.url+\"' session '\"+this.id+\"'\")}return t.prototype.connect=function(){var i=this;if(this.closed_permanently)return s.Promise.reject(new Error(\"Cannot connect() a closed ClientConnection\"));if(null!=this.socket)return s.Promise.reject(new Error(\"Already connected\"));this._pending_replies={},this._current_handler=null;try{var t=this.url+\"?bokeh-protocol-version=1.0&bokeh-session-id=\"+this.id;return null!=this.args_string&&0<this.args_string.length&&(t+=\"&\"+this.args_string),this.socket=new WebSocket(t),new s.Promise(function(t,e){i.socket.binaryType=\"arraybuffer\",i.socket.onopen=function(){return i._on_open(t,e)},i.socket.onmessage=function(t){return i._on_message(t)},i.socket.onclose=function(t){return i._on_close(t)},i.socket.onerror=function(){return i._on_error(e)}})}catch(t){return a.logger.error(\"websocket creation failed to url: \"+this.url),a.logger.error(\" - \"+t),s.Promise.reject(t)}},t.prototype.close=function(){this.closed_permanently||(a.logger.debug(\"Permanently closing websocket connection \"+this._number),this.closed_permanently=!0,null!=this.socket&&this.socket.close(1e3,\"close method called on ClientConnection \"+this._number),this.session._connection_closed(),null!=this._on_closed_permanently_hook&&(this._on_closed_permanently_hook(),this._on_closed_permanently_hook=null))},t.prototype._schedule_reconnect=function(t){var e=this;setTimeout(function(){e.closed_permanently||a.logger.info(\"Websocket connection \"+e._number+\" disconnected, will not attempt to reconnect\")},t)},t.prototype.send=function(t){if(null==this.socket)throw new Error(\"not connected so cannot send \"+t);t.send(this.socket)},t.prototype.send_with_reply=function(i){var n=this,t=new s.Promise(function(t,e){n._pending_replies[i.msgid()]=[t,e],n.send(i)});return t.then(function(t){if(\"ERROR\"===t.msgtype())throw new Error(\"Error reply \"+t.content.text);return t},function(t){throw t})},t.prototype._pull_doc_json=function(){var t=h.Message.create(\"PULL-DOC-REQ\",{}),e=this.send_with_reply(t);return e.then(function(t){if(!(\"doc\"in t.content))throw new Error(\"No 'doc' field in PULL-DOC-REPLY\");return t.content.doc},function(t){throw t})},t.prototype._repull_session_doc=function(){var r=this;null==this.session?a.logger.debug(\"Pulling session for first time\"):a.logger.debug(\"Repulling session\"),this._pull_doc_json().then(function(t){if(null==r.session)if(r.closed_permanently)a.logger.debug(\"Got new document after connection was already closed\");else{var e=l.Document.from_json(t),i=l.Document._compute_patch_since_json(t,e);if(0<i.events.length){a.logger.debug(\"Sending \"+i.events.length+\" changes from model construction back to server\");var n=h.Message.create(\"PATCH-DOC\",{},i);r.send(n)}r.session=new u.ClientSession(r,e,r.id),a.logger.debug(\"Created a new session from new pulled doc\"),null!=r._on_have_session_hook&&(r._on_have_session_hook(r.session),r._on_have_session_hook=null)}else r.session.document.replace_with_json(t),a.logger.debug(\"Updated existing session with new pulled doc\")},function(t){throw t}).catch(function(t){null!=console.trace&&console.trace(t),a.logger.error(\"Failed to repull session \"+t)})},t.prototype._on_open=function(t,e){var i=this;a.logger.info(\"Websocket connection \"+this._number+\" is now open\"),this._pending_ack=[t,e],this._current_handler=function(t){i._awaiting_ack_handler(t)}},t.prototype._on_message=function(t){null==this._current_handler&&a.logger.error(\"Got a message with no current handler set\");try{this._receiver.consume(t.data)}catch(t){this._close_bad_protocol(t.toString())}if(null!=this._receiver.message){var e=this._receiver.message,i=e.problem();null!=i&&this._close_bad_protocol(i),this._current_handler(e)}},t.prototype._on_close=function(t){var i=this;a.logger.info(\"Lost websocket \"+this._number+\" connection, \"+t.code+\" (\"+t.reason+\")\"),(this.socket=null)!=this._pending_ack&&(this._pending_ack[1](new Error(\"Lost websocket connection, \"+t.code+\" (\"+t.reason+\")\")),this._pending_ack=null);for(var e=function(){for(var t in i._pending_replies){var e=i._pending_replies[t];return delete i._pending_replies[t],e}return null},n=e();null!=n;)n[1](\"Disconnected\"),n=e();this.closed_permanently||this._schedule_reconnect(2e3)},t.prototype._on_error=function(t){a.logger.debug(\"Websocket error on socket \"+this._number),t(new Error(\"Could not open websocket\"))},t.prototype._close_bad_protocol=function(t){a.logger.error(\"Closing connection: \"+t),null!=this.socket&&this.socket.close(1002,t)},t.prototype._awaiting_ack_handler=function(t){var e=this;\"ACK\"===t.msgtype()?(this._current_handler=function(t){return e._steady_state_handler(t)},this._repull_session_doc(),null!=this._pending_ack&&(this._pending_ack[0](this),this._pending_ack=null)):this._close_bad_protocol(\"First message was not an ACK\")},t.prototype._steady_state_handler=function(t){if(t.reqid()in this._pending_replies){var e=this._pending_replies[t.reqid()];delete this._pending_replies[t.reqid()],e[0](t)}else this.session.handle(t)},t}();o.ClientConnection=p,o.pull_session=function(i,n,r){return new s.Promise(function(t,e){return new p(i,n,r,function(e){try{t(e)}catch(t){throw a.logger.error(\"Promise handler threw an error, closing session \"+t),e.close(),t}},function(){e(new Error(\"Connection was closed before we successfully pulled a session\"))}).connect().then(function(t){},function(t){throw a.logger.error(\"Failed to connect to Bokeh server \"+t),t})})}},function(t,e,i){var n=t(14),r=t(50),o=t(269),s=function(){function t(t,e,i){var n=this;this._connection=t,this.document=e,this.id=i,this._document_listener=function(t){return n._document_changed(t)},this.document.on_change(this._document_listener),this.event_manager=this.document.event_manager,this.event_manager.session=this}return t.prototype.handle=function(t){var e=t.msgtype();\"PATCH-DOC\"===e?this._handle_patch(t):\"OK\"===e?this._handle_ok(t):\"ERROR\"===e?this._handle_error(t):n.logger.debug(\"Doing nothing with message \"+t.msgtype())},t.prototype.close=function(){this._connection.close()},t.prototype.send_event=function(t){var e=o.Message.create(\"EVENT\",{},JSON.stringify(t));this._connection.send(e)},t.prototype._connection_closed=function(){this.document.remove_on_change(this._document_listener)},t.prototype.request_server_info=function(){var t=o.Message.create(\"SERVER-INFO-REQ\",{}),e=this._connection.send_with_reply(t);return e.then(function(t){return t.content})},t.prototype.force_roundtrip=function(){return this.request_server_info().then(function(t){})},t.prototype._document_changed=function(t){if(t.setter_id!==this.id&&(!(t instanceof r.ModelChangedEvent)||t.attr in t.model.serializable_attributes())){var e=o.Message.create(\"PATCH-DOC\",{},this.document.create_json_patch([t]));this._connection.send(e)}},t.prototype._handle_patch=function(t){this.document.apply_json_patch(t.content,t.buffers,this.id)},t.prototype._handle_ok=function(t){n.logger.trace(\"Unhandled OK reply to \"+t.reqid())},t.prototype._handle_error=function(t){n.logger.error(\"Unhandled ERROR reply to \"+t.reqid()+\": \"+t.content.text)},t}();i.ClientSession=s},function(t,e,i){var n=t(387),r=t(14),o=t(32),s={};function a(e){return function(t){t.prototype.event_name=e,s[e]=t}}i.register_event_class=a,i.register_with_event=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var n=t.prototype.applicable_models.concat(e);t.prototype.applicable_models=n};var l=function(){function t(t){void 0===t&&(t={}),this.model_id=null,(this._options=t).model_id&&(this.model_id=t.model_id)}return t.prototype.set_model_id=function(t){return this._options.model_id=t,this.model_id=t,this},t.prototype.is_applicable_to=function(e){return this.applicable_models.some(function(t){return e instanceof t})},t.event_class=function(t){if(t.type)return s[t.type];r.logger.warn(\"BokehEvent.event_class required events with a string type attribute\")},t.prototype.toJSON=function(){return{event_name:this.event_name,event_values:o.clone(this._options)}},t.prototype._customize_event=function(t){return this},t}();(i.BokehEvent=l).prototype.applicable_models=[];var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"button_click\")],e)}(l);i.ButtonClick=h;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(l),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"lodstart\")],e)}(i.UIEvent=c);i.LODStart=u;var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"lodend\")],e)}(c);i.LODEnd=_;var p=function(i){function t(t){var e=i.call(this,t)||this;return e.geometry=t.geometry,e.final=t.final,e}return n.__extends(t,i),t=n.__decorate([a(\"selectiongeometry\")],t)}(c);i.SelectionGeometry=p;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"reset\")],e)}(c);i.Reset=d;var f=function(i){function t(t){var e=i.call(this,t)||this;return e.sx=t.sx,e.sy=t.sy,e.x=null,e.y=null,e}return n.__extends(t,i),t.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.sx,sy:t.sy,model_id:e})},t.prototype._customize_event=function(t){var e=t.plot_canvas.frame.xscales.default,i=t.plot_canvas.frame.yscales.default;return this.x=e.invert(this.sx),this.y=i.invert(this.sy),this._options.x=this.x,this._options.y=this.y,this},t}(c),v=function(i){function t(t){void 0===t&&(t={});var e=i.call(this,t)||this;return e.delta_x=t.delta_x,e.delta_y=t.delta_y,e}return n.__extends(t,i),t.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.sx,sy:t.sy,delta_x:t.deltaX,delta_y:t.deltaY,direction:t.direction,model_id:e})},t=n.__decorate([a(\"pan\")],t)}(i.PointEvent=f);i.Pan=v;var m=function(i){function t(t){void 0===t&&(t={});var e=i.call(this,t)||this;return e.scale=t.scale,e}return n.__extends(t,i),t.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.sx,sy:t.sy,scale:t.scale,model_id:e})},t=n.__decorate([a(\"pinch\")],t)}(f);i.Pinch=m;var g=function(i){function t(t){void 0===t&&(t={});var e=i.call(this,t)||this;return e.delta=t.delta,e}return n.__extends(t,i),t.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.sx,sy:t.sy,delta:t.delta,model_id:e})},t=n.__decorate([a(\"wheel\")],t)}(f);i.MouseWheel=g;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"mousemove\")],e)}(f);i.MouseMove=y;var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"mouseenter\")],e)}(f);i.MouseEnter=b;var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"mouseleave\")],e)}(f);i.MouseLeave=x;var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"tap\")],e)}(f);i.Tap=w;var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"doubletap\")],e)}(f);i.DoubleTap=k;var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"press\")],e)}(f);i.Press=S;var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"panstart\")],e)}(f);i.PanStart=T;var C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"panend\")],e)}(f);i.PanEnd=C;var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"pinchstart\")],e)}(f);i.PinchStart=A;var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e=n.__decorate([a(\"pinchend\")],e)}(f);i.PinchEnd=E},function(t,e,i){var g=t(387),y=t(21);i.build_views=function(e,t,i,n){void 0===n&&(n=function(t){return t.default_view});for(var r=y.difference(Object.keys(e),t.map(function(t){return t.id})),o=0,s=r;o<s.length;o++){var a=s[o];e[a].remove(),delete e[a]}for(var l=[],h=t.filter(function(t){return null==e[t.id]}),c=0,u=h;c<u.length;c++){var _=u[c],p=n(_),d=g.__assign({},i,{model:_,connect_signals:!1}),f=new p(d);e[_.id]=f,l.push(f)}for(var v=0,m=l;v<m.length;v++){var f=m[v];f.connect_signals()}return l},i.remove_views=function(t){for(var e in t)t[e].remove(),delete t[e]}},function(t,e,i){var n,y=t(44),r=function(g){return function(t){void 0===t&&(t={});for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var n=document.createElement(g);for(var r in t){var o=t[r];if(null!=o&&(!y.isBoolean(o)||o))if(\"class\"===r&&y.isArray(o))for(var s=0,a=o;s<a.length;s++){var l=a[s];null!=l&&n.classList.add(l)}else if(\"style\"===r&&y.isObject(o))for(var h in o)n.style[h]=o[h];else if(\"data\"===r&&y.isObject(o))for(var c in o)n.dataset[c]=o[c];else n.setAttribute(r,o)}function u(t){if(t instanceof HTMLElement)n.appendChild(t);else if(y.isString(t))n.appendChild(document.createTextNode(t));else if(null!=t&&!1!==t)throw new Error(\"expected an HTMLElement, string, false or null, got \"+JSON.stringify(t))}for(var _=0,p=e;_<p.length;_++){var d=p[_];if(y.isArray(d))for(var f=0,v=d;f<v.length;f++){var m=v[f];u(m)}else u(d)}return n}};function o(t,e){var i=Element.prototype,n=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector;return n.call(t,e)}i.createElement=function(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];return r(t).apply(void 0,[e].concat(i))},i.div=r(\"div\"),i.span=r(\"span\"),i.link=r(\"link\"),i.style=r(\"style\"),i.a=r(\"a\"),i.p=r(\"p\"),i.i=r(\"i\"),i.pre=r(\"pre\"),i.button=r(\"button\"),i.label=r(\"label\"),i.input=r(\"input\"),i.select=r(\"select\"),i.option=r(\"option\"),i.optgroup=r(\"optgroup\"),i.textarea=r(\"textarea\"),i.canvas=r(\"canvas\"),i.ul=r(\"ul\"),i.ol=r(\"ol\"),i.li=r(\"li\"),i.nbsp=document.createTextNode(\" \"),i.removeElement=function(t){var e=t.parentNode;null!=e&&e.removeChild(t)},i.replaceWith=function(t,e){var i=t.parentNode;null!=i&&i.replaceChild(e,t)},i.prepend=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=t.firstChild,r=0,o=e;r<o.length;r++){var s=o[r];t.insertBefore(s,n)}},i.empty=function(t){for(var e;e=t.firstChild;)t.removeChild(e)},i.show=function(t){t.style.display=\"\"},i.hide=function(t){t.style.display=\"none\"},i.position=function(t){return{top:t.offsetTop,left:t.offsetLeft}},i.offset=function(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}},i.matches=o,i.parent=function(t,e){for(var i=t;i=i.parentElement;)if(o(i,e))return i;return null},i.margin=function(t){var e=getComputedStyle(t);return{top:parseFloat(e.marginTop)||0,bottom:parseFloat(e.marginBottom)||0,left:parseFloat(e.marginLeft)||0,right:parseFloat(e.marginRight)||0}},i.padding=function(t){var e=getComputedStyle(t);return{top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0,left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0}},(n=i.Keys||(i.Keys={}))[n.Backspace=8]=\"Backspace\",n[n.Tab=9]=\"Tab\",n[n.Enter=13]=\"Enter\",n[n.Esc=27]=\"Esc\",n[n.PageUp=33]=\"PageUp\",n[n.PageDown=34]=\"PageDown\",n[n.Left=37]=\"Left\",n[n.Up=38]=\"Up\",n[n.Right=39]=\"Right\",n[n.Down=40]=\"Down\",n[n.Delete=46]=\"Delete\"},function(t,e,i){var n=t(387),r=t(48),o=t(5),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this._has_finished=!1,this.el=this._createElement()},t.prototype.remove=function(){o.removeElement(this.el),e.prototype.remove.call(this)},t.prototype.css_classes=function(){return[]},t.prototype.cursor=function(t,e){return null},t.prototype.layout=function(){},t.prototype.render=function(){},t.prototype.renderTo=function(t){t.appendChild(this.el),this.layout()},t.prototype.has_finished=function(){return this._has_finished},Object.defineProperty(t.prototype,\"_root_element\",{get:function(){return o.parent(this.el,\".bk-root\")||document.body},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"solver\",{get:function(){return this.is_root?this._solver:this.parent.solver},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"is_idle\",{get:function(){return this.has_finished()},enumerable:!0,configurable:!0}),t.prototype._createElement=function(){return o.createElement(this.tagName,{id:this.id,class:this.css_classes()})},t}(r.View);(i.DOMView=s).prototype.tagName=\"div\"},function(t,e,i){i.AngleUnits=[\"deg\",\"rad\"],i.Dimension=[\"width\",\"height\"],i.Dimensions=[\"width\",\"height\",\"both\"],i.Direction=[\"clock\",\"anticlock\"],i.FontStyle=[\"normal\",\"italic\",\"bold\"],i.LatLon=[\"lat\",\"lon\"],i.LineCap=[\"butt\",\"round\",\"square\"],i.LineJoin=[\"miter\",\"round\",\"bevel\"],i.Location=[\"above\",\"below\",\"left\",\"right\"],i.LegendClickPolicy=[\"none\",\"hide\",\"mute\"],i.LegendLocation=[\"top_left\",\"top_center\",\"top_right\",\"center_left\",\"center\",\"center_right\",\"bottom_left\",\"bottom_center\",\"bottom_right\"],i.Anchor=i.LegendLocation,i.Orientation=[\"vertical\",\"horizontal\"],i.OutputBackend=[\"canvas\",\"svg\",\"webgl\"],i.RenderLevel=[\"image\",\"underlay\",\"glyph\",\"annotation\",\"overlay\"],i.RenderMode=[\"canvas\",\"css\"],i.Side=[\"above\",\"below\",\"left\",\"right\"],i.Place=[\"above\",\"below\",\"left\",\"right\",\"center\"],i.SpatialUnits=[\"screen\",\"data\"],i.StartEnd=[\"start\",\"end\"],i.VerticalAlign=[\"top\",\"middle\",\"bottom\"],i.TextAlign=[\"left\",\"right\",\"center\"],i.TextBaseline=[\"top\",\"middle\",\"bottom\",\"alphabetic\",\"hanging\",\"ideographic\"],i.TickLabelOrientation=[\"vertical\",\"horizontal\",\"parallel\",\"normal\"],i.TooltipAttachment=[\"horizontal\",\"vertical\",\"left\",\"right\",\"above\",\"below\"],i.Distribution=[\"uniform\",\"normal\"],i.StepMode=[\"after\",\"before\",\"center\"],i.SizingMode=[\"stretch_both\",\"scale_width\",\"scale_height\",\"scale_both\",\"fixed\"],i.PaddingUnits=[\"percent\",\"absolute\"],i.SliderCallbackPolicy=[\"continuous\",\"throttle\",\"mouseup\"],i.RoundingFunction=[\"round\",\"nearest\",\"floor\",\"rounddown\",\"ceil\",\"roundup\"],i.UpdateMode=[\"replace\",\"append\"],i.HTTPMethod=[\"POST\",\"GET\"],i.Logo=[\"normal\",\"grey\"]},function(t,e,i){var o=t(387),l=t(19),n=t(16),h=t(34),r=t(15),c=t(38),s=t(21),_=t(32),p=t(44),d=t(30),a=function(a){function u(t){void 0===t&&(t={});var e=a.call(this)||this;for(var i in e._subtype=void 0,e.document=null,e.destroyed=new l.Signal0(e,\"destroyed\"),e.change=new l.Signal0(e,\"change\"),e.transformchange=new l.Signal0(e,\"transformchange\"),e.attributes={},e.properties={},e._set_after_defaults={},e._pending=!1,e._changing=!1,e.props){var n=e.props[i],r=n.type,o=n.default_value;if(null==r)throw new Error(\"undefined property type for \"+e.type+\".\"+i);e.properties[i]=new r(e,i,o)}null==t.id&&e.setv({id:c.uniqueId()},{silent:!0});var s=t.__deferred__||!1;return s&&delete(t=_.clone(t)).__deferred__,e.setv(t,{silent:!0}),s||e.finalize(),e}return o.__extends(u,a),u.initClass=function(){this.prototype.type=\"HasProps\",this.prototype.props={},this.prototype.mixins=[],this.define({id:[r.Any]})},u._fix_default=function(t,e){return void 0===t?void 0:p.isFunction(t)?t:p.isObject(t)?p.isArray(t)?function(){return s.copy(t)}:function(){return _.clone(t)}:function(){return t}},u.define=function(a){var t=function(i){var t=a[i];if(null!=l.prototype.props[i])throw new Error(\"attempted to redefine property '\"+l.prototype.type+\".\"+i+\"'\");if(null!=l.prototype[i])throw new Error(\"attempted to redefine attribute '\"+l.prototype.type+\".\"+i+\"'\");Object.defineProperty(l.prototype,i,{get:function(){var t=this.getv(i);return t},set:function(t){var e;return this.setv(((e={})[i]=t,e)),this},configurable:!1,enumerable:!0});var e=t[0],n=t[1],r=t[2],o={type:e,default_value:l._fix_default(n,i),internal:r||!1},s=_.clone(l.prototype.props);s[i]=o,l.prototype.props=s},l=this;for(var e in a)t(e)},u.internal=function(t){var e={};for(var i in t){var n=t[i],r=n[0],o=n[1];e[i]=[r,o,!0]}this.define(e)},u.mixin=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.define(n.create(t));var i=this.prototype.mixins.concat(t);this.prototype.mixins=i},u.mixins=function(t){this.mixin.apply(this,t)},u.override=function(t){for(var e in t){var i=this._fix_default(t[e],e),n=this.prototype.props[e];if(null==n)throw new Error(\"attempted to override nonexistent '\"+this.prototype.type+\".\"+e+\"'\");var r=_.clone(this.prototype.props);r[e]=o.__assign({},n,{default_value:i}),this.prototype.props=r}},u.prototype.toString=function(){return this.type+\"(\"+this.id+\")\"},u.prototype.finalize=function(){var t=this;for(var e in this.properties){var i=this.properties[e];i.update(),null!=i.spec.transform&&this.connect(i.spec.transform.change,function(){return t.transformchange.emit()})}this.initialize(),this.connect_signals()},u.prototype.initialize=function(){},u.prototype.connect_signals=function(){},u.prototype.disconnect_signals=function(){l.Signal.disconnectReceiver(this)},u.prototype.destroy=function(){this.disconnect_signals(),this.destroyed.emit()},u.prototype.clone=function(){return new this.constructor(this.attributes)},u.prototype._setv=function(t,e){var i=e.check_eq,n=e.silent,r=[],o=this._changing;this._changing=!0;var s=this.attributes;for(var a in t){var l=t[a];!1!==i&&d.isEqual(s[a],l)||r.push(a),s[a]=l}if(!n){0<r.length&&(this._pending=!0);for(var h=0;h<r.length;h++)this.properties[r[h]].change.emit()}if(!o){if(!n&&!e.no_change)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}},u.prototype.setv=function(t,e){for(var i in void 0===e&&(e={}),t)if(t.hasOwnProperty(i)){var n=i;if(null==this.props[n])throw new Error(\"property \"+this.type+\".\"+n+\" wasn't declared\");null!=e&&e.defaults||(this._set_after_defaults[i]=!0)}if(!_.isEmpty(t)){var r={};for(var i in t)r[i]=this.getv(i);this._setv(t,e);var o=e.silent;if(null==o||!o)for(var i in t)this._tell_document_about_change(i,r[i],this.getv(i),e)}},u.prototype.getv=function(t){if(null==this.props[t])throw new Error(\"property \"+this.type+\".\"+t+\" wasn't declared\");return this.attributes[t]},u.prototype.ref=function(){return h.create_ref(this)},u.prototype.set_subtype=function(t){this._subtype=t},u.prototype.attribute_is_serializable=function(t){var e=this.props[t];if(null==e)throw new Error(this.type+\".attribute_is_serializable('\"+t+\"'): \"+t+\" wasn't declared\");return!e.internal},u.prototype.serializable_attributes=function(){var t={};for(var e in this.attributes){var i=this.attributes[e];this.attribute_is_serializable(e)&&(t[e]=i)}return t},u._value_to_json=function(t,e,i){if(e instanceof u)return e.ref();if(p.isArray(e)){for(var n=[],r=0;r<e.length;r++){var o=e[r];n.push(u._value_to_json(r.toString(),o,e))}return n}if(p.isObject(e)){var s={};for(var a in e)e.hasOwnProperty(a)&&(s[a]=u._value_to_json(a,e[a],e));return s}return e},u.prototype.attributes_as_json=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=u._value_to_json);var i=this.serializable_attributes(),n={};for(var r in i)if(i.hasOwnProperty(r)){var o=i[r];t?n[r]=o:r in this._set_after_defaults&&(n[r]=o)}return e(\"attributes\",n,this)},u._json_record_references=function(t,e,i,n){if(null==e);else if(h.is_ref(e)){if(!(e.id in i)){var r=t.get_model_by_id(e.id);u._value_record_references(r,i,n)}}else if(p.isArray(e))for(var o=0,s=e;o<s.length;o++){var a=s[o];u._json_record_references(t,a,i,n)}else if(p.isObject(e))for(var l in e)if(e.hasOwnProperty(l)){var a=e[l];u._json_record_references(t,a,i,n)}},u._value_record_references=function(t,e,i){if(null==t);else if(t instanceof u){if(!(t.id in e)&&(e[t.id]=t,i))for(var n=t._immediate_references(),r=0,o=n;r<o.length;r++){var s=o[r];u._value_record_references(s,e,!0)}}else if(t.buffer instanceof ArrayBuffer);else if(p.isArray(t))for(var a=0,l=t;a<l.length;a++){var h=l[a];u._value_record_references(h,e,i)}else if(p.isObject(t))for(var c in t)if(t.hasOwnProperty(c)){var h=t[c];u._value_record_references(h,e,i)}},u.prototype._immediate_references=function(){var t={},e=this.serializable_attributes();for(var i in e){var n=e[i];u._value_record_references(n,t,!1)}return _.values(t)},u.prototype.references=function(){var t={};return u._value_record_references(this,t,!0),_.values(t)},u.prototype._doc_attached=function(){},u.prototype.attach_document=function(t){if(null!=this.document&&this.document!=t)throw new Error(\"models must be owned by only a single document\");this.document=t,this._doc_attached()},u.prototype.detach_document=function(){this.document=null},u.prototype._tell_document_about_change=function(t,e,i,n){if(this.attribute_is_serializable(t)&&null!=this.document){var r={};u._value_record_references(i,r,!1);var o={};u._value_record_references(e,o,!1);var s=!1;for(var a in r)if(!(a in o)){s=!0;break}if(!s)for(var l in o)if(!(l in r)){s=!0;break}s&&this.document._invalidate_all_models(),this.document._notify_change(this,t,e,i,n)}},u.prototype.materialize_dataspecs=function(t){var e={};for(var i in this.properties){var n=this.properties[i];n.dataspec&&(!n.optional||null!=n.spec.value||i in this._set_after_defaults)&&(e[\"_\"+i]=n.array(t),null!=n.spec.field&&n.spec.field in t._shapes&&(e[\"_\"+i+\"_shape\"]=t._shapes[n.spec.field]),n instanceof r.Distance&&(e[\"max_\"+i]=s.max(e[\"_\"+i])))}return e},u}(l.Signalable());(i.HasProps=a).initClass()},function(t,e,i){var n=t(21),r=t(187);function o(t){return t*t}function s(t,e){return o(t.x-e.x)+o(t.y-e.y)}function a(t,e,i){var n=s(e,i);if(0==n)return s(t,e);var r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;if(r<0)return s(t,e);if(1<r)return s(t,i);var o={x:e.x+r*(i.x-e.x),y:e.y+r*(i.y-e.y)};return s(t,o)}i.point_in_poly=function(t,e,i,n){for(var r=!1,o=i[i.length-1],s=n[n.length-1],a=0;a<i.length;a++){var l=i[a],h=n[a];s<e!=h<e&&o+(e-s)/(h-s)*(l-o)<t&&(r=!r),o=l,s=h}return r},i.create_empty_hit_test_result=function(){return new r.Selection},i.create_hit_test_result_from_hits=function(t){var e=new r.Selection;return e.indices=n.sortBy(t,function(t){return t[0],t[1]}).map(function(t){var e=t[0];return t[1],e}),e},i.validate_bbox_coords=function(t,e){var i,n,r=t[0],o=t[1],s=e[0],a=e[1];return o<r&&(r=(i=[o,r])[0],o=i[1]),a<s&&(s=(n=[a,s])[0],a=n[1]),{minX:r,minY:s,maxX:o,maxY:a}},i.dist_2_pts=s,i.dist_to_segment_squared=a,i.dist_to_segment=function(t,e,i){return Math.sqrt(a(t,e,i))},i.check_2_segments_intersect=function(t,e,i,n,r,o,s,a){var l=(a-o)*(i-t)-(s-r)*(n-e);if(0==l)return{hit:!1,x:null,y:null};var h=e-o,c=t-r,u=(s-r)*h-(a-o)*c,_=(i-t)*h-(n-e)*c;c=_/l;var p=t+(h=u/l)*(i-t),d=e+h*(n-e);return{hit:0<h&&h<1&&0<c&&c<1,x:p,y:d}}},function(t,e,i){var s=t(13),a=t(21);i.vstack=function(t,e){var i=[];if(0<e.length){i.push(s.EQ(a.head(e)._bottom,[-1,t._bottom])),i.push(s.EQ(a.tail(e)._top,[-1,t._top])),i.push.apply(i,a.pairwise(e,function(t,e){return s.EQ(t._top,[-1,e._bottom])}));for(var n=0,r=e;n<r.length;n++){var o=r[n];i.push(s.EQ(o._left,[-1,t._left])),i.push(s.EQ(o._right,[-1,t._right]))}}return i},i.hstack=function(t,e){var i=[];if(0<e.length){i.push(s.EQ(a.head(e)._right,[-1,t._right])),i.push(s.EQ(a.tail(e)._left,[-1,t._left])),i.push.apply(i,a.pairwise(e,function(t,e){return s.EQ(t._left,[-1,e._right])}));for(var n=0,r=e;n<r.length;n++){var o=r[n];i.push(s.EQ(o._top,[-1,t._top])),i.push(s.EQ(o._bottom,[-1,t._bottom]))}}return i}},function(t,e,i){var n=t(387),r=t(13),o=t(8),s=t(24),a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LayoutCanvas\"},t.prototype.initialize=function(){e.prototype.initialize.call(this),this._top=new r.Variable(this.toString()+\".top\"),this._left=new r.Variable(this.toString()+\".left\"),this._width=new r.Variable(this.toString()+\".width\"),this._height=new r.Variable(this.toString()+\".height\"),this._right=new r.Variable(this.toString()+\".right\"),this._bottom=new r.Variable(this.toString()+\".bottom\"),this._hcenter=new r.Variable(this.toString()+\".hcenter\"),this._vcenter=new r.Variable(this.toString()+\".vcenter\")},t.prototype.get_editables=function(){return[]},t.prototype.get_constraints=function(){return[r.GE(this._top),r.GE(this._bottom),r.GE(this._left),r.GE(this._right),r.GE(this._width),r.GE(this._height),r.EQ(this._left,this._width,[-1,this._right]),r.EQ(this._top,this._height,[-1,this._bottom]),r.EQ([2,this._hcenter],[-1,this._left],[-1,this._right]),r.EQ([2,this._vcenter],[-1,this._top],[-1,this._bottom])]},t.prototype.get_layoutable_children=function(){return[]},Object.defineProperty(t.prototype,\"bbox\",{get:function(){return new s.BBox({x0:this._left.value,y0:this._top.value,x1:this._right.value,y1:this._bottom.value})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"layout_bbox\",{get:function(){return{top:this._top.value,left:this._left.value,width:this._width.value,height:this._height.value,right:this._right.value,bottom:this._bottom.value,hcenter:this._hcenter.value,vcenter:this._vcenter.value}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"xview\",{get:function(){var r=this;return{compute:function(t){return r._left.value+t},v_compute:function(t){for(var e=new Float64Array(t.length),i=r._left.value,n=0;n<t.length;n++)e[n]=i+t[n];return e}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"yview\",{get:function(){var r=this;return{compute:function(t){return r._bottom.value-t},v_compute:function(t){for(var e=new Float64Array(t.length),i=r._bottom.value,n=0;n<t.length;n++)e[n]=i-t[n];return e}}},enumerable:!0,configurable:!0}),t}(o.HasProps);(i.LayoutCanvas=a).initClass()},function(t,e,r){var i=t(387),o=t(13),n=t(11),s=t(15),a=t(14),l=t(44),h=Math.PI/2,c=\"alphabetic\",u=\"middle\",_=\"hanging\",p=\"left\",d=\"right\",f=\"center\",v={above:{parallel:0,normal:-h,horizontal:0,vertical:-h},below:{parallel:0,normal:h,horizontal:0,vertical:h},left:{parallel:-h,normal:0,horizontal:0,vertical:-h},right:{parallel:h,normal:0,horizontal:0,vertical:h}},m={above:{justified:\"top\",parallel:c,normal:u,horizontal:c,vertical:u},below:{justified:\"bottom\",parallel:_,normal:u,horizontal:_,vertical:u},left:{justified:\"top\",parallel:c,normal:u,horizontal:u,vertical:c},right:{justified:\"top\",parallel:c,normal:u,horizontal:u,vertical:c}},g={above:{justified:f,parallel:f,normal:p,horizontal:f,vertical:p},below:{justified:f,parallel:f,normal:p,horizontal:f,vertical:p},left:{justified:f,parallel:f,normal:d,horizontal:d,vertical:f},right:{justified:f,parallel:f,normal:p,horizontal:p,vertical:f}},y={above:d,below:p,left:d,right:p},b={above:p,below:d,left:d,right:p};function x(t){return\"panel\"in t}r.isSizeable=x,r.isSizeableView=function(t){return x(t.model)&&\"get_size\"in t},r._view_sizes=new WeakMap,r._view_constraints=new WeakMap,r.update_panel_constraints=function(t){var e=t.solver,i=t.get_size(),n=r._view_constraints.get(t);if(null!=n&&e.has_constraint(n)){if(r._view_sizes.get(t)===i)return;e.remove_constraint(n)}n=o.GE(t.model.panel._size,-i),e.add_constraint(n),r._view_sizes.set(t,i),r._view_constraints.set(t,n)};var w=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"SidePanel\",this.internal({side:[s.String]})},t.prototype.toString=function(){return this.type+\"(\"+this.id+\", \"+this.side+\")\"},t.prototype.initialize=function(){switch(e.prototype.initialize.call(this),this.side){case\"above\":this._dim=0,this._normals=[0,-1],this._size=this._height;break;case\"below\":this._dim=0,this._normals=[0,1],this._size=this._height;break;case\"left\":this._dim=1,this._normals=[-1,0],this._size=this._width;break;case\"right\":this._dim=1,this._normals=[1,0],this._size=this._width;break;default:a.logger.error(\"unrecognized side: '\"+this.side+\"'\")}},Object.defineProperty(t.prototype,\"dimension\",{get:function(){return this._dim},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"normals\",{get:function(){return this._normals},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"is_horizontal\",{get:function(){return\"above\"==this.side||\"below\"==this.side},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"is_vertical\",{get:function(){return\"left\"==this.side||\"right\"==this.side},enumerable:!0,configurable:!0}),t.prototype.apply_label_text_heuristics=function(t,e){var i,n,r=this.side;l.isString(e)?(i=m[r][e],n=g[r][e]):0===e?n=i=\"whatever\":e<0?(i=\"middle\",n=y[r]):(i=\"middle\",n=b[r]),t.textBaseline=i,t.textAlign=n},t.prototype.get_label_angle_heuristic=function(t){return v[this.side][t]},t}(n.LayoutCanvas);(r.SidePanel=w).initClass()},function(t,e,i){var n=t(346);function r(i){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n.Constraint(new(n.Expression.bind.apply(n.Expression,[void 0].concat(t))),i)}}function o(i){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n.Constraint(new(n.Expression.bind.apply(n.Expression,[void 0].concat(t))),i,n.Strength.weak)}}i.Variable=n.Variable,i.Expression=n.Expression,i.Constraint=n.Constraint,i.Operator=n.Operator,i.Strength=n.Strength,i.EQ=r(n.Operator.Eq),i.LE=r(n.Operator.Le),i.GE=r(n.Operator.Ge),i.WEAK_EQ=o(n.Operator.Eq),i.WEAK_LE=o(n.Operator.Le),i.WEAK_GE=o(n.Operator.Ge);var s=function(){function t(){this.solver=new n.Solver}return t.prototype.clear=function(){this.solver=new n.Solver},t.prototype.toString=function(){return\"Solver(num_constraints=\"+this.num_constraints+\", num_editables=\"+this.num_editables+\")\"},Object.defineProperty(t.prototype,\"num_constraints\",{get:function(){return this.solver.numConstraints},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"num_editables\",{get:function(){return this.solver.numEditVariables},enumerable:!0,configurable:!0}),t.prototype.get_constraints=function(){return this.solver.getConstraints()},t.prototype.update_variables=function(){this.solver.updateVariables()},t.prototype.has_constraint=function(t){return this.solver.hasConstraint(t)},t.prototype.add_constraint=function(e){try{this.solver.addConstraint(e)}catch(t){throw new Error(t.message+\": \"+e.toString())}},t.prototype.remove_constraint=function(t){this.solver.removeConstraint(t)},t.prototype.add_edit_variable=function(t,e){this.solver.addEditVariable(t,e)},t.prototype.remove_edit_variable=function(t){this.solver.removeEditVariable(t)},t.prototype.suggest_value=function(t,e){this.solver.suggestValue(t,e)},t}();i.Solver=s},function(t,e,i){var o=t(44),n={},s=function(t,e){this.name=t,this.level=e};i.LogLevel=s;var r=function(){function r(t,e){void 0===e&&(e=r.INFO),this._name=t,this.set_level(e)}return Object.defineProperty(r,\"levels\",{get:function(){return Object.keys(r.log_levels)},enumerable:!0,configurable:!0}),r.get=function(t,e){if(void 0===e&&(e=r.INFO),0<t.length){var i=n[t];return null==i&&(n[t]=i=new r(t,e)),i}throw new TypeError(\"Logger.get() expects a non-empty string name and an optional log-level\")},Object.defineProperty(r.prototype,\"level\",{get:function(){return this.get_level()},enumerable:!0,configurable:!0}),r.prototype.get_level=function(){return this._log_level},r.prototype.set_level=function(t){if(t instanceof s)this._log_level=t;else{if(!o.isString(t)||null==r.log_levels[t])throw new Error(\"Logger.set_level() expects a log-level object or a string name of a log-level\");this._log_level=r.log_levels[t]}var e=\"[\"+this._name+\"]\";for(var i in r.log_levels){var n=r.log_levels[i];n.level<this._log_level.level||this._log_level.level===r.OFF.level?this[i]=function(){}:this[i]=a(i,e)}},r.prototype.trace=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},r.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},r.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},r.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},r.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},r.TRACE=new s(\"trace\",0),r.DEBUG=new s(\"debug\",1),r.INFO=new s(\"info\",2),r.WARN=new s(\"warn\",6),r.ERROR=new s(\"error\",7),r.FATAL=new s(\"fatal\",8),r.OFF=new s(\"off\",9),r.log_levels={trace:r.TRACE,debug:r.DEBUG,info:r.INFO,warn:r.WARN,error:r.ERROR,fatal:r.FATAL,off:r.OFF},r}();function a(t,e){return null!=console[t]?console[t].bind(console,e):null!=console.log?console.log.bind(console,e):function(){}}i.Logger=r,i.logger=r.get(\"bokeh\"),i.set_log_level=function(t){null==r.log_levels[t]?(console.log(\"[bokeh] unrecognized logging level '\"+t+\"' passed to Bokeh.set_log_level(), ignoring\"),console.log(\"[bokeh] valid log levels are: \"+r.levels.join(\", \"))):(console.log(\"[bokeh] setting log level to: '\"+t+\"'\"),i.logger.set_level(t))}},function(t,e,i){var o=t(387),s=t(19),n=t(8),r=t(7),a=t(39),l=t(27),h=t(21),c=t(22),u=t(44);function _(e){try{return JSON.stringify(e)}catch(t){return e.toString()}}function p(t){return!(t instanceof n.HasProps)&&u.isObject(t)&&(void 0===t.value?0:1)+(void 0===t.field?0:1)+(void 0===t.expr?0:1)==1}s.Signal,i.isSpec=p;var d=function(r){function t(t,e,i){var n=r.call(this)||this;return n.obj=t,n.attr=e,n.default_value=i,n.optional=!1,n.obj=t,n.attr=e,n.default_value=i,n.change=new s.Signal0(n.obj,\"change\"),n._init(),n.connect(n.change,function(){return n._init()}),n}return o.__extends(t,r),t.prototype.update=function(){this._init()},t.prototype.init=function(){},t.prototype.transform=function(t){return t},t.prototype.validate=function(t){},t.prototype.value=function(t){if(void 0===t&&(t=!0),void 0===this.spec.value)throw new Error(\"attempted to retrieve property value for property without value specification\");var e=this.transform([this.spec.value])[0];return null!=this.spec.transform&&t&&(e=this.spec.transform.compute(e)),e},t.prototype.array=function(t){if(!this.dataspec)throw new Error(\"attempted to retrieve property array for non-dataspec property\");var e;if(null!=this.spec.field){if(null==(e=this.transform(t.get_column(this.spec.field))))throw new Error(\"attempted to retrieve property array for nonexistent field '\"+this.spec.field+\"'\")}else if(null!=this.spec.expr)e=this.transform(this.spec.expr.v_compute(t));else{var i=t.get_length();null==i&&(i=1);var n=this.value(!1);e=h.repeat(n,i)}return null!=this.spec.transform&&(e=this.spec.transform.v_compute(e)),e},t.prototype._init=function(){var t,e=this.obj,i=this.attr,n=e.getv(i);if(void 0===n){var r=this.default_value;n=void 0!==r?r(e):null,e.setv(((t={})[i]=n,t),{silent:!0,defaults:!0})}if(u.isArray(n)?this.spec={value:n}:p(n)?this.spec=n:this.spec={value:n},null!=this.spec.field&&!u.isString(this.spec.field))throw new Error(\"field value for property '\"+i+\"' is not a string\");null!=this.spec.value&&this.validate(this.spec.value),this.init()},t.prototype.toString=function(){return\"Prop(\"+this.obj+\".\"+this.attr+\", spec: \"+_(this.spec)+\")\"},t}(s.Signalable());function f(i,n){return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.validate=function(t){if(!n(t))throw new Error(i+\" property '\"+this.attr+\"' given invalid value: \"+_(t))},e}(d)}(i.Property=d).prototype.dataspec=!1;var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}((i.simple_prop=f)(\"Any\",function(t){return!0}));i.Any=v;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(f(\"Array\",function(t){return u.isArray(t)||t instanceof Float64Array}));i.Array=m;var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(f(\"Bool\",u.isBoolean));i.Bool=g,i.Boolean=g;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(f(\"Color\",function(t){return a.is_svg_color(t.toLowerCase())||\"#\"==t.substring(0,1)||l.valid_rgb(t)}));i.Color=y;var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(f(\"Instance\",function(t){return null!=t.properties}));i.Instance=b;var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(f(\"Number\",function(t){return u.isNumber(t)||u.isBoolean(t)}));i.Number=x,i.Int=x;var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(f(\"Number\",function(t){return(u.isNumber(t)||u.isBoolean(t))&&0<=t&&t<=1}));i.Percent=w;var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(f(\"String\",u.isString)),S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(i.String=k);function T(t,e){return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(f(t,function(t){return h.includes(e,t)}))}i.Font=S;var C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}((i.enum_prop=T)(\"Anchor\",r.LegendLocation));i.Anchor=C;var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"AngleUnits\",r.AngleUnits));i.AngleUnits=A;var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.transform=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;i++)switch(t[i]){case\"clock\":e[i]=0;break;case\"anticlock\":e[i]=1}return e},e}(T(\"Direction\",r.Direction));i.Direction=E;var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"Dimension\",r.Dimension));i.Dimension=M;var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"Dimensions\",r.Dimensions));i.Dimensions=O;var z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"FontStyle\",r.FontStyle));i.FontStyle=z;var P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"LatLon\",r.LatLon));i.LatLon=P;var j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"LineCap\",r.LineCap));i.LineCap=j;var N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"LineJoin\",r.LineJoin));i.LineJoin=N;var F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"LegendLocation\",r.LegendLocation));i.LegendLocation=F;var D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"Location\",r.Location));i.Location=D;var I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"OutputBackend\",r.OutputBackend));i.OutputBackend=I;var R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"Orientation\",r.Orientation));i.Orientation=R;var B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"VerticalAlign\",r.VerticalAlign));i.VerticalAlign=B;var L=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"TextAlign\",r.TextAlign));i.TextAlign=L;var V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"TextBaseline\",r.TextBaseline));i.TextBaseline=V;var G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"RenderLevel\",r.RenderLevel));i.RenderLevel=G;var U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"RenderMode\",r.RenderMode));i.RenderMode=U;var q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"SizingMode\",r.SizingMode));i.SizingMode=q;var Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"SpatialUnits\",r.SpatialUnits));i.SpatialUnits=Y;var X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"Distribution\",r.Distribution));i.Distribution=X;var H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"StepMode\",r.StepMode));i.StepMode=H;var W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"PaddingUnits\",r.PaddingUnits));i.PaddingUnits=W;var J=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(T(\"StartEnd\",r.StartEnd));function Q(i,n,r){return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.init=function(){null==this.spec.units&&(this.spec.units=r);var t=this.spec.units;if(!h.includes(n,t))throw new Error(i+\" units must be one of \"+n+\", given invalid value: \"+t)},Object.defineProperty(e.prototype,\"units\",{get:function(){return this.spec.units},set:function(t){this.spec.units=t},enumerable:!0,configurable:!0}),e}(x)}i.StartEnd=J;var $=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.transform=function(t){return\"deg\"==this.spec.units&&(t=c.map(t,function(t){return t*Math.PI/180})),t=c.map(t,function(t){return-t}),e.prototype.transform.call(this,t)},t}((i.units_prop=Q)(\"Angle\",r.AngleUnits,\"rad\"));i.Angle=$;var K=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(Q(\"Distance\",r.SpatialUnits,\"data\"));i.Distance=K;var Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}($);(i.AngleSpec=Z).prototype.dataspec=!0;var tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(y);(i.ColorSpec=tt).prototype.dataspec=!0;var et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(K);(i.DistanceSpec=et).prototype.dataspec=!0;var it=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(k);(i.FontSizeSpec=it).prototype.dataspec=!0;var nt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(x);(i.NumberSpec=nt).prototype.dataspec=!0;var rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e}(k);(i.StringSpec=rt).prototype.dataspec=!0},function(t,e,h){var i=t(15),c=t(32);function n(t,e){var i={};for(var n in t){var r=t[n];i[e+n]=r}return i}var r={line_color:[i.ColorSpec,\"black\"],line_width:[i.NumberSpec,1],line_alpha:[i.NumberSpec,1],line_join:[i.LineJoin,\"bevel\"],line_cap:[i.LineCap,\"butt\"],line_dash:[i.Array,[]],line_dash_offset:[i.Number,0]};h.line=function(t){return void 0===t&&(t=\"\"),n(r,t)};var o={fill_color:[i.ColorSpec,\"gray\"],fill_alpha:[i.NumberSpec,1]};h.fill=function(t){return void 0===t&&(t=\"\"),n(o,t)};var s={text_font:[i.Font,\"helvetica\"],text_font_size:[i.FontSizeSpec,\"12pt\"],text_font_style:[i.FontStyle,\"normal\"],text_color:[i.ColorSpec,\"#444444\"],text_alpha:[i.NumberSpec,1],text_align:[i.TextAlign,\"left\"],text_baseline:[i.TextBaseline,\"bottom\"],text_line_height:[i.Number,1.2]};h.text=function(t){return void 0===t&&(t=\"\"),n(s,t)},h.create=function(t){for(var e={},i=0,n=t;i<n.length;i++){var r=n[i],o=r.split(\":\"),s=o[0],a=o[1],l=void 0;switch(s){case\"line\":l=h.line;break;case\"fill\":l=h.fill;break;case\"text\":l=h.text;break;default:throw new Error(\"Unknown property mixin kind '\"+s+\"'\")}c.extend(e,l(a))}return e}},function(t,e,i){var n=t(387),r=t(8),o=t(187),p=t(175),d=t(176),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"SelectionManager\",this.internal({source:[s.Any]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.inspectors={}},e.prototype.select=function(t,e,i,n){void 0===n&&(n=!1);for(var r=[],o=[],s=0,a=t;s<a.length;s++){var l=a[s];l instanceof p.GlyphRendererView?r.push(l):l instanceof d.GraphRendererView&&o.push(l)}for(var h=!1,c=0,u=o;c<u.length;c++){var l=u[c],_=l.model.selection_policy.hit_test(e,l);h=h||l.model.selection_policy.do_selection(_,l.model,i,n)}if(0<r.length){var _=this.source.selection_policy.hit_test(e,r);h=h||this.source.selection_policy.do_selection(_,this.source,i,n)}return h},e.prototype.inspect=function(t,e){var i=!1;if(t instanceof p.GlyphRendererView){var n=t.hit_test(e);if(null!=n){i=!n.is_empty();var r=this.get_or_create_inspector(t.model);r.update(n,!0,!1),this.source.setv({inspected:r},{silent:!0}),this.source.inspect.emit([t,{geometry:e}])}}else if(t instanceof d.GraphRendererView){var n=t.model.inspection_policy.hit_test(e,t);i=i||t.model.inspection_policy.do_inspection(n,e,t,!1,!1)}return i},e.prototype.clear=function(t){this.source.selected.clear(),null!=t&&this.get_or_create_inspector(t.model).clear()},e.prototype.get_or_create_inspector=function(t){return null==this.inspectors[t.id]&&(this.inspectors[t.id]=new o.Selection),this.inspectors[t.id]},e}(r.HasProps);(i.SelectionManager=a).initClass()},function(t,e,i){var n=function(){function t(){this._dev=!1}return Object.defineProperty(t.prototype,\"dev\",{get:function(){return this._dev},set:function(t){this._dev=t},enumerable:!0,configurable:!0}),t}();i.Settings=n,i.settings=new n},function(t,e,i){var n,r=t(387),o=t(25),s=t(21),a=function(){function t(t,e){this.sender=t,this.name=e}return t.prototype.connect=function(t,e){void 0===e&&(e=null),h.has(this.sender)||h.set(this.sender,[]);var i=h.get(this.sender);if(null!=u(i,this,t,e))return!1;var n=e||t;c.has(n)||c.set(n,[]);var r=c.get(n),o={signal:this,slot:t,context:e};return i.push(o),r.push(o),!0},t.prototype.disconnect=function(t,e){void 0===e&&(e=null);var i=h.get(this.sender);if(null==i||0===i.length)return!1;var n=u(i,this,t,e);if(null==n)return!1;var r=e||t,o=c.get(r);return n.signal=null,p(i),p(o),!0},t.prototype.emit=function(t){for(var e=h.get(this.sender)||[],i=0,n=e;i<n.length;i++){var r=n[i],o=r.signal,s=r.slot,a=r.context;o===this&&s.call(a,t,this.sender)}},t}(),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.emit=function(){t.prototype.emit.call(this,void 0)},e}(i.Signal=a);i.Signal0=l,(n=a=i.Signal||(i.Signal={})).disconnectBetween=function(t,e){var i=h.get(t);if(null!=i&&0!==i.length){var n=c.get(e);if(null!=n&&0!==n.length){for(var r=0,o=n;r<o.length;r++){var s=o[r];if(null==s.signal)return;s.signal.sender===t&&(s.signal=null)}p(i),p(n)}}},n.disconnectSender=function(t){var e=h.get(t);if(null!=e&&0!==e.length){for(var i=0,n=e;i<n.length;i++){var r=n[i];if(null==r.signal)return;var o=r.context||r.slot;r.signal=null,p(c.get(o))}p(e)}},n.disconnectReceiver=function(t){var e=c.get(t);if(null!=e&&0!==e.length){for(var i=0,n=e;i<n.length;i++){var r=n[i];if(null==r.signal)return;var o=r.signal.sender;r.signal=null,p(h.get(o))}p(e)}},n.disconnectAll=function(t){var e=h.get(t);if(null!=e&&0!==e.length){for(var i=0,n=e;i<n.length;i++){var r=n[i];r.signal=null}p(e)}var o=c.get(t);if(null!=o&&0!==o.length){for(var s=0,a=o;s<a.length;s++){var r=a[s];r.signal=null}p(o)}},i.Signal=a,i.Signalable=function(t){return null!=t?function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.connect=function(t,e){return t.connect(e,this)},e}(t):function(){function t(){}return t.prototype.connect=function(t,e){return t.connect(e,this)},t}()},(i._Signalable||(i._Signalable={})).connect=function(t,e){return t.connect(e,this)};var h=new WeakMap,c=new WeakMap;function u(t,e,i,n){return s.find(t,function(t){return t.signal===e&&t.slot===i&&t.context===n})}var _=new Set;function p(t){0===_.size&&o.defer(d),_.add(t)}function d(){_.forEach(function(t){s.removeBy(t,function(t){return null==t.signal})}),_.clear()}},function(t,e,p){var i=t(387),r=t(343),o=t(19),a=t(14),l=t(5),n=t(45),h=t(21),d=t(32),s=t(44),c=t(3);p.is_mobile=\"ontouchstart\"in window||0<navigator.maxTouchPoints;var u=function(){function t(t,e,i,n){this.plot_view=t,this.toolbar=e,this.hit_area=i,this.plot=n,this.pan_start=new o.Signal(this,\"pan:start\"),this.pan=new o.Signal(this,\"pan\"),this.pan_end=new o.Signal(this,\"pan:end\"),this.pinch_start=new o.Signal(this,\"pinch:start\"),this.pinch=new o.Signal(this,\"pinch\"),this.pinch_end=new o.Signal(this,\"pinch:end\"),this.rotate_start=new o.Signal(this,\"rotate:start\"),this.rotate=new o.Signal(this,\"rotate\"),this.rotate_end=new o.Signal(this,\"rotate:end\"),this.tap=new o.Signal(this,\"tap\"),this.doubletap=new o.Signal(this,\"doubletap\"),this.press=new o.Signal(this,\"press\"),this.move_enter=new o.Signal(this,\"move:enter\"),this.move=new o.Signal(this,\"move\"),this.move_exit=new o.Signal(this,\"move:exit\"),this.scroll=new o.Signal(this,\"scroll\"),this.keydown=new o.Signal(this,\"keydown\"),this.keyup=new o.Signal(this,\"keyup\"),this.hammer=new r(this.hit_area),this._configure_hammerjs()}return t.prototype._configure_hammerjs=function(){var e=this;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 e._doubletap(t)}),this.hammer.on(\"tap\",function(t){return e._tap(t)}),this.hammer.on(\"press\",function(t){return e._press(t)}),this.hammer.get(\"pan\").set({direction:r.DIRECTION_ALL}),this.hammer.on(\"panstart\",function(t){return e._pan_start(t)}),this.hammer.on(\"pan\",function(t){return e._pan(t)}),this.hammer.on(\"panend\",function(t){return e._pan_end(t)}),this.hammer.get(\"pinch\").set({enable:!0}),this.hammer.on(\"pinchstart\",function(t){return e._pinch_start(t)}),this.hammer.on(\"pinch\",function(t){return e._pinch(t)}),this.hammer.on(\"pinchend\",function(t){return e._pinch_end(t)}),this.hammer.get(\"rotate\").set({enable:!0}),this.hammer.on(\"rotatestart\",function(t){return e._rotate_start(t)}),this.hammer.on(\"rotate\",function(t){return e._rotate(t)}),this.hammer.on(\"rotateend\",function(t){return e._rotate_end(t)}),this.hit_area.addEventListener(\"mousemove\",function(t){return e._mouse_move(t)}),this.hit_area.addEventListener(\"mouseenter\",function(t){return e._mouse_enter(t)}),this.hit_area.addEventListener(\"mouseleave\",function(t){return e._mouse_exit(t)}),this.hit_area.addEventListener(\"wheel\",function(t){return e._mouse_wheel(t)}),document.addEventListener(\"keydown\",function(t){return e._key_down(t)}),document.addEventListener(\"keyup\",function(t){return e._key_up(t)})},t.prototype.register_tool=function(i){var n=this,t=i.model.event_type;null!=t&&(s.isString(t)?this._register_tool(i,t):t.forEach(function(t,e){return n._register_tool(i,t,e<1)}))},t.prototype._register_tool=function(t,e,i){void 0===i&&(i=!0);var n=t,r=n.model.id,o=function(e){return function(t){t.id==r&&e(t.e)}},s=function(e){return function(t){e(t.e)}};switch(e){case\"pan\":null!=n._pan_start&&n.connect(this.pan_start,o(n._pan_start.bind(n))),null!=n._pan&&n.connect(this.pan,o(n._pan.bind(n))),null!=n._pan_end&&n.connect(this.pan_end,o(n._pan_end.bind(n)));break;case\"pinch\":null!=n._pinch_start&&n.connect(this.pinch_start,o(n._pinch_start.bind(n))),null!=n._pinch&&n.connect(this.pinch,o(n._pinch.bind(n))),null!=n._pinch_end&&n.connect(this.pinch_end,o(n._pinch_end.bind(n)));break;case\"rotate\":null!=n._rotate_start&&n.connect(this.rotate_start,o(n._rotate_start.bind(n))),null!=n._rotate&&n.connect(this.rotate,o(n._rotate.bind(n))),null!=n._rotate_end&&n.connect(this.rotate_end,o(n._rotate_end.bind(n)));break;case\"move\":null!=n._move_enter&&n.connect(this.move_enter,o(n._move_enter.bind(n))),null!=n._move&&n.connect(this.move,o(n._move.bind(n))),null!=n._move_exit&&n.connect(this.move_exit,o(n._move_exit.bind(n)));break;case\"tap\":null!=n._tap&&n.connect(this.tap,o(n._tap.bind(n)));break;case\"press\":null!=n._press&&n.connect(this.press,o(n._press.bind(n)));break;case\"scroll\":null!=n._scroll&&n.connect(this.scroll,o(n._scroll.bind(n)));break;default:throw new Error(\"unsupported event_type: \"+e)}i&&(null!=n._doubletap&&n.connect(this.doubletap,s(n._doubletap.bind(n))),null!=n._keydown&&n.connect(this.keydown,s(n._keydown.bind(n))),null!=n._keyup&&n.connect(this.keyup,s(n._keyup.bind(n))),p.is_mobile&&null!=n._scroll&&\"pinch\"==e&&(a.logger.debug(\"Registering scroll on touch screen\"),n.connect(this.scroll,o(n._scroll.bind(n)))))},t.prototype._hit_test_renderers=function(t,e){for(var i=this.plot_view.get_renderer_views(),n=0,r=h.reversed(i);n<r.length;n++){var o=r[n],s=o.model.level;if((\"annotation\"==s||\"overlay\"==s)&&null!=o.interactive_hit&&o.interactive_hit(t,e))return o}return null},t.prototype._hit_test_frame=function(t,e){return this.plot_view.frame.bbox.contains(t,e)},t.prototype._trigger=function(e,i,t){var n=this,r=this.toolbar.gestures,o=e.name,s=o.split(\":\")[0],a=this._hit_test_renderers(i.sx,i.sy);switch(s){case\"move\":var l=r[s].active;null!=l&&this.trigger(e,i,l.id);var h=this.toolbar.inspectors.filter(function(t){return t.active}),c=\"default\";null!=a?(c=a.cursor(i.sx,i.sy)||c,d.isEmpty(h)||(e=this.move_exit,o=e.name)):this._hit_test_frame(i.sx,i.sy)&&(d.isEmpty(h)||(c=\"crosshair\")),this.plot_view.set_cursor(c),h.map(function(t){return n.trigger(e,i,t.id)});break;case\"tap\":var u=t.target;if(null!=u&&u!=this.hit_area)return;null!=a&&null!=a.on_hit&&a.on_hit(i.sx,i.sy);var l=r[s].active;null!=l&&this.trigger(e,i,l.id);break;case\"scroll\":var _=p.is_mobile?\"pinch\":\"scroll\",l=r[_].active;null!=l&&(t.preventDefault(),t.stopPropagation(),this.trigger(e,i,l.id));break;default:var l=r[s].active;null!=l&&this.trigger(e,i,l.id)}this._trigger_bokeh_event(i)},t.prototype.trigger=function(t,e,i){void 0===i&&(i=null),t.emit({id:i,e:e})},t.prototype._trigger_bokeh_event=function(t){var e=c.BokehEvent.event_class(t);null!=e?this.plot.trigger_event(e.from_event(t)):a.logger.debug(\"Unhandled event of type \"+t.type)},t.prototype._get_sxy=function(t){var e,i=(e=t,\"undefined\"!=typeof TouchEvent&&e instanceof TouchEvent?(0!=t.touches.length?t.touches:t.changedTouches)[0]:t),n=i.pageX,r=i.pageY,o=l.offset(this.hit_area),s=o.left,a=o.top;return{sx:n-s,sy:r-a}},t.prototype._gesture_event=function(t){return i.__assign({type:t.type},this._get_sxy(t.srcEvent),{deltaX:t.deltaX,deltaY:t.deltaY,scale:t.scale,shiftKey:t.srcEvent.shiftKey})},t.prototype._tap_event=function(t){return i.__assign({type:t.type},this._get_sxy(t.srcEvent),{shiftKey:t.srcEvent.shiftKey})},t.prototype._move_event=function(t){return i.__assign({type:t.type},this._get_sxy(t))},t.prototype._scroll_event=function(t){return i.__assign({type:t.type},this._get_sxy(t),{delta:n.getDeltaY(t)})},t.prototype._key_event=function(t){return{type:t.type,keyCode:t.keyCode}},t.prototype._pan_start=function(t){var e=this._gesture_event(t);e.sx-=t.deltaX,e.sy-=t.deltaY,this._trigger(this.pan_start,e,t.srcEvent)},t.prototype._pan=function(t){this._trigger(this.pan,this._gesture_event(t),t.srcEvent)},t.prototype._pan_end=function(t){this._trigger(this.pan_end,this._gesture_event(t),t.srcEvent)},t.prototype._pinch_start=function(t){this._trigger(this.pinch_start,this._gesture_event(t),t.srcEvent)},t.prototype._pinch=function(t){this._trigger(this.pinch,this._gesture_event(t),t.srcEvent)},t.prototype._pinch_end=function(t){this._trigger(this.pinch_end,this._gesture_event(t),t.srcEvent)},t.prototype._rotate_start=function(t){this._trigger(this.rotate_start,this._gesture_event(t),t.srcEvent)},t.prototype._rotate=function(t){this._trigger(this.rotate,this._gesture_event(t),t.srcEvent)},t.prototype._rotate_end=function(t){this._trigger(this.rotate_end,this._gesture_event(t),t.srcEvent)},t.prototype._tap=function(t){this._trigger(this.tap,this._tap_event(t),t.srcEvent)},t.prototype._doubletap=function(t){var e=this._tap_event(t);this._trigger_bokeh_event(e),this.trigger(this.doubletap,e)},t.prototype._press=function(t){this._trigger(this.press,this._tap_event(t),t.srcEvent)},t.prototype._mouse_enter=function(t){this._trigger(this.move_enter,this._move_event(t),t)},t.prototype._mouse_move=function(t){this._trigger(this.move,this._move_event(t),t)},t.prototype._mouse_exit=function(t){this._trigger(this.move_exit,this._move_event(t),t)},t.prototype._mouse_wheel=function(t){this._trigger(this.scroll,this._scroll_event(t),t)},t.prototype._key_down=function(t){this.trigger(this.keydown,this._key_event(t))},t.prototype._key_up=function(t){this.trigger(this.keyup,this._key_event(t))},t}();p.UIEvents=u},function(t,e,n){var o=t(31),c=t(23),i=t(22);n.min=i.min,n.minBy=i.minBy,n.max=i.max,n.maxBy=i.maxBy,n.sum=i.sum;var r=Array.prototype.slice;function s(t){var e;return(e=[]).concat.apply(e,t)}function u(t,e){return-1!==t.indexOf(e)}function a(t,e,i){void 0===i&&(i=1),c.assert(0<i,\"'step' must be a positive number\"),null==e&&(e=t,t=0);for(var n=Math.max,r=Math.ceil,o=Math.abs,s=t<=e?i:-i,a=n(r(o(e-t)/i),0),l=Array(a),h=0;h<a;h++,t+=s)l[h]=t;return l}function l(r){return function(t,e){for(var i=t.length,n=0<r?0:i-1;0<=n&&n<i;n+=r)if(e(t[n]))return n;return-1}}function h(t){for(var e=[],i=0,n=t;i<n.length;i++){var r=n[i];u(e,r)||e.push(r)}return e}n.head=function(t){return t[0]},n.tail=function(t){return t[t.length-1]},n.last=function(t){return t[t.length-1]},n.copy=function(t){return r.call(t)},n.concat=s,n.includes=u,n.contains=u,n.nth=function(t,e){return t[0<=e?e:t.length+e]},n.zip=function(t,e){for(var i=Math.min(t.length,e.length),n=new Array(i),r=0;r<i;r++)n[r]=[t[r],e[r]];return n},n.unzip=function(t){for(var e,i=t.length,n=new Array(i),r=new Array(i),o=0;o<i;o++)e=t[o],n[o]=e[0],r[o]=e[1];return[n,r]},n.range=a,n.linspace=function(t,e,i){void 0===i&&(i=100);for(var n=(e-t)/(i-1),r=new Array(i),o=0;o<i;o++)r[o]=t+n*o;return r},n.transpose=function(t){for(var e=t.length,i=t[0].length,n=[],r=0;r<i;r++){n[r]=[];for(var o=0;o<e;o++)n[r][o]=t[o][r]}return n},n.cumsum=function(t){var n=[];return t.reduce(function(t,e,i){return n[i]=t+e},0),n},n.argmin=function(e){return i.minBy(a(e.length),function(t){return e[t]})},n.argmax=function(e){return i.maxBy(a(e.length),function(t){return e[t]})},n.all=function(t,e){for(var i=0,n=t;i<n.length;i++){var r=n[i];if(!e(r))return!1}return!0},n.any=function(t,e){for(var i=0,n=t;i<n.length;i++){var r=n[i];if(e(r))return!0}return!1},n.findIndex=l(1),n.findLastIndex=l(-1),n.find=function(t,e){var i=n.findIndex(t,e);return-1==i?void 0:t[i]},n.findLast=function(t,e){var i=n.findLastIndex(t,e);return-1==i?void 0:t[i]},n.sortedIndex=function(t,e){for(var i=0,n=t.length;i<n;){var r=Math.floor((i+n)/2);t[r]<e?i=r+1:n=r}return i},n.sortBy=function(t,i){var e=t.map(function(t,e){return{value:t,index:e,key:i(t)}});return e.sort(function(t,e){var i=t.key,n=e.key;if(i!==n){if(n<i||void 0===i)return 1;if(i<n||void 0===n)return-1}return t.index-e.index}),e.map(function(t){return t.value})},n.uniq=h,n.uniqBy=function(t,e){for(var i=[],n=[],r=0,o=t;r<o.length;r++){var s=o[r],a=e(s);u(n,a)||(n.push(a),i.push(s))}return i},n.union=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return h(s(t))},n.intersection=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var n=[];t:for(var r=0,o=t;r<o.length;r++){var s=o[r];if(!u(n,s)){for(var a=0,l=e;a<l.length;a++){var h=l[a];if(!u(h,s))continue t}n.push(s)}}return n},n.difference=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var n=s(e);return t.filter(function(t){return!u(n,t)})},n.removeBy=function(t,e){for(var i=0;i<t.length;)e(t[i])?t.splice(i,1):i++},n.shuffle=function(t){for(var e=t.length,i=new Array(e),n=0;n<e;n++){var r=o.randomIn(0,n);r!==n&&(i[n]=i[r]),i[r]=t[n]}return i},n.pairwise=function(t,e){for(var i=t.length,n=new Array(i-1),r=0;r<i-1;r++)n[r]=e(t[r],t[r+1]);return n},n.reversed=function(t){for(var e=t.length,i=new Array(e),n=0;n<e;n++)i[e-n-1]=t[n];return i},n.repeat=function(t,e){for(var i=new Array(e),n=0;n<e;n++)i[n]=t;return i}},function(t,e,i){function n(t,e,i){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];var o=t.length;e<0&&(e+=o),e<0?e=0:o<e&&(e=o),null==i||o-e<i?i=o-e:i<0&&(i=0);for(var s=o-i+n.length,a=new t.constructor(s),l=0;l<e;l++)a[l]=t[l];for(var h=0,c=n;h<c.length;h++){var u=c[h];a[l++]=u}for(var _=e+i;_<o;_++)a[l++]=t[_];return a}i.splice=n,i.insert=function(t,e,i){return n(t,i,0,e)},i.append=function(t,e){return n(t,t.length,0,e)},i.prepend=function(t,e){return n(t,0,0,e)},i.indexOf=function(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},i.map=function(t,e){for(var i=t.length,n=new t.constructor(i),r=0;r<i;r++)n[r]=e(t[r],r,t);return n},i.min=function(t){for(var e,i=1/0,n=0,r=t.length;n<r;n++)(e=t[n])<i&&(i=e);return i},i.minBy=function(t,e){if(0==t.length)throw new Error(\"minBy() called with an empty array\");for(var i=t[0],n=e(i),r=1,o=t.length;r<o;r++){var s=t[r],a=e(s);a<n&&(i=s,n=a)}return i},i.max=function(t){for(var e,i=-1/0,n=0,r=t.length;n<r;n++)e=t[n],i<e&&(i=e);return i},i.maxBy=function(t,e){if(0==t.length)throw new Error(\"maxBy() called with an empty array\");for(var i=t[0],n=e(i),r=1,o=t.length;r<o;r++){var s=t[r],a=e(s);n<a&&(i=s,n=a)}return i},i.sum=function(t){for(var e=0,i=0,n=t.length;i<n;i++)e+=t[i];return e}},function(t,e,i){var n=t(387),r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(Error);i.AssertionError=r,i.assert=function(t,e){if(!(!0===t||!1!==t&&t()))throw new r(e||\"Assertion failed\")}},function(t,e,i){var n=Math.min,r=Math.max;i.empty=function(){return{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}},i.positive_x=function(){return{minX:Number.MIN_VALUE,minY:-1/0,maxX:1/0,maxY:1/0}},i.positive_y=function(){return{minX:-1/0,minY:Number.MIN_VALUE,maxX:1/0,maxY:1/0}},i.union=function(t,e){return{minX:n(t.minX,e.minX),maxX:r(t.maxX,e.maxX),minY:n(t.minY,e.minY),maxY:r(t.maxY,e.maxY)}};var o=function(){function e(t){if(\"x0\"in t&&\"y0\"in t&&\"x1\"in t&&\"y1\"in t){var e=t,i=e.x0,n=e.y0,r=e.x1,o=e.y1;if(!(i<=r&&n<=o))throw new Error(\"invalid bbox {x0: \"+i+\", y0: \"+n+\", x1: \"+r+\", y1: \"+o+\"}\");this.x0=i,this.y0=n,this.x1=r,this.y1=o}else{var s=t,a=s.x,l=s.y,h=s.width,c=s.height;if(!(0<=h&&0<=c))throw new Error(\"invalid bbox {x: \"+a+\", y: \"+l+\", width: \"+h+\", height: \"+c+\"}\");this.x0=a,this.y0=l,this.x1=a+h,this.y1=l+c}}return Object.defineProperty(e.prototype,\"minX\",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"minY\",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"maxX\",{get:function(){return this.x1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"maxY\",{get:function(){return this.y1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"left\",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"top\",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"right\",{get:function(){return this.x1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"bottom\",{get:function(){return this.y1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"p0\",{get:function(){return[this.x0,this.y0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"p1\",{get:function(){return[this.x1,this.y1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"x\",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"y\",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"width\",{get:function(){return this.x1-this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"height\",{get:function(){return this.y1-this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"rect\",{get:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"h_range\",{get:function(){return{start:this.x0,end:this.x1}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"v_range\",{get:function(){return{start:this.y0,end:this.y1}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"ranges\",{get:function(){return[this.h_range,this.v_range]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"aspect\",{get:function(){return this.width/this.height},enumerable:!0,configurable:!0}),e.prototype.contains=function(t,e){return t>=this.x0&&t<=this.x1&&e>=this.y0&&e<=this.y1},e.prototype.clip=function(t,e){return t<this.x0?t=this.x0:t>this.x1&&(t=this.x1),e<this.y0?e=this.y0:e>this.y1&&(e=this.y1),[t,e]},e.prototype.union=function(t){return new e({x0:n(this.x0,t.x0),y0:n(this.y0,t.y0),x1:r(this.x1,t.x1),y1:r(this.y1,t.y1)})},e}();i.BBox=o},function(t,e,i){i.delay=function(t,e){return setTimeout(t,e)};var n=\"function\"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;i.defer=function(t){return n(t)},i.throttle=function(i,n,r){void 0===r&&(r={});var o,s,a,l=null,h=0,c=function(){h=!1===r.leading?0:Date.now(),l=null,a=i.apply(o,s),l||(o=s=null)};return function(){var t=Date.now();h||!1!==r.leading||(h=t);var e=n-(t-h);return o=this,s=arguments,e<=0||n<e?(l&&(clearTimeout(l),l=null),h=t,a=i.apply(o,s),l||(o=s=null)):l||!1===r.trailing||(l=setTimeout(c,e)),a}},i.once=function(t){var e,i=!1;return function(){return i||(i=!0,e=t()),e}}},function(t,e,i){var n=t(273);i.SVGRenderingContext2D=n,i.fixup_ctx=function(t){var e,u,i,n,r;(e=t).setLineDash||(e.setLineDash=function(t){e.mozDash=t,e.webkitLineDash=t}),e.getLineDash||(e.getLineDash=function(){return e.mozDash}),(r=t).setLineDashOffset=function(t){r.lineDashOffset=t,r.mozDashOffset=t,r.webkitLineDashOffset=t},r.getLineDashOffset=function(){return r.mozDashOffset},(n=t).setImageSmoothingEnabled=function(t){n.imageSmoothingEnabled=t,n.mozImageSmoothingEnabled=t,n.oImageSmoothingEnabled=t,n.webkitImageSmoothingEnabled=t,n.msImageSmoothingEnabled=t},n.getImageSmoothingEnabled=function(){var t=n.imageSmoothingEnabled;return null==t||t},(i=t).measureText&&null==i.html5MeasureText&&(i.html5MeasureText=i.measureText,i.measureText=function(t){var e=i.html5MeasureText(t);return e.ascent=1.6*i.html5MeasureText(\"m\").width,e}),(u=t).ellipse||(u.ellipse=function(t,e,i,n,r,o,s,a){void 0===a&&(a=!1);var l=.551784;u.translate(t,e),u.rotate(r);var h=i,c=n;a&&(h=-i,c=-n),u.moveTo(-h,0),u.bezierCurveTo(-h,c*l,-h*l,c,0,c),u.bezierCurveTo(h*l,c,h,c*l,h,0),u.bezierCurveTo(h,-c*l,h*l,-c,0,-c),u.bezierCurveTo(-h*l,-c,-h,-c*l,-h,0),u.rotate(-r),u.translate(-t,-e)})},i.get_scale_ratio=function(t,e,i){if(\"svg\"==i)return 1;if(e){var n=window.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}return 1}},function(t,e,i){var n=t(39),r=t(21);function o(t){var e=Number(t).toString(16);return 1==e.length?\"0\"+e:e}function s(t){if(0==(t+=\"\").indexOf(\"#\"))return t;if(n.is_svg_color(t))return n.svg_colors[t];if(0==t.indexOf(\"rgb\")){var e=t.replace(/^rgba?\\(|\\s+|\\)$/g,\"\").split(\",\"),i=e.slice(0,3).map(o).join(\"\");return 4==e.length&&(i+=o(Math.floor(255*parseFloat(e[3])))),\"#\"+i.slice(0,8)}return t}i.color2hex=s,i.color2rgba=function(t,e){if(void 0===e&&(e=1),!t)return[0,0,0,0];var i=s(t);(i=i.replace(/ |#/g,\"\")).length<=4&&(i=i.replace(/(.)/g,\"$1$1\"));for(var n=i.match(/../g).map(function(t){return parseInt(t,16)/255});n.length<3;)n.push(0);return n.length<4&&n.push(e),n.slice(0,4)},i.valid_rgb=function(t){var e;switch(t.substring(0,4)){case\"rgba\":e={start:\"rgba(\",len:4,alpha:!0};break;case\"rgb(\":e={start:\"rgb(\",len:3,alpha:!1};break;default:return!1}if(new RegExp(\".*?(\\\\.).*(,)\").test(t))throw new Error(\"color expects integers for rgb in rgb/rgba tuple, received \"+t);var i=t.replace(e.start,\"\").replace(\")\",\"\").split(\",\").map(parseFloat);if(i.length!=e.len)throw new Error(\"color expects rgba \"+e.len+\"-tuple, received \"+t);if(e.alpha&&!(0<=i[3]&&i[3]<=1))throw new Error(\"color expects rgba 4-tuple to have alpha value between 0 and 1\");if(r.includes(i.slice(0,3).map(function(t){return 0<=t&&t<=255}),!1))throw new Error(\"color expects rgb to have value between 0 and 255\");return!0}},function(t,e,i){i.is_ie=0<=navigator.userAgent.indexOf(\"MSIE\")||0<navigator.userAgent.indexOf(\"Trident\")||0<navigator.userAgent.indexOf(\"Edge\"),i.is_little_endian=function(){var t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t);i[1]=168496141;var n=!0;return 10==e[4]&&11==e[5]&&12==e[6]&&13==e[7]&&(n=!1),n}()},function(t,e,i){var r=t(21),o=t(30),s=t(44),n=function(){function t(){this._dict={}}return t.prototype._existing=function(t){return t in this._dict?this._dict[t]:null},t.prototype.add_value=function(t,e){var i=this._existing(t);null==i?this._dict[t]=e:s.isArray(i)?i.push(e):this._dict[t]=[i,e]},t.prototype.remove_value=function(t,e){var i=this._existing(t);if(s.isArray(i)){var n=r.difference(i,[e]);0<n.length?this._dict[t]=n:delete this._dict[t]}else o.isEqual(i,e)&&delete this._dict[t]},t.prototype.get_one=function(t,e){var i=this._existing(t);if(s.isArray(i)){if(1===i.length)return i[0];throw new Error(e)}return i},t}();i.MultiDict=n;var a=function(){function o(t){this.values=null==t?[]:t instanceof o?r.copy(t.values):this._compact(t)}return o.prototype._compact=function(t){for(var e=[],i=0,n=t;i<n.length;i++){var r=n[i];-1===e.indexOf(r)&&e.push(r)}return e},o.prototype.push=function(t){this.missing(t)&&this.values.push(t)},o.prototype.remove=function(t){var e=this.values.indexOf(t);this.values=this.values.slice(0,e).concat(this.values.slice(e+1))},o.prototype.length=function(){return this.values.length},o.prototype.includes=function(t){return-1!=this.values.indexOf(t)},o.prototype.missing=function(t){return!this.includes(t)},o.prototype.slice=function(t,e){return this.values.slice(t,e)},o.prototype.join=function(t){return this.values.join(t)},o.prototype.toString=function(){return this.join(\", \")},o.prototype.union=function(t){return t=new o(t),new o(this.values.concat(t.values))},o.prototype.intersect=function(t){t=new o(t);for(var e=new o,i=0,n=t.values;i<n.length;i++){var r=n[i];this.includes(r)&&t.includes(r)&&e.push(r)}return e},o.prototype.diff=function(t){t=new o(t);for(var e=new o,i=0,n=this.values;i<n.length;i++){var r=n[i];t.missing(r)&&e.push(r)}return e},o}();i.Set=a},function(t,e,i){var _=t(44),p=Object.prototype.toString;i.isEqual=function(t,e){return function t(e,i,n,r){if(e===i)return 0!==e||1/e==1/i;if(null==e||null==i)return e===i;var o=p.call(e);if(o!==p.call(i))return!1;switch(o){case\"[object RegExp]\":case\"[object String]\":return\"\"+e==\"\"+i;case\"[object Number]\":return+e!=+e?+i!=+i:0==+e?1/+e==1/i:+e==+i;case\"[object Date]\":case\"[object Boolean]\":return+e==+i}var s=\"[object Array]\"===o;if(!s){if(\"object\"!=typeof e||\"object\"!=typeof i)return!1;var a=e.constructor,l=i.constructor;if(a!==l&&!(_.isFunction(a)&&a instanceof a&&_.isFunction(l)&&l instanceof l)&&\"constructor\"in e&&\"constructor\"in i)return!1}r=r||[];for(var h=(n=n||[]).length;h--;)if(n[h]===e)return r[h]===i;if(n.push(e),r.push(i),s){if((h=e.length)!==i.length)return!1;for(;h--;)if(!t(e[h],i[h],n,r))return!1}else{var c=Object.keys(e),u=void 0;if(h=c.length,Object.keys(i).length!==h)return!1;for(;h--;)if(u=c[h],!i.hasOwnProperty(u)||!t(e[u],i[u],n,r))return!1}return n.pop(),r.pop(),!0}(t,e)}},function(t,e,i){function a(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}function l(t,e){return Math.abs(a(t-e))}function o(){return Math.random()}i.angle_norm=a,i.angle_dist=l,i.angle_between=function(t,e,i,n){var r=a(t),o=l(e,i),s=l(e,r)<=o&&l(r,i)<=o;return 1==n?!s:s},i.random=o,i.randomIn=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},i.atan2=function(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])},i.rnorm=function(t,e){for(var i,n;i=o(),n=(2*(n=o())-1)*Math.sqrt(1/Math.E*2),!(-4*i*i*Math.log(i)>=n*n););var r=n/i;return r=t+e*r},i.clamp=function(t,e,i){return i<t?i:t<e?e:t}},function(t,e,i){var n=t(387),h=t(21);function r(t,e){return n.__assign(t,e)}function o(t){return Object.keys(t).length}i.keys=Object.keys,i.values=function(t){for(var e=Object.keys(t),i=e.length,n=new Array(i),r=0;r<i;r++)n[r]=t[e[r]];return n},i.extend=r,i.clone=function(t){return r({},t)},i.merge=function(t,e){for(var i=Object.create(Object.prototype),n=h.concat([Object.keys(t),Object.keys(e)]),r=0,o=n;r<o.length;r++){var s=o[r],a=t.hasOwnProperty(s)?t[s]:[],l=e.hasOwnProperty(s)?e[s]:[];i[s]=h.union(a,l)}return i},i.size=o,i.isEmpty=function(t){return 0===o(t)}},function(t,e,h){var i=t(370),n=t(358),r=new n(\"GOOGLE\"),o=new n(\"WGS84\");h.wgs84_mercator=i(o,r);var s={lon:[-20026376.39,20026376.39],lat:[-20048966.1,20048966.1]},a={lon:[-180,180],lat:[-85.06,85.06]};function c(t,e){for(var i=Math.min(t.length,e.length),n=new Array(i),r=new Array(i),o=0;o<i;o++){var s=h.wgs84_mercator.forward([t[o],e[o]]),a=s[0],l=s[1];n[o]=a,r[o]=l}return[n,r]}h.clip_mercator=function(t,e,i){var n=s[i],r=n[0],o=n[1];return[Math.max(t,r),Math.min(e,o)]},h.in_bounds=function(t,e){return t>a[e][0]&&t<a[e][1]},h.project_xy=c,h.project_xsys=function(t,e){for(var i=Math.min(t.length,e.length),n=new Array(i),r=new Array(i),o=0;o<i;o++){var s=c(t[o],e[o]),a=s[0],l=s[1];n[o]=a,r[o]=l}return[n,r]}},function(t,e,i){var n=t(44);i.create_ref=function(t){var e={type:t.type,id:t.id};return null!=t._subtype&&(e.subtype=t._subtype),e},i.is_ref=function(t){if(n.isObject(t)){var e=Object.keys(t).sort();if(2==e.length)return\"id\"==e[0]&&\"type\"==e[1];if(3==e.length)return\"id\"==e[0]&&\"subtype\"==e[1]&&\"type\"==e[2]}return!1}},function(t,e,i){i.get_indices=function(t){var e=t.selected;return e[\"0d\"].glyph?e[\"0d\"].indices:0<e[\"1d\"].indices.length?e[\"1d\"].indices:0<e[\"2d\"].indices.length?e[\"2d\"].indices:[]}},function(t,e,c){var f=t(44),i=t(28);function u(t){for(var e=new Uint8Array(t.buffer,t.byteOffset,2*t.length),i=0,n=e.length;i<n;i+=2){var r=e[i];e[i]=e[i+1],e[i+1]=r}}function _(t){for(var e=new Uint8Array(t.buffer,t.byteOffset,4*t.length),i=0,n=e.length;i<n;i+=4){var r=e[i];e[i]=e[i+3],e[i+3]=r,r=e[i+1],e[i+1]=e[i+2],e[i+2]=r}}function p(t){for(var e=new Uint8Array(t.buffer,t.byteOffset,8*t.length),i=0,n=e.length;i<n;i+=8){var r=e[i];e[i]=e[i+7],e[i+7]=r,r=e[i+1],e[i+1]=e[i+6],e[i+6]=r,r=e[i+2],e[i+2]=e[i+5],e[i+5]=r,r=e[i+3],e[i+3]=e[i+4],e[i+4]=r}}function n(t,e){for(var i=t.order!==c.BYTE_ORDER,n=t.shape,r=null,o=0,s=e;o<s.length;o++){var a=s[o],l=JSON.parse(a[0]);if(l.id===t.__buffer__){r=a[1];break}}var h=new c.ARRAY_TYPES[t.dtype](r);return i&&(2===h.BYTES_PER_ELEMENT?u(h):4===h.BYTES_PER_ELEMENT?_(h):8===h.BYTES_PER_ELEMENT&&p(h)),[h,n]}function v(t,e){return f.isObject(t)&&\"__ndarray__\"in t?o(t):f.isObject(t)&&\"__buffer__\"in t?n(t,e):f.isArray(t)?[t,[]]:void 0}function s(t){var e=new Uint8Array(t),i=Array.from(e).map(function(t){return String.fromCharCode(t)});return btoa(i.join(\"\"))}function r(t){for(var e=atob(t),i=e.length,n=new Uint8Array(i),r=0,o=i;r<o;r++)n[r]=e.charCodeAt(r);return n.buffer}function o(t){var e=r(t.__ndarray__),i=t.dtype,n=t.shape;if(!(i in c.ARRAY_TYPES))throw new Error(\"unknown dtype: \"+i);return[new c.ARRAY_TYPES[i](e),n]}function d(t,e){var i,n=s(t.buffer),r=function(t){if(\"name\"in t.constructor)return t.constructor.name;switch(!0){case t instanceof Uint8Array:return\"Uint8Array\";case t instanceof Int8Array:return\"Int8Array\";case t instanceof Uint16Array:return\"Uint16Array\";case t instanceof Int16Array:return\"Int16Array\";case t instanceof Uint32Array:return\"Uint32Array\";case t instanceof Int32Array:return\"Int32Array\";case t instanceof Float32Array:return\"Float32Array\";case t instanceof Float64Array:return\"Float64Array\";default:throw new Error(\"unsupported typed array\")}}(t);if(!(r in c.DTYPES))throw new Error(\"unknown array type: \"+r);i=c.DTYPES[r];var o={__ndarray__:n,shape:e,dtype:i};return o}c.ARRAY_TYPES={uint8:Uint8Array,int8:Int8Array,uint16:Uint16Array,int16:Int16Array,uint32:Uint32Array,int32:Int32Array,float32:Float32Array,float64:Float64Array},c.DTYPES={Uint8Array:\"uint8\",Int8Array:\"int8\",Uint16Array:\"uint16\",Int16Array:\"int16\",Uint32Array:\"uint32\",Int32Array:\"int32\",Float32Array:\"float32\",Float64Array:\"float64\"},c.BYTE_ORDER=i.is_little_endian?\"little\":\"big\",c.swap16=u,c.swap32=_,c.swap64=p,c.process_buffer=n,c.process_array=v,c.arrayBufferToBase64=s,c.base64ToArrayBuffer=r,c.decode_base64=o,c.encode_base64=d,c.decode_column_data=function(t,e){void 0===e&&(e=[]);var i={},n={};for(var r in t){var o=t[r];if(f.isArray(o)){if(0==o.length||!f.isObject(o[0])&&!f.isArray(o[0])){i[r]=o;continue}for(var s=[],a=[],l=0,h=o;l<h.length;l++){var c=h[l],u=v(c,e),_=u[0],p=u[1];s.push(_),a.push(p)}i[r]=s,n[r]=a}else{var d=v(o,e),_=d[0],p=d[1];i[r]=_,n[r]=p}}return[i,n]},c.encode_column_data=function(t,e){var i={};for(var n in t){var r=t[n],o=void 0;if(f.isTypedArray(r))o=d(r,null!=e?e[n]:void 0);else if(f.isArray(r)){for(var s=[],a=0,l=r.length;a<l;a++){var h=r[a];if(f.isTypedArray(h)){var c=null!=e&&null!=e[n]?e[n][a]:void 0;s.push(d(h,c))}else s.push(h)}o=s}else o=r;i[n]=o}return i}},function(t,e,i){var l=t(342),o=t(24),n=function(){function t(t){if(this.points=t,this.index=null,0<t.length){this.index=new l(t.length);for(var e=0,i=t;e<i.length;e++){var n=i[e],r=n.minX,o=n.minY,s=n.maxX,a=n.maxY;this.index.add(r,o,s,a)}this.index.finish()}}return Object.defineProperty(t.prototype,\"bbox\",{get:function(){if(null==this.index)return o.empty();var t=this.index,e=t.minX,i=t.minY,n=t.maxX,r=t.maxY;return{minX:e,minY:i,maxX:n,maxY:r}},enumerable:!0,configurable:!0}),t.prototype.search=function(t){var e=this;if(null==this.index)return[];var i=t.minX,n=t.minY,r=t.maxX,o=t.maxY,s=this.index.search(i,n,r,o);return s.map(function(t){return e.points[t]})},t.prototype.indices=function(t){return this.search(t).map(function(t){var e=t.i;return e})},t}();i.SpatialIndex=n},function(t,e,i){var n=t(18);function r(){for(var t=new Array(32),e=\"0123456789ABCDEF\",i=0;i<32;i++)t[i]=e.substr(Math.floor(16*Math.random()),1);return t[12]=\"4\",t[16]=e.substr(3&t[16].charCodeAt(0)|8,1),t.join(\"\")}i.startsWith=function(t,e,i){return void 0===i&&(i=0),t.substr(i,e.length)==e},i.uuid4=r;var o=1e3;i.uniqueId=function(t){var e=n.settings.dev?\"j\"+o++:r();return null!=t?t+\"-\"+e:e},i.escape=function(t){return t.replace(/(?:[&<>\"'`])/g,function(t){switch(t){case\"&\":return\"&amp;\";case\"<\":return\"&lt;\";case\">\":return\"&gt;\";case'\"':return\"&quot;\";case\"'\":return\"&#x27;\";case\"`\":return\"&#x60;\";default:return t}})},i.unescape=function(t){return t.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,function(t,e){switch(e){case\"amp\":return\"&\";case\"lt\":return\"<\";case\"gt\":return\">\";case\"quot\":return'\"';case\"#x27\":return\"'\";case\"#x60\":return\"`\";default:return e}})},i.use_strict=function(t){return\"'use strict';\\n\"+t}},function(t,e,i){i.svg_colors={indianred:\"#CD5C5C\",lightcoral:\"#F08080\",salmon:\"#FA8072\",darksalmon:\"#E9967A\",lightsalmon:\"#FFA07A\",crimson:\"#DC143C\",red:\"#FF0000\",firebrick:\"#B22222\",darkred:\"#8B0000\",pink:\"#FFC0CB\",lightpink:\"#FFB6C1\",hotpink:\"#FF69B4\",deeppink:\"#FF1493\",mediumvioletred:\"#C71585\",palevioletred:\"#DB7093\",coral:\"#FF7F50\",tomato:\"#FF6347\",orangered:\"#FF4500\",darkorange:\"#FF8C00\",orange:\"#FFA500\",gold:\"#FFD700\",yellow:\"#FFFF00\",lightyellow:\"#FFFFE0\",lemonchiffon:\"#FFFACD\",lightgoldenrodyellow:\"#FAFAD2\",papayawhip:\"#FFEFD5\",moccasin:\"#FFE4B5\",peachpuff:\"#FFDAB9\",palegoldenrod:\"#EEE8AA\",khaki:\"#F0E68C\",darkkhaki:\"#BDB76B\",lavender:\"#E6E6FA\",thistle:\"#D8BFD8\",plum:\"#DDA0DD\",violet:\"#EE82EE\",orchid:\"#DA70D6\",fuchsia:\"#FF00FF\",magenta:\"#FF00FF\",mediumorchid:\"#BA55D3\",mediumpurple:\"#9370DB\",blueviolet:\"#8A2BE2\",darkviolet:\"#9400D3\",darkorchid:\"#9932CC\",darkmagenta:\"#8B008B\",purple:\"#800080\",indigo:\"#4B0082\",slateblue:\"#6A5ACD\",darkslateblue:\"#483D8B\",mediumslateblue:\"#7B68EE\",greenyellow:\"#ADFF2F\",chartreuse:\"#7FFF00\",lawngreen:\"#7CFC00\",lime:\"#00FF00\",limegreen:\"#32CD32\",palegreen:\"#98FB98\",lightgreen:\"#90EE90\",mediumspringgreen:\"#00FA9A\",springgreen:\"#00FF7F\",mediumseagreen:\"#3CB371\",seagreen:\"#2E8B57\",forestgreen:\"#228B22\",green:\"#008000\",darkgreen:\"#006400\",yellowgreen:\"#9ACD32\",olivedrab:\"#6B8E23\",olive:\"#808000\",darkolivegreen:\"#556B2F\",mediumaquamarine:\"#66CDAA\",darkseagreen:\"#8FBC8F\",lightseagreen:\"#20B2AA\",darkcyan:\"#008B8B\",teal:\"#008080\",aqua:\"#00FFFF\",cyan:\"#00FFFF\",lightcyan:\"#E0FFFF\",paleturquoise:\"#AFEEEE\",aquamarine:\"#7FFFD4\",turquoise:\"#40E0D0\",mediumturquoise:\"#48D1CC\",darkturquoise:\"#00CED1\",cadetblue:\"#5F9EA0\",steelblue:\"#4682B4\",lightsteelblue:\"#B0C4DE\",powderblue:\"#B0E0E6\",lightblue:\"#ADD8E6\",skyblue:\"#87CEEB\",lightskyblue:\"#87CEFA\",deepskyblue:\"#00BFFF\",dodgerblue:\"#1E90FF\",cornflowerblue:\"#6495ED\",royalblue:\"#4169E1\",blue:\"#0000FF\",mediumblue:\"#0000CD\",darkblue:\"#00008B\",navy:\"#000080\",midnightblue:\"#191970\",cornsilk:\"#FFF8DC\",blanchedalmond:\"#FFEBCD\",bisque:\"#FFE4C4\",navajowhite:\"#FFDEAD\",wheat:\"#F5DEB3\",burlywood:\"#DEB887\",tan:\"#D2B48C\",rosybrown:\"#BC8F8F\",sandybrown:\"#F4A460\",goldenrod:\"#DAA520\",darkgoldenrod:\"#B8860B\",peru:\"#CD853F\",chocolate:\"#D2691E\",saddlebrown:\"#8B4513\",sienna:\"#A0522D\",brown:\"#A52A2A\",maroon:\"#800000\",white:\"#FFFFFF\",snow:\"#FFFAFA\",honeydew:\"#F0FFF0\",mintcream:\"#F5FFFA\",azure:\"#F0FFFF\",aliceblue:\"#F0F8FF\",ghostwhite:\"#F8F8FF\",whitesmoke:\"#F5F5F5\",seashell:\"#FFF5EE\",beige:\"#F5F5DC\",oldlace:\"#FDF5E6\",floralwhite:\"#FFFAF0\",ivory:\"#FFFFF0\",antiquewhite:\"#FAEBD7\",linen:\"#FAF0E6\",lavenderblush:\"#FFF0F5\",mistyrose:\"#FFE4E1\",gainsboro:\"#DCDCDC\",lightgray:\"#D3D3D3\",lightgrey:\"#D3D3D3\",silver:\"#C0C0C0\",darkgray:\"#A9A9A9\",darkgrey:\"#A9A9A9\",gray:\"#808080\",grey:\"#808080\",dimgray:\"#696969\",dimgrey:\"#696969\",lightslategray:\"#778899\",lightslategrey:\"#778899\",slategray:\"#708090\",slategrey:\"#708090\",darkslategray:\"#2F4F4F\",darkslategrey:\"#2F4F4F\",black:\"#000000\"},i.is_svg_color=function(t){return t in i.svg_colors}},function(t,e,s){var r=t(385),n=t(357),o=t(386),_=t(38),a=t(44);function l(t,e,i){if(a.isNumber(t)){var n=function(){switch(!1){case Math.floor(t)!=t:return\"%d\";case!(.1<Math.abs(t)&&Math.abs(t)<1e3):return\"%0.3f\";default:return\"%0.3e\"}}();return r.sprintf(n,t)}return\"\"+t}function p(t,e,i,n){if(null==i)return l;if(null!=n&&(t in n||e in n)){var r=e in n?e:t,o=n[r];if(a.isString(o)){if(o in s.DEFAULT_FORMATTERS)return s.DEFAULT_FORMATTERS[o];throw new Error(\"Unknown tooltip field formatter type '\"+o+\"'\")}return function(t,e,i){return o.format(t,e,i)}}return s.DEFAULT_FORMATTERS.numeral}function d(t,e,i,n){if(\"$\"==t[0]){if(t.substring(1)in n)return n[t.substring(1)];throw new Error(\"Unknown special variable '\"+t+\"'\")}var r=e.get_column(t);if(null==r)return null;if(a.isNumber(i))return r[i];var o=r[i.index];if(a.isTypedArray(o)||a.isArray(o)){if(a.isArray(o[0])){var s=o[i.dim2];return s[i.dim1]}return o[i.flat_index]}return o}s.DEFAULT_FORMATTERS={numeral:function(t,e,i){return n.format(t,e)},datetime:function(t,e,i){return o(t,e)},printf:function(t,e,i){return r.sprintf(e,t)}},s.basic_formatter=l,s.get_formatter=p,s.get_value=d,s.replace_placeholders=function(t,a,l,h,c){void 0===c&&(c={});var u=t.replace(/(?:^|[^@])([@|\\$](?:\\w+|{[^{}]+}))(?:{[^{}]+})?/g,function(t,e,i){return\"\"+e});return t=(t=(t=t.replace(/@\\$name/g,function(t){return\"@{\"+c.name+\"}\"})).replace(/(^|[^\\$])\\$(\\w+)/g,function(t,e,i){return e+\"@$\"+i})).replace(/(^|[^@])@(?:(\\$?\\w+)|{([^{}]+)})(?:{([^{}]+)})?/g,function(t,e,i,n,r){var o=d(i=null!=n?n:i,a,l,c);if(null==o)return\"\"+e+_.escape(\"???\");if(\"safe\"==r)return\"\"+e+o;var s=p(i,u,r,h);return\"\"+e+_.escape(s(o,r,c))})}},function(t,e,i){var a=t(5),l={};i.get_text_height=function(t){if(null!=l[t])return l[t];var e=a.span({style:{font:t}},\"Hg\"),i=a.div({style:{display:\"inline-block\",width:\"1px\",height:\"0px\"}}),n=a.div({},e,i);document.body.appendChild(n);try{i.style.verticalAlign=\"baseline\";var r=a.offset(i).top-a.offset(e).top;i.style.verticalAlign=\"bottom\";var o=a.offset(i).top-a.offset(e).top,s={height:o,ascent:r,descent:o-r};return l[t]=s}finally{document.body.removeChild(n)}}},function(t,e,i){var a=(\"undefined\"!=typeof window?window.requestAnimationFrame:void 0)||(\"undefined\"!=typeof window?window.webkitRequestAnimationFrame:void 0)||(\"undefined\"!=typeof window?window.mozRequestAnimationFrame:void 0)||(\"undefined\"!=typeof window?window.msRequestAnimationFrame:void 0)||function(t){return t(Date.now()),-1};i.throttle=function(t,i){var n=null,r=0,o=!1,s=function(){r=Date.now(),n=null,o=!1,t()};return function(){var t=Date.now(),e=i-(t-r);e<=0&&!o?(null!=n&&clearTimeout(n),o=!0,a(s)):n||o||(n=setTimeout(function(){return a(s)},e))}}},function(t,e,i){i.concat=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=t.length,r=0,o=e;r<o.length;r++){var s=o[r];n+=s.length}var a=new t.constructor(n);a.set(t,0);for(var l=t.length,h=0,c=e;h<c.length;h++){var s=c[h];a.set(s,l),l+=s.length}return a}},function(t,e,i){var n=t(21),r=Object.prototype.toString;function o(t){return\"[object Number]\"===r.call(t)}i.isBoolean=function(t){return!0===t||!1===t||\"[object Boolean]\"===r.call(t)},i.isNumber=o,i.isInteger=function(t){return o(t)&&isFinite(t)&&Math.floor(t)===t},i.isString=function(t){return\"[object String]\"===r.call(t)},i.isStrictNaN=function(t){return o(t)&&t!==+t},i.isFunction=function(t){return\"[object Function]\"===r.call(t)},i.isArray=function(t){return Array.isArray(t)},i.isArrayOf=function(t,e){return n.all(t,e)},i.isArrayableOf=function(t,e){for(var i=0,n=t.length;i<n;i++)if(!e(t[i]))return!1;return!0},i.isTypedArray=function(t){return null!=t&&null!=t.buffer&&t.buffer instanceof ArrayBuffer},i.isObject=function(t){var e=typeof t;return\"function\"===e||\"object\"===e&&!!t}},function(t,e,i){function n(t){var e=getComputedStyle(t).fontSize;return null!=e?parseInt(e,10):null}i.getDeltaY=function(t){var e,i=-t.deltaY;if(t.target instanceof HTMLElement)switch(t.deltaMode){case t.DOM_DELTA_LINE:i*=n((e=t.target).offsetParent||document.body)||n(e)||16;break;case t.DOM_DELTA_PAGE:i*=t.target.clientHeight}return i}},function(t,e,i){var f=t(31);function v(t,e,i){var n=[t.start,t.end],r=n[0],o=n[1],s=null!=i?i:(o+r)/2,a=r-(r-s)*e,l=o-(o-s)*e;return[a,l]}function m(t,e){var i=e[0],n=e[1],r={};for(var o in t){var s=t[o],a=s.r_invert(i,n),l=a[0],h=a[1];r[o]={start:l,end:h}}return r}i.scale_highlow=v,i.get_info=m,i.scale_range=function(t,e,i,n,r){void 0===i&&(i=!0),void 0===n&&(n=!0),e=f.clamp(e,-.9,.9);var o=i?e:0,s=v(t.bbox.h_range,o,null!=r?r.x:void 0),a=s[0],l=s[1],h=m(t.xscales,[a,l]),c=n?e:0,u=v(t.bbox.v_range,c,null!=r?r.y:void 0),_=u[0],p=u[1],d=m(t.yscales,[_,p]);return{xrs:h,yrs:d,factor:e}}},function(t,e,i){var n=t(44);i.isValue=function(t){return n.isObject(t)&&\"value\"in t},i.isField=function(t){return n.isObject(t)&&\"field\"in t}},function(t,e,i){var n=t(387),r=t(19),o=t(38),s=function(i){function t(t){var e=i.call(this)||this;if(e.removed=new r.Signal0(e,\"removed\"),null==t.model)throw new Error(\"model of a view wasn't configured\");return e.model=t.model,e._parent=t.parent,e.id=t.id||o.uniqueId(),e.initialize(t),!1!==t.connect_signals&&e.connect_signals(),e}return n.__extends(t,i),t.prototype.initialize=function(t){},t.prototype.remove=function(){this._parent=void 0,this.disconnect_signals(),this.removed.emit()},t.prototype.toString=function(){return this.model.type+\"View(\"+this.id+\")\"},Object.defineProperty(t.prototype,\"parent\",{get:function(){if(void 0!==this._parent)return this._parent;throw new Error(\"parent of a view wasn't configured\")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"is_root\",{get:function(){return null===this.parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"root\",{get:function(){return this.is_root?this:this.parent.root},enumerable:!0,configurable:!0}),t.prototype.connect_signals=function(){},t.prototype.disconnect_signals=function(){r.Signal.disconnectReceiver(this)},t.prototype.notify_finished=function(){this.root.notify_finished()},t}(r.Signalable());i.View=s},function(t,e,i){var n=t(387),r=t(16),o=t(27),s=function(){function t(t,e){void 0===e&&(e=\"\"),this.obj=t,this.prefix=e,this.cache={};var i=t.properties[e+this.do_attr].spec;this.doit=null!==i.value;for(var n=0,r=this.attrs;n<r.length;n++){var o=r[n];this[o]=t.properties[e+o]}}return t.prototype.warm_cache=function(t){for(var e=0,i=this.attrs;e<i.length;e++){var n=i[e],r=this.obj.properties[this.prefix+n];if(void 0!==r.spec.value)this.cache[n]=r.spec.value;else{if(null==t)throw new Error(\"source is required with a vectorized visual property\");this.cache[n+\"_array\"]=r.array(t)}}},t.prototype.cache_select=function(t,e){var i,n=this.obj.properties[this.prefix+t];return void 0!==n.spec.value?this.cache[t]=i=n.spec.value:this.cache[t]=i=this.cache[t+\"_array\"][e],i},t.prototype.set_vectorize=function(t,e){null!=this.all_indices?this._set_vectorize(t,this.all_indices[e]):this._set_vectorize(t,e)},t}(),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.set_value=function(t){t.strokeStyle=this.line_color.value(),t.globalAlpha=this.line_alpha.value(),t.lineWidth=this.line_width.value(),t.lineJoin=this.line_join.value(),t.lineCap=this.line_cap.value(),t.setLineDash(this.line_dash.value()),t.setLineDashOffset(this.line_dash_offset.value())},e.prototype._set_vectorize=function(t,e){this.cache_select(\"line_color\",e),t.strokeStyle!==this.cache.line_color&&(t.strokeStyle=this.cache.line_color),this.cache_select(\"line_alpha\",e),t.globalAlpha!==this.cache.line_alpha&&(t.globalAlpha=this.cache.line_alpha),this.cache_select(\"line_width\",e),t.lineWidth!==this.cache.line_width&&(t.lineWidth=this.cache.line_width),this.cache_select(\"line_join\",e),t.lineJoin!==this.cache.line_join&&(t.lineJoin=this.cache.line_join),this.cache_select(\"line_cap\",e),t.lineCap!==this.cache.line_cap&&(t.lineCap=this.cache.line_cap),this.cache_select(\"line_dash\",e),t.getLineDash()!==this.cache.line_dash&&t.setLineDash(this.cache.line_dash),this.cache_select(\"line_dash_offset\",e),t.getLineDashOffset()!==this.cache.line_dash_offset&&t.setLineDashOffset(this.cache.line_dash_offset)},e.prototype.color_value=function(){var t=o.color2rgba(this.line_color.value(),this.line_alpha.value()),e=t[0],i=t[1],n=t[2],r=t[3];return\"rgba(\"+255*e+\",\"+255*i+\",\"+255*n+\",\"+r+\")\"},e}(i.ContextProperties=s);(i.Line=h).prototype.attrs=Object.keys(r.line()),h.prototype.do_attr=\"line_color\";var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.set_value=function(t){t.fillStyle=this.fill_color.value(),t.globalAlpha=this.fill_alpha.value()},e.prototype._set_vectorize=function(t,e){this.cache_select(\"fill_color\",e),t.fillStyle!==this.cache.fill_color&&(t.fillStyle=this.cache.fill_color),this.cache_select(\"fill_alpha\",e),t.globalAlpha!==this.cache.fill_alpha&&(t.globalAlpha=this.cache.fill_alpha)},e.prototype.color_value=function(){var t=o.color2rgba(this.fill_color.value(),this.fill_alpha.value()),e=t[0],i=t[1],n=t[2],r=t[3];return\"rgba(\"+255*e+\",\"+255*i+\",\"+255*n+\",\"+r+\")\"},e}(s);(i.Fill=c).prototype.attrs=Object.keys(r.fill()),c.prototype.do_attr=\"fill_color\";var u=function(a){function t(){return null!==a&&a.apply(this,arguments)||this}return n.__extends(t,a),t.prototype.cache_select=function(t,e){var i;if(\"font\"==t){a.prototype.cache_select.call(this,\"text_font_style\",e),a.prototype.cache_select.call(this,\"text_font_size\",e),a.prototype.cache_select.call(this,\"text_font\",e);var n=this.cache,r=n.text_font_style,o=n.text_font_size,s=n.text_font;this.cache.font=i=r+\" \"+o+\" \"+s}else i=a.prototype.cache_select.call(this,t,e);return i},t.prototype.font_value=function(){var t=this.text_font.value(),e=this.text_font_size.value(),i=this.text_font_style.value();return i+\" \"+e+\" \"+t},t.prototype.color_value=function(){var t=o.color2rgba(this.text_color.value(),this.text_alpha.value()),e=t[0],i=t[1],n=t[2],r=t[3];return\"rgba(\"+255*e+\",\"+255*i+\",\"+255*n+\",\"+r+\")\"},t.prototype.set_value=function(t){t.font=this.font_value(),t.fillStyle=this.text_color.value(),t.globalAlpha=this.text_alpha.value(),t.textAlign=this.text_align.value(),t.textBaseline=this.text_baseline.value()},t.prototype._set_vectorize=function(t,e){this.cache_select(\"font\",e),t.font!==this.cache.font&&(t.font=this.cache.font),this.cache_select(\"text_color\",e),t.fillStyle!==this.cache.text_color&&(t.fillStyle=this.cache.text_color),this.cache_select(\"text_alpha\",e),t.globalAlpha!==this.cache.text_alpha&&(t.globalAlpha=this.cache.text_alpha),this.cache_select(\"text_align\",e),t.textAlign!==this.cache.text_align&&(t.textAlign=this.cache.text_align),this.cache_select(\"text_baseline\",e),t.textBaseline!==this.cache.text_baseline&&(t.textBaseline=this.cache.text_baseline)},t}(s);(i.Text=u).prototype.attrs=Object.keys(r.text()),u.prototype.do_attr=\"text_color\";var a=function(){function t(t){for(var e=0,i=t.mixins;e<i.length;e++){var n=i[e],r=n.split(\":\"),o=r[0],s=r[1],a=void 0===s?\"\":s,l=void 0;switch(o){case\"line\":l=h;break;case\"fill\":l=c;break;case\"text\":l=u;break;default:throw new Error(\"unknown visual: \"+o)}this[a+o]=new l(t,a)}}return t.prototype.warm_cache=function(t){for(var e in this)if(this.hasOwnProperty(e)){var i=this[e];i instanceof s&&i.warm_cache(t)}},t.prototype.set_all_indices=function(t){for(var e in this)if(this.hasOwnProperty(e)){var i=this[e];i instanceof s&&(i.all_indices=t)}},t}();i.Visuals=a},function(t,e,i){var o=t(387),s=t(0),_=t(272),j=t(14),n=t(3),p=t(8),r=t(19),a=t(34),N=t(36),m=t(29),y=t(21),b=t(32),x=t(30),d=t(44),l=t(152),F=t(190),g=t(57),h=function(){function t(t){this.document=t,this.session=null,this.subscribed_models=new m.Set}return t.prototype.send_event=function(t){null!=this.session&&this.session.send_event(t)},t.prototype.trigger=function(t){for(var e=0,i=this.subscribed_models.values;e<i.length;e++){var n=i[e];if(null==t.model_id||t.model_id===n){var r=this.document._all_models[n];null!=r&&r._process_event(t)}}},t}();i.EventManager=h;var c=function(t){this.document=t},u=function(a){function t(t,e,i,n,r,o){var s=a.call(this,t)||this;return s.model=e,s.attr=i,s.old=n,s.new_=r,s.setter_id=o,s}return o.__extends(t,a),t.prototype.json=function(t){if(\"id\"===this.attr)throw new Error(\"'id' field should never change, whatever code just set it is wrong\");var e=this.new_,i=p.HasProps._value_to_json(this.attr,e,this.model),n={};for(var r in p.HasProps._value_record_references(e,n,!0),this.model.id in n&&this.model!==e&&delete n[this.model.id],n)t[r]=n[r];return{kind:\"ModelChanged\",model:this.model.ref(),attr:this.attr,new:i}},t}(i.DocumentChangedEvent=c);i.ModelChangedEvent=u;var f=function(r){function t(t,e,i){var n=r.call(this,t)||this;return n.title=e,n.setter_id=i,n}return o.__extends(t,r),t.prototype.json=function(t){return{kind:\"TitleChanged\",title:this.title}},t}(c);i.TitleChangedEvent=f;var v=function(r){function t(t,e,i){var n=r.call(this,t)||this;return n.model=e,n.setter_id=i,n}return o.__extends(t,r),t.prototype.json=function(t){return p.HasProps._value_record_references(this.model,t,!0),{kind:\"RootAdded\",model:this.model.ref()}},t}(c);i.RootAddedEvent=v;var w=function(r){function t(t,e,i){var n=r.call(this,t)||this;return n.model=e,n.setter_id=i,n}return o.__extends(t,r),t.prototype.json=function(t){return{kind:\"RootRemoved\",model:this.model.ref()}},t}(c);i.RootRemovedEvent=w,i.documents=[],i.DEFAULT_TITLE=\"Bokeh Application\";var k=function(){function P(){i.documents.push(this),this._init_timestamp=Date.now(),this._title=i.DEFAULT_TITLE,this._roots=[],this._all_models={},this._all_models_by_name=new m.MultiDict,this._all_models_freeze_count=0,this._callbacks=[],this.event_manager=new h(this),this.idle=new r.Signal0(this,\"idle\"),this._idle_roots=new WeakMap,this._interactive_timestamp=null,this._interactive_plot=null}return Object.defineProperty(P.prototype,\"layoutables\",{get:function(){return this._roots.filter(function(t){return t instanceof l.LayoutDOM})},enumerable:!0,configurable:!0}),Object.defineProperty(P.prototype,\"is_idle\",{get:function(){for(var t=0,e=this.layoutables;t<e.length;t++){var i=e[t];if(!this._idle_roots.has(i))return!1}return!0},enumerable:!0,configurable:!0}),P.prototype.notify_idle=function(t){this._idle_roots.set(t,!0),this.is_idle&&(j.logger.info(\"document idle at \"+(Date.now()-this._init_timestamp)+\" ms\"),this.idle.emit())},P.prototype.clear=function(){this._push_all_models_freeze();try{for(;0<this._roots.length;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}},P.prototype.interactive_start=function(t){null==this._interactive_plot&&(this._interactive_plot=t,this._interactive_plot.trigger_event(new n.LODStart({}))),this._interactive_timestamp=Date.now()},P.prototype.interactive_stop=function(t){null!=this._interactive_plot&&this._interactive_plot.id===t.id&&this._interactive_plot.trigger_event(new n.LODEnd({})),this._interactive_plot=null,this._interactive_timestamp=null},P.prototype.interactive_duration=function(){return null==this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp},P.prototype.destructively_move=function(t){if(t===this)throw new Error(\"Attempted to overwrite a document with itself\");t.clear();var e=y.copy(this._roots);this.clear();for(var i=0,n=e;i<n.length;i++){var r=n[i];if(null!=r.document)throw new Error(\"Somehow we didn't detach \"+r)}if(0!==Object.keys(this._all_models).length)throw new Error(\"this._all_models still had stuff in it: \"+this._all_models);for(var o=0,s=e;o<s.length;o++){var r=s[o];t.add_root(r)}t.set_title(this._title)},P.prototype._push_all_models_freeze=function(){this._all_models_freeze_count+=1},P.prototype._pop_all_models_freeze=function(){this._all_models_freeze_count-=1,0===this._all_models_freeze_count&&this._recompute_all_models()},P.prototype._invalidate_all_models=function(){j.logger.debug(\"invalidating document models\"),0===this._all_models_freeze_count&&this._recompute_all_models()},P.prototype._recompute_all_models=function(){for(var t=new m.Set,e=0,i=this._roots;e<i.length;e++){var n=i[e];t=t.union(n.references())}for(var r=new m.Set(b.values(this._all_models)),o=r.diff(t),s=t.diff(r),a={},l=0,h=t.values;l<h.length;l++){var c=h[l];a[c.id]=c}for(var u=0,_=o.values;u<_.length;u++){var p=_[u];p.detach_document(),p instanceof g.Model&&null!=p.name&&this._all_models_by_name.remove_value(p.name,p)}for(var d=0,f=s.values;d<f.length;d++){var v=f[d];v.attach_document(this),v instanceof g.Model&&null!=v.name&&this._all_models_by_name.add_value(v.name,v)}this._all_models=a},P.prototype.roots=function(){return this._roots},P.prototype.add_root=function(t,e){if(j.logger.debug(\"Adding root: \"+t),!y.includes(this._roots,t)){this._push_all_models_freeze();try{this._roots.push(t)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new v(this,t,e))}},P.prototype.remove_root=function(t,e){var i=this._roots.indexOf(t);if(!(i<0)){this._push_all_models_freeze();try{this._roots.splice(i,1)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new w(this,t,e))}},P.prototype.title=function(){return this._title},P.prototype.set_title=function(t,e){t!==this._title&&(this._title=t,this._trigger_on_change(new f(this,t,e)))},P.prototype.get_model_by_id=function(t){return t in this._all_models?this._all_models[t]:null},P.prototype.get_model_by_name=function(t){return this._all_models_by_name.get_one(t,\"Multiple models are named '\"+t+\"'\")},P.prototype.on_change=function(t){y.includes(this._callbacks,t)||this._callbacks.push(t)},P.prototype.remove_on_change=function(t){var e=this._callbacks.indexOf(t);0<=e&&this._callbacks.splice(e,1)},P.prototype._trigger_on_change=function(t){for(var e=0,i=this._callbacks;e<i.length;e++){var n=i[e];n(t)}},P.prototype._notify_change=function(t,e,i,n,r){\"name\"===e&&(this._all_models_by_name.remove_value(i,t),null!=n&&this._all_models_by_name.add_value(n,t));var o=null!=r?r.setter_id:void 0;this._trigger_on_change(new u(this,t,e,i,n,o))},P._references_json=function(t,e){void 0===e&&(e=!0);for(var i=[],n=0,r=t;n<r.length;n++){var o=r[n],s=o.ref();s.attributes=o.attributes_as_json(e),delete s.attributes.id,i.push(s)}return i},P._instantiate_object=function(t,e,i){var n=o.__assign({},i,{id:t,__deferred__:!0}),r=s.Models(e);return new r(n)},P._instantiate_references_json=function(t,e){for(var i={},n=0,r=t;n<r.length;n++){var o=r[n],s=o.id,a=o.type,l=o.attributes||{},h=void 0;s in e?h=e[s]:(h=P._instantiate_object(s,a,l),null!=o.subtype&&h.set_subtype(o.subtype)),i[h.id]=h}return i},P._resolve_refs=function(t,e,i){function o(t){if(a.is_ref(t)){if(t.id in e)return e[t.id];if(t.id in i)return i[t.id];throw new Error(\"reference \"+JSON.stringify(t)+\" isn't known (not in Document?)\")}return d.isArray(t)?function(t){for(var e=[],i=0,n=t;i<n.length;i++){var r=n[i];e.push(o(r))}return e}(t):d.isObject(t)?function(t){var e={};for(var i in t){var n=t[i];e[i]=o(n)}return e}(t):t}return o(t)},P._initialize_references_json=function(t,e,i){for(var n={},r=0,o=t;r<o.length;r++){var s=o[r],a=s.id,l=s.attributes,h=!(a in e),c=h?i[a]:e[a],u=P._resolve_refs(l,e,i);n[c.id]=[c,u,h]}function _(h,c){var u={};function _(t){if(t instanceof p.HasProps){if(!(t.id in u)&&t.id in h){u[t.id]=!0;var e=h[t.id],i=e[1],n=e[2];for(var r in i){var o=i[r];_(o)}c(t,i,n)}}else if(d.isArray(t))for(var s=0,a=t;s<a.length;s++){var o=a[s];_(o)}else if(d.isObject(t))for(var l in t){var o=t[l];_(o)}}for(var t in h){var e=h[t],i=e[0];_(i)}}_(n,function(t,e,i){i&&t.setv(e,{silent:!0})}),_(n,function(t,e,i){i&&t.finalize()})},P._event_for_attribute_change=function(t,e,i,n,r){var o=n.get_model_by_id(t.id);if(o.attribute_is_serializable(e)){var s={kind:\"ModelChanged\",model:{id:t.id,type:t.type},attr:e,new:i};return p.HasProps._json_record_references(n,i,r,!0),s}return null},P._events_to_sync_objects=function(t,e,i,n){for(var r=Object.keys(t.attributes),o=Object.keys(e.attributes),s=y.difference(r,o),a=y.difference(o,r),l=y.intersection(r,o),h=[],c=0,u=s;c<u.length;c++){var _=u[c];j.logger.warn(\"Server sent key \"+_+\" but we don't seem to have it in our JSON\")}for(var p=0,d=a;p<d.length;p++){var _=d[p],f=e.attributes[_];h.push(P._event_for_attribute_change(t,_,f,i,n))}for(var v=0,m=l;v<m.length;v++){var _=m[v],g=t.attributes[_],f=e.attributes[_];null==g&&null==f||(null==g||null==f?h.push(P._event_for_attribute_change(t,_,f,i,n)):x.isEqual(g,f)||h.push(P._event_for_attribute_change(t,_,f,i,n)))}return h.filter(function(t){return null!=t})},P._compute_patch_since_json=function(t,e){var i=e.to_json(!1);function n(t){for(var e={},i=0,n=t.roots.references;i<n.length;i++){var r=n[i];e[r.id]=r}return e}for(var r=n(t),o={},s=[],a=0,l=t.roots.root_ids;a<l.length;a++){var h=l[a];o[h]=r[h],s.push(h)}for(var c=n(i),u={},_=[],p=0,d=i.roots.root_ids;p<d.length;p++){var h=d[p];u[h]=c[h],_.push(h)}if(s.sort(),_.sort(),0<y.difference(s,_).length||0<y.difference(_,s).length)throw new Error(\"Not implemented: computing add/remove of document roots\");var f={},v=[];for(var m in e._all_models)if(m in r){var g=P._events_to_sync_objects(r[m],c[m],e,f);v=v.concat(g)}return{references:P._references_json(b.values(f),!1),events:v}},P.prototype.to_json_string=function(t){return void 0===t&&(t=!0),JSON.stringify(this.to_json(t))},P.prototype.to_json=function(t){void 0===t&&(t=!0);var e=this._roots.map(function(t){return t.id}),i=b.values(this._all_models);return{title:this._title,roots:{root_ids:e,references:P._references_json(i,t)}}},P.from_json_string=function(t){var e=JSON.parse(t);return P.from_json(e)},P.from_json=function(t){j.logger.debug(\"Creating Document from JSON\");var e=t.version,i=-1!==e.indexOf(\"+\")||-1!==e.indexOf(\"-\"),n=\"Library versions: JS (\"+_.version+\") / Python (\"+e+\")\";i||_.version===e?j.logger.debug(n):(j.logger.warn(\"JS/Python version mismatch\"),j.logger.warn(n));var r=t.roots,o=r.root_ids,s=r.references,a=P._instantiate_references_json(s,{});P._initialize_references_json(s,{},a);for(var l=new P,h=0,c=o;h<c.length;h++){var u=c[h];l.add_root(a[u])}return l.set_title(t.title),l},P.prototype.replace_with_json=function(t){var e=P.from_json(t);e.destructively_move(this)},P.prototype.create_json_patch_string=function(t){return JSON.stringify(this.create_json_patch(t))},P.prototype.create_json_patch=function(t){for(var e={},i=[],n=0,r=t;n<r.length;n++){var o=r[n];if(o.document!==this)throw j.logger.warn(\"Cannot create a patch using events from a different document, event had \",o.document,\" we are \",this),new Error(\"Cannot create a patch using events from a different document\");i.push(o.json(e))}return{events:i,references:P._references_json(b.values(e))}},P.prototype.apply_json_patch=function(t,e,i){for(var n,r=t.references,o=t.events,s=P._instantiate_references_json(r,this._all_models),a=0,l=o;a<l.length;a++){var h=l[a];switch(h.kind){case\"RootAdded\":case\"RootRemoved\":case\"ModelChanged\":var c=h.model.id;if(c in this._all_models)s[c]=this._all_models[c];else if(!(c in s))throw j.logger.warn(\"Got an event for unknown model \",h.model),new Error(\"event model wasn't known\")}}var u={},_={};for(var p in s){var d=s[p];p in this._all_models?u[p]=d:_[p]=d}P._initialize_references_json(r,u,_);for(var f=0,v=o;f<v.length;f++){var h=v[f];switch(h.kind){case\"ModelChanged\":var m=h.model.id;if(!(m in this._all_models))throw new Error(\"Cannot apply patch to \"+m+\" which is not in the document\");var g=this._all_models[m],y=h.attr,b=h.model.type;if(\"data\"===y&&\"ColumnDataSource\"===b){var x=N.decode_column_data(h.new,e),w=x[0],k=x[1];g.setv({_shapes:k,data:w},{setter_id:i})}else{var d=P._resolve_refs(h.new,u,_);g.setv(((n={})[y]=d,n),{setter_id:i})}break;case\"ColumnDataChanged\":var S=h.column_source.id;if(!(S in this._all_models))throw new Error(\"Cannot stream to \"+S+\" which is not in the document\");var T=this._all_models[S],C=N.decode_column_data(h.new,e),w=C[0],k=C[1];if(null!=h.cols){for(var A in T.data)A in w||(w[A]=T.data[A]);for(var A in T._shapes)A in k||(k[A]=T._shapes[A])}T.setv({_shapes:k,data:w},{setter_id:i,check_eq:!1});break;case\"ColumnsStreamed\":var S=h.column_source.id;if(!(S in this._all_models))throw new Error(\"Cannot stream to \"+S+\" which is not in the document\");var T=this._all_models[S];if(!(T instanceof F.ColumnDataSource))throw new Error(\"Cannot stream to non-ColumnDataSource\");var w=h.data,E=h.rollover;T.stream(w,E);break;case\"ColumnsPatched\":var S=h.column_source.id;if(!(S in this._all_models))throw new Error(\"Cannot patch \"+S+\" which is not in the document\");var T=this._all_models[S];if(!(T instanceof F.ColumnDataSource))throw new Error(\"Cannot patch non-ColumnDataSource\");var M=h.patches;T.patch(M);break;case\"RootAdded\":var O=h.model.id,z=s[O];this.add_root(z,i);break;case\"RootRemoved\":var O=h.model.id,z=s[O];this.remove_root(z,i);break;case\"TitleChanged\":this.set_title(h.title,i);break;default:throw new Error(\"Unknown patch event \"+JSON.stringify(h))}}},P}();i.Document=k},function(t,e,n){var r=t(5);function o(t){var e=document.getElementById(t);if(null==e)throw new Error(\"Error rendering Bokeh model: could not find #\"+t+\" HTML tag\");if(!document.body.contains(e))throw new Error(\"Error rendering Bokeh model: element #\"+t+\" must be under <body>\");if(\"SCRIPT\"==e.tagName){var i=r.div({class:n.BOKEH_ROOT});r.replaceWith(e,i),e=i}return e}n.BOKEH_ROOT=\"bk-root\",n.inject_css=function(t){var e=r.link({href:t,rel:\"stylesheet\",type:\"text/css\"});document.body.appendChild(e)},n.inject_raw_css=function(t){var e=r.style({},t);document.body.appendChild(e)},n._resolve_element=function(t){var e=t.elementid;return null!=e?o(e):document.body},n._resolve_root_elements=function(t){var e={};if(null!=t.roots)for(var i in t.roots)e[i]=o(t.roots[i]);return e}},function(t,e,i){var d=t(50),f=t(14),r=t(25),v=t(38),m=t(44),g=t(55),y=t(54),b=t(51),n=t(55);i.add_document_standalone=n.add_document_standalone;var o=t(54);i.add_document_from_session=o.add_document_from_session;var s=t(53);i.embed_items_notebook=s.embed_items_notebook;var a=t(51);i.BOKEH_ROOT=a.BOKEH_ROOT,i.inject_css=a.inject_css,i.inject_raw_css=a.inject_raw_css,i.embed_items=function(t,e,i,n){r.defer(function(){return function(t,e,i,n){m.isString(t)&&(t=JSON.parse(v.unescape(t)));var r={};for(var o in t){var s=t[o];r[o]=d.Document.from_json(s)}for(var a=0,l=e;a<l.length;a++){var h=l[a],c=b._resolve_element(h),u=b._resolve_root_elements(h);if(null!=h.docid)g.add_document_standalone(r[h.docid],c,u,h.use_for_title);else{if(null==h.sessionid)throw new Error(\"Error rendering Bokeh items: either 'docid' or 'sessionid' was expected.\");var _=y._get_ws_url(i,n);f.logger.debug(\"embed: computed ws url: \"+_);var p=y.add_document_from_session(_,h.sessionid,c,u,h.use_for_title);p.then(function(){console.log(\"Bokeh items were rendered successfully\")},function(t){console.log(\"Error rendering Bokeh items:\",t)})}}}(t,e,i,n)})}},function(t,e,r){var l=t(50),o=t(270),s=t(14),h=t(32),c=t(55),u=t(51);function a(t,e){0<e.buffers.length?t.consume(e.buffers[0].buffer):t.consume(e.content.data);var i=t.message;null!=i&&this.apply_json_patch(i.content,i.buffers)}function _(i,n){if(\"undefined\"!=typeof Jupyter&&null!=Jupyter.notebook.kernel){s.logger.info(\"Registering Jupyter comms for target \"+i);var t=Jupyter.notebook.kernel.comm_manager;try{t.register_target(i,function(t){s.logger.info(\"Registering Jupyter comms for target \"+i);var e=new o.Receiver;t.on_msg(a.bind(n,e))})}catch(t){s.logger.warn(\"Jupyter comms failed to register. push_notebook() will not function. (exception reported: \"+t+\")\")}}else if(n.roots()[0].id in r.kernels){s.logger.info(\"Registering JupyterLab comms for target \"+i);var e=r.kernels[n.roots()[0].id];try{e.registerCommTarget(i,function(t){s.logger.info(\"Registering JupyterLab comms for target \"+i);var e=new o.Receiver;t.onMsg=a.bind(n,e)})}catch(t){s.logger.warn(\"Jupyter comms failed to register. push_notebook() will not function. (exception reported: \"+t+\")\")}}else console.warn(\"Jupyter notebooks comms not available. push_notebook() will not function. If running JupyterLab ensure the latest jupyterlab_bokeh extension is installed. In an exported notebook this warning is expected.\")}r.kernels={},r.embed_items_notebook=function(t,e){if(1!=h.size(t))throw new Error(\"embed_items_notebook expects exactly one document in docs_json\");for(var i=l.Document.from_json(h.values(t)[0]),n=0,r=e;n<r.length;n++){var o=r[n];null!=o.notebook_comms_target&&_(o.notebook_comms_target,i);var s=u._resolve_element(o),a=u._resolve_root_elements(o);c.add_document_standalone(i,s,a)}}},function(t,e,i){var s=t(1),a=t(14),l=t(55);i._get_ws_url=function(t,e){var i,n=\"ws:\";return\"https:\"==window.location.protocol&&(n=\"wss:\"),null!=e?(i=document.createElement(\"a\")).href=e:i=window.location,null!=t?\"/\"==t&&(t=\"\"):t=i.pathname.replace(/\\/+$/,\"\"),n+\"//\"+i.host+t+\"/ws\"};var h={};i.add_document_from_session=function(t,e,i,n,r){void 0===n&&(n={}),void 0===r&&(r=!1);var o=window.location.search.substr(1);return function(t,e,i){t in h||(h[t]={});var n=h[t];return e in n||(n[e]=s.pull_session(t,e,i)),n[e]}(t,e,o).then(function(t){return l.add_document_standalone(t.document,i,n,r)},function(t){throw a.logger.error(\"Failed to load Bokeh session \"+e+\": \"+t),t})}},function(t,e,i){var h=t(50),c=t(5),u=t(0),_=t(51);i.add_document_standalone=function(t,o,s,e){void 0===s&&(s={}),void 0===e&&(e=!1);var a={};function i(t){var e;t.id in s?e=s[t.id]:o.classList.contains(_.BOKEH_ROOT)?e=o:(e=c.div({class:_.BOKEH_ROOT}),o.appendChild(e));var i,n,r=(n=new(i=t).default_view({model:i,parent:null}),u.index[i.id]=n);r.renderTo(e),a[t.id]=r}for(var n=0,r=t.roots();n<r.length;n++){var l=r[n];i(l)}return e&&(window.document.title=t.title()),t.on_change(function(t){t instanceof h.RootAddedEvent?i(t.model):t instanceof h.RootRemovedEvent?function(t){var e=t.id;if(e in a){var i=a[e];i.remove(),delete a[e],delete u.index[e]}}(t.model):e&&t instanceof h.TitleChangedEvent&&(window.document.title=t.title)}),a}},function(t,e,i){t(267);var n=t(272);i.version=n.version;var r=t(52);i.embed=r;var o=t(268);i.protocol=o;var s=t(14);i.logger=s.logger,i.set_log_level=s.set_log_level;var a=t(18);i.settings=a.settings;var l=t(0);i.Models=l.Models,i.index=l.index;var h=t(50);i.documents=h.documents;var c=t(271);i.safely=c.safely},function(t,e,i){var n=t(387),r=t(8),o=t(15),s=t(44),a=t(32),l=t(14),h=function(_){function i(t){return _.call(this,t)||this}return n.__extends(i,_),i.initClass=function(){this.prototype.type=\"Model\",this.define({tags:[o.Array,[]],name:[o.String],js_property_callbacks:[o.Any,{}],js_event_callbacks:[o.Any,{}],subscribed_events:[o.Array,[]]})},i.prototype.connect_signals=function(){var i=this;for(var t in _.prototype.connect_signals.call(this),this.js_property_callbacks)for(var e=this.js_property_callbacks[t],n=t.split(\":\"),r=n[0],o=n[1],s=void 0===o?null:o,a=function(t){var e=null!=s?l.properties[s][r]:l[r];l.connect(e,function(){return t.execute(i,{})})},l=this,h=0,c=e;h<c.length;h++){var u=c[h];a(u)}this.connect(this.properties.js_event_callbacks.change,function(){return i._update_event_callbacks}),this.connect(this.properties.subscribed_events.change,function(){return i._update_event_callbacks})},i.prototype._process_event=function(e){if(e.is_applicable_to(this)){e=e._customize_event(this);for(var t=0,i=this.js_event_callbacks[e.event_name]||[];t<i.length;t++){var n=i[t];n.execute(e,{})}null!=this.document&&this.subscribed_events.some(function(t){return t==e.event_name})&&this.document.event_manager.send_event(e)}},i.prototype.trigger_event=function(t){null!=this.document&&this.document.event_manager.trigger(t.set_model_id(this.id))},i.prototype._update_event_callbacks=function(){null!=this.document?this.document.event_manager.subscribed_models.push(this.id):l.logger.warn(\"WARNING: Document not defined for updating event callbacks\")},i.prototype._doc_attached=function(){a.isEmpty(this.js_event_callbacks)&&a.isEmpty(this.subscribed_events)||this._update_event_callbacks()},i.prototype.select=function(e){if(s.isString(e))return this.references().filter(function(t){return t instanceof i&&t.name===e});if(e.prototype instanceof r.HasProps)return this.references().filter(function(t){return t instanceof e});throw new Error(\"invalid selector\")},i.prototype.select_one=function(t){var e=this.select(t);switch(e.length){case 0:return null;case 1:return e[0];default:throw new Error(\"found more than one object matching given selector\")}},i}(r.HasProps);(i.Model=h).initClass()},function(t,e,i){var n=t(387),r=t(12),o=t(15),s=t(33),a=t(32),l=t(179),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._get_size=function(){throw new Error(\"not implemented\")},e.prototype.get_size=function(){return this.model.visible?Math.round(this._get_size()):0},e.prototype.set_data=function(t){var e,i,n=this.model.materialize_dataspecs(t);if(a.extend(this,n),this.plot_model.use_map){var r=this;null!=r._x&&(e=s.project_xy(r._x,r._y),r._x=e[0],r._y=e[1]),null!=r._xs&&(i=s.project_xsys(r._xs,r._ys),r._xs=i[0],r._ys=i[1])}},e}(l.RendererView);i.AnnotationView=h;var c=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Annotation\",this.define({plot:[o.Instance]}),this.override({level:\"annotation\"})},t.prototype.add_panel=function(t){if(null==this.panel||t!==this.panel.side){var e=new r.SidePanel({side:t});e.attach_document(this.document),this.set_panel(e)}},t.prototype.set_panel=function(t){this.panel=t,this.level=\"overlay\"},t}(l.Renderer);(i.Annotation=c).initClass()},function(t,e,i){var n=t(387),r=t(58),o=t(60),s=t(190),a=t(15),l=t(31),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),null==this.model.source&&(this.model.source=new s.ColumnDataSource),this.set_data(this.model.source)},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.plot_view.request_render()}),this.connect(this.model.source.streaming,function(){return t.set_data(t.model.source)}),this.connect(this.model.source.patching,function(){return t.set_data(t.model.source)}),this.connect(this.model.source.change,function(){return t.set_data(t.model.source)})},t.prototype.set_data=function(t){e.prototype.set_data.call(this,t),this.visuals.warm_cache(t),this.plot_view.request_render()},t.prototype._map_data=function(){var t,e,i,n,r=this.plot_view.frame;return\"data\"==this.model.start_units?(t=r.xscales[this.model.x_range_name].v_compute(this._x_start),e=r.yscales[this.model.y_range_name].v_compute(this._y_start)):(t=r.xview.v_compute(this._x_start),e=r.yview.v_compute(this._y_start)),\"data\"==this.model.end_units?(i=r.xscales[this.model.x_range_name].v_compute(this._x_end),n=r.yscales[this.model.y_range_name].v_compute(this._y_end)):(i=r.xview.v_compute(this._x_end),n=r.yview.v_compute(this._y_end)),[[t,e],[i,n]]},t.prototype.render=function(){if(this.model.visible){var t=this.plot_view.canvas_view.ctx;t.save();var e=this._map_data(),i=e[0],n=e[1];null!=this.model.end&&this._arrow_head(t,\"render\",this.model.end,i,n),null!=this.model.start&&this._arrow_head(t,\"render\",this.model.start,n,i),t.beginPath();var r=this.plot_model.canvas.bbox.rect,o=r.x,s=r.y,a=r.width,l=r.height;t.rect(o,s,a,l),null!=this.model.end&&this._arrow_head(t,\"clip\",this.model.end,i,n),null!=this.model.start&&this._arrow_head(t,\"clip\",this.model.start,n,i),t.closePath(),t.clip(),this._arrow_body(t,i,n),t.restore()}},t.prototype._arrow_head=function(t,e,i,n,r){for(var o=0,s=this._x_start.length;o<s;o++){var a=Math.PI/2+l.atan2([n[0][o],n[1][o]],[r[0][o],r[1][o]]);t.save(),t.translate(r[0][o],r[1][o]),t.rotate(a),\"render\"==e?i.render(t,o):\"clip\"==e&&i.clip(t,o),t.restore()}},t.prototype._arrow_body=function(t,e,i){if(this.visuals.line.doit)for(var n=0,r=this._x_start.length;n<r;n++)this.visuals.line.set_vectorize(t,n),t.beginPath(),t.moveTo(e[0][n],e[1][n]),t.lineTo(i[0][n],i[1][n]),t.stroke()},t}(r.AnnotationView);i.ArrowView=h;var c=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Arrow\",this.prototype.default_view=h,this.mixins([\"line\"]),this.define({x_start:[a.NumberSpec],y_start:[a.NumberSpec],start_units:[a.String,\"data\"],start:[a.Instance,null],x_end:[a.NumberSpec],y_end:[a.NumberSpec],end_units:[a.String,\"data\"],end:[a.Instance,function(){return new o.OpenHead({})}],source:[a.Instance],x_range_name:[a.String,\"default\"],y_range_name:[a.String,\"default\"]})},t}(r.Annotation);(i.Arrow=c).initClass()},function(t,e,i){var n=t(387),r=t(58),o=t(49),s=t(15),a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ArrowHead\",this.define({size:[s.Number,25]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.visuals=new o.Visuals(this)},t}(r.Annotation);(i.ArrowHead=a).initClass();var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"OpenHead\",this.mixins([\"line\"])},t.prototype.clip=function(t,e){this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(0,0),t.lineTo(.5*this.size,this.size)},t.prototype.render=function(t,e){this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.stroke())},t}(a);(i.OpenHead=l).initClass();var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"NormalHead\",this.mixins([\"line\",\"fill\"]),this.override({fill_color:\"black\"})},t.prototype.clip=function(t,e){this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(.5*this.size,this.size)},t.prototype.render=function(t,e){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._normal(t,e),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,e),this._normal(t,e),t.stroke())},t.prototype._normal=function(t,e){t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.closePath()},t}(a);(i.NormalHead=h).initClass();var c=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"VeeHead\",this.mixins([\"line\",\"fill\"]),this.override({fill_color:\"black\"})},t.prototype.clip=function(t,e){this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(0,.5*this.size),t.lineTo(.5*this.size,this.size)},t.prototype.render=function(t,e){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._vee(t,e),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,e),this._vee(t,e),t.stroke())},t.prototype._vee=function(t,e){t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.lineTo(0,.5*this.size),t.closePath()},t}(a);(i.VeeHead=c).initClass();var u=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"TeeHead\",this.mixins([\"line\"])},t.prototype.render=function(t,e){this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.size,0),t.lineTo(-.5*this.size,0),t.stroke())},t.prototype.clip=function(t,e){},t}(a);(i.TeeHead=u).initClass()},function(t,e,i){var n=t(387),r=t(58),o=t(190),s=t(15),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.set_data(this.model.source)},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return t.set_data(t.model.source)}),this.connect(this.model.source.patching,function(){return t.set_data(t.model.source)}),this.connect(this.model.source.change,function(){return t.set_data(t.model.source)})},t.prototype.set_data=function(t){e.prototype.set_data.call(this,t),this.visuals.warm_cache(t),this.plot_view.request_render()},t.prototype._map_data=function(){var t,e,i,n=this.plot_view.frame,r=this.model.dimension,o=n.xscales[this.model.x_range_name],s=n.yscales[this.model.y_range_name],a=\"height\"==r?s:o,l=\"height\"==r?o:s,h=\"height\"==r?n.yview:n.xview,c=\"height\"==r?n.xview:n.yview;t=\"data\"==this.model.lower.units?a.v_compute(this._lower):h.v_compute(this._lower),e=\"data\"==this.model.upper.units?a.v_compute(this._upper):h.v_compute(this._upper),i=\"data\"==this.model.base.units?l.v_compute(this._base):c.v_compute(this._base);var u=\"height\"==r?[1,0]:[0,1],_=u[0],p=u[1],d=[t,i],f=[e,i];this._lower_sx=d[_],this._lower_sy=d[p],this._upper_sx=f[_],this._upper_sy=f[p]},t.prototype.render=function(){if(this.model.visible){this._map_data();var t=this.plot_view.canvas_view.ctx;t.beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]);for(var e=0,i=this._lower_sx.length;e<i;e++)t.lineTo(this._lower_sx[e],this._lower_sy[e]);for(var n=this._upper_sx.length-1,e=n;0<=e;e--)t.lineTo(this._upper_sx[e],this._upper_sy[e]);t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_value(t),t.fill()),t.beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]);for(var e=0,i=this._lower_sx.length;e<i;e++)t.lineTo(this._lower_sx[e],this._lower_sy[e]);this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke()),t.beginPath(),t.moveTo(this._upper_sx[0],this._upper_sy[0]);for(var e=0,i=this._upper_sx.length;e<i;e++)t.lineTo(this._upper_sx[e],this._upper_sy[e]);this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke())}},t}(r.AnnotationView);i.BandView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Band\",this.prototype.default_view=a,this.mixins([\"line\",\"fill\"]),this.define({lower:[s.DistanceSpec],upper:[s.DistanceSpec],base:[s.DistanceSpec],dimension:[s.Dimension,\"height\"],source:[s.Instance,function(){return new o.ColumnDataSource}],x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"]}),this.override({fill_color:\"#fff9ba\",fill_alpha:.4,line_color:\"#cccccc\",line_alpha:.3})},t}(r.Annotation);(i.Band=l).initClass()},function(t,e,i){var n=t(387),r=t(58),o=t(19),l=t(5),s=t(15),a=t(24);i.EDGE_TOLERANCE=2.5;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.plot_view.canvas_overlays.appendChild(this.el),this.el.classList.add(\"bk-shading\"),l.hide(this.el)},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),\"css\"==this.model.render_mode?(this.connect(this.model.change,function(){return t.render()}),this.connect(this.model.data_update,function(){return t.render()})):(this.connect(this.model.change,function(){return t.plot_view.request_render()}),this.connect(this.model.data_update,function(){return t.plot_view.request_render()}))},t.prototype.render=function(){var o=this;if(this.model.visible||\"css\"!=this.model.render_mode||l.hide(this.el),this.model.visible)if(null!=this.model.left||null!=this.model.right||null!=this.model.top||null!=this.model.bottom){var t=this.plot_model.frame,e=t.xscales[this.model.x_range_name],i=t.yscales[this.model.y_range_name],n=function(t,e,i,n,r){return null!=t?o.model.screen?t:\"data\"==e?i.compute(t):n.compute(t):r};this.sleft=n(this.model.left,this.model.left_units,e,t.xview,t._left.value),this.sright=n(this.model.right,this.model.right_units,e,t.xview,t._right.value),this.stop=n(this.model.top,this.model.top_units,i,t.yview,t._top.value),this.sbottom=n(this.model.bottom,this.model.bottom_units,i,t.yview,t._bottom.value);var r=\"css\"==this.model.render_mode?this._css_box.bind(this):this._canvas_box.bind(this);r(this.sleft,this.sright,this.sbottom,this.stop)}else l.hide(this.el)},t.prototype._css_box=function(t,e,i,n){var r=this.model.properties.line_width.value(),o=Math.floor(e-t)-r,s=Math.floor(i-n)-r;this.el.style.left=t+\"px\",this.el.style.width=o+\"px\",this.el.style.top=n+\"px\",this.el.style.height=s+\"px\",this.el.style.borderWidth=r+\"px\",this.el.style.borderColor=this.model.properties.line_color.value(),this.el.style.backgroundColor=this.model.properties.fill_color.value(),this.el.style.opacity=this.model.properties.fill_alpha.value();var a=this.model.properties.line_dash.value().length<2?\"solid\":\"dashed\";this.el.style.borderStyle=a,l.show(this.el)},t.prototype._canvas_box=function(t,e,i,n){var r=this.plot_view.canvas_view.ctx;r.save(),r.beginPath(),r.rect(t,n,e-t,i-n),this.visuals.fill.set_value(r),r.fill(),this.visuals.line.set_value(r),r.stroke(),r.restore()},t.prototype.interactive_bbox=function(){var t=this.model.properties.line_width.value()+i.EDGE_TOLERANCE;return new a.BBox({x0:this.sleft-t,y0:this.stop-t,x1:this.sright+t,y1:this.sbottom+t})},t.prototype.interactive_hit=function(t,e){if(null==this.model.in_cursor)return!1;var i=this.interactive_bbox();return i.contains(t,e)},t.prototype.cursor=function(t,e){return Math.abs(t-this.sleft)<3||Math.abs(t-this.sright)<3?this.model.ew_cursor:Math.abs(e-this.sbottom)<3||Math.abs(e-this.stop)<3?this.model.ns_cursor:t>this.sleft&&t<this.sright&&e>this.stop&&e<this.sbottom?this.model.in_cursor:null},t}(r.AnnotationView);i.BoxAnnotationView=h;var c=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"BoxAnnotation\",this.prototype.default_view=h,this.mixins([\"line\",\"fill\"]),this.define({render_mode:[s.RenderMode,\"canvas\"],x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"],top:[s.Number,null],top_units:[s.SpatialUnits,\"data\"],bottom:[s.Number,null],bottom_units:[s.SpatialUnits,\"data\"],left:[s.Number,null],left_units:[s.SpatialUnits,\"data\"],right:[s.Number,null],right_units:[s.SpatialUnits,\"data\"]}),this.internal({screen:[s.Boolean,!1],ew_cursor:[s.String,null],ns_cursor:[s.String,null],in_cursor:[s.String,null]}),this.override({fill_color:\"#fff9ba\",fill_alpha:.4,line_color:\"#cccccc\",line_alpha:.3})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.data_update=new o.Signal0(this,\"data_update\")},t.prototype.update=function(t){var e=t.left,i=t.right,n=t.top,r=t.bottom;this.setv({left:e,right:i,top:n,bottom:r,screen:!0},{silent:!0}),this.data_update.emit()},t}(r.Annotation);(i.BoxAnnotation=c).initClass()},function(t,e,i){var n=t(387),r=t(58),o=t(197),s=t(102),c=t(160),a=t(182),l=t(183),h=t(174),u=t(15),_=t(41),p=t(21),g=t(22),d=t(32),f=t(44),v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this._set_canvas_image()},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(){return t.plot_view.request_render()}),this.connect(this.model.ticker.change,function(){return t.plot_view.request_render()}),this.connect(this.model.formatter.change,function(){return t.plot_view.request_render()}),null!=this.model.color_mapper&&this.connect(this.model.color_mapper.change,function(){t._set_canvas_image(),t.plot_view.request_render()})},t.prototype._get_size=function(){if(null==this.model.color_mapper)return 0;var t=this.compute_legend_dimensions(),e=this.model.panel.side;switch(e){case\"above\":case\"below\":return t.height;case\"left\":case\"right\":return t.width;default:throw new Error(\"unreachable code\")}},t.prototype._set_canvas_image=function(){var t,e;if(null!=this.model.color_mapper){var i,n,r=this.model.color_mapper.palette;switch(\"vertical\"==this.model.orientation&&(r=p.reversed(r)),this.model.orientation){case\"vertical\":t=[1,r.length],i=t[0],n=t[1];break;case\"horizontal\":e=[r.length,1],i=e[0],n=e[1];break;default:throw new Error(\"unreachable code\")}var o=document.createElement(\"canvas\");o.width=i,o.height=n;var s=o.getContext(\"2d\"),a=s.getImageData(0,0,i,n),l=new c.LinearColorMapper({palette:r}).rgba_mapper,h=l.v_compute(p.range(0,r.length));a.data.set(h),s.putImageData(a,0,0),this.image=o}},t.prototype.compute_legend_dimensions=function(){var t,e,i=this.model._computed_image_dimensions(),n=[i.height,i.width],r=n[0],o=n[1],s=this._get_label_extent(),a=this.model._title_extent(),l=this.model._tick_extent(),h=this.model.padding;switch(this.model.orientation){case\"vertical\":t=r+a+2*h,e=o+l+s+2*h;break;case\"horizontal\":t=r+a+l+s+2*h,e=o+2*h;break;default:throw new Error(\"unreachable code\")}return{width:e,height:t}},t.prototype.compute_legend_location=function(){var t,e,i=this.compute_legend_dimensions(),n=[i.height,i.width],r=n[0],o=n[1],s=this.model.margin,a=null!=this.model.panel?this.model.panel:this.plot_view.frame,l=a.bbox.ranges,h=l[0],c=l[1],u=this.model.location;if(f.isString(u))switch(u){case\"top_left\":t=h.start+s,e=c.start+s;break;case\"top_center\":t=(h.end+h.start)/2-o/2,e=c.start+s;break;case\"top_right\":t=h.end-s-o,e=c.start+s;break;case\"bottom_right\":t=h.end-s-o,e=c.end-s-r;break;case\"bottom_center\":t=(h.end+h.start)/2-o/2,e=c.end-s-r;break;case\"bottom_left\":t=h.start+s,e=c.end-s-r;break;case\"center_left\":t=h.start+s,e=(c.end+c.start)/2-r/2;break;case\"center\":t=(h.end+h.start)/2-o/2,e=(c.end+c.start)/2-r/2;break;case\"center_right\":t=h.end-s-o,e=(c.end+c.start)/2-r/2;break;default:throw new Error(\"unreachable code\")}else{if(!f.isArray(u)||2!=u.length)throw new Error(\"unreachable code\");var _=u[0],p=u[1];t=a.xview.compute(_),e=a.yview.compute(p)-r}return{sx:t,sy:e}},t.prototype.render=function(){if(this.model.visible&&null!=this.model.color_mapper){var t=this.plot_view.canvas_view.ctx;t.save();var e=this.compute_legend_location(),i=e.sx,n=e.sy;t.translate(i,n),this._draw_bbox(t);var r=this._get_image_offset();if(t.translate(r.x,r.y),this._draw_image(t),null!=this.model.color_mapper.low&&null!=this.model.color_mapper.high){var o=this.model.tick_info();this._draw_major_ticks(t,o),this._draw_minor_ticks(t,o),this._draw_major_labels(t,o)}this.model.title&&this._draw_title(t),t.restore()}},t.prototype._draw_bbox=function(t){var e=this.compute_legend_dimensions();t.save(),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fillRect(0,0,e.width,e.height)),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.strokeRect(0,0,e.width,e.height)),t.restore()},t.prototype._draw_image=function(t){var e=this.model._computed_image_dimensions();t.save(),t.setImageSmoothingEnabled(!1),t.globalAlpha=this.model.scale_alpha,t.drawImage(this.image,0,0,e.width,e.height),this.visuals.bar_line.doit&&(this.visuals.bar_line.set_value(t),t.strokeRect(0,0,e.width,e.height)),t.restore()},t.prototype._draw_major_ticks=function(t,e){if(this.visuals.major_tick_line.doit){var i=this.model._normals(),n=i[0],r=i[1],o=this.model._computed_image_dimensions(),s=[o.width*n,o.height*r],a=s[0],l=s[1],h=e.coords.major,c=h[0],u=h[1],_=this.model.major_tick_in,p=this.model.major_tick_out;t.save(),t.translate(a,l),this.visuals.major_tick_line.set_value(t);for(var d=0,f=c.length;d<f;d++)t.beginPath(),t.moveTo(Math.round(c[d]+n*p),Math.round(u[d]+r*p)),t.lineTo(Math.round(c[d]-n*_),Math.round(u[d]-r*_)),t.stroke();t.restore()}},t.prototype._draw_minor_ticks=function(t,e){if(this.visuals.minor_tick_line.doit){var i=this.model._normals(),n=i[0],r=i[1],o=this.model._computed_image_dimensions(),s=[o.width*n,o.height*r],a=s[0],l=s[1],h=e.coords.minor,c=h[0],u=h[1],_=this.model.minor_tick_in,p=this.model.minor_tick_out;t.save(),t.translate(a,l),this.visuals.minor_tick_line.set_value(t);for(var d=0,f=c.length;d<f;d++)t.beginPath(),t.moveTo(Math.round(c[d]+n*p),Math.round(u[d]+r*p)),t.lineTo(Math.round(c[d]-n*_),Math.round(u[d]-r*_)),t.stroke();t.restore()}},t.prototype._draw_major_labels=function(t,e){if(this.visuals.major_label_text.doit){var i=this.model._normals(),n=i[0],r=i[1],o=this.model._computed_image_dimensions(),s=[o.width*n,o.height*r],a=s[0],l=s[1],h=this.model.label_standoff+this.model._tick_extent(),c=[h*n,h*r],u=c[0],_=c[1],p=e.coords.major,d=p[0],f=p[1],v=e.labels.major;this.visuals.major_label_text.set_value(t),t.save(),t.translate(a+u,l+_);for(var m=0,g=d.length;m<g;m++)t.fillText(v[m],Math.round(d[m]+n*this.model.label_standoff),Math.round(f[m]+r*this.model.label_standoff));t.restore()}},t.prototype._draw_title=function(t){this.visuals.title_text.doit&&(t.save(),this.visuals.title_text.set_value(t),t.fillText(this.model.title,0,-this.model.title_standoff),t.restore())},t.prototype._get_label_extent=function(){var t,e=this.model.tick_info().labels.major;if(null==this.model.color_mapper.low||null==this.model.color_mapper.high||d.isEmpty(e))t=0;else{var i=this.plot_view.canvas_view.ctx;switch(i.save(),this.visuals.major_label_text.set_value(i),this.model.orientation){case\"vertical\":t=p.max(e.map(function(t){return i.measureText(t.toString()).width}));break;case\"horizontal\":t=_.get_text_height(this.visuals.major_label_text.font_value()).height;break;default:throw new Error(\"unreachable code\")}t+=this.model.label_standoff,i.restore()}return t},t.prototype._get_image_offset=function(){var t=this.model.padding,e=this.model.padding+this.model._title_extent();return{x:t,y:e}},t}(r.AnnotationView);i.ColorBarView=v;var m=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ColorBar\",this.prototype.default_view=v,this.mixins([\"text:major_label_\",\"text:title_\",\"line:major_tick_\",\"line:minor_tick_\",\"line:border_\",\"line:bar_\",\"fill:background_\"]),this.define({location:[u.Any,\"top_right\"],orientation:[u.Orientation,\"vertical\"],title:[u.String],title_standoff:[u.Number,2],width:[u.Any,\"auto\"],height:[u.Any,\"auto\"],scale_alpha:[u.Number,1],ticker:[u.Instance,function(){return new o.BasicTicker}],formatter:[u.Instance,function(){return new s.BasicTickFormatter}],major_label_overrides:[u.Any,{}],color_mapper:[u.Instance],label_standoff:[u.Number,5],margin:[u.Number,30],padding:[u.Number,10],major_tick_in:[u.Number,5],major_tick_out:[u.Number,0],minor_tick_in:[u.Number,0],minor_tick_out:[u.Number,0]}),this.override({background_fill_color:\"#ffffff\",background_fill_alpha:.95,bar_line_color:null,border_line_color:null,major_label_text_align:\"center\",major_label_text_baseline:\"middle\",major_label_text_font_size:\"8pt\",major_tick_line_color:\"#ffffff\",minor_tick_line_color:null,title_text_font_size:\"10pt\",title_text_font_style:\"italic\"})},t.prototype._normals=function(){return\"vertical\"==this.orientation?[1,0]:[0,1]},t.prototype._title_extent=function(){var t=this.title_text_font+\" \"+this.title_text_font_size+\" \"+this.title_text_font_style,e=this.title?_.get_text_height(t).height+this.title_standoff:0;return e},t.prototype._tick_extent=function(){return null!=this.color_mapper.low&&null!=this.color_mapper.high?p.max([this.major_tick_out,this.minor_tick_out]):0},t.prototype._computed_image_dimensions=function(){var t,e,i=this.plot.plot_canvas.frame._height.value,n=this.plot.plot_canvas.frame._width.value,r=this._title_extent();switch(this.orientation){case\"vertical\":\"auto\"==this.height?null!=this.panel?t=i-2*this.padding-r:(t=p.max([25*this.color_mapper.palette.length,.3*i]),t=p.min([t,.8*i-2*this.padding-r])):t=this.height,e=\"auto\"==this.width?25:this.width;break;case\"horizontal\":t=\"auto\"==this.height?25:this.height,\"auto\"==this.width?null!=this.panel?e=n-2*this.padding:(e=p.max([25*this.color_mapper.palette.length,.3*n]),e=p.min([e,.8*n-2*this.padding])):e=this.width;break;default:throw new Error(\"unreachable code\")}return{width:e,height:t}},t.prototype._tick_coordinate_scale=function(t){var e={source_range:new h.Range1d({start:this.color_mapper.low,end:this.color_mapper.high}),target_range:new h.Range1d({start:0,end:t})};switch(this.color_mapper.type){case\"LinearColorMapper\":return new a.LinearScale(e);case\"LogColorMapper\":return new l.LogScale(e);default:throw new Error(\"unreachable code\")}},t.prototype._format_major_labels=function(t,e){for(var i=this.formatter.doFormat(t,null),n=0,r=e.length;n<r;n++)e[n]in this.major_label_overrides&&(i[n]=this.major_label_overrides[e[n]]);return i},t.prototype.tick_info=function(){var e,t=this._computed_image_dimensions();switch(this.orientation){case\"vertical\":e=t.height;break;case\"horizontal\":e=t.width;break;default:throw new Error(\"unreachable code\")}for(var i=this._tick_coordinate_scale(e),n=this._normals(),r=n[0],o=n[1],s=[this.color_mapper.low,this.color_mapper.high],a=s[0],l=s[1],h=this.ticker.get_ticks(a,l,null,null,this.ticker.desired_num_ticks),c=h.major,u=h.minor,_=[[],[]],p=[[],[]],d=0,f=c.length;d<f;d++)c[d]<a||c[d]>l||(_[r].push(c[d]),_[o].push(0));for(var d=0,f=u.length;d<f;d++)u[d]<a||u[d]>l||(p[r].push(u[d]),p[o].push(0));var v={major:this._format_major_labels(_[r],c)},m={major:[[],[]],minor:[[],[]]};return m.major[r]=i.v_compute(_[r]),m.minor[r]=i.v_compute(p[r]),m.major[o]=_[o],m.minor[o]=p[o],\"vertical\"==this.orientation&&(m.major[r]=g.map(m.major[r],function(t){return e-t}),m.minor[r]=g.map(m.minor[r],function(t){return e-t})),{coords:m,labels:v}},t}(r.Annotation);(i.ColorBar=m).initClass()},function(t,e,i){var n=t(58);i.Annotation=n.Annotation;var r=t(59);i.Arrow=r.Arrow;var o=t(60);i.ArrowHead=o.ArrowHead;var s=t(60);i.OpenHead=s.OpenHead;var a=t(60);i.NormalHead=a.NormalHead;var l=t(60);i.TeeHead=l.TeeHead;var h=t(60);i.VeeHead=h.VeeHead;var c=t(61);i.Band=c.Band;var u=t(62);i.BoxAnnotation=u.BoxAnnotation;var _=t(63);i.ColorBar=_.ColorBar;var p=t(65);i.Label=p.Label;var d=t(66);i.LabelSet=d.LabelSet;var f=t(67);i.Legend=f.Legend;var v=t(68);i.LegendItem=v.LegendItem;var m=t(69);i.PolyAnnotation=m.PolyAnnotation;var g=t(70);i.Slope=g.Slope;var y=t(71);i.Span=y.Span;var b=t(72);i.TextAnnotation=b.TextAnnotation;var x=t(73);i.Title=x.Title;var w=t(74);i.ToolbarPanel=w.ToolbarPanel;var k=t(75);i.Tooltip=k.Tooltip;var S=t(76);i.Whisker=S.Whisker},function(t,e,i){var n=t(387),r=t(72),a=t(5),o=t(15),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.visuals.warm_cache()},t.prototype._get_size=function(){var t=this.plot_view.canvas_view.ctx;if(this.visuals.text.set_value(t),this.model.panel.is_horizontal){var e=t.measureText(this.model.text).ascent;return e}var i=t.measureText(this.model.text).width;return i},t.prototype.render=function(){if(this.model.visible||\"css\"!=this.model.render_mode||a.hide(this.el),this.model.visible){var t;switch(this.model.angle_units){case\"rad\":t=-this.model.angle;break;case\"deg\":t=-this.model.angle*Math.PI/180;break;default:throw new Error(\"unreachable code\")}var e=null!=this.model.panel?this.model.panel:this.plot_view.frame,i=this.plot_view.frame.xscales[this.model.x_range_name],n=this.plot_view.frame.yscales[this.model.y_range_name],r=\"data\"==this.model.x_units?i.compute(this.model.x):e.xview.compute(this.model.x),o=\"data\"==this.model.y_units?n.compute(this.model.y):e.yview.compute(this.model.y);r+=this.model.x_offset,o-=this.model.y_offset;var s=\"canvas\"==this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this);s(this.plot_view.canvas_view.ctx,this.model.text,r,o,t)}},t}(r.TextAnnotationView);i.LabelView=s;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Label\",this.prototype.default_view=s,this.mixins([\"text\",\"line:border_\",\"fill:background_\"]),this.define({x:[o.Number],x_units:[o.SpatialUnits,\"data\"],y:[o.Number],y_units:[o.SpatialUnits,\"data\"],text:[o.String],angle:[o.Angle,0],angle_units:[o.AngleUnits,\"rad\"],x_offset:[o.Number,0],y_offset:[o.Number,0],x_range_name:[o.String,\"default\"],y_range_name:[o.String,\"default\"]}),this.override({background_fill_color:null,border_line_color:null})},t}(r.TextAnnotation);(i.Label=l).initClass()},function(t,e,i){var n=t(387),r=t(72),o=t(190),c=t(5),s=t(15),a=function(r){function t(){return null!==r&&r.apply(this,arguments)||this}return n.__extends(t,r),t.prototype.initialize=function(t){if(r.prototype.initialize.call(this,t),this.set_data(this.model.source),\"css\"==this.model.render_mode)for(var e=0,i=this._text.length;e<i;e++){var n=c.div({class:\"bk-annotation-child\",style:{display:\"none\"}});this.el.appendChild(n)}},t.prototype.connect_signals=function(){var t=this;r.prototype.connect_signals.call(this),\"css\"==this.model.render_mode?(this.connect(this.model.change,function(){t.set_data(t.model.source),t.render()}),this.connect(this.model.source.streaming,function(){t.set_data(t.model.source),t.render()}),this.connect(this.model.source.patching,function(){t.set_data(t.model.source),t.render()}),this.connect(this.model.source.change,function(){t.set_data(t.model.source),t.render()})):(this.connect(this.model.change,function(){t.set_data(t.model.source),t.plot_view.request_render()}),this.connect(this.model.source.streaming,function(){t.set_data(t.model.source),t.plot_view.request_render()}),this.connect(this.model.source.patching,function(){t.set_data(t.model.source),t.plot_view.request_render()}),this.connect(this.model.source.change,function(){t.set_data(t.model.source),t.plot_view.request_render()}))},t.prototype.set_data=function(t){r.prototype.set_data.call(this,t),this.visuals.warm_cache(t)},t.prototype._map_data=function(){var t=this.plot_view.frame.xscales[this.model.x_range_name],e=this.plot_view.frame.yscales[this.model.y_range_name],i=null!=this.model.panel?this.model.panel:this.plot_view.frame,n=\"data\"==this.model.x_units?t.v_compute(this._x):i.xview.v_compute(this._x),r=\"data\"==this.model.y_units?e.v_compute(this._y):i.yview.v_compute(this._y);return[n,r]},t.prototype.render=function(){if(this.model.visible||\"css\"!=this.model.render_mode||c.hide(this.el),this.model.visible)for(var t=\"canvas\"==this.model.render_mode?this._v_canvas_text.bind(this):this._v_css_text.bind(this),e=this.plot_view.canvas_view.ctx,i=this._map_data(),n=i[0],r=i[1],o=0,s=this._text.length;o<s;o++)t(e,o,this._text[o],n[o]+this._x_offset[o],r[o]-this._y_offset[o],this._angle[o])},t.prototype._get_size=function(){var t=this.plot_view.canvas_view.ctx;switch(this.visuals.text.set_value(t),this.model.panel.side){case\"above\":case\"below\":var e=t.measureText(this._text[0]).ascent;return e;case\"left\":case\"right\":var i=t.measureText(this._text[0]).width;return i;default:throw new Error(\"unreachable code\")}},t.prototype._v_canvas_text=function(t,e,i,n,r,o){this.visuals.text.set_vectorize(t,e);var s=this._calculate_bounding_box_dimensions(t,i);t.save(),t.beginPath(),t.translate(n,r),t.rotate(o),t.rect(s[0],s[1],s[2],s[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_vectorize(t,e),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_vectorize(t,e),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_vectorize(t,e),t.fillText(i,0,0)),t.restore()},t.prototype._v_css_text=function(t,e,i,n,r,o){var s=this.el.children[e];s.textContent=i,this.visuals.text.set_vectorize(t,e);var a=this._calculate_bounding_box_dimensions(t,i),l=this.visuals.border_line.line_dash.value(),h=l.length<2?\"solid\":\"dashed\";this.visuals.border_line.set_vectorize(t,e),this.visuals.background_fill.set_vectorize(t,e),s.style.position=\"absolute\",s.style.left=n+a[0]+\"px\",s.style.top=r+a[1]+\"px\",s.style.color=\"\"+this.visuals.text.text_color.value(),s.style.opacity=\"\"+this.visuals.text.text_alpha.value(),s.style.font=\"\"+this.visuals.text.font_value(),s.style.lineHeight=\"normal\",o&&(s.style.transform=\"rotate(\"+o+\"rad)\"),this.visuals.background_fill.doit&&(s.style.backgroundColor=\"\"+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(s.style.borderStyle=\"\"+h,s.style.borderWidth=this.visuals.border_line.line_width.value()+\"px\",s.style.borderColor=\"\"+this.visuals.border_line.color_value()),c.show(s)},t}(r.TextAnnotationView);i.LabelSetView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LabelSet\",this.prototype.default_view=a,this.mixins([\"text\",\"line:border_\",\"fill:background_\"]),this.define({x:[s.NumberSpec],y:[s.NumberSpec],x_units:[s.SpatialUnits,\"data\"],y_units:[s.SpatialUnits,\"data\"],text:[s.StringSpec,{field:\"text\"}],angle:[s.AngleSpec,0],x_offset:[s.NumberSpec,{value:0}],y_offset:[s.NumberSpec,{value:0}],source:[s.Instance,function(){return new o.ColumnDataSource}],x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"]}),this.override({background_fill_color:null,border_line_color:null})},t}(r.TextAnnotation);(i.LabelSet=l).initClass()},function(t,e,i){var n=t(387),r=t(58),o=t(15),M=t(41),O=t(24),z=t(21),P=t(32),j=t(44),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.cursor=function(t,e){return\"none\"==this.model.click_policy?null:\"pointer\"},Object.defineProperty(t.prototype,\"legend_padding\",{get:function(){return null!=this.visuals.border_line.line_color.value()?this.model.padding:0},enumerable:!0,configurable:!0}),t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(){return t.plot_view.request_render()})},t.prototype.compute_legend_bbox=function(){var t=this.model.get_legend_names(),e=this.model,i=e.glyph_height,n=e.glyph_width,r=this.model,o=r.label_height,s=r.label_width;this.max_label_height=z.max([M.get_text_height(this.visuals.label_text.font_value()).height,o,i]);var a=this.plot_view.canvas_view.ctx;a.save(),this.visuals.label_text.set_value(a),this.text_widths={};for(var l=0,h=t;l<h.length;l++){var c=h[l];this.text_widths[c]=z.max([a.measureText(c).width,s])}a.restore();var u,_,p=Math.max(z.max(P.values(this.text_widths)),0),d=this.model.margin,f=this.legend_padding,v=this.model.spacing,m=this.model.label_standoff;if(\"vertical\"==this.model.orientation)u=t.length*this.max_label_height+Math.max(t.length-1,0)*v+2*f,_=p+n+m+2*f;else{for(var g in _=2*f+Math.max(t.length-1,0)*v,this.text_widths){var y=this.text_widths[g];_+=z.max([y,s])+n+m}u=this.max_label_height+2*f}var b,x,w=null!=this.model.panel?this.model.panel:this.plot_view.frame,k=w.bbox.ranges,S=k[0],T=k[1],C=this.model.location;if(j.isString(C))switch(C){case\"top_left\":b=S.start+d,x=T.start+d;break;case\"top_center\":b=(S.end+S.start)/2-_/2,x=T.start+d;break;case\"top_right\":b=S.end-d-_,x=T.start+d;break;case\"bottom_right\":b=S.end-d-_,x=T.end-d-u;break;case\"bottom_center\":b=(S.end+S.start)/2-_/2,x=T.end-d-u;break;case\"bottom_left\":b=S.start+d,x=T.end-d-u;break;case\"center_left\":b=S.start+d,x=(T.end+T.start)/2-u/2;break;case\"center\":b=(S.end+S.start)/2-_/2,x=(T.end+T.start)/2-u/2;break;case\"center_right\":b=S.end-d-_,x=(T.end+T.start)/2-u/2;break;default:throw new Error(\"unreachable code\")}else{if(!j.isArray(C)||2!=C.length)throw new Error(\"unreachable code\");var A=C[0],E=C[1];b=w.xview.compute(A),x=w.yview.compute(E)-u}return{x:b,y:x,width:_,height:u}},t.prototype.interactive_bbox=function(){var t=this.compute_legend_bbox(),e=t.x,i=t.y,n=t.width,r=t.height;return new O.BBox({x:e,y:i,width:n,height:r})},t.prototype.interactive_hit=function(t,e){var i=this.interactive_bbox();return i.contains(t,e)},t.prototype.on_hit=function(t,e){for(var i,n,r,o=this.model.glyph_width,s=this.legend_padding,a=this.model.spacing,l=this.model.label_standoff,h=r=s,c=this.compute_legend_bbox(),u=\"vertical\"==this.model.orientation,_=0,p=this.model.items;_<p.length;_++)for(var d=p[_],f=d.get_labels_list_from_label_prop(),v=0,m=f;v<m.length;v++){var g=m[v],y=c.x+h,b=c.y+r,x=void 0,w=void 0;u?(i=[c.width-2*s,this.max_label_height],x=i[0],w=i[1]):(n=[this.text_widths[g]+o+l,this.max_label_height],x=n[0],w=n[1]);var k=new O.BBox({x:y,y:b,width:x,height:w});if(k.contains(t,e)){switch(this.model.click_policy){case\"hide\":for(var S=0,T=d.renderers;S<T.length;S++){var C=T[S];C.visible=!C.visible}break;case\"mute\":for(var A=0,E=d.renderers;A<E.length;A++){var C=E[A];C.muted=!C.muted}}return!0}u?r+=this.max_label_height+a:h+=this.text_widths[g]+o+l+a}return!1},t.prototype.render=function(){if(this.model.visible&&0!=this.model.items.length){var t=this.plot_view.canvas_view.ctx,e=this.compute_legend_bbox();t.save(),this._draw_legend_box(t,e),this._draw_legend_items(t,e),t.restore()}},t.prototype._draw_legend_box=function(t,e){t.beginPath(),t.rect(e.x,e.y,e.width,e.height),this.visuals.background_fill.set_value(t),t.fill(),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.stroke())},t.prototype._draw_legend_items=function(y,b){for(var x=this,t=this.model,w=t.glyph_width,k=t.glyph_height,S=this.legend_padding,T=this.model.spacing,C=this.model.label_standoff,A=S,E=S,M=\"vertical\"==this.model.orientation,e=function(t){var e,i,n=t.get_labels_list_from_label_prop(),r=t.get_field_from_label_prop();if(0==n.length)return\"continue\";for(var o=function(){switch(x.model.click_policy){case\"none\":return!0;case\"hide\":return z.all(t.renderers,function(t){return t.visible});case\"mute\":return z.all(t.renderers,function(t){return!t.muted})}}(),s=0,a=n;s<a.length;s++){var l=a[s],h=b.x+A,c=b.y+E,u=h+w,_=c+k;M?E+=O.max_label_height+T:A+=O.text_widths[l]+w+C+T,O.visuals.label_text.set_value(y),y.fillText(l,u+C,c+O.max_label_height/2);for(var p=0,d=t.renderers;p<d.length;p++){var f=d[p],v=O.plot_view.renderer_views[f.id];v.draw_legend(y,h,u,c,_,r,l)}if(!o){var m=void 0,g=void 0;M?(e=[b.width-2*S,O.max_label_height],m=e[0],g=e[1]):(i=[O.text_widths[l]+w+C,O.max_label_height],m=i[0],g=i[1]),y.beginPath(),y.rect(h,c,m,g),O.visuals.inactive_fill.set_value(y),y.fill()}}},O=this,i=0,n=this.model.items;i<n.length;i++){var r=n[i];e(r)}},t.prototype._get_size=function(){var t=this.compute_legend_bbox();switch(this.model.panel.side){case\"above\":case\"below\":return t.height+2*this.model.margin;case\"left\":case\"right\":return t.width+2*this.model.margin}},t}(r.AnnotationView);i.LegendView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Legend\",this.prototype.default_view=s,this.mixins([\"text:label_\",\"fill:inactive_\",\"line:border_\",\"fill:background_\"]),this.define({orientation:[o.Orientation,\"vertical\"],location:[o.Any,\"top_right\"],label_standoff:[o.Number,5],glyph_height:[o.Number,20],glyph_width:[o.Number,20],label_height:[o.Number,20],label_width:[o.Number,20],margin:[o.Number,10],padding:[o.Number,10],spacing:[o.Number,3],items:[o.Array,[]],click_policy:[o.Any,\"none\"]}),this.override({border_line_color:\"#e5e5e5\",border_line_alpha:.5,border_line_width:1,background_fill_color:\"#ffffff\",background_fill_alpha:.95,inactive_fill_color:\"white\",inactive_fill_alpha:.7,label_text_font_size:\"10pt\",label_text_baseline:\"middle\"})},t.prototype.get_legend_names=function(){for(var t=[],e=0,i=this.items;e<i.length;e++){var n=i[e],r=n.get_labels_list_from_label_prop();t.push.apply(t,r)}return t},t}(r.Annotation);(i.Legend=a).initClass()},function(t,e,i){var n=t(387),r=t(57),o=t(191),s=t(47),a=t(15),l=t(14),h=t(21),c=function(i){function t(t){return i.call(this,t)||this}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"LegendItem\",this.define({label:[a.StringSpec,null],renderers:[a.Array,[]]})},t.prototype._check_data_sources_on_renderers=function(){var t=this.get_field_from_label_prop();if(null!=t){if(this.renderers.length<1)return!1;var e=this.renderers[0].data_source;if(null!=e)for(var i=0,n=this.renderers;i<n.length;i++){var r=n[i];if(r.data_source!=e)return!1}}return!0},t.prototype._check_field_label_on_data_source=function(){var t=this.get_field_from_label_prop();if(null!=t){if(this.renderers.length<1)return!1;var e=this.renderers[0].data_source;if(null!=e&&!h.includes(e.columns(),t))return!1}return!0},t.prototype.initialize=function(){i.prototype.initialize.call(this);var t=this._check_data_sources_on_renderers();t||l.logger.error(\"Non matching data sources on legend item renderers\");var e=this._check_field_label_on_data_source();e||l.logger.error(\"Bad column name on label: \"+this.label)},t.prototype.get_field_from_label_prop=function(){var t=this.label;return s.isField(t)?t.field:null},t.prototype.get_labels_list_from_label_prop=function(){if(s.isValue(this.label))return[this.label.value];var t=this.get_field_from_label_prop();if(null!=t){var e=void 0;if(!this.renderers[0]||null==this.renderers[0].data_source)return[\"No source found\"];if((e=this.renderers[0].data_source)instanceof o.ColumnarDataSource){var i=e.get_column(t);return null!=i?h.uniq(Array.from(i)):[\"Invalid field\"]}}return[]},t}(r.Model);(i.LegendItem=c).initClass()},function(t,e,i){var n=t(387),r=t(58),o=t(19),s=t(15),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.plot_view.request_render()}),this.connect(this.model.data_update,function(){return t.plot_view.request_render()})},t.prototype.render=function(){if(this.model.visible){var t=this.model,e=t.xs,i=t.ys;if(e.length==i.length&&!(e.length<3||i.length<3)){for(var n=this.plot_view.frame,r=this.plot_view.canvas_view.ctx,o=0,s=e.length;o<s;o++){var a=void 0;if(\"screen\"!=this.model.xs_units)throw new Error(\"not implemented\");a=this.model.screen?e[o]:n.xview.compute(e[o]);var l=void 0;if(\"screen\"!=this.model.ys_units)throw new Error(\"not implemented\");l=this.model.screen?i[o]:n.yview.compute(i[o]),0==o?(r.beginPath(),r.moveTo(a,l)):r.lineTo(a,l)}r.closePath(),this.visuals.line.doit&&(this.visuals.line.set_value(r),r.stroke()),this.visuals.fill.doit&&(this.visuals.fill.set_value(r),r.fill())}}},t}(r.AnnotationView);i.PolyAnnotationView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"PolyAnnotation\",this.prototype.default_view=a,this.mixins([\"line\",\"fill\"]),this.define({xs:[s.Array,[]],xs_units:[s.SpatialUnits,\"data\"],ys:[s.Array,[]],ys_units:[s.SpatialUnits,\"data\"],x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"]}),this.internal({screen:[s.Boolean,!1]}),this.override({fill_color:\"#fff9ba\",fill_alpha:.4,line_color:\"#cccccc\",line_alpha:.3})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.data_update=new o.Signal0(this,\"data_update\")},t.prototype.update=function(t){var e=t.xs,i=t.ys;this.setv({xs:e,ys:i,screen:!0},{silent:!0}),this.data_update.emit()},t}(r.Annotation);(i.PolyAnnotation=l).initClass()},function(t,e,i){var n=t(387),r=t(58),o=t(15),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t)},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.plot_view.request_render()})},t.prototype.render=function(){this.model.visible&&this._draw_slope()},t.prototype._draw_slope=function(){var t=this.model.gradient,e=this.model.y_intercept;if(null!=t&&null!=e){var i=this.plot_view.frame,n=i.xscales[this.model.x_range_name],r=i.yscales[this.model.y_range_name],o=i._top.value,s=o+i._height.value,a=r.invert(o),l=r.invert(s),h=(a-e)/t,c=(l-e)/t,u=n.compute(h),_=n.compute(c),p=this.plot_view.canvas_view.ctx;p.save(),p.beginPath(),this.visuals.line.set_value(p),p.moveTo(u,o),p.lineTo(_,s),p.stroke(),p.restore()}},t}(r.AnnotationView);i.SlopeView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Slope\",this.prototype.default_view=s,this.mixins([\"line\"]),this.define({gradient:[o.Number,null],y_intercept:[o.Number,null],x_range_name:[o.String,\"default\"],y_range_name:[o.String,\"default\"]}),this.override({line_color:\"black\"})},t}(r.Annotation);(i.Slope=a).initClass()},function(t,e,i){var n=t(387),r=t(58),u=t(5),o=t(15),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.position=\"absolute\",u.hide(this.el)},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.model.for_hover?this.connect(this.model.properties.computed_location.change,function(){return t._draw_span()}):\"canvas\"==this.model.render_mode?(this.connect(this.model.change,function(){return t.plot_view.request_render()}),this.connect(this.model.properties.location.change,function(){return t.plot_view.request_render()})):(this.connect(this.model.change,function(){return t.render()}),this.connect(this.model.properties.location.change,function(){return t._draw_span()}))},t.prototype.render=function(){this.model.visible||\"css\"!=this.model.render_mode||u.hide(this.el),this.model.visible&&this._draw_span()},t.prototype._draw_span=function(){var i=this,n=this.model.for_hover?this.model.computed_location:this.model.location;if(null!=n){var t,e,r,o,s=this.plot_view.frame,a=s.xscales[this.model.x_range_name],l=s.yscales[this.model.y_range_name],h=function(t,e){return i.model.for_hover?i.model.computed_location:\"data\"==i.model.location_units?t.compute(n):e.compute(n)};if(\"width\"==this.model.dimension?(r=h(l,s.yview),e=s._left.value,o=s._width.value,t=this.model.properties.line_width.value()):(r=s._top.value,e=h(a,s.xview),o=this.model.properties.line_width.value(),t=s._height.value),\"css\"==this.model.render_mode)this.el.style.top=r+\"px\",this.el.style.left=e+\"px\",this.el.style.width=o+\"px\",this.el.style.height=t+\"px\",this.el.style.backgroundColor=this.model.properties.line_color.value(),this.el.style.opacity=this.model.properties.line_alpha.value(),u.show(this.el);else if(\"canvas\"==this.model.render_mode){var c=this.plot_view.canvas_view.ctx;c.save(),c.beginPath(),this.visuals.line.set_value(c),c.moveTo(e,r),\"width\"==this.model.dimension?c.lineTo(e+o,r):c.lineTo(e,r+t),c.stroke(),c.restore()}}else u.hide(this.el)},t}(r.AnnotationView);i.SpanView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Span\",this.prototype.default_view=s,this.mixins([\"line\"]),this.define({render_mode:[o.RenderMode,\"canvas\"],x_range_name:[o.String,\"default\"],y_range_name:[o.String,\"default\"],location:[o.Number,null],location_units:[o.SpatialUnits,\"data\"],dimension:[o.Dimension,\"width\"]}),this.override({line_color:\"black\"}),this.internal({for_hover:[o.Boolean,!1],computed_location:[o.Number,null]})},t}(r.Annotation);(i.Span=a).initClass()},function(t,e,i){var n=t(387),r=t(58),l=t(5),o=t(15),s=t(41),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),\"css\"==this.model.render_mode&&(this.el.classList.add(\"bk-annotation\"),this.plot_view.canvas_overlays.appendChild(this.el))},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),\"css\"==this.model.render_mode?this.connect(this.model.change,function(){return t.render()}):this.connect(this.model.change,function(){return t.plot_view.request_render()})},t.prototype._calculate_text_dimensions=function(t,e){var i=t.measureText(e).width,n=s.get_text_height(this.visuals.text.font_value()).height;return[i,n]},t.prototype._calculate_bounding_box_dimensions=function(t,e){var i,n,r=this._calculate_text_dimensions(t,e),o=r[0],s=r[1];switch(t.textAlign){case\"left\":i=0;break;case\"center\":i=-o/2;break;case\"right\":i=-o;break;default:throw new Error(\"unreachable code\")}switch(t.textBaseline){case\"top\":n=0;break;case\"middle\":n=-.5*s;break;case\"bottom\":n=-1*s;break;case\"alphabetic\":n=-.8*s;break;case\"hanging\":n=-.17*s;break;case\"ideographic\":n=-.83*s;break;default:throw new Error(\"unreachable code\")}return[i,n,o,s]},t.prototype._canvas_text=function(t,e,i,n,r){this.visuals.text.set_value(t);var o=this._calculate_bounding_box_dimensions(t,e);t.save(),t.beginPath(),t.translate(i,n),r&&t.rotate(r),t.rect(o[0],o[1],o[2],o[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_value(t),t.fillText(e,0,0)),t.restore()},t.prototype._css_text=function(t,e,i,n,r){l.hide(this.el),this.visuals.text.set_value(t);var o=this._calculate_bounding_box_dimensions(t,e),s=this.visuals.border_line.line_dash.value(),a=s.length<2?\"solid\":\"dashed\";this.visuals.border_line.set_value(t),this.visuals.background_fill.set_value(t),this.el.style.position=\"absolute\",this.el.style.left=i+o[0]+\"px\",this.el.style.top=n+o[1]+\"px\",this.el.style.color=\"\"+this.visuals.text.text_color.value(),this.el.style.opacity=\"\"+this.visuals.text.text_alpha.value(),this.el.style.font=\"\"+this.visuals.text.font_value(),this.el.style.lineHeight=\"normal\",r&&(this.el.style.transform=\"rotate(\"+r+\"rad)\"),this.visuals.background_fill.doit&&(this.el.style.backgroundColor=\"\"+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(this.el.style.borderStyle=\"\"+a,this.el.style.borderWidth=this.visuals.border_line.line_width.value()+\"px\",this.el.style.borderColor=\"\"+this.visuals.border_line.color_value()),this.el.textContent=e,l.show(this.el)},t}(r.AnnotationView);i.TextAnnotationView=a;var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"TextAnnotation\",this.define({render_mode:[o.RenderMode,\"canvas\"]})},t}(r.Annotation);(i.TextAnnotation=h).initClass()},function(t,e,i){var n=t(387),r=t(72),s=t(5),o=t(15),a=t(49),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.visuals.text=new a.Text(this.model)},t.prototype._get_location=function(){var t,e,i=this.model.panel,n=this.model.offset;switch(i.side){case\"above\":case\"below\":switch(this.model.vertical_align){case\"top\":e=i._top.value+5;break;case\"middle\":e=i._vcenter.value;break;case\"bottom\":e=i._bottom.value-5;break;default:throw new Error(\"unreachable code\")}switch(this.model.align){case\"left\":t=i._left.value+n;break;case\"center\":t=i._hcenter.value;break;case\"right\":t=i._right.value-n;break;default:throw new Error(\"unreachable code\")}break;case\"left\":switch(this.model.vertical_align){case\"top\":t=i._left.value-5;break;case\"middle\":t=i._hcenter.value;break;case\"bottom\":t=i._right.value+5;break;default:throw new Error(\"unreachable code\")}switch(this.model.align){case\"left\":e=i._bottom.value-n;break;case\"center\":e=i._vcenter.value;break;case\"right\":e=i._top.value+n;break;default:throw new Error(\"unreachable code\")}break;case\"right\":switch(this.model.vertical_align){case\"top\":t=i._right.value-5;break;case\"middle\":t=i._hcenter.value;break;case\"bottom\":t=i._left.value+5;break;default:throw new Error(\"unreachable code\")}switch(this.model.align){case\"left\":e=i._top.value+n;break;case\"center\":e=i._vcenter.value;break;case\"right\":e=i._bottom.value-n;break;default:throw new Error(\"unreachable code\")}break;default:throw new Error(\"unreachable code\")}return[t,e]},t.prototype.render=function(){if(this.model.visible){var t=this.model.text;if(null!=t&&0!=t.length){this.model.text_baseline=this.model.vertical_align,this.model.text_align=this.model.align;var e=this._get_location(),i=e[0],n=e[1],r=this.model.panel.get_label_angle_heuristic(\"parallel\"),o=\"canvas\"==this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this);o(this.plot_view.canvas_view.ctx,t,i,n,r)}}else\"css\"==this.model.render_mode&&s.hide(this.el)},t.prototype._get_size=function(){var t=this.model.text;if(null==t||0==t.length)return 0;var e=this.plot_view.canvas_view.ctx;return this.visuals.text.set_value(e),e.measureText(t).ascent+10},t}(r.TextAnnotationView);i.TitleView=l;var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Title\",this.prototype.default_view=l,this.mixins([\"line:border_\",\"fill:background_\"]),this.define({text:[o.String],text_font:[o.Font,\"helvetica\"],text_font_size:[o.FontSizeSpec,\"10pt\"],text_font_style:[o.FontStyle,\"bold\"],text_color:[o.ColorSpec,\"#444444\"],text_alpha:[o.NumberSpec,1],vertical_align:[o.VerticalAlign,\"bottom\"],align:[o.TextAlign,\"left\"],offset:[o.Number,0]}),this.override({background_fill_color:null,border_line_color:null}),this.internal({text_align:[o.TextAlign,\"left\"],text_baseline:[o.TextBaseline,\"bottom\"]})},t}(r.TextAnnotation);(i.Title=h).initClass()},function(t,e,i){var n=t(387),r=t(58),o=t(4),s=t(5),a=t(15),l=function(i){function t(){return null!==i&&i.apply(this,arguments)||this}return n.__extends(t,i),t.prototype.initialize=function(t){i.prototype.initialize.call(this,t),this.plot_view.canvas_events.appendChild(this.el),this._toolbar_views={},o.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},t.prototype.remove=function(){o.remove_views(this._toolbar_views),i.prototype.remove.call(this)},t.prototype.render=function(){if(i.prototype.render.call(this),this.model.visible){var t=this.model.panel;this.el.style.position=\"absolute\",this.el.style.left=t._left.value+\"px\",this.el.style.top=t._top.value+\"px\",this.el.style.width=t._width.value+\"px\",this.el.style.height=t._height.value+\"px\",this.el.style.overflow=\"hidden\";var e=this._toolbar_views[this.model.toolbar.id];e.render(),s.empty(this.el),this.el.appendChild(e.el),s.show(this.el)}else s.hide(this.el)},t.prototype._get_size=function(){return 30},t}(r.AnnotationView);i.ToolbarPanelView=l;var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ToolbarPanel\",this.prototype.default_view=l,this.define({toolbar:[a.Instance]})},t}(r.Annotation);(i.ToolbarPanel=h).initClass()},function(t,e,i){var n=t(387),r=t(58),f=t(5),o=t(15);function v(t,e,i,n,r){var o;switch(t){case\"horizontal\":o=e<n?\"right\":\"left\";break;case\"vertical\":o=i<r?\"below\":\"above\";break;default:o=t}return o}i.compute_side=v;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.plot_view.canvas_overlays.appendChild(this.el),f.hide(this.el)},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.properties.data.change,function(){return t._draw_tips()})},t.prototype.css_classes=function(){return e.prototype.css_classes.call(this).concat(\"bk-tooltip\")},t.prototype.render=function(){this.model.visible&&this._draw_tips()},t.prototype._draw_tips=function(){var t=this.model.data;if(f.empty(this.el),f.hide(this.el),this.model.custom?this.el.classList.add(\"bk-tooltip-custom\"):this.el.classList.remove(\"bk-tooltip-custom\"),0!=t.length){for(var e=this.plot_view.frame,i=0,n=t;i<n.length;i++){var r=n[i],o=r[0],s=r[1],a=r[2];if(!this.model.inner_only||e.bbox.contains(o,s)){var l=f.div({},a);this.el.appendChild(l)}}var h,c,u=t[t.length-1],_=u[0],p=u[1],d=v(this.model.attachment,_,p,e._hcenter.value,e._vcenter.value);switch(this.el.classList.remove(\"bk-right\"),this.el.classList.remove(\"bk-left\"),this.el.classList.remove(\"bk-above\"),this.el.classList.remove(\"bk-below\"),f.show(this.el),d){case\"right\":this.el.classList.add(\"bk-left\"),h=_+(this.el.offsetWidth-this.el.clientWidth)+10,c=p-this.el.offsetHeight/2;break;case\"left\":this.el.classList.add(\"bk-right\"),h=_-this.el.offsetWidth-10,c=p-this.el.offsetHeight/2;break;case\"below\":this.el.classList.add(\"bk-above\"),c=p+(this.el.offsetHeight-this.el.clientHeight)+10,h=Math.round(_-this.el.offsetWidth/2);break;case\"above\":this.el.classList.add(\"bk-below\"),c=p-this.el.offsetHeight-10,h=Math.round(_-this.el.offsetWidth/2);break;default:throw new Error(\"unreachable code\")}this.model.show_arrow&&this.el.classList.add(\"bk-tooltip-arrow\"),0<this.el.childNodes.length?(this.el.style.top=c+\"px\",this.el.style.left=h+\"px\"):f.hide(this.el)}},t}(r.AnnotationView);i.TooltipView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Tooltip\",this.prototype.default_view=s,this.define({attachment:[o.String,\"horizontal\"],inner_only:[o.Bool,!0],show_arrow:[o.Bool,!0]}),this.override({level:\"overlay\"}),this.internal({data:[o.Any,[]],custom:[o.Any]})},t.prototype.clear=function(){this.data=[]},t.prototype.add=function(t,e,i){this.data=this.data.concat([[t,e,i]])},t}(r.Annotation);(i.Tooltip=a).initClass()},function(t,e,i){var n=t(387),r=t(58),o=t(190),s=t(60),a=t(15),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.set_data(this.model.source)},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return t.set_data(t.model.source)}),this.connect(this.model.source.patching,function(){return t.set_data(t.model.source)}),this.connect(this.model.source.change,function(){return t.set_data(t.model.source)})},t.prototype.set_data=function(t){e.prototype.set_data.call(this,t),this.visuals.warm_cache(t),this.plot_view.request_render()},t.prototype._map_data=function(){var t,e,i,n=this.plot_model.frame,r=this.model.dimension,o=n.xscales[this.model.x_range_name],s=n.yscales[this.model.y_range_name],a=\"height\"==r?s:o,l=\"height\"==r?o:s,h=\"height\"==r?n.yview:n.xview,c=\"height\"==r?n.xview:n.yview;t=\"data\"==this.model.lower.units?a.v_compute(this._lower):h.v_compute(this._lower),e=\"data\"==this.model.upper.units?a.v_compute(this._upper):h.v_compute(this._upper),i=\"data\"==this.model.base.units?l.v_compute(this._base):c.v_compute(this._base);var u=\"height\"==r?[1,0]:[0,1],_=u[0],p=u[1],d=[t,i],f=[e,i];this._lower_sx=d[_],this._lower_sy=d[p],this._upper_sx=f[_],this._upper_sy=f[p]},t.prototype.render=function(){if(this.model.visible){this._map_data();var t=this.plot_view.canvas_view.ctx;if(this.visuals.line.doit)for(var e=0,i=this._lower_sx.length;e<i;e++)this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(this._lower_sx[e],this._lower_sy[e]),t.lineTo(this._upper_sx[e],this._upper_sy[e]),t.stroke();var n=\"height\"==this.model.dimension?0:Math.PI/2;if(null!=this.model.lower_head)for(var e=0,i=this._lower_sx.length;e<i;e++)t.save(),t.translate(this._lower_sx[e],this._lower_sy[e]),t.rotate(n+Math.PI),this.model.lower_head.render(t,e),t.restore();if(null!=this.model.upper_head)for(var e=0,i=this._upper_sx.length;e<i;e++)t.save(),t.translate(this._upper_sx[e],this._upper_sy[e]),t.rotate(n),this.model.upper_head.render(t,e),t.restore()}},t}(r.AnnotationView);i.WhiskerView=l;var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Whisker\",this.prototype.default_view=l,this.mixins([\"line\"]),this.define({lower:[a.DistanceSpec],lower_head:[a.Instance,function(){return new s.TeeHead({level:\"underlay\",size:10})}],upper:[a.DistanceSpec],upper_head:[a.Instance,function(){return new s.TeeHead({level:\"underlay\",size:10})}],base:[a.DistanceSpec],dimension:[a.Dimension,\"height\"],source:[a.Instance,function(){return new o.ColumnDataSource}],x_range_name:[a.String,\"default\"],y_range_name:[a.String,\"default\"]}),this.override({level:\"underlay\"})},t}(r.Annotation);(i.Whisker=h).initClass()},function(t,e,i){var n=t(387),r=t(177),o=t(15),s=t(12),l=t(21),C=t(44),a=t(171),h=Math.abs,c=Math.min,u=Math.max,_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.render=function(){if(this.model.visible){var t={tick:this._tick_extent(),tick_label:this._tick_label_extents(),axis_label:this._axis_label_extent()},e=this.model.tick_coords,i=this.plot_view.canvas_view.ctx;i.save(),this._draw_rule(i,t),this._draw_major_ticks(i,t,e),this._draw_minor_ticks(i,t,e),this._draw_major_labels(i,t,e),this._draw_axis_label(i,t,e),null!=this._render&&this._render(i,t,e),i.restore()}},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.plot_view.request_render()})},t.prototype.get_size=function(){return this.model.visible?Math.round(this._get_size()):0},t.prototype._get_size=function(){return null!=this.model.fixed_location?0:this._tick_extent()+this._tick_label_extent()+this._axis_label_extent()},Object.defineProperty(t.prototype,\"needs_clip\",{get:function(){return null!=this.model.fixed_location},enumerable:!0,configurable:!0}),t.prototype._draw_rule=function(t,e){if(this.visuals.axis_line.doit){var i=this.model.rule_coords,n=i[0],r=i[1],o=this.plot_view.map_to_screen(n,r,this.model.x_range_name,this.model.y_range_name),s=o[0],a=o[1],l=this.model.normals,h=l[0],c=l[1],u=this.model.offsets,_=u[0],p=u[1];this.visuals.axis_line.set_value(t),t.beginPath(),t.moveTo(Math.round(s[0]+h*_),Math.round(a[0]+c*p));for(var d=1;d<s.length;d++){var f=Math.round(s[d]+h*_),v=Math.round(a[d]+c*p);t.lineTo(f,v)}t.stroke()}},t.prototype._draw_major_ticks=function(t,e,i){var n=this.model.major_tick_in,r=this.model.major_tick_out,o=this.visuals.major_tick_line;this._draw_ticks(t,i.major,n,r,o)},t.prototype._draw_minor_ticks=function(t,e,i){var n=this.model.minor_tick_in,r=this.model.minor_tick_out,o=this.visuals.minor_tick_line;this._draw_ticks(t,i.minor,n,r,o)},t.prototype._draw_major_labels=function(t,e,i){var n=i.major,r=this.model.compute_labels(n[this.model.dimension]),o=this.model.major_label_orientation,s=e.tick+this.model.major_label_standoff,a=this.visuals.major_label_text;this._draw_oriented_labels(t,r,n,o,this.model.panel.side,s,a)},t.prototype._draw_axis_label=function(t,e,i){if(null!=this.model.axis_label&&0!=this.model.axis_label.length&&null==this.model.fixed_location){var n,r;switch(this.model.panel.side){case\"above\":n=this.model.panel._hcenter.value,r=this.model.panel._bottom.value;break;case\"below\":n=this.model.panel._hcenter.value,r=this.model.panel._top.value;break;case\"left\":n=this.model.panel._right.value,r=this.model.panel._vcenter.value;break;case\"right\":n=this.model.panel._left.value,r=this.model.panel._vcenter.value;break;default:throw new Error(\"unknown side: \"+this.model.panel.side)}var o=[[n],[r]],s=e.tick+l.sum(e.tick_label)+this.model.axis_label_standoff,a=this.visuals.axis_label_text;this._draw_oriented_labels(t,[this.model.axis_label],o,\"parallel\",this.model.panel.side,s,a,\"screen\")}},t.prototype._draw_ticks=function(t,e,i,n,r){if(r.doit){var o=e[0],s=e[1],a=this.plot_view.map_to_screen(o,s,this.model.x_range_name,this.model.y_range_name),l=a[0],h=a[1],c=this.model.normals,u=c[0],_=c[1],p=this.model.offsets,d=p[0],f=p[1],v=[u*(d-i),_*(f-i)],m=v[0],g=v[1],y=[u*(d+n),_*(f+n)],b=y[0],x=y[1];r.set_value(t);for(var w=0;w<l.length;w++){var k=Math.round(l[w]+b),S=Math.round(h[w]+x),T=Math.round(l[w]+m),C=Math.round(h[w]+g);t.beginPath(),t.moveTo(k,S),t.lineTo(T,C),t.stroke()}}},t.prototype._draw_oriented_labels=function(t,e,i,n,r,o,s,a){var l,h,c;if(void 0===a&&(a=\"data\"),s.doit&&0!=e.length){var u,_,p,d;if(\"screen\"==a)u=i[0],_=i[1],p=(l=[0,0])[0],d=l[1];else{var f=i[0],v=i[1];h=this.plot_view.map_to_screen(f,v,this.model.x_range_name,this.model.y_range_name),u=h[0],_=h[1],c=this.model.offsets,p=c[0],d=c[1]}var m,g=this.model.normals,y=g[0],b=g[1],x=y*(p+o),w=b*(d+o);s.set_value(t),this.model.panel.apply_label_text_heuristics(t,n),m=C.isString(n)?this.model.panel.get_label_angle_heuristic(n):-n;for(var k=0;k<u.length;k++){var S=Math.round(u[k]+x),T=Math.round(_[k]+w);t.translate(S,T),t.rotate(m),t.fillText(e[k],0,0),t.rotate(-m),t.translate(-S,-T)}}},t.prototype._axis_label_extent=function(){if(null==this.model.axis_label||\"\"==this.model.axis_label)return 0;var t=this.model.axis_label_standoff,e=this.visuals.axis_label_text;return this._oriented_labels_extent([this.model.axis_label],\"parallel\",this.model.panel.side,t,e)},t.prototype._tick_extent=function(){return this.model.major_tick_out},t.prototype._tick_label_extent=function(){return l.sum(this._tick_label_extents())},t.prototype._tick_label_extents=function(){var t=this.model.tick_coords.major,e=this.model.compute_labels(t[this.model.dimension]),i=this.model.major_label_orientation,n=this.model.major_label_standoff,r=this.visuals.major_label_text;return[this._oriented_labels_extent(e,i,this.model.panel.side,n,r)]},t.prototype._oriented_labels_extent=function(t,e,i,n,r){if(0==t.length)return 0;var o,s,a=this.plot_view.canvas_view.ctx;r.set_value(a),C.isString(e)?(o=1,s=this.model.panel.get_label_angle_heuristic(e)):(o=2,s=-e),s=Math.abs(s);for(var l=Math.cos(s),h=Math.sin(s),c=0,u=0;u<t.length;u++){var _=1.1*a.measureText(t[u]).width,p=.9*a.measureText(t[u]).ascent,d=void 0;c<(d=\"above\"==i||\"below\"==i?_*h+p/o*l:_*l+p/o*h)&&(c=d)}return 0<c&&(c+=n),c},t}(r.GuideRendererView);i.AxisView=_;var p=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Axis\",this.prototype.default_view=_,this.mixins([\"line:axis_\",\"line:major_tick_\",\"line:minor_tick_\",\"text:major_label_\",\"text:axis_label_\"]),this.define({bounds:[o.Any,\"auto\"],ticker:[o.Instance,null],formatter:[o.Instance,null],x_range_name:[o.String,\"default\"],y_range_name:[o.String,\"default\"],axis_label:[o.String,\"\"],axis_label_standoff:[o.Int,5],major_label_standoff:[o.Int,5],major_label_orientation:[o.Any,\"horizontal\"],major_label_overrides:[o.Any,{}],major_tick_in:[o.Number,2],major_tick_out:[o.Number,6],minor_tick_in:[o.Number,0],minor_tick_out:[o.Number,4],fixed_location:[o.Any,null]}),this.override({axis_line_color:\"black\",major_tick_line_color:\"black\",minor_tick_line_color:\"black\",major_label_text_font_size:\"8pt\",major_label_text_align:\"center\",major_label_text_baseline:\"alphabetic\",axis_label_text_font_size:\"10pt\",axis_label_text_font_style:\"italic\"})},t.prototype.add_panel=function(t){this.panel=new s.SidePanel({side:t}),this.panel.attach_document(this.document)},Object.defineProperty(t.prototype,\"normals\",{get:function(){return this.panel.normals},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"dimension\",{get:function(){return this.panel.dimension},enumerable:!0,configurable:!0}),t.prototype.compute_labels=function(t){for(var e=this.formatter.doFormat(t,this),i=0;i<t.length;i++)t[i]in this.major_label_overrides&&(e[i]=this.major_label_overrides[t[i]]);return e},Object.defineProperty(t.prototype,\"offsets\",{get:function(){var t=this.plot.plot_canvas.frame,e=[0,0],i=e[0],n=e[1];switch(this.panel.side){case\"below\":n=h(this.panel._top.value-t._bottom.value);break;case\"above\":n=h(this.panel._bottom.value-t._top.value);break;case\"right\":i=h(this.panel._left.value-t._right.value);break;case\"left\":i=h(this.panel._right.value-t._left.value)}return[i,n]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"ranges\",{get:function(){var t=this.dimension,e=(t+1)%2,i=this.plot.plot_canvas.frame,n=[i.x_ranges[this.x_range_name],i.y_ranges[this.y_range_name]];return[n[t],n[e]]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"computed_bounds\",{get:function(){var t=this.ranges[0],e=this.bounds,i=[t.min,t.max];if(\"auto\"==e)return[t.min,t.max];if(C.isArray(e)){var n=void 0,r=void 0,o=e[0],s=e[1],a=i[0],l=i[1];return h(o-s)>h(a-l)?(n=u(c(o,s),a),r=c(u(o,s),l)):(n=c(o,s),r=u(o,s)),[n,r]}throw new Error(\"user bounds '\"+e+\"' not understood\")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"rule_coords\",{get:function(){var t=this.dimension,e=(t+1)%2,i=this.ranges[0],n=this.computed_bounds,r=n[0],o=n[1],s=new Array(2),a=new Array(2),l=[s,a];return l[t][0]=Math.max(r,i.min),l[t][1]=Math.min(o,i.max),l[t][0]>l[t][1]&&(l[t][0]=l[t][1]=NaN),l[e][0]=this.loc,l[e][1]=this.loc,l},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"tick_coords\",{get:function(){for(var t=this.dimension,e=(t+1)%2,i=this.ranges[0],n=this.computed_bounds,r=n[0],o=n[1],s=this.ticker.get_ticks(r,o,i,this.loc,{}),a=s.major,l=s.minor,h=[[],[]],c=[[],[]],u=[i.min,i.max],_=u[0],p=u[1],d=0;d<a.length;d++)a[d]<_||a[d]>p||(h[t].push(a[d]),h[e].push(this.loc));for(var d=0;d<l.length;d++)l[d]<_||l[d]>p||(c[t].push(l[d]),c[e].push(this.loc));return{major:h,minor:c}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"loc\",{get:function(){if(null!=this.fixed_location){if(C.isNumber(this.fixed_location))return this.fixed_location;var t=this.ranges,e=t[1];if(e instanceof a.FactorRange)return e.synthetic(this.fixed_location);throw new Error(\"unexpected\")}var i=this.ranges,n=i[1];switch(this.panel.side){case\"left\":case\"below\":return n.start;case\"right\":case\"above\":return n.end}},enumerable:!0,configurable:!0}),t}(r.GuideRenderer);(i.Axis=p).initClass()},function(t,e,i){var n=t(387),r=t(77),o=t(198),s=t(103),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){this._draw_group_separators(t,e,i)},e.prototype._draw_group_separators=function(t,e,i){var n,r=this.model.ranges[0],o=this.model.computed_bounds,s=o[0],a=o[1];if(r.tops&&!(r.tops.length<2)&&this.visuals.separator_line.doit){for(var l=this.model.dimension,h=(l+1)%2,c=[[],[]],u=0,_=0;_<r.tops.length-1;_++){for(var p=void 0,d=void 0,f=u;f<r.factors.length;f++)if(r.factors[f][0]==r.tops[_+1]){n=[r.factors[f-1],r.factors[f]],p=n[0],d=n[1],u=f;break}var v=(r.synthetic(p)+r.synthetic(d))/2;s<v&&v<a&&(c[l].push(v),c[h].push(this.model.loc))}var m=this._tick_label_extent();this._draw_ticks(t,c,-3,m-6,this.visuals.separator_line)}},e.prototype._draw_major_labels=function(t,e,i){for(var n=this._get_factor_info(),r=e.tick+this.model.major_label_standoff,o=0;o<n.length;o++){var s=n[o],a=s[0],l=s[1],h=s[2],c=s[3];this._draw_oriented_labels(t,a,l,h,this.model.panel.side,r,c),r+=e.tick_label[o]}},e.prototype._tick_label_extents=function(){for(var t=this._get_factor_info(),e=[],i=0,n=t;i<n.length;i++){var r=n[i],o=r[0],s=r[2],a=r[3],l=this._oriented_labels_extent(o,s,this.model.panel.side,this.model.major_label_standoff,a);e.push(l)}return e},e.prototype._get_factor_info=function(){var t=this.model.ranges[0],e=this.model.computed_bounds,i=e[0],n=e[1],r=this.model.loc,o=this.model.ticker.get_ticks(i,n,t,r,{}),s=this.model.tick_coords,a=[];if(1==t.levels){var l=this.model.formatter.doFormat(o.major,this.model);a.push([l,s.major,this.model.major_label_orientation,this.visuals.major_label_text])}else if(2==t.levels){var l=this.model.formatter.doFormat(o.major.map(function(t){return t[1]}),this.model);a.push([l,s.major,this.model.major_label_orientation,this.visuals.major_label_text]),a.push([o.tops,s.tops,this.model.group_label_orientation,this.visuals.group_text])}else if(3==t.levels){var l=this.model.formatter.doFormat(o.major.map(function(t){return t[2]}),this.model),h=o.mids.map(function(t){return t[1]});a.push([l,s.major,this.model.major_label_orientation,this.visuals.major_label_text]),a.push([h,s.mids,this.model.subgroup_label_orientation,this.visuals.subgroup_text]),a.push([o.tops,s.tops,this.model.group_label_orientation,this.visuals.group_text])}return a},e}(r.AxisView);i.CategoricalAxisView=l;var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"CategoricalAxis\",this.prototype.default_view=l,this.mixins([\"line:separator_\",\"text:group_\",\"text:subgroup_\"]),this.define({group_label_orientation:[a.Any,\"parallel\"],subgroup_label_orientation:[a.Any,\"parallel\"]}),this.override({ticker:function(){return new o.CategoricalTicker},formatter:function(){return new s.CategoricalTickFormatter},separator_line_color:\"lightgrey\",separator_line_width:2,group_text_font_style:\"bold\",group_text_font_size:\"8pt\",group_text_color:\"grey\",subgroup_text_font_style:\"bold\",subgroup_text_font_size:\"8pt\"})},Object.defineProperty(t.prototype,\"tick_coords\",{get:function(){var e=this,t=this.dimension,i=(t+1)%2,n=this.ranges[0],r=this.computed_bounds,o=r[0],s=r[1],a=this.ticker.get_ticks(o,s,n,this.loc,{}),l={major:[[],[]],mids:[[],[]],tops:[[],[]],minor:[[],[]]};return l.major[t]=a.major,l.major[i]=a.major.map(function(t){return e.loc}),3==n.levels&&(l.mids[t]=a.mids),l.mids[i]=a.mids.map(function(t){return e.loc}),1<n.levels&&(l.tops[t]=a.tops),l.tops[i]=a.tops.map(function(t){return e.loc}),l},enumerable:!0,configurable:!0}),t}(r.Axis);(i.CategoricalAxis=h).initClass()},function(t,e,i){var n=t(387),r=t(77),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ContinuousAxis\"},t}(r.Axis);(i.ContinuousAxis=o).initClass()},function(t,e,i){var n=t(387),r=t(82),o=t(104),s=t(201),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.LinearAxisView);i.DatetimeAxisView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"DatetimeAxis\",this.prototype.default_view=a,this.override({ticker:function(){return new s.DatetimeTicker},formatter:function(){return new o.DatetimeTickFormatter}})},t}(r.LinearAxis);(i.DatetimeAxis=l).initClass()},function(t,e,i){var n=t(77);i.Axis=n.Axis;var r=t(78);i.CategoricalAxis=r.CategoricalAxis;var o=t(79);i.ContinuousAxis=o.ContinuousAxis;var s=t(80);i.DatetimeAxis=s.DatetimeAxis;var a=t(82);i.LinearAxis=a.LinearAxis;var l=t(83);i.LogAxis=l.LogAxis;var h=t(84);i.MercatorAxis=h.MercatorAxis},function(t,e,i){var n=t(387),r=t(77),o=t(79),s=t(102),a=t(197),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.AxisView);i.LinearAxisView=l;var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LinearAxis\",this.prototype.default_view=l,this.override({ticker:function(){return new a.BasicTicker},formatter:function(){return new s.BasicTickFormatter}})},t}(o.ContinuousAxis);(i.LinearAxis=h).initClass()},function(t,e,i){var n=t(387),r=t(77),o=t(79),s=t(107),a=t(205),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.AxisView);i.LogAxisView=l;var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LogAxis\",this.prototype.default_view=l,this.override({ticker:function(){return new a.LogTicker},formatter:function(){return new s.LogTickFormatter}})},t}(o.ContinuousAxis);(i.LogAxis=h).initClass()},function(t,e,i){var n=t(387),r=t(77),o=t(82),s=t(108),a=t(206),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.AxisView);i.MercatorAxisView=l;var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"MercatorAxis\",this.prototype.default_view=l,this.override({ticker:function(){return new a.MercatorTicker({dimension:\"lat\"})},formatter:function(){return new s.MercatorTickFormatter({dimension:\"lat\"})}})},t}(o.LinearAxis);(i.MercatorAxis=h).initClass()},function(t,e,i){var n=t(387),r=t(57),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Callback\"},t}(r.Model);(i.Callback=o).initClass()},function(i,t,e){var n=i(387),r=i(85),o=i(15),s=i(32),a=i(38),l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"CustomJS\",this.define({args:[o.Any,{}],code:[o.String,\"\"],use_strict:[o.Boolean,!1]})},Object.defineProperty(t.prototype,\"names\",{get:function(){return s.keys(this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"values\",{get:function(){return s.values(this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"func\",{get:function(){var t=this.use_strict?a.use_strict(this.code):this.code;return new(Function.bind.apply(Function,[void 0].concat(this.names,[\"cb_obj\",\"cb_data\",\"require\",\"exports\",t])))},enumerable:!0,configurable:!0}),t.prototype.execute=function(t,e){return this.func.apply(t,this.values.concat(t,e,i,{}))},t}(r.Callback);(e.CustomJS=l).initClass()},function(t,e,i){var n=t(86);i.CustomJS=n.CustomJS;var r=t(88);i.OpenURL=r.OpenURL},function(t,e,i){var n=t(387),r=t(85),o=t(15),s=t(35),a=t(40),l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"OpenURL\",this.define({url:[o.String,\"http://\"]})},t.prototype.execute=function(t,e){for(var i=0,n=s.get_indices(e.source);i<n.length;i++){var r=n[i],o=a.replace_placeholders(this.url,e.source,r);window.open(o)}return null},t}(r.Callback);(i.OpenURL=l).initClass()},function(t,e,i){var n=t(387),r=t(11),o=t(6),s=t(13),a=t(14),l=t(15),h=t(5),c=t(26);null!=window.CanvasPixelArray&&(window.CanvasPixelArray.prototype.set=function(t){for(var e=0;e<this.length;e++)this[e]=t[e]});var u=function(i){function t(){return null!==i&&i.apply(this,arguments)||this}return n.__extends(t,i),Object.defineProperty(t.prototype,\"ctx\",{get:function(){return this._ctx},enumerable:!0,configurable:!0}),t.prototype.initialize=function(t){switch(i.prototype.initialize.call(this,t),this.map_el=this.model.map?this.el.appendChild(h.div({class:\"bk-canvas-map\"})):null,this.model.output_backend){case\"canvas\":case\"webgl\":this.canvas_el=this.el.appendChild(h.canvas({class:\"bk-canvas\"}));var e=this.canvas_el.getContext(\"2d\");if(null==e)throw new Error(\"unable to obtain 2D rendering context\");this._ctx=e;break;case\"svg\":var e=new c.SVGRenderingContext2D;this._ctx=e,this.canvas_el=this.el.appendChild(e.getSvg())}this.overlays_el=this.el.appendChild(h.div({class:\"bk-canvas-overlays\"})),this.events_el=this.el.appendChild(h.div({class:\"bk-canvas-events\"})),c.fixup_ctx(this._ctx),a.logger.debug(\"CanvasView initialized\")},t.prototype.css_classes=function(){return i.prototype.css_classes.call(this).concat(\"bk-canvas-wrapper\")},t.prototype.get_canvas_element=function(){return this.canvas_el},t.prototype.prepare_canvas=function(){var t=this.model._width.value,e=this.model._height.value;this.el.style.width=t+\"px\",this.el.style.height=e+\"px\";var i=c.get_scale_ratio(this.ctx,this.model.use_hidpi,this.model.output_backend);this.model.pixel_ratio=i,this.canvas_el.style.width=t+\"px\",this.canvas_el.style.height=e+\"px\",this.canvas_el.setAttribute(\"width\",\"\"+t*i),this.canvas_el.setAttribute(\"height\",\"\"+e*i),a.logger.debug(\"Rendering CanvasView with width: \"+t+\", height: \"+e+\", pixel ratio: \"+i)},t.prototype.set_dims=function(t){var e=t[0],i=t[1];e<=0||i<=0||(e!=this.model._width.value&&(null!=this._width_constraint&&this.solver.has_constraint(this._width_constraint)&&this.solver.remove_constraint(this._width_constraint),this._width_constraint=s.EQ(this.model._width,-e),this.solver.add_constraint(this._width_constraint)),i!=this.model._height.value&&(null!=this._height_constraint&&this.solver.has_constraint(this._height_constraint)&&this.solver.remove_constraint(this._height_constraint),this._height_constraint=s.EQ(this.model._height,-i),this.solver.add_constraint(this._height_constraint)),this.solver.update_variables())},t}(o.DOMView);i.CanvasView=u;var _=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Canvas\",this.prototype.default_view=u,this.internal({map:[l.Boolean,!1],use_hidpi:[l.Boolean,!0],pixel_ratio:[l.Number,1],output_backend:[l.OutputBackend,\"canvas\"]})},Object.defineProperty(t.prototype,\"panel\",{get:function(){return this},enumerable:!0,configurable:!0}),t}(r.LayoutCanvas);(i.Canvas=_).initClass()},function(t,e,i){var n=t(387),a=t(180),l=t(182),h=t(183),c=t(174),u=t(170),_=t(171),r=t(11),o=t(15),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"CartesianFrame\",this.internal({extra_x_ranges:[o.Any,{}],extra_y_ranges:[o.Any,{}],x_range:[o.Instance],y_range:[o.Instance],x_scale:[o.Instance],y_scale:[o.Instance]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this._configure_scales()},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.change,function(){return t._configure_scales()})},Object.defineProperty(t.prototype,\"panel\",{get:function(){return this},enumerable:!0,configurable:!0}),t.prototype.get_editables=function(){return e.prototype.get_editables.call(this).concat([this._width,this._height])},t.prototype.map_to_screen=function(t,e,i,n){void 0===i&&(i=\"default\"),void 0===n&&(n=\"default\");var r=this.xscales[i].v_compute(t),o=this.yscales[n].v_compute(e);return[r,o]},t.prototype._get_ranges=function(t,e){var i={};if(i.default=t,null!=e)for(var n in e)i[n]=e[n];return i},t.prototype._get_scales=function(t,e,i){var n={};for(var r in e){var o=e[r];if(o instanceof u.DataRange1d||o instanceof c.Range1d){if(!(t instanceof h.LogScale||t instanceof l.LinearScale))throw new Error(\"Range \"+o.type+\" is incompatible is Scale \"+t.type);if(t instanceof a.CategoricalScale)throw new Error(\"Range \"+o.type+\" is incompatible is Scale \"+t.type)}if(o instanceof _.FactorRange&&!(t instanceof a.CategoricalScale))throw new Error(\"Range \"+o.type+\" is incompatible is Scale \"+t.type);t instanceof h.LogScale&&o instanceof u.DataRange1d&&(o.scale_hint=\"log\");var s=t.clone();s.setv({source_range:o,target_range:i}),n[r]=s}return n},t.prototype._configure_frame_ranges=function(){this._h_target=new c.Range1d({start:this._left.value,end:this._right.value}),this._v_target=new c.Range1d({start:this._bottom.value,end:this._top.value})},t.prototype._configure_scales=function(){this._configure_frame_ranges(),this._x_ranges=this._get_ranges(this.x_range,this.extra_x_ranges),this._y_ranges=this._get_ranges(this.y_range,this.extra_y_ranges),this._xscales=this._get_scales(this.x_scale,this._x_ranges,this._h_target),this._yscales=this._get_scales(this.y_scale,this._y_ranges,this._v_target)},t.prototype.update_scales=function(){for(var t in this._configure_frame_ranges(),this._xscales){var e=this._xscales[t];e.target_range=this._h_target}for(var i in this._yscales){var e=this._yscales[i];e.target_range=this._v_target}},Object.defineProperty(t.prototype,\"x_ranges\",{get:function(){return this._x_ranges},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"y_ranges\",{get:function(){return this._y_ranges},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"xscales\",{get:function(){return this._xscales},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"yscales\",{get:function(){return this._yscales},enumerable:!0,configurable:!0}),t}(r.LayoutCanvas);(i.CartesianFrame=s).initClass()},function(t,e,i){var n=t(89);i.Canvas=n.Canvas;var r=t(90);i.CartesianFrame=r.CartesianFrame},function(t,e,i){var n=t(387),r=t(93),o=t(15),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"CumSum\",this.define({field:[o.String],include_zero:[o.Boolean,!1]})},t.prototype._v_compute=function(t){var e=new Float64Array(t.get_length()||0),i=t.data[this.field],n=this.include_zero?1:0;e[0]=this.include_zero?0:i[0];for(var r=1;r<e.length;r++)e[r]=e[r-1]+i[r-n];return e},t}(r.Expression);(i.CumSum=s).initClass()},function(t,e,i){var n=t(387),r=t(57),o=function(i){function t(t){var e=i.call(this,t)||this;return e._connected={},e._result={},e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"Expression\"},t.prototype.initialize=function(){i.prototype.initialize.call(this),this._connected={},this._result={}},t.prototype.v_compute=function(t){var e=this;null==this._connected[t.id]&&(this.connect(t.change,function(){return delete e._result[t.id]}),this.connect(t.patching,function(){return delete e._result[t.id]}),this.connect(t.streaming,function(){return delete e._result[t.id]}),this._connected[t.id]=!0);var i=this._result[t.id];return null==i&&(this._result[t.id]=i=this._v_compute(t)),i},t}(r.Model);(i.Expression=o).initClass()},function(t,e,i){var n=t(93);i.Expression=n.Expression;var r=t(95);i.Stack=r.Stack;var o=t(92);i.CumSum=o.CumSum},function(t,e,i){var n=t(387),r=t(93),o=t(15),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Stack\",this.define({fields:[o.Array,[]]})},t.prototype._v_compute=function(t){for(var e=new Float64Array(t.get_length()||0),i=0,n=this.fields;i<n.length;i++)for(var r=n[i],o=0;o<t.data[r].length;o++){var s=t.data[r][o];e[o]+=s}return e},t}(r.Expression);(i.Stack=s).initClass()},function(t,e,i){var n=t(387),r=t(98),o=t(15),s=t(14),a=t(21),l=t(44),h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"BooleanFilter\",this.define({booleans:[o.Array,null]})},t.prototype.compute_indices=function(t){var e=this.booleans;return null!=e&&0<e.length?a.all(e,l.isBoolean)?(e.length!==t.get_length()&&s.logger.warn(\"BooleanFilter \"+this.id+\": length of booleans doesn't match data source\"),a.range(0,e.length).filter(function(t){return!0===e[t]})):(s.logger.warn(\"BooleanFilter \"+this.id+\": booleans should be array of booleans, defaulting to no filtering\"),null):(null!=e&&0==e.length?s.logger.warn(\"BooleanFilter \"+this.id+\": booleans is empty, defaulting to no filtering\"):s.logger.warn(\"BooleanFilter \"+this.id+\": booleans was not set, defaulting to no filtering\"),null)},t}(r.Filter);(i.BooleanFilter=h).initClass()},function(i,t,e){var n=i(387),r=i(98),o=i(15),s=i(32),a=i(38),l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"CustomJSFilter\",this.define({args:[o.Any,{}],code:[o.String,\"\"],use_strict:[o.Boolean,!1]})},Object.defineProperty(t.prototype,\"names\",{get:function(){return s.keys(this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"values\",{get:function(){return s.values(this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"func\",{get:function(){var t=this.use_strict?a.use_strict(this.code):this.code;return new(Function.bind.apply(Function,[void 0].concat(this.names,[\"source\",\"require\",\"exports\",t])))},enumerable:!0,configurable:!0}),t.prototype.compute_indices=function(t){return this.filter=this.func.apply(this,this.values.concat([t,i,{}])),e.prototype.compute_indices.call(this,t)},t}(r.Filter);(e.CustomJSFilter=l).initClass()},function(t,e,i){var n=t(387),r=t(57),o=t(15),s=t(44),a=t(21),l=t(14),h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Filter\",this.define({filter:[o.Array,null]})},t.prototype.compute_indices=function(t){var e=this.filter;return null!=e&&0<=e.length?s.isArrayOf(e,s.isBoolean)?a.range(0,e.length).filter(function(t){return!0===e[t]}):s.isArrayOf(e,s.isInteger)?e:(l.logger.warn(\"Filter \"+this.id+\": filter should either be array of only booleans or only integers, defaulting to no filtering\"),null):(l.logger.warn(\"Filter \"+this.id+\": filter was not set to be an array, defaulting to no filtering\"),null)},t}(r.Model);(i.Filter=h).initClass()},function(t,e,i){var n=t(387),r=t(98),o=t(15),s=t(14),a=t(21),l=function(i){function t(t){var e=i.call(this,t)||this;return e.indices=null,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"GroupFilter\",this.define({column_name:[o.String],group:[o.String]})},t.prototype.compute_indices=function(t){var e=this,i=t.get_column(this.column_name);return null==i?(s.logger.warn(\"group filter: groupby column not found in data source\"),null):(this.indices=a.range(0,t.get_length()||0).filter(function(t){return i[t]===e.group}),0===this.indices.length&&s.logger.warn(\"group filter: group '\"+this.group+\"' did not match any values in column '\"+this.column_name+\"'\"),this.indices)},t}(r.Filter);(i.GroupFilter=l).initClass()},function(t,e,i){var n=t(96);i.BooleanFilter=n.BooleanFilter;var r=t(97);i.CustomJSFilter=r.CustomJSFilter;var o=t(98);i.Filter=o.Filter;var s=t(99);i.GroupFilter=s.GroupFilter;var a=t(101);i.IndexFilter=a.IndexFilter},function(t,e,i){var n=t(387),r=t(98),o=t(15),s=t(14),a=t(44),l=t(21),h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"IndexFilter\",this.define({indices:[o.Array,null]})},t.prototype.compute_indices=function(t){return null!=this.indices&&0<=this.indices.length?l.all(this.indices,a.isInteger)?this.indices:(s.logger.warn(\"IndexFilter \"+this.id+\": indices should be array of integers, defaulting to no filtering\"),null):(s.logger.warn(\"IndexFilter \"+this.id+\": indices was not set, defaulting to no filtering\"),null)},t}(r.Filter);(i.IndexFilter=h).initClass()},function(t,e,i){var n=t(387),r=t(111),o=t(15),f=t(44),s=function(i){function t(t){var e=i.call(this,t)||this;return e.last_precision=3,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"BasicTickFormatter\",this.define({precision:[o.Any,\"auto\"],use_scientific:[o.Bool,!0],power_limit_high:[o.Number,5],power_limit_low:[o.Number,-3]})},Object.defineProperty(t.prototype,\"scientific_limit_low\",{get:function(){return Math.pow(10,this.power_limit_low)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"scientific_limit_high\",{get:function(){return Math.pow(10,this.power_limit_high)},enumerable:!0,configurable:!0}),t.prototype.doFormat=function(t,e){if(0==t.length)return[];var i=0;2<=t.length&&(i=Math.abs(t[1]-t[0])/1e4);var n=!1;if(this.use_scientific)for(var r=0,o=t;r<o.length;r++){var s=o[r],a=Math.abs(s);if(i<a&&(a>=this.scientific_limit_high||a<=this.scientific_limit_low)){n=!0;break}}var l=new Array(t.length),h=this.precision;if(null==h||f.isNumber(h))if(n)for(var c=0,u=t.length;c<u;c++)l[c]=t[c].toExponential(h||void 0);else for(var c=0,u=t.length;c<u;c++)l[c]=t[c].toFixed(h||void 0).replace(/(\\.[0-9]*?)0+$/,\"$1\").replace(/\\.$/,\"\");else for(var _=this.last_precision,p=this.last_precision<=15;p?_<=15:15<=_;p?_++:_--){var d=!0;if(n){for(var c=0,u=t.length;c<u;c++)if(l[c]=t[c].toExponential(_),0<c&&l[c]===l[c-1]){d=!1;break}if(d)break}else{for(var c=0,u=t.length;c<u;c++)if(l[c]=t[c].toFixed(_).replace(/(\\.[0-9]*?)0+$/,\"$1\").replace(/\\.$/,\"\"),0<c&&l[c]==l[c-1]){d=!1;break}if(d)break}if(d){this.last_precision=_;break}}return l},t}(r.TickFormatter);(i.BasicTickFormatter=s).initClass()},function(t,e,i){var n=t(387),r=t(111),o=t(21),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"CategoricalTickFormatter\"},t.prototype.doFormat=function(t,e){return o.copy(t)},t}(r.TickFormatter);(i.CategoricalTickFormatter=s).initClass()},function(t,e,i){var n=t(387),r=t(385),w=t(386),o=t(111),k=t(14),s=t(15),a=t(21),l=t(44);function S(t,e){if(l.isFunction(e))return e(t);var i,n=r.sprintf(\"$1%06d\",(i=t,Math.round(i/1e3%1*1e6)));return-1==(e=e.replace(/((^|[^%])(%%)*)%f/,n)).indexOf(\"%\")?e:w(t,e)}var T=[\"microseconds\",\"milliseconds\",\"seconds\",\"minsec\",\"minutes\",\"hourmin\",\"hours\",\"days\",\"months\",\"years\"],h=function(i){function t(t){var e=i.call(this,t)||this;return e.strip_leading_zeros=!0,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"DatetimeTickFormatter\",this.define({microseconds:[s.Array,[\"%fus\"]],milliseconds:[s.Array,[\"%3Nms\",\"%S.%3Ns\"]],seconds:[s.Array,[\"%Ss\"]],minsec:[s.Array,[\":%M:%S\"]],minutes:[s.Array,[\":%M\",\"%Mm\"]],hourmin:[s.Array,[\"%H:%M\"]],hours:[s.Array,[\"%Hh\",\"%H:%M\"]],days:[s.Array,[\"%m/%d\",\"%a%d\"]],months:[s.Array,[\"%m/%Y\",\"%b %Y\"]],years:[s.Array,[\"%Y\"]]})},t.prototype.initialize=function(){i.prototype.initialize.call(this),this._update_width_formats()},t.prototype._update_width_formats=function(){var n=+w(new Date),t=function(t){var e=t.map(function(t){return S(n,t).length}),i=a.sortBy(a.zip(e,t),function(t){var e=t[0];return e});return a.unzip(i)};this._width_formats={microseconds:t(this.microseconds),milliseconds:t(this.milliseconds),seconds:t(this.seconds),minsec:t(this.minsec),minutes:t(this.minutes),hourmin:t(this.hourmin),hours:t(this.hours),days:t(this.days),months:t(this.months),years:t(this.years)}},t.prototype._get_resolution_str=function(t,e){var i=1.1*t;switch(!1){case!(i<.001):return\"microseconds\";case!(i<1):return\"milliseconds\";case!(i<60):return 60<=e?\"minsec\":\"seconds\";case!(i<3600):return 3600<=e?\"hourmin\":\"minutes\";case!(i<86400):return\"hours\";case!(i<2678400):return\"days\";case!(i<31536e3):return\"months\";default:return\"years\"}},t.prototype.doFormat=function(t,e){if(0==t.length)return[];for(var i=Math.abs(t[t.length-1]-t[0])/1e3,n=i/(t.length-1),r=this._get_resolution_str(n,i),o=this._width_formats[r],s=o[1][0],a=[],l=T.indexOf(r),h={},c=0,u=T;c<u.length;c++){var _=u[c];h[_]=0}h.seconds=5,h.minsec=4,h.minutes=4,h.hourmin=3,h.hours=3;for(var p=0,d=t;p<d.length;p++){var f=d[p],v=void 0,m=void 0;try{m=w(f,\"%Y %m %d %H %M %S\").split(/\\s+/).map(function(t){return parseInt(t,10)}),v=S(f,s)}catch(t){k.logger.warn(\"unable to format tick for timestamp value \"+f),k.logger.warn(\" - \"+t),a.push(\"ERR\");continue}for(var g=!1,y=l;0==m[h[T[y]]];){var b=void 0;if((y+=1)==T.length)break;if((\"minsec\"==r||\"hourmin\"==r)&&!g){if(\"minsec\"==r&&0==m[4]&&0!=m[5]||\"hourmin\"==r&&0==m[3]&&0!=m[4]){b=this._width_formats[T[l-1]][1][0],v=S(f,b);break}g=!0}b=this._width_formats[T[y]][1][0],v=S(f,b)}if(this.strip_leading_zeros){var x=v.replace(/^0+/g,\"\");x!=v&&isNaN(parseInt(x))&&(x=\"0\"+x),a.push(x)}else a.push(v)}return a},t}(o.TickFormatter);(i.DatetimeTickFormatter=h).initClass()},function(o,t,e){var i=o(387),n=o(111),r=o(15),s=o(32),a=o(38),l=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"FuncTickFormatter\",this.define({args:[r.Any,{}],code:[r.String,\"\"],use_strict:[r.Boolean,!1]})},Object.defineProperty(t.prototype,\"names\",{get:function(){return s.keys(this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"values\",{get:function(){return s.values(this.args)},enumerable:!0,configurable:!0}),t.prototype._make_func=function(){var t=this.use_strict?a.use_strict(this.code):this.code;return new(Function.bind.apply(Function,[void 0,\"tick\",\"index\",\"ticks\"].concat(this.names,[\"require\",\"exports\",t])))},t.prototype.doFormat=function(t,e){var n=this,r=this._make_func().bind({});return t.map(function(t,e,i){return r.apply(void 0,[t,e,i].concat(n.values,[o,{}]))})},t}(n.TickFormatter);(e.FuncTickFormatter=l).initClass()},function(t,e,i){var n=t(102);i.BasicTickFormatter=n.BasicTickFormatter;var r=t(103);i.CategoricalTickFormatter=r.CategoricalTickFormatter;var o=t(104);i.DatetimeTickFormatter=o.DatetimeTickFormatter;var s=t(105);i.FuncTickFormatter=s.FuncTickFormatter;var a=t(107);i.LogTickFormatter=a.LogTickFormatter;var l=t(108);i.MercatorTickFormatter=l.MercatorTickFormatter;var h=t(109);i.NumeralTickFormatter=h.NumeralTickFormatter;var c=t(110);i.PrintfTickFormatter=c.PrintfTickFormatter;var u=t(111);i.TickFormatter=u.TickFormatter},function(t,e,i){var n=t(387),r=t(111),o=t(102),s=t(14),a=t(15),l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LogTickFormatter\",this.define({ticker:[a.Instance,null]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.basic_formatter=new o.BasicTickFormatter,null==this.ticker&&s.logger.warn(\"LogTickFormatter not configured with a ticker, using default base of 10 (labels will be incorrect if ticker base is not 10)\")},t.prototype.doFormat=function(t,e){if(0==t.length)return[];for(var i=null!=this.ticker?this.ticker.base:10,n=!1,r=new Array(t.length),o=0,s=t.length;o<s;o++)if(r[o]=i+\"^\"+Math.round(Math.log(t[o])/Math.log(i)),0<o&&r[o]==r[o-1]){n=!0;break}return n?this.basic_formatter.doFormat(t,e):r},t}(r.TickFormatter);(i.LogTickFormatter=l).initClass()},function(t,e,i){var n=t(387),r=t(102),o=t(15),h=t(33),s=function(l){function t(t){return l.call(this,t)||this}return n.__extends(t,l),t.initClass=function(){this.prototype.type=\"MercatorTickFormatter\",this.define({dimension:[o.LatLon]})},t.prototype.doFormat=function(t,e){if(null==this.dimension)throw new Error(\"MercatorTickFormatter.dimension not configured\");if(0==t.length)return[];var i=t.length,n=new Array(i);if(\"lon\"==this.dimension)for(var r=0;r<i;r++){var o=h.wgs84_mercator.inverse([t[r],e.loc])[0];n[r]=o}else for(var r=0;r<i;r++){var s=h.wgs84_mercator.inverse([e.loc,t[r]]),a=s[1];n[r]=a}return l.prototype.doFormat.call(this,n,e)},t}(r.BasicTickFormatter);(i.MercatorTickFormatter=s).initClass()},function(t,e,i){var n=t(387),o=t(357),r=t(111),s=t(15),a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"NumeralTickFormatter\",this.define({format:[s.String,\"0,0\"],language:[s.String,\"en\"],rounding:[s.String,\"round\"]})},Object.defineProperty(t.prototype,\"_rounding_fn\",{get:function(){switch(this.rounding){case\"round\":case\"nearest\":return Math.round;case\"floor\":case\"rounddown\":return Math.floor;case\"ceil\":case\"roundup\":return Math.ceil}},enumerable:!0,configurable:!0}),t.prototype.doFormat=function(t,e){var i=this.format,n=this.language,r=this._rounding_fn;return t.map(function(t){return o.format(t,i,n,r)})},t}(r.TickFormatter);(i.NumeralTickFormatter=a).initClass()},function(t,e,i){var n=t(387),r=t(385),o=t(111),s=t(15),a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"PrintfTickFormatter\",this.define({format:[s.String,\"%s\"]})},t.prototype.doFormat=function(t,e){var i=this;return t.map(function(t){return r.sprintf(i.format,t)})},t}(o.TickFormatter);(i.PrintfTickFormatter=a).initClass()},function(t,e,i){var n=t(387),r=t(57),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"TickFormatter\"},t}(r.Model);(i.TickFormatter=o).initClass()},function(t,e,i){var n=t(387),r=t(141),o=t(138),z=t(9),s=t(15),P=t(31),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){\"data\"==this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,this._x,this._inner_radius):this.sinner_radius=this._inner_radius,\"data\"==this.model.properties.outer_radius.units?this.souter_radius=this.sdist(this.renderer.xscale,this._x,this._outer_radius):this.souter_radius=this._outer_radius,this._angle=new Float32Array(this._start_angle.length);for(var t=0,e=this._start_angle.length;t<e;t++)this._angle[t]=this._end_angle[t]-this._start_angle[t]},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i._start_angle,s=i._angle,a=i.sinner_radius,l=i.souter_radius,h=this.model.properties.direction.value(),c=0,u=e;c<u.length;c++){var _=u[c];isNaN(n[_]+r[_]+a[_]+l[_]+o[_]+s[_])||(t.translate(n[_],r[_]),t.rotate(o[_]),t.moveTo(l[_],0),t.beginPath(),t.arc(0,0,l[_],0,s[_],h),t.rotate(s[_]),t.lineTo(a[_],0),t.arc(0,0,a[_],0,-s[_],!h),t.closePath(),t.rotate(-s[_]-o[_]),t.translate(-n[_],-r[_]),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,_),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,_),t.stroke()))}},e.prototype._hit_point=function(t){var e,i,n,r,o,s,a=t.sx,l=t.sy,h=this.renderer.xscale.invert(a),c=this.renderer.yscale.invert(l);if(\"data\"==this.model.properties.outer_radius.units)n=h-this.max_outer_radius,o=h+this.max_outer_radius,r=c-this.max_outer_radius,s=c+this.max_outer_radius;else{var u=a-this.max_outer_radius,_=a+this.max_outer_radius;e=this.renderer.xscale.r_invert(u,_),n=e[0],o=e[1];var p=l-this.max_outer_radius,d=l+this.max_outer_radius;i=this.renderer.yscale.r_invert(p,d),r=i[0],s=i[1]}for(var f=[],v=z.validate_bbox_coords([n,o],[r,s]),m=0,g=this.index.indices(v);m<g.length;m++){var y=g[m],b=Math.pow(this.souter_radius[y],2),x=Math.pow(this.sinner_radius[y],2),w=this.renderer.xscale.r_compute(h,this._x[y]),u=w[0],_=w[1],k=this.renderer.yscale.r_compute(c,this._y[y]),p=k[0],d=k[1],S=Math.pow(u-_,2)+Math.pow(p-d,2);S<=b&&x<=S&&f.push([y,S])}for(var T=this.model.properties.direction.value(),C=[],A=0,E=f;A<E.length;A++){var M=E[A],y=M[0],S=M[1],O=Math.atan2(l-this.sy[y],a-this.sx[y]);P.angle_between(-O,-this._start_angle[y],-this._end_angle[y],T)&&C.push([y,S])}return z.create_hit_test_result_from_hits(C)},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e.prototype._scenterxy=function(t){var e=(this.sinner_radius[t]+this.souter_radius[t])/2,i=(this._start_angle[t]+this._end_angle[t])/2;return{x:this.sx[t]+e*Math.cos(i),y:this.sy[t]+e*Math.sin(i)}},e.prototype.scenterx=function(t){return this._scenterxy(t).x},e.prototype.scentery=function(t){return this._scenterxy(t).y},e}(r.XYGlyphView);i.AnnularWedgeView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"AnnularWedge\",this.prototype.default_view=a,this.mixins([\"line\",\"fill\"]),this.define({direction:[s.Direction,\"anticlock\"],inner_radius:[s.DistanceSpec],outer_radius:[s.DistanceSpec],start_angle:[s.AngleSpec],end_angle:[s.AngleSpec]})},t}(r.XYGlyph);(i.AnnularWedge=l).initClass()},function(t,e,i){var n=t(387),r=t(141),k=t(9),o=t(15),p=t(28),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){\"data\"==this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,this._x,this._inner_radius):this.sinner_radius=this._inner_radius,\"data\"==this.model.properties.outer_radius.units?this.souter_radius=this.sdist(this.renderer.xscale,this._x,this._outer_radius):this.souter_radius=this._outer_radius},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sinner_radius,s=i.souter_radius,a=0,l=e;a<l.length;a++){var h=l[a];if(!isNaN(n[h]+r[h]+o[h]+s[h])){if(this.visuals.fill.doit){if(this.visuals.fill.set_vectorize(t,h),t.beginPath(),p.is_ie)for(var c=0,u=[!1,!0];c<u.length;c++){var _=u[c];t.arc(n[h],r[h],o[h],0,Math.PI,_),t.arc(n[h],r[h],s[h],Math.PI,0,!_)}else t.arc(n[h],r[h],o[h],0,2*Math.PI,!0),t.arc(n[h],r[h],s[h],2*Math.PI,0,!1);t.fill()}this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,h),t.beginPath(),t.arc(n[h],r[h],o[h],0,2*Math.PI),t.moveTo(n[h]+s[h],r[h]),t.arc(n[h],r[h],s[h],0,2*Math.PI),t.stroke())}}},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=n-this.max_outer_radius,o=n+this.max_outer_radius,s=this.renderer.yscale.invert(i),a=s-this.max_outer_radius,l=s+this.max_outer_radius,h=[],c=k.validate_bbox_coords([r,o],[a,l]),u=0,_=this.index.indices(c);u<_.length;u++){var p=_[u],d=Math.pow(this.souter_radius[p],2),f=Math.pow(this.sinner_radius[p],2),v=this.renderer.xscale.r_compute(n,this._x[p]),m=v[0],g=v[1],y=this.renderer.yscale.r_compute(s,this._y[p]),b=y[0],x=y[1],w=Math.pow(m-g,2)+Math.pow(b-x,2);w<=d&&f<=w&&h.push([p,w])}return k.create_hit_test_result_from_hits(h)},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.y0,o=e.x1,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+o)/2;var h=new Array(a);h[i]=(r+s)/2;var c=.5*Math.min(Math.abs(o-n),Math.abs(s-r)),u=new Array(a);u[i]=.4*c;var _=new Array(a);_[i]=.8*c,this._render(t,[i],{sx:l,sy:h,sinner_radius:u,souter_radius:_})},e}(r.XYGlyphView);i.AnnulusView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Annulus\",this.prototype.default_view=s,this.mixins([\"line\",\"fill\"]),this.define({inner_radius:[o.DistanceSpec],outer_radius:[o.DistanceSpec]})},t}(r.XYGlyph);(i.Annulus=a).initClass()},function(t,e,i){var n=t(387),r=t(141),o=t(138),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){\"data\"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy,o=i.sradius,s=i._start_angle,a=i._end_angle;if(this.visuals.line.doit)for(var l=this.model.properties.direction.value(),h=0,c=e;h<c.length;h++){var u=c[h];isNaN(n[u]+r[u]+o[u]+s[u]+a[u])||(t.beginPath(),t.arc(n[u],r[u],o[u],s[u],a[u],l),this.visuals.line.set_vectorize(t,u),t.stroke())}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.ArcView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Arc\",this.prototype.default_view=a,this.mixins([\"line\"]),this.define({direction:[s.Direction,\"anticlock\"],radius:[s.DistanceSpec],start_angle:[s.AngleSpec],end_angle:[s.AngleSpec]})},t}(r.XYGlyph);(i.Arc=l).initClass()},function(t,e,i){var n=t(387),l=t(37),r=t(119),o=t(138);function h(t,e,i,n,r,o,s,a){for(var l=[],h=[[],[]],c=0;c<=2;c++){var u=void 0,_=void 0,p=void 0;if(0===c?(_=6*t-12*i+6*r,u=-3*t+9*i-9*r+3*s,p=3*i-3*t):(_=6*e-12*n+6*o,u=-3*e+9*n-9*o+3*a,p=3*n-3*e),Math.abs(u)<1e-12){if(Math.abs(_)<1e-12)continue;var d=-p/_;0<d&&d<1&&l.push(d)}else{var f=_*_-4*p*u,v=Math.sqrt(f);if(!(f<0)){var m=(-_+v)/(2*u);0<m&&m<1&&l.push(m);var g=(-_-v)/(2*u);0<g&&g<1&&l.push(g)}}}for(var y=l.length,b=y;y--;){var d=l[y],x=1-d,w=x*x*x*t+3*x*x*d*i+3*x*d*d*r+d*d*d*s;h[0][y]=w;var k=x*x*x*e+3*x*x*d*n+3*x*d*d*o+d*d*d*a;h[1][y]=k}return h[0][b]=t,h[1][b]=e,h[0][b+1]=s,h[1][b+1]=a,[Math.min.apply(Math,h[0]),Math.max.apply(Math,h[1]),Math.max.apply(Math,h[0]),Math.min.apply(Math,h[1])]}var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._x0.length;e<i;e++)if(!isNaN(this._x0[e]+this._x1[e]+this._y0[e]+this._y1[e]+this._cx0[e]+this._cy0[e]+this._cx1[e]+this._cy1[e])){var n=h(this._x0[e],this._y0[e],this._x1[e],this._y1[e],this._cx0[e],this._cy0[e],this._cx1[e],this._cy1[e]),r=n[0],o=n[1],s=n[2],a=n[3];t.push({minX:r,minY:o,maxX:s,maxY:a,i:e})}return new l.SpatialIndex(t)},e.prototype._render=function(t,e,i){var n=i.sx0,r=i.sy0,o=i.sx1,s=i.sy1,a=i.scx0,l=i.scy0,h=i.scx1,c=i.scy1;if(this.visuals.line.doit)for(var u=0,_=e;u<_.length;u++){var p=_[u];isNaN(n[p]+r[p]+o[p]+s[p]+a[p]+l[p]+h[p]+c[p])||(t.beginPath(),t.moveTo(n[p],r[p]),t.bezierCurveTo(a[p],l[p],h[p],c[p],o[p],s[p]),this.visuals.line.set_vectorize(t,p),t.stroke())}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e.prototype.scenterx=function(){throw new Error(\"not implemented\")},e.prototype.scentery=function(){throw new Error(\"not implemented\")},e}(r.GlyphView);i.BezierView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Bezier\",this.prototype.default_view=s,this.coords([[\"x0\",\"y0\"],[\"x1\",\"y1\"],[\"cx0\",\"cy0\"],[\"cx1\",\"cy1\"]]),this.mixins([\"line\"])},t}(r.Glyph);(i.Bezier=a).initClass()},function(t,e,i){var n=t(387),l=t(37),r=t(119),o=t(138),f=t(9),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_box=function(t){for(var e=[],i=0;i<t;i++){var n=this._lrtb(i),r=n[0],o=n[1],s=n[2],a=n[3];!isNaN(r+o+s+a)&&isFinite(r+o+s+a)&&e.push({minX:r,minY:a,maxX:o,maxY:s,i:i})}return new l.SpatialIndex(e)},e.prototype._render=function(t,e,i){for(var n=i.sleft,r=i.sright,o=i.stop,s=i.sbottom,a=0,l=e;a<l.length;a++){var h=l[a];isNaN(n[h]+o[h]+r[h]+s[h])||(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,h),t.fillRect(n[h],o[h],r[h]-n[h],s[h]-o[h])),this.visuals.line.doit&&(t.beginPath(),t.rect(n[h],o[h],r[h]-n[h],s[h]-o[h]),this.visuals.line.set_vectorize(t,h),t.stroke()))}},e.prototype._hit_rect=function(t){return this._hit_rect_against_index(t)},e.prototype._hit_point=function(t){var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),o=this.index.indices({minX:n,minY:r,maxX:n,maxY:r}),s=f.create_empty_hit_test_result();return s.indices=o,s},e.prototype._hit_span=function(t){var e,i=t.sx,n=t.sy;if(\"v\"==t.direction){var r=this.renderer.yscale.invert(n),o=this.renderer.plot_view.frame.bbox.h_range,s=this.renderer.xscale.r_invert(o.start,o.end),a=s[0],l=s[1];e=this.index.indices({minX:a,minY:r,maxX:l,maxY:r})}else{var h=this.renderer.xscale.invert(i),c=this.renderer.plot_view.frame.bbox.v_range,u=this.renderer.yscale.r_invert(c.start,c.end),_=u[0],p=u[1];e=this.index.indices({minX:h,minY:_,maxX:h,maxY:p})}var d=f.create_empty_hit_test_result();return d.indices=e,d},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e}(r.GlyphView);i.BoxView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Box\",this.mixins([\"line\",\"fill\"])},t}(r.Glyph);(i.Box=a).initClass()},function(t,e,i){var n=t(387),r=t(141),M=t(9),o=t(15),h=t(21),s=t(22),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){if(null!=this._radius)if(\"data\"==this.model.properties.radius.spec.units){var t=this.model.properties.radius_dimension.spec.value;switch(t){case\"x\":this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius);break;case\"y\":this.sradius=this.sdist(this.renderer.yscale,this._y,this._radius)}}else this.sradius=this._radius,this.max_size=2*this.max_radius;else this.sradius=s.map(this._size,function(t){return t/2})},e.prototype._mask_data=function(){var t,e,i,n,r,o,s,a,l=this.renderer.plot_view.frame.bbox.ranges,h=l[0],c=l[1];if(null!=this._radius&&\"data\"==this.model.properties.radius.units){var u=h.start,_=h.end;t=this.renderer.xscale.r_invert(u,_),r=t[0],s=t[1],r-=this.max_radius,s+=this.max_radius;var p=c.start,d=c.end;e=this.renderer.yscale.r_invert(p,d),o=e[0],a=e[1],o-=this.max_radius,a+=this.max_radius}else{var u=h.start-this.max_size,_=h.end+this.max_size;i=this.renderer.xscale.r_invert(u,_),r=i[0],s=i[1];var p=c.start-this.max_size,d=c.end+this.max_size;n=this.renderer.yscale.r_invert(p,d),o=n[0],a=n[1]}var f=M.validate_bbox_coords([r,s],[o,a]);return this.index.indices(f)},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sradius,s=0,a=e;s<a.length;s++){var l=a[s];isNaN(n[l]+r[l]+o[l])||(t.beginPath(),t.arc(n[l],r[l],o[l],0,2*Math.PI,!1),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,l),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,l),t.stroke()))}},e.prototype._hit_point=function(t){var e,i,n,r,o,s,a,l,h,c,u,_,p,d,f,v,m=t.sx,g=t.sy,y=this.renderer.xscale.invert(m),b=this.renderer.yscale.invert(g);null!=this._radius&&\"data\"==this.model.properties.radius.units?(p=y-this.max_radius,d=y+this.max_radius,f=b-this.max_radius,v=b+this.max_radius):(h=m-this.max_size,c=m+this.max_size,e=this.renderer.xscale.r_invert(h,c),p=e[0],d=e[1],i=[Math.min(p,d),Math.max(p,d)],p=i[0],d=i[1],u=g-this.max_size,_=g+this.max_size,n=this.renderer.yscale.r_invert(u,_),f=n[0],v=n[1],r=[Math.min(f,v),Math.max(f,v)],f=r[0],v=r[1]);var x=M.validate_bbox_coords([p,d],[f,v]),w=this.index.indices(x),k=[];if(null!=this._radius&&\"data\"==this.model.properties.radius.units)for(var S=0,T=w;S<T.length;S++){var C=T[S];l=Math.pow(this.sradius[C],2),o=this.renderer.xscale.r_compute(y,this._x[C]),h=o[0],c=o[1],s=this.renderer.yscale.r_compute(b,this._y[C]),u=s[0],_=s[1],(a=Math.pow(h-c,2)+Math.pow(u-_,2))<=l&&k.push([C,a])}else for(var A=0,E=w;A<E.length;A++){var C=E[A];l=Math.pow(this.sradius[C],2),(a=Math.pow(this.sx[C]-m,2)+Math.pow(this.sy[C]-g,2))<=l&&k.push([C,a])}return M.create_hit_test_result_from_hits(k)},e.prototype._hit_span=function(t){var e,i,n,r,o,s,a,l,h,c=t.sx,u=t.sy,_=this.bounds(),p=_.minX,d=_.minY,f=_.maxX,v=_.maxY,m=M.create_empty_hit_test_result();if(\"h\"==t.direction){var g=void 0,y=void 0;l=d,h=v,null!=this._radius&&\"data\"==this.model.properties.radius.units?(g=c-this.max_radius,y=c+this.max_radius,e=this.renderer.xscale.r_invert(g,y),s=e[0],a=e[1]):(o=this.max_size/2,g=c-o,y=c+o,i=this.renderer.xscale.r_invert(g,y),s=i[0],a=i[1])}else{var b=void 0,x=void 0;s=p,a=f,null!=this._radius&&\"data\"==this.model.properties.radius.units?(b=u-this.max_radius,x=u+this.max_radius,n=this.renderer.yscale.r_invert(b,x),l=n[0],h=n[1]):(o=this.max_size/2,b=u-o,x=u+o,r=this.renderer.yscale.r_invert(b,x),l=r[0],h=r[1])}var w=M.validate_bbox_coords([s,a],[l,h]),k=this.index.indices(w);return m.indices=k,m},e.prototype._hit_rect=function(t){var e=t.sx0,i=t.sx1,n=t.sy0,r=t.sy1,o=this.renderer.xscale.r_invert(e,i),s=o[0],a=o[1],l=this.renderer.yscale.r_invert(n,r),h=l[0],c=l[1],u=M.validate_bbox_coords([s,a],[h,c]),_=M.create_empty_hit_test_result();return _.indices=this.index.indices(u),_},e.prototype._hit_poly=function(t){for(var e=t.sx,i=t.sy,n=h.range(0,this.sx.length),r=[],o=0,s=n.length;o<s;o++){var a=n[o];M.point_in_poly(this.sx[o],this.sy[o],e,i)&&r.push(a)}var l=M.create_empty_hit_test_result();return l.indices=r,l},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.y0,o=e.x1,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+o)/2;var h=new Array(a);h[i]=(r+s)/2;var c=new Array(a);c[i]=.2*Math.min(Math.abs(o-n),Math.abs(s-r)),this._render(t,[i],{sx:l,sy:h,sradius:c})},e}(r.XYGlyphView);i.CircleView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Circle\",this.prototype.default_view=a,this.mixins([\"line\",\"fill\"]),this.define({angle:[o.AngleSpec,0],size:[o.DistanceSpec,{units:\"screen\",value:4}],radius:[o.DistanceSpec,null],radius_dimension:[o.String,\"x\"]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.properties.radius.optional=!0},t}(r.XYGlyph);(i.Circle=l).initClass()},function(t,e,i){var n=t(387),r=t(141),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._set_data=function(){this.max_w2=0,\"data\"==this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,\"data\"==this.model.properties.height.units&&(this.max_h2=this.max_height/2)},e.prototype._map_data=function(){\"data\"==this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this._width,\"center\"):this.sw=this._width,\"data\"==this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this._height,\"center\"):this.sh=this._height},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sw,s=i.sh,a=0,l=e;a<l.length;a++){var h=l[a];isNaN(n[h]+r[h]+o[h]+s[h]+this._angle[h])||(t.beginPath(),t.ellipse(n[h],r[h],o[h]/2,s[h]/2,this._angle[h],0,2*Math.PI),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,h),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,h),t.stroke()))}},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.y0,o=e.x1,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+o)/2;var h=new Array(a);h[i]=(r+s)/2;var c=this.sw[i]/this.sh[i],u=.8*Math.min(Math.abs(o-n),Math.abs(s-r)),_=new Array(a),p=new Array(a);1<c?(_[i]=u,p[i]=u/c):(_[i]=u*c,p[i]=u),this._render(t,[i],{sx:l,sy:h,sw:_,sh:p})},e.prototype._bounds=function(t){var e=t.minX,i=t.maxX,n=t.minY,r=t.maxY;return{minX:e-this.max_w2,maxX:i+this.max_w2,minY:n-this.max_h2,maxY:r+this.max_h2}},e}(r.XYGlyphView);i.EllipseView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Ellipse\",this.prototype.default_view=s,this.mixins([\"line\",\"fill\"]),this.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},t}(r.XYGlyph);(i.Ellipse=a).initClass()},function(o,t,e){var i=o(387),p=o(9),l=o(15),h=o(24),m=o(33),s=o(49),n=o(48),r=o(57),a=o(14),g=o(22),y=o(32),d=o(44),b=o(126),x=o(171),c=function(r){function t(){var t=null!==r&&r.apply(this,arguments)||this;return t._nohit_warned={},t}return i.__extends(t,r),t.prototype.initialize=function(t){r.prototype.initialize.call(this,t),this._nohit_warned={},this.renderer=t.renderer,this.visuals=new s.Visuals(this.model);var e=this.renderer.plot_view.gl;if(null!=e){var i=null;try{i=o(448)}catch(t){if(\"MODULE_NOT_FOUND\"!==t.code)throw t;a.logger.warn(\"WebGL was requested and is supported, but bokeh-gl(.min).js is not available, falling back to 2D rendering.\")}if(null!=i){var n=i[this.model.type+\"GLGlyph\"];null!=n&&(this.glglyph=new n(e.ctx,this))}}},t.prototype.set_visuals=function(t){this.visuals.warm_cache(t),null!=this.glglyph&&this.glglyph.set_visuals_changed()},t.prototype.render=function(t,e,i){t.beginPath(),null!=this.glglyph&&this.glglyph.render(t,e,i)||this._render(t,e,i)},t.prototype.has_finished=function(){return!0},t.prototype.notify_finished=function(){this.renderer.notify_finished()},t.prototype._bounds=function(t){return t},t.prototype.bounds=function(){return this._bounds(this.index.bbox)},t.prototype.log_bounds=function(){for(var t=h.empty(),e=this.index.search(h.positive_x()),i=0,n=e;i<n.length;i++){var r=n[i];r.minX<t.minX&&(t.minX=r.minX),r.maxX>t.maxX&&(t.maxX=r.maxX)}for(var o=this.index.search(h.positive_y()),s=0,a=o;s<a.length;s++){var l=a[s];l.minY<t.minY&&(t.minY=l.minY),l.maxY>t.maxY&&(t.maxY=l.maxY)}return this._bounds(t)},t.prototype.get_anchor_point=function(t,e,i){var n=i[0],r=i[1];switch(t){case\"center\":return{x:this.scenterx(e,n,r),y:this.scentery(e,n,r)};default:return null}},t.prototype.sdist=function(t,e,i,n,r){var o,s;void 0===n&&(n=\"edge\"),void 0===r&&(r=!1);var a=e.length;if(\"center\"==n){var l=g.map(i,function(t){return t/2});o=new Float64Array(a);for(var h=0;h<a;h++)o[h]=e[h]-l[h];s=new Float64Array(a);for(var h=0;h<a;h++)s[h]=e[h]+l[h]}else{o=e,s=new Float64Array(a);for(var h=0;h<a;h++)s[h]=o[h]+i[h]}var c=t.v_compute(o),u=t.v_compute(s);return r?g.map(c,function(t,e){return Math.ceil(Math.abs(u[e]-c[e]))}):g.map(c,function(t,e){return Math.abs(u[e]-c[e])})},t.prototype.draw_legend_for_index=function(t,e,i){},t.prototype.hit_test=function(t){var e=null,i=\"_hit_\"+t.type;return null!=this[i]?e=this[i](t):null==this._nohit_warned[t.type]&&(a.logger.debug(\"'\"+t.type+\"' selection not available for \"+this.model.type),this._nohit_warned[t.type]=!0),e},t.prototype._hit_rect_against_index=function(t){var e=t.sx0,i=t.sx1,n=t.sy0,r=t.sy1,o=this.renderer.xscale.r_invert(e,i),s=o[0],a=o[1],l=this.renderer.yscale.r_invert(n,r),h=l[0],c=l[1],u=p.validate_bbox_coords([s,a],[h,c]),_=p.create_empty_hit_test_result();return _.indices=this.index.indices(u),_},t.prototype.set_data=function(t,i,e){var n,r,o=this.model.materialize_dataspecs(t);if(this.visuals.set_all_indices(i),i&&!(this instanceof b.LineView)){var s={},a=function(t){var e=o[t];\"_\"===t.charAt(0)?s[t]=i.map(function(t){return e[t]}):s[t]=e};for(var l in o)a(l);o=s}var h=this;if(y.extend(h,o),this.renderer.plot_view.model.use_map&&(null!=h._x&&(n=m.project_xy(h._x,h._y),h._x=n[0],h._y=n[1]),null!=h._xs&&(r=m.project_xsys(h._xs,h._ys),h._xs=r[0],h._ys=r[1])),null!=this.renderer.plot_view.frame.x_ranges)for(var c=this.renderer.plot_view.frame.x_ranges[this.model.x_range_name],u=this.renderer.plot_view.frame.y_ranges[this.model.y_range_name],_=0,p=this.model._coords;_<p.length;_++){var d=p[_],f=d[0],v=d[1];f=\"_\"+f,v=\"_\"+v,null!=h._xs?(c instanceof x.FactorRange&&(h[f]=g.map(h[f],function(t){return c.v_synthetic(t)})),u instanceof x.FactorRange&&(h[v]=g.map(h[v],function(t){return u.v_synthetic(t)}))):(c instanceof x.FactorRange&&(h[f]=c.v_synthetic(h[f])),u instanceof x.FactorRange&&(h[v]=u.v_synthetic(h[v])))}null!=this.glglyph&&this.glglyph.set_data_changed(h._x.length),this._set_data(e),this.index_data()},t.prototype._set_data=function(t){},t.prototype.index_data=function(){this.index=this._index_data()},t.prototype.mask_data=function(t){return null!=this.glglyph||null==this._mask_data?t:this._mask_data()},t.prototype.map_data=function(){for(var t,e=this,i=0,n=this.model._coords;i<n.length;i++){var r=n[i],o=r[0],s=r[1],a=\"s\"+o,l=\"s\"+s;if(s=\"_\"+s,null!=e[o=\"_\"+o]&&(d.isArray(e[o][0])||d.isTypedArray(e[o][0]))){var h=e[o].length;e[a]=new Array(h),e[l]=new Array(h);for(var c=0;c<h;c++){var u=this.map_to_screen(e[o][c],e[s][c]),_=u[0],p=u[1];e[a][c]=_,e[l][c]=p}}else t=this.map_to_screen(e[o],e[s]),e[a]=t[0],e[l]=t[1]}this._map_data()},t.prototype._map_data=function(){},t.prototype.map_to_screen=function(t,e){return this.renderer.plot_view.map_to_screen(t,e,this.model.x_range_name,this.model.y_range_name)},t}(n.View);e.GlyphView=c;var u=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"Glyph\",this.prototype._coords=[],this.internal({x_range_name:[l.String,\"default\"],y_range_name:[l.String,\"default\"]})},t.coords=function(t){var e=this.prototype._coords.concat(t);this.prototype._coords=e;for(var i={},n=0,r=t;n<r.length;n++){var o=r[n],s=o[0],a=o[1];i[s]=[l.NumberSpec],i[a]=[l.NumberSpec]}this.define(i)},t}(r.Model);(e.Glyph=u).initClass()},function(t,e,i){var n=t(387),r=t(116),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.scenterx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype.scentery=function(t){return this.sy[t]},e.prototype._index_data=function(){return this._index_box(this._y.length)},e.prototype._lrtb=function(t){var e=Math.min(this._left[t],this._right[t]),i=Math.max(this._left[t],this._right[t]),n=this._y[t]+.5*this._height[t],r=this._y[t]-.5*this._height[t];return[e,i,n,r]},e.prototype._map_data=function(){this.sy=this.renderer.yscale.v_compute(this._y),this.sh=this.sdist(this.renderer.yscale,this._y,this._height,\"center\"),this.sleft=this.renderer.xscale.v_compute(this._left),this.sright=this.renderer.xscale.v_compute(this._right);var t=this.sy.length;this.stop=new Float64Array(t),this.sbottom=new Float64Array(t);for(var e=0;e<t;e++)this.stop[e]=this.sy[e]-this.sh[e]/2,this.sbottom[e]=this.sy[e]+this.sh[e]/2},e}(r.BoxView);i.HBarView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"HBar\",this.prototype.default_view=s,this.coords([[\"left\",\"y\"]]),this.define({height:[o.DistanceSpec],right:[o.NumberSpec]}),this.override({left:0})},t}(r.Box);(i.HBar=a).initClass()},function(t,e,i){var n=t(387),r=t(119),f=t(9),o=t(15),a=t(37),s=t(138),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.scenterx=function(t){return this.sx[t]},e.prototype.scentery=function(t){return this.sy[t]},e.prototype._set_data=function(){var t=this._q.length,e=this.model.size,i=this.model.aspect_scale;if(this._x=new Float64Array(t),this._y=new Float64Array(t),\"pointytop\"==this.model.orientation)for(var n=0;n<t;n++)this._x[n]=e*Math.sqrt(3)*(this._q[n]+this._r[n]/2)/i,this._y[n]=3*-e/2*this._r[n];else for(var n=0;n<t;n++)this._x[n]=3*e/2*this._q[n],this._y[n]=-e*Math.sqrt(3)*(this._r[n]+this._q[n]/2)*i},e.prototype._index_data=function(){var t,e=this.model.size,i=Math.sqrt(3)*e/2;\"flattop\"==this.model.orientation?(i=(t=[e,i])[0],e=t[1],e*=this.model.aspect_scale):i/=this.model.aspect_scale;for(var n=[],r=0;r<this._x.length;r++){var o=this._x[r],s=this._y[r];!isNaN(o+s)&&isFinite(o+s)&&n.push({minX:o-i,minY:s-e,maxX:o+i,maxY:s+e,i:r})}return new a.SpatialIndex(n)},e.prototype.map_data=function(){var t,e;t=this.map_to_screen(this._x,this._y),this.sx=t[0],this.sy=t[1],e=this._get_unscaled_vertices(),this.svx=e[0],this.svy=e[1]},e.prototype._get_unscaled_vertices=function(){var t=this.model.size,e=this.model.aspect_scale;if(\"pointytop\"==this.model.orientation){var i=this.renderer.yscale,n=this.renderer.xscale,r=Math.abs(i.compute(0)-i.compute(t)),o=Math.sqrt(3)/2*Math.abs(n.compute(0)-n.compute(t))/e,s=r/2,a=[0,-o,-o,0,o,o],l=[r,s,-s,-r,-s,s];return[a,l]}var i=this.renderer.xscale,n=this.renderer.yscale,r=Math.abs(i.compute(0)-i.compute(t)),o=Math.sqrt(3)/2*Math.abs(n.compute(0)-n.compute(t))*e,s=r/2,a=[r,s,-s,-r,-s,s],l=[0,-o,-o,0,o,o];return[a,l]},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.svx,s=i.svy,a=i._scale,l=0,h=e;l<h.length;l++){var c=h[l];if(!isNaN(n[c]+r[c]+a[c])){t.translate(n[c],r[c]),t.beginPath();for(var u=0;u<6;u++)t.lineTo(o[u]*a[c],s[u]*a[c]);t.closePath(),t.translate(-n[c],-r[c]),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,c),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,c),t.stroke())}}},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),o=this.index.indices({minX:n,minY:r,maxX:n,maxY:r}),s=[],a=0,l=o;a<l.length;a++){var h=l[a];f.point_in_poly(e-this.sx[h],i-this.sy[h],this.svx,this.svy)&&s.push(h)}var c=f.create_empty_hit_test_result();return c.indices=s,c},e.prototype._hit_span=function(t){var e,i=t.sx,n=t.sy;if(\"v\"==t.direction){var r=this.renderer.yscale.invert(n),o=this.renderer.plot_view.frame.bbox.h_range,s=this.renderer.xscale.r_invert(o.start,o.end),a=s[0],l=s[1];e=this.index.indices({minX:a,minY:r,maxX:l,maxY:r})}else{var h=this.renderer.xscale.invert(i),c=this.renderer.plot_view.frame.bbox.v_range,u=this.renderer.yscale.r_invert(c.start,c.end),_=u[0],p=u[1];e=this.index.indices({minX:h,minY:_,maxX:h,maxY:p})}var d=f.create_empty_hit_test_result();return d.indices=e,d},e.prototype._hit_rect=function(t){var e=t.sx0,i=t.sx1,n=t.sy0,r=t.sy1,o=this.renderer.xscale.r_invert(e,i),s=o[0],a=o[1],l=this.renderer.yscale.r_invert(n,r),h=l[0],c=l[1],u=f.validate_bbox_coords([s,a],[h,c]),_=f.create_empty_hit_test_result();return _.indices=this.index.indices(u),_},e.prototype.draw_legend_for_index=function(t,e,i){s.generic_area_legend(this.visuals,t,e,i)},e}(r.GlyphView);i.HexTileView=l;var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"HexTile\",this.prototype.default_view=l,this.coords([[\"r\",\"q\"]]),this.mixins([\"line\",\"fill\"]),this.define({size:[o.Number,1],aspect_scale:[o.Number,1],scale:[o.NumberSpec,1],orientation:[o.String,\"pointytop\"]}),this.override({line_color:null})},t}(r.Glyph);(i.HexTile=h).initClass()},function(t,e,i){var n=t(387),r=t(141),o=t(160),s=t(15),u=t(21),l=t(37),_=t(9),a=function(i){function t(){return null!==i&&i.apply(this,arguments)||this}return n.__extends(t,i),t.prototype.initialize=function(t){var e=this;i.prototype.initialize.call(this,t),this.connect(this.model.color_mapper.change,function(){return e._update_image()}),this.connect(this.model.properties.global_alpha.change,function(){return e.renderer.request_render()})},t.prototype._update_image=function(){null!=this.image_data&&(this._set_data(),this.renderer.plot_view.request_render())},t.prototype._index_data=function(){for(var t=[],e=0,i=this._x.length;e<i;e++){var n=this._lrtb(e),r=n[0],o=n[1],s=n[2],a=n[3];!isNaN(r+o+s+a)&&isFinite(r+o+s+a)&&t.push({minX:r,minY:a,maxX:o,maxY:s,i:e})}return new l.SpatialIndex(t)},t.prototype._lrtb=function(t){var e=this._x[t],i=e+this._dw[t],n=this._y[t],r=n+this._dh[t];return[e,i,r,n]},t.prototype._image_index=function(t,e,i){var n=this._lrtb(t),r=n[0],o=n[1],s=n[2],a=n[3],l=this._width[t],h=this._height[t],c=(o-r)/l,u=(s-a)/h,_=Math.floor((e-r)/c),p=Math.floor((i-a)/u);return{index:t,dim1:_,dim2:p,flat_index:p*l+_}},t.prototype._hit_point=function(t){var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),o=_.validate_bbox_coords([n,n],[r,r]),s=this.index.indices(o),a=_.create_empty_hit_test_result();a.image_indices=[];for(var l=0,h=s;l<h.length;l++){var c=h[l];e!=1/0&&i!=1/0&&a.image_indices.push(this._image_index(c,n,r))}return a},t.prototype._set_data=function(){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));for(var t=this.model.color_mapper.rgba_mapper,e=0,i=this._image.length;e<i;e++){var n=void 0;if(null!=this._image_shape&&0<this._image_shape[e].length){n=this._image[e];var r=this._image_shape[e];this._height[e]=r[0],this._width[e]=r[1]}else{var o=this._image[e];n=u.concat(o),this._height[e]=o.length,this._width[e]=o[0].length}var s=this.image_data[e],a=void 0;null!=s&&s.width==this._width[e]&&s.height==this._height[e]?a=s:((a=document.createElement(\"canvas\")).width=this._width[e],a.height=this._height[e]);var l=a.getContext(\"2d\"),h=l.getImageData(0,0,this._width[e],this._height[e]),c=t.v_compute(n);h.data.set(c),l.putImageData(h,0,0),this.image_data[e]=a,this.max_dw=0,\"data\"==this.model.properties.dw.units&&(this.max_dw=u.max(this._dw)),this.max_dh=0,\"data\"==this.model.properties.dh.units&&(this.max_dh=u.max(this._dh))}},t.prototype._map_data=function(){switch(this.model.properties.dw.units){case\"data\":this.sw=this.sdist(this.renderer.xscale,this._x,this._dw,\"edge\",this.model.dilate);break;case\"screen\":this.sw=this._dw}switch(this.model.properties.dh.units){case\"data\":this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,\"edge\",this.model.dilate);break;case\"screen\":this.sh=this._dh}},t.prototype._render=function(t,e,i){var n=i.image_data,r=i.sx,o=i.sy,s=i.sw,a=i.sh,l=t.getImageSmoothingEnabled();t.setImageSmoothingEnabled(!1),t.globalAlpha=this.model.global_alpha;for(var h=0,c=e;h<c.length;h++){var u=c[h];if(null!=n[u]&&!isNaN(r[u]+o[u]+s[u]+a[u])){var _=o[u];t.translate(0,_),t.scale(1,-1),t.translate(0,-_),t.drawImage(n[u],0|r[u],0|o[u],s[u],a[u]),t.translate(0,_),t.scale(1,-1),t.translate(0,-_)}}t.setImageSmoothingEnabled(l)},t.prototype.bounds=function(){var t=this.index.bbox;return t.maxX+=this.max_dw,t.maxY+=this.max_dh,t},t}(r.XYGlyphView);i.ImageView=a;var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Image\",this.prototype.default_view=a,this.define({image:[s.NumberSpec],dw:[s.DistanceSpec],dh:[s.DistanceSpec],dilate:[s.Bool,!1],global_alpha:[s.Number,1],color_mapper:[s.Instance,function(){return new o.LinearColorMapper({palette:[\"#000000\",\"#252525\",\"#525252\",\"#737373\",\"#969696\",\"#bdbdbd\",\"#d9d9d9\",\"#f0f0f0\",\"#ffffff\"]})}]})},t}(r.XYGlyph);(i.Image=h).initClass()},function(t,e,i){var n=t(387),r=t(141),o=t(15),f=t(21),s=function(i){function t(){return null!==i&&i.apply(this,arguments)||this}return n.__extends(t,i),t.prototype.initialize=function(t){var e=this;i.prototype.initialize.call(this,t),this.connect(this.model.properties.global_alpha.change,function(){return e.renderer.request_render()})},t.prototype._set_data=function(t){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));for(var e=0,i=this._image.length;e<i;e++)if(!(null!=t&&t.indexOf(e)<0)){var n=void 0;if(null!=this._image_shape&&0<this._image_shape[e].length){n=this._image[e].buffer;var r=this._image_shape[e];this._height[e]=r[0],this._width[e]=r[1]}else{var o=this._image[e],s=f.concat(o);n=new ArrayBuffer(4*s.length);for(var a=new Uint32Array(n),l=0,h=s.length;l<h;l++)a[l]=s[l];this._height[e]=o.length,this._width[e]=o[0].length}var c=this.image_data[e],u=void 0;null!=c&&c.width==this._width[e]&&c.height==this._height[e]?u=c:((u=document.createElement(\"canvas\")).width=this._width[e],u.height=this._height[e]);var _=u.getContext(\"2d\"),p=_.getImageData(0,0,this._width[e],this._height[e]),d=new Uint8Array(n);p.data.set(d),_.putImageData(p,0,0),this.image_data[e]=u,this.max_dw=0,\"data\"==this.model.properties.dw.units&&(this.max_dw=f.max(this._dw)),this.max_dh=0,\"data\"==this.model.properties.dh.units&&(this.max_dh=f.max(this._dh))}},t.prototype._map_data=function(){switch(this.model.properties.dw.units){case\"data\":this.sw=this.sdist(this.renderer.xscale,this._x,this._dw,\"edge\",this.model.dilate);break;case\"screen\":this.sw=this._dw}switch(this.model.properties.dh.units){case\"data\":this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,\"edge\",this.model.dilate);break;case\"screen\":this.sh=this._dh}},t.prototype._render=function(t,e,i){var n=i.image_data,r=i.sx,o=i.sy,s=i.sw,a=i.sh,l=t.getImageSmoothingEnabled();t.setImageSmoothingEnabled(!1),t.globalAlpha=this.model.global_alpha;for(var h=0,c=e;h<c.length;h++){var u=c[h];if(!isNaN(r[u]+o[u]+s[u]+a[u])){var _=o[u];t.translate(0,_),t.scale(1,-1),t.translate(0,-_),t.drawImage(n[u],0|r[u],0|o[u],s[u],a[u]),t.translate(0,_),t.scale(1,-1),t.translate(0,-_)}}t.setImageSmoothingEnabled(l)},t.prototype.bounds=function(){var t=this.index.bbox;return t.maxX+=this.max_dw,t.maxY+=this.max_dh,t},t}(r.XYGlyphView);i.ImageRGBAView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ImageRGBA\",this.prototype.default_view=s,this.define({image:[o.NumberSpec],dw:[o.DistanceSpec],dh:[o.DistanceSpec],global_alpha:[o.Number,1],dilate:[o.Bool,!1]})},t}(r.XYGlyph);(i.ImageRGBA=a).initClass()},function(t,e,l){var n=t(387),i=t(141),h=t(14),r=t(15),c=t(22),o=t(37);l.CanvasImage=Image;var s=function(i){function t(){var t=null!==i&&i.apply(this,arguments)||this;return t._images_rendered=!1,t}return n.__extends(t,i),t.prototype.initialize=function(t){var e=this;i.prototype.initialize.call(this,t),this.connect(this.model.properties.global_alpha.change,function(){return e.renderer.request_render()})},t.prototype._index_data=function(){return new o.SpatialIndex([])},t.prototype._set_data=function(){var n=this;null!=this.image&&this.image.length==this._url.length||(this.image=c.map(this._url,function(){return null}));var t=this.model,r=t.retry_attempts,o=t.retry_timeout;this.retries=c.map(this._url,function(){return r});for(var e=function(t,e){if(null==s._url[t])return\"continue\";var i=new l.CanvasImage;i.onerror=function(){0<n.retries[t]?(h.logger.trace(\"ImageURL failed to load \"+n._url[t]+\" image, retrying in \"+o+\" ms\"),setTimeout(function(){return i.src=n._url[t]},o)):h.logger.warn(\"ImageURL unable to load \"+n._url[t]+\" image after \"+r+\" retries\"),n.retries[t]-=1},i.onload=function(){n.image[t]=i,n.renderer.request_render()},i.src=s._url[t]},s=this,i=0,a=this._url.length;i<a;i++)e(i,a)},t.prototype.has_finished=function(){return i.prototype.has_finished.call(this)&&1==this._images_rendered},t.prototype._map_data=function(){var t=null!=this.model.w?this._w:c.map(this._x,function(){return NaN}),e=null!=this.model.h?this._h:c.map(this._x,function(){return NaN});switch(this.model.properties.w.units){case\"data\":this.sw=this.sdist(this.renderer.xscale,this._x,t,\"edge\",this.model.dilate);break;case\"screen\":this.sw=t}switch(this.model.properties.h.units){case\"data\":this.sh=this.sdist(this.renderer.yscale,this._y,e,\"edge\",this.model.dilate);break;case\"screen\":this.sh=e}},t.prototype._render=function(t,e,i){var n=i.image,r=i.sx,o=i.sy,s=i.sw,a=i.sh,l=i._angle,h=this.renderer.plot_view.frame;t.rect(h._left.value+1,h._top.value+1,h._width.value-2,h._height.value-2),t.clip();for(var c=!0,u=0,_=e;u<_.length;u++){var p=_[u];if(!isNaN(r[p]+o[p]+l[p])&&-1!=this.retries[p]){var d=n[p];null!=d?this._render_image(t,p,d,r,o,s,a,l):c=!1}}c&&!this._images_rendered&&(this._images_rendered=!0,this.notify_finished())},t.prototype._final_sx_sy=function(t,e,i,n,r){switch(t){case\"top_left\":return[e,i];case\"top_center\":return[e-n/2,i];case\"top_right\":return[e-n,i];case\"center_right\":return[e-n,i-r/2];case\"bottom_right\":return[e-n,i-r];case\"bottom_center\":return[e-n/2,i-r];case\"bottom_left\":return[e,i-r];case\"center_left\":return[e,i-r/2];case\"center\":return[e-n/2,i-r/2]}},t.prototype._render_image=function(t,e,i,n,r,o,s,a){isNaN(o[e])&&(o[e]=i.width),isNaN(s[e])&&(s[e]=i.height);var l=this.model.anchor,h=this._final_sx_sy(l,n[e],r[e],o[e],s[e]),c=h[0],u=h[1];t.save(),t.globalAlpha=this.model.global_alpha,a[e]?(t.translate(c,u),t.rotate(a[e]),t.drawImage(i,0,0,o[e],s[e]),t.rotate(-a[e]),t.translate(-c,-u)):t.drawImage(i,c,u,o[e],s[e]),t.restore()},t}(i.XYGlyphView);l.ImageURLView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ImageURL\",this.prototype.default_view=s,this.define({url:[r.StringSpec],anchor:[r.Anchor,\"top_left\"],global_alpha:[r.Number,1],angle:[r.AngleSpec,0],w:[r.DistanceSpec],h:[r.DistanceSpec],dilate:[r.Bool,!1],retry_attempts:[r.Number,0],retry_timeout:[r.Number,0]})},t}(i.XYGlyph);(l.ImageURL=a).initClass()},function(t,e,i){var n=t(112);i.AnnularWedge=n.AnnularWedge;var r=t(113);i.Annulus=r.Annulus;var o=t(114);i.Arc=o.Arc;var s=t(115);i.Bezier=s.Bezier;var a=t(117);i.Circle=a.Circle;var l=t(118);i.Ellipse=l.Ellipse;var h=t(119);i.Glyph=h.Glyph;var c=t(120);i.HBar=c.HBar;var u=t(121);i.HexTile=u.HexTile;var _=t(122);i.Image=_.Image;var p=t(123);i.ImageRGBA=p.ImageRGBA;var d=t(124);i.ImageURL=d.ImageURL;var f=t(126);i.Line=f.Line;var v=t(127);i.MultiLine=v.MultiLine;var m=t(128);i.Oval=m.Oval;var g=t(129);i.Patch=g.Patch;var y=t(130);i.Patches=y.Patches;var b=t(131);i.Quad=b.Quad;var x=t(132);i.Quadratic=x.Quadratic;var w=t(133);i.Ray=w.Ray;var k=t(134);i.Rect=k.Rect;var S=t(135);i.Segment=S.Segment;var T=t(136);i.Step=T.Step;var C=t(137);i.Text=C.Text;var A=t(139);i.VBar=A.VBar;var E=t(140);i.Wedge=E.Wedge;var M=t(141);i.XYGlyph=M.XYGlyph},function(t,e,i){var n=t(387),r=t(141),o=t(138),w=t(9),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy,o=!1,s=null;this.visuals.line.set_value(t);for(var a=0,l=e;a<l.length;a++){var h=l[a];if(o){if(!isFinite(n[h]+r[h])){t.stroke(),t.beginPath(),o=!1,s=h;continue}null!=s&&1<h-s&&(t.stroke(),o=!1)}o?t.lineTo(n[h],r[h]):(t.beginPath(),t.moveTo(n[h],r[h]),o=!0),s=h}o&&t.stroke()},e.prototype._hit_point=function(t){for(var e=this,i=w.create_empty_hit_test_result(),n={x:t.sx,y:t.sy},r=9999,o=Math.max(2,this.visuals.line.line_width.value()/2),s=0,a=this.sx.length-1;s<a;s++){var l={x:this.sx[s],y:this.sy[s]},h={x:this.sx[s+1],y:this.sy[s+1]},c=w.dist_to_segment(n,l,h);c<o&&c<r&&(r=c,i.add_to_selected_glyphs(this.model),i.get_view=function(){return e},i.line_indices=[s])}return i},e.prototype._hit_span=function(t){var e,i,n=this,r=t.sx,o=t.sy,s=w.create_empty_hit_test_result();\"v\"==t.direction?(e=this.renderer.yscale.invert(o),i=this._y):(e=this.renderer.xscale.invert(r),i=this._x);for(var a=0,l=i.length-1;a<l;a++)(i[a]<=e&&e<=i[a+1]||i[a+1]<=e&&e<=i[a])&&(s.add_to_selected_glyphs(this.model),s.get_view=function(){return n},s.line_indices.push(a));return s},e.prototype.get_interpolation_hit=function(t,e){var i,n,r,o,s,a,l,h,c,u,_=e.sx,p=e.sy,d=[this._x[t],this._y[t],this._x[t+1],this._y[t+1]],f=d[0],v=d[1],m=d[2],g=d[3];\"point\"==e.type?(i=this.renderer.yscale.r_invert(p-1,p+1),c=i[0],u=i[1],n=this.renderer.xscale.r_invert(_-1,_+1),l=n[0],h=n[1]):\"v\"==e.direction?(r=this.renderer.yscale.r_invert(p,p),c=r[0],u=r[1],l=(o=[f,m])[0],h=o[1]):(s=this.renderer.xscale.r_invert(_,_),l=s[0],h=s[1],c=(a=[v,g])[0],u=a[1]);var y=w.check_2_segments_intersect(l,c,h,u,f,v,m,g),b=y.x,x=y.y;return[b,x]},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.LineView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Line\",this.prototype.default_view=s,this.mixins([\"line\"])},t}(r.XYGlyph);(i.Line=a).initClass()},function(t,e,i){var n=t(387),m=t(37),w=t(9),d=t(32),g=t(21),y=t(44),r=t(119),o=t(138),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._xs.length;e<i;e++)if(null!=this._xs[e]&&0!==this._xs[e].length){for(var n=this._xs[e],r=[],o=0,s=n.length;o<s;o++){var a=n[o];y.isStrictNaN(a)||r.push(a)}for(var l=this._ys[e],h=[],o=0,s=l.length;o<s;o++){var c=l[o];y.isStrictNaN(c)||h.push(c)}var u=[g.min(r),g.max(r)],_=u[0],p=u[1],d=[g.min(h),g.max(h)],f=d[0],v=d[1];t.push({minX:_,minY:f,maxX:p,maxY:v,i:e})}return new m.SpatialIndex(t)},e.prototype._render=function(t,e,i){for(var n=i.sxs,r=i.sys,o=0,s=e;o<s.length;o++){var a=s[o],l=[n[a],r[a]],h=l[0],c=l[1];this.visuals.line.set_vectorize(t,a);for(var u=0,_=h.length;u<_;u++)0!=u?isNaN(h[u])||isNaN(c[u])?(t.stroke(),t.beginPath()):t.lineTo(h[u],c[u]):(t.beginPath(),t.moveTo(h[u],c[u]));t.stroke()}},e.prototype._hit_point=function(t){for(var e=w.create_empty_hit_test_result(),i={x:t.sx,y:t.sy},n=9999,r={},o=0,s=this.sxs.length;o<s;o++){for(var a=Math.max(2,this.visuals.line.cache_select(\"line_width\",o)/2),l=null,h=0,c=this.sxs[o].length-1;h<c;h++){var u={x:this.sxs[o][h],y:this.sys[o][h]},_={x:this.sxs[o][h+1],y:this.sys[o][h+1]},p=w.dist_to_segment(i,u,_);p<a&&p<n&&(n=p,l=[h])}l&&(r[o]=l)}return e.indices=d.keys(r).map(function(t){return parseInt(t,10)}),e.multiline_indices=r,e},e.prototype._hit_span=function(t){var e,i,n=t.sx,r=t.sy,o=w.create_empty_hit_test_result();\"v\"===t.direction?(e=this.renderer.yscale.invert(r),i=this._ys):(e=this.renderer.xscale.invert(n),i=this._xs);for(var s={},a=0,l=i.length;a<l;a++){for(var h=[],c=0,u=i[a].length-1;c<u;c++)i[a][c]<=e&&e<=i[a][c+1]&&h.push(c);0<h.length&&(s[a]=h)}return o.indices=d.keys(s).map(function(t){return parseInt(t,10)}),o.multiline_indices=s,o},e.prototype.get_interpolation_hit=function(t,e,i){var n,r,o,s,a,l,h,c,u,_,p=i.sx,d=i.sy,f=this._xs[t][e],v=this._ys[t][e],m=this._xs[t][e+1],g=this._ys[t][e+1];\"point\"==i.type?(n=this.renderer.yscale.r_invert(d-1,d+1),u=n[0],_=n[1],r=this.renderer.xscale.r_invert(p-1,p+1),h=r[0],c=r[1]):\"v\"==i.direction?(o=this.renderer.yscale.r_invert(d,d),u=o[0],_=o[1],h=(s=[f,m])[0],c=s[1]):(a=this.renderer.xscale.r_invert(p,p),h=a[0],c=a[1],u=(l=[v,g])[0],_=l[1]);var y=w.check_2_segments_intersect(h,u,c,_,f,v,m,g),b=y.x,x=y.y;return[b,x]},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e.prototype.scenterx=function(){throw new Error(\"not implemented\")},e.prototype.scentery=function(){throw new Error(\"not implemented\")},e}(r.GlyphView);i.MultiLineView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"MultiLine\",this.prototype.default_view=s,this.coords([[\"xs\",\"ys\"]]),this.mixins([\"line\"])},t}(r.Glyph);(i.MultiLine=a).initClass()},function(t,e,i){var n=t(387),r=t(141),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._set_data=function(){this.max_w2=0,\"data\"==this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,\"data\"==this.model.properties.height.units&&(this.max_h2=this.max_height/2)},e.prototype._map_data=function(){\"data\"==this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this._width,\"center\"):this.sw=this._width,\"data\"==this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this._height,\"center\"):this.sh=this._height},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sw,s=i.sh,a=i._angle,l=0,h=e;l<h.length;l++){var c=h[l];isNaN(n[c]+r[c]+o[c]+s[c]+a[c])||(t.translate(n[c],r[c]),t.rotate(a[c]),t.beginPath(),t.moveTo(0,-s[c]/2),t.bezierCurveTo(o[c]/2,-s[c]/2,o[c]/2,s[c]/2,0,s[c]/2),t.bezierCurveTo(-o[c]/2,s[c]/2,-o[c]/2,-s[c]/2,0,-s[c]/2),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,c),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,c),t.stroke()),t.rotate(-a[c]),t.translate(-n[c],-r[c]))}},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.y0,o=e.x1,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+o)/2;var h=new Array(a);h[i]=(r+s)/2;var c=this.sw[i]/this.sh[i],u=.8*Math.min(Math.abs(o-n),Math.abs(s-r)),_=new Array(a),p=new Array(a);1<c?(_[i]=u,p[i]=u/c):(_[i]=u*c,p[i]=u),this._render(t,[i],{sx:l,sy:h,sw:_,sh:p})},e.prototype._bounds=function(t){var e=t.minX,i=t.maxX,n=t.minY,r=t.maxY;return{minX:e-this.max_w2,maxX:i+this.max_w2,minY:n-this.max_h2,maxY:r+this.max_h2}},e}(r.XYGlyphView);i.OvalView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Oval\",this.prototype.default_view=s,this.mixins([\"line\",\"fill\"]),this.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},t}(r.XYGlyph);(i.Oval=a).initClass()},function(t,e,i){var n=t(387),r=t(141),o=t(138),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy;if(this.visuals.fill.doit){this.visuals.fill.set_value(t);for(var o=0,s=e;o<s.length;o++){var a=s[o];0!=a?isNaN(n[a]+r[a])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(n[a],r[a]):(t.beginPath(),t.moveTo(n[a],r[a]))}t.closePath(),t.fill()}if(this.visuals.line.doit){this.visuals.line.set_value(t);for(var l=0,h=e;l<h.length;l++){var a=h[l];0!=a?isNaN(n[a]+r[a])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(n[a],r[a]):(t.beginPath(),t.moveTo(n[a],r[a]))}return t.closePath(),t.stroke()}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.PatchView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Patch\",this.prototype.default_view=s,this.mixins([\"line\",\"fill\"])},t}(r.XYGlyph);(i.Patch=a).initClass()},function(t,e,i){var n=t(387),h=t(37),r=t(119),o=t(138),c=t(21),s=t(22),l=t(44),f=t(9),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._build_discontinuous_object=function(t){for(var e=[],i=0,n=t.length;i<n;i++){e[i]=[];for(var r=c.copy(t[i]);0<r.length;){var o=c.findLastIndex(r,function(t){return l.isStrictNaN(t)}),s=void 0;0<=o?s=r.splice(o):(s=r,r=[]);var a=s.filter(function(t){return!l.isStrictNaN(t)});e[i].push(a)}}return e},e.prototype._index_data=function(){for(var t=this._build_discontinuous_object(this._xs),e=this._build_discontinuous_object(this._ys),i=[],n=0,r=this._xs.length;n<r;n++)for(var o=0,s=t[n].length;o<s;o++){var a=t[n][o],l=e[n][o];0!=a.length&&i.push({minX:c.min(a),minY:c.min(l),maxX:c.max(a),maxY:c.max(l),i:n})}return new h.SpatialIndex(i)},e.prototype._mask_data=function(){var t=this.renderer.plot_view.frame.x_ranges.default,e=[t.min,t.max],i=e[0],n=e[1],r=this.renderer.plot_view.frame.y_ranges.default,o=[r.min,r.max],s=o[0],a=o[1],l=f.validate_bbox_coords([i,n],[s,a]),h=this.index.indices(l);return h.sort(function(t,e){return t-e})},e.prototype._render=function(t,e,i){var n=i.sxs,r=i.sys;this.sxss=this._build_discontinuous_object(n),this.syss=this._build_discontinuous_object(r);for(var o=0,s=e;o<s.length;o++){var a=s[o],l=[n[a],r[a]],h=l[0],c=l[1];if(this.visuals.fill.doit){this.visuals.fill.set_vectorize(t,a);for(var u=0,_=h.length;u<_;u++)0!=u?isNaN(h[u]+c[u])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(h[u],c[u]):(t.beginPath(),t.moveTo(h[u],c[u]));t.closePath(),t.fill()}if(this.visuals.line.doit){this.visuals.line.set_vectorize(t,a);for(var u=0,_=h.length;u<_;u++)0!=u?isNaN(h[u]+c[u])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(h[u],c[u]):(t.beginPath(),t.moveTo(h[u],c[u]));t.closePath(),t.stroke()}}},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),o=this.index.indices({minX:n,minY:r,maxX:n,maxY:r}),s=[],a=0,l=o.length;a<l;a++)for(var h=o[a],c=this.sxss[h],u=this.syss[h],_=0,p=c.length;_<p;_++)f.point_in_poly(e,i,c[_],u[_])&&s.push(h);var d=f.create_empty_hit_test_result();return d.indices=s,d},e.prototype._get_snap_coord=function(t){return s.sum(t)/t.length},e.prototype.scenterx=function(t,e,i){if(1==this.sxss[t].length)return this._get_snap_coord(this.sxs[t]);for(var n=this.sxss[t],r=this.syss[t],o=0,s=n.length;o<s;o++)if(f.point_in_poly(e,i,n[o],r[o]))return this._get_snap_coord(n[o]);throw new Error(\"unreachable code\")},e.prototype.scentery=function(t,e,i){if(1==this.syss[t].length)return this._get_snap_coord(this.sys[t]);for(var n=this.sxss[t],r=this.syss[t],o=0,s=n.length;o<s;o++)if(f.point_in_poly(e,i,n[o],r[o]))return this._get_snap_coord(r[o]);throw new Error(\"unreachable code\")},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e}(r.GlyphView);i.PatchesView=a;var u=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Patches\",this.prototype.default_view=a,this.coords([[\"xs\",\"ys\"]]),this.mixins([\"line\",\"fill\"])},t}(r.Glyph);(i.Patches=u).initClass()},function(t,e,i){var n=t(387),r=t(116),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.get_anchor_point=function(t,e,i){var n=Math.min(this.sleft[e],this.sright[e]),r=Math.max(this.sright[e],this.sleft[e]),o=Math.min(this.stop[e],this.sbottom[e]),s=Math.max(this.sbottom[e],this.stop[e]);switch(t){case\"top_left\":return{x:n,y:o};case\"top_center\":return{x:(n+r)/2,y:o};case\"top_right\":return{x:r,y:o};case\"center_right\":return{x:r,y:(o+s)/2};case\"bottom_right\":return{x:r,y:s};case\"bottom_center\":return{x:(n+r)/2,y:s};case\"bottom_left\":return{x:n,y:s};case\"center_left\":return{x:n,y:(o+s)/2};case\"center\":return{x:(n+r)/2,y:(o+s)/2};default:return null}},e.prototype.scenterx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype.scentery=function(t){return(this.stop[t]+this.sbottom[t])/2},e.prototype._index_data=function(){return this._index_box(this._right.length)},e.prototype._lrtb=function(t){var e=this._left[t],i=this._right[t],n=this._top[t],r=this._bottom[t];return[e,i,n,r]},e}(r.BoxView);i.QuadView=o;var s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Quad\",this.prototype.default_view=o,this.coords([[\"right\",\"bottom\"],[\"left\",\"top\"]])},t}(r.Box);(i.Quad=s).initClass()},function(t,e,i){var n=t(387),h=t(37),r=t(119),o=t(138);function c(t,e,i){if(e==(t+i)/2)return[t,i];var n=(t-e)/(t-2*e+i),r=t*Math.pow(1-n,2)+2*e*(1-n)*n+i*Math.pow(n,2);return[Math.min(t,i,r),Math.max(t,i,r)]}var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._x0.length;e<i;e++)if(!isNaN(this._x0[e]+this._x1[e]+this._y0[e]+this._y1[e]+this._cx[e]+this._cy[e])){var n=c(this._x0[e],this._cx[e],this._x1[e]),r=n[0],o=n[1],s=c(this._y0[e],this._cy[e],this._y1[e]),a=s[0],l=s[1];t.push({minX:r,minY:a,maxX:o,maxY:l,i:e})}return new h.SpatialIndex(t)},e.prototype._render=function(t,e,i){var n=i.sx0,r=i.sy0,o=i.sx1,s=i.sy1,a=i.scx,l=i.scy;if(this.visuals.line.doit)for(var h=0,c=e;h<c.length;h++){var u=c[h];isNaN(n[u]+r[u]+o[u]+s[u]+a[u]+l[u])||(t.beginPath(),t.moveTo(n[u],r[u]),t.quadraticCurveTo(a[u],l[u],o[u],s[u]),this.visuals.line.set_vectorize(t,u),t.stroke())}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e.prototype.scenterx=function(){throw new Error(\"not implemented\")},e.prototype.scentery=function(){throw new Error(\"not implemented\")},e}(r.GlyphView);i.QuadraticView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Quadratic\",this.prototype.default_view=s,this.coords([[\"x0\",\"y0\"],[\"x1\",\"y1\"],[\"cx\",\"cy\"]]),this.mixins([\"line\"])},t}(r.Glyph);(i.Quadratic=a).initClass()},function(t,e,i){var n=t(387),r=t(141),o=t(138),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){\"data\"==this.model.properties.length.units?this.slength=this.sdist(this.renderer.xscale,this._x,this._length):this.slength=this._length},e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy,o=i.slength,s=i._angle;if(this.visuals.line.doit){for(var a=this.renderer.plot_view.frame._width.value,l=this.renderer.plot_view.frame._height.value,h=2*(a+l),c=0,u=o.length;c<u;c++)0==o[c]&&(o[c]=h);for(var _=0,p=e;_<p.length;_++){var c=p[_];isNaN(n[c]+r[c]+s[c]+o[c])||(t.translate(n[c],r[c]),t.rotate(s[c]),t.beginPath(),t.moveTo(0,0),t.lineTo(o[c],0),this.visuals.line.set_vectorize(t,c),t.stroke(),t.rotate(-s[c]),t.translate(-n[c],-r[c]))}}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.RayView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Ray\",this.prototype.default_view=a,this.mixins([\"line\"]),this.define({length:[s.DistanceSpec],angle:[s.AngleSpec]})},t}(r.XYGlyph);(i.Ray=l).initClass()},function(t,e,i){var n=t(387),r=t(141),o=t(138),C=t(9),s=t(15),A=t(22),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._set_data=function(){this.max_w2=0,\"data\"==this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,\"data\"==this.model.properties.height.units&&(this.max_h2=this.max_height/2)},e.prototype._map_data=function(){var t,e;if(\"data\"==this.model.properties.width.units)t=this._map_dist_corner_for_data_side_length(this._x,this._width,this.renderer.xscale),this.sw=t[0],this.sx0=t[1];else{this.sw=this._width;var i=this.sx.length;this.sx0=new Float64Array(i);for(var n=0;n<i;n++)this.sx0[n]=this.sx[n]-this.sw[n]/2}if(\"data\"==this.model.properties.height.units)e=this._map_dist_corner_for_data_side_length(this._y,this._height,this.renderer.yscale),this.sh=e[0],this.sy1=e[1];else{this.sh=this._height;var r=this.sy.length;this.sy1=new Float64Array(r);for(var n=0;n<r;n++)this.sy1[n]=this.sy[n]-this.sh[n]/2}var o=this.sw.length;this.ssemi_diag=new Float64Array(o);for(var n=0;n<o;n++)this.ssemi_diag[n]=Math.sqrt(this.sw[n]/2*this.sw[n]/2+this.sh[n]/2*this.sh[n]/2)},e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy,o=i.sx0,s=i.sy1,a=i.sw,l=i.sh,h=i._angle;if(this.visuals.fill.doit)for(var c=0,u=e;c<u.length;c++){var _=u[c];isNaN(n[_]+r[_]+o[_]+s[_]+a[_]+l[_]+h[_])||(this.visuals.fill.set_vectorize(t,_),h[_]?(t.translate(n[_],r[_]),t.rotate(h[_]),t.fillRect(-a[_]/2,-l[_]/2,a[_],l[_]),t.rotate(-h[_]),t.translate(-n[_],-r[_])):t.fillRect(o[_],s[_],a[_],l[_]))}if(this.visuals.line.doit){t.beginPath();for(var p=0,d=e;p<d.length;p++){var _=d[p];isNaN(n[_]+r[_]+o[_]+s[_]+a[_]+l[_]+h[_])||0!=a[_]&&0!=l[_]&&(h[_]?(t.translate(n[_],r[_]),t.rotate(h[_]),t.rect(-a[_]/2,-l[_]/2,a[_],l[_]),t.rotate(-h[_]),t.translate(-n[_],-r[_])):t.rect(o[_],s[_],a[_],l[_]),this.visuals.line.set_vectorize(t,_),t.stroke(),t.beginPath())}t.stroke()}},e.prototype._hit_rect=function(t){return this._hit_rect_against_index(t)},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),o=[],s=0,a=this.sx0.length;s<a;s++)o.push(this.sx0[s]+this.sw[s]/2);for(var l=[],s=0,a=this.sy1.length;s<a;s++)l.push(this.sy1[s]+this.sh[s]/2);for(var h=A.max(this._ddist(0,o,this.ssemi_diag)),c=A.max(this._ddist(1,l,this.ssemi_diag)),u=n-h,_=n+h,p=r-c,d=r+c,f=[],v=C.validate_bbox_coords([u,_],[p,d]),m=0,g=this.index.indices(v);m<g.length;m++){var s=g[m],y=void 0,b=void 0;if(this._angle[s]){var x=Math.sin(-this._angle[s]),w=Math.cos(-this._angle[s]),k=w*(e-this.sx[s])-x*(i-this.sy[s])+this.sx[s],S=x*(e-this.sx[s])+w*(i-this.sy[s])+this.sy[s];e=k,i=S,b=Math.abs(this.sx[s]-e)<=this.sw[s]/2,y=Math.abs(this.sy[s]-i)<=this.sh[s]/2}else b=e-this.sx0[s]<=this.sw[s]&&0<=e-this.sx0[s],y=i-this.sy1[s]<=this.sh[s]&&0<=i-this.sy1[s];y&&b&&f.push(s)}var T=C.create_empty_hit_test_result();return T.indices=f,T},e.prototype._map_dist_corner_for_data_side_length=function(t,e,i){for(var n=t.length,r=new Float64Array(n),o=new Float64Array(n),s=0;s<n;s++)r[s]=Number(t[s])-e[s]/2,o[s]=Number(t[s])+e[s]/2;for(var a=i.v_compute(r),l=i.v_compute(o),h=this.sdist(i,r,e,\"edge\",this.model.dilate),c=a,s=0,u=a.length;s<u;s++)if(a[s]!=l[s]){c=a[s]<l[s]?a:l;break}return[h,c]},e.prototype._ddist=function(t,e,i){for(var n=0==t?this.renderer.xscale:this.renderer.yscale,r=e,o=r.length,s=new Float64Array(o),a=0;a<o;a++)s[a]=r[a]+i[a];for(var l=n.v_invert(r),h=n.v_invert(s),c=l.length,u=new Float64Array(c),a=0;a<c;a++)u[a]=Math.abs(h[a]-l[a]);return u},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e.prototype._bounds=function(t){var e=t.minX,i=t.maxX,n=t.minY,r=t.maxY;return{minX:e-this.max_w2,maxX:i+this.max_w2,minY:n-this.max_h2,maxY:r+this.max_h2}},e}(r.XYGlyphView);i.RectView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Rect\",this.prototype.default_view=a,this.mixins([\"line\",\"fill\"]),this.define({angle:[s.AngleSpec,0],width:[s.DistanceSpec],height:[s.DistanceSpec],dilate:[s.Bool,!1]})},t}(r.XYGlyph);(i.Rect=l).initClass()},function(t,e,i){var n=t(387),k=t(9),a=t(37),r=t(119),o=t(138),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._x0.length;e<i;e++){var n=this._x0[e],r=this._x1[e],o=this._y0[e],s=this._y1[e];isNaN(n+r+o+s)||t.push({minX:Math.min(n,r),minY:Math.min(o,s),maxX:Math.max(n,r),maxY:Math.max(o,s),i:e})}return new a.SpatialIndex(t)},e.prototype._render=function(t,e,i){var n=i.sx0,r=i.sy0,o=i.sx1,s=i.sy1;if(this.visuals.line.doit)for(var a=0,l=e;a<l.length;a++){var h=l[a];isNaN(n[h]+r[h]+o[h]+s[h])||(t.beginPath(),t.moveTo(n[h],r[h]),t.lineTo(o[h],s[h]),this.visuals.line.set_vectorize(t,h),t.stroke())}},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n={x:e,y:i},r=[],o=this.renderer.xscale.r_invert(e-2,e+2),s=o[0],a=o[1],l=this.renderer.yscale.r_invert(i-2,i+2),h=l[0],c=l[1],u=this.index.indices({minX:s,minY:h,maxX:a,maxY:c}),_=0,p=u;_<p.length;_++){var d=p[_],f=Math.pow(Math.max(2,this.visuals.line.cache_select(\"line_width\",d)/2),2),v={x:this.sx0[d],y:this.sy0[d]},m={x:this.sx1[d],y:this.sy1[d]},g=k.dist_to_segment_squared(n,v,m);g<f&&r.push(d)}var y=k.create_empty_hit_test_result();return y.indices=r,y},e.prototype._hit_span=function(t){var e,i,n,r,o,s=this.renderer.plot_view.frame.bbox.ranges,a=s[0],l=s[1],h=t.sx,c=t.sy;\"v\"==t.direction?(o=this.renderer.yscale.invert(c),e=[this._y0,this._y1],n=e[0],r=e[1]):(o=this.renderer.xscale.invert(h),i=[this._x0,this._x1],n=i[0],r=i[1]);for(var u=[],_=this.renderer.xscale.r_invert(a.start,a.end),p=_[0],d=_[1],f=this.renderer.yscale.r_invert(l.start,l.end),v=f[0],m=f[1],g=this.index.indices({minX:p,minY:v,maxX:d,maxY:m}),y=0,b=g;y<b.length;y++){var x=b[y];(n[x]<=o&&o<=r[x]||r[x]<=o&&o<=n[x])&&u.push(x)}var w=k.create_empty_hit_test_result();return w.indices=u,w},e.prototype.scenterx=function(t){return(this.sx0[t]+this.sx1[t])/2},e.prototype.scentery=function(t){return(this.sy0[t]+this.sy1[t])/2},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.GlyphView);i.SegmentView=s;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Segment\",this.prototype.default_view=s,this.coords([[\"x0\",\"y0\"],[\"x1\",\"y1\"]]),this.mixins([\"line\"])},t}(r.Glyph);(i.Segment=l).initClass()},function(t,e,i){var n=t(387),r=t(141),o=t(138),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){var n,r,o,s,a,l,h=i.sx,c=i.sy;this.visuals.line.set_value(t);var u=e.length;if(!(u<2)){t.beginPath(),t.moveTo(h[0],c[0]);for(var _=1;_<u;_++){var p=void 0,d=void 0,f=void 0,v=void 0;switch(this.model.mode){case\"before\":n=[h[_-1],c[_]],p=n[0],f=n[1],r=[h[_],c[_]],d=r[0],v=r[1];break;case\"after\":o=[h[_],c[_-1]],p=o[0],f=o[1],s=[h[_],c[_]],d=s[0],v=s[1];break;case\"center\":var m=(h[_-1]+h[_])/2;a=[m,c[_-1]],p=a[0],f=a[1],l=[m,c[_]],d=l[0],v=l[1];break;default:throw new Error(\"unexpected\")}t.lineTo(p,f),t.lineTo(d,v)}t.lineTo(h[u-1],c[u-1]),t.stroke()}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.StepView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Step\",this.prototype.default_view=a,this.mixins([\"line\"]),this.define({mode:[s.StepMode,\"before\"]})},t}(r.XYGlyph);(i.Step=l).initClass()},function(t,e,i){var n=t(387),r=t(141),o=t(15),k=t(41),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i._x_offset,s=i._y_offset,a=i._angle,l=i._text,h=0,c=e;h<c.length;h++){var u=c[h];if(!isNaN(n[u]+r[u]+o[u]+s[u]+a[u])&&null!=l[u]&&this.visuals.text.doit){var _=\"\"+l[u];if(t.save(),t.translate(n[u]+o[u],r[u]+s[u]),t.rotate(a[u]),this.visuals.text.set_vectorize(t,u),-1==_.indexOf(\"\\n\"))t.fillText(_,0,0);else{var p=_.split(\"\\n\"),d=this.visuals.text.cache_select(\"font\",u),f=k.get_text_height(d).height,v=this.visuals.text.text_line_height.value()*f,m=v*p.length,g=this.visuals.text.cache_select(\"text_baseline\",u),y=void 0;switch(g){case\"top\":y=0;break;case\"middle\":y=-m/2+v/2;break;case\"bottom\":y=-m+v;break;default:y=0,console.warn(\"'\"+g+\"' baseline not supported with multi line text\")}for(var b=0,x=p;b<x.length;b++){var w=x[b];t.fillText(w,0,y),y+=v}}t.restore()}}},e}(r.XYGlyphView);i.TextView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Text\",this.prototype.default_view=s,this.mixins([\"text\"]),this.define({text:[o.StringSpec,{field:\"text\"}],angle:[o.AngleSpec,0],x_offset:[o.NumberSpec,0],y_offset:[o.NumberSpec,0]})},t}(r.XYGlyph);(i.Text=a).initClass()},function(t,e,i){i.generic_line_legend=function(t,e,i,n){var r=i.x0,o=i.x1,s=i.y0,a=i.y1;e.save(),e.beginPath(),e.moveTo(r,(s+a)/2),e.lineTo(o,(s+a)/2),t.line.doit&&(t.line.set_vectorize(e,n),e.stroke()),e.restore()},i.generic_area_legend=function(t,e,i,n){var r=i.x0,o=i.x1,s=i.y0,a=i.y1,l=.1*Math.abs(o-r),h=.1*Math.abs(a-s),c=r+l,u=o-l,_=s+h,p=a-h;t.fill.doit&&(t.fill.set_vectorize(e,n),e.fillRect(c,_,u-c,p-_)),t.line.doit&&(e.beginPath(),e.rect(c,_,u-c,p-_),t.line.set_vectorize(e,n),e.stroke())}},function(t,e,i){var n=t(387),r=t(116),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.scenterx=function(t){return this.sx[t]},e.prototype.scentery=function(t){return(this.stop[t]+this.sbottom[t])/2},e.prototype._index_data=function(){return this._index_box(this._x.length)},e.prototype._lrtb=function(t){var e=this._x[t]-this._width[t]/2,i=this._x[t]+this._width[t]/2,n=Math.max(this._top[t],this._bottom[t]),r=Math.min(this._top[t],this._bottom[t]);return[e,i,n,r]},e.prototype._map_data=function(){this.sx=this.renderer.xscale.v_compute(this._x),this.sw=this.sdist(this.renderer.xscale,this._x,this._width,\"center\"),this.stop=this.renderer.yscale.v_compute(this._top),this.sbottom=this.renderer.yscale.v_compute(this._bottom);var t=this.sx.length;this.sleft=new Float64Array(t),this.sright=new Float64Array(t);for(var e=0;e<t;e++)this.sleft[e]=this.sx[e]-this.sw[e]/2,this.sright[e]=this.sx[e]+this.sw[e]/2},e}(r.BoxView);i.VBarView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"VBar\",this.prototype.default_view=s,this.coords([[\"x\",\"bottom\"]]),this.define({width:[o.DistanceSpec],top:[o.NumberSpec]}),this.override({bottom:0})},t}(r.Box);(i.VBar=a).initClass()},function(t,e,i){var n=t(387),r=t(141),o=t(138),P=t(9),s=t(15),j=t(31),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){\"data\"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sradius,s=i._start_angle,a=i._end_angle,l=this.model.properties.direction.value(),h=0,c=e;h<c.length;h++){var u=c[h];isNaN(n[u]+r[u]+o[u]+s[u]+a[u])||(t.beginPath(),t.arc(n[u],r[u],o[u],s[u],a[u],l),t.lineTo(n[u],r[u]),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,u),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,u),t.stroke()))}},e.prototype._hit_point=function(t){var e,i,n,r,o,s,a,l,h,c,u,_,p,d=t.sx,f=t.sy,v=this.renderer.xscale.invert(d),m=this.renderer.yscale.invert(f),g=2*this.max_radius;\"data\"===this.model.properties.radius.units?(c=v-g,u=v+g,_=m-g,p=m+g):(s=d-g,a=d+g,e=this.renderer.xscale.r_invert(s,a),c=e[0],u=e[1],l=f-g,h=f+g,i=this.renderer.yscale.r_invert(l,h),_=i[0],p=i[1]);for(var y=[],b=P.validate_bbox_coords([c,u],[_,p]),x=0,w=this.index.indices(b);x<w.length;x++){var k=w[x],S=Math.pow(this.sradius[k],2);n=this.renderer.xscale.r_compute(v,this._x[k]),s=n[0],a=n[1],r=this.renderer.yscale.r_compute(m,this._y[k]),l=r[0],h=r[1],(o=Math.pow(s-a,2)+Math.pow(l-h,2))<=S&&y.push([k,o])}for(var T=this.model.properties.direction.value(),C=[],A=0,E=y;A<E.length;A++){var M=E[A],k=M[0],O=M[1],z=Math.atan2(f-this.sy[k],d-this.sx[k]);j.angle_between(-z,-this._start_angle[k],-this._end_angle[k],T)&&C.push([k,O])}return P.create_hit_test_result_from_hits(C)},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e.prototype._scenterxy=function(t){var e=this.sradius[t]/2,i=(this._start_angle[t]+this._end_angle[t])/2;return{x:this.sx[t]+e*Math.cos(i),y:this.sy[t]+e*Math.sin(i)}},e.prototype.scenterx=function(t){return this._scenterxy(t).x},e.prototype.scentery=function(t){return this._scenterxy(t).y},e}(r.XYGlyphView);i.WedgeView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Wedge\",this.prototype.default_view=a,this.mixins([\"line\",\"fill\"]),this.define({direction:[s.Direction,\"anticlock\"],radius:[s.DistanceSpec],start_angle:[s.AngleSpec],end_angle:[s.AngleSpec]})},t}(r.XYGlyph);(i.Wedge=l).initClass()},function(t,e,i){var n=t(387),o=t(37),r=t(119),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._x.length;e<i;e++){var n=this._x[e],r=this._y[e];!isNaN(n+r)&&isFinite(n+r)&&t.push({minX:n,minY:r,maxX:n,maxY:r,i:e})}return new o.SpatialIndex(t)},e.prototype.scenterx=function(t){return this.sx[t]},e.prototype.scentery=function(t){return this.sy[t]},e}(r.GlyphView);i.XYGlyphView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"XYGlyph\",this.coords([[\"x\",\"y\"]])},t}(r.Glyph);(i.XYGlyph=a).initClass()},function(t,e,i){var n=t(387),r=t(57),c=t(22),u=t(21),_=t(9),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"GraphHitTestPolicy\"},t.prototype._hit_test_nodes=function(t,e){if(!e.model.visible)return null;var i=e.node_view.glyph.hit_test(t);return null==i?null:e.node_view.model.view.convert_selection_from_subset(i)},t.prototype._hit_test_edges=function(t,e){if(!e.model.visible)return null;var i=e.edge_view.glyph.hit_test(t);return null==i?null:e.edge_view.model.view.convert_selection_from_subset(i)},t}(r.Model),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"NodesOnly\"},t.prototype.hit_test=function(t,e){return this._hit_test_nodes(t,e)},t.prototype.do_selection=function(t,e,i,n){if(null==t)return!1;var r=e.node_renderer.data_source.selected;return r.update(t,i,n),e.node_renderer.data_source._select.emit(),!r.is_empty()},t.prototype.do_inspection=function(t,e,i,n,r){if(null==t)return!1;var o=i.model.get_selection_manager().get_or_create_inspector(i.node_view.model);return o.update(t,n,r),i.node_view.model.data_source.setv({inspected:o},{silent:!0}),i.node_view.model.data_source.inspect.emit([i.node_view,{geometry:e}]),!o.is_empty()},t}(i.GraphHitTestPolicy=o);(i.NodesOnly=s).initClass();var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"NodesAndLinkedEdges\"},t.prototype.hit_test=function(t,e){return this._hit_test_nodes(t,e)},t.prototype.get_linked_edges=function(e,t,i){var n=[];\"selection\"==i?n=e.selected.indices.map(function(t){return e.data.index[t]}):\"inspection\"==i&&(n=e.inspected.indices.map(function(t){return e.data.index[t]}));for(var r=[],o=0;o<t.data.start.length;o++)(u.contains(n,t.data.start[o])||u.contains(n,t.data.end[o]))&&r.push(o);for(var s=_.create_empty_hit_test_result(),a=0,l=r;a<l.length;a++){var o=l[a];s.multiline_indices[o]=[0]}return s.indices=r,s},t.prototype.do_selection=function(t,e,i,n){if(null==t)return!1;var r=e.node_renderer.data_source.selected;r.update(t,i,n);var o=e.edge_renderer.data_source.selected,s=this.get_linked_edges(e.node_renderer.data_source,e.edge_renderer.data_source,\"selection\");return o.update(s,i,n),e.node_renderer.data_source._select.emit(),!r.is_empty()},t.prototype.do_inspection=function(t,e,i,n,r){if(null==t)return!1;var o=i.node_view.model.data_source.selection_manager.get_or_create_inspector(i.node_view.model);o.update(t,n,r),i.node_view.model.data_source.setv({inspected:o},{silent:!0});var s=i.edge_view.model.data_source.selection_manager.get_or_create_inspector(i.edge_view.model),a=this.get_linked_edges(i.node_view.model.data_source,i.edge_view.model.data_source,\"inspection\");return s.update(a,n,r),i.edge_view.model.data_source.setv({inspected:s},{silent:!0}),i.node_view.model.data_source.inspect.emit([i.node_view,{geometry:e}]),!o.is_empty()},t}(o);(i.NodesAndLinkedEdges=a).initClass();var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"EdgesAndLinkedNodes\"},t.prototype.hit_test=function(t,e){return this._hit_test_edges(t,e)},t.prototype.get_linked_nodes=function(e,t,i){var n=[];\"selection\"==i?n=t.selected.indices:\"inspection\"==i&&(n=t.inspected.indices);for(var r=[],o=0,s=n;o<s.length;o++){var a=s[o];r.push(t.data.start[a]),r.push(t.data.end[a])}var l=u.uniq(r).map(function(t){return c.indexOf(e.data.index,t)}),h=_.create_empty_hit_test_result();return h.indices=l,h},t.prototype.do_selection=function(t,e,i,n){if(null==t)return!1;var r=e.edge_renderer.data_source.selected;r.update(t,i,n);var o=e.node_renderer.data_source.selected,s=this.get_linked_nodes(e.node_renderer.data_source,e.edge_renderer.data_source,\"selection\");return o.update(s,i,n),e.edge_renderer.data_source._select.emit(),!r.is_empty()},t.prototype.do_inspection=function(t,e,i,n,r){if(null==t)return!1;var o=i.edge_view.model.data_source.selection_manager.get_or_create_inspector(i.edge_view.model);o.update(t,n,r),i.edge_view.model.data_source.setv({inspected:o},{silent:!0});var s=i.node_view.model.data_source.selection_manager.get_or_create_inspector(i.node_view.model),a=this.get_linked_nodes(i.node_view.model.data_source,i.edge_view.model.data_source,\"inspection\");return s.update(a,n,r),i.node_view.model.data_source.setv({inspected:s},{silent:!0}),i.edge_view.model.data_source.inspect.emit([i.edge_view,{geometry:e}]),!o.is_empty()},t}(o);(i.EdgesAndLinkedNodes=l).initClass()},function(t,e,i){var n=t(387);n.__exportStar(t(142),i),n.__exportStar(t(144),i),n.__exportStar(t(145),i)},function(t,e,i){var n=t(387),r=t(57),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LayoutProvider\"},t}(r.Model);(i.LayoutProvider=o).initClass()},function(t,e,i){var n=t(387),r=t(144),o=t(15),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"StaticLayoutProvider\",this.define({graph_layout:[o.Any,{}]})},t.prototype.get_node_coordinates=function(t){for(var e=[],i=[],n=t.data.index,r=0,o=n.length;r<o;r++){var s=this.graph_layout[n[r]],a=null!=s?s:[NaN,NaN],l=a[0],h=a[1];e.push(l),i.push(h)}return[e,i]},t.prototype.get_edge_coordinates=function(t){for(var e,i,n=[],r=[],o=t.data.start,s=t.data.end,a=null!=t.data.xs&&null!=t.data.ys,l=0,h=o.length;l<h;l++){var c=null!=this.graph_layout[o[l]]&&null!=this.graph_layout[s[l]];if(a&&c)n.push(t.data.xs[l]),r.push(t.data.ys[l]);else{var u=void 0,_=void 0;c?(e=[this.graph_layout[o[l]],this.graph_layout[s[l]]],_=e[0],u=e[1]):(_=(i=[[NaN,NaN],[NaN,NaN]])[0],u=i[1]),n.push([_[0],u[0]]),r.push([_[1],u[1]])}}return[n,r]},t}(r.LayoutProvider);(i.StaticLayoutProvider=s).initClass()},function(t,e,i){var n=t(387),h=t(77),r=t(177),o=t(15),c=t(44),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),Object.defineProperty(t.prototype,\"_x_range_name\",{get:function(){return this.model.x_range_name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"_y_range_name\",{get:function(){return this.model.y_range_name},enumerable:!0,configurable:!0}),t.prototype.render=function(){if(this.model.visible){var t=this.plot_view.canvas_view.ctx;t.save(),this._draw_regions(t),this._draw_minor_grids(t),this._draw_grids(t),t.restore()}},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.request_render()})},t.prototype._draw_regions=function(t){if(this.visuals.band_fill.doit){var e=this.model.grid_coords(\"major\",!1),i=e[0],n=e[1];this.visuals.band_fill.set_value(t);for(var r=0;r<i.length-1;r++)if(r%2==1){var o=this.plot_view.map_to_screen(i[r],n[r],this._x_range_name,this._y_range_name),s=o[0],a=o[1],l=this.plot_view.map_to_screen(i[r+1],n[r+1],this._x_range_name,this._y_range_name),h=l[0],c=l[1];t.fillRect(s[0],a[0],h[1]-s[0],c[1]-a[0]),t.fill()}}},t.prototype._draw_grids=function(t){if(this.visuals.grid_line.doit){var e=this.model.grid_coords(\"major\"),i=e[0],n=e[1];this._draw_grid_helper(t,this.visuals.grid_line,i,n)}},t.prototype._draw_minor_grids=function(t){if(this.visuals.minor_grid_line.doit){var e=this.model.grid_coords(\"minor\"),i=e[0],n=e[1];this._draw_grid_helper(t,this.visuals.minor_grid_line,i,n)}},t.prototype._draw_grid_helper=function(t,e,i,n){e.set_value(t);for(var r=0;r<i.length;r++){var o=this.plot_view.map_to_screen(i[r],n[r],this._x_range_name,this._y_range_name),s=o[0],a=o[1];t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(a[0]));for(var l=1;l<s.length;l++)t.lineTo(Math.round(s[l]),Math.round(a[l]));t.stroke()}},t}(r.GuideRendererView);i.GridView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Grid\",this.prototype.default_view=s,this.mixins([\"line:grid_\",\"line:minor_grid_\",\"fill:band_\"]),this.define({bounds:[o.Any,\"auto\"],dimension:[o.Number,0],ticker:[o.Instance],x_range_name:[o.String,\"default\"],y_range_name:[o.String,\"default\"]}),this.override({level:\"underlay\",band_fill_color:null,band_fill_alpha:0,grid_line_color:\"#e5e5e5\",minor_grid_line_color:null})},t.prototype.ranges=function(){var t=this.dimension,e=(t+1)%2,i=this.plot.plot_canvas.frame,n=[i.x_ranges[this.x_range_name],i.y_ranges[this.y_range_name]];return[n[t],n[e]]},t.prototype.computed_bounds=function(){var t,e,i,n=this.ranges()[0],r=this.bounds,o=[n.min,n.max];if(c.isArray(r))e=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),e<o[0]&&(e=o[0]),o[1]<i&&(i=o[1]);else{e=o[0],i=o[1];for(var s=0,a=this.plot.select(h.Axis);s<a.length;s++){var l=a[s];l.dimension==this.dimension&&l.x_range_name==this.x_range_name&&l.y_range_name==this.y_range_name&&(t=l.computed_bounds,e=t[0],i=t[1])}}return[e,i]},t.prototype.grid_coords=function(t,e){var i;void 0===e&&(e=!0);var n=this.dimension,r=(n+1)%2,o=this.ranges(),s=o[0],a=o[1],l=this.computed_bounds(),h=l[0],c=l[1];i=[Math.min(h,c),Math.max(h,c)],h=i[0],c=i[1];var u=this.ticker.get_ticks(h,c,s,a.min,{})[t],_=s.min,p=s.max,d=a.min,f=a.max,v=[[],[]];e||(u[0]!=_&&u.splice(0,0,_),u[u.length-1]!=p&&u.push(p));for(var m=0;m<u.length;m++)if(u[m]!=_&&u[m]!=p||!e){for(var g=[],y=[],b=0;b<2;b++){var x=d+(f-d)/1*b;g.push(u[m]),y.push(x)}v[n].push(g),v[r].push(y)}return v},t}(r.GuideRenderer);(i.Grid=a).initClass()},function(t,e,i){var n=t(146);i.Grid=n.Grid},function(t,e,i){var n=t(387);n.__exportStar(t(64),i),n.__exportStar(t(81),i),n.__exportStar(t(87),i),n.__exportStar(t(91),i),n.__exportStar(t(94),i),n.__exportStar(t(100),i),n.__exportStar(t(106),i),n.__exportStar(t(125),i),n.__exportStar(t(143),i),n.__exportStar(t(147),i),n.__exportStar(t(151),i),n.__exportStar(t(159),i),n.__exportStar(t(261),i),n.__exportStar(t(162),i),n.__exportStar(t(166),i),n.__exportStar(t(172),i),n.__exportStar(t(178),i),n.__exportStar(t(181),i),n.__exportStar(t(185),i),n.__exportStar(t(194),i),n.__exportStar(t(204),i),n.__exportStar(t(214),i),n.__exportStar(t(247),i)},function(t,e,i){var n=t(387),p=t(13),r=t(15),s=t(21),o=t(152),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.properties.children.change,function(){return t.rebuild_child_views()})},t.prototype.css_classes=function(){return e.prototype.css_classes.call(this).concat(\"bk-grid\")},t.prototype.get_height=function(){var t=this.model.get_layoutable_children(),e=t.map(function(t){return t._height.value});return this.model._horizontal?s.max(e):s.sum(e)},t.prototype.get_width=function(){var t=this.model.get_layoutable_children(),e=t.map(function(t){return t._width.value});return this.model._horizontal?s.sum(e):s.max(e)},t}(o.LayoutDOMView);i.BoxView=a;var l=function(_){function w(t){return _.call(this,t)||this}return n.__extends(w,_),w.initClass=function(){this.prototype.type=\"Box\",this.prototype.default_view=a,this.define({children:[r.Array,[]]}),this.internal({spacing:[r.Number,6]})},w.prototype.initialize=function(){_.prototype.initialize.call(this),this._child_equal_size_width=new p.Variable(this.toString()+\".child_equal_size_width\"),this._child_equal_size_height=new p.Variable(this.toString()+\".child_equal_size_height\"),this._box_equal_size_top=new p.Variable(this.toString()+\".box_equal_size_top\"),this._box_equal_size_bottom=new p.Variable(this.toString()+\".box_equal_size_bottom\"),this._box_equal_size_left=new p.Variable(this.toString()+\".box_equal_size_left\"),this._box_equal_size_right=new p.Variable(this.toString()+\".box_equal_size_right\"),this._box_cell_align_top=new p.Variable(this.toString()+\".box_cell_align_top\"),this._box_cell_align_bottom=new p.Variable(this.toString()+\".box_cell_align_bottom\"),this._box_cell_align_left=new p.Variable(this.toString()+\".box_cell_align_left\"),this._box_cell_align_right=new p.Variable(this.toString()+\".box_cell_align_right\")},w.prototype.get_layoutable_children=function(){return this.children},w.prototype.get_constrained_variables=function(){return n.__assign({},_.prototype.get_constrained_variables.call(this),{box_equal_size_top:this._box_equal_size_top,box_equal_size_bottom:this._box_equal_size_bottom,box_equal_size_left:this._box_equal_size_left,box_equal_size_right:this._box_equal_size_right,box_cell_align_top:this._box_cell_align_top,box_cell_align_bottom:this._box_cell_align_bottom,box_cell_align_left:this._box_cell_align_left,box_cell_align_right:this._box_cell_align_right})},w.prototype.get_constraints=function(){var i=_.prototype.get_constraints.call(this),t=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.push.apply(i,t)},e=this.get_layoutable_children();if(0==e.length)return i;for(var n=0,r=e;n<r.length;n++){var o=r[n],s=o.get_constrained_variables(),a=this._child_rect(s);this._horizontal?null!=s.height&&t(p.EQ(a.height,[-1,this._height])):null!=s.width&&t(p.EQ(a.width,[-1,this._width])),this._horizontal?null!=s.box_equal_size_left&&null!=s.box_equal_size_right&&null!=s.width&&t(p.EQ([-1,s.box_equal_size_left],[-1,s.box_equal_size_right],s.width,this._child_equal_size_width)):null!=s.box_equal_size_top&&null!=s.box_equal_size_bottom&&null!=s.height&&t(p.EQ([-1,s.box_equal_size_top],[-1,s.box_equal_size_bottom],s.height,this._child_equal_size_height))}var l=this._info(e[0].get_constrained_variables());t(p.EQ(l.span.start,0));for(var h=1;h<e.length;h++){var c=this._info(e[h].get_constrained_variables());l.span.size&&t(p.EQ(l.span.start,l.span.size,[-1,c.span.start])),t(p.WEAK_EQ(l.whitespace.after,c.whitespace.before,0-this.spacing)),t(p.GE(l.whitespace.after,c.whitespace.before,0-this.spacing)),l=c}var u=e[e.length-1].get_constrained_variables();return this._horizontal?null!=u.width&&t(p.EQ(l.span.start,l.span.size,[-1,this._width])):null!=u.height&&t(p.EQ(l.span.start,l.span.size,[-1,this._height])),i=i.concat(this._align_outer_edges_constraints(!0),this._align_outer_edges_constraints(!1),this._align_inner_cell_edges_constraints(),this._box_equal_size_bounds(!0),this._box_equal_size_bounds(!1),this._box_cell_align_bounds(!0),this._box_cell_align_bounds(!1),this._box_whitespace(!0),this._box_whitespace(!1))},w.prototype._child_rect=function(t){return{x:t.origin_x,y:t.origin_y,width:t.width,height:t.height}},w.prototype._span=function(t){return this._horizontal?{start:t.x,size:t.width}:{start:t.y,size:t.height}},w.prototype._info=function(t){var e;e=this._horizontal?{before:t.whitespace_left,after:t.whitespace_right}:{before:t.whitespace_top,after:t.whitespace_bottom};var i=this._span(this._child_rect(t));return{span:i,whitespace:e}},w.prototype._flatten_cell_edge_variables=function(t){var e;e=t?w._top_bottom_inner_cell_edge_variables:w._left_right_inner_cell_edge_variables;for(var i=t!=this._horizontal,n=this.get_layoutable_children(),r=n.length,o={},s=0,a=0,l=n;a<l.length;a++){var h=l[a],c=void 0;c=h instanceof w?h._flatten_cell_edge_variables(t):{};for(var u=h.get_constrained_variables(),_=0,p=e;_<p.length;_++){var d=p[_];d in u&&(c[d]=[u[d]])}for(var f in c){var v=c[f],m=void 0;if(i){var g=f.split(\" \"),y=g[0],b=1<g.length?g[1]:\"\",x=this._horizontal?\"row\":\"col\";m=y+\" \"+x+\"-\"+r+\"-\"+s+\"-\"+b}else m=f;o[m]=m in o?o[m].concat(v):v}s++}return o},w.prototype._align_inner_cell_edges_constraints=function(){var t=[];if(null!=this.document&&s.includes(this.document.roots(),this)){var e=this._flatten_cell_edge_variables(this._horizontal);for(var i in e){var n=e[i];if(1<n.length)for(var r=n[0],o=1;o<n.length;o++)t.push(p.EQ(n[o],[-1,r]))}}return t},w.prototype._find_edge_leaves=function(t){var e=this.get_layoutable_children(),i=[[],[]];if(0<e.length)if(this._horizontal==t){var n=e[0],r=e[e.length-1];n instanceof w?i[0]=i[0].concat(n._find_edge_leaves(t)[0]):i[0].push(n),r instanceof w?i[1]=i[1].concat(r._find_edge_leaves(t)[1]):i[1].push(r)}else for(var o=0,s=e;o<s.length;o++){var a=s[o];if(a instanceof w){var l=a._find_edge_leaves(t);i[0]=i[0].concat(l[0]),i[1]=i[1].concat(l[1])}else i[0].push(a),i[1].push(a)}return i},w.prototype._align_outer_edges_constraints=function(t){var e,i,n=this._find_edge_leaves(t),r=n[0],o=n[1];t?(e=\"on_edge_align_left\",i=\"on_edge_align_right\"):(e=\"on_edge_align_top\",i=\"on_edge_align_bottom\");var s=function(t,e){for(var i=[],n=0,r=t;n<r.length;n++){var o=r[n],s=o.get_constrained_variables();e in s&&i.push(s[e])}return i},a=s(r,e),l=s(o,i),h=[],c=function(t){if(1<t.length)for(var e=t[0],i=1;i<t.length;i++){var n=t[i];h.push(p.EQ([-1,e],n))}};return c(a),c(l),h},w.prototype._box_insets_from_child_insets=function(t,e,i,a){var n,r,o,s,l=this._find_edge_leaves(t),h=l[0],c=l[1];t?(n=e+\"_left\",r=e+\"_right\",o=this[i+\"_left\"],s=this[i+\"_right\"]):(n=e+\"_top\",r=e+\"_bottom\",o=this[i+\"_top\"],s=this[i+\"_bottom\"]);var u=[],_=function(t,e,i){for(var n=0,r=e;n<r.length;n++){var o=r[n],s=o.get_constrained_variables();i in s&&(a?u.push(p.GE([-1,t],s[i])):u.push(p.EQ([-1,t],s[i])))}};return _(o,h,n),_(s,c,r),u},w.prototype._box_equal_size_bounds=function(t){return this._box_insets_from_child_insets(t,\"box_equal_size\",\"_box_equal_size\",!1)},w.prototype._box_cell_align_bounds=function(t){return this._box_insets_from_child_insets(t,\"box_cell_align\",\"_box_cell_align\",!1)},w.prototype._box_whitespace=function(t){return this._box_insets_from_child_insets(t,\"whitespace\",\"_whitespace\",!0)},w._left_right_inner_cell_edge_variables=[\"box_cell_align_left\",\"box_cell_align_right\"],w._top_bottom_inner_cell_edge_variables=[\"box_cell_align_top\",\"box_cell_align_bottom\"],w}(o.LayoutDOM);(i.Box=l).initClass()},function(t,e,i){var n=t(387),r=t(149),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-grid-column\")},e}(r.BoxView);i.ColumnView=o;var s=function(i){function t(t){var e=i.call(this,t)||this;return e._horizontal=!1,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"Column\",this.prototype.default_view=o},t}(r.Box);(i.Column=s).initClass()},function(t,e,i){var n=t(149);i.Box=n.Box;var r=t(150);i.Column=r.Column;var o=t(152);i.LayoutDOM=o.LayoutDOM;var s=t(153);i.Row=s.Row;var a=t(154);i.Spacer=a.Spacer;var l=t(155);i.WidgetBox=l.WidgetBox},function(t,e,i){var n=t(387),r=t(57),g=t(5),o=t(15),s=t(11),h=t(13),a=t(4),l=t(6),c=function(i){function t(){var t=null!==i&&i.apply(this,arguments)||this;return t._solver_inited=!1,t._idle_notified=!1,t}return n.__extends(t,i),t.prototype.initialize=function(t){i.prototype.initialize.call(this,t),this.is_root&&(this._solver=new h.Solver),this.child_views={},this.build_child_views()},t.prototype.remove=function(){for(var t in this.child_views){var e=this.child_views[t];e.remove()}this.child_views={},i.prototype.remove.call(this)},t.prototype.has_finished=function(){if(!i.prototype.has_finished.call(this))return!1;for(var t in this.child_views){var e=this.child_views[t];if(!e.has_finished())return!1}return!0},t.prototype.notify_finished=function(){this.is_root?!this._idle_notified&&this.has_finished()&&null!=this.model.document&&(this._idle_notified=!0,this.model.document.notify_idle(this.model)):i.prototype.notify_finished.call(this)},t.prototype._calc_width_height=function(){for(var t=this.el;t=t.parentElement;)if(!t.classList.contains(\"bk-root\")){if(t==document.body){var e=g.margin(document.body),i=e.left,n=e.right,r=e.top,o=e.bottom,s=document.documentElement.clientWidth-i-n,a=document.documentElement.clientHeight-r-o;return[s,a]}var l=g.padding(t),h=l.left,c=l.right,u=l.top,_=l.bottom,p=t.getBoundingClientRect(),d=p.width,f=p.height,v=d-h-c,m=f-u-_;switch(this.model.sizing_mode){case\"scale_width\":if(0<v)return[v,0<m?m:null];break;case\"scale_height\":if(0<m)return[0<v?v:null,m];break;case\"scale_both\":case\"stretch_both\":if(0<v||0<m)return[0<v?v:null,0<m?m:null];break;default:throw new Error(\"unreachable\")}}return[null,null]},t.prototype._init_solver=function(){this._root_width=new h.Variable(this.toString()+\".root_width\"),this._root_height=new h.Variable(this.toString()+\".root_height\"),this._solver.add_edit_variable(this._root_width,NaN),this._solver.add_edit_variable(this._root_height,NaN);for(var t=this.model.get_all_editables(),e=0,i=t;e<i.length;e++){var n=i[e];this._solver.add_edit_variable(n,h.Strength.strong)}for(var r=this.model.get_all_constraints(),o=0,s=r;o<s.length;o++){var a=s[o];this._solver.add_constraint(a)}var l=this.model.get_constrained_variables();null!=l.width&&this._solver.add_constraint(h.EQ(l.width,this._root_width)),null!=l.height&&this._solver.add_constraint(h.EQ(l.height,this._root_height)),this._solver.update_variables(),this._solver_inited=!0},t.prototype._suggest_dims=function(t,e){var i,n=this.model.get_constrained_variables();null==n.width&&null==n.height||(null!=t&&null!=e||(i=this._calc_width_height(),t=i[0],e=i[1]),null!=n.width&&null!=t&&this._solver.suggest_value(this._root_width,t),null!=n.height&&null!=e&&this._solver.suggest_value(this._root_height,e),this._solver.update_variables())},t.prototype.resize=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.is_root?this._do_layout(!1,t,e):this.root.resize(t,e)},t.prototype.partial_layout=function(){this.is_root?this._do_layout(!1):this.root.partial_layout()},t.prototype.layout=function(){this.is_root?this._do_layout(!0):this.root.layout()},t.prototype._do_layout=function(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null),this._solver_inited&&!t||(this._solver.clear(),this._init_solver()),this._suggest_dims(e,i),this._layout(),this._layout(),this._layout(!0),this.notify_finished()},t.prototype._layout=function(t){void 0===t&&(t=!1);for(var e=0,i=this.model.get_layoutable_children();e<i.length;e++){var n=i[e],r=this.child_views[n.id];null!=r._layout&&r._layout(t)}this.render(),t&&(this._has_finished=!0)},t.prototype.rebuild_child_views=function(){this.solver.clear(),this.build_child_views(),this.layout()},t.prototype.build_child_views=function(){var t=this.model.get_layoutable_children();a.build_views(this.child_views,t,{parent:this}),g.empty(this.el);for(var e=0,i=t;e<i.length;e++){var n=i[e],r=this.child_views[n.id];this.el.appendChild(r.el)}},t.prototype.connect_signals=function(){var t=this;i.prototype.connect_signals.call(this),this.is_root&&window.addEventListener(\"resize\",function(){return t.resize()}),this.connect(this.model.properties.sizing_mode.change,function(){return t.layout()})},t.prototype._render_classes=function(){this.el.className=\"\";for(var t=0,e=this.css_classes();t<e.length;t++){var i=e[t];this.el.classList.add(i)}this.el.classList.add(\"bk-layout-\"+this.model.sizing_mode);for(var n=0,r=this.model.css_classes;n<r.length;n++){var o=r[n];this.el.classList.add(o)}},t.prototype.render=function(){switch(this._render_classes(),this.model.sizing_mode){case\"fixed\":var t=void 0;t=null!=this.model.width?this.model.width:this.get_width(),this.model.setv({width:t},{silent:!0});var e=void 0;e=null!=this.model.height?this.model.height:this.get_height(),this.model.setv({height:e},{silent:!0}),this.solver.suggest_value(this.model._width,t),this.solver.suggest_value(this.model._height,e);break;case\"scale_width\":var e=this.get_height();this.solver.suggest_value(this.model._height,e);break;case\"scale_height\":var t=this.get_width();this.solver.suggest_value(this.model._width,t);break;case\"scale_both\":var i=this.get_width_height(),t=i[0],e=i[1];this.solver.suggest_value(this.model._width,t),this.solver.suggest_value(this.model._height,e)}this.solver.update_variables(),this.position()},t.prototype.position=function(){switch(this.model.sizing_mode){case\"fixed\":case\"scale_width\":case\"scale_height\":this.el.style.position=\"relative\",this.el.style.left=\"\",this.el.style.top=\"\";break;case\"scale_both\":case\"stretch_both\":this.el.style.position=\"absolute\",this.el.style.left=this.model._dom_left.value+\"px\",this.el.style.top=this.model._dom_top.value+\"px\"}this.el.style.width=this.model._width.value+\"px\",this.el.style.height=this.model._height.value+\"px\"},t.prototype.get_width_height=function(){var t=this._calc_width_height(),e=t[0],i=t[1];if(null==e&&null==i)throw new Error(\"detached element\");var n=this.model.get_aspect_ratio();if(null!=e&&null==i)return[e,e/n];if(null==e&&null!=i)return[i*n,i];var r,o,s=e,a=e/n,l=i*n,h=i;return s<l?(r=s,o=a):(r=l,o=h),[r,o]},t}(l.DOMView);i.LayoutDOMView=c;var u=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LayoutDOM\",this.define({height:[o.Number],width:[o.Number],disabled:[o.Bool,!1],sizing_mode:[o.SizingMode,\"fixed\"],css_classes:[o.Array,[]]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this._width=new h.Variable(this.toString()+\".width\"),this._height=new h.Variable(this.toString()+\".height\"),this._left=new h.Variable(this.toString()+\".left\"),this._right=new h.Variable(this.toString()+\".right\"),this._top=new h.Variable(this.toString()+\".top\"),this._bottom=new h.Variable(this.toString()+\".bottom\"),this._dom_top=new h.Variable(this.toString()+\".dom_top\"),this._dom_left=new h.Variable(this.toString()+\".dom_left\"),this._width_minus_right=new h.Variable(this.toString()+\".width_minus_right\"),this._height_minus_bottom=new h.Variable(this.toString()+\".height_minus_bottom\"),this._whitespace_top=new h.Variable(this.toString()+\".whitespace_top\"),this._whitespace_bottom=new h.Variable(this.toString()+\".whitespace_bottom\"),this._whitespace_left=new h.Variable(this.toString()+\".whitespace_left\"),this._whitespace_right=new h.Variable(this.toString()+\".whitespace_right\")},Object.defineProperty(t.prototype,\"layout_bbox\",{get:function(){return{top:this._top.value,left:this._left.value,width:this._width.value,height:this._height.value,right:this._right.value,bottom:this._bottom.value,dom_top:this._dom_top.value,dom_left:this._dom_left.value}},enumerable:!0,configurable:!0}),t.prototype.dump_layout=function(){for(var t,e={},i=[this];t=i.shift();)i.push.apply(i,t.get_layoutable_children()),e[t.toString()]=t.layout_bbox;console.table(e)},t.prototype.get_all_constraints=function(){for(var t=this.get_constraints(),e=0,i=this.get_layoutable_children();e<i.length;e++){var n=i[e];t=n instanceof s.LayoutCanvas?t.concat(n.get_constraints()):t.concat(n.get_all_constraints())}return t},t.prototype.get_all_editables=function(){for(var t=this.get_editables(),e=0,i=this.get_layoutable_children();e<i.length;e++){var n=i[e];t=n instanceof s.LayoutCanvas?t.concat(n.get_editables()):t.concat(n.get_all_editables())}return t},t.prototype.get_constraints=function(){return[h.GE(this._dom_left),h.GE(this._dom_top),h.GE(this._left),h.GE(this._width,[-1,this._right]),h.GE(this._top),h.GE(this._height,[-1,this._bottom]),h.EQ(this._width_minus_right,[-1,this._width],this._right),h.EQ(this._height_minus_bottom,[-1,this._height],this._bottom)]},t.prototype.get_layoutable_children=function(){return[]},t.prototype.get_editables=function(){switch(this.sizing_mode){case\"fixed\":return[this._height,this._width];case\"scale_width\":return[this._height];case\"scale_height\":return[this._width];case\"scale_both\":return[this._width,this._height];default:return[]}},t.prototype.get_constrained_variables=function(){var t={origin_x:this._dom_left,origin_y:this._dom_top,whitespace_top:this._whitespace_top,whitespace_bottom:this._whitespace_bottom,whitespace_left:this._whitespace_left,whitespace_right:this._whitespace_right};switch(this.sizing_mode){case\"stretch_both\":t.width=this._width,t.height=this._height;break;case\"scale_width\":t.width=this._width;break;case\"scale_height\":t.height=this._height}return t},t.prototype.get_aspect_ratio=function(){return this.width/this.height},t}(r.Model);(i.LayoutDOM=u).initClass()},function(t,e,i){var n=t(387),r=t(149),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-grid-row\")},e}(r.BoxView);i.RowView=o;var s=function(i){function t(t){var e=i.call(this,t)||this;return e._horizontal=!0,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"Row\",this.prototype.default_view=o},t}(r.Box);(i.Row=s).initClass()},function(t,e,i){var n=t(387),r=t(152),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this),\"fixed\"==this.model.sizing_mode&&(this.el.style.width=this.model.width+\"px\",this.el.style.height=this.model.height+\"px\")},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-spacer-box\")},e.prototype.get_width=function(){return 1},e.prototype.get_height=function(){return 1},e}(r.LayoutDOMView);i.SpacerView=o;var s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Spacer\",this.prototype.default_view=o},t.prototype.get_constrained_variables=function(){return n.__assign({},e.prototype.get_constrained_variables.call(this),{on_edge_align_top:this._top,on_edge_align_bottom:this._height_minus_bottom,on_edge_align_left:this._left,on_edge_align_right:this._width_minus_right,box_cell_align_top:this._top,box_cell_align_bottom:this._height_minus_bottom,box_cell_align_left:this._left,box_cell_align_right:this._width_minus_right,box_equal_size_top:this._top,box_equal_size_bottom:this._height_minus_bottom,box_equal_size_left:this._left,box_equal_size_right:this._width_minus_right})},t}(r.LayoutDOM);(i.Spacer=s).initClass()},function(t,e,i){var n=t(387),r=t(14),o=t(15),s=t(152),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.properties.children.change,function(){return t.rebuild_child_views()})},t.prototype.css_classes=function(){return e.prototype.css_classes.call(this).concat(\"bk-widget-box\")},t.prototype.render=function(){if(this._render_classes(),\"fixed\"==this.model.sizing_mode||\"scale_height\"==this.model.sizing_mode){var t=this.get_width();this.model._width.value!=t&&this.solver.suggest_value(this.model._width,t)}if(\"fixed\"==this.model.sizing_mode||\"scale_width\"==this.model.sizing_mode){var e=this.get_height();this.model._height.value!=e&&this.solver.suggest_value(this.model._height,e)}if(this.solver.update_variables(),\"stretch_both\"==this.model.sizing_mode)this.el.style.position=\"absolute\",this.el.style.left=this.model._dom_left.value+\"px\",this.el.style.top=this.model._dom_top.value+\"px\",this.el.style.width=this.model._width.value+\"px\",this.el.style.height=this.model._height.value+\"px\";else{var i=void 0;i=0<this.model._width.value-20?this.model._width.value-20+\"px\":\"100%\",this.el.style.width=i}},t.prototype.get_height=function(){var t=0;for(var e in this.child_views){var i=this.child_views[e],n=i.el,r=getComputedStyle(n),o=parseInt(r.marginTop)||0,s=parseInt(r.marginBottom)||0;t+=n.offsetHeight+o+s}return t+20},t.prototype.get_width=function(){if(null!=this.model.width)return this.model.width;var t=this.el.scrollWidth+20;for(var e in this.child_views){var i=this.child_views[e],n=i.el.scrollWidth;t<n&&(t=n)}return t},t}(s.LayoutDOMView);i.WidgetBoxView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"WidgetBox\",this.prototype.default_view=a,this.define({children:[o.Array,[]]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),\"fixed\"==this.sizing_mode&&null==this.width&&(this.width=300,r.logger.info(\"WidgetBox mode is fixed, but no width specified. Using default of 300.\"))},t.prototype.get_constrained_variables=function(){var t=n.__assign({},e.prototype.get_constrained_variables.call(this),{on_edge_align_top:this._top,on_edge_align_bottom:this._height_minus_bottom,on_edge_align_left:this._left,on_edge_align_right:this._width_minus_right,box_cell_align_top:this._top,box_cell_align_bottom:this._height_minus_bottom,box_cell_align_left:this._left,box_cell_align_right:this._width_minus_right,box_equal_size_top:this._top,box_equal_size_bottom:this._height_minus_bottom});return\"fixed\"!=this.sizing_mode&&(t.box_equal_size_left=this._left,t.box_equal_size_right=this._width_minus_right),t},t.prototype.get_layoutable_children=function(){return this.children},t}(s.LayoutDOM);(i.WidgetBox=l).initClass()},function(t,e,i){var n=t(387),r=t(157),o=t(15),c=t(21),u=t(44),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"CategoricalColorMapper\",this.define({factors:[o.Array],start:[o.Number,0],end:[o.Number]})},t.prototype._v_compute=function(o,s,a,t){for(var l=t.nan_color,e=function(t,e){var i=o[t],n=void 0;u.isString(i)?n=h.factors.indexOf(i):(null!=h.start?i=null!=h.end?i.slice(h.start,h.end):i.slice(h.start):null!=h.end&&(i=i.slice(0,h.end)),n=1==i.length?h.factors.indexOf(i[0]):c.findIndex(h.factors,function(t){return function(t,e){if(t.length!=e.length)return!1;for(var i=0,n=t.length;i<n;i++)if(t[i]!==e[i])return!1;return!0}(t,i)}));var r=void 0;r=n<0||n>=a.length?l:a[n],s[t]=r},h=this,i=0,n=o.length;i<n;i++)e(i,n)},t}(r.ColorMapper);(i.CategoricalColorMapper=s).initClass()},function(t,e,i){var n=t(387),r=t(266),o=t(15),s=t(27),a=t(28);function l(t){return\"#\"!=t[0]&&(t=s.color2hex(t)),9!=t.length&&(t+=\"ff\"),parseInt(t.slice(1),16)}function h(t){for(var e=new Uint32Array(t.length),i=0,n=t.length;i<n;i++)e[i]=l(t[i]);return e}function c(t){if(a.is_little_endian)for(var e=new DataView(t.buffer),i=0,n=t.length;i<n;i++)e.setUint32(4*i,t[i]);return new Uint8Array(t.buffer)}i._convert_color=l,i._convert_palette=h,i._uint32_to_rgba=c;var u=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ColorMapper\",this.define({palette:[o.Any],nan_color:[o.Color,\"gray\"]})},t.prototype.compute=function(t){throw new Error(\"not supported\")},t.prototype.v_compute=function(t){var e=new Array(t.length);return this._v_compute(t,e,this.palette,this._colors(function(t){return t})),e},Object.defineProperty(t.prototype,\"rgba_mapper\",{get:function(){var i=this,n=h(this.palette),r=this._colors(l);return{v_compute:function(t){var e=new Uint32Array(t.length);return i._v_compute(t,e,n,r),c(e)}}},enumerable:!0,configurable:!0}),t.prototype._colors=function(t){return{nan_color:t(this.nan_color)}},t}(r.Transform);(i.ColorMapper=u).initClass()},function(t,e,i){var n=t(387),r=t(157),o=t(15),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ContinuousColorMapper\",this.define({high:[o.Number],low:[o.Number],high_color:[o.Color],low_color:[o.Color]})},t.prototype._colors=function(t){return n.__assign({},e.prototype._colors.call(this,t),{low_color:null!=this.low_color?t(this.low_color):void 0,high_color:null!=this.high_color?t(this.high_color):void 0})},t}(r.ColorMapper);(i.ContinuousColorMapper=s).initClass()},function(t,e,i){var n=t(156);i.CategoricalColorMapper=n.CategoricalColorMapper;var r=t(158);i.ContinuousColorMapper=r.ContinuousColorMapper;var o=t(157);i.ColorMapper=o.ColorMapper;var s=t(160);i.LinearColorMapper=s.LinearColorMapper;var a=t(161);i.LogColorMapper=a.LogColorMapper},function(t,e,i){var n=t(387),r=t(158),m=t(22),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LinearColorMapper\"},t.prototype._v_compute=function(t,e,i,n){for(var r=n.nan_color,o=n.low_color,s=n.high_color,a=null!=this.low?this.low:m.min(t),l=null!=this.high?this.high:m.max(t),h=i.length-1,c=1/(l-a),u=1/i.length,_=0,p=t.length;_<p;_++){var d=t[_];if(isNaN(d))e[_]=r;else if(d!=l){var f=(d-a)*c,v=Math.floor(f/u);e[_]=v<0?null!=o?o:i[0]:h<v?null!=s?s:i[h]:i[v]}else e[_]=i[h]}},t}(r.ContinuousColorMapper);(i.LinearColorMapper=o).initClass()},function(t,e,i){var n=t(387),r=t(158),m=t(22),g=null!=Math.log1p?Math.log1p:function(t){return Math.log(1+t)},o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LogColorMapper\"},t.prototype._v_compute=function(t,e,i,n){for(var r=n.nan_color,o=n.low_color,s=n.high_color,a=i.length,l=null!=this.low?this.low:m.min(t),h=null!=this.high?this.high:m.max(t),c=a/(g(h)-g(l)),u=i.length-1,_=0,p=t.length;_<p;_++){var d=t[_];if(isNaN(d))e[_]=r;else if(h<d)e[_]=null!=s?s:i[u];else if(d!=h)if(d<l)e[_]=null!=o?o:i[0];else{var f=g(d)-g(l),v=Math.floor(f*c);u<v&&(v=u),e[_]=i[v]}else e[_]=i[u]}},t}(r.ContinuousColorMapper);(i.LogColorMapper=o).initClass()},function(t,e,i){var o=t(387),s=t(163),h=Math.sqrt(3);function a(t,e){t.moveTo(-e,e),t.lineTo(e,-e),t.moveTo(-e,-e),t.lineTo(e,e)}function l(t,e){t.moveTo(0,e),t.lineTo(0,-e),t.moveTo(-e,0),t.lineTo(e,0)}function c(t,e){t.moveTo(0,e),t.lineTo(e/1.5,0),t.lineTo(0,-e),t.lineTo(-e/1.5,0),t.closePath()}function u(t,e){var i=e*h,n=i/3;t.moveTo(-e,n),t.lineTo(e,n),t.lineTo(0,n-i),t.closePath()}function n(i,n){var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.initClass=function(){this.prototype._render_one=n},e}(s.MarkerView);r.initClass();var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.initClass=function(){this.prototype.default_view=r,this.prototype.type=i},e}(s.Marker);return t.initClass(),t}i.Asterisk=n(\"Asterisk\",function(t,e,i,n,r){var o=.65*i;l(t,i),a(t,o),n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.CircleCross=n(\"CircleCross\",function(t,e,i,n,r){t.arc(0,0,i,0,2*Math.PI,!1),r.doit&&(r.set_vectorize(t,e),t.fill()),n.doit&&(n.set_vectorize(t,e),l(t,i),t.stroke())}),i.CircleX=n(\"CircleX\",function(t,e,i,n,r){t.arc(0,0,i,0,2*Math.PI,!1),r.doit&&(r.set_vectorize(t,e),t.fill()),n.doit&&(n.set_vectorize(t,e),a(t,i),t.stroke())}),i.Cross=n(\"Cross\",function(t,e,i,n,r){l(t,i),n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.Diamond=n(\"Diamond\",function(t,e,i,n,r){c(t,i),r.doit&&(r.set_vectorize(t,e),t.fill()),n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.DiamondCross=n(\"DiamondCross\",function(t,e,i,n,r){c(t,i),r.doit&&(r.set_vectorize(t,e),t.fill()),n.doit&&(n.set_vectorize(t,e),l(t,i),t.stroke())}),i.Hex=n(\"Hex\",function(t,e,i,n,r){var o,s,a,l;l=h*(a=(s=i)/2),(o=t).moveTo(s,0),o.lineTo(a,-l),o.lineTo(-a,-l),o.lineTo(-s,0),o.lineTo(-a,l),o.lineTo(a,l),o.closePath(),r.doit&&(r.set_vectorize(t,e),t.fill()),n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.InvertedTriangle=n(\"InvertedTriangle\",function(t,e,i,n,r){t.rotate(Math.PI),u(t,i),t.rotate(-Math.PI),r.doit&&(r.set_vectorize(t,e),t.fill()),n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.Square=n(\"Square\",function(t,e,i,n,r){var o=2*i;t.rect(-i,-i,o,o),r.doit&&(r.set_vectorize(t,e),t.fill()),n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.SquareCross=n(\"SquareCross\",function(t,e,i,n,r){var o=2*i;t.rect(-i,-i,o,o),r.doit&&(r.set_vectorize(t,e),t.fill()),n.doit&&(n.set_vectorize(t,e),l(t,i),t.stroke())}),i.SquareX=n(\"SquareX\",function(t,e,i,n,r){var o=2*i;t.rect(-i,-i,o,o),r.doit&&(r.set_vectorize(t,e),t.fill()),n.doit&&(n.set_vectorize(t,e),a(t,i),t.stroke())}),i.Triangle=n(\"Triangle\",function(t,e,i,n,r){u(t,i),r.doit&&(r.set_vectorize(t,e),t.fill()),n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.X=n(\"X\",function(t,e,i,n,r){a(t,i),n.doit&&(n.set_vectorize(t,e),t.stroke())})},function(t,e,i){var n=t(387),r=t(141),w=t(9),o=t(15),h=t(21),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i._size,s=i._angle,a=0,l=e;a<l.length;a++){var h=l[a];if(!isNaN(n[h]+r[h]+o[h]+s[h])){var c=o[h]/2;t.beginPath(),t.translate(n[h],r[h]),s[h]&&t.rotate(s[h]),this._render_one(t,h,c,this.visuals.line,this.visuals.fill),s[h]&&t.rotate(-s[h]),t.translate(-n[h],-r[h])}}},e.prototype._mask_data=function(){var t=this.renderer.plot_view.frame.bbox.h_range,e=t.start-this.max_size,i=t.end+this.max_size,n=this.renderer.xscale.r_invert(e,i),r=n[0],o=n[1],s=this.renderer.plot_view.frame.bbox.v_range,a=s.start-this.max_size,l=s.end+this.max_size,h=this.renderer.yscale.r_invert(a,l),c=h[0],u=h[1],_=w.validate_bbox_coords([r,o],[c,u]);return this.index.indices(_)},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=e-this.max_size,r=e+this.max_size,o=this.renderer.xscale.r_invert(n,r),s=o[0],a=o[1],l=i-this.max_size,h=i+this.max_size,c=this.renderer.yscale.r_invert(l,h),u=c[0],_=c[1],p=w.validate_bbox_coords([s,a],[u,_]),d=this.index.indices(p),f=[],v=0,m=d;v<m.length;v++){var g=m[v],y=this._size[g]/2,b=Math.abs(this.sx[g]-e)+Math.abs(this.sy[g]-i);Math.abs(this.sx[g]-e)<=y&&Math.abs(this.sy[g]-i)<=y&&f.push([g,b])}return w.create_hit_test_result_from_hits(f)},e.prototype._hit_span=function(t){var e,i,n,r,o,s,a=t.sx,l=t.sy,h=this.bounds(),c=h.minX,u=h.minY,_=h.maxX,p=h.maxY,d=w.create_empty_hit_test_result();if(\"h\"==t.direction){o=u,s=p;var f=this.max_size/2,v=a-f,m=a+f;e=this.renderer.xscale.r_invert(v,m),n=e[0],r=e[1]}else{n=c,r=_;var f=this.max_size/2,g=l-f,y=l+f;i=this.renderer.yscale.r_invert(g,y),o=i[0],s=i[1]}var b=w.validate_bbox_coords([n,r],[o,s]),x=this.index.indices(b);return d.indices=x,d},e.prototype._hit_rect=function(t){var e=t.sx0,i=t.sx1,n=t.sy0,r=t.sy1,o=this.renderer.xscale.r_invert(e,i),s=o[0],a=o[1],l=this.renderer.yscale.r_invert(n,r),h=l[0],c=l[1],u=w.validate_bbox_coords([s,a],[h,c]),_=w.create_empty_hit_test_result();return _.indices=this.index.indices(u),_},e.prototype._hit_poly=function(t){for(var e=t.sx,i=t.sy,n=h.range(0,this.sx.length),r=[],o=0,s=n.length;o<s;o++){var a=n[o];w.point_in_poly(this.sx[o],this.sy[o],e,i)&&r.push(a)}var l=w.create_empty_hit_test_result();return l.indices=r,l},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.x1,o=e.y0,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+r)/2;var h=new Array(a);h[i]=(o+s)/2;var c=new Array(a);c[i]=.4*Math.min(Math.abs(r-n),Math.abs(s-o));var u=new Array(a);u[i]=this._angle[i],this._render(t,[i],{sx:l,sy:h,_size:c,_angle:u})},e}(r.XYGlyphView);i.MarkerView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.mixins([\"line\",\"fill\"]),this.define({size:[o.DistanceSpec,{units:\"screen\",value:4}],angle:[o.AngleSpec,0]})},t}(r.XYGlyph);(i.Marker=a).initClass()},function(t,e,i){var n=t(387),r=t(14),o=t(165),s=t(167),a=t(15),l=t(57),h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"MapOptions\",this.define({lat:[a.Number],lng:[a.Number],zoom:[a.Number,12]})},t}(l.Model);(i.MapOptions=h).initClass();var c=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"GMapOptions\",this.define({map_type:[a.String,\"roadmap\"],scale_control:[a.Bool,!1],styles:[a.String]})},t}(h);(i.GMapOptions=c).initClass();var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(s.PlotView);i.GMapPlotView=u;var _=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"GMapPlot\",this.prototype.default_view=u,this.define({map_options:[a.Instance],api_key:[a.String]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.api_key||r.logger.error(\"api_key is required. See https://developers.google.com/maps/documentation/javascript/get-api-key for more information on how to obtain your own.\")},t.prototype._init_plot_canvas=function(){return new o.GMapPlotCanvas({plot:this})},t}(s.Plot);(i.GMapPlot=_).initClass()},function(t,e,i){var n=t(387),r=t(19),u=t(33),o=t(168),s=new r.Signal0({},\"gmaps_ready\"),a=function(a){function t(){return null!==a&&a.apply(this,arguments)||this}return n.__extends(t,a),t.prototype.initialize=function(t){var e=this;this.pause(),a.prototype.initialize.call(this,t),this._tiles_loaded=!1,this.zoom_count=0;var i=this.model.plot.map_options,n=i.zoom,r=i.lat,o=i.lng;this.initial_zoom=n,this.initial_lat=r,this.initial_lng=o,this.canvas_view.map_el.style.position=\"absolute\",\"undefined\"!=typeof google&&null!=google.maps||(\"undefined\"==typeof _bokeh_gmaps_callback&&function(t){_bokeh_gmaps_callback=function(){return s.emit()};var e=document.createElement(\"script\");e.type=\"text/javascript\",e.src=\"https://maps.googleapis.com/maps/api/js?key=\"+t+\"&callback=_bokeh_gmaps_callback\",document.body.appendChild(e)}(this.model.plot.api_key),s.connect(function(){return e.request_render()})),this.unpause()},t.prototype.update_range=function(t){if(null==t)this.map.setCenter({lat:this.initial_lat,lng:this.initial_lng}),this.map.setOptions({zoom:this.initial_zoom}),a.prototype.update_range.call(this,null);else if(null!=t.sdx||null!=t.sdy)this.map.panBy(t.sdx||0,t.sdy||0),a.prototype.update_range.call(this,t);else if(null!=t.factor){var e=void 0;if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,this.pause(),a.prototype.update_range.call(this,t),e=t.factor<0?-1:1;var i=this.map.getZoom(),n=i+e;if(2<=n){this.map.setZoom(n);var r=this._get_projected_bounds(),o=r[0],s=r[1];s-o<0&&this.map.setZoom(i)}this.unpause()}this._set_bokeh_ranges()},t.prototype._build_map=function(){var t=this,e=google.maps;this.map_types={satellite:e.MapTypeId.SATELLITE,terrain:e.MapTypeId.TERRAIN,roadmap:e.MapTypeId.ROADMAP,hybrid:e.MapTypeId.HYBRID};var i=this.model.plot.map_options,n={center:new e.LatLng(i.lat,i.lng),zoom:i.zoom,disableDefaultUI:!0,mapTypeId:this.map_types[i.map_type],scaleControl:i.scale_control};null!=i.styles&&(n.styles=JSON.parse(i.styles)),this.map=new e.Map(this.canvas_view.map_el,n),e.event.addListener(this.map,\"idle\",function(){return t._set_bokeh_ranges()}),e.event.addListener(this.map,\"bounds_changed\",function(){return t._set_bokeh_ranges()}),e.event.addListenerOnce(this.map,\"tilesloaded\",function(){return t._render_finished()}),this.connect(this.model.plot.properties.map_options.change,function(){return t._update_options()}),this.connect(this.model.plot.map_options.properties.styles.change,function(){return t._update_styles()}),this.connect(this.model.plot.map_options.properties.lat.change,function(){return t._update_center(\"lat\")}),this.connect(this.model.plot.map_options.properties.lng.change,function(){return t._update_center(\"lng\")}),this.connect(this.model.plot.map_options.properties.zoom.change,function(){return t._update_zoom()}),this.connect(this.model.plot.map_options.properties.map_type.change,function(){return t._update_map_type()}),this.connect(this.model.plot.map_options.properties.scale_control.change,function(){return t._update_scale_control()})},t.prototype._render_finished=function(){this._tiles_loaded=!0,this.notify_finished()},t.prototype.has_finished=function(){return a.prototype.has_finished.call(this)&&!0===this._tiles_loaded},t.prototype._get_latlon_bounds=function(){var t=this.map.getBounds(),e=t.getNorthEast(),i=t.getSouthWest(),n=i.lng(),r=e.lng(),o=i.lat(),s=e.lat();return[n,r,o,s]},t.prototype._get_projected_bounds=function(){var t=this._get_latlon_bounds(),e=t[0],i=t[1],n=t[2],r=t[3],o=u.wgs84_mercator.forward([e,n]),s=o[0],a=o[1],l=u.wgs84_mercator.forward([i,r]),h=l[0],c=l[1];return[s,h,a,c]},t.prototype._set_bokeh_ranges=function(){var t=this._get_projected_bounds(),e=t[0],i=t[1],n=t[2],r=t[3];this.frame.x_range.setv({start:e,end:i}),this.frame.y_range.setv({start:n,end:r})},t.prototype._update_center=function(t){var e=this.map.getCenter().toJSON();e[t]=this.model.plot.map_options[t],this.map.setCenter(e),this._set_bokeh_ranges()},t.prototype._update_map_type=function(){this.map.setOptions({mapTypeId:this.map_types[this.model.plot.map_options.map_type]})},t.prototype._update_scale_control=function(){this.map.setOptions({scaleControl:this.model.plot.map_options.scale_control})},t.prototype._update_options=function(){this._update_styles(),this._update_center(\"lat\"),this._update_center(\"lng\"),this._update_zoom(),this._update_map_type()},t.prototype._update_styles=function(){this.map.setOptions({styles:JSON.parse(this.model.plot.map_options.styles)})},t.prototype._update_zoom=function(){this.map.setOptions({zoom:this.model.plot.map_options.zoom}),this._set_bokeh_ranges()},t.prototype._map_hook=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3];this.canvas_view.map_el.style.top=n+\"px\",this.canvas_view.map_el.style.left=i+\"px\",this.canvas_view.map_el.style.width=r+\"px\",this.canvas_view.map_el.style.height=o+\"px\",null==this.map&&\"undefined\"!=typeof google&&null!=google.maps&&this._build_map()},t.prototype._paint_empty=function(t,e){var i=this.canvas._width.value,n=this.canvas._height.value,r=e[0],o=e[1],s=e[2],a=e[3];t.clearRect(0,0,i,n),t.beginPath(),t.moveTo(0,0),t.lineTo(0,n),t.lineTo(i,n),t.lineTo(i,0),t.lineTo(0,0),t.moveTo(r,o),t.lineTo(r+s,o),t.lineTo(r+s,o+a),t.lineTo(r,o+a),t.lineTo(r,o),t.closePath(),t.fillStyle=this.model.plot.border_fill_color,t.fill()},t}(o.PlotCanvasView);i.GMapPlotCanvasView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"GMapPlotCanvas\",this.prototype.default_view=a},t.prototype.initialize=function(){this.use_map=!0,e.prototype.initialize.call(this)},t}(o.PlotCanvas);(i.GMapPlotCanvas=l).initClass()},function(t,e,i){var n=t(164);i.MapOptions=n.MapOptions;var r=t(164);i.GMapOptions=r.GMapOptions;var o=t(164);i.GMapPlot=o.GMapPlot;var s=t(165);i.GMapPlotCanvas=s.GMapPlotCanvas;var a=t(167);i.Plot=a.Plot;var l=t(168);i.PlotCanvas=l.PlotCanvas},function(t,e,i){var o=t(387),n=t(13),r=t(14),s=t(15),f=t(19),a=t(21),v=t(32),m=t(44),l=t(152),h=t(73),c=t(182),u=t(255),_=t(74),p=t(168),g=t(190),y=t(175),b=t(3),x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.connect_signals=function(){t.prototype.connect_signals.call(this),this.connect(this.model.properties.title.change,function(){return r.logger.warn(\"Title object cannot be replaced. Try changing properties on title to update it after initialization.\")})},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-plot-layout\")},e.prototype.get_height=function(){return this.model._width.value/this.model.get_aspect_ratio()},e.prototype.get_width=function(){return this.model._height.value*this.model.get_aspect_ratio()},e.prototype.save=function(t){this.plot_canvas_view.save(t)},Object.defineProperty(e.prototype,\"plot_canvas_view\",{get:function(){return this.child_views[this.model.plot_canvas.id]},enumerable:!0,configurable:!0}),e}(l.LayoutDOMView);i.PlotView=x;var d=function(d){function t(t){return d.call(this,t)||this}return o.__extends(t,d),t.initClass=function(){this.prototype.type=\"Plot\",this.prototype.default_view=x,this.mixins([\"line:outline_\",\"fill:background_\",\"fill:border_\"]),this.define({toolbar:[s.Instance,function(){return new u.Toolbar}],toolbar_location:[s.Location,\"right\"],toolbar_sticky:[s.Boolean,!0],plot_width:[s.Number,600],plot_height:[s.Number,600],title:[s.Any,function(){return new h.Title({text:\"\"})}],title_location:[s.Location,\"above\"],h_symmetry:[s.Bool,!0],v_symmetry:[s.Bool,!1],above:[s.Array,[]],below:[s.Array,[]],left:[s.Array,[]],right:[s.Array,[]],renderers:[s.Array,[]],x_range:[s.Instance],extra_x_ranges:[s.Any,{}],y_range:[s.Instance],extra_y_ranges:[s.Any,{}],x_scale:[s.Instance,function(){return new c.LinearScale}],y_scale:[s.Instance,function(){return new c.LinearScale}],lod_factor:[s.Number,10],lod_interval:[s.Number,300],lod_threshold:[s.Number,2e3],lod_timeout:[s.Number,500],hidpi:[s.Bool,!0],output_backend:[s.OutputBackend,\"canvas\"],min_border:[s.Number,5],min_border_top:[s.Number,null],min_border_left:[s.Number,null],min_border_bottom:[s.Number,null],min_border_right:[s.Number,null],inner_width:[s.Number],inner_height:[s.Number],layout_width:[s.Number],layout_height:[s.Number],match_aspect:[s.Bool,!1],aspect_scale:[s.Number,1]}),this.override({outline_line_color:\"#e5e5e5\",border_fill_color:\"#ffffff\",background_fill_color:\"#ffffff\"}),b.register_with_event(b.UIEvent,this)},t.prototype.initialize=function(){d.prototype.initialize.call(this),this.reset=new f.Signal0(this,\"reset\");for(var t=0,e=v.values(this.extra_x_ranges).concat(this.x_range);t<e.length;t++){var i=e[t],n=i.plots;m.isArray(n)&&(n=n.concat(this),i.setv({plots:n},{silent:!0}))}for(var r=0,o=v.values(this.extra_y_ranges).concat(this.y_range);r<o.length;r++){var s=o[r],n=s.plots;m.isArray(n)&&(n=n.concat(this),s.setv({plots:n},{silent:!0}))}null!=this.min_border&&(null==this.min_border_top&&(this.min_border_top=this.min_border),null==this.min_border_bottom&&(this.min_border_bottom=this.min_border),null==this.min_border_left&&(this.min_border_left=this.min_border),null==this.min_border_right&&(this.min_border_right=this.min_border));for(var a=0,l=[\"above\",\"below\",\"left\",\"right\"];a<l.length;a++)for(var h=l[a],c=this.getv(h),u=0,_=c;u<_.length;u++){var p=_[u];p.add_panel(h)}this._init_title_panel(),this._init_toolbar_panel(),this._plot_canvas=this._init_plot_canvas(),this.plot_canvas.toolbar=this.toolbar,null==this.width&&(this.width=this.plot_width),null==this.height&&(this.height=this.plot_height)},t.prototype._init_plot_canvas=function(){return new p.PlotCanvas({plot:this})},t.prototype._init_title_panel=function(){if(null!=this.title){var t=m.isString(this.title)?new h.Title({text:this.title}):this.title;this.add_layout(t,this.title_location)}},t.prototype._init_toolbar_panel=function(){var e=this,t=a.find(this.renderers,function(t){return t instanceof _.ToolbarPanel&&a.includes(t.tags,e.id)});switch(null!=t&&this.remove_layout(t),this.toolbar_location){case\"left\":case\"right\":case\"above\":case\"below\":if(t=new _.ToolbarPanel({toolbar:this.toolbar,tags:[this.id]}),this.toolbar.toolbar_location=this.toolbar_location,this.toolbar_sticky){var i=this.getv(this.toolbar_location),n=a.find(i,function(t){return t instanceof h.Title});if(null!=n)return t.set_panel(n.panel),void this.add_renderers(t)}this.add_layout(t,this.toolbar_location)}},t.prototype.connect_signals=function(){var t=this;d.prototype.connect_signals.call(this),this.connect(this.properties.toolbar_location.change,function(){return t._init_toolbar_panel()})},Object.defineProperty(t.prototype,\"plot_canvas\",{get:function(){return this._plot_canvas},enumerable:!0,configurable:!0}),t.prototype._doc_attached=function(){this.plot_canvas.attach_document(this.document),d.prototype._doc_attached.call(this)},t.prototype.add_renderers=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=this.renderers;i=i.concat(t),this.renderers=i},t.prototype.add_layout=function(t,e){if(void 0===e&&(e=\"center\"),null!=t.props.plot&&(t.plot=this),\"center\"!=e){var i=this.getv(e);i.push(t),t.add_panel(e)}this.add_renderers(t)},t.prototype.remove_layout=function(e){var t=function(t){a.removeBy(t,function(t){return t==e})};t(this.left),t(this.right),t(this.above),t(this.below),t(this.renderers)},t.prototype.add_glyph=function(t,e,i){void 0===e&&(e=new g.ColumnDataSource),void 0===i&&(i={});var n=o.__assign({},i,{data_source:e,glyph:t}),r=new y.GlyphRenderer(n);return this.add_renderers(r),r},t.prototype.add_tools=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,n=t;i<n.length;i++){var r=n[i];null!=r.overlay&&this.add_renderers(r.overlay)}this.toolbar.tools=this.toolbar.tools.concat(t)},t.prototype.get_layoutable_children=function(){return[this.plot_canvas]},t.prototype.get_constraints=function(){var t=d.prototype.get_constraints.call(this);return t.push(n.EQ(this._width,[-1,this.plot_canvas._width])),t.push(n.EQ(this._height,[-1,this.plot_canvas._height])),t},t.prototype.get_constrained_variables=function(){var t=o.__assign({},d.prototype.get_constrained_variables.call(this),{on_edge_align_top:this.plot_canvas._top,on_edge_align_bottom:this.plot_canvas._height_minus_bottom,on_edge_align_left:this.plot_canvas._left,on_edge_align_right:this.plot_canvas._width_minus_right,box_cell_align_top:this.plot_canvas._top,box_cell_align_bottom:this.plot_canvas._height_minus_bottom,box_cell_align_left:this.plot_canvas._left,box_cell_align_right:this.plot_canvas._width_minus_right,box_equal_size_top:this.plot_canvas._top,box_equal_size_bottom:this.plot_canvas._height_minus_bottom});return\"fixed\"!=this.sizing_mode&&(t.box_equal_size_left=this.plot_canvas._left,t.box_equal_size_right=this.plot_canvas._width_minus_right),t},Object.defineProperty(t.prototype,\"all_renderers\",{get:function(){for(var t=this.renderers,e=0,i=this.toolbar.tools;e<i.length;e++){var n=i[e];t=t.concat(n.synthetic_renderers)}return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"webgl\",{get:function(){return r.logger.warn(\"webgl attr is deprecated, use output_backend\"),\"webgl\"==this.output_backend},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"tool_events\",{get:function(){return r.logger.warn(\"tool_events attr is deprecated, use SelectionGeometry Event\"),null},enumerable:!0,configurable:!0}),t}(l.LayoutDOM);(i.Plot=d).initClass()},function(t,e,i){var l=t(387),n=t(89),r=t(90),T=t(170),C=t(175),o=t(152),s=t(3),h=t(19),u=t(4),c=t(20),_=t(49),a=t(6),p=t(11),d=t(10),f=t(13),A=t(14),v=t(7),m=t(15),g=t(42),y=t(44),b=t(21),E=t(32),x=t(12),w=null,k=function(a){function t(){return null!==a&&a.apply(this,arguments)||this}return l.__extends(t,a),Object.defineProperty(t.prototype,\"frame\",{get:function(){return this.model.frame},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"canvas\",{get:function(){return this.model.canvas},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"canvas_overlays\",{get:function(){return this.canvas_view.overlays_el},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"canvas_events\",{get:function(){return this.canvas_view.events_el},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"is_paused\",{get:function(){return null!=this._is_paused&&0!==this._is_paused},enumerable:!0,configurable:!0}),t.prototype.view_options=function(){return{plot_view:this,parent:this}},t.prototype.pause=function(){null==this._is_paused?this._is_paused=1:this._is_paused+=1},t.prototype.unpause=function(t){if(void 0===t&&(t=!1),null==this._is_paused)throw new Error(\"wasn't paused\");this._is_paused-=1,0!=this._is_paused||t||this.request_render()},t.prototype.request_render=function(){this.request_paint()},t.prototype.request_paint=function(){this.is_paused||this.throttled_paint()},t.prototype.reset=function(){this.clear_state(),this.reset_range(),this.reset_selection(),this.model.plot.trigger_event(new s.Reset)},t.prototype.remove=function(){u.remove_views(this.renderer_views),u.remove_views(this.tool_views),this.canvas_view.remove(),a.prototype.remove.call(this)},t.prototype.css_classes=function(){return a.prototype.css_classes.call(this).concat(\"bk-plot-wrapper\")},t.prototype.initialize=function(t){var e=this;this.pause(),a.prototype.initialize.call(this,t),this.force_paint=new h.Signal0(this,\"force_paint\"),this.state_changed=new h.Signal0(this,\"state_changed\"),this.lod_started=!1,this.visuals=new _.Visuals(this.model.plot),this._initial_state_info={selection:{},dimensions:{width:this.model.canvas._width.value,height:this.model.canvas._height.value}},this.state={history:[],index:-1},this.canvas_view=new this.canvas.default_view({model:this.canvas,parent:this}),this.el.appendChild(this.canvas_view.el),this.canvas_view.render(),\"webgl\"==this.model.plot.output_backend&&this.init_webgl(),this.throttled_paint=g.throttle(function(){return e.force_paint.emit()},15),this.ui_event_bus=new c.UIEvents(this,this.model.toolbar,this.canvas_view.events_el,this.model.plot),this.levels={};for(var i=0,n=v.RenderLevel;i<n.length;i++){var r=n[i];this.levels[r]={}}this.renderer_views={},this.tool_views={},this.build_levels(),this.build_tools(),this.update_dataranges(),this.unpause(!0),A.logger.debug(\"PlotView initialized\")},t.prototype.set_cursor=function(t){void 0===t&&(t=\"default\"),this.canvas_view.el.style.cursor=t},t.prototype.init_webgl=function(){if(null==w){var t=document.createElement(\"canvas\"),e={premultipliedAlpha:!0},i=t.getContext(\"webgl\",e)||t.getContext(\"experimental-webgl\",e);null!=i&&(w={canvas:t,ctx:i})}null!=w?this.gl=w:A.logger.warn(\"WebGL is not supported, falling back to 2D canvas.\")},t.prototype.prepare_webgl=function(t,e){if(null!=this.gl){var i=this.canvas_view.get_canvas_element();this.gl.canvas.width=i.width,this.gl.canvas.height=i.height;var n=this.gl.ctx;n.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT||n.DEPTH_BUFFER_BIT),n.enable(n.SCISSOR_TEST);var r=e[0],o=e[1],s=e[2],a=e[3],l=this.model.canvas,h=l.xview,c=l.yview,u=h.compute(r),_=c.compute(o+a);n.scissor(t*u,t*_,t*s,t*a),n.enable(n.BLEND),n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE_MINUS_DST_ALPHA,n.ONE)}},t.prototype.blit_webgl=function(t){var e=this.canvas_view.ctx;null!=this.gl&&(A.logger.debug(\"drawing with WebGL\"),e.restore(),e.drawImage(this.gl.canvas,0,0),e.save(),e.scale(t,t),e.translate(.5,.5))},t.prototype.update_dataranges=function(){for(var t=this.model.frame,e={},i={},n=!1,r=0,o=E.values(t.x_ranges).concat(E.values(t.y_ranges));r<o.length;r++){var s=o[r];s instanceof T.DataRange1d&&\"log\"==s.scale_hint&&(n=!0)}for(var a in this.renderer_views){var l=this.renderer_views[a];if(l instanceof C.GlyphRendererView){var h=l.glyph.bounds();if(null!=h&&(e[a]=h),n){var c=l.glyph.log_bounds();null!=c&&(i[a]=c)}}}var u,_=!1,p=!1;!1!==this.model.plot.match_aspect&&0!=this.frame._width.value&&0!=this.frame._height.value&&(u=1/this.model.plot.aspect_scale*(this.frame._width.value/this.frame._height.value));for(var d=0,f=E.values(t.x_ranges);d<f.length;d++){var v=f[d];if(v instanceof T.DataRange1d){var m=\"log\"==v.scale_hint?i:e;v.update(m,0,this.model.id,u),v.follow&&(_=!0)}null!=v.bounds&&(p=!0)}for(var g=0,y=E.values(t.y_ranges);g<y.length;g++){var b=y[g];if(b instanceof T.DataRange1d){var m=\"log\"==b.scale_hint?i:e;b.update(m,1,this.model.id,u),b.follow&&(_=!0)}null!=b.bounds&&(p=!0)}if(_&&p){A.logger.warn(\"Follow enabled so bounds are unset.\");for(var x=0,w=E.values(t.x_ranges);x<w.length;x++){var v=w[x];v.bounds=null}for(var k=0,S=E.values(t.y_ranges);k<S.length;k++){var b=S[k];b.bounds=null}}this.range_update_timestamp=Date.now()},t.prototype.map_to_screen=function(t,e,i,n){return void 0===i&&(i=\"default\"),void 0===n&&(n=\"default\"),this.frame.map_to_screen(t,e,i,n)},t.prototype.push_state=function(t,e){var i=this.state,n=i.history,r=i.index,o=null!=n[r]?n[r].info:{},s=l.__assign({},this._initial_state_info,o,e);this.state.history=this.state.history.slice(0,this.state.index+1),this.state.history.push({type:t,info:s}),this.state.index=this.state.history.length-1,this.state_changed.emit()},t.prototype.clear_state=function(){this.state={history:[],index:-1},this.state_changed.emit()},t.prototype.can_undo=function(){this.state.index},t.prototype.can_redo=function(){this.state.index,this.state.history.length},t.prototype.undo=function(){this.can_undo()&&(this.state.index-=1,this._do_state_change(this.state.index),this.state_changed.emit())},t.prototype.redo=function(){this.can_redo()&&(this.state.index+=1,this._do_state_change(this.state.index),this.state_changed.emit())},t.prototype._do_state_change=function(t){var e=null!=this.state.history[t]?this.state.history[t].info:this._initial_state_info;null!=e.range&&this.update_range(e.range),null!=e.selection&&this.update_selection(e.selection)},t.prototype.get_selection=function(){for(var t={},e=0,i=this.model.plot.renderers;e<i.length;e++){var n=i[e];if(n instanceof C.GlyphRenderer){var r=n.data_source.selected;t[n.id]=r}}return t},t.prototype.update_selection=function(t){for(var e=0,i=this.model.plot.renderers;e<i.length;e++){var n=i[e];if(n instanceof C.GlyphRenderer){var r=n.data_source;null!=t?null!=t[n.id]&&(r.selected=t[n.id]):r.selection_manager.clear()}}},t.prototype.reset_selection=function(){this.update_selection(null)},t.prototype._update_ranges_together=function(t){for(var e=1,i=0,n=t;i<n.length;i++){var r=n[i],o=r[0],s=r[1];e=Math.min(e,this._get_weight_to_constrain_interval(o,s))}if(e<1)for(var a=0,l=t;a<l.length;a++){var h=l[a],o=h[0],s=h[1];s.start=e*s.start+(1-e)*o.start,s.end=e*s.end+(1-e)*o.end}},t.prototype._update_ranges_individually=function(t,e,i,n){for(var r=!1,o=0,s=t;o<s.length;o++){var a=s[o],l=a[0],h=a[1],c=l.start>l.end;if(!i){var u=this._get_weight_to_constrain_interval(l,h);u<1&&(h.start=u*h.start+(1-u)*l.start,h.end=u*h.end+(1-u)*l.end)}if(null!=l.bounds&&\"auto\"!=l.bounds){var _=l.bounds,p=_[0],d=_[1],f=Math.abs(h.end-h.start);c?(null!=p&&p>=h.end&&(r=!0,h.end=p,(e||i)&&(h.start=p+f)),null!=d&&d<=h.start&&(r=!0,h.start=d,(e||i)&&(h.end=d-f))):(null!=p&&p>=h.start&&(r=!0,h.start=p,(e||i)&&(h.end=p+f)),null!=d&&d<=h.end&&(r=!0,h.end=d,(e||i)&&(h.start=d-f)))}}if(!(i&&r&&n))for(var v=0,m=t;v<m.length;v++){var g=m[v],l=g[0],h=g[1];l.have_updated_interactively=!0,l.start==h.start&&l.end==h.end||l.setv(h)}},t.prototype._get_weight_to_constrain_interval=function(t,e){var i=t.min_interval,n=t.max_interval;if(null!=t.bounds&&\"auto\"!=t.bounds){var r=t.bounds,o=r[0],s=r[1];if(null!=o&&null!=s){var a=Math.abs(s-o);n=null!=n?Math.min(n,a):a}}var l=1;if(null!=i||null!=n){var h=Math.abs(t.end-t.start),c=Math.abs(e.end-e.start);0<i&&c<i&&(l=(h-i)/(h-c)),0<n&&n<c&&(l=(n-h)/(c-h)),l=Math.max(0,Math.min(1,l))}return l},t.prototype.update_range=function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=!0),this.pause();var r=this.frame,o=r.x_ranges,s=r.y_ranges;if(null==t){for(var a in o){var l=o[a];l.reset()}for(var h in s){var l=s[h];l.reset()}this.update_dataranges()}else{var c=[];for(var u in o){var l=o[u];c.push([l,t.xrs[u]])}for(var _ in s){var l=s[_];c.push([l,t.yrs[_]])}i&&this._update_ranges_together(c),this._update_ranges_individually(c,e,i,n)}this.unpause()},t.prototype.reset_range=function(){this.update_range(null)},t.prototype.build_levels=function(){var t=this.model.plot.all_renderers,e=E.keys(this.renderer_views),i=u.build_views(this.renderer_views,t,this.view_options()),n=b.difference(e,t.map(function(t){return t.id}));for(var r in this.levels)for(var o=0,s=n;o<s.length;o++){var a=s[o];delete this.levels[r][a]}for(var l=0,h=i;l<h.length;l++){var c=h[l];this.levels[c.model.level][c.model.id]=c}},t.prototype.get_renderer_views=function(){var e=this;return this.model.plot.renderers.map(function(t){return e.levels[t.level][t.id]})},t.prototype.build_tools=function(){var e=this,t=this.model.plot.toolbar.tools,i=u.build_views(this.tool_views,t,this.view_options());i.map(function(t){return e.ui_event_bus.register_tool(t)})},t.prototype.connect_signals=function(){var t=this;a.prototype.connect_signals.call(this),this.connect(this.force_paint,function(){return t.repaint()});var e=this.model.frame,i=e.x_ranges,n=e.y_ranges;for(var r in i){var o=i[r];this.connect(o.change,function(){return t.request_render()})}for(var s in n){var o=n[s];this.connect(o.change,function(){return t.request_render()})}this.connect(this.model.plot.properties.renderers.change,function(){return t.build_levels()}),this.connect(this.model.plot.toolbar.properties.tools.change,function(){t.build_levels(),t.build_tools()}),this.connect(this.model.plot.change,function(){return t.request_render()}),this.connect(this.model.plot.reset,function(){return t.reset()})},t.prototype.set_initial_range=function(){var t=!0,e=this.frame,i=e.x_ranges,n=e.y_ranges,r={},o={};for(var s in i){var a=i[s],l=a.start,h=a.end;if(null==l||null==h||y.isStrictNaN(l+h)){t=!1;break}r[s]={start:l,end:h}}if(t)for(var c in n){var u=n[c],l=u.start,h=u.end;if(null==l||null==h||y.isStrictNaN(l+h)){t=!1;break}o[c]={start:l,end:h}}t?(this._initial_state_info.range={xrs:r,yrs:o},A.logger.debug(\"initial ranges set\")):A.logger.warn(\"could not set initial ranges\")},t.prototype.update_constraints=function(){for(var t in this.solver.suggest_value(this.frame._width,this.canvas._width.value),this.solver.suggest_value(this.frame._height,this.canvas._height.value),this.renderer_views){var e=this.renderer_views[t];x.isSizeableView(e)&&null!=e.model.panel&&x.update_panel_constraints(e)}this.solver.update_variables()},t.prototype._layout=function(t){void 0===t&&(t=!1),this.render(),t&&(this.model.plot.setv({inner_width:Math.round(this.frame._width.value),inner_height:Math.round(this.frame._height.value),layout_width:Math.round(this.canvas._width.value),layout_height:Math.round(this.canvas._height.value)},{no_change:!0}),this.paint())},t.prototype.has_finished=function(){if(!a.prototype.has_finished.call(this))return!1;for(var t in this.levels){var e=this.levels[t];for(var i in e){var n=e[i];if(!n.has_finished())return!1}}return!0},t.prototype.render=function(){var t=this.model._width.value,e=this.model._height.value;this.canvas_view.set_dims([t,e]),this.update_constraints(),!1!==this.model.plot.match_aspect&&0!=this.frame._width.value&&0!=this.frame._height.value&&this.update_dataranges(),this.el.style.position=\"absolute\",this.el.style.left=this.model._dom_left.value+\"px\",this.el.style.top=this.model._dom_top.value+\"px\",this.el.style.width=this.model._width.value+\"px\",this.el.style.height=this.model._height.value+\"px\"},t.prototype._needs_layout=function(){for(var t in this.renderer_views){var e=this.renderer_views[t];if(x.isSizeableView(e)&&null!=e.model.panel&&x._view_sizes.get(e)!=e.get_size())return!0}return!1},t.prototype.repaint=function(){this._needs_layout()?this.parent.partial_layout():this.paint()},t.prototype.paint=function(){var t=this;if(!this.is_paused){A.logger.trace(\"PlotCanvas.render() for \"+this.model.id),this.canvas_view.prepare_canvas();var e=this.model.document;if(null!=e){var i=e.interactive_duration(),n=this.model.plot;0<=i&&i<n.lod_interval?setTimeout(function(){e.interactive_duration()>n.lod_timeout&&e.interactive_stop(n),t.request_render()},n.lod_timeout):e.interactive_stop(n)}for(var r in this.renderer_views){var o=this.renderer_views[r];if(null==this.range_update_timestamp||o instanceof C.GlyphRendererView&&o.set_data_timestamp>this.range_update_timestamp){this.update_dataranges();break}}this.model.frame.update_scales();var s=this.canvas_view.ctx,a=this.canvas.pixel_ratio;s.save(),s.scale(a,a),s.translate(.5,.5);var l=[this.frame._left.value,this.frame._top.value,this.frame._width.value,this.frame._height.value];if(this._map_hook(s,l),this._paint_empty(s,l),this.prepare_webgl(a,l),s.save(),this.visuals.outline_line.doit){this.visuals.outline_line.set_value(s);var h=l[0],c=l[1],u=l[2],_=l[3];h+u==this.canvas._width.value&&(u-=1),c+_==this.canvas._height.value&&(_-=1),s.strokeRect(h,c,u,_)}s.restore(),this._paint_levels(s,[\"image\",\"underlay\",\"glyph\"],l,!0),this.blit_webgl(a),this._paint_levels(s,[\"annotation\"],l,!0),this._paint_levels(s,[\"overlay\"],l,!1),null==this._initial_state_info.range&&this.set_initial_range(),s.restore(),this._has_finished||(this._has_finished=!0,this.notify_finished())}},t.prototype._paint_levels=function(t,e,i,n){t.save(),n&&(t.beginPath(),t.rect.apply(t,i),t.clip());for(var r={},o=0;o<this.model.plot.renderers.length;o++){var s=this.model.plot.renderers[o];r[s.id]=o}for(var a=function(t){return r[t.model.id]},l=0,h=e;l<h.length;l++)for(var c=h[l],u=b.sortBy(E.values(this.levels[c]),a),_=0,p=u;_<p.length;_++){var d=p[_];!n&&d.needs_clip&&(t.save(),t.beginPath(),t.rect.apply(t,i),t.clip()),d.render(),!n&&d.needs_clip&&t.restore()}t.restore()},t.prototype._map_hook=function(t,e){},t.prototype._paint_empty=function(t,e){var i=[0,0,this.canvas_view.model._width.value,this.canvas_view.model._height.value],n=i[0],r=i[1],o=i[2],s=i[3],a=e[0],l=e[1],h=e[2],c=e[3];t.clearRect(n,r,o,s),this.visuals.border_fill.doit&&(this.visuals.border_fill.set_value(t),t.fillRect(n,r,o,s),t.clearRect(a,l,h,c)),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fillRect(a,l,h,c))},t.prototype.save=function(t){switch(this.model.plot.output_backend){case\"canvas\":case\"webgl\":var e=this.canvas_view.get_canvas_element();if(null!=e.msToBlob){var i=e.msToBlob();window.navigator.msSaveBlob(i,t)}else{var n=document.createElement(\"a\");n.href=e.toDataURL(\"image/png\"),n.download=t+\".png\",n.target=\"_blank\",n.dispatchEvent(new MouseEvent(\"click\"))}break;case\"svg\":var r=this.canvas_view._ctx,o=r.getSerializedSvg(!0),s=new Blob([o],{type:\"text/plain\"}),a=document.createElement(\"a\");a.download=t+\".svg\",a.innerHTML=\"Download svg\",a.href=window.URL.createObjectURL(s),a.onclick=function(t){return document.body.removeChild(t.target)},a.style.display=\"none\",document.body.appendChild(a),a.click()}},t}(a.DOMView);i.PlotCanvasView=k;var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e.initClass=function(){this.prototype.type=\"AbovePanel\"},e}(p.LayoutCanvas);(i.AbovePanel=S).initClass();var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e.initClass=function(){this.prototype.type=\"BelowPanel\"},e}(p.LayoutCanvas);(i.BelowPanel=M).initClass();var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e.initClass=function(){this.prototype.type=\"LeftPanel\"},e}(p.LayoutCanvas);(i.LeftPanel=O).initClass();var z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(e,t),e.initClass=function(){this.prototype.type=\"RightPanel\"},e}(p.LayoutCanvas);(i.RightPanel=z).initClass();var P=function(e){function t(t){return e.call(this,t)||this}return l.__extends(t,e),t.initClass=function(){this.prototype.type=\"PlotCanvas\",this.prototype.default_view=k,this.internal({plot:[m.Instance],toolbar:[m.Instance],canvas:[m.Instance],frame:[m.Instance]}),this.override({sizing_mode:\"stretch_both\"})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.canvas=new n.Canvas({map:null!=this.use_map&&this.use_map,use_hidpi:this.plot.hidpi,output_backend:this.plot.output_backend}),this.frame=new r.CartesianFrame({x_range:this.plot.x_range,extra_x_ranges:this.plot.extra_x_ranges,x_scale:this.plot.x_scale,y_range:this.plot.y_range,extra_y_ranges:this.plot.extra_y_ranges,y_scale:this.plot.y_scale}),this.above_panel=new S,this.below_panel=new M,this.left_panel=new O,this.right_panel=new z,A.logger.debug(\"PlotCanvas initialized\")},t.prototype._doc_attached=function(){this.canvas.attach_document(this.document),this.frame.attach_document(this.document),this.above_panel.attach_document(this.document),this.below_panel.attach_document(this.document),this.left_panel.attach_document(this.document),this.right_panel.attach_document(this.document),e.prototype._doc_attached.call(this),A.logger.debug(\"PlotCanvas attached to document\")},t.prototype.get_layoutable_children=function(){var r=[this.above_panel,this.below_panel,this.left_panel,this.right_panel,this.canvas,this.frame],t=function(t){for(var e=0,i=t;e<i.length;e++){var n=i[e];x.isSizeable(n)&&null!=n.panel&&r.push(n.panel)}};return t(this.plot.above),t(this.plot.below),t(this.plot.left),t(this.plot.right),r},t.prototype.get_constraints=function(){return e.prototype.get_constraints.call(this).concat(this._get_constant_constraints(),this._get_side_constraints())},t.prototype._get_constant_constraints=function(){return[f.EQ(this.canvas._left,0),f.EQ(this.canvas._top,0),f.GE(this.above_panel._top,[-1,this.canvas._top]),f.EQ(this.above_panel._bottom,[-1,this.frame._top]),f.EQ(this.above_panel._left,[-1,this.left_panel._right]),f.EQ(this.above_panel._right,[-1,this.right_panel._left]),f.EQ(this.below_panel._top,[-1,this.frame._bottom]),f.LE(this.below_panel._bottom,[-1,this.canvas._bottom]),f.EQ(this.below_panel._left,[-1,this.left_panel._right]),f.EQ(this.below_panel._right,[-1,this.right_panel._left]),f.EQ(this.left_panel._top,[-1,this.above_panel._bottom]),f.EQ(this.left_panel._bottom,[-1,this.below_panel._top]),f.GE(this.left_panel._left,[-1,this.canvas._left]),f.EQ(this.left_panel._right,[-1,this.frame._left]),f.EQ(this.right_panel._top,[-1,this.above_panel._bottom]),f.EQ(this.right_panel._bottom,[-1,this.below_panel._top]),f.EQ(this.right_panel._left,[-1,this.frame._right]),f.LE(this.right_panel._right,[-1,this.canvas._right]),f.EQ(this._top,[-1,this.above_panel._bottom]),f.EQ(this._left,[-1,this.left_panel._right]),f.EQ(this._height,[-1,this._bottom],[-1,this.canvas._bottom],this.below_panel._top),f.EQ(this._width,[-1,this._right],[-1,this.canvas._right],this.right_panel._left),f.GE(this._top,-this.plot.min_border_top),f.GE(this._left,-this.plot.min_border_left),f.GE(this._height,[-1,this._bottom],-this.plot.min_border_bottom),f.GE(this._width,[-1,this._right],-this.plot.min_border_right)]},t.prototype._get_side_constraints=function(){var t=function(t){return t.map(function(t){return t.panel})},e=d.vstack(this.above_panel,t(this.plot.above)),i=d.vstack(this.below_panel,b.reversed(t(this.plot.below))),n=d.hstack(this.left_panel,t(this.plot.left)),r=d.hstack(this.right_panel,b.reversed(t(this.plot.right)));return b.concat([e,i,n,r])},t}(o.LayoutDOM);(i.PlotCanvas=P).initClass()},function(t,e,i){var n=t(387),r=t(173),o=t(15),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"DataRange\",this.define({names:[o.Array,[]],renderers:[o.Array,[]]})},t}(r.Range);(i.DataRange=s).initClass()},function(t,e,i){var n=t(387),r=t(169),h=t(175),_=t(14),o=t(15),c=t(24),u=t(21),s=function(i){function t(t){var e=i.call(this,t)||this;return e._plot_bounds={},e.have_updated_interactively=!1,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"DataRange1d\",this.define({start:[o.Number],end:[o.Number],range_padding:[o.Number,.1],range_padding_units:[o.PaddingUnits,\"percent\"],flipped:[o.Bool,!1],follow:[o.StartEnd],follow_interval:[o.Number],default_span:[o.Number,2]}),this.internal({scale_hint:[o.String,\"auto\"]})},t.prototype.initialize=function(){i.prototype.initialize.call(this),this._initial_start=this.start,this._initial_end=this.end,this._initial_range_padding=this.range_padding,this._initial_range_padding_units=this.range_padding_units,this._initial_follow=this.follow,this._initial_follow_interval=this.follow_interval,this._initial_default_span=this.default_span},Object.defineProperty(t.prototype,\"min\",{get:function(){return Math.min(this.start,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"max\",{get:function(){return Math.max(this.start,this.end)},enumerable:!0,configurable:!0}),t.prototype.computed_renderers=function(){var e=this.names,t=this.renderers;if(0==t.length)for(var i=0,n=this.plots;i<n.length;i++){var r=n[i],o=r.renderers.filter(function(t){return t instanceof h.GlyphRenderer});t=t.concat(o)}0<e.length&&(t=t.filter(function(t){return u.includes(e,t.name)})),_.logger.debug(\"computed \"+t.length+\" renderers for DataRange1d \"+this.id);for(var s=0,a=t;s<a.length;s++){var l=a[s];_.logger.trace(\" - \"+l.type+\" \"+l.id)}return t},t.prototype._compute_plot_bounds=function(t,e){for(var i=c.empty(),n=0,r=t;n<r.length;n++){var o=r[n];null!=e[o.id]&&(i=c.union(i,e[o.id]))}return i},t.prototype.adjust_bounds_for_aspect=function(t,e){var i=c.empty(),n=t.maxX-t.minX;n<=0&&(n=1);var r=t.maxY-t.minY;r<=0&&(r=1);var o=.5*(t.maxX+t.minX),s=.5*(t.maxY+t.minY);return n<e*r?n=e*r:r=n/e,i.maxX=o+.5*n,i.minX=o-.5*n,i.maxY=s+.5*r,i.minY=s-.5*r,i},t.prototype._compute_min_max=function(t,e){var i,n,r,o,s=c.empty();for(var a in t){var l=t[a];s=c.union(s,l)}return 0==e?(i=[s.minX,s.maxX],r=i[0],o=i[1]):(n=[s.minY,s.maxY],r=n[0],o=n[1]),[r,o]},t.prototype._compute_range=function(t,e){var i,n,r,o=this.range_padding;if(\"log\"==this.scale_hint){(isNaN(t)||!isFinite(t)||t<=0)&&(t=isNaN(e)||!isFinite(e)||e<=0?.1:e/100,_.logger.warn(\"could not determine minimum data value for log axis, DataRange1d using value \"+t)),(isNaN(e)||!isFinite(e)||e<=0)&&(e=isNaN(t)||!isFinite(t)||t<=0?10:100*t,_.logger.warn(\"could not determine maximum data value for log axis, DataRange1d using value \"+e));var s=void 0,a=void 0;if(e==t)a=this.default_span+.001,s=Math.log(t)/Math.log(10);else{var l=void 0,h=void 0;\"percent\"==this.range_padding_units?(l=Math.log(t)/Math.log(10),h=Math.log(e)/Math.log(10),a=(h-l)*(1+o)):(l=Math.log(t-o)/Math.log(10),h=Math.log(e+o)/Math.log(10),a=h-l),s=(l+h)/2}n=Math.pow(10,s-a/2),r=Math.pow(10,s+a/2)}else{var a=void 0;a=e==t?this.default_span:\"percent\"==this.range_padding_units?(e-t)*(1+o):e-t+2*o;var s=(e+t)/2;n=s-a/2,r=s+a/2}var c=1;this.flipped&&(n=(i=[r,n])[0],r=i[1],c=-1);var u=this.follow_interval;return null!=u&&Math.abs(n-r)>u&&(\"start\"==this.follow?r=n+c*u:\"end\"==this.follow&&(n=r-c*u)),[n,r]},t.prototype.update=function(t,e,i,n){if(!this.have_updated_interactively){var r=this.computed_renderers(),o=this._compute_plot_bounds(r,t);null!=n&&(o=this.adjust_bounds_for_aspect(o,n)),this._plot_bounds[i]=o;var s=this._compute_min_max(this._plot_bounds,e),a=s[0],l=s[1],h=this._compute_range(a,l),c=h[0],u=h[1];null!=this._initial_start&&(\"log\"==this.scale_hint?0<this._initial_start&&(c=this._initial_start):c=this._initial_start),null!=this._initial_end&&(\"log\"==this.scale_hint?0<this._initial_end&&(u=this._initial_end):u=this._initial_end);var _=[this.start,this.end],p=_[0],d=_[1];if(c!=p||u!=d){var f={};c!=p&&(f.start=c),u!=d&&(f.end=u),this.setv(f)}\"auto\"==this.bounds&&this.setv({bounds:[c,u]},{silent:!0}),this.change.emit()}},t.prototype.reset=function(){this.have_updated_interactively=!1,this.setv({range_padding:this._initial_range_padding,range_padding_units:this._initial_range_padding_units,follow:this._initial_follow,follow_interval:this._initial_follow_interval,default_span:this._initial_default_span},{silent:!0}),this.change.emit()},t}(r.DataRange);(i.DataRange1d=s).initClass()},function(t,e,i){var n=t(387),r=t(173),o=t(15),s=t(22),b=t(21),l=t(44);function m(t,e,i){void 0===i&&(i=0);for(var n={},r=0;r<t.length;r++){var o=t[r];if(o in n)throw new Error(\"duplicate factor or subfactor: \"+o);n[o]={value:.5+r*(1+e)+i}}return[n,(t.length-1)*e]}function x(t,s,a,e){void 0===e&&(e=0);for(var l={},h={},i=[],n=0,r=t;n<r.length;n++){var o=r[n],c=o[0],u=o[1];c in h||(h[c]=[],i.push(c)),h[c].push(u)}for(var _=e,p=0,d=function(t){var e=h[t].length,i=m(h[t],a,_),n=i[0],r=i[1];p+=r;var o=b.sum(h[t].map(function(t){return n[t].value}));l[t]={value:o/e,mapping:n},_+=e+s+r},f=0,v=i;f<v.length;f++){var c=v[f];d(c)}return[l,i,(i.length-1)*s+p]}function h(t,c,u,_,e){void 0===e&&(e=0);for(var p={},d={},i=[],n=0,r=t;n<r.length;n++){var o=r[n],s=o[0],a=o[1],l=o[2];s in d||(d[s]=[],i.push(s)),d[s].push([a,l])}for(var f=[],v=e,m=0,h=function(t){for(var e=d[t].length,i=x(d[t],u,_,v),n=i[0],r=i[1],o=i[2],s=0,a=r;s<a.length;s++){var l=a[s];f.push([t,l])}m+=o;var h=b.sum(d[t].map(function(t){var e=t[0];return n[e].value}));p[t]={value:h/e,mapping:n},v+=e+c+o},g=0,y=i;g<y.length;g++){var s=y[g];h(s)}return[p,i,f,(i.length-1)*c+m]}i.map_one_level=m,i.map_two_levels=x,i.map_three_levels=h;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"FactorRange\",this.define({factors:[o.Array,[]],factor_padding:[o.Number,0],subgroup_padding:[o.Number,.8],group_padding:[o.Number,1.4],range_padding:[o.Number,0],range_padding_units:[o.PaddingUnits,\"percent\"],start:[o.Number],end:[o.Number]}),this.internal({levels:[o.Number],mids:[o.Array],tops:[o.Array],tops_groups:[o.Array]})},Object.defineProperty(t.prototype,\"min\",{get:function(){return this.start},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"max\",{get:function(){return this.end},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){e.prototype.initialize.call(this),this._init()},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.properties.factors.change,function(){return t.reset()}),this.connect(this.properties.factor_padding.change,function(){return t.reset()}),this.connect(this.properties.group_padding.change,function(){return t.reset()}),this.connect(this.properties.subgroup_padding.change,function(){return t.reset()}),this.connect(this.properties.range_padding.change,function(){return t.reset()}),this.connect(this.properties.range_padding_units.change,function(){return t.reset()})},t.prototype.reset=function(){this._init(),this.change.emit()},t.prototype._lookup=function(t){if(1==t.length){var e=this._mapping;return e.hasOwnProperty(t[0])?e[t[0]].value:NaN}if(2==t.length){var e=this._mapping;return e.hasOwnProperty(t[0])&&e[t[0]].mapping.hasOwnProperty(t[1])?e[t[0]].mapping[t[1]].value:NaN}if(3==t.length){var e=this._mapping;return e.hasOwnProperty(t[0])&&e[t[0]].mapping.hasOwnProperty(t[1])&&e[t[0]].mapping[t[1]].mapping.hasOwnProperty(t[2])?e[t[0]].mapping[t[1]].mapping[t[2]].value:NaN}throw new Error(\"unreachable code\")},t.prototype.synthetic=function(t){if(l.isNumber(t))return t;if(l.isString(t))return this._lookup([t]);var e=0,i=t[t.length-1];return l.isNumber(i)&&(e=i,t=t.slice(0,-1)),this._lookup(t)+e},t.prototype.v_synthetic=function(t){var e=this;return s.map(t,function(t){return e.synthetic(t)})},t.prototype._init=function(){var t,e,i,n,r;if(b.all(this.factors,l.isString))n=1,t=m(this.factors,this.factor_padding),this._mapping=t[0],r=t[1];else if(b.all(this.factors,function(t){return l.isArray(t)&&2==t.length&&l.isString(t[0])&&l.isString(t[1])}))n=2,e=x(this.factors,this.group_padding,this.factor_padding),this._mapping=e[0],this.tops=e[1],r=e[2];else{if(!b.all(this.factors,function(t){return l.isArray(t)&&3==t.length&&l.isString(t[0])&&l.isString(t[1])&&l.isString(t[2])}))throw new Error(\"???\");n=3,i=h(this.factors,this.group_padding,this.subgroup_padding,this.factor_padding),this._mapping=i[0],this.tops=i[1],this.mids=i[2],r=i[3]}var o=0,s=this.factors.length+r;if(\"percent\"==this.range_padding_units){var a=(s-o)*this.range_padding/2;o-=a,s+=a}else o-=this.range_padding,s+=this.range_padding;this.setv({start:o,end:s,levels:n},{silent:!0}),\"auto\"==this.bounds&&this.setv({bounds:[o,s]},{silent:!0})},t}(r.Range);(i.FactorRange=a).initClass()},function(t,e,i){var n=t(169);i.DataRange=n.DataRange;var r=t(170);i.DataRange1d=r.DataRange1d;var o=t(171);i.FactorRange=o.FactorRange;var s=t(173);i.Range=s.Range;var a=t(174);i.Range1d=a.Range1d},function(t,e,i){var n=t(387),r=t(57),o=t(15),s=t(44),a=function(i){function t(t){var e=i.call(this,t)||this;return e.have_updated_interactively=!1,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"Range\",this.define({callback:[o.Any],bounds:[o.Any],min_interval:[o.Any],max_interval:[o.Any]}),this.internal({plots:[o.Array,[]]})},t.prototype.connect_signals=function(){var t=this;i.prototype.connect_signals.call(this),this.connect(this.change,function(){return t._emit_callback()})},t.prototype.reset=function(){this.change.emit()},t.prototype._emit_callback=function(){null!=this.callback&&(s.isFunction(this.callback)?this.callback(this):this.callback.execute(this,{}))},t}(r.Model);(i.Range=a).initClass()},function(t,e,i){var n=t(387),r=t(173),o=t(15),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Range1d\",this.define({start:[o.Number,0],end:[o.Number,1],reset_start:[o.Number],reset_end:[o.Number]})},t.prototype._set_auto_bounds=function(){if(\"auto\"==this.bounds){var t=Math.min(this.reset_start,this.reset_end),e=Math.max(this.reset_start,this.reset_end);this.setv({bounds:[t,e]},{silent:!0})}},t.prototype.initialize=function(){e.prototype.initialize.call(this),null==this.reset_start&&(this.reset_start=this.start),null==this.reset_end&&(this.reset_end=this.end),this._set_auto_bounds()},Object.defineProperty(t.prototype,\"min\",{get:function(){return Math.min(this.start,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"max\",{get:function(){return Math.max(this.start,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"is_reversed\",{get:function(){return this.start>this.end},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this._set_auto_bounds(),this.start!=this.reset_start||this.end!=this.reset_end?this.setv({start:this.reset_start,end:this.reset_end}):this.change.emit()},t}(r.Range);(i.Range1d=s).initClass()},function(t,e,i){var n=t(387),r=t(179),P=t(126),o=t(189),j=t(14),s=t(15),a=t(22),N=t(21),_=t(32),l=t(171),p={fill:{},line:{}},d={fill:{fill_alpha:.3,fill_color:\"grey\"},line:{line_alpha:.3,line_color:\"grey\"}},f={fill:{fill_alpha:.2},line:{}},h=function(u){function t(){return null!==u&&u.apply(this,arguments)||this}return n.__extends(t,u),t.prototype.initialize=function(t){u.prototype.initialize.call(this,t);var i=this.model.glyph,n=N.includes(i.mixins,\"fill\"),r=N.includes(i.mixins,\"line\"),o=_.clone(i.attributes);function e(t){var e=_.clone(o);return n&&_.extend(e,t.fill),r&&_.extend(e,t.line),new i.constructor(e)}delete o.id,this.glyph=this.build_glyph_view(i);var s=this.model.selection_glyph;null==s?s=e({fill:{},line:{}}):\"auto\"===s&&(s=e(p)),this.selection_glyph=this.build_glyph_view(s);var a=this.model.nonselection_glyph;null==a?a=e({fill:{},line:{}}):\"auto\"===a&&(a=e(f)),this.nonselection_glyph=this.build_glyph_view(a);var l=this.model.hover_glyph;null!=l&&(this.hover_glyph=this.build_glyph_view(l));var h=this.model.muted_glyph;null!=h&&(this.muted_glyph=this.build_glyph_view(h));var c=e(d);this.decimated_glyph=this.build_glyph_view(c),this.xscale=this.plot_view.frame.xscales[this.model.x_range_name],this.yscale=this.plot_view.frame.yscales[this.model.y_range_name],this.set_data(!1)},t.prototype.build_glyph_view=function(t){return new t.default_view({model:t,renderer:this,plot_view:this.plot_view,parent:this})},t.prototype.connect_signals=function(){var e=this;u.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.request_render()}),this.connect(this.model.glyph.change,function(){return e.set_data()}),this.connect(this.model.data_source.change,function(){return e.set_data()}),this.connect(this.model.data_source.streaming,function(){return e.set_data()}),this.connect(this.model.data_source.patching,function(t){return e.set_data(!0,t)}),this.connect(this.model.data_source.selected.change,function(){return e.request_render()}),this.connect(this.model.data_source._select,function(){return e.request_render()}),null!=this.hover_glyph&&this.connect(this.model.data_source.inspect,function(){return e.request_render()}),this.connect(this.model.properties.view.change,function(){return e.set_data()}),this.connect(this.model.view.change,function(){return e.set_data()});var t=this.plot_model.frame,i=t.x_ranges,n=t.y_ranges;for(var r in i){var o=i[r];o instanceof l.FactorRange&&this.connect(o.change,function(){return e.set_data()})}for(var s in n){var o=n[s];o instanceof l.FactorRange&&this.connect(o.change,function(){return e.set_data()})}this.connect(this.model.glyph.transformchange,function(){return e.set_data()})},t.prototype.have_selection_glyphs=function(){return null!=this.selection_glyph&&null!=this.nonselection_glyph},t.prototype.set_data=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=null);var i=Date.now(),n=this.model.data_source;this.all_indices=this.model.view.indices,this.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),this.glyph.set_data(n,this.all_indices,e),this.glyph.set_visuals(n),this.decimated_glyph.set_visuals(n),this.have_selection_glyphs()&&(this.selection_glyph.set_visuals(n),this.nonselection_glyph.set_visuals(n)),null!=this.hover_glyph&&this.hover_glyph.set_visuals(n),null!=this.muted_glyph&&this.muted_glyph.set_visuals(n);var r=this.plot_model.plot.lod_factor;this.decimated=[];for(var o=0,s=Math.floor(this.all_indices.length/r);o<s;o++)this.decimated.push(o*r);var a=Date.now()-i;j.logger.debug(this.glyph.model.type+\" GlyphRenderer (\"+this.model.id+\"): set_data finished in \"+a+\"ms\"),this.set_data_timestamp=Date.now(),t&&this.request_render()},t.prototype.render=function(){var r=this;if(this.model.visible){var t=Date.now(),e=this.glyph.glglyph;this.glyph.map_data();var i=Date.now()-t,n=Date.now(),o=this.glyph.mask_data(this.all_indices);o.length===this.all_indices.length&&(o=N.range(0,this.all_indices.length));var s=Date.now()-n,a=this.plot_view.canvas_view.ctx;a.save();var l,h=this.model.data_source.selected;l=!h||h.is_empty()?[]:this.glyph instanceof P.LineView&&h.selected_glyph===this.glyph.model?this.model.view.convert_indices_from_subset(o):h.indices;var c,u=this.model.data_source.inspected;c=u&&0!==u.length?u[\"0d\"].glyph?this.model.view.convert_indices_from_subset(o):0<u[\"1d\"].indices.length?u[\"1d\"].indices:function(){for(var t=[],e=0,i=Object.keys(u[\"2d\"].indices);e<i.length;e++){var n=i[e];t.push(parseInt(n))}return t}():[];var _,p,d,f=function(){for(var t=[],e=0,i=o;e<i.length;e++){var n=i[e];N.includes(c,r.all_indices[n])&&t.push(n)}return t}(),v=this.plot_model.plot.lod_threshold;null!=this.model.document&&0<this.model.document.interactive_duration()&&!e&&null!=v&&this.all_indices.length>v?(o=this.decimated,_=this.decimated_glyph,p=this.decimated_glyph):(_=this.model.muted&&null!=this.muted_glyph?this.muted_glyph:this.glyph,p=this.nonselection_glyph),d=this.selection_glyph,null!=this.hover_glyph&&f.length&&(o=N.difference(o,f));var m,g=null;if(l.length&&this.have_selection_glyphs()){for(var y=Date.now(),b={},x=0,w=l;x<w.length;x++){var k=w[x];b[k]=!0}var S=new Array,T=new Array;if(this.glyph instanceof P.LineView)for(var C=0,A=this.all_indices;C<A.length;C++){var k=A[C];null!=b[k]?S.push(k):T.push(k)}else for(var E=0,M=o;E<M.length;E++){var k=M[E];null!=b[this.all_indices[k]]?S.push(k):T.push(k)}g=Date.now()-y,m=Date.now(),p.render(a,T,this.glyph),d.render(a,S,this.glyph),null!=this.hover_glyph&&(this.glyph instanceof P.LineView?this.hover_glyph.render(a,this.model.view.convert_indices_from_subset(f),this.glyph):this.hover_glyph.render(a,f,this.glyph))}else m=Date.now(),this.glyph instanceof P.LineView?this.hover_glyph&&f.length?this.hover_glyph.render(a,this.model.view.convert_indices_from_subset(f),this.glyph):_.render(a,this.all_indices,this.glyph):(_.render(a,o,this.glyph),this.hover_glyph&&f.length&&this.hover_glyph.render(a,f,this.glyph));var O=Date.now()-m;this.last_dtrender=O;var z=Date.now()-t;return j.logger.debug(this.glyph.model.type+\" GlyphRenderer (\"+this.model.id+\"): render finished in \"+z+\"ms\"),j.logger.trace(\" - map_data finished in : \"+i+\"ms\"),j.logger.trace(\" - mask_data finished in : \"+s+\"ms\"),null!=g&&j.logger.trace(\" - selection mask finished in : \"+g+\"ms\"),j.logger.trace(\" - glyph renders finished in : \"+O+\"ms\"),a.restore()}},t.prototype.draw_legend=function(t,e,i,n,r,o,s){var a=this.model.get_reference_point(o,s);this.glyph.draw_legend_for_index(t,{x0:e,x1:i,y0:n,y1:r},a)},t.prototype.hit_test=function(t){if(!this.model.visible)return null;var e=this.glyph.hit_test(t);return null==e?null:this.model.view.convert_selection_from_subset(e)},t}(r.RendererView);i.GlyphRendererView=h;var c=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"GlyphRenderer\",this.prototype.default_view=h,this.define({x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"],data_source:[s.Instance],view:[s.Instance,function(){return new o.CDSView}],glyph:[s.Instance],hover_glyph:[s.Instance],nonselection_glyph:[s.Any,\"auto\"],selection_glyph:[s.Any,\"auto\"],muted_glyph:[s.Instance],muted:[s.Bool,!1]}),this.override({level:\"glyph\"})},t.prototype.initialize=function(){e.prototype.initialize.call(this),null==this.view.source&&(this.view.source=this.data_source,this.view.compute_indices())},t.prototype.get_reference_point=function(t,e){var i=0;if(null!=t){var n=this.data_source.get_column(t);if(null!=n){var r=a.indexOf(n,e);-1!=r&&(i=r)}}return i},t.prototype.get_selection_manager=function(){return this.data_source.selection_manager},t}(r.Renderer);(i.GlyphRenderer=c).initClass()},function(t,e,i){var n=t(387),r=t(179),o=t(142),s=t(15),l=t(4),a=function(a){function t(){return null!==a&&a.apply(this,arguments)||this}return n.__extends(t,a),t.prototype.initialize=function(t){var e;a.prototype.initialize.call(this,t),this.xscale=this.plot_view.frame.xscales.default,this.yscale=this.plot_view.frame.yscales.default,this._renderer_views={},e=l.build_views(this._renderer_views,[this.model.node_renderer,this.model.edge_renderer],this.plot_view.view_options()),this.node_view=e[0],this.edge_view=e[1],this.set_data()},t.prototype.connect_signals=function(){var t=this;a.prototype.connect_signals.call(this),this.connect(this.model.layout_provider.change,function(){return t.set_data()}),this.connect(this.model.node_renderer.data_source._select,function(){return t.set_data()}),this.connect(this.model.node_renderer.data_source.inspect,function(){return t.set_data()}),this.connect(this.model.node_renderer.data_source.change,function(){return t.set_data()}),this.connect(this.model.edge_renderer.data_source._select,function(){return t.set_data()}),this.connect(this.model.edge_renderer.data_source.inspect,function(){return t.set_data()}),this.connect(this.model.edge_renderer.data_source.change,function(){return t.set_data()});var e=this.plot_model.frame,i=e.x_ranges,n=e.y_ranges;for(var r in i){var o=i[r];this.connect(o.change,function(){return t.set_data()})}for(var s in n){var o=n[s];this.connect(o.change,function(){return t.set_data()})}},t.prototype.set_data=function(t){var e,i;void 0===t&&(t=!0),this.node_view.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),this.edge_view.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0});var n=this.node_view.glyph;e=this.model.layout_provider.get_node_coordinates(this.model.node_renderer.data_source),n._x=e[0],n._y=e[1];var r=this.edge_view.glyph;i=this.model.layout_provider.get_edge_coordinates(this.model.edge_renderer.data_source),r._xs=i[0],r._ys=i[1],n.index_data(),r.index_data(),t&&this.request_render()},t.prototype.render=function(){this.edge_view.render(),this.node_view.render()},t}(r.RendererView);i.GraphRendererView=a;var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"GraphRenderer\",this.prototype.default_view=a,this.define({x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"],layout_provider:[s.Instance],node_renderer:[s.Instance],edge_renderer:[s.Instance],selection_policy:[s.Instance,function(){return new o.NodesOnly}],inspection_policy:[s.Instance,function(){return new o.NodesOnly}]}),this.override({level:\"glyph\"})},t.prototype.get_selection_manager=function(){return this.node_renderer.data_source.selection_manager},t}(r.Renderer);(i.GraphRenderer=h).initClass()},function(t,e,i){var n=t(387),r=t(179),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.RendererView);i.GuideRendererView=s;var a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"GuideRenderer\",this.define({plot:[o.Instance]}),this.override({level:\"overlay\"})},t}(r.Renderer);(i.GuideRenderer=a).initClass()},function(t,e,i){var n=t(175);i.GlyphRenderer=n.GlyphRenderer;var r=t(176);i.GraphRenderer=r.GraphRenderer;var o=t(177);i.GuideRenderer=o.GuideRenderer;var s=t(179);i.Renderer=s.Renderer},function(t,e,i){var n=t(387),r=t(6),o=t(49),s=t(15),a=t(57),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.plot_view=t.plot_view,this.visuals=new o.Visuals(this.model),this._has_finished=!0},Object.defineProperty(t.prototype,\"plot_model\",{get:function(){return this.plot_view.model},enumerable:!0,configurable:!0}),t.prototype.request_render=function(){this.plot_view.request_render()},t.prototype.map_to_screen=function(t,e){return this.plot_view.map_to_screen(t,e,this.model.x_range_name,this.model.y_range_name)},Object.defineProperty(t.prototype,\"needs_clip\",{get:function(){return!1},enumerable:!0,configurable:!0}),t}(r.DOMView);i.RendererView=l;var h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Renderer\",this.define({level:[s.RenderLevel],visible:[s.Bool,!0]})},t}(a.Model);(i.Renderer=h).initClass()},function(t,e,i){var n=t(387),r=t(182),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"CategoricalScale\"},t.prototype.compute=function(t){return e.prototype.compute.call(this,this.source_range.synthetic(t))},t.prototype.v_compute=function(t){return e.prototype.v_compute.call(this,this.source_range.v_synthetic(t))},t}(r.LinearScale);(i.CategoricalScale=o).initClass()},function(t,e,i){var n=t(180);i.CategoricalScale=n.CategoricalScale;var r=t(182);i.LinearScale=r.LinearScale;var o=t(183);i.LogScale=o.LogScale;var s=t(184);i.Scale=s.Scale},function(t,e,i){var n=t(387),r=t(184),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LinearScale\"},t.prototype.compute=function(t){var e=this._compute_state(),i=e[0],n=e[1];return i*t+n},t.prototype.v_compute=function(t){for(var e=this._compute_state(),i=e[0],n=e[1],r=new Float64Array(t.length),o=0;o<t.length;o++)r[o]=i*t[o]+n;return r},t.prototype.invert=function(t){var e=this._compute_state(),i=e[0],n=e[1];return(t-n)/i},t.prototype.v_invert=function(t){for(var e=this._compute_state(),i=e[0],n=e[1],r=new Float64Array(t.length),o=0;o<t.length;o++)r[o]=(t[o]-n)/i;return r},t.prototype._compute_state=function(){var t=this.source_range.start,e=this.source_range.end,i=this.target_range.start,n=this.target_range.end,r=(n-i)/(e-t),o=-r*t+i;return[r,o]},t}(r.Scale);(i.LinearScale=o).initClass()},function(t,e,i){var n=t(387),r=t(184),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LogScale\"},t.prototype.compute=function(t){var e,i=this._compute_state(),n=i[0],r=i[1],o=i[2],s=i[3];if(0==o)e=0;else{var a=(Math.log(t)-s)/o;e=isFinite(a)?a*n+r:NaN}return e},t.prototype.v_compute=function(t){var e=this._compute_state(),i=e[0],n=e[1],r=e[2],o=e[3],s=new Float64Array(t.length);if(0==r)for(var a=0;a<t.length;a++)s[a]=0;else for(var a=0;a<t.length;a++){var l=(Math.log(t[a])-o)/r,h=void 0;h=isFinite(l)?l*i+n:NaN,s[a]=h}return s},t.prototype.invert=function(t){var e=this._compute_state(),i=e[0],n=e[1],r=e[2],o=e[3],s=(t-n)/i;return Math.exp(r*s+o)},t.prototype.v_invert=function(t){for(var e=this._compute_state(),i=e[0],n=e[1],r=e[2],o=e[3],s=new Float64Array(t.length),a=0;a<t.length;a++){var l=(t[a]-n)/i;s[a]=Math.exp(r*l+o)}return s},t.prototype._get_safe_factor=function(t,e){var i,n=t<0?0:t,r=e<0?0:e;if(n==r)if(0==n)n=(i=[1,10])[0],r=i[1];else{var o=Math.log(n)/Math.log(10);n=Math.pow(10,Math.floor(o)),r=Math.ceil(o)!=Math.floor(o)?Math.pow(10,Math.ceil(o)):Math.pow(10,Math.ceil(o)+1)}return[n,r]},t.prototype._compute_state=function(){var t,e,i=this.source_range.start,n=this.source_range.end,r=this.target_range.start,o=this.target_range.end,s=o-r,a=this._get_safe_factor(i,n),l=a[0],h=a[1];0==l?(t=Math.log(h),e=0):(t=Math.log(h)-Math.log(l),e=Math.log(l));var c=s,u=r;return[c,u,t,e]},t}(r.Scale);(i.LogScale=o).initClass()},function(t,e,i){var n=t(387),r=t(261),o=t(15),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Scale\",this.internal({source_range:[o.Any],target_range:[o.Any]})},t.prototype.r_compute=function(t,e){return this.target_range.is_reversed?[this.compute(e),this.compute(t)]:[this.compute(t),this.compute(e)]},t.prototype.r_invert=function(t,e){return this.target_range.is_reversed?[this.invert(e),this.invert(t)]:[this.invert(t),this.invert(e)]},t}(r.Transform);(i.Scale=s).initClass()},function(t,e,i){var n=t(387);n.__exportStar(t(186),i);var r=t(187);i.Selection=r.Selection},function(t,e,i){var n=t(387),r=t(57),o=t(187),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.do_selection=function(t,e,i,n){if(null===t)return!1;e.selected.update(t,i,n);var r=new o.Selection;return r.update(e.selected,i,!1),e.selected=r,e._select.emit(),!e.selected.is_empty()},e}(r.Model);(i.SelectionPolicy=s).prototype.type=\"SelectionPolicy\";var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.hit_test=function(t,e){for(var i=[],n=0,r=e;n<r.length;n++){var o=r[n],s=o.hit_test(t);null!==s&&i.push(s)}if(0<i.length){for(var a=i[0],l=0,h=i;l<h.length;l++){var c=h[l];a.update_through_intersection(c)}return a}return null},e}(s);(i.IntersectRenderers=a).prototype.type=\"IntersectRenderers\";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.hit_test=function(t,e){for(var i=[],n=0,r=e;n<r.length;n++){var o=r[n],s=o.hit_test(t);null!==s&&i.push(s)}if(0<i.length){for(var a=i[0],l=0,h=i;l<h.length;l++){var c=h[l];a.update_through_union(c)}return a}return null},e}(s);(i.UnionRenderers=l).prototype.type=\"UnionRenderers\"},function(t,e,i){var n=t(387),r=t(57),o=t(15),s=t(21),a=t(32),l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Selection\",this.define({indices:[o.Array,[]],line_indices:[o.Array,[]],multiline_indices:[o.Any,{}]}),this.internal({final:[o.Boolean],selected_glyphs:[o.Array,[]],get_view:[o.Any],image_indices:[o.Array,[]]})},t.prototype.initialize=function(){var t=this;e.prototype.initialize.call(this),this[\"0d\"]={glyph:null,indices:[],flag:!1,get_view:function(){return null}},this[\"2d\"]={indices:{}},this[\"1d\"]={indices:this.indices},this.get_view=function(){return null},this.connect(this.properties.indices.change,function(){return t[\"1d\"].indices=t.indices}),this.connect(this.properties.line_indices.change,function(){t[\"0d\"].indices=t.line_indices,0==t.line_indices.length?t[\"0d\"].flag=!1:t[\"0d\"].flag=!0}),this.connect(this.properties.selected_glyphs.change,function(){return t[\"0d\"].glyph=t.selected_glyph}),this.connect(this.properties.get_view.change,function(){return t[\"0d\"].get_view=t.get_view}),this.connect(this.properties.multiline_indices.change,function(){return t[\"2d\"].indices=t.multiline_indices})},Object.defineProperty(t.prototype,\"selected_glyph\",{get:function(){return 0<this.selected_glyphs.length?this.selected_glyphs[0]:null},enumerable:!0,configurable:!0}),t.prototype.add_to_selected_glyphs=function(t){this.selected_glyphs.push(t)},t.prototype.update=function(t,e,i){this.final=e,i?this.update_through_union(t):(this.indices=t.indices,this.line_indices=t.line_indices,this.selected_glyphs=t.selected_glyphs,this.get_view=t.get_view,this.multiline_indices=t.multiline_indices,this.image_indices=t.image_indices)},t.prototype.clear=function(){this.final=!0,this.indices=[],this.line_indices=[],this.multiline_indices={},this.get_view=function(){return null},this.selected_glyphs=[]},t.prototype.is_empty=function(){return 0==this.indices.length&&0==this.line_indices.length&&0==this.image_indices.length},t.prototype.update_through_union=function(t){this.indices=s.union(t.indices,this.indices),this.selected_glyphs=s.union(t.selected_glyphs,this.selected_glyphs),this.line_indices=s.union(t.line_indices,this.line_indices),this.get_view()||(this.get_view=t.get_view),this.multiline_indices=a.merge(t.multiline_indices,this.multiline_indices)},t.prototype.update_through_intersection=function(t){this.indices=s.intersection(t.indices,this.indices),this.selected_glyphs=s.union(t.selected_glyphs,this.selected_glyphs),this.line_indices=s.union(t.line_indices,this.line_indices),this.get_view()||(this.get_view=t.get_view),this.multiline_indices=a.merge(t.multiline_indices,this.multiline_indices)},t}(r.Model);(i.Selection=l).initClass()},function(t,e,i){var n=t(387),r=t(195),o=t(14),s=t(15),a=function(i){function t(t){var e=i.call(this,t)||this;return e.initialized=!1,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"AjaxDataSource\",this.define({mode:[s.String,\"replace\"],content_type:[s.String,\"application/json\"],http_headers:[s.Any,{}],max_size:[s.Number],method:[s.String,\"POST\"],if_modified:[s.Bool,!1]})},t.prototype.destroy=function(){null!=this.interval&&clearInterval(this.interval),i.prototype.destroy.call(this)},t.prototype.setup=function(){var t=this;!this.initialized&&(this.initialized=!0,this.get_data(this.mode),this.polling_interval)&&(this.interval=setInterval(function(){return t.get_data(t.mode,t.max_size,t.if_modified)},this.polling_interval))},t.prototype.get_data=function(t,e,i){var n=this;void 0===e&&(e=0),void 0===i&&(i=!1);var r=this.prepare_request();r.addEventListener(\"load\",function(){return n.do_load(r,t,e)}),r.addEventListener(\"error\",function(){return n.do_error(r)}),r.send()},t.prototype.prepare_request=function(){var t=new XMLHttpRequest;t.open(this.method,this.data_url,!0),t.withCredentials=!1,t.setRequestHeader(\"Content-Type\",this.content_type);var e=this.http_headers;for(var i in e){var n=e[i];t.setRequestHeader(i,n)}return t},t.prototype.do_load=function(t,e,i){if(200===t.status){var n=JSON.parse(t.responseText);switch(e){case\"replace\":this.data=n;break;case\"append\":for(var r=this.data,o=0,s=this.columns();o<s.length;o++){var a=s[o],l=Array.from(r[a]),h=Array.from(n[a]);n[a]=l.concat(h).slice(-i)}this.data=n}}},t.prototype.do_error=function(t){o.logger.error(\"Failed to fetch JSON from \"+this.data_url+\" with code \"+t.status)},t}(r.RemoteDataSource);(i.AjaxDataSource=a).initClass()},function(t,e,i){var n=t(387),r=t(57),o=t(15),s=t(187),a=t(21),l=t(191),h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"CDSView\",this.define({filters:[o.Array,[]],source:[o.Instance]}),this.internal({indices:[o.Array,[]],indices_map:[o.Any,{}]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.compute_indices()},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.properties.filters.change,function(){t.compute_indices(),t.change.emit()}),null!=this.source&&(null!=this.source.change&&this.connect(this.source.change,function(){return t.compute_indices()}),null!=this.source.streaming&&this.connect(this.source.streaming,function(){return t.compute_indices()}),null!=this.source.patching&&this.connect(this.source.patching,function(){return t.compute_indices()}))},t.prototype.compute_indices=function(){var e=this,r=this.filters.map(function(t){return t.compute_indices(e.source)});0<(r=function(){for(var t=[],e=0,i=r;e<i.length;e++){var n=i[e];null!=n&&t.push(n)}return t}()).length?this.indices=a.intersection.apply(this,r):this.source instanceof l.ColumnarDataSource&&(this.indices=this.source.get_indices()),this.indices_map_to_subset()},t.prototype.indices_map_to_subset=function(){this.indices_map={};for(var t=0;t<this.indices.length;t++)this.indices_map[this.indices[t]]=t},t.prototype.convert_selection_from_subset=function(t){var e=this,i=new s.Selection;i.update_through_union(t);var n=t.indices.map(function(t){return e.indices[t]});return i.indices=n,i.image_indices=t.image_indices,i},t.prototype.convert_selection_to_subset=function(t){var e=this,i=new s.Selection;i.update_through_union(t);var n=t.indices.map(function(t){return e.indices_map[t]});return i.indices=n,i.image_indices=t.image_indices,i},t.prototype.convert_indices_from_subset=function(t){var e=this;return t.map(function(t){return e.indices[t]})},t}(r.Model);(i.CDSView=h).initClass()},function(t,e,i){var n=t(387),r=t(191),o=t(8),s=t(15),k=t(29),h=t(36),S=t(44),c=t(43),u=t(32);function a(t,e,i){if(S.isArray(t)){var n=t.concat(e);return null!=i&&n.length>i?n.slice(-i):n}if(S.isTypedArray(t)){var r=t.length+e.length;if(null!=i&&i<r){var o=r-i,s=t.length,n=void 0;t.length<i?(n=new t.constructor(i)).set(t,0):n=t;for(var a=o,l=s;a<l;a++)n[a-o]=n[a];for(var a=0,l=e.length;a<l;a++)n[a+(s-o)]=e[a];return n}var h=new t.constructor(e);return c.concat(t,h)}throw new Error(\"unsupported array types\")}function T(t,e){var i,n,r;return S.isNumber(t)?(r=(i=t)+1,n=1):(i=null!=t.start?t.start:0,r=null!=t.stop?t.stop:e,n=null!=t.step?t.step:1),[i,r,n]}function _(t,e,i){for(var n=new k.Set,r=!1,o=0,s=e;o<s.length;o++){var a=s[o],l=a[0],h=a[1],c=void 0,u=void 0;if(S.isArray(l)){var _=l[0];n.push(_),u=i[_],c=t[_]}else S.isNumber(l)?(h=[h],n.push(l)):r=!0,l=[0,0,l],u=[1,t.length],c=t;2===l.length&&(u=[1,u[0]],l=[l[0],0,l[1]]);for(var p=0,d=T(l[1],u[0]),f=d[0],v=d[1],m=d[2],g=T(l[2],u[1]),y=g[0],b=g[1],x=g[2],_=f;_<v;_+=m)for(var w=y;w<b;w+=x)r&&n.push(w),c[_*u[1]+w]=h[p],p++}return n}i.stream_to_column=a,i.slice=T,i.patch_to_column=_;var l=function(e){function l(t){return e.call(this,t)||this}return n.__extends(l,e),l.initClass=function(){this.prototype.type=\"ColumnDataSource\",this.define({data:[s.Any,{}]})},l.prototype.initialize=function(){var t;e.prototype.initialize.call(this),t=h.decode_column_data(this.data),this.data=t[0],this._shapes=t[1]},l.prototype.attributes_as_json=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=l._value_to_json);for(var i={},n=this.serializable_attributes(),r=0,o=u.keys(n);r<o.length;r++){var s=o[r],a=n[s];\"data\"===s&&(a=h.encode_column_data(a,this._shapes)),t?i[s]=a:s in this._set_after_defaults&&(i[s]=a)}return e(\"attributes\",i,this)},l._value_to_json=function(t,e,i){return S.isObject(e)&&\"data\"===t?h.encode_column_data(e,i._shapes):o.HasProps._value_to_json(t,e,i)},l.prototype.stream=function(t,e){var i=this.data;for(var n in t)i[n]=a(i[n],t[n],e);this.setv({data:i},{silent:!0}),this.streaming.emit()},l.prototype.patch=function(t){var e=this.data,i=new k.Set;for(var n in t){var r=t[n];i=i.union(_(e[n],r,this._shapes[n]))}this.setv({data:e},{silent:!0}),this.patching.emit(i.values)},l}(r.ColumnarDataSource);(i.ColumnDataSource=l).initClass()},function(t,e,i){var n=t(387),r=t(192),o=t(19),s=t(14),a=t(17),l=t(15),h=t(44),c=t(21),u=t(32),_=t(187),p=t(186),d=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),Object.defineProperty(t.prototype,\"column_names\",{get:function(){return u.keys(this.data)},enumerable:!0,configurable:!0}),t.prototype.get_array=function(t){var e=this.data[t];return null==e?this.data[t]=e=[]:h.isArray(e)||(this.data[t]=e=Array.from(e)),e},t.initClass=function(){this.prototype.type=\"ColumnarDataSource\",this.define({selection_policy:[l.Instance,function(){return new p.UnionRenderers}]}),this.internal({selection_manager:[l.Instance,function(t){return new a.SelectionManager({source:t})}],inspected:[l.Instance,function(){return new _.Selection}],_shapes:[l.Any,{}]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this._select=new o.Signal0(this,\"select\"),this.inspect=new o.Signal(this,\"inspect\"),this.streaming=new o.Signal0(this,\"streaming\"),this.patching=new o.Signal(this,\"patching\")},t.prototype.get_column=function(t){var e=this.data[t];return null!=e?e:null},t.prototype.columns=function(){return u.keys(this.data)},t.prototype.get_length=function(t){void 0===t&&(t=!0);var e=c.uniq(u.values(this.data).map(function(t){return t.length}));switch(e.length){case 0:return null;case 1:return e[0];default:var i=\"data source has columns of inconsistent lengths\";if(t)return s.logger.warn(i),e.sort()[0];throw new Error(i)}},t.prototype.get_indices=function(){var t=this.get_length();return c.range(0,null!=t?t:1)},t}(r.DataSource);(i.ColumnarDataSource=d).initClass()},function(t,e,i){var n=t(387),r=t(57),o=t(15),s=t(44),a=t(187),l=function(i){function t(t){return i.call(this,t)||this}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"DataSource\",this.define({selected:[o.Instance,function(){return new a.Selection}],callback:[o.Any]})},t.prototype.connect_signals=function(){var e=this;i.prototype.connect_signals.call(this),this.connect(this.properties.selected.change,function(){var t=e.callback;null!=t&&(s.isFunction(t)?t(e):t.execute(e))})},t}(r.Model);(i.DataSource=l).initClass()},function(t,e,i){var n=t(387),r=t(191),b=t(14),o=t(15),s=t(21),a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"GeoJSONDataSource\",this.define({geojson:[o.Any]}),this.internal({data:[o.Any,{}]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this._update_data()},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.properties.geojson.change,function(){return t._update_data()})},t.prototype._update_data=function(){this.data=this.geojson_to_column_data()},t.prototype._get_new_list_array=function(t){return s.range(0,t).map(function(t){return[]})},t.prototype._get_new_nan_array=function(t){return s.range(0,t).map(function(t){return NaN})},t.prototype._add_properties=function(t,e,i,n){var r=t.properties||{};for(var o in r)e.hasOwnProperty(o)||(e[o]=this._get_new_nan_array(n)),e[o][i]=r[o]},t.prototype._add_geometry=function(t,e,i){function n(t){return null!=t?t:NaN}function r(t,e){return t.concat([[NaN,NaN,NaN]]).concat(e)}switch(t.type){case\"Point\":var o=t.coordinates,s=o[0],a=o[1],l=o[2];e.x[i]=s,e.y[i]=a,e.z[i]=n(l);break;case\"LineString\":for(var h=t.coordinates,c=0;c<h.length;c++){var u=h[c],s=u[0],a=u[1],l=u[2];e.xs[i][c]=s,e.ys[i][c]=a,e.zs[i][c]=n(l)}break;case\"Polygon\":1<t.coordinates.length&&b.logger.warn(\"Bokeh does not support Polygons with holes in, only exterior ring used.\");for(var _=t.coordinates[0],c=0;c<_.length;c++){var p=_[c],s=p[0],a=p[1],l=p[2];e.xs[i][c]=s,e.ys[i][c]=a,e.zs[i][c]=n(l)}break;case\"MultiPoint\":b.logger.warn(\"MultiPoint not supported in Bokeh\");break;case\"MultiLineString\":for(var h=t.coordinates.reduce(r),c=0;c<h.length;c++){var d=h[c],s=d[0],a=d[1],l=d[2];e.xs[i][c]=s,e.ys[i][c]=a,e.zs[i][c]=n(l)}break;case\"MultiPolygon\":for(var f=[],v=0,m=t.coordinates;v<m.length;v++){var g=m[v];1<g.length&&b.logger.warn(\"Bokeh does not support Polygons with holes in, only exterior ring used.\"),f.push(g[0])}for(var h=f.reduce(r),c=0;c<h.length;c++){var y=h[c],s=y[0],a=y[1],l=y[2];e.xs[i][c]=s,e.ys[i][c]=a,e.zs[i][c]=n(l)}break;default:throw new Error(\"Invalid GeoJSON geometry type: \"+t.type)}},t.prototype.geojson_to_column_data=function(){var t,e=JSON.parse(this.geojson);switch(e.type){case\"GeometryCollection\":if(null==e.geometries)throw new Error(\"No geometries found in GeometryCollection\");if(0===e.geometries.length)throw new Error(\"geojson.geometries must have one or more items\");t=e.geometries;break;case\"FeatureCollection\":if(null==e.features)throw new Error(\"No features found in FeaturesCollection\");if(0==e.features.length)throw new Error(\"geojson.features must have one or more items\");t=e.features;break;default:throw new Error(\"Bokeh only supports type GeometryCollection and FeatureCollection at top level\")}for(var i=0,n=0,r=t;n<r.length;n++){var o=r[n],s=\"Feature\"===o.type?o.geometry:o;\"GeometryCollection\"==s.type?i+=s.geometries.length:i+=1}for(var a={x:this._get_new_nan_array(i),y:this._get_new_nan_array(i),z:this._get_new_nan_array(i),xs:this._get_new_list_array(i),ys:this._get_new_list_array(i),zs:this._get_new_list_array(i)},l=0,h=0,c=t;h<c.length;h++){var o=c[h],s=\"Feature\"==o.type?o.geometry:o;if(\"GeometryCollection\"==s.type)for(var u=0,_=s.geometries;u<_.length;u++){var p=_[u];this._add_geometry(p,a,l),\"Feature\"===o.type&&this._add_properties(o,a,l,i),l+=1}else this._add_geometry(s,a,l),\"Feature\"===o.type&&this._add_properties(o,a,l,i),l+=1}return a},t}(r.ColumnarDataSource);(i.GeoJSONDataSource=a).initClass()},function(t,e,i){var n=t(188);i.AjaxDataSource=n.AjaxDataSource;var r=t(190);i.ColumnDataSource=r.ColumnDataSource;var o=t(191);i.ColumnarDataSource=o.ColumnarDataSource;var s=t(189);i.CDSView=s.CDSView;var a=t(192);i.DataSource=a.DataSource;var l=t(193);i.GeoJSONDataSource=l.GeoJSONDataSource;var h=t(195);i.RemoteDataSource=h.RemoteDataSource},function(t,e,i){var n=t(387),r=t(190),o=t(15),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.prototype.get_column=function(t){var e=this.data[t];return null!=e?e:[]},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.setup()},t.initClass=function(){this.prototype.type=\"RemoteDataSource\",this.define({data_url:[o.String],polling_interval:[o.Number]})},t}(r.ColumnDataSource);(i.RemoteDataSource=s).initClass()},function(t,e,i){var n=t(387),r=t(200),o=t(15),v=t(21),s=function(i){function t(t){return i.call(this,t)||this}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"AdaptiveTicker\",this.define({base:[o.Number,10],mantissas:[o.Array,[1,2,5]],min_interval:[o.Number,0],max_interval:[o.Number]})},t.prototype.initialize=function(){i.prototype.initialize.call(this);var t=v.nth(this.mantissas,-1)/this.base,e=v.nth(this.mantissas,0)*this.base;this.extended_mantissas=[t].concat(this.mantissas,[e]),this.base_factor=0===this.get_min_interval()?1:this.get_min_interval()},t.prototype.get_interval=function(t,e,i){var n,r,o,s,a,l=e-t,h=this.get_ideal_interval(t,e,i),c=Math.floor((s=h/this.base_factor,void 0===(a=this.base)&&(a=Math.E),Math.log(s)/Math.log(a))),u=Math.pow(this.base,c)*this.base_factor,_=this.extended_mantissas,p=_.map(function(t){return Math.abs(i-l/(t*u))}),d=_[v.argmin(p)],f=d*u;return n=f,r=this.get_min_interval(),o=this.get_max_interval(),Math.max(r,Math.min(o,n))},t}(r.ContinuousTicker);(i.AdaptiveTicker=s).initClass()},function(t,e,i){var n=t(387),r=t(196),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"BasicTicker\"},t}(r.AdaptiveTicker);(i.BasicTicker=o).initClass()},function(t,e,i){var n=t(387),r=t(209),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"CategoricalTicker\"},t.prototype.get_ticks=function(t,e,i,n,r){var o=this._collect(i.factors,i,t,e),s=this._collect(i.tops||[],i,t,e),a=this._collect(i.mids||[],i,t,e);return{major:o,minor:[],tops:s,mids:a}},t.prototype._collect=function(t,e,i,n){for(var r=[],o=0,s=t;o<s.length;o++){var a=s[o],l=e.synthetic(a);i<l&&l<n&&r.push(a)}return r},t}(r.Ticker);(i.CategoricalTicker=o).initClass()},function(t,e,i){var n=t(387),r=t(200),o=t(15),u=t(21),_=t(32),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"CompositeTicker\",this.define({tickers:[o.Array,[]]})},Object.defineProperty(t.prototype,\"min_intervals\",{get:function(){return this.tickers.map(function(t){return t.get_min_interval()})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"max_intervals\",{get:function(){return this.tickers.map(function(t){return t.get_max_interval()})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"min_interval\",{get:function(){return this.min_intervals[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"max_interval\",{get:function(){return this.max_intervals[0]},enumerable:!0,configurable:!0}),t.prototype.get_best_ticker=function(t,e,i){var n,r=e-t,o=this.get_ideal_interval(t,e,i),s=[u.sortedIndex(this.min_intervals,o)-1,u.sortedIndex(this.max_intervals,o)],a=[this.min_intervals[s[0]],this.max_intervals[s[1]]],l=a.map(function(t){return Math.abs(i-r/t)});if(_.isEmpty(l.filter(function(t){return!isNaN(t)})))n=this.tickers[0];else{var h=u.argmin(l),c=s[h];n=this.tickers[c]}return n},t.prototype.get_interval=function(t,e,i){var n=this.get_best_ticker(t,e,i);return n.get_interval(t,e,i)},t.prototype.get_ticks_no_defaults=function(t,e,i,n){var r=this.get_best_ticker(t,e,n);return r.get_ticks_no_defaults(t,e,i,n)},t}(r.ContinuousTicker);(i.CompositeTicker=s).initClass()},function(t,e,i){var n=t(387),r=t(209),o=t(15),x=t(21),w=t(44),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ContinuousTicker\",this.define({num_minor_ticks:[o.Number,5],desired_num_ticks:[o.Number,6]})},t.prototype.get_ticks=function(t,e,i,n,r){return this.get_ticks_no_defaults(t,e,n,this.desired_num_ticks)},t.prototype.get_ticks_no_defaults=function(e,i,t,n){var r=this.get_interval(e,i,n),o=Math.floor(e/r),s=Math.ceil(i/r),a=(w.isStrictNaN(o)||w.isStrictNaN(s)?[]:x.range(o,s+1)).map(function(t){return t*r}).filter(function(t){return e<=t&&t<=i}),l=this.num_minor_ticks,h=[];if(0<l&&0<a.length){for(var c=r/l,u=x.range(0,l).map(function(t){return t*c}),_=0,p=u.slice(1);_<p.length;_++){var d=p[_],f=a[0]-d;e<=f&&f<=i&&h.push(f)}for(var v=0,m=a;v<m.length;v++)for(var g=m[v],y=0,b=u;y<b.length;y++){var d=b[y],f=g+d;e<=f&&f<=i&&h.push(f)}}return{major:a,minor:h}},t.prototype.get_min_interval=function(){return this.min_interval},t.prototype.get_max_interval=function(){return null!=this.max_interval?this.max_interval:1/0},t.prototype.get_ideal_interval=function(t,e,i){var n=e-t;return n/i},t}(r.Ticker);(i.ContinuousTicker=s).initClass()},function(t,e,i){var n=t(387),r=t(21),o=t(196),s=t(199),a=t(202),l=t(207),h=t(211),c=t(210),u=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"DatetimeTicker\",this.override({num_minor_ticks:0,tickers:function(){return[new o.AdaptiveTicker({mantissas:[1,2,5],base:10,min_interval:0,max_interval:500*c.ONE_MILLI,num_minor_ticks:0}),new o.AdaptiveTicker({mantissas:[1,2,5,10,15,20,30],base:60,min_interval:c.ONE_SECOND,max_interval:30*c.ONE_MINUTE,num_minor_ticks:0}),new o.AdaptiveTicker({mantissas:[1,2,4,6,8,12],base:24,min_interval:c.ONE_HOUR,max_interval:12*c.ONE_HOUR,num_minor_ticks:0}),new a.DaysTicker({days:r.range(1,32)}),new a.DaysTicker({days:r.range(1,31,3)}),new a.DaysTicker({days:[1,8,15,22]}),new a.DaysTicker({days:[1,15]}),new l.MonthsTicker({months:r.range(0,12,1)}),new l.MonthsTicker({months:r.range(0,12,2)}),new l.MonthsTicker({months:r.range(0,12,4)}),new l.MonthsTicker({months:r.range(0,12,6)}),new h.YearsTicker({})]}})},t}(s.CompositeTicker);(i.DatetimeTicker=u).initClass()},function(t,e,i){var n=t(387),r=t(208),c=t(210),o=t(15),u=t(21),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"DaysTicker\",this.define({days:[o.Array,[]]}),this.override({num_minor_ticks:0})},t.prototype.initialize=function(){e.prototype.initialize.call(this);var t=this.days;1<t.length?this.interval=(t[1]-t[0])*c.ONE_DAY:this.interval=31*c.ONE_DAY},t.prototype.get_ticks_no_defaults=function(e,i,t,n){var r=function(t,e){var i=c.last_month_no_later_than(new Date(t)),n=c.last_month_no_later_than(new Date(e));n.setUTCMonth(n.getUTCMonth()+1);for(var r=[],o=i;r.push(c.copy_date(o)),o.setUTCMonth(o.getUTCMonth()+1),!(n<o););return r}(e,i),l=this.days,o=this.interval,s=u.concat(r.map(function(t){return function(t,e){for(var i=[],n=0,r=l;n<r.length;n++){var o=r[n],s=c.copy_date(t);s.setUTCDate(o);var a=new Date(s.getTime()+e/2);a.getUTCMonth()==t.getUTCMonth()&&i.push(s)}return i}(t,o)})),a=s.map(function(t){return t.getTime()}),h=a.filter(function(t){return e<=t&&t<=i});return{major:h,minor:[]}},t}(r.SingleIntervalTicker);(i.DaysTicker=s).initClass()},function(t,e,i){var n=t(387),r=t(200),o=t(15),s=function(i){function t(t){var e=i.call(this,t)||this;return e.min_interval=0,e.max_interval=0,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"FixedTicker\",this.define({ticks:[o.Array,[]]})},t.prototype.get_ticks_no_defaults=function(t,e,i,n){return{major:this.ticks,minor:[]}},t.prototype.get_interval=function(t,e,i){return 0},t}(r.ContinuousTicker);(i.FixedTicker=s).initClass()},function(t,e,i){var n=t(196);i.AdaptiveTicker=n.AdaptiveTicker;var r=t(197);i.BasicTicker=r.BasicTicker;var o=t(198);i.CategoricalTicker=o.CategoricalTicker;var s=t(199);i.CompositeTicker=s.CompositeTicker;var a=t(200);i.ContinuousTicker=a.ContinuousTicker;var l=t(201);i.DatetimeTicker=l.DatetimeTicker;var h=t(202);i.DaysTicker=h.DaysTicker;var c=t(203);i.FixedTicker=c.FixedTicker;var u=t(205);i.LogTicker=u.LogTicker;var _=t(206);i.MercatorTicker=_.MercatorTicker;var p=t(207);i.MonthsTicker=p.MonthsTicker;var d=t(208);i.SingleIntervalTicker=d.SingleIntervalTicker;var f=t(209);i.Ticker=f.Ticker;var v=t(211);i.YearsTicker=v.YearsTicker},function(t,e,i){var n=t(387),r=t(196),N=t(21),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LogTicker\",this.override({mantissas:[1,5]})},t.prototype.get_ticks_no_defaults=function(e,i,t,n){var r,o=this.num_minor_ticks,s=[],a=this.base,l=Math.log(e)/Math.log(a),h=Math.log(i)/Math.log(a),c=h-l;if(isFinite(c))if(c<2){var u=this.get_interval(e,i,n),_=Math.floor(e/u),p=Math.ceil(i/u);if(r=N.range(_,p+1).filter(function(t){return 0!=t}).map(function(t){return t*u}).filter(function(t){return e<=t&&t<=i}),0<o&&0<r.length){for(var d=u/o,f=N.range(0,o).map(function(t){return t*d}),v=0,m=f.slice(1);v<m.length;v++){var g=m[v];s.push(r[0]-g)}for(var y=0,b=r;y<b.length;y++)for(var x=b[y],w=0,k=f;w<k.length;w++){var g=k[w];s.push(x+g)}}}else{var S=Math.ceil(.999999*l),T=Math.floor(1.000001*h),C=Math.ceil((T-S)/9);if(r=N.range(S,T+1,C).map(function(t){return Math.pow(a,t)}).filter(function(t){return e<=t&&t<=i}),0<o&&0<r.length){for(var A=Math.pow(a,C)/o,f=N.range(1,o+1).map(function(t){return t*A}),E=0,M=f;E<M.length;E++){var g=M[E];s.push(r[0]/g)}s.push(r[0]);for(var O=0,z=r;O<z.length;O++)for(var x=z[O],P=0,j=f;P<j.length;P++){var g=j[P];s.push(x*g)}}}else r=[];return{major:r,minor:s}},t}(r.AdaptiveTicker);(i.LogTicker=o).initClass()},function(t,e,i){var n=t(387),r=t(197),o=t(15),M=t(33),s=function(E){function t(t){return E.call(this,t)||this}return n.__extends(t,E),t.initClass=function(){this.prototype.type=\"MercatorTicker\",this.define({dimension:[o.LatLon]})},t.prototype.get_ticks_no_defaults=function(t,e,i,n){var r,o,s,a,l,h,c,u;if(null==this.dimension)throw new Error(\"MercatorTicker.dimension not configured\");r=M.clip_mercator(t,e,this.dimension),t=r[0],e=r[1],\"lon\"===this.dimension?(o=M.wgs84_mercator.inverse([t,i]),h=o[0],u=o[1],s=M.wgs84_mercator.inverse([e,i]),c=s[0],u=s[1]):(a=M.wgs84_mercator.inverse([i,t]),u=a[0],h=a[1],l=M.wgs84_mercator.inverse([i,e]),u=l[0],c=l[1]);var _=E.prototype.get_ticks_no_defaults.call(this,h,c,i,n),p=[],d=[];if(\"lon\"===this.dimension){for(var f=0,v=_.major;f<v.length;f++){var m=v[f];if(M.in_bounds(m,\"lon\")){var g=M.wgs84_mercator.forward([m,u])[0];p.push(g)}}for(var y=0,b=_.minor;y<b.length;y++){var m=b[y];if(M.in_bounds(m,\"lon\")){var g=M.wgs84_mercator.forward([m,u])[0];d.push(g)}}}else{for(var x=0,w=_.major;x<w.length;x++){var m=w[x];if(M.in_bounds(m,\"lat\")){var k=M.wgs84_mercator.forward([u,m]),S=k[1];p.push(S)}}for(var T=0,C=_.minor;T<C.length;T++){var m=C[T];if(M.in_bounds(m,\"lat\")){var A=M.wgs84_mercator.forward([u,m]),S=A[1];d.push(S)}}}return{major:p,minor:d}},t}(r.BasicTicker);(i.MercatorTicker=s).initClass()},function(t,e,i){var n=t(387),r=t(208),h=t(210),o=t(15),c=t(21),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"MonthsTicker\",this.define({months:[o.Array,[]]})},t.prototype.initialize=function(){e.prototype.initialize.call(this);var t=this.months;1<t.length?this.interval=(t[1]-t[0])*h.ONE_MONTH:this.interval=12*h.ONE_MONTH},t.prototype.get_ticks_no_defaults=function(e,i,t,n){var r=function(t,e){var i=h.last_year_no_later_than(new Date(t)),n=h.last_year_no_later_than(new Date(e));n.setUTCFullYear(n.getUTCFullYear()+1);for(var r=[],o=i;r.push(h.copy_date(o)),o.setUTCFullYear(o.getUTCFullYear()+1),!(n<o););return r}(e,i),o=this.months,s=c.concat(r.map(function(i){return o.map(function(t){var e=h.copy_date(i);return e.setUTCMonth(t),e})})),a=s.map(function(t){return t.getTime()}),l=a.filter(function(t){return e<=t&&t<=i});return{major:l,minor:[]}},t}(r.SingleIntervalTicker);(i.MonthsTicker=s).initClass()},function(t,e,i){var n=t(387),r=t(200),o=t(15),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"SingleIntervalTicker\",this.define({interval:[o.Number]})},t.prototype.get_interval=function(t,e,i){return this.interval},Object.defineProperty(t.prototype,\"min_interval\",{get:function(){return this.interval},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"max_interval\",{get:function(){return this.interval},enumerable:!0,configurable:!0}),t}(r.ContinuousTicker);(i.SingleIntervalTicker=s).initClass()},function(t,e,i){var n=t(387),r=t(57),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Ticker\"},t}(r.Model);(i.Ticker=o).initClass()},function(t,e,i){function n(t){return new Date(t.getTime())}function r(t){var e=n(t);return e.setUTCDate(1),e.setUTCHours(0),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),e}i.ONE_MILLI=1,i.ONE_SECOND=1e3,i.ONE_MINUTE=60*i.ONE_SECOND,i.ONE_HOUR=60*i.ONE_MINUTE,i.ONE_DAY=24*i.ONE_HOUR,i.ONE_MONTH=30*i.ONE_DAY,i.ONE_YEAR=365*i.ONE_DAY,i.copy_date=n,i.last_month_no_later_than=r,i.last_year_no_later_than=function(t){var e=r(t);return e.setUTCMonth(0),e}},function(t,e,i){var n=t(387),r=t(197),o=t(208),h=t(210),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"YearsTicker\"},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.interval=h.ONE_YEAR,this.basic_ticker=new r.BasicTicker({num_minor_ticks:0})},t.prototype.get_ticks_no_defaults=function(e,i,t,n){var r=h.last_year_no_later_than(new Date(e)).getUTCFullYear(),o=h.last_year_no_later_than(new Date(i)).getUTCFullYear(),s=this.basic_ticker.get_ticks_no_defaults(r,o,t,n).major,a=s.map(function(t){return Date.UTC(t,0,1)}),l=a.filter(function(t){return e<=t&&t<=i});return{major:l,minor:[]}},t}(o.SingleIntervalTicker);(i.YearsTicker=s).initClass()},function(t,e,i){var n=t(387),r=t(215),o=t(15),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"BBoxTileSource\",this.define({use_latlon:[o.Bool,!1]})},t.prototype.get_image_url=function(t,e,i){var n,r,o,s,a,l,h=this.string_lookup_replace(this.url,this.extra_url_vars);return this.use_latlon?(n=this.get_tile_geographic_bounds(t,e,i),s=n[0],l=n[1],o=n[2],a=n[3]):(r=this.get_tile_meter_bounds(t,e,i),s=r[0],l=r[1],o=r[2],a=r[3]),h.replace(\"{XMIN}\",s.toString()).replace(\"{YMIN}\",l.toString()).replace(\"{XMAX}\",o.toString()).replace(\"{YMAX}\",a.toString())},t}(r.MercatorTileSource);(i.BBoxTileSource=s).initClass()},function(t,e,i){var n=t(44),r=function(){function t(){this.images=[]}return t.prototype.pop=function(){var t=this.images.pop();return null!=t?t:new Image},t.prototype.push=function(t){var e;50<this.images.length||(n.isArray(t)?(e=this.images).push.apply(e,t):this.images.push(t))},t}();i.ImagePool=r},function(t,e,i){var n=t(212);i.BBoxTileSource=n.BBoxTileSource;var r=t(215);i.MercatorTileSource=r.MercatorTileSource;var o=t(216);i.QUADKEYTileSource=o.QUADKEYTileSource;var s=t(217);i.TileRenderer=s.TileRenderer;var a=t(218);i.TileSource=a.TileSource;var l=t(220);i.TMSTileSource=l.TMSTileSource;var h=t(221);i.WMTSTileSource=h.WMTSTileSource},function(t,e,i){var n=t(387),r=t(218),o=t(15),s=t(21),h=t(219),a=function(i){function t(t){return i.call(this,t)||this}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"MercatorTileSource\",this.define({snap_to_zoom:[o.Bool,!1],wrap_around:[o.Bool,!0]}),this.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097})},t.prototype.initialize=function(){var e=this;i.prototype.initialize.call(this),this._resolutions=s.range(this.min_zoom,this.max_zoom+1).map(function(t){return e.get_resolution(t)})},t.prototype._computed_initial_resolution=function(){return null!=this.initial_resolution?this.initial_resolution:2*Math.PI*6378137/this.tile_size},t.prototype.is_valid_tile=function(t,e,i){return!(!this.wrap_around&&(t<0||t>=Math.pow(2,i))||e<0||e>=Math.pow(2,i))},t.prototype.parent_by_tile_xyz=function(t,e,i){var n=this.tile_xyz_to_quadkey(t,e,i),r=n.substring(0,n.length-1);return this.quadkey_to_tile_xyz(r)},t.prototype.get_resolution=function(t){return this._computed_initial_resolution()/Math.pow(2,t)},t.prototype.get_resolution_by_extent=function(t,e,i){var n=(t[2]-t[0])/i,r=(t[3]-t[1])/e;return[n,r]},t.prototype.get_level_by_extent=function(t,e,i){for(var n=(t[2]-t[0])/i,r=(t[3]-t[1])/e,o=Math.max(n,r),s=0,a=0,l=this._resolutions;a<l.length;a++){var h=l[a];if(h<o){if(0==s)return 0;if(0<s)return s-1}s+=1}return s-1},t.prototype.get_closest_level_by_extent=function(t,e,i){var n=(t[2]-t[0])/i,r=(t[3]-t[1])/e,o=Math.max(n,r),s=this._resolutions.reduce(function(t,e){return Math.abs(e-o)<Math.abs(t-o)?e:t});return this._resolutions.indexOf(s)},t.prototype.snap_to_zoom_level=function(t,e,i,n){var r=t[0],o=t[1],s=t[2],a=t[3],l=this._resolutions[n],h=i*l,c=e*l;if(!this.snap_to_zoom){var u=(s-r)/h,_=(a-o)/c;_<u?(h=s-r,c*=u):(h*=_,c=a-o)}var p=(h-(s-r))/2,d=(c-(a-o))/2;return[r-p,o-d,s+p,a+d]},t.prototype.tms_to_wmts=function(t,e,i){\"Note this works both ways\";return[t,Math.pow(2,i)-1-e,i]},t.prototype.wmts_to_tms=function(t,e,i){\"Note this works both ways\";return[t,Math.pow(2,i)-1-e,i]},t.prototype.pixels_to_meters=function(t,e,i){var n=this.get_resolution(i),r=t*n-this.x_origin_offset,o=e*n-this.y_origin_offset;return[r,o]},t.prototype.meters_to_pixels=function(t,e,i){var n=this.get_resolution(i),r=(t+this.x_origin_offset)/n,o=(e+this.y_origin_offset)/n;return[r,o]},t.prototype.pixels_to_tile=function(t,e){var i=Math.ceil(t/this.tile_size);i=0===i?i:i-1;var n=Math.max(Math.ceil(e/this.tile_size)-1,0);return[i,n]},t.prototype.pixels_to_raster=function(t,e,i){var n=this.tile_size<<i;return[t,n-e]},t.prototype.meters_to_tile=function(t,e,i){var n=this.meters_to_pixels(t,e,i),r=n[0],o=n[1];return this.pixels_to_tile(r,o)},t.prototype.get_tile_meter_bounds=function(t,e,i){var n=this.pixels_to_meters(t*this.tile_size,e*this.tile_size,i),r=n[0],o=n[1],s=this.pixels_to_meters((t+1)*this.tile_size,(e+1)*this.tile_size,i),a=s[0],l=s[1];return[r,o,a,l]},t.prototype.get_tile_geographic_bounds=function(t,e,i){var n=this.get_tile_meter_bounds(t,e,i),r=h.meters_extent_to_geographic(n),o=r[0],s=r[1],a=r[2],l=r[3];return[o,s,a,l]},t.prototype.get_tiles_by_extent=function(t,e,i){void 0===i&&(i=1);var n=t[0],r=t[1],o=t[2],s=t[3],a=this.meters_to_tile(n,r,e),l=a[0],h=a[1],c=this.meters_to_tile(o,s,e),u=c[0],_=c[1];l-=i,h-=i,u+=i;for(var p=[],d=_+=i;h<=d;d--)for(var f=l;f<=u;f++)this.is_valid_tile(f,d,e)&&p.push([f,d,e,this.get_tile_meter_bounds(f,d,e)]);return this.sort_tiles_from_center(p,[l,h,u,_]),p},t.prototype.quadkey_to_tile_xyz=function(t){for(var e=0,i=0,n=t.length,r=n;0<r;r--){var o=t.charAt(n-r),s=1<<r-1;switch(o){case\"0\":continue;case\"1\":e|=s;break;case\"2\":i|=s;break;case\"3\":e|=s,i|=s;break;default:throw new TypeError(\"Invalid Quadkey: \"+t)}}return[e,i,n]},t.prototype.tile_xyz_to_quadkey=function(t,e,i){for(var n=\"\",r=i;0<r;r--){var o=1<<r-1,s=0;0!=(t&o)&&(s+=1),0!=(e&o)&&(s+=2),n+=s.toString()}return n},t.prototype.children_by_tile_xyz=function(t,e,i){for(var n=this.tile_xyz_to_quadkey(t,e,i),r=[],o=0;o<=3;o++){var s=this.quadkey_to_tile_xyz(n+o.toString()),a=s[0],l=s[1],h=s[2],c=this.get_tile_meter_bounds(a,l,h);r.push([a,l,h,c])}return r},t.prototype.get_closest_parent_by_tile_xyz=function(t,e,i){var n,r,o,s=this.calculate_world_x_by_tile_xyz(t,e,i);n=this.normalize_xyz(t,e,i),t=n[0],e=n[1],i=n[2];for(var a=this.tile_xyz_to_quadkey(t,e,i);0<a.length;)if(a=a.substring(0,a.length-1),r=this.quadkey_to_tile_xyz(a),t=r[0],e=r[1],i=r[2],o=this.denormalize_xyz(t,e,i,s),t=o[0],e=o[1],i=o[2],this.tile_xyz_to_key(t,e,i)in this.tiles)return[t,e,i];return[0,0,0]},t.prototype.normalize_xyz=function(t,e,i){if(this.wrap_around){var n=Math.pow(2,i);return[(t%n+n)%n,e,i]}return[t,e,i]},t.prototype.denormalize_xyz=function(t,e,i,n){return[t+n*Math.pow(2,i),e,i]},t.prototype.denormalize_meters=function(t,e,i,n){return[t+2*n*Math.PI*6378137,e]},t.prototype.calculate_world_x_by_tile_xyz=function(t,e,i){return Math.floor(t/Math.pow(2,i))},t}(r.TileSource);(i.MercatorTileSource=a).initClass()},function(t,e,i){var n=t(387),r=t(215),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"QUADKEYTileSource\"},t.prototype.get_image_url=function(t,e,i){var n=this.string_lookup_replace(this.url,this.extra_url_vars),r=this.tms_to_wmts(t,e,i),o=r[0],s=r[1],a=r[2],l=this.tile_xyz_to_quadkey(o,s,a);return n.replace(\"{Q}\",l)},t}(r.MercatorTileSource);(i.QUADKEYTileSource=o).initClass()},function(t,e,i){var r=t(387),o=t(213),n=t(221),s=t(179),a=t(174),l=t(5),h=t(15),I=t(21),c=t(44),u=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r.__extends(t,n),t.prototype.initialize=function(t){this.attributionEl=null,this._tiles=[],n.prototype.initialize.call(this,t)},t.prototype.connect_signals=function(){var t=this;n.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.request_render()})},t.prototype.get_extent=function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]},Object.defineProperty(t.prototype,\"map_plot\",{get:function(){return this.plot_model.plot},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"map_canvas\",{get:function(){return this.plot_view.canvas_view.ctx},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"map_frame\",{get:function(){return this.plot_model.frame},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"x_range\",{get:function(){return this.map_plot.x_range},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"y_range\",{get:function(){return this.map_plot.y_range},enumerable:!0,configurable:!0}),t.prototype._set_data=function(){this.pool=new o.ImagePool,this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0},t.prototype._add_attribution=function(){var t=this.model.tile_source.attribution;if(c.isString(t)&&0<t.length){if(null==this.attributionEl){var e=this.plot_model.canvas._right.value-this.plot_model.frame._right.value,i=this.plot_model.canvas._bottom.value-this.plot_model.frame._bottom.value,n=this.map_frame._width.value;this.attributionEl=l.div({class:\"bk-tile-attribution\",style:{position:\"absolute\",bottom:i+\"px\",right:e+\"px\",\"max-width\":n-4+\"px\",padding:\"2px\",\"background-color\":\"rgba(255,255,255,0.5)\",\"font-size\":\"7pt\",\"font-family\":\"sans-serif\",\"line-height\":\"1.05\",\"white-space\":\"nowrap\",overflow:\"hidden\",\"text-overflow\":\"ellipsis\"}});var r=this.plot_view.canvas_view.events_el;r.appendChild(this.attributionEl)}this.attributionEl.innerHTML=t,this.attributionEl.title=this.attributionEl.textContent.replace(/\\s*\\n\\s*/g,\" \")}},t.prototype._map_data=function(){this.initial_extent=this.get_extent();var t=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value),e=this.model.tile_source.snap_to_zoom_level(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value,t);this.x_range.start=e[0],this.y_range.start=e[1],this.x_range.end=e[2],this.y_range.end=e[3],this.x_range instanceof a.Range1d&&(this.x_range.reset_start=e[0],this.x_range.reset_end=e[2]),this.y_range instanceof a.Range1d&&(this.y_range.reset_start=e[1],this.y_range.reset_end=e[3]),this._add_attribution()},t.prototype._on_tile_load=function(t,e){t.img=e.target,t.loaded=!0,this.request_render()},t.prototype._on_tile_cache_load=function(t,e){t.img=e.target,t.loaded=!0,t.finished=!0,this.notify_finished()},t.prototype._on_tile_error=function(t){t.finished=!0},t.prototype._create_tile=function(t,e,i,n,r){void 0===r&&(r=!1);var o=this.model.tile_source.normalize_xyz(t,e,i),s=o[0],a=o[1],l=o[2],h=this.pool.pop(),c={img:h,tile_coords:[t,e,i],normalized_coords:[s,a,l],quadkey:this.model.tile_source.tile_xyz_to_quadkey(t,e,i),cache_key:this.model.tile_source.tile_xyz_to_key(t,e,i),bounds:n,loaded:!1,finished:!1,x_coord:n[0],y_coord:n[3]};h.onload=r?this._on_tile_cache_load.bind(this,c):this._on_tile_load.bind(this,c),h.onerror=this._on_tile_error.bind(this,c),h.alt=\"\",h.src=this.model.tile_source.get_image_url(s,a,l),this.model.tile_source.tiles[c.cache_key]=c,this._tiles.push(c)},t.prototype._enforce_aspect_ratio=function(){if(this._last_height!==this.map_frame._height.value||this._last_width!==this.map_frame._width.value){var t=this.get_extent(),e=this.model.tile_source.get_level_by_extent(t,this.map_frame._height.value,this.map_frame._width.value),i=this.model.tile_source.snap_to_zoom_level(t,this.map_frame._height.value,this.map_frame._width.value,e);return this.x_range.setv({start:i[0],end:i[2]}),this.y_range.setv({start:i[1],end:i[3]}),this.extent=i,this._last_height=this.map_frame._height.value,this._last_width=this.map_frame._width.value,!0}return!1},t.prototype.has_finished=function(){if(!n.prototype.has_finished.call(this))return!1;if(0===this._tiles.length)return!1;for(var t=0,e=this._tiles;t<e.length;t++){var i=e[t];if(!i.finished)return!1}return!0},t.prototype.render=function(){null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),this._enforce_aspect_ratio()||(this._update(),null!=this.prefetch_timer&&clearTimeout(this.prefetch_timer),this.prefetch_timer=setTimeout(this._prefetch_tiles.bind(this),500),this.has_finished()&&this.notify_finished())},t.prototype._draw_tile=function(t){var e=this.model.tile_source.tiles[t];if(null!=e){var i=this.plot_view.map_to_screen([e.bounds[0]],[e.bounds[3]]),n=i[0][0],r=i[1][0],o=this.plot_view.map_to_screen([e.bounds[2]],[e.bounds[1]]),s=o[0][0],a=o[1][0],l=s-n,h=a-r,c=n,u=r;this.map_canvas.drawImage(e.img,c,u,l,h),e.finished=!0}},t.prototype._set_rect=function(){var t=this.plot_model.plot.properties.outline_line_width.value(),e=this.map_frame._left.value+t/2,i=this.map_frame._top.value+t/2,n=this.map_frame._width.value-t,r=this.map_frame._height.value-t;this.map_canvas.rect(e,i,n,r),this.map_canvas.clip()},t.prototype._render_tiles=function(t){this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha;for(var e=0,i=t;e<i.length;e++){var n=i[e];this._draw_tile(n)}this.map_canvas.restore()},t.prototype._prefetch_tiles=function(){for(var t=this.model.tile_source,e=this.get_extent(),i=this.map_frame._height.value,n=this.map_frame._width.value,r=this.model.tile_source.get_level_by_extent(e,i,n),o=this.model.tile_source.get_tiles_by_extent(e,r),s=0,a=Math.min(10,o.length);s<a;s++)for(var l=o[s],h=l[0],c=l[1],u=l[2],_=this.model.tile_source.children_by_tile_xyz(h,c,u),p=0,d=_;p<d.length;p++){var f=d[p],v=f[0],m=f[1],g=f[2],y=f[3];t.tile_xyz_to_key(v,m,g)in t.tiles||this._create_tile(v,m,g,y,!0)}},t.prototype._fetch_tiles=function(t){for(var e=0,i=t;e<i.length;e++){var n=i[e],r=n[0],o=n[1],s=n[2],a=n[3];this._create_tile(r,o,s,a)}},t.prototype._update=function(){var t=this,e=this.model.tile_source,i=e.min_zoom,n=e.max_zoom,r=this.get_extent(),o=this.extent[2]-this.extent[0]<r[2]-r[0],s=this.map_frame._height.value,a=this.map_frame._width.value,l=e.get_level_by_extent(r,s,a),h=!1;l<i?(r=this.extent,l=i,h=!0):n<l&&(r=this.extent,l=n,h=!0),h&&(this.x_range.setv({x_range:{start:r[0],end:r[2]}}),this.y_range.setv({start:r[1],end:r[3]}),this.extent=r),this.extent=r;for(var c=e.get_tiles_by_extent(r,l),u=[],_=[],p=[],d=[],f=0,v=c;f<v.length;f++){var m=v[f],g=m[0],y=m[1],b=m[2],x=e.tile_xyz_to_key(g,y,b),w=e.tiles[x];if(null!=w&&w.loaded)_.push(x);else if(this.model.render_parents){var k=e.get_closest_parent_by_tile_xyz(g,y,b),S=k[0],T=k[1],C=k[2],A=e.tile_xyz_to_key(S,T,C),E=e.tiles[A];if(null!=E&&E.loaded&&!I.includes(p,A)&&p.push(A),o)for(var M=e.children_by_tile_xyz(g,y,b),O=0,z=M;O<z.length;O++){var P=z[O],j=P[0],N=P[1],F=P[2],D=e.tile_xyz_to_key(j,N,F);D in e.tiles&&d.push(D)}}null==w&&u.push(m)}this._render_tiles(p),this._render_tiles(d),this._render_tiles(_),null!=this.render_timer&&clearTimeout(this.render_timer),this.render_timer=setTimeout(function(){return t._fetch_tiles(u)},65)},t}(s.RendererView);i.TileRendererView=u;var _=function(e){function t(t){return e.call(this,t)||this}return r.__extends(t,e),t.initClass=function(){this.prototype.type=\"TileRenderer\",this.prototype.default_view=u,this.define({alpha:[h.Number,1],x_range_name:[h.String,\"default\"],y_range_name:[h.String,\"default\"],tile_source:[h.Instance,function(){return new n.WMTSTileSource}],render_parents:[h.Bool,!0]}),this.override({level:\"underlay\"})},t}(s.Renderer);(i.TileRenderer=_).initClass()},function(t,e,i){var n=t(387),r=t(57),o=t(213),s=t(15),a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"TileSource\",this.define({url:[s.String,\"\"],tile_size:[s.Number,256],max_zoom:[s.Number,30],min_zoom:[s.Number,0],extra_url_vars:[s.Any,{}],attribution:[s.String,\"\"],x_origin_offset:[s.Number],y_origin_offset:[s.Number],initial_resolution:[s.Number]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.tiles={},this.pool=new o.ImagePool,this._normalize_case()},t.prototype.string_lookup_replace=function(t,e){var i=t;for(var n in e){var r=e[n];i=i.replace(\"{\"+n+\"}\",r)}return i},t.prototype._normalize_case=function(){var t=this.url.replace(\"{x}\",\"{X}\").replace(\"{y}\",\"{Y}\").replace(\"{z}\",\"{Z}\").replace(\"{q}\",\"{Q}\").replace(\"{xmin}\",\"{XMIN}\").replace(\"{ymin}\",\"{YMIN}\").replace(\"{xmax}\",\"{XMAX}\").replace(\"{ymax}\",\"{YMAX}\");this.url=t},t.prototype.tile_xyz_to_key=function(t,e,i){return t+\":\"+e+\":\"+i},t.prototype.key_to_tile_xyz=function(t){var e=t.split(\":\").map(function(t){return parseInt(t)}),i=e[0],n=e[1],r=e[2];return[i,n,r]},t.prototype.sort_tiles_from_center=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=(r-i)/2+i,a=(o-n)/2+n;t.sort(function(t,e){var i=Math.sqrt(Math.pow(s-t[0],2)+Math.pow(a-t[1],2)),n=Math.sqrt(Math.pow(s-e[0],2)+Math.pow(a-e[1],2));return i-n})},t.prototype.get_image_url=function(t,e,i){var n=this.string_lookup_replace(this.url,this.extra_url_vars);return n.replace(\"{X}\",t.toString()).replace(\"{Y}\",e.toString()).replace(\"{Z}\",i.toString())},t}(r.Model);(i.TileSource=a).initClass()},function(t,e,i){var n=t(33);function u(t,e){return n.wgs84_mercator.forward([t,e])}function _(t,e){return n.wgs84_mercator.inverse([t,e])}i.geographic_to_meters=u,i.meters_to_geographic=_,i.geographic_extent_to_meters=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=u(e,i),s=o[0],a=o[1],l=u(n,r),h=l[0],c=l[1];return[s,a,h,c]},i.meters_extent_to_geographic=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=_(e,i),s=o[0],a=o[1],l=_(n,r),h=l[0],c=l[1];return[s,a,h,c]}},function(t,e,i){var n=t(387),r=t(215),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"TMSTileSource\"},t.prototype.get_image_url=function(t,e,i){var n=this.string_lookup_replace(this.url,this.extra_url_vars);return n.replace(\"{X}\",t.toString()).replace(\"{Y}\",e.toString()).replace(\"{Z}\",i.toString())},t}(r.MercatorTileSource);(i.TMSTileSource=o).initClass()},function(t,e,i){var n=t(387),r=t(215),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"WMTSTileSource\"},t.prototype.get_image_url=function(t,e,i){var n=this.string_lookup_replace(this.url,this.extra_url_vars),r=this.tms_to_wmts(t,e,i),o=r[0],s=r[1],a=r[2];return n.replace(\"{X}\",o.toString()).replace(\"{Y}\",s.toString()).replace(\"{Z}\",a.toString())},t}(r.MercatorTileSource);(i.WMTSTileSource=o).initClass()},function(t,e,i){var n=t(387),r=t(230),o=t(19),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._clicked=function(){this.model.do.emit()},e}(r.ButtonToolButtonView);i.ActionToolButtonView=s;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.do,function(){return t.doit()})},t}(r.ButtonToolView);i.ActionToolView=a;var l=function(i){function t(t){var e=i.call(this,t)||this;return e.button_view=s,e.do=new o.Signal0(e,\"do\"),e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"ActionTool\"},t}(r.ButtonTool);(i.ActionTool=l).initClass()},function(t,e,i){var n=t(387),r=t(222),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){window.open(this.model.redirect)},e}(r.ActionToolView);i.HelpToolView=s;var a=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Help\",e.icon=\"bk-tool-icon-help\",e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"HelpTool\",this.prototype.default_view=s,this.define({help_tooltip:[o.String,\"Click the question mark to learn more about Bokeh plot tools.\"],redirect:[o.String,\"https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#built-in-tools\"]})},Object.defineProperty(t.prototype,\"tooltip\",{get:function(){return this.help_tooltip},enumerable:!0,configurable:!0}),t}(r.ActionTool);(i.HelpTool=a).initClass()},function(t,e,i){var n=t(387),r=t(222),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.plot_view.state_changed,function(){return t.model.disabled=!t.plot_view.can_redo()})},t.prototype.doit=function(){this.plot_view.redo()},t}(r.ActionToolView);i.RedoToolView=o;var s=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Redo\",e.icon=\"bk-tool-icon-redo\",e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"RedoTool\",this.prototype.default_view=o,this.override({disabled:!0})},t}(r.ActionTool);(i.RedoTool=s).initClass()},function(t,e,i){var n=t(387),r=t(222),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){this.plot_view.reset()},e}(r.ActionToolView);i.ResetToolView=o;var s=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Reset\",e.icon=\"bk-tool-icon-reset\",e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"ResetTool\",this.prototype.default_view=o},t}(r.ActionTool);(i.ResetTool=s).initClass()},function(t,e,i){var n=t(387),r=t(222),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){this.plot_view.save(\"bokeh_plot\")},e}(r.ActionToolView);i.SaveToolView=o;var s=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Save\",e.icon=\"bk-tool-icon-save\",e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"SaveTool\",this.prototype.default_view=o},t}(r.ActionTool);(i.SaveTool=s).initClass()},function(t,e,i){var n=t(387),r=t(222),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.plot_view.state_changed,function(){return t.model.disabled=!t.plot_view.can_undo()})},t.prototype.doit=function(){this.plot_view.undo()},t}(r.ActionToolView);i.UndoToolView=o;var s=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Undo\",e.icon=\"bk-tool-icon-undo\",e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"UndoTool\",this.prototype.default_view=o,this.override({disabled:!0})},t}(r.ActionTool);(i.UndoTool=s).initClass()},function(t,e,i){var n=t(387),r=t(222),o=t(46),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){var t=this.plot_model.frame,e=this.model.dimensions,i=\"width\"==e||\"both\"==e,n=\"height\"==e||\"both\"==e,r=o.scale_range(t,this.model.factor,i,n);this.plot_view.push_state(\"zoom_out\",{range:r}),this.plot_view.update_range(r,!1,!0),this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e}(r.ActionToolView);i.ZoomInToolView=a;var l=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Zoom In\",e.icon=\"bk-tool-icon-zoom-in\",e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"ZoomInTool\",this.prototype.default_view=a,this.define({factor:[s.Percent,.1],dimensions:[s.Dimensions,\"both\"]})},Object.defineProperty(t.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),t}(r.ActionTool);(i.ZoomInTool=l).initClass()},function(t,e,i){var n=t(387),r=t(222),o=t(46),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){var t=this.plot_model.frame,e=this.model.dimensions,i=\"width\"==e||\"both\"==e,n=\"height\"==e||\"both\"==e,r=o.scale_range(t,-this.model.factor,i,n);this.plot_view.push_state(\"zoom_out\",{range:r}),this.plot_view.update_range(r,!1,!0),this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e}(r.ActionToolView);i.ZoomOutToolView=a;var l=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Zoom Out\",e.icon=\"bk-tool-icon-zoom-out\",e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"ZoomOutTool\",this.prototype.default_view=a,this.define({factor:[s.Percent,.1],dimensions:[s.Dimensions,\"both\"]})},Object.defineProperty(t.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),t}(r.ActionTool);(i.ZoomOutTool=l).initClass()},function(t,e,i){var n=t(387),r=t(6),o=t(253),s=t(5),a=t(15),l=function(i){function t(){return null!==i&&i.apply(this,arguments)||this}return n.__extends(t,i),t.prototype.initialize=function(t){var e=this;i.prototype.initialize.call(this,t),this.connect(this.model.change,function(){return e.render()}),this.el.addEventListener(\"click\",function(){return e._clicked()}),this.render()},t.prototype.css_classes=function(){return i.prototype.css_classes.call(this).concat(\"bk-toolbar-button\")},t.prototype.render=function(){s.empty(this.el),this.el.classList.add(this.model.icon),this.el.title=this.model.tooltip},t}(r.DOMView);i.ButtonToolButtonView=l;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(o.ToolView);i.ButtonToolView=h;var c=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ButtonTool\",this.internal({disabled:[a.Boolean,!1]})},Object.defineProperty(t.prototype,\"tooltip\",{get:function(){return this.tool_name},enumerable:!0,configurable:!0}),t}(o.Tool);(i.ButtonTool=c).initClass()},function(t,e,i){var n=t(387),o=t(5),r=t(15),s=t(232),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._tap=function(t){if(null==this._draw_basepoint&&null==this._basepoint){var e=t.shiftKey;this._select_event(t,e,this.model.renderers)}},e.prototype._keyup=function(t){if(this.model.active&&this._mouse_in_frame)for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];if(t.keyCode===o.Keys.Backspace)this._delete_selected(n);else if(t.keyCode==o.Keys.Esc){var r=n.data_source;r.selection_manager.clear()}}},e.prototype._set_extent=function(t,e,i,n){var r=t[0],o=t[1],s=e[0],a=e[1];void 0===n&&(n=!1);var l=this.model.renderers[0],h=this.plot_model.frame,c=l.glyph,u=l.data_source,_=h.xscales[l.x_range_name],p=h.yscales[l.y_range_name],d=_.r_invert(r,o),f=d[0],v=d[1],m=p.r_invert(s,a),g=m[0],y=m[1],b=[(f+v)/2,(g+y)/2],x=b[0],w=b[1],k=[v-f,y-g],S=k[0],T=k[1],C=[c.x.field,c.y.field],A=C[0],E=C[1],M=[c.width.field,c.height.field],O=M[0],z=M[1];if(i)A&&u.get_array(A).push(x),E&&u.get_array(E).push(w),O&&u.get_array(O).push(S),z&&u.get_array(z).push(T),this._pad_empty_columns(u,[A,E,O,z]);else{var P=u.data[A].length-1;A&&(u.data[A][P]=x),E&&(u.data[E][P]=w),O&&(u.data[O][P]=S),z&&(u.data[z][P]=T)}u.change.emit(),n&&u.properties.data.change.emit()},e.prototype._update_box=function(t,e,i){if(void 0===e&&(e=!1),void 0===i&&(i=!1),null!=this._draw_basepoint){var n=[t.sx,t.sy],r=this.plot_model.frame,o=this.model.dimensions,s=this.model._get_dim_limits(this._draw_basepoint,n,r,o);if(null!=s){var a=s[0],l=s[1];this._set_extent(a,l,e,i)}}},e.prototype._doubletap=function(t){if(null!=this._draw_basepoint){this._update_box(t,!1,!0),this._draw_basepoint=null;for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];n.data_source.selected.indices=[],n.data_source.properties.data.change.emit()}}else this._draw_basepoint=[t.sx,t.sy],this._select_event(t,!0,this.model.renderers),this._update_box(t,!0,!1)},e.prototype._move=function(t){this._update_box(t,!1,!1)},e.prototype._pan_start=function(t){if(t.shiftKey){if(null!=this._draw_basepoint)return;this._draw_basepoint=[t.sx,t.sy],this._update_box(t,!0,!1)}else{if(null!=this._basepoint)return;this._select_event(t,!0,this.model.renderers),this._basepoint=[t.sx,t.sy]}},e.prototype._pan=function(t,e,i){if(void 0===e&&(e=!1),void 0===i&&(i=!1),t.shiftKey){if(null==this._draw_basepoint)return;this._update_box(t,e,i)}else{if(null==this._basepoint)return;this._drag_points(t,this.model.renderers)}},e.prototype._pan_end=function(t){this._pan(t,!1,!0),t.shiftKey?this._draw_basepoint=null:this._basepoint=null;for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];n.data_source.selected.indices=[],n.data_source.properties.data.change.emit()}},e}(s.EditToolView);i.BoxEditToolView=a;var l=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Box Edit Tool\",e.icon=\"bk-tool-icon-box-edit\",e.event_type=[\"tap\",\"pan\",\"move\"],e.default_order=1,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"BoxEditTool\",this.prototype.default_view=a,this.define({dimensions:[r.Dimensions,\"both\"]})},t}(s.EditTool);(i.BoxEditTool=l).initClass()},function(t,e,i){var n=t(387),r=t(15),o=t(21),s=t(238),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._mouse_in_frame=!0,t}return n.__extends(t,e),t.prototype._move_enter=function(t){this._mouse_in_frame=!0},t.prototype._move_exit=function(t){this._mouse_in_frame=!1},t.prototype._map_drag=function(t,e,i){var n=this.plot_model.frame;if(!n.bbox.contains(t,e))return null;var r=n.xscales[i.x_range_name].invert(t),o=n.yscales[i.y_range_name].invert(e);return[r,o]},t.prototype._delete_selected=function(t){var e=t.data_source,i=e.selected.indices;i.sort();for(var n=0,r=e.columns();n<r.length;n++)for(var o=r[n],s=e.get_array(o),a=0;a<i.length;a++){var l=i[a];s.splice(l-a,1)}e.change.emit(),e.properties.data.change.emit(),e.selection_manager.clear()},t.prototype._drag_points=function(t,e){if(null!=this._basepoint){for(var i=this._basepoint,n=i[0],r=i[1],o=0,s=e;o<s.length;o++){var a=s[o],l=this._map_drag(n,r,a),h=this._map_drag(t.sx,t.sy,a);if(null!=h&&null!=l)for(var c=h[0],u=h[1],_=l[0],p=l[1],d=[c-_,u-p],f=d[0],v=d[1],m=a.glyph,g=a.data_source,y=[m.x.field,m.y.field],b=y[0],x=y[1],w=0,k=g.selected.indices;w<k.length;w++){var S=k[w];b&&(g.data[b][S]+=f),x&&(g.data[x][S]+=v)}}for(var T=0,C=e;T<C.length;T++){var a=C[T];a.data_source.change.emit(),a.data_source.properties.data.change.emit()}this._basepoint=[t.sx,t.sy]}},t.prototype._pad_empty_columns=function(t,e){for(var i=0,n=t.columns();i<n.length;i++){var r=n[i];o.includes(e,r)||t.get_array(r).push(this.model.empty_value)}},t.prototype._select_event=function(t,e,i){var n=this.plot_model.frame,r=t.sx,o=t.sy;if(!n.bbox.contains(r,o))return[];for(var s={type:\"point\",sx:r,sy:o},a=[],l=0,h=i;l<h.length;l++){var c=h[l],u=c.get_selection_manager(),_=c.data_source,p=[this.plot_view.renderer_views[c.id]],d=u.select(p,s,!0,e);d&&a.push(c),_.properties.selected.change.emit()}return a},t}(s.GestureToolView);i.EditToolView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"EditTool\",this.define({empty_value:[r.Any],renderers:[r.Array,[]]})},t}(s.GestureTool);(i.EditTool=l).initClass()},function(t,e,i){var n=t(387),o=t(5),r=t(15),s=t(232),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._tap=function(t){var e=t.shiftKey,i=this._select_event(t,e,this.model.renderers);if(!i.length&&this.model.add){var n=this.model.renderers[0],r=this._map_drag(t.sx,t.sy,n);if(null!=r){var o=n.glyph,s=n.data_source,a=[o.x.field,o.y.field],l=a[0],h=a[1],c=r[0],u=r[1];l&&s.get_array(l).push(c),h&&s.get_array(h).push(u),this._pad_empty_columns(s,[l,h]),s.change.emit(),s.properties.data.change.emit()}}},e.prototype._keyup=function(t){if(this.model.active&&this._mouse_in_frame)for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];if(t.keyCode===o.Keys.Backspace)this._delete_selected(n);else if(t.keyCode==o.Keys.Esc){var r=n.data_source;r.selection_manager.clear()}}},e.prototype._pan_start=function(t){this.model.drag&&(this._select_event(t,!0,this.model.renderers),this._basepoint=[t.sx,t.sy])},e.prototype._pan=function(t){this.model.drag&&null!=this._basepoint&&this._drag_points(t,this.model.renderers)},e.prototype._pan_end=function(t){if(this.model.drag){this._pan(t);for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];n.data_source.selected.indices=[],n.data_source.data=n.data_source.data,n.data_source.properties.data.change.emit()}this._basepoint=null}},e}(s.EditToolView);i.PointDrawToolView=a;var l=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Point Draw Tool\",e.icon=\"bk-tool-icon-point-draw\",e.event_type=[\"tap\",\"pan\",\"move\"],e.default_order=2,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"PointDrawTool\",this.prototype.default_view=a,this.define({add:[r.Bool,!0],drag:[r.Bool,!0]})},t}(s.EditTool);(i.PointDrawTool=l).initClass()},function(t,e,i){var n=t(387),o=t(5),r=t(15),m=t(44),s=t(232),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._drawing=!1,t}return n.__extends(t,e),t.prototype._tap=function(t){if(this._drawing)this._draw(t,\"add\"),this.model.renderers[0].data_source.properties.data.change.emit();else{var e=t.shiftKey;this._select_event(t,e,this.model.renderers)}},t.prototype._draw=function(t,e){var i=this.model.renderers[0],n=this._map_drag(t.sx,t.sy,i);if(null!=n){var r=n[0],o=n[1],s=i.data_source,a=i.glyph,l=[a.xs.field,a.ys.field],h=l[0],c=l[1];if(\"new\"==e)h&&s.get_array(h).push([r,r]),c&&s.get_array(c).push([o,o]),this._pad_empty_columns(s,[h,c]);else if(\"edit\"==e){if(h){var u=s.data[h][s.data[h].length-1];u[u.length-1]=r}if(c){var _=s.data[c][s.data[c].length-1];_[_.length-1]=o}}else if(\"add\"==e){if(h){var p=s.data[h].length-1,u=s.get_array(h)[p],d=u[u.length-1];u[u.length-1]=r,m.isArray(u)||(u=Array.from(u),s.data[h][p]=u),u.push(d)}if(c){var f=s.data[c].length-1,_=s.get_array(c)[f],v=_[_.length-1];_[_.length-1]=o,m.isArray(_)||(_=Array.from(_),s.data[c][f]=_),_.push(v)}}s.change.emit()}},t.prototype._doubletap=function(t){this.model.active&&(this._drawing?(this._drawing=!1,this._draw(t,\"edit\")):(this._drawing=!0,this._draw(t,\"new\")),this.model.renderers[0].data_source.properties.data.change.emit())},t.prototype._move=function(t){this._drawing&&this._draw(t,\"edit\")},t.prototype._remove=function(){var t=this.model.renderers[0],e=t.data_source,i=t.glyph,n=[i.xs.field,i.ys.field],r=n[0],o=n[1];if(r){var s=e.data[r].length-1,a=e.get_array(r)[s];a.splice(a.length-1,1)}if(o){var l=e.data[o].length-1,h=e.get_array(o)[l];h.splice(h.length-1,1)}e.change.emit(),e.properties.data.change.emit()},t.prototype._keyup=function(t){if(this.model.active&&this._mouse_in_frame)for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];if(t.keyCode===o.Keys.Backspace)this._delete_selected(n);else if(t.keyCode==o.Keys.Esc){this._drawing&&(this._remove(),this._drawing=!1);var r=n.data_source;r.selection_manager.clear()}}},t.prototype._pan_start=function(t){this.model.drag&&(this._select_event(t,!0,this.model.renderers),this._basepoint=[t.sx,t.sy])},t.prototype._pan=function(t){if(null!=this._basepoint&&this.model.drag){for(var e=this._basepoint,i=e[0],n=e[1],r=0,o=this.model.renderers;r<o.length;r++){var s=o[r],a=this._map_drag(i,n,s),l=this._map_drag(t.sx,t.sy,s);if(null!=l&&null!=a){var h=s.data_source,c=s.glyph,u=[c.xs.field,c.ys.field],_=u[0],p=u[1];if(_||p){for(var d=l[0],f=l[1],v=a[0],m=a[1],g=[d-v,f-m],y=g[0],b=g[1],x=0,w=h.selected.indices;x<w.length;x++){var k=w[x],S=void 0,T=void 0,C=void 0;_&&(T=h.data[_][k]),p?(C=h.data[p][k],S=C.length):S=T.length;for(var A=0;A<S;A++)T&&(T[A]+=y),C&&(C[A]+=b)}h.change.emit()}}}this._basepoint=[t.sx,t.sy]}},t.prototype._pan_end=function(t){if(this.model.drag){this._pan(t);for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];n.data_source.selected.indices=[],n.data_source.properties.data.change.emit()}this._basepoint=null}},t.prototype.deactivate=function(){this._drawing&&(this._remove(),this._drawing=!1)},t}(s.EditToolView);i.PolyDrawToolView=a;var l=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Polygon Draw Tool\",e.icon=\"bk-tool-icon-poly-draw\",e.event_type=[\"pan\",\"tap\",\"move\"],e.default_order=3,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"PolyDrawTool\",this.prototype.default_view=a,this.define({drag:[r.Bool,!0]})},t}(s.EditTool);(i.PolyDrawTool=l).initClass()},function(t,e,i){var n=t(387),s=t(5),r=t(15),o=t(232),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._drawing=!1,t}return n.__extends(t,e),t.prototype._doubletap=function(t){if(this.model.active){var e=this._map_drag(t.sx,t.sy,this.model.vertex_renderer);if(null!=e){var i=e[0],n=e[1],r=this._select_event(t,!1,this.model.renderers),o=this._select_event(t,!1,[this.model.vertex_renderer]),s=this.model.vertex_renderer.data_source,a=this.model.vertex_renderer.glyph,l=[a.x.field,a.y.field],h=l[0],c=l[1];if(o.length&&null!=this._selected_renderer){var u=s.selected.indices[0];return this._drawing?(s.selected.indices=[],h&&(s.data[h][u]=i),c&&(s.data[c][u]=n),this._drawing=!1,this._selected_renderer.data_source.properties.data.change.emit()):(s.selected.indices=[u+1],h&&s.get_array(h).splice(u+1,0,i),c&&s.get_array(c).splice(u+1,0,n),this._drawing=!0),s.change.emit(),void this._selected_renderer.data_source.change.emit()}if(!r.length)return h&&(s.data[h]=[]),c&&(s.data[c]=[]),this._selected_renderer=null,this._drawing=!1,void s.change.emit();var _=r[0],p=_.glyph,d=_.data_source,f=d.selected.indices[0],v=[p.xs.field,p.ys.field],m=v[0],g=v[1];if(m){var y=d.data[m][f];h&&(s.data[h]=y)}else a.x={value:p.xs.value};if(g){var b=d.data[g][f];c&&(s.data[c]=b)}else a.y={value:p.ys.value};s.selected.indices=[],this._selected_renderer=_,s.change.emit(),s.properties.data.change.emit()}}},t.prototype._move=function(t){if(this._drawing&&null!=this._selected_renderer){var e=this.model.vertex_renderer,i=this._map_drag(t.sx,t.sy,e);if(null==i)return;var n=i[0],r=i[1],o=e.data_source,s=e.glyph,a=[s.x.field,s.y.field],l=a[0],h=a[1],c=o.selected.indices[0];l&&(o.data[l][c]=n),h&&(o.data[h][c]=r),o.change.emit(),this._selected_renderer.data_source.change.emit()}},t.prototype._tap=function(t){var e=this.model.vertex_renderer,i=this._map_drag(t.sx,t.sy,e);if(null!=i){if(this._drawing&&this._selected_renderer){var n=i[0],r=i[1],o=e.data_source,s=e.glyph,a=[s.x.field,s.y.field],l=a[0],h=a[1],c=o.selected.indices[0];if(o.selected.indices=[c+1],l){var u=o.get_array(l),_=u[c];u[c]=n,u.splice(c+1,0,_)}if(h){var p=o.get_array(h),d=p[c];p[c]=r,p.splice(c+1,0,d)}o.change.emit();var f=this._selected_renderer.data_source;return f.change.emit(),void f.properties.data.change.emit()}var v=t.shiftKey;this._select_event(t,v,[e]),this._select_event(t,v,this.model.renderers)}},t.prototype._remove_vertex=function(t){if(void 0===t&&(t=!0),this._drawing&&this._selected_renderer){var e=this.model.vertex_renderer,i=e.data_source,n=e.glyph,r=i.selected.indices[0],o=[n.x.field,n.y.field],s=o[0],a=o[1];s&&i.get_array(s).splice(r,1),a&&i.get_array(a).splice(r,1),t&&(i.change.emit(),i.properties.data.change.emit())}},t.prototype._pan_start=function(t){this._select_event(t,!0,[this.model.vertex_renderer]),this._basepoint=[t.sx,t.sy]},t.prototype._pan=function(t){null!=this._basepoint&&(this._drag_points(t,[this.model.vertex_renderer]),this._selected_renderer&&this._selected_renderer.data_source.change.emit())},t.prototype._pan_end=function(t){this.model.vertex_renderer.data_source.selected.indices=[],this._selected_renderer&&this._selected_renderer.data_source.properties.data.change.emit(),this._basepoint=null},t.prototype._keyup=function(t){if(this.model.active&&this._mouse_in_frame){var e;e=this._selected_renderer?[this.model.vertex_renderer]:this.model.renderers;for(var i=0,n=e;i<n.length;i++){var r=n[i];if(t.keyCode===s.Keys.Backspace)this._delete_selected(r);else if(t.keyCode==s.Keys.Esc){this._drawing&&(this._remove_vertex(),this._drawing=!1);var o=r.data_source;o.selection_manager.clear()}}}},t.prototype.deactivate=function(){if(this._selected_renderer){this._drawing&&(this._remove_vertex(!1),this._drawing=!1);var t=this.model.vertex_renderer,e=t.data_source,i=t.glyph,n=[i.x.field,i.y.field],r=n[0],o=n[1];r&&(e.data[r]=[]),o&&(e.data[o]=[]),e.selection_manager.clear(),e.change.emit(),this._selected_renderer.data_source.change.emit(),e.properties.data.change.emit(),this._selected_renderer.data_source.properties.data.change.emit(),this._selected_renderer=null}},t}(o.EditToolView);i.PolyEditToolView=a;var l=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Poly Edit Tool\",e.icon=\"bk-tool-icon-poly-edit\",e.event_type=[\"tap\",\"pan\",\"move\"],e.default_order=4,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"PolyEditTool\",this.prototype.default_view=a,this.define({vertex_renderer:[r.Instance]})},t}(o.EditTool);(i.PolyEditTool=l).initClass()},function(t,e,i){var v=t(387),n=t(243),r=t(62),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v.__extends(e,t),e.prototype._compute_limits=function(t){var e=this.plot_model.frame,i=this.model.dimensions,n=this._base_point;if(\"center\"==this.model.origin){var r=n[0],o=n[1],s=t[0],a=t[1];n=[r-(s-r),o-(a-o)]}return this.model._get_dim_limits(n,t,e,i)},e.prototype._pan_start=function(t){var e=t.sx,i=t.sy;this._base_point=[e,i]},e.prototype._pan=function(t){var e=t.sx,i=t.sy,n=[e,i],r=this._compute_limits(n),o=r[0],s=r[1];if(this.model.overlay.update({left:o[0],right:o[1],top:s[0],bottom:s[1]}),this.model.select_every_mousemove){var a=t.shiftKey;this._do_select(o,s,!1,a)}},e.prototype._pan_end=function(t){var e=t.sx,i=t.sy,n=[e,i],r=this._compute_limits(n),o=r[0],s=r[1],a=t.shiftKey;this._do_select(o,s,!0,a),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null,this.plot_view.push_state(\"box_select\",{selection:this.plot_view.get_selection()})},e.prototype._do_select=function(t,e,i,n){var r=t[0],o=t[1],s=e[0],a=e[1];void 0===n&&(n=!1);var l={type:\"rect\",sx0:r,sx1:o,sy0:s,sy1:a};this._select(l,i,n)},e.prototype._emit_callback=function(t){var e=this.computed_renderers[0],i=this.plot_model.frame,n=i.xscales[e.x_range_name],r=i.yscales[e.y_range_name],o=t.sx0,s=t.sx1,a=t.sy0,l=t.sy1,h=n.r_invert(o,s),c=h[0],u=h[1],_=r.r_invert(a,l),p=_[0],d=_[1],f=v.__assign({x0:c,y0:p,x1:u,y1:d},t);this.model.callback.execute(this.model,{geometry:f})},e}(n.SelectToolView);i.BoxSelectToolView=s;var a=function(){return new r.BoxAnnotation({level:\"overlay\",render_mode:\"css\",top_units:\"screen\",left_units:\"screen\",bottom_units:\"screen\",right_units:\"screen\",fill_color:{value:\"lightgrey\"},fill_alpha:{value:.5},line_color:{value:\"black\"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})},l=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Box Select\",e.icon=\"bk-tool-icon-box-select\",e.event_type=\"pan\",e.default_order=30,e}return v.__extends(t,i),t.initClass=function(){this.prototype.type=\"BoxSelectTool\",this.prototype.default_view=s,this.define({dimensions:[o.Dimensions,\"both\"],select_every_mousemove:[o.Bool,!1],callback:[o.Instance],overlay:[o.Instance,a],origin:[o.String,\"corner\"]})},Object.defineProperty(t.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),t}(n.SelectTool);(i.BoxSelectTool=l).initClass()},function(t,e,i){var n=t(387),r=t(238),o=t(62),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._match_aspect=function(t,e,i){var n,r,o,s,a=i.bbox.aspect,l=i.bbox.h_range.end,h=i.bbox.h_range.start,c=i.bbox.v_range.end,u=i.bbox.v_range.start,_=Math.abs(t[0]-e[0]),p=Math.abs(t[1]-e[1]),d=0==p?0:_/p,f=(a<=d?[1,d/a]:[a/d,1])[0];return t[0]<=e[0]?(n=t[0],r=t[0]+_*f,l<r&&(r=l)):(r=t[0],(n=t[0]-_*f)<h&&(n=h)),_=Math.abs(r-n),t[1]<=e[1]?(s=t[1],o=t[1]+_/a,c<o&&(o=c)):(o=t[1],(s=t[1]-_/a)<u&&(s=u)),p=Math.abs(o-s),t[0]<=e[0]?r=t[0]+a*p:n=t[0]-a*p,[[n,r],[s,o]]},e.prototype._compute_limits=function(t){var e,i,n,r,o=this.plot_model.frame,s=this.model.dimensions,a=this._base_point;if(\"center\"==this.model.origin){var l=a[0],h=a[1],c=t[0],u=t[1];a=[l-(c-l),h-(u-h)]}return this.model.match_aspect&&\"both\"==s?(e=this._match_aspect(a,t,o),n=e[0],r=e[1]):(i=this.model._get_dim_limits(a,t,o,s),n=i[0],r=i[1]),[n,r]},e.prototype._pan_start=function(t){this._base_point=[t.sx,t.sy]},e.prototype._pan=function(t){var e=[t.sx,t.sy],i=this._compute_limits(e),n=i[0],r=i[1];this.model.overlay.update({left:n[0],right:n[1],top:r[0],bottom:r[1]})},e.prototype._pan_end=function(t){var e=[t.sx,t.sy],i=this._compute_limits(e),n=i[0],r=i[1];this._update(n,r),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null},e.prototype._update=function(t,e){var i=t[0],n=t[1],r=e[0],o=e[1];if(!(Math.abs(n-i)<=5||Math.abs(o-r)<=5)){var s=this.plot_model.frame,a=s.xscales,l=s.yscales,h={};for(var c in a){var u=a[c],_=u.r_invert(i,n),p=_[0],d=_[1];h[c]={start:p,end:d}}var f={};for(var v in l){var u=l[v],m=u.r_invert(r,o),p=m[0],d=m[1];f[v]={start:p,end:d}}var g={xrs:h,yrs:f};this.plot_view.push_state(\"box_zoom\",{range:g}),this.plot_view.update_range(g)}},e}(r.GestureToolView);i.BoxZoomToolView=a;var l=function(){return new o.BoxAnnotation({level:\"overlay\",render_mode:\"css\",top_units:\"screen\",left_units:\"screen\",bottom_units:\"screen\",right_units:\"screen\",fill_color:{value:\"lightgrey\"},fill_alpha:{value:.5},line_color:{value:\"black\"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})},h=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Box Zoom\",e.icon=\"bk-tool-icon-box-zoom\",e.event_type=\"pan\",e.default_order=20,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"BoxZoomTool\",this.prototype.default_view=a,this.define({dimensions:[s.Dimensions,\"both\"],overlay:[s.Instance,l],match_aspect:[s.Bool,!1],origin:[s.String,\"corner\"]})},Object.defineProperty(t.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),t}(r.GestureTool);(i.BoxZoomTool=h).initClass()},function(t,e,i){var n=t(387),r=t(230),o=t(252),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.ButtonToolView);i.GestureToolView=s;var a=function(i){function t(t){var e=i.call(this,t)||this;return e.button_view=o.OnOffButtonView,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"GestureTool\"},t}(r.ButtonTool);(i.GestureTool=a).initClass()},function(t,e,i){var l=t(387),n=t(243),r=t(69),o=t(5),s=t(15),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.data=null},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){return t._active_change()})},t.prototype._active_change=function(){this.model.active||this._clear_overlay()},t.prototype._keyup=function(t){t.keyCode==o.Keys.Enter&&this._clear_overlay()},t.prototype._pan_start=function(t){var e=t.sx,i=t.sy;this.data={sx:[e],sy:[i]}},t.prototype._pan=function(t){var e=t.sx,i=t.sy,n=this.plot_model.frame.bbox.clip(e,i),r=n[0],o=n[1];this.data.sx.push(r),this.data.sy.push(o);var s=this.model.overlay;if(s.update({xs:this.data.sx,ys:this.data.sy}),this.model.select_every_mousemove){var a=t.shiftKey;this._do_select(this.data.sx,this.data.sy,!1,a)}},t.prototype._pan_end=function(t){this._clear_overlay();var e=t.shiftKey;this._do_select(this.data.sx,this.data.sy,!0,e),this.plot_view.push_state(\"lasso_select\",{selection:this.plot_view.get_selection()})},t.prototype._clear_overlay=function(){this.model.overlay.update({xs:[],ys:[]})},t.prototype._do_select=function(t,e,i,n){var r={type:\"poly\",sx:t,sy:e};this._select(r,i,n)},t.prototype._emit_callback=function(t){var e=this.computed_renderers[0],i=this.plot_model.frame,n=i.xscales[e.x_range_name],r=i.yscales[e.y_range_name],o=n.v_invert(t.sx),s=r.v_invert(t.sy),a=l.__assign({x:o,y:s},t);this.model.callback.execute(this.model,{geometry:a})},t}(n.SelectToolView);i.LassoSelectToolView=a;var h=function(){return new r.PolyAnnotation({level:\"overlay\",xs_units:\"screen\",ys_units:\"screen\",fill_color:{value:\"lightgrey\"},fill_alpha:{value:.5},line_color:{value:\"black\"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})},c=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Lasso Select\",e.icon=\"bk-tool-icon-lasso-select\",e.event_type=\"pan\",e.default_order=12,e}return l.__extends(t,i),t.initClass=function(){this.prototype.type=\"LassoSelectTool\",this.prototype.default_view=a,this.define({select_every_mousemove:[s.Bool,!0],callback:[s.Instance],overlay:[s.Instance,h]})},t}(n.SelectTool);(i.LassoSelectTool=c).initClass()},function(t,e,i){var n=t(387),r=t(238),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._pan_start=function(t){this.last_dx=0,this.last_dy=0;var e=t.sx,i=t.sy,n=this.plot_model.frame.bbox;if(!n.contains(e,i)){var r=n.h_range,o=n.v_range;(e<r.start||e>r.end)&&(this.v_axis_only=!0),(i<o.start||i>o.end)&&(this.h_axis_only=!0)}null!=this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e.prototype._pan=function(t){this._update(t.deltaX,t.deltaY),null!=this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e.prototype._pan_end=function(t){this.h_axis_only=!1,this.v_axis_only=!1,null!=this.pan_info&&this.plot_view.push_state(\"pan\",{range:this.pan_info})},e.prototype._update=function(t,e){var i,n,r,o,s,a,l=this.plot_model.frame,h=t-this.last_dx,c=e-this.last_dy,u=l.bbox.h_range,_=u.start-h,p=u.end-h,d=l.bbox.v_range,f=d.start-c,v=d.end-c,m=this.model.dimensions;\"width\"!=m&&\"both\"!=m||this.v_axis_only?(i=u.start,n=u.end,r=0):(i=_,n=p,r=-h),\"height\"!=m&&\"both\"!=m||this.h_axis_only?(o=d.start,s=d.end,a=0):(o=f,s=v,a=-c),this.last_dx=t,this.last_dy=e;var g=l.xscales,y=l.yscales,b={};for(var x in g){var w=g[x],k=w.r_invert(i,n),S=k[0],T=k[1];b[x]={start:S,end:T}}var C={};for(var A in y){var w=y[A],E=w.r_invert(o,s),S=E[0],T=E[1];C[A]={start:S,end:T}}this.pan_info={xrs:b,yrs:C,sdx:r,sdy:a},this.plot_view.update_range(this.pan_info,!0)},e}(r.GestureToolView);i.PanToolView=s;var a=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Pan\",e.event_type=\"pan\",e.default_order=10,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"PanTool\",this.prototype.default_view=s,this.define({dimensions:[o.Dimensions,\"both\"]})},Object.defineProperty(t.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(\"Pan\",this.dimensions)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"icon\",{get:function(){switch(this.dimensions){case\"both\":return\"bk-tool-icon-pan\";case\"width\":return\"bk-tool-icon-xpan\";case\"height\":return\"bk-tool-icon-ypan\"}},enumerable:!0,configurable:!0}),t}(r.GestureTool);(i.PanTool=a).initClass()},function(t,e,i){var l=t(387),n=t(243),r=t(69),o=t(5),s=t(15),a=t(21),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.data={sx:[],sy:[]}},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){return t._active_change()})},t.prototype._active_change=function(){this.model.active||this._clear_data()},t.prototype._keyup=function(t){t.keyCode==o.Keys.Enter&&this._clear_data()},t.prototype._doubletap=function(t){var e=t.shiftKey;this._do_select(this.data.sx,this.data.sy,!0,e),this.plot_view.push_state(\"poly_select\",{selection:this.plot_view.get_selection()}),this._clear_data()},t.prototype._clear_data=function(){this.data={sx:[],sy:[]},this.model.overlay.update({xs:[],ys:[]})},t.prototype._tap=function(t){var e=t.sx,i=t.sy,n=this.plot_model.frame;n.bbox.contains(e,i)&&(this.data.sx.push(e),this.data.sy.push(i),this.model.overlay.update({xs:a.copy(this.data.sx),ys:a.copy(this.data.sy)}))},t.prototype._do_select=function(t,e,i,n){var r={type:\"poly\",sx:t,sy:e};this._select(r,i,n)},t.prototype._emit_callback=function(t){var e=this.computed_renderers[0],i=this.plot_model.frame,n=i.xscales[e.x_range_name],r=i.yscales[e.y_range_name],o=n.v_invert(t.sx),s=r.v_invert(t.sy),a=l.__assign({x:o,y:s},t);this.model.callback.execute(this.model,{geometry:a})},t}(n.SelectToolView);i.PolySelectToolView=h;var c=function(){return new r.PolyAnnotation({level:\"overlay\",xs_units:\"screen\",ys_units:\"screen\",fill_color:{value:\"lightgrey\"},fill_alpha:{value:.5},line_color:{value:\"black\"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})},u=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Poly Select\",e.icon=\"bk-tool-icon-polygon-select\",e.event_type=\"tap\",e.default_order=11,e}return l.__extends(t,i),t.initClass=function(){this.prototype.type=\"PolySelectTool\",this.prototype.default_view=h,this.define({callback:[s.Instance],overlay:[s.Instance,c]})},t}(n.SelectTool);(i.PolySelectTool=u).initClass()},function(t,e,i){var n=t(387),_=t(62),r=t(14),o=t(15),s=t(238);function p(t,e,i,n){if(null==e)return!1;var r=i.compute(e);return Math.abs(t-r)<n}function d(t,e,i,n,r){var o=!0;if(null!=r.left&&null!=r.right){var s=i.invert(t);(s<r.left||s>r.right)&&(o=!1)}if(null!=r.bottom&&null!=r.top){var a=n.invert(e);(a<r.bottom||a>r.top)&&(o=!1)}return o}function l(t,e,i,n){var r=e.compute(t),o=e.invert(r+i);return o>=n.start&&o<=n.end?o:t}function h(t,e,i,n){var r=e.r_compute(t.start,t.end),o=r[0],s=r[1],a=e.r_invert(o+i,s+i),l=a[0],h=a[1];l>=n.start&&l<=n.end&&h>=n.start&&h<=n.end&&(t.start=l,t.end=h)}i.is_near=p,i.is_inside=d,i.compute_value=l,i.update_range=h;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.side=0,this.model.update_overlay_from_ranges()},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),null!=this.model.x_range&&this.connect(this.model.x_range.change,function(){return t.model.update_overlay_from_ranges()}),null!=this.model.y_range&&this.connect(this.model.y_range.change,function(){return t.model.update_overlay_from_ranges()})},t.prototype._pan_start=function(t){this.last_dx=0,this.last_dy=0;var e=this.model.x_range,i=this.model.y_range,n=this.plot_model.frame,r=n.xscales.default,o=n.yscales.default,s=this.model.overlay,a=s.left,l=s.right,h=s.top,c=s.bottom,u=this.model.overlay.properties.line_width.value()+_.EDGE_TOLERANCE;null!=e&&this.model.x_interaction&&(p(t.sx,a,r,u)?this.side=1:p(t.sx,l,r,u)?this.side=2:d(t.sx,t.sy,r,o,s)&&(this.side=3)),null!=i&&this.model.y_interaction&&(0==this.side&&p(t.sy,c,o,u)&&(this.side=4),0==this.side&&p(t.sy,h,o,u)?this.side=5:d(t.sx,t.sy,r,o,this.model.overlay)&&(3==this.side?this.side=7:this.side=6))},t.prototype._pan=function(t){var e=this.plot_model.frame,i=t.deltaX-this.last_dx,n=t.deltaY-this.last_dy,r=this.model.x_range,o=this.model.y_range,s=e.xscales.default,a=e.yscales.default;null!=r&&(3==this.side||7==this.side?h(r,s,i,e.x_range):1==this.side?r.start=l(r.start,s,i,e.x_range):2==this.side&&(r.end=l(r.end,s,i,e.x_range))),null!=o&&(6==this.side||7==this.side?h(o,a,n,e.y_range):4==this.side?o.start=l(o.start,a,n,e.y_range):5==this.side&&(o.end=l(o.end,a,n,e.y_range))),this.last_dx=t.deltaX,this.last_dy=t.deltaY},t.prototype._pan_end=function(t){this.side=0},t}(s.GestureToolView);i.RangeToolView=a;var c=function(){return new _.BoxAnnotation({level:\"overlay\",render_mode:\"css\",fill_color:\"lightgrey\",fill_alpha:{value:.5},line_color:{value:\"black\"},line_alpha:{value:1},line_width:{value:.5},line_dash:[2,2]})},u=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Range Tool\",e.icon=\"bk-tool-icon-range\",e.event_type=\"pan\",e.default_order=1,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"RangeTool\",this.prototype.default_view=a,this.define({x_range:[o.Instance,null],x_interaction:[o.Bool,!0],y_range:[o.Instance,null],y_interaction:[o.Bool,!0],overlay:[o.Instance,c]})},t.prototype.initialize=function(){i.prototype.initialize.call(this),this.overlay.in_cursor=\"grab\",this.overlay.ew_cursor=null!=this.x_range&&this.x_interaction?\"ew-resize\":null,this.overlay.ns_cursor=null!=this.y_range&&this.y_interaction?\"ns-resize\":null},t.prototype.update_overlay_from_ranges=function(){null==this.x_range&&null==this.y_range&&(this.overlay.left=null,this.overlay.right=null,this.overlay.bottom=null,this.overlay.top=null,r.logger.warn(\"RangeTool not configured with any Ranges.\")),null==this.x_range?(this.overlay.left=null,this.overlay.right=null):(this.overlay.left=this.x_range.start,this.overlay.right=this.x_range.end),null==this.y_range?(this.overlay.bottom=null,this.overlay.top=null):(this.overlay.bottom=this.y_range.start,this.overlay.top=this.y_range.end)},t}(s.GestureTool);(i.RangeTool=u).initClass()},function(t,e,i){var y=t(387),n=t(238),o=t(176),r=t(258),s=t(15),a=t(5),b=t(3),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y.__extends(e,t),Object.defineProperty(e.prototype,\"computed_renderers\",{get:function(){var t=this.model.renderers,e=this.plot_model.plot.renderers,i=this.model.names;return r.compute_renderers(t,e,i)},enumerable:!0,configurable:!0}),e.prototype._computed_renderers_by_data_source=function(){for(var t={},e=0,i=this.computed_renderers;e<i.length;e++){var n=i[e],r=void 0;(r=n instanceof o.GraphRenderer?n.node_renderer.data_source.id:n.data_source.id)in t||(t[r]=[]),t[r].push(n)}return t},e.prototype._keyup=function(t){if(t.keyCode==a.Keys.Esc)for(var e=0,i=this.computed_renderers;e<i.length;e++){var n=i[e],r=n.data_source,o=r.selection_manager;o.clear()}},e.prototype._select=function(t,e,i){var n=this._computed_renderers_by_data_source();for(var r in n){for(var o=n[r],s=o[0].get_selection_manager(),a=[],l=0,h=o;l<h.length;l++){var c=h[l];c.id in this.plot_view.renderer_views&&a.push(this.plot_view.renderer_views[c.id])}s.select(a,t,e,i)}null!=this.model.callback&&this._emit_callback(t),this._emit_selection_event(t,e)},e.prototype._emit_selection_event=function(t,e){void 0===e&&(e=!0);var i,n=this.plot_model.frame.xscales.default,r=this.plot_model.frame.yscales.default;switch(t.type){case\"point\":var o=t.sx,s=t.sy,a=n.invert(o),l=r.invert(s);i=y.__assign({},t,{x:a,y:l});break;case\"rect\":var h=t.sx0,c=t.sx1,u=t.sy0,_=t.sy1,p=n.r_invert(h,c),d=p[0],f=p[1],v=r.r_invert(u,_),m=v[0],g=v[1];i=y.__assign({},t,{x0:d,y0:m,x1:f,y1:g});break;case\"poly\":var o=t.sx,s=t.sy,a=n.v_invert(o),l=r.v_invert(s);i=y.__assign({},t,{x:a,y:l});break;default:throw new Error(\"Unrecognized selection geometry type: '\"+t.type+\"'\")}this.plot_model.plot.trigger_event(new b.SelectionGeometry({geometry:i,final:e}))},e}(n.GestureToolView);i.SelectToolView=l;var h=function(e){function t(t){return e.call(this,t)||this}return y.__extends(t,e),t.initClass=function(){this.prototype.type=\"SelectTool\",this.define({renderers:[s.Any,\"auto\"],names:[s.Array,[]]})},t}(n.GestureTool);(i.SelectTool=h).initClass()},function(t,e,i){var n=t(387),r=t(243),o=t(15),f=t(44),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._tap=function(t){var e=t.sx,i=t.sy,n={type:\"point\",sx:e,sy:i},r=t.shiftKey;this._select(n,!0,r)},e.prototype._select=function(t,e,i){var n=this,r=this.model.callback,o={geometries:t,source:null};if(\"select\"==this.model.behavior){var s=this._computed_renderers_by_data_source();for(var a in s){var l=s[a],h=l[0].get_selection_manager(),c=l.map(function(t){return n.plot_view.renderer_views[t.id]}),u=h.select(c,t,e,i);u&&null!=r&&(o.source=h.source,f.isFunction(r)?r(this,o):r.execute(this,o))}this._emit_selection_event(t),this.plot_view.push_state(\"tap\",{selection:this.plot_view.get_selection()})}else for(var _=0,p=this.computed_renderers;_<p.length;_++){var d=p[_],h=d.get_selection_manager(),u=h.inspect(this.plot_view.renderer_views[d.id],t);u&&null!=r&&(o.source=h.source,f.isFunction(r)?r(this,o):r.execute(this,o))}},e}(r.SelectToolView);i.TapToolView=s;var a=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Tap\",e.icon=\"bk-tool-icon-tap-select\",e.event_type=\"tap\",e.default_order=10,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"TapTool\",this.prototype.default_view=s,this.define({behavior:[o.String,\"select\"],callback:[o.Any]})},t}(r.SelectTool);(i.TapTool=a).initClass()},function(t,e,i){var n=t(387),r=t(238),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._scroll=function(t){var e=this.model.speed*t.delta;.9<e?e=.9:e<-.9&&(e=-.9),this._update_ranges(e)},e.prototype._update_ranges=function(t){var e,i,n,r,o=this.plot_model.frame,s=o.bbox.h_range,a=o.bbox.v_range,l=[s.start,s.end],h=l[0],c=l[1],u=[a.start,a.end],_=u[0],p=u[1];switch(this.model.dimension){case\"height\":var d=Math.abs(p-_);e=h,i=c,n=_-d*t,r=p-d*t;break;case\"width\":var f=Math.abs(c-h);e=h-f*t,i=c-f*t,n=_,r=p;break;default:throw new Error(\"this shouldn't have happened\")}var v=o.xscales,m=o.yscales,g={};for(var y in v){var b=v[y],x=b.r_invert(e,i),w=x[0],k=x[1];g[y]={start:w,end:k}}var S={};for(var T in m){var b=m[T],C=b.r_invert(n,r),w=C[0],k=C[1];S[T]={start:w,end:k}}var A={xrs:g,yrs:S,factor:t};this.plot_view.push_state(\"wheel_pan\",{range:A}),this.plot_view.update_range(A,!1,!0),null!=this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e}(r.GestureToolView);i.WheelPanToolView=s;var a=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Wheel Pan\",e.icon=\"bk-tool-icon-wheel-pan\",e.event_type=\"scroll\",e.default_order=12,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"WheelPanTool\",this.prototype.default_view=s,this.define({dimension:[o.Dimension,\"width\"]}),this.internal({speed:[o.Number,.001]})},Object.defineProperty(t.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimension)},enumerable:!0,configurable:!0}),t}(r.GestureTool);(i.WheelPanTool=a).initClass()},function(t,e,i){var n=t(387),r=t(238),u=t(46),o=t(15),s=t(20),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._pinch=function(t){var e,i=t.sx,n=t.sy,r=t.scale;e=1<=r?20*(r-1):-20/r,this._scroll({type:\"mousewheel\",sx:i,sy:n,delta:e})},e.prototype._scroll=function(t){var e=this.plot_model.frame,i=e.bbox.h_range,n=e.bbox.v_range,r=t.sx,o=t.sy,s=this.model.dimensions,a=(\"width\"==s||\"both\"==s)&&i.start<r&&r<i.end,l=(\"height\"==s||\"both\"==s)&&n.start<o&&o<n.end;if(a&&l||this.model.zoom_on_axis){var h=this.model.speed*t.delta,c=u.scale_range(e,h,a,l,{x:r,y:o});this.plot_view.push_state(\"wheel_zoom\",{range:c}),this.plot_view.update_range(c,!1,!0,this.model.maintain_focus),null!=this.model.document&&this.model.document.interactive_start(this.plot_model.plot)}},e}(r.GestureToolView);i.WheelZoomToolView=a;var l=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Wheel Zoom\",e.icon=\"bk-tool-icon-wheel-zoom\",e.event_type=s.is_mobile?\"pinch\":\"scroll\",e.default_order=10,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"WheelZoomTool\",this.prototype.default_view=a,this.define({dimensions:[o.Dimensions,\"both\"],maintain_focus:[o.Boolean,!0],zoom_on_axis:[o.Boolean,!0],speed:[o.Number,1/600]})},Object.defineProperty(t.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),t}(r.GestureTool);(i.WheelZoomTool=l).initClass()},function(t,e,i){var n=t(222);i.ActionTool=n.ActionTool;var r=t(223);i.HelpTool=r.HelpTool;var o=t(224);i.RedoTool=o.RedoTool;var s=t(225);i.ResetTool=s.ResetTool;var a=t(226);i.SaveTool=a.SaveTool;var l=t(227);i.UndoTool=l.UndoTool;var h=t(228);i.ZoomInTool=h.ZoomInTool;var c=t(229);i.ZoomOutTool=c.ZoomOutTool;var u=t(230);i.ButtonTool=u.ButtonTool;var _=t(232);i.EditTool=_.EditTool;var p=t(231);i.BoxEditTool=p.BoxEditTool;var d=t(233);i.PointDrawTool=d.PointDrawTool;var f=t(234);i.PolyDrawTool=f.PolyDrawTool;var v=t(235);i.PolyEditTool=v.PolyEditTool;var m=t(236);i.BoxSelectTool=m.BoxSelectTool;var g=t(237);i.BoxZoomTool=g.BoxZoomTool;var y=t(238);i.GestureTool=y.GestureTool;var b=t(239);i.LassoSelectTool=b.LassoSelectTool;var x=t(240);i.PanTool=x.PanTool;var w=t(241);i.PolySelectTool=w.PolySelectTool;var k=t(242);i.RangeTool=k.RangeTool;var S=t(243);i.SelectTool=S.SelectTool;var T=t(244);i.TapTool=T.TapTool;var C=t(245);i.WheelPanTool=C.WheelPanTool;var A=t(246);i.WheelZoomTool=A.WheelZoomTool;var E=t(248);i.CrosshairTool=E.CrosshairTool;var M=t(249);i.CustomJSHover=M.CustomJSHover;var O=t(250);i.HoverTool=O.HoverTool;var z=t(251);i.InspectTool=z.InspectTool;var P=t(253);i.Tool=P.Tool;var j=t(254);i.ToolProxy=j.ToolProxy;var N=t(255);i.Toolbar=N.Toolbar;var F=t(256);i.ToolbarBase=F.ToolbarBase;var D=t(257);i.ProxyToolbar=D.ProxyToolbar;var I=t(257);i.ToolbarBox=I.ToolbarBox},function(t,e,i){var n=t(387),r=t(251),o=t(71),s=t(15),a=t(32),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._move=function(t){if(this.model.active){var e=t.sx,i=t.sy;this.plot_model.frame.bbox.contains(e,i)?this._update_spans(e,i):this._update_spans(null,null)}},e.prototype._move_exit=function(t){this._update_spans(null,null)},e.prototype._update_spans=function(t,e){var i=this.model.dimensions;\"width\"!=i&&\"both\"!=i||(this.model.spans.width.computed_location=e),\"height\"!=i&&\"both\"!=i||(this.model.spans.height.computed_location=t)},e}(r.InspectToolView);i.CrosshairToolView=l;var h=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Crosshair\",e.icon=\"bk-tool-icon-crosshair\",e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"CrosshairTool\",this.prototype.default_view=l,this.define({dimensions:[s.Dimensions,\"both\"],line_color:[s.Color,\"black\"],line_width:[s.Number,1],line_alpha:[s.Number,1]}),this.internal({location_units:[s.SpatialUnits,\"screen\"],render_mode:[s.RenderMode,\"css\"],spans:[s.Any]})},Object.defineProperty(t.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(\"Crosshair\",this.dimensions)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"synthetic_renderers\",{get:function(){return a.values(this.spans)},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){i.prototype.initialize.call(this),this.spans={width:new o.Span({for_hover:!0,dimension:\"width\",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha}),height:new o.Span({for_hover:!0,dimension:\"height\",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha})}},t}(r.InspectTool);(i.CrosshairTool=h).initClass()},function(r,t,o){var i=r(387),e=r(57),n=r(15),s=r(32),a=r(38),l=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"CustomJSHover\",this.define({args:[n.Any,{}],code:[n.String,\"\"]})},Object.defineProperty(t.prototype,\"values\",{get:function(){return s.values(this.args)},enumerable:!0,configurable:!0}),t.prototype._make_code=function(t,e,i,n){return new(Function.bind.apply(Function,[void 0].concat(s.keys(this.args),[t,e,i,\"require\",\"exports\",a.use_strict(n)])))},t.prototype.format=function(t,e,i){var n=this._make_code(\"value\",\"format\",\"special_vars\",this.code);return n.apply(void 0,this.values.concat([t,e,i,r,o]))},t}(e.Model);(o.CustomJSHover=l).initClass()},function(t,e,i){var f=t(387),n=t(251),s=t(75),Z=t(175),tt=t(176),o=t(258),u=t(9),k=t(40),S=t(5),r=t(15),T=t(27),et=t(32),C=t(44),a=t(4);function it(t,e,i,n,r,o){var s,a,l={x:r[t],y:o[t]},h={x:r[t+1],y:o[t+1]};if(\"span\"==e.type)\"h\"==e.direction?(s=Math.abs(l.x-i),a=Math.abs(h.x-i)):(s=Math.abs(l.y-n),a=Math.abs(h.y-n));else{var c={x:i,y:n};s=u.dist_2_pts(l,c),a=u.dist_2_pts(h,c)}return s<a?[[l.x,l.y],t]:[[h.x,h.y],t+1]}function nt(t,e,i){return[[t[i],e[i]],i]}i._nearest_line_hit=it,i._line_hit=nt;var l=function(r){function t(){return null!==r&&r.apply(this,arguments)||this}return f.__extends(t,r),t.prototype.initialize=function(t){r.prototype.initialize.call(this,t),this.ttviews={}},t.prototype.remove=function(){a.remove_views(this.ttviews),r.prototype.remove.call(this)},t.prototype.connect_signals=function(){var t=this;r.prototype.connect_signals.call(this);for(var e=0,i=this.computed_renderers;e<i.length;e++){var n=i[e];n instanceof Z.GlyphRenderer?this.connect(n.data_source.inspect,this._update):(this.connect(n.node_renderer.data_source.inspect,this._update),this.connect(n.edge_renderer.data_source.inspect,this._update))}this.connect(this.model.properties.renderers.change,function(){return t._computed_renderers=t._ttmodels=null}),this.connect(this.model.properties.names.change,function(){return t._computed_renderers=t._ttmodels=null}),this.connect(this.model.properties.tooltips.change,function(){return t._ttmodels=null})},t.prototype._compute_ttmodels=function(){var t={},e=this.model.tooltips;if(null!=e)for(var i=0,n=this.computed_renderers;i<n.length;i++){var r=n[i];if(r instanceof Z.GlyphRenderer){var o=new s.Tooltip({custom:C.isString(e)||C.isFunction(e),attachment:this.model.attachment,show_arrow:this.model.show_arrow});t[r.id]=o}else{var o=new s.Tooltip({custom:C.isString(e)||C.isFunction(e),attachment:this.model.attachment,show_arrow:this.model.show_arrow});t[r.node_renderer.id]=o,t[r.edge_renderer.id]=o}}return a.build_views(this.ttviews,et.values(t),{parent:this,plot_view:this.plot_view}),t},Object.defineProperty(t.prototype,\"computed_renderers\",{get:function(){if(null==this._computed_renderers){var t=this.model.renderers,e=this.plot_model.plot.renderers,i=this.model.names;this._computed_renderers=o.compute_renderers(t,e,i)}return this._computed_renderers},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"ttmodels\",{get:function(){return null==this._ttmodels&&(this._ttmodels=this._compute_ttmodels()),this._ttmodels},enumerable:!0,configurable:!0}),t.prototype._clear=function(){for(var t in this._inspect(1/0,1/0),this.ttmodels){var e=this.ttmodels[t];e.clear()}},t.prototype._move=function(t){if(this.model.active){var e=t.sx,i=t.sy;this.plot_model.frame.bbox.contains(e,i)?this._inspect(e,i):this._clear()}},t.prototype._move_exit=function(){this._clear()},t.prototype._inspect=function(t,e){var i;if(\"mouse\"==this.model.mode)i={type:\"point\",sx:t,sy:e};else{var n=\"vline\"==this.model.mode?\"h\":\"v\";i={type:\"span\",direction:n,sx:t,sy:e}}for(var r=0,o=this.computed_renderers;r<o.length;r++){var s=o[r],a=s.get_selection_manager();a.inspect(this.plot_view.renderer_views[s.id],i)}null!=this.model.callback&&this._emit_callback(i)},t.prototype._update=function(t){var e,i,n,r,o,s,a,l,h,c,u,_,p,d,f,v,m=t[0],g=t[1].geometry;if(this.model.active&&(m instanceof Z.GlyphRendererView||m instanceof tt.GraphRendererView)){var y=m.model,b=this.ttmodels[y.id];if(null!=b){b.clear();var x=y.get_selection_manager(),w=x.inspectors[y.id];if(y instanceof Z.GlyphRenderer&&(w=y.view.convert_selection_to_subset(w)),!w.is_empty()){for(var k=x.source,S=this.plot_model.frame,T=g.sx,C=g.sy,A=S.xscales[y.x_range_name],E=S.yscales[y.y_range_name],M=A.invert(T),O=E.invert(C),z=m.glyph,P=0,j=w.line_indices;P<j.length;P++){var N=j[P],F=z._x[N+1],D=z._y[N+1],I=N,R=void 0,B=void 0;switch(this.model.line_policy){case\"interp\":e=z.get_interpolation_hit(N,g),F=e[0],D=e[1],R=A.compute(F),B=E.compute(D);break;case\"prev\":i=nt(z.sx,z.sy,N),n=i[0],R=n[0],B=n[1],I=i[1];break;case\"next\":r=nt(z.sx,z.sy,N+1),o=r[0],R=o[0],B=o[1],I=r[1];break;case\"nearest\":s=it(N,g,T,C,z.sx,z.sy),a=s[0],R=a[0],B=a[1],I=s[1],F=z._x[I],D=z._y[I];break;default:R=(l=[T,C])[0],B=l[1]}var L={index:I,x:M,y:O,sx:T,sy:C,data_x:F,data_y:D,rx:R,ry:B,indices:w.line_indices,name:m.model.name};b.add(R,B,this._render_tooltips(k,I,L))}for(var V=0,G=w.image_indices;V<G.length;V++){var U=G[V],L={index:U.index,x:M,y:O,sx:T,sy:C},q=this._render_tooltips(k,U,L);b.add(T,C,q)}for(var Y=0,X=w.indices;Y<X.length;Y++){var N=X[Y];if(et.isEmpty(w.multiline_indices)){var F=null!=z._x?z._x[N]:void 0,D=null!=z._y?z._y[N]:void 0,R=void 0,B=void 0;if(\"snap_to_data\"==this.model.point_policy){var H=z.get_anchor_point(this.model.anchor,N,[T,C]);null==H&&(H=z.get_anchor_point(\"center\",N,[T,C])),R=H.x,B=H.y}else R=(v=[T,C])[0],B=v[1];var W=void 0,L={index:W=y instanceof Z.GlyphRenderer?y.view.convert_indices_from_subset([N])[0]:N,x:M,y:O,sx:T,sy:C,data_x:F,data_y:D,indices:w.indices,name:m.model.name};b.add(R,B,this._render_tooltips(k,W,L))}else for(var J=0,Q=w.multiline_indices[N.toString()];J<Q.length;J++){var $=Q[J],F=z._xs[N][$],D=z._ys[N][$],K=$,R=void 0,B=void 0;switch(this.model.line_policy){case\"interp\":h=z.get_interpolation_hit(N,$,g),F=h[0],D=h[1],R=A.compute(F),B=E.compute(D);break;case\"prev\":c=nt(z.sxs[N],z.sys[N],$),u=c[0],R=u[0],B=u[1],K=c[1];break;case\"next\":_=nt(z.sxs[N],z.sys[N],$+1),p=_[0],R=p[0],B=p[1],K=_[1];break;case\"nearest\":d=it($,g,T,C,z.sxs[N],z.sys[N]),f=d[0],R=f[0],B=f[1],K=d[1],F=z._xs[N][K],D=z._ys[N][K];break;default:throw new Error(\"should't have happened\")}var W=void 0,L={index:W=y instanceof Z.GlyphRenderer?y.view.convert_indices_from_subset([N])[0]:N,segment_index:K,x:M,y:O,sx:T,sy:C,data_x:F,data_y:D,indices:w.multiline_indices,name:m.model.name};b.add(R,B,this._render_tooltips(k,W,L))}}}}}},t.prototype._emit_callback=function(t){for(var e=0,i=this.computed_renderers;e<i.length;e++){var n=i[e],r=n.data_source.inspected,o=this.plot_model.frame,s=o.xscales[n.x_range_name],a=o.yscales[n.y_range_name],l=s.invert(t.sx),h=a.invert(t.sy),c=f.__assign({x:l,y:h},t),u=this.model.callback,_=[u,{index:r,geometry:c,renderer:n}],p=_[0],d=_[1];C.isFunction(u)?u(p,d):u.execute(p,d)}},t.prototype._render_tooltips=function(t,e,i){var n=this.model.tooltips;if(C.isString(n)){var r=S.div();return r.innerHTML=k.replace_placeholders(n,t,e,this.model.formatters,i),r}if(C.isFunction(n))return n(t,i);for(var o=S.div({style:{display:\"table\",borderSpacing:\"2px\"}}),s=0,a=n;s<a.length;s++){var l=a[s],h=l[0],c=l[1],u=S.div({style:{display:\"table-row\"}});o.appendChild(u);var _=void 0;if(_=S.div({style:{display:\"table-cell\"},class:\"bk-tooltip-row-label\"},h+\": \"),u.appendChild(_),_=S.div({style:{display:\"table-cell\"},class:\"bk-tooltip-row-value\"}),u.appendChild(_),0<=c.indexOf(\"$color\")){var p=c.match(/\\$color(\\[.*\\])?:(\\w*)/),d=p[1],f=void 0===d?\"\":d,v=p[2],m=t.get_column(v);if(null==m){var g=S.span({},v+\" unknown\");_.appendChild(g);continue}var y=0<=f.indexOf(\"hex\"),b=0<=f.indexOf(\"swatch\"),x=C.isNumber(e)?m[e]:null;if(null==x){var w=S.span({},\"(null)\");_.appendChild(w);continue}y&&(x=T.color2hex(x));var r=S.span({},x);_.appendChild(r),b&&(r=S.span({class:\"bk-tooltip-color-block\",style:{backgroundColor:x}},\" \"),_.appendChild(r))}else{var r=S.span();r.innerHTML=k.replace_placeholders(c.replace(\"$~\",\"$data_\"),t,e,this.model.formatters,i),_.appendChild(r)}}return o},t}(n.InspectToolView);i.HoverToolView=l;var h=function(i){function t(t){var e=i.call(this,t)||this;return e.tool_name=\"Hover\",e.icon=\"bk-tool-icon-hover\",e}return f.__extends(t,i),t.initClass=function(){this.prototype.type=\"HoverTool\",this.prototype.default_view=l,this.define({tooltips:[r.Any,[[\"index\",\"$index\"],[\"data (x, y)\",\"($x, $y)\"],[\"screen (x, y)\",\"($sx, $sy)\"]]],formatters:[r.Any,{}],renderers:[r.Any,\"auto\"],names:[r.Array,[]],mode:[r.String,\"mouse\"],point_policy:[r.String,\"snap_to_data\"],line_policy:[r.String,\"nearest\"],show_arrow:[r.Boolean,!0],anchor:[r.String,\"center\"],attachment:[r.String,\"horizontal\"],callback:[r.Any]})},t}(n.InspectTool);(i.HoverTool=h).initClass()},function(t,e,i){var n=t(387),r=t(230),o=t(252),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.ButtonToolView);i.InspectToolView=a;var l=function(i){function t(t){var e=i.call(this,t)||this;return e.event_type=\"move\",e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"InspectTool\",this.prototype.button_view=o.OnOffButtonView,this.define({toggleable:[s.Bool,!0]}),this.override({active:!0})},t}(r.ButtonTool);(i.InspectTool=l).initClass()},function(t,e,i){var n=t(387),r=t(230),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.model.active?this.el.classList.add(\"bk-active\"):this.el.classList.remove(\"bk-active\")},e.prototype._clicked=function(){var t=this.model.active;this.model.active=!t},e}(r.ButtonToolButtonView);i.OnOffButtonView=o},function(t,e,i){var n=t(387),r=t(15),o=t(48),_=t(21),s=t(57),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.plot_view=t.plot_view},Object.defineProperty(t.prototype,\"plot_model\",{get:function(){return this.plot_view.model},enumerable:!0,configurable:!0}),t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){t.model.active?t.activate():t.deactivate()})},t.prototype.activate=function(){},t.prototype.deactivate=function(){},t}(o.View);i.ToolView=a;var l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Tool\",this.internal({active:[r.Boolean,!1]})},Object.defineProperty(t.prototype,\"synthetic_renderers\",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype._get_dim_tooltip=function(t,e){switch(e){case\"width\":return t+\" (x-axis)\";case\"height\":return t+\" (y-axis)\";case\"both\":return t}},t.prototype._get_dim_limits=function(t,e,i,n){var r,o=t[0],s=t[1],a=e[0],l=e[1],h=i.bbox.h_range;\"width\"==n||\"both\"==n?(r=[_.min([o,a]),_.max([o,a])],r=[_.max([r[0],h.start]),_.min([r[1],h.end])]):r=[h.start,h.end];var c,u=i.bbox.v_range;return\"height\"==n||\"both\"==n?(c=[_.min([s,l]),_.max([s,l])],c=[_.max([c[0],u.start]),_.min([c[1],u.end])]):c=[u.start,u.end],[r,c]},t}(s.Model);(i.Tool=l).initClass()},function(t,e,i){var n=t(387),r=t(15),o=t(19),s=t(57),a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ToolProxy\",this.define({tools:[r.Array,[]],active:[r.Bool,!1],disabled:[r.Bool,!1]})},Object.defineProperty(t.prototype,\"button_view\",{get:function(){return this.tools[0].button_view},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"event_type\",{get:function(){return this.tools[0].event_type},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"tooltip\",{get:function(){return this.tools[0].tool_name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"tool_name\",{get:function(){return this.tools[0].tool_name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"icon\",{get:function(){return this.tools[0].icon},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.do=new o.Signal0(this,\"do\")},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.do,function(){return t.doit()}),this.connect(this.properties.active.change,function(){return t.set_active()})},t.prototype.doit=function(){for(var t=0,e=this.tools;t<e.length;t++){var i=e[t];i.do.emit()}},t.prototype.set_active=function(){for(var t=0,e=this.tools;t<e.length;t++){var i=e[t];i.active=this.active}},t}(s.Model);(i.ToolProxy=a).initClass()},function(t,e,i){var n=t(387),r=t(15),v=t(14),m=t(44),g=t(21),y=t(222),b=t(223),x=t(238),w=t(251),o=t(256),s=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Toolbar\",this.prototype.default_view=o.ToolbarBaseView,this.define({active_drag:[r.Any,\"auto\"],active_inspect:[r.Any,\"auto\"],active_scroll:[r.Any,\"auto\"],active_tap:[r.Any,\"auto\"],active_multi:[r.Any,null]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),this._init_tools()},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.properties.tools.change,function(){return t._init_tools()})},t.prototype._init_tools=function(){for(var e=this,t=function(e){if(e instanceof w.InspectTool)g.any(s.inspectors,function(t){return t.id==e.id})||(s.inspectors=s.inspectors.concat([e]));else if(e instanceof b.HelpTool)g.any(s.help,function(t){return t.id==e.id})||(s.help=s.help.concat([e]));else if(e instanceof y.ActionTool)g.any(s.actions,function(t){return t.id==e.id})||(s.actions=s.actions.concat([e]));else if(e instanceof x.GestureTool){var t=void 0,i=void 0;m.isString(e.event_type)?(t=[e.event_type],i=!1):(t=e.event_type||[],i=!0);for(var n=0,r=t;n<r.length;n++){var o=r[n];o in s.gestures?(i&&(o=\"multi\"),g.any(s.gestures[o].tools,function(t){return t.id==e.id})||(s.gestures[o].tools=s.gestures[o].tools.concat([e])),s.connect(e.properties.active.change,s._active_change.bind(s,e))):v.logger.warn(\"Toolbar: unknown event type '\"+o+\"' for tool: \"+e.type+\" (\"+e.id+\")\")}}},s=this,i=0,n=this.tools;i<n.length;i++){var r=n[i];t(r)}if(\"auto\"==this.active_inspect);else if(this.active_inspect instanceof w.InspectTool)for(var o=0,a=this.inspectors;o<a.length;o++){var l=a[o];l!=this.active_inspect&&(l.active=!1)}else if(m.isArray(this.active_inspect))for(var h=0,c=this.inspectors;h<c.length;h++){var l=c[h];g.includes(this.active_inspect,l)||(l.active=!1)}else if(null==this.active_inspect)for(var u=0,_=this.inspectors;u<_.length;u++){var l=_[u];l.active=!1}var p=function(t){t.active?e._active_change(t):t.active=!0};for(var d in this.gestures){var f=this.gestures[d];if(0!=f.tools.length){if(f.tools=g.sortBy(f.tools,function(t){return t.default_order}),\"tap\"==d){if(null==this.active_tap)continue;\"auto\"==this.active_tap?p(f.tools[0]):p(this.active_tap)}if(\"pan\"==d){if(null==this.active_drag)continue;\"auto\"==this.active_drag?p(f.tools[0]):p(this.active_drag)}if(\"pinch\"==d||\"scroll\"==d){if(null==this.active_scroll||\"auto\"==this.active_scroll)continue;p(this.active_scroll)}null!=this.active_multi&&p(this.active_multi)}}},t}(o.ToolbarBase);(i.Toolbar=s).initClass()},function(t,e,i){var n=t(387),a=t(14),u=t(5),r=t(4),o=t(15),s=t(6),l=t(44),h=t(57),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this._tool_button_views={},this._build_tool_button_views()},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.properties.tools.change,function(){return t._build_tool_button_views()})},t.prototype.remove=function(){r.remove_views(this._tool_button_views),e.prototype.remove.call(this)},t.prototype._build_tool_button_views=function(){var t=null!=this.model._proxied_tools?this.model._proxied_tools:this.model.tools;r.build_views(this._tool_button_views,t,{parent:this},function(t){return t.button_view})},t.prototype.render=function(){var e=this;if(u.empty(this.el),this.el.classList.add(\"bk-toolbar\"),this.el.classList.add(\"bk-toolbar-\"+this.model.toolbar_location),null!=this.model.logo){var t=\"grey\"===this.model.logo?\"bk-grey\":null,i=u.a({href:\"https://bokeh.pydata.org/\",target:\"_blank\",class:[\"bk-logo\",\"bk-logo-small\",t]});this.el.appendChild(i)}var n=[],r=function(t){return e._tool_button_views[t.id].el},o=this.model.gestures;for(var s in o)n.push(o[s].tools.map(r));n.push(this.model.actions.map(r)),n.push(this.model.inspectors.filter(function(t){return t.toggleable}).map(r)),n.push(this.model.help.map(r));for(var a=0,l=n;a<l.length;a++){var h=l[a];if(0!==h.length){var c=u.div({class:\"bk-button-bar\"},h);this.el.appendChild(c)}}},t}(s.DOMView);i.ToolbarBaseView=c;var _=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ToolbarBase\",this.prototype.default_view=c,this.define({tools:[o.Array,[]],logo:[o.String,\"normal\"]}),this.internal({gestures:[o.Any,function(){return{pan:{tools:[],active:null},scroll:{tools:[],active:null},pinch:{tools:[],active:null},tap:{tools:[],active:null},doubletap:{tools:[],active:null},press:{tools:[],active:null},rotate:{tools:[],active:null},move:{tools:[],active:null},multi:{tools:[],active:null}}}],actions:[o.Array,[]],inspectors:[o.Array,[]],help:[o.Array,[]],toolbar_location:[o.Location,\"right\"]})},Object.defineProperty(t.prototype,\"horizontal\",{get:function(){return\"above\"===this.toolbar_location||\"below\"===this.toolbar_location},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"vertical\",{get:function(){return\"left\"===this.toolbar_location||\"right\"===this.toolbar_location},enumerable:!0,configurable:!0}),t.prototype._active_change=function(t){var e=t.event_type;if(null!=e)for(var i=l.isString(e)?[e]:e,n=0,r=i;n<r.length;n++){var o=r[n];if(t.active){var s=this.gestures[o].active;null!=s&&t!=s&&(a.logger.debug(\"Toolbar: deactivating tool: \"+s.type+\" (\"+s.id+\") for event type '\"+o+\"'\"),s.active=!1),this.gestures[o].active=t,a.logger.debug(\"Toolbar: activating tool: \"+t.type+\" (\"+t.id+\") for event type '\"+o+\"'\")}else this.gestures[o].active=null}},t}(h.Model);(i.ToolbarBase=_).initClass()},function(t,e,i){var n=t(387),r=t(15),o=t(5),a=t(14),l=t(44),S=t(21),h=t(222),c=t(223),u=t(238),_=t(251),s=t(256),T=t(254),p=t(152),d=t(4),f=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ProxyToolbar\"},t.prototype.initialize=function(){e.prototype.initialize.call(this),this._init_tools(),this._merge_tools()},t.prototype._init_tools=function(){for(var t=function(e){if(e instanceof _.InspectTool)S.any(s.inspectors,function(t){return t.id==e.id})||(s.inspectors=s.inspectors.concat([e]));else if(e instanceof c.HelpTool)S.any(s.help,function(t){return t.id==e.id})||(s.help=s.help.concat([e]));else if(e instanceof h.ActionTool)S.any(s.actions,function(t){return t.id==e.id})||(s.actions=s.actions.concat([e]));else if(e instanceof u.GestureTool){var t=void 0,i=void 0;l.isString(e.event_type)?(t=[e.event_type],i=!1):(t=e.event_type||[],i=!0);for(var n=0,r=t;n<r.length;n++){var o=r[n];o in s.gestures?(i&&(o=\"multi\"),S.any(s.gestures[o].tools,function(t){return t.id==e.id})||(s.gestures[o].tools=s.gestures[o].tools.concat([e]))):a.logger.warn(\"Toolbar: unknown event type '\"+o+\"' for tool: \"+e.type+\" (\"+e.id+\")\")}}},s=this,e=0,i=this.tools;e<i.length;e++){var n=i[e];t(n)}},t.prototype._merge_tools=function(){var t,n=this;this._proxied_tools=[];for(var e={},i={},r={},o=[],s=[],a=0,l=this.help;a<l.length;a++){var h=l[a];S.includes(s,h.redirect)||(o.push(h),s.push(h.redirect))}for(var c in(t=this._proxied_tools).push.apply(t,o),this.help=o,this.gestures){var u=this.gestures[c];c in r||(r[c]={});for(var _=0,p=u.tools;_<p.length;_++){var d=p[_];d.type in r[c]||(r[c][d.type]=[]),r[c][d.type].push(d)}}for(var f=0,v=this.inspectors;f<v.length;f++){var d=v[f];d.type in e||(e[d.type]=[]),e[d.type].push(d)}for(var m=0,g=this.actions;m<g.length;m++){var d=g[m];d.type in i||(i[d.type]=[]),i[d.type].push(d)}var y=function(t,e){void 0===e&&(e=!1);var i=new T.ToolProxy({tools:t,active:e});return n._proxied_tools.push(i),i};for(var c in r){var u=this.gestures[c];for(var b in u.tools=[],r[c]){var x=r[c][b];if(0<x.length){var w=y(x);u.tools.push(w),this.connect(w.properties.active.change,this._active_change.bind(this,w))}}}for(var b in this.actions=[],i){var x=i[b];0<x.length&&this.actions.push(y(x))}for(var b in this.inspectors=[],e){var x=e[b];0<x.length&&this.inspectors.push(y(x,!0))}for(var k in this.gestures){var u=this.gestures[k];0!=u.tools.length&&(u.tools=S.sortBy(u.tools,function(t){return t.default_order}),\"pinch\"!=k&&\"scroll\"!=k&&\"multi\"!=k&&(u.tools[0].active=!0))}},t}(s.ToolbarBase);(i.ProxyToolbar=f).initClass();var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.model.toolbar.toolbar_location=this.model.toolbar_location,this._toolbar_views={},d.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},t.prototype.remove=function(){d.remove_views(this._toolbar_views),e.prototype.remove.call(this)},t.prototype.css_classes=function(){return e.prototype.css_classes.call(this).concat(\"bk-toolbar-box\")},t.prototype.render=function(){e.prototype.render.call(this);var t=this._toolbar_views[this.model.toolbar.id];t.render(),o.empty(this.el),this.el.appendChild(t.el)},t.prototype.get_width=function(){return this.model.toolbar.vertical?30:null},t.prototype.get_height=function(){return this.model.toolbar.horizontal?30:null},t}(p.LayoutDOMView);i.ToolbarBoxView=v;var m=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"ToolbarBox\",this.prototype.default_view=v,this.define({toolbar:[r.Instance],toolbar_location:[r.Location,\"right\"]})},Object.defineProperty(t.prototype,\"sizing_mode\",{get:function(){switch(this.toolbar_location){case\"above\":case\"below\":return\"scale_width\";case\"left\":case\"right\":return\"scale_height\"}},enumerable:!0,configurable:!0}),t}(p.LayoutDOM);(i.ToolbarBox=m).initClass()},function(t,e,i){var r=t(21),o=t(175),s=t(176);i.compute_renderers=function(t,e,i){return null==t?[]:(n=\"auto\"==t?e.filter(function(t){return t instanceof o.GlyphRenderer||t instanceof s.GraphRenderer}):t,0<i.length&&(n=n.filter(function(t){return r.includes(i,t.name)})),n);var n}},function(i,t,e){var n=i(387),r=i(266),o=i(15),s=i(32),a=i(38),l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"CustomJSTransform\",this.define({args:[o.Any,{}],func:[o.String,\"\"],v_func:[o.String,\"\"],use_strict:[o.Boolean,!1]})},Object.defineProperty(t.prototype,\"names\",{get:function(){return s.keys(this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"values\",{get:function(){return s.values(this.args)},enumerable:!0,configurable:!0}),t.prototype._make_transform=function(t,e){var i=this.use_strict?a.use_strict(e):e;return new(Function.bind.apply(Function,[void 0].concat(this.names,[t,\"require\",\"exports\",i])))},Object.defineProperty(t.prototype,\"scalar_transform\",{get:function(){return this._make_transform(\"x\",this.func)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"vector_transform\",{get:function(){return this._make_transform(\"xs\",this.v_func)},enumerable:!0,configurable:!0}),t.prototype.compute=function(t){return this.scalar_transform.apply(this,this.values.concat([t,i,{}]))},t.prototype.v_compute=function(t){return this.vector_transform.apply(this,this.values.concat([t,i,{}]))},t}(r.Transform);(e.CustomJSTransform=l).initClass()},function(t,e,i){var n=t(387),r=t(266),o=t(171),s=t(15),a=t(44),l=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Dodge\",this.define({value:[s.Number,0],range:[s.Instance]})},t.prototype.v_compute=function(t){var e;if(this.range instanceof o.FactorRange)e=this.range.v_synthetic(t);else{if(!a.isArrayableOf(t,a.isNumber))throw new Error(\"unexpected\");e=t}for(var i=new Float64Array(e.length),n=0;n<e.length;n++){var r=e[n];i[n]=this._compute(r)}return i},t.prototype.compute=function(t){if(this.range instanceof o.FactorRange)return this._compute(this.range.synthetic(t));if(a.isNumber(t))return this._compute(t);throw new Error(\"unexpected\")},t.prototype._compute=function(t){return t+this.value},t}(r.Transform);(i.Dodge=l).initClass()},function(t,e,i){var n=t(259);i.CustomJSTransform=n.CustomJSTransform;var r=t(260);i.Dodge=r.Dodge;var o=t(262);i.Interpolator=o.Interpolator;var s=t(263);i.Jitter=s.Jitter;var a=t(264);i.LinearInterpolator=a.LinearInterpolator;var l=t(265);i.StepInterpolator=l.StepInterpolator;var h=t(266);i.Transform=h.Transform},function(t,e,i){var n=t(387),r=t(266),o=t(15),u=t(21),_=t(44),s=function(i){function t(t){var e=i.call(this,t)||this;return e._sorted_dirty=!0,e}return n.__extends(t,i),t.initClass=function(){this.prototype.type=\"Interpolator\",this.define({x:[o.Any],y:[o.Any],data:[o.Any],clip:[o.Bool,!0]})},t.prototype.connect_signals=function(){var t=this;i.prototype.connect_signals.call(this),this.connect(this.change,function(){return t._sorted_dirty=!0})},t.prototype.v_compute=function(t){for(var e=new Float64Array(t.length),i=0;i<t.length;i++){var n=t[i];e[i]=this.compute(n)}return e},t.prototype.sort=function(t){if(void 0===t&&(t=!1),this._sorted_dirty){var e,i;if(_.isString(this.x)&&_.isString(this.y)&&null!=this.data){var n=this.data.columns();if(!u.includes(n,this.x))throw new Error(\"The x parameter does not correspond to a valid column name defined in the data parameter\");if(!u.includes(n,this.y))throw new Error(\"The y parameter does not correspond to a valid column name defined in the data parameter\");e=this.data.get_column(this.x),i=this.data.get_column(this.y)}else{if(!_.isArray(this.x)||!_.isArray(this.y))throw new Error(\"parameters 'x' and 'y' must be both either string fields or arrays\");e=this.x,i=this.y}if(e.length!==i.length)throw new Error(\"The length for x and y do not match\");if(e.length<2)throw new Error(\"x and y must have at least two elements to support interpolation\");var r=[];for(var o in e)r.push({x:e[o],y:i[o]});t?r.sort(function(t,e){return t.x>e.x?-1:t.x==e.x?0:1}):r.sort(function(t,e){return t.x<e.x?-1:t.x==e.x?0:1}),this._x_sorted=[],this._y_sorted=[];for(var s=0,a=r;s<a.length;s++){var l=a[s],h=l.x,c=l.y;this._x_sorted.push(h),this._y_sorted.push(c)}this._sorted_dirty=!1}},t}(r.Transform);(i.Interpolator=s).initClass()},function(t,e,i){var n=t(387),r=t(266),o=t(171),s=t(44),a=t(15),l=t(31),h=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Jitter\",this.define({mean:[a.Number,0],width:[a.Number,1],distribution:[a.Distribution,\"uniform\"],range:[a.Instance]}),this.internal({previous_values:[a.Array]})},t.prototype.v_compute=function(t){if(null!=this.previous_values&&this.previous_values.length==t.length)return this.previous_values;var e;if(this.range instanceof o.FactorRange)e=this.range.v_synthetic(t);else{if(!s.isArrayableOf(t,s.isNumber))throw new Error(\"unexpected\");e=t}for(var i=new Float64Array(e.length),n=0;n<e.length;n++){var r=e[n];i[n]=this._compute(r)}return this.previous_values=i},t.prototype.compute=function(t){if(this.range instanceof o.FactorRange)return this._compute(this.range.synthetic(t));if(s.isNumber(t))return this._compute(t);throw new Error(\"unexpected\")},t.prototype._compute=function(t){switch(this.distribution){case\"uniform\":return t+this.mean+(l.random()-.5)*this.width;case\"normal\":return t+l.rnorm(this.mean,this.width)}},t}(r.Transform);(i.Jitter=h).initClass()},function(t,e,i){var n=t(387),s=t(21),r=t(262),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"LinearInterpolator\"},t.prototype.compute=function(e){if(this.sort(!1),this.clip){if(e<this._x_sorted[0]||e>this._x_sorted[this._x_sorted.length-1])return NaN}else{if(e<this._x_sorted[0])return this._y_sorted[0];if(e>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}if(e==this._x_sorted[0])return this._y_sorted[0];var t=s.findLastIndex(this._x_sorted,function(t){return t<e}),i=this._x_sorted[t],n=this._x_sorted[t+1],r=this._y_sorted[t],o=this._y_sorted[t+1];return r+(e-i)/(n-i)*(o-r)},t}(r.Interpolator);(i.LinearInterpolator=o).initClass()},function(t,e,i){var n=t(387),r=t(262),o=t(15),s=t(21),a=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"StepInterpolator\",this.define({mode:[o.StepMode,\"after\"]})},t.prototype.compute=function(e){if(this.sort(!1),this.clip){if(e<this._x_sorted[0]||e>this._x_sorted[this._x_sorted.length-1])return NaN}else{if(e<this._x_sorted[0])return this._y_sorted[0];if(e>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}var t;switch(this.mode){case\"after\":t=s.findLastIndex(this._x_sorted,function(t){return t<=e});break;case\"before\":t=s.findIndex(this._x_sorted,function(t){return e<=t});break;case\"center\":var i=this._x_sorted.map(function(t){return Math.abs(t-e)}),n=s.min(i);t=s.findIndex(i,function(t){return n===t});break;default:throw new Error(\"unknown mode: \"+this.mode)}return-1!=t?this._y_sorted[t]:NaN},t}(r.Interpolator);(i.StepInterpolator=a).initClass()},function(t,e,i){var n=t(387),r=t(57),o=function(e){function t(t){return e.call(this,t)||this}return n.__extends(t,e),t.initClass=function(){this.prototype.type=\"Transform\"},t}(r.Model);(i.Transform=o).initClass()},function(t,e,i){\"function\"!=typeof WeakMap&&t(337),\"function\"!=typeof Set&&t(327),Number.isInteger||(Number.isInteger=function(t){return\"number\"==typeof t&&isFinite(t)&&Math.floor(t)===t});var n,l,r,h,o=String.prototype;o.repeat||(o.repeat=function(t){if(null==this)throw new TypeError(\"can't convert \"+this+\" to object\");var e=\"\"+this;if((t=+t)!=t&&(t=0),t<0)throw new RangeError(\"repeat count must be non-negative\");if(t==1/0)throw new RangeError(\"repeat count must be less than infinity\");if(t=Math.floor(t),0==e.length||0==t)return\"\";if(e.length*t>=1<<28)throw new RangeError(\"repeat count must not overflow maximum string size\");for(var i=\"\";1==(1&t)&&(i+=e),0!=(t>>>=1);)e+=e;return i}),Array.from||(Array.from=(n=Object.prototype.toString,l=function(t){return\"function\"==typeof t||\"[object Function]\"===n.call(t)},r=Math.pow(2,53)-1,h=function(t){var e,i=(e=Number(t),isNaN(e)?0:0!==e&&isFinite(e)?(0<e?1:-1)*Math.floor(Math.abs(e)):e);return Math.min(Math.max(i,0),r)},function(t){var e=Object(t);if(null==t)throw new TypeError(\"Array.from requires an array-like object - not null or undefined\");var i,n=1<arguments.length?arguments[1]:void 0;if(void 0!==n){if(!l(n))throw new TypeError(\"Array.from: when provided, the second argument must be a function\");2<arguments.length&&(i=arguments[2])}for(var r=h(e.length),o=l(this)?Object(new this(r)):new Array(r),s=0\n",
" // 13. If IsConstructor(C) is true, then\n",
" ;s<r;){var a=e[s];o[s]=n?void 0===i?n(a,s):n.call(i,a,s):a,s+=1}return o.length=r,o}))},function(t,e,i){var n=t(387);n.__exportStar(t(269),i),n.__exportStar(t(270),i)},function(t,e,i){var n=t(38),r=function(){function s(t,e,i){this.header=t,this.metadata=e,this.content=i,this.buffers=[]}return s.assemble=function(t,e,i){var n=JSON.parse(t),r=JSON.parse(e),o=JSON.parse(i);return new s(n,r,o)},s.prototype.assemble_buffer=function(t,e){var i=null!=this.header.num_buffers?this.header.num_buffers:0;if(i<=this.buffers.length)throw new Error(\"too many buffers received, expecting #{nb}\");this.buffers.push([t,e])},s.create=function(t,e,i){void 0===i&&(i={});var n=s.create_header(t);return new s(n,e,i)},s.create_header=function(t){return{msgid:n.uniqueId(),msgtype:t}},s.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)},s.prototype.send=function(t){var e=null!=this.header.num_buffers?this.header.num_buffers:0;if(0<e)throw new Error(\"BokehJS only supports receiving buffers, not sending\");var i=JSON.stringify(this.header),n=JSON.stringify(this.metadata),r=JSON.stringify(this.content);t.send(i),t.send(n),t.send(r)},s.prototype.msgid=function(){return this.header.msgid},s.prototype.msgtype=function(){return this.header.msgtype},s.prototype.reqid=function(){return this.header.reqid},s.prototype.problem=function(){return\"msgid\"in this.header?\"msgtype\"in this.header?null:\"No msgtype in header\":\"No msgid in header\"},s}();i.Message=r},function(t,e,i){var o=t(269),n=function(){function t(){this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}return t.prototype.consume=function(t){this._current_consumer(t)},t.prototype._HEADER=function(t){this._assume_text(t),this.message=null,this._partial=null,this._fragments=[t],this._buf_header=null,this._current_consumer=this._METADATA},t.prototype._METADATA=function(t){this._assume_text(t),this._fragments.push(t),this._current_consumer=this._CONTENT},t.prototype._CONTENT=function(t){this._assume_text(t),this._fragments.push(t);var e=this._fragments.slice(0,3),i=e[0],n=e[1],r=e[2];this._partial=o.Message.assemble(i,n,r),this._check_complete()},t.prototype._BUFFER_HEADER=function(t){this._assume_text(t),this._buf_header=t,this._current_consumer=this._BUFFER_PAYLOAD},t.prototype._BUFFER_PAYLOAD=function(t){this._assume_binary(t),this._partial.assemble_buffer(this._buf_header,t),this._check_complete()},t.prototype._assume_text=function(t){if(t instanceof ArrayBuffer)throw new Error(\"Expected text fragment but received binary fragment\")},t.prototype._assume_binary=function(t){if(!(t instanceof ArrayBuffer))throw new Error(\"Expected binary fragment but received text fragment\")},t.prototype._check_complete=function(){this._partial.complete()?(this.message=this._partial,this._current_consumer=this._HEADER):this._current_consumer=this._BUFFER_HEADER},t}();i.Receiver=n},function(t,e,i){i.safely=function(t,e){void 0===e&&(e=!1);try{return t()}catch(t){if(function(t){var e=document.createElement(\"div\");e.style.backgroundColor=\"#f2dede\",e.style.border=\"1px solid #a94442\",e.style.borderRadius=\"4px\",e.style.display=\"inline-block\",e.style.fontFamily=\"sans-serif\",e.style.marginTop=\"5px\",e.style.minWidth=\"200px\",e.style.padding=\"5px 5px 5px 10px\",e.classList.add(\"bokeh-error-box-into-flames\");var i=document.createElement(\"span\");i.style.backgroundColor=\"#a94442\",i.style.borderRadius=\"0px 4px 0px 0px\",i.style.color=\"white\",i.style.cursor=\"pointer\",i.style.cssFloat=\"right\",i.style.fontSize=\"0.8em\",i.style.margin=\"-6px -6px 0px 0px\",i.style.padding=\"2px 5px 4px 5px\",i.title=\"close\",i.setAttribute(\"aria-label\",\"close\"),i.appendChild(document.createTextNode(\"x\")),i.addEventListener(\"click\",function(){return s.removeChild(e)});var n=document.createElement(\"h3\");n.style.color=\"#a94442\",n.style.margin=\"8px 0px 0px 0px\",n.style.padding=\"0px\",n.appendChild(document.createTextNode(\"Bokeh Error\"));var r=document.createElement(\"pre\");r.style.whiteSpace=\"unset\",r.style.overflowX=\"auto\";var o=t instanceof Error?t.message:t;r.appendChild(document.createTextNode(o)),e.appendChild(i),e.appendChild(n),e.appendChild(r);var s=document.getElementsByTagName(\"body\")[0];s.insertBefore(e,s.firstChild)}(t),e)return;throw t}}},function(t,e,i){i.version=\"0.13.0\"},function(t,e,i){!function(){\"use strict\";var _,x,p,d,a;function f(t,e){var i,n=Object.keys(e);for(i=0;i<n.length;i++)t=t.replace(new RegExp(\"\\\\{\"+n[i]+\"\\\\}\",\"gi\"),e[n[i]]);return t}function l(t){var e,i,n;if(!t)throw new Error(\"cannot create a random attribute name for an undefined object\");e=\"ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz\",i=\"\";do{for(i=\"\",n=0;n<12;n++)i+=e[Math.floor(Math.random()*e.length)]}while(t[i]);return i}a=function(t,e){var i,n,r,o={};for(t=t.split(\",\"),e=e||10,i=0;i<t.length;i+=2)n=\"&\"+t[i+1]+\";\",r=parseInt(t[i],e),o[n]=\"&#\"+r+\";\";return o[\"\\\\xa0\"]=\"&#160;\",o}(\"50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro\",32),_={strokeStyle:{svgAttr:\"stroke\",canvas:\"#000000\",svg:\"none\",apply:\"stroke\"},fillStyle:{svgAttr:\"fill\",canvas:\"#000000\",svg:null,apply:\"fill\"},lineCap:{svgAttr:\"stroke-linecap\",canvas:\"butt\",svg:\"butt\",apply:\"stroke\"},lineJoin:{svgAttr:\"stroke-linejoin\",canvas:\"miter\",svg:\"miter\",apply:\"stroke\"},miterLimit:{svgAttr:\"stroke-miterlimit\",canvas:10,svg:4,apply:\"stroke\"},lineWidth:{svgAttr:\"stroke-width\",canvas:1,svg:1,apply:\"stroke\"},globalAlpha:{svgAttr:\"opacity\",canvas:1,svg:1,apply:\"fill stroke\"},font:{canvas:\"10px sans-serif\"},shadowColor:{canvas:\"#000000\"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:\"start\"},textBaseline:{canvas:\"alphabetic\"},lineDash:{svgAttr:\"stroke-dasharray\",canvas:[],svg:null,apply:\"stroke\"}},(p=function(t,e){this.__root=t,this.__ctx=e}).prototype.addColorStop=function(t,e){var i,n=this.__ctx.__createElement(\"stop\");n.setAttribute(\"offset\",t),-1!==e.indexOf(\"rgba\")?(i=/rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d?\\.?\\d*)\\s*\\)/gi.exec(e),n.setAttribute(\"stop-color\",f(\"rgb({r},{g},{b})\",{r:i[1],g:i[2],b:i[3]})),n.setAttribute(\"stop-opacity\",i[4])):n.setAttribute(\"stop-color\",e),this.__root.appendChild(n)},d=function(t,e){this.__root=t,this.__ctx=e},(x=function(t){var e,i={width:500,height:500,enableMirroring:!1};if(1<arguments.length?((e=i).width=t,e.height=arguments[1]):e=t||i,!(this instanceof x))return new x(e);this.width=e.width||i.width,this.height=e.height||i.height,this.enableMirroring=void 0!==e.enableMirroring?e.enableMirroring:i.enableMirroring,(this.canvas=this).__document=e.document||document,e.ctx?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement(\"canvas\"),this.__ctx=this.__canvas.getContext(\"2d\")),this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\"),this.__root.setAttribute(\"version\",1.1),this.__root.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\"),this.__root.setAttributeNS(\"http://www.w3.org/2000/xmlns/\",\"xmlns:xlink\",\"http://www.w3.org/1999/xlink\"),this.__root.setAttribute(\"width\",this.width),this.__root.setAttribute(\"height\",this.height),this.__ids={},this.__defs=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"defs\"),this.__root.appendChild(this.__defs),this.__currentElement=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"g\"),this.__root.appendChild(this.__currentElement)}).prototype.__createElement=function(t,e,i){void 0===e&&(e={});var n,r,o=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",t),s=Object.keys(e);for(i&&(o.setAttribute(\"fill\",\"none\"),o.setAttribute(\"stroke\",\"none\")),n=0;n<s.length;n++)r=s[n],o.setAttribute(r,e[r]);return o},x.prototype.__setDefaultStyles=function(){var t,e,i=Object.keys(_);for(t=0;t<i.length;t++)this[e=i[t]]=_[e].canvas},x.prototype.__applyStyleState=function(t){var e,i,n=Object.keys(t);for(e=0;e<n.length;e++)this[i=n[e]]=t[i]},x.prototype.__getStyleState=function(){var t,e,i={},n=Object.keys(_);for(t=0;t<n.length;t++)e=n[t],i[e]=this[e];return i},x.prototype.__applyStyleToCurrentElement=function(e){var t=this.__currentElement,i=this.__currentElementsToStyle;i&&(t.setAttribute(e,\"\"),t=i.element,i.children.forEach(function(t){t.setAttribute(e,\"\")}));var n,r,o,s,a,l=Object.keys(_);for(n=0;n<l.length;n++)if(r=_[l[n]],o=this[l[n]],r.apply)if(o instanceof d){if(o.__ctx)for(;o.__ctx.__defs.childNodes.length;)s=o.__ctx.__defs.childNodes[0].getAttribute(\"id\"),this.__ids[s]=s,this.__defs.appendChild(o.__ctx.__defs.childNodes[0]);t.setAttribute(r.apply,f(\"url(#{id})\",{id:o.__root.getAttribute(\"id\")}))}else if(o instanceof p)t.setAttribute(r.apply,f(\"url(#{id})\",{id:o.__root.getAttribute(\"id\")}));else if(-1!==r.apply.indexOf(e)&&r.svg!==o)if(\"stroke\"!==r.svgAttr&&\"fill\"!==r.svgAttr||-1===o.indexOf(\"rgba\")){var h=r.svgAttr;if(\"globalAlpha\"===l[n]&&(h=e+\"-\"+r.svgAttr,t.getAttribute(h)))continue;t.setAttribute(h,o)}else{a=/rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d?\\.?\\d*)\\s*\\)/gi.exec(o),t.setAttribute(r.svgAttr,f(\"rgb({r},{g},{b})\",{r:a[1],g:a[2],b:a[3]}));var c=a[4],u=this.globalAlpha;null!=u&&(c*=u),t.setAttribute(r.svgAttr+\"-opacity\",c)}},x.prototype.__closestGroupOrSvg=function(t){return\"g\"===(t=t||this.__currentElement).nodeName||\"svg\"===t.nodeName?t:this.__closestGroupOrSvg(t.parentNode)},x.prototype.getSerializedSvg=function(t){var e,i,n,r,o,s=(new XMLSerializer).serializeToString(this.__root);if(/xmlns=\"http:\\/\\/www\\.w3\\.org\\/2000\\/svg\".+xmlns=\"http:\\/\\/www\\.w3\\.org\\/2000\\/svg/gi.test(s)&&(s=s.replace('xmlns=\"http://www.w3.org/2000/svg','xmlns:xlink=\"http://www.w3.org/1999/xlink')),t)for(e=Object.keys(a),i=0;i<e.length;i++)n=e[i],r=a[n],(o=new RegExp(n,\"gi\")).test(s)&&(s=s.replace(o,r));return s},x.prototype.getSvg=function(){return this.__root},x.prototype.save=function(){var t=this.__createElement(\"g\"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__stack.push(this.__getStyleState())},x.prototype.restore=function(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||(this.__currentElement=this.__root.childNodes[1]);var t=this.__stack.pop();this.__applyStyleState(t)},x.prototype.__addTransform=function(t){var e=this.__closestGroupOrSvg();if(0<e.childNodes.length){\"path\"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var i=this.__createElement(\"g\");e.appendChild(i),this.__currentElement=i}var n=this.__currentElement.getAttribute(\"transform\");n?n+=\" \":n=\"\",n+=t,this.__currentElement.setAttribute(\"transform\",n)},x.prototype.scale=function(t,e){void 0===e&&(e=t),this.__addTransform(f(\"scale({x},{y})\",{x:t,y:e}))},x.prototype.rotate=function(t){var e=180*t/Math.PI;this.__addTransform(f(\"rotate({angle},{cx},{cy})\",{angle:e,cx:0,cy:0}))},x.prototype.translate=function(t,e){this.__addTransform(f(\"translate({x},{y})\",{x:t,y:e}))},x.prototype.transform=function(t,e,i,n,r,o){this.__addTransform(f(\"matrix({a},{b},{c},{d},{e},{f})\",{a:t,b:e,c:i,d:n,e:r,f:o}))},x.prototype.beginPath=function(){var t;this.__currentDefaultPath=\"\",this.__currentPosition={},t=this.__createElement(\"path\",{},!0),this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t},x.prototype.__applyCurrentDefaultPath=function(){var t=this.__currentElement;\"path\"===t.nodeName?t.setAttribute(\"d\",this.__currentDefaultPath):console.error(\"Attempted to apply path command to node\",t.nodeName)},x.prototype.__addPathCommand=function(t){this.__currentDefaultPath+=\" \",this.__currentDefaultPath+=t},x.prototype.moveTo=function(t,e){\"path\"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(f(\"M {x} {y}\",{x:t,y:e}))},x.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand(\"Z\")},x.prototype.lineTo=function(t,e){this.__currentPosition={x:t,y:e},-1<this.__currentDefaultPath.indexOf(\"M\")?this.__addPathCommand(f(\"L {x} {y}\",{x:t,y:e})):this.__addPathCommand(f(\"M {x} {y}\",{x:t,y:e}))},x.prototype.bezierCurveTo=function(t,e,i,n,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(f(\"C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}\",{cp1x:t,cp1y:e,cp2x:i,cp2y:n,x:r,y:o}))},x.prototype.quadraticCurveTo=function(t,e,i,n){this.__currentPosition={x:i,y:n},this.__addPathCommand(f(\"Q {cpx} {cpy} {x} {y}\",{cpx:t,cpy:e,x:i,y:n}))};var b=function(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]};x.prototype.arcTo=function(t,e,i,n,r){var o=this.__currentPosition&&this.__currentPosition.x,s=this.__currentPosition&&this.__currentPosition.y;if(void 0!==o&&void 0!==s){if(r<0)throw new Error(\"IndexSizeError: The radius provided (\"+r+\") is negative.\");if(o===t&&s===e||t===i&&e===n||0===r)this.lineTo(t,e);else{var a=b([o-t,s-e]),l=b([i-t,n-e]);if(a[0]*l[1]!=a[1]*l[0]){var h=a[0]*l[0]+a[1]*l[1],c=Math.acos(Math.abs(h)),u=b([a[0]+l[0],a[1]+l[1]]),_=r/Math.sin(c/2),p=t+_*u[0],d=e+_*u[1],f=[-a[1],a[0]],v=[l[1],-l[0]],m=function(t){var e=t[0],i=t[1];return 0<=i?Math.acos(e):-Math.acos(e)},g=m(f),y=m(v);this.lineTo(p+f[0]*r,d+f[1]*r),this.arc(p,d,r,g,y)}else this.lineTo(t,e)}}},x.prototype.stroke=function(){\"path\"===this.__currentElement.nodeName&&this.__currentElement.setAttribute(\"paint-order\",\"fill stroke markers\"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement(\"stroke\")},x.prototype.fill=function(){\"path\"===this.__currentElement.nodeName&&this.__currentElement.setAttribute(\"paint-order\",\"stroke fill markers\"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement(\"fill\")},x.prototype.rect=function(t,e,i,n){\"path\"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()},x.prototype.fillRect=function(t,e,i,n){var r;r=this.__createElement(\"rect\",{x:t,y:e,width:i,height:n},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement(\"fill\")},x.prototype.strokeRect=function(t,e,i,n){var r;r=this.__createElement(\"rect\",{x:t,y:e,width:i,height:n},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement(\"stroke\")},x.prototype.__clearCanvas=function(){for(var t=this.__closestGroupOrSvg(),e=t.getAttribute(\"transform\"),i=this.__root.childNodes[1],n=i.childNodes,r=n.length-1;0<=r;r--)n[r]&&i.removeChild(n[r]);this.__currentElement=i,this.__groupStack=[],e&&this.__addTransform(e)},x.prototype.clearRect=function(t,e,i,n){if(0!==t||0!==e||i!==this.width||n!==this.height){var r,o=this.__closestGroupOrSvg();r=this.__createElement(\"rect\",{x:t,y:e,width:i,height:n,fill:\"#FFFFFF\"},!0),o.appendChild(r)}else this.__clearCanvas()},x.prototype.createLinearGradient=function(t,e,i,n){var r=this.__createElement(\"linearGradient\",{id:l(this.__ids),x1:t+\"px\",x2:i+\"px\",y1:e+\"px\",y2:n+\"px\",gradientUnits:\"userSpaceOnUse\"},!1);return this.__defs.appendChild(r),new p(r,this)},x.prototype.createRadialGradient=function(t,e,i,n,r,o){var s=this.__createElement(\"radialGradient\",{id:l(this.__ids),cx:n+\"px\",cy:r+\"px\",r:o+\"px\",fx:t+\"px\",fy:e+\"px\",gradientUnits:\"userSpaceOnUse\"},!1);return this.__defs.appendChild(s),new p(s,this)},x.prototype.__parseFont=function(){var t=/^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))(?:\\s*\\/\\s*(normal|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])))?\\s*([-,\\'\\\"\\sa-z0-9]+?)\\s*$/i.exec(this.font),e={style:t[1]||\"normal\",size:t[4]||\"10px\",family:t[6]||\"sans-serif\",weight:t[3]||\"normal\",decoration:t[2]||\"normal\",href:null};return\"underline\"===this.__fontUnderline&&(e.decoration=\"underline\"),this.__fontHref&&(e.href=this.__fontHref),e},x.prototype.__wrapTextLink=function(t,e){if(t.href){var i=this.__createElement(\"a\");return i.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",t.href),i.appendChild(e),i}return e},x.prototype.__applyText=function(t,e,i,n){var r,o,s,a,l=this.__parseFont(),h=this.__closestGroupOrSvg(),c=this.__createElement(\"text\",{\"font-family\":l.family,\"font-size\":l.size,\"font-style\":l.style,\"font-weight\":l.weight,\"text-decoration\":l.decoration,x:e,y:i,\"text-anchor\":(s=this.textAlign,a={left:\"start\",right:\"end\",center:\"middle\",start:\"start\",end:\"end\"},a[s]||a.start),\"dominant-baseline\":(r=this.textBaseline,o={alphabetic:\"alphabetic\",hanging:\"hanging\",top:\"text-before-edge\",bottom:\"text-after-edge\",middle:\"central\"},o[r]||o.alphabetic)},!0);c.appendChild(this.__document.createTextNode(t)),this.__currentElement=c,this.__applyStyleToCurrentElement(n),h.appendChild(this.__wrapTextLink(l,c))},x.prototype.fillText=function(t,e,i){this.__applyText(t,e,i,\"fill\")},x.prototype.strokeText=function(t,e,i){this.__applyText(t,e,i,\"stroke\")},x.prototype.measureText=function(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)},x.prototype.arc=function(t,e,i,n,r,o){if(n!==r){n%=2*Math.PI,r%=2*Math.PI,n===r&&(r=(r+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));var s=t+i*Math.cos(r),a=e+i*Math.sin(r),l=t+i*Math.cos(n),h=e+i*Math.sin(n),c=o?0:1,u=0,_=r-n;_<0&&(_+=2*Math.PI),u=o?_>Math.PI?0:1:_>Math.PI?1:0,this.lineTo(l,h),this.__addPathCommand(f(\"A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}\",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:u,sweepFlag:c,endX:s,endY:a})),this.__currentPosition={x:s,y:a}}},x.prototype.clip=function(){var t=this.__closestGroupOrSvg(),e=this.__createElement(\"clipPath\"),i=l(this.__ids),n=this.__createElement(\"g\");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute(\"id\",i),e.appendChild(this.__currentElement),this.__defs.appendChild(e),t.setAttribute(\"clip-path\",f(\"url(#{id})\",{id:i})),t.appendChild(n),this.__currentElement=n},x.prototype.drawImage=function(){var t,e,i,n,r,o,s,a,l,h,c,u,_,p,d=Array.prototype.slice.call(arguments),f=d[0],v=0,m=0;if(3===d.length)t=d[1],e=d[2],r=f.width,o=f.height,i=r,n=o;else if(5===d.length)t=d[1],e=d[2],i=d[3],n=d[4],r=f.width,o=f.height;else{if(9!==d.length)throw new Error(\"Inavlid number of arguments passed to drawImage: \"+arguments.length);v=d[1],m=d[2],r=d[3],o=d[4],t=d[5],e=d[6],i=d[7],n=d[8]}s=this.__closestGroupOrSvg(),this.__currentElement;var g=\"translate(\"+t+\", \"+e+\")\";if(f instanceof x){if((a=f.getSvg().cloneNode(!0)).childNodes&&1<a.childNodes.length){for(l=a.childNodes[0];l.childNodes.length;)p=l.childNodes[0].getAttribute(\"id\"),this.__ids[p]=p,this.__defs.appendChild(l.childNodes[0]);if(h=a.childNodes[1]){var y,b=h.getAttribute(\"transform\");y=b?b+\" \"+g:g,h.setAttribute(\"transform\",y),s.appendChild(h)}}}else\"IMG\"===f.nodeName?((c=this.__createElement(\"image\")).setAttribute(\"width\",i),c.setAttribute(\"height\",n),c.setAttribute(\"preserveAspectRatio\",\"none\"),(v||m||r!==f.width||o!==f.height)&&((u=this.__document.createElement(\"canvas\")).width=i,u.height=n,(_=u.getContext(\"2d\")).drawImage(f,v,m,r,o,0,0,i,n),f=u),c.setAttribute(\"transform\",g),c.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",\"CANVAS\"===f.nodeName?f.toDataURL():f.getAttribute(\"src\")),s.appendChild(c)):\"CANVAS\"===f.nodeName&&((c=this.__createElement(\"image\")).setAttribute(\"width\",i),c.setAttribute(\"height\",n),c.setAttribute(\"preserveAspectRatio\",\"none\"),(u=this.__document.createElement(\"canvas\")).width=i,u.height=n,(_=u.getContext(\"2d\")).imageSmoothingEnabled=!1,_.mozImageSmoothingEnabled=!1,_.oImageSmoothingEnabled=!1,_.webkitImageSmoothingEnabled=!1,_.drawImage(f,v,m,r,o,0,0,i,n),f=u,c.setAttribute(\"transform\",g),c.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",f.toDataURL()),s.appendChild(c))},x.prototype.createPattern=function(t,e){var i,n=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"pattern\"),r=l(this.__ids);return n.setAttribute(\"id\",r),n.setAttribute(\"width\",t.width),n.setAttribute(\"height\",t.height),\"CANVAS\"===t.nodeName||\"IMG\"===t.nodeName?((i=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"image\")).setAttribute(\"width\",t.width),i.setAttribute(\"height\",t.height),i.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",\"CANVAS\"===t.nodeName?t.toDataURL():t.getAttribute(\"src\")),n.appendChild(i),this.__defs.appendChild(n)):t instanceof x&&(n.appendChild(t.__root.childNodes[1]),this.__defs.appendChild(n)),new d(n,this)},x.prototype.setLineDash=function(t){t&&0<t.length?this.lineDash=t.join(\",\"):this.lineDash=null},x.prototype.drawFocusRing=function(){},x.prototype.createImageData=function(){},x.prototype.getImageData=function(){},x.prototype.putImageData=function(){},x.prototype.globalCompositeOperation=function(){},x.prototype.setTransform=function(){},\"object\"==typeof window&&(window.C2S=x),\"object\"==typeof e&&\"object\"==typeof e.exports&&(e.exports=x)}()},function(t,e,i){var n,o=t(297),r=t(307),s=t(311),a=t(306),l=t(311),h=t(313),c=Function.prototype.bind,u=Object.defineProperty,_=Object.prototype.hasOwnProperty;n=function(t,e,i){var n,r=h(e)&&l(e.value);return delete(n=o(e)).writable,delete n.value,n.get=function(){return!i.overwriteDefinition&&_.call(this,t)?r:(e.value=c.call(r,i.resolveContext?i.resolveContext(this):this),u(this,t,e),this[t])},n},e.exports=function(t){var i=r(arguments[1]);return null!=i.resolveContext&&s(i.resolveContext),a(t,function(t,e){return n(e,t,i)})}},function(t,e,i){var a=t(294),l=t(307),h=t(300),c=t(314);(e.exports=function(t,e){var i,n,r,o,s;return arguments.length<2||\"string\"!=typeof t?(o=e,e=t,t=null):o=arguments[2],null==t?(i=r=!0,n=!1):(i=c.call(t,\"c\"),n=c.call(t,\"e\"),r=c.call(t,\"w\")),s={value:e,configurable:i,enumerable:n,writable:r},o?a(l(o),s):s}).gs=function(t,e,i){var n,r,o,s;return\"string\"!=typeof t?(o=i,i=e,e=t,t=null):o=arguments[3],null==e?e=void 0:h(e)?null==i?i=void 0:h(i)||(o=i,i=void 0):(o=e,e=i=void 0),null==t?r=!(n=!0):(n=c.call(t,\"c\"),r=c.call(t,\"e\")),s={get:e,set:i,configurable:n,enumerable:r},o?a(l(o),s):s}},function(t,e,i){var n=t(313);e.exports=function(){return n(this).length=0,this}},function(t,e,i){var o=t(288),s=t(292),a=t(313),l=Array.prototype.indexOf,h=Object.prototype.hasOwnProperty,c=Math.abs,u=Math.floor;e.exports=function(t){var e,i,n,r;if(!o(t))return l.apply(this,arguments);for(i=s(a(this).length),n=arguments[1],n=isNaN(n)?0:0<=n?u(n):s(this.length)-u(c(n)),e=n;e<i;++e)if(h.call(this,e)&&(r=this[e],o(r)))return e;return-1}},function(t,e,i){e.exports=t(279)()?Array.from:t(280)},function(t,e,i){e.exports=function(){var t,e,i=Array.from;return\"function\"==typeof i&&(e=i(t=[\"raz\",\"dwa\"]),Boolean(e&&e!==t&&\"dwa\"===e[1]))}},function(t,e,i){var p=t(332).iterator,d=t(281),f=t(282),v=t(292),m=t(311),g=t(313),y=t(302),b=t(317),x=Array.isArray,w=Function.prototype.call,k={configurable:!0,enumerable:!0,writable:!0,value:null},S=Object.defineProperty;e.exports=function(t){var e,i,n,r,o,s,a,l,h,c,u=arguments[1],_=arguments[2];if(t=Object(g(t)),y(u)&&m(u),this&&this!==Array&&f(this))e=this;else{if(!u){if(d(t))return 1!==(o=t.length)?Array.apply(null,t):((r=new Array(1))[0]=t[0],r);if(x(t)){for(r=new Array(o=t.length),i=0;i<o;++i)r[i]=t[i];return r}}r=[]}if(!x(t))if(void 0!==(h=t[p])){for(a=m(h).call(t),e&&(r=new e),l=a.next(),i=0;!l.done;)c=u?w.call(u,_,l.value,i):l.value,e?(k.value=c,S(r,i,k)):r[i]=c,l=a.next(),++i;o=i}else if(b(t)){for(o=t.length,e&&(r=new e),n=i=0;i<o;++i)c=t[i],i+1<o&&55296<=(s=c.charCodeAt(0))&&s<=56319&&(c+=t[++i]),c=u?w.call(u,_,c,n):c,e?(k.value=c,S(r,n,k)):r[n]=c,++n;o=n}if(void 0===o)for(o=v(t.length),e&&(r=new e(o)),i=0;i<o;++i)c=u?w.call(u,_,t[i],i):t[i],e?(k.value=c,S(r,i,k)):r[i]=c;return e&&(k.value=null,r.length=o),r}},function(t,e,i){var n=Object.prototype.toString,r=n.call(function(){return arguments}());e.exports=function(t){return n.call(t)===r}},function(t,e,i){var n=Object.prototype.toString,r=n.call(t(283));e.exports=function(t){return\"function\"==typeof t&&n.call(t)===r}},function(t,e,i){e.exports=function(){}},function(t,e,i){e.exports=function(){return this}()},function(t,e,i){e.exports=t(286)()?Math.sign:t(287)},function(t,e,i){e.exports=function(){var t=Math.sign;return\"function\"==typeof t&&1===t(10)&&-1===t(-20)}},function(t,e,i){e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:0<t?1:-1}},function(t,e,i){e.exports=t(289)()?Number.isNaN:t(290)},function(t,e,i){e.exports=function(){var t=Number.isNaN;return\"function\"==typeof t&&!t({})&&t(NaN)&&!t(34)}},function(t,e,i){e.exports=function(t){return t!=t}},function(t,e,i){var n=t(285),r=Math.abs,o=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*o(r(t)):t}},function(t,e,i){var n=t(291),r=Math.max;e.exports=function(t){return r(0,n(t))}},function(t,e,i){var a=t(311),l=t(313),h=Function.prototype.bind,c=Function.prototype.call,u=Object.keys,_=Object.prototype.propertyIsEnumerable;e.exports=function(o,s){return function(i,n){var t,r=arguments[2],e=arguments[3];return i=Object(l(i)),a(n),t=u(i),e&&t.sort(\"function\"==typeof e?h.call(e,i):void 0),\"function\"!=typeof o&&(o=t[o]),c.call(o,t,function(t,e){return _.call(i,t)?c.call(n,r,i[t],t,i,e):s})}}},function(t,e,i){e.exports=t(295)()?Object.assign:t(296)},function(t,e,i){e.exports=function(){var t,e=Object.assign;return\"function\"==typeof e&&(e(t={foo:\"raz\"},{bar:\"dwa\"},{trzy:\"trzy\"}),t.foo+t.bar+t.trzy===\"razdwatrzy\")}},function(t,e,i){var s=t(303),a=t(313),l=Math.max;e.exports=function(e,i){var n,t,r,o=l(arguments.length,2);for(e=Object(a(e)),r=function(t){try{e[t]=i[t]}catch(t){n||(n=t)}},t=1;t<o;++t)i=arguments[t],s(i).forEach(r);if(void 0!==n)throw n;return e}},function(t,e,i){var o=t(278),s=t(294),a=t(313);e.exports=function(e){var t=Object(a(e)),i=arguments[1],n=Object(arguments[2]);if(t!==e&&!i)return t;var r={};return i?o(i,function(t){(n.ensure||t in e)&&(r[t]=e[t])}):s(r,e),r}},function(t,e,i){var n,r,o,s,a=Object.create;t(309)()||(n=t(310)),e.exports=n?1!==n.level?a:(s={configurable:(o={},!1),enumerable:(r={},!1),writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(t){o[t]=\"__proto__\"!==t?s:{configurable:!0,enumerable:!1,writable:!0,value:void 0}}),Object.defineProperties(r,o),Object.defineProperty(n,\"nullPolyfill\",{configurable:!1,enumerable:!1,writable:!1,value:r}),function(t,e){return a(null===t?r:t,e)}):a},function(t,e,i){e.exports=t(293)(\"forEach\")},function(t,e,i){e.exports=function(t){return\"function\"==typeof t}},function(t,e,i){var n=t(302),r={function:!0,object:!0};e.exports=function(t){return n(t)&&r[typeof t]||!1}},function(t,e,i){var n=t(283)();e.exports=function(t){return t!==n&&null!==t}},function(t,e,i){e.exports=t(304)()?Object.keys:t(305)},function(t,e,i){e.exports=function(){try{return Object.keys(\"primitive\"),!0}catch(t){return!1}}},function(t,e,i){var n=t(302),r=Object.keys;e.exports=function(t){return r(n(t)?Object(t):t)}},function(t,e,i){var n=t(311),a=t(299),l=Function.prototype.call;e.exports=function(t,r){var o={},s=arguments[2];return n(r),a(t,function(t,e,i,n){o[e]=l.call(r,s,t,e,i,n)}),o}},function(t,e,i){var n=t(302),r=Array.prototype.forEach,o=Object.create;e.exports=function(t){var e=o(null);return r.call(arguments,function(t){n(t)&&function(t,e){var i;for(i in t)e[i]=t[i]}(Object(t),e)}),e}},function(t,e,i){e.exports=t(309)()?Object.setPrototypeOf:t(310)},function(t,e,i){var n=Object.create,r=Object.getPrototypeOf,o={};e.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||n;return\"function\"==typeof t&&r(t(e(null),o))===o}},function(t,e,i){var r,n,o,s,a=t(301),l=t(313),h=Object.prototype.isPrototypeOf,c=Object.defineProperty,u={configurable:!0,enumerable:!1,writable:!0,value:void 0};r=function(t,e){if(l(t),null===e||a(e))return t;throw new TypeError(\"Prototype must be null or an object\")},e.exports=(n=function(){var t,e=Object.create(null),i={},n=Object.getOwnPropertyDescriptor(Object.prototype,\"__proto__\");if(n){try{(t=n.set).call(e,i)}catch(t){}if(Object.getPrototypeOf(e)===i)return{set:t,level:2}}return e.__proto__=i,Object.getPrototypeOf(e)===i?{level:2}:((e={}).__proto__=i,Object.getPrototypeOf(e)===i&&{level:1})}())?(2===n.level?n.set?(s=n.set,o=function(t,e){return s.call(r(t,e),e),t}):o=function(t,e){return r(t,e).__proto__=e,t}:o=function t(e,i){var n;return r(e,i),(n=h.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===i&&(i=t.nullPolyfill),e.__proto__=i,n&&c(t.nullPolyfill,\"__proto__\",u),e},Object.defineProperty(o,\"level\",{configurable:!1,enumerable:!1,writable:!1,value:n.level})):null,t(298)},function(t,e,i){e.exports=function(t){if(\"function\"!=typeof t)throw new TypeError(t+\" is not a function\");return t}},function(t,e,i){var n=t(301);e.exports=function(t){if(!n(t))throw new TypeError(t+\" is not an Object\");return t}},function(t,e,i){var n=t(302);e.exports=function(t){if(!n(t))throw new TypeError(\"Cannot use null or undefined\");return t}},function(t,e,i){e.exports=t(315)()?String.prototype.contains:t(316)},function(t,e,i){var n=\"razdwatrzy\";e.exports=function(){return\"function\"==typeof n.contains&&!0===n.contains(\"dwa\")&&!1===n.contains(\"foo\")}},function(t,e,i){var n=String.prototype.indexOf;e.exports=function(t){return-1<n.call(this,t,arguments[1])}},function(t,e,i){var n=Object.prototype.toString,r=n.call(\"\");e.exports=function(t){return\"string\"==typeof t||t&&\"object\"==typeof t&&(t instanceof String||n.call(t)===r)||!1}},function(t,e,i){var n=Object.create(null),r=Math.random;e.exports=function(){for(var t;t=r().toString(36).slice(2),n[t];);return t}},function(t,e,i){var n,r=t(308),o=t(314),s=t(275),a=t(332),l=t(322),h=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");l.call(this,t),e=e?o.call(e,\"key+value\")?\"key+value\":o.call(e,\"key\")?\"key\":\"value\":\"value\",h(this,\"__kind__\",s(\"\",e))},r&&r(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:s(function(t){return\"value\"===this.__kind__?this.__list__[t]:\"key+value\"===this.__kind__?[t,this.__list__[t]]:t})}),h(n.prototype,a.toStringTag,s(\"c\",\"Array Iterator\"))},function(t,e,i){var u=t(281),_=t(311),p=t(317),d=t(321),f=Array.isArray,v=Function.prototype.call,m=Array.prototype.some;e.exports=function(t,e){var i,n,r,o,s,a,l,h,c=arguments[2];if(f(t)||u(t)?i=\"array\":p(t)?i=\"string\":t=d(t),_(e),r=function(){o=!0},\"array\"!==i)if(\"string\"!==i)for(n=t.next();!n.done;){if(v.call(e,c,n.value,r),o)return;n=t.next()}else for(a=t.length,s=0;s<a&&(l=t[s],s+1<a&&55296<=(h=l.charCodeAt(0))&&h<=56319&&(l+=t[++s]),v.call(e,c,l,r),!o);++s);else m.call(t,function(t){return v.call(e,c,t,r),o})}},function(t,e,i){var n=t(281),r=t(317),o=t(319),s=t(324),a=t(325),l=t(332).iterator;e.exports=function(t){return\"function\"==typeof a(t)[l]?t[l]():n(t)?new o(t):r(t)?new s(t):new o(t)}},function(t,e,i){var n,r=t(276),o=t(294),s=t(311),a=t(313),l=t(275),h=t(274),c=t(332),u=Object.defineProperty,_=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");_(this,{__list__:l(\"w\",a(t)),__context__:l(\"w\",e),__nextIndex__:l(\"w\",0)}),e&&(s(e.on),e.on(\"_add\",this._onAdd),e.on(\"_delete\",this._onDelete),e.on(\"_clear\",this._onClear))},delete n.prototype.constructor,_(n.prototype,o({_next:l(function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()}),next:l(function(){return this._createResult(this._next())}),_createResult:l(function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}}),_resolve:l(function(t){return this.__list__[t]}),_unBind:l(function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off(\"_add\",this._onAdd),this.__context__.off(\"_delete\",this._onDelete),this.__context__.off(\"_clear\",this._onClear),this.__context__=null)}),toString:l(function(){return\"[object \"+(this[c.toStringTag]||\"Object\")+\"]\"})},h({_onAdd:l(function(i){i>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(t,e){i<=t&&(this.__redo__[e]=++t)},this),this.__redo__.push(i)):u(this,\"__redo__\",l(\"c\",[i])))}),_onDelete:l(function(i){var t;i>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(i))&&this.__redo__.splice(t,1),this.__redo__.forEach(function(t,e){i<t&&(this.__redo__[e]=--t)},this)))}),_onClear:l(function(){this.__redo__&&r.call(this.__redo__),this.__nextIndex__=0})}))),u(n.prototype,c.iterator,l(function(){return this}))},function(t,e,i){var n=t(281),r=t(302),o=t(317),s=t(332).iterator,a=Array.isArray;e.exports=function(t){return!(!r(t)||!a(t)&&!o(t)&&!n(t)&&\"function\"!=typeof t[s])}},function(t,e,i){var n,r=t(308),o=t(275),s=t(332),a=t(322),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");t=String(t),a.call(this,t),l(this,\"__length__\",o(\"\",t.length))},r&&r(n,a),delete n.prototype.constructor,n.prototype=Object.create(a.prototype,{_next:o(function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()}),_resolve:o(function(t){var e,i=this.__list__[t];return this.__nextIndex__===this.__length__?i:55296<=(e=i.charCodeAt(0))&&e<=56319?i+this.__list__[this.__nextIndex__++]:i})}),l(n.prototype,s.toStringTag,o(\"c\",\"String Iterator\"))},function(t,e,i){var n=t(323);e.exports=function(t){if(!n(t))throw new TypeError(t+\" is not iterable\");return t}},function(L,t,e){\n",
" /*!\n",
" * @overview es6-promise - a tiny implementation of Promises/A+.\n",
" * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n",
" * @license Licensed under MIT license\n",
" * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n",
" * @version v4.2.4+314e4831\n",
" */var i,n;i=this,n=function(){\"use strict\";function h(t){return\"function\"==typeof t}var i=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)},n=0,e=void 0,r=void 0,a=function(t,e){_[n]=t,_[n+1]=e,2===(n+=2)&&(r?r(p):g())},t=\"undefined\"!=typeof window?window:void 0,o=t||{},s=o.MutationObserver||o.WebKitMutationObserver,l=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),c=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel;function u(){var t=setTimeout;return function(){return t(p,1)}}var _=new Array(1e3);function p(){for(var t=0;t<n;t+=2){var e=_[t],i=_[t+1];e(i),_[t]=void 0,_[t+1]=void 0}n=0}var d,f,v,m,g=void 0;function y(t,e){var i=this,n=new this.constructor(w);void 0===n[x]&&I(n);var r=i._state;if(r){var o=arguments[r-1];a(function(){return F(r,n,o,i._result)})}else j(i,n,t,e);return n}function b(t){if(t&&\"object\"==typeof t&&t.constructor===this)return t;var e=new this(w);return M(e,t),e}l?g=function(){return process.nextTick(p)}:s?(f=0,v=new s(p),m=document.createTextNode(\"\"),v.observe(m,{characterData:!0}),g=function(){m.data=f=++f%2}):c?((d=new MessageChannel).port1.onmessage=p,g=function(){return d.port2.postMessage(0)}):g=void 0===t&&\"function\"==typeof L?function(){try{var t=Function(\"return this\")().require(\"vertx\");return void 0!==(e=t.runOnLoop||t.runOnContext)?function(){e(p)}:u()}catch(t){return u()}}():u();var x=Math.random().toString(36).substring(2);function w(){}var k=void 0,S=1,T=2,C={error:null};function A(t){try{return t.then}catch(t){return C.error=t,C}}function E(t,e,i){var n,r,o,s;e.constructor===t.constructor&&i===y&&e.constructor.resolve===b?(o=t,(s=e)._state===S?z(o,s._result):s._state===T?P(o,s._result):j(s,void 0,function(t){return M(o,t)},function(t){return P(o,t)})):i===C?(P(t,C.error),C.error=null):void 0===i?z(t,e):h(i)?(n=e,r=i,a(function(e){var i=!1,t=function(t,e,i,n){try{t.call(e,i,n)}catch(t){return t}}(r,n,function(t){i||(i=!0,n!==t?M(e,t):z(e,t))},function(t){i||(i=!0,P(e,t))},e._label);!i&&t&&(i=!0,P(e,t))},t)):z(t,e)}function M(t,e){var i,n;t===e?P(t,new TypeError(\"You cannot resolve a promise with itself\")):(n=typeof(i=e),null===i||\"object\"!==n&&\"function\"!==n?z(t,e):E(t,e,A(e)))}function O(t){t._onerror&&t._onerror(t._result),N(t)}function z(t,e){t._state===k&&(t._result=e,t._state=S,0!==t._subscribers.length&&a(N,t))}function P(t,e){t._state===k&&(t._state=T,t._result=e,a(O,t))}function j(t,e,i,n){var r=t._subscribers,o=r.length;t._onerror=null,r[o]=e,r[o+S]=i,r[o+T]=n,0===o&&t._state&&a(N,t)}function N(t){var e=t._subscribers,i=t._state;if(0!==e.length){for(var n=void 0,r=void 0,o=t._result,s=0;s<e.length;s+=3)n=e[s],r=e[s+i],n?F(i,n,r,o):r(o);t._subscribers.length=0}}function F(t,e,i,n){var r=h(i),o=void 0,s=void 0,a=void 0,l=void 0;if(r){if((o=function(t,e){try{return t(e)}catch(t){return C.error=t,C}}(i,n))===C?(l=!0,s=o.error,o.error=null):a=!0,e===o)return void P(e,new TypeError(\"A promises callback cannot return that same promise.\"))}else o=n,a=!0;e._state!==k||(r&&a?M(e,o):l?P(e,s):t===S?z(e,o):t===T&&P(e,o))}var D=0;function I(t){t[x]=D++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(w),this.promise[x]||I(this.promise),i(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?z(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&z(this.promise,this._result))):P(this.promise,new Error(\"Array Methods must be provided an Array\"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===k&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(e,t){var i=this._instanceConstructor,n=i.resolve;if(n===b){var r=A(e);if(r===y&&e._state!==k)this._settledAt(e._state,t,e._result);else if(\"function\"!=typeof r)this._remaining--,this._result[t]=e;else if(i===B){var o=new i(w);E(o,e,r),this._willSettleAt(o,t)}else this._willSettleAt(new i(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},t.prototype._settledAt=function(t,e,i){var n=this.promise;n._state===k&&(this._remaining--,t===T?P(n,i):this._result[e]=i),0===this._remaining&&z(n,this._result)},t.prototype._willSettleAt=function(t,e){var i=this;j(t,void 0,function(t){return i._settledAt(S,e,t)},function(t){return i._settledAt(T,e,t)})},t}(),B=function(){function e(t){this[x]=D++,this._result=this._state=void 0,this._subscribers=[],w!==t&&(\"function\"!=typeof t&&function(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}(),this instanceof e?function(e,t){try{t(function(t){M(e,t)},function(t){P(e,t)})}catch(t){P(e,t)}}(this,t):function(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var i=this.constructor;return this.then(function(t){return i.resolve(e()).then(function(){return t})},function(t){return i.resolve(e()).then(function(){throw t})})},e}();return B.prototype.then=y,B.all=function(t){return new R(this,t).promise},B.race=function(r){var o=this;return i(r)?new o(function(t,e){for(var i=r.length,n=0;n<i;n++)o.resolve(r[n]).then(t,e)}):new o(function(t,e){return e(new TypeError(\"You must pass an array to race.\"))})},B.resolve=b,B.reject=function(t){var e=new this(w);return P(e,t),e},B._setScheduler=function(t){r=t},B._setAsap=function(t){a=t},B._asap=a,B.polyfill=function(){var t=void 0;if(\"undefined\"!=typeof global)t=global;else if(\"undefined\"!=typeof self)t=self;else try{t=Function(\"return this\")()}catch(t){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var e=t.Promise;if(e){var i=null;try{i=Object.prototype.toString.call(e.resolve())}catch(t){}if(\"[object Promise]\"===i&&!e.cast)return}t.Promise=B},B.Promise=B},\"object\"==typeof e&&void 0!==t?t.exports=n():i.ES6Promise=n()},function(t,e,i){t(328)()||Object.defineProperty(t(284),\"Set\",{value:t(331),configurable:!0,enumerable:!1,writable:!0})},function(t,e,i){e.exports=function(){var t,e,i;return\"function\"==typeof Set&&(t=new Set([\"raz\",\"dwa\",\"trzy\"]),\"[object Set]\"===String(t)&&3===t.size&&\"function\"==typeof t.add&&\"function\"==typeof t.clear&&\"function\"==typeof t.delete&&\"function\"==typeof t.entries&&\"function\"==typeof t.forEach&&\"function\"==typeof t.has&&\"function\"==typeof t.keys&&\"function\"==typeof t.values&&(e=t.values(),!1===(i=e.next()).done&&\"raz\"===i.value))}},function(t,e,i){e.exports=\"undefined\"!=typeof Set&&\"[object Set]\"===Object.prototype.toString.call(Set.prototype)},function(t,e,i){var n,r=t(308),o=t(314),s=t(275),a=t(322),l=t(332).toStringTag,h=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))return new n(t,e);a.call(this,t.__setData__,t),e=e&&o.call(e,\"key+value\")?\"key+value\":\"value\",h(this,\"__kind__\",s(\"\",e))},r&&r(n,a),n.prototype=Object.create(a.prototype,{constructor:s(n),_resolve:s(function(t){return\"value\"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__list__[t]]}),toString:s(function(){return\"[object Set Iterator]\"})}),h(n.prototype,l,s(\"c\",\"Set Iterator\"))},function(t,e,i){var n,r,o,s=t(276),a=t(277),l=t(308),h=t(311),c=t(275),u=t(341),_=t(332),p=t(325),d=t(320),f=t(330),v=t(329),m=Function.prototype.call,g=Object.defineProperty,y=Object.getPrototypeOf;v&&(o=Set),e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");return t=v&&l?l(new o,y(this)):this,null!=e&&p(e),g(t,\"__setData__\",c(\"c\",[])),e&&d(e,function(t){-1===a.call(this,t)&&this.push(t)},t.__setData__),t},v&&(l&&l(n,o),n.prototype=Object.create(o.prototype,{constructor:c(n)})),u(Object.defineProperties(n.prototype,{add:c(function(t){return this.has(t)||this.emit(\"_add\",this.__setData__.push(t)-1,t),this}),clear:c(function(){this.__setData__.length&&(s.call(this.__setData__),this.emit(\"_clear\"))}),delete:c(function(t){var e=a.call(this.__setData__,t);return-1!==e&&(this.__setData__.splice(e,1),this.emit(\"_delete\",e,t),!0)}),entries:c(function(){return new f(this,\"key+value\")}),forEach:c(function(t){var e,i,n,r=arguments[1];for(h(t),e=this.values(),i=e._next();void 0!==i;)n=e._resolve(i),m.call(t,r,n,n,this),i=e._next()}),has:c(function(t){return-1!==a.call(this.__setData__,t)}),keys:c(r=function(){return this.values()}),size:c.gs(function(){return this.__setData__.length}),values:c(function(){return new f(this)}),toString:c(function(){return\"[object Set]\"})})),g(n.prototype,_.iterator,c(r)),g(n.prototype,_.toStringTag,c(\"c\",\"Set\"))},function(t,e,i){e.exports=t(333)()?Symbol:t(335)},function(t,e,i){var n={object:!0,symbol:!0};e.exports=function(){var t;if(\"function\"!=typeof Symbol)return!1;t=Symbol(\"test symbol\");try{String(t)}catch(t){return!1}return!!n[typeof Symbol.iterator]&&!!n[typeof Symbol.toPrimitive]&&!!n[typeof Symbol.toStringTag]}},function(t,e,i){e.exports=function(t){return!!t&&(\"symbol\"==typeof t||!!t.constructor&&\"Symbol\"===t.constructor.name&&\"Symbol\"===t[t.constructor.toStringTag])}},function(t,e,i){var n,r,o,s,a=t(275),l=t(336),h=Object.create,c=Object.defineProperties,u=Object.defineProperty,_=Object.prototype,p=h(null);if(\"function\"==typeof Symbol){n=Symbol;try{String(n()),s=!0}catch(t){}}var d,f=(d=h(null),function(t){for(var e,i,n=0;d[t+(n||\"\")];)++n;return d[t+=n||\"\"]=!0,u(_,e=\"@@\"+t,a.gs(null,function(t){i||(i=!0,u(this,e,a(t)),i=!1)})),e});o=function(t){if(this instanceof o)throw new TypeError(\"Symbol is not a constructor\");return r(t)},e.exports=r=function t(e){var i;if(this instanceof t)throw new TypeError(\"Symbol is not a constructor\");return s?n(e):(i=h(o.prototype),e=void 0===e?\"\":String(e),c(i,{__description__:a(\"\",e),__name__:a(\"\",f(e))}))},c(r,{for:a(function(t){return p[t]?p[t]:p[t]=r(String(t))}),keyFor:a(function(t){var e;for(e in l(t),p)if(p[e]===t)return e}),hasInstance:a(\"\",n&&n.hasInstance||r(\"hasInstance\")),isConcatSpreadable:a(\"\",n&&n.isConcatSpreadable||r(\"isConcatSpreadable\")),iterator:a(\"\",n&&n.iterator||r(\"iterator\")),match:a(\"\",n&&n.match||r(\"match\")),replace:a(\"\",n&&n.replace||r(\"replace\")),search:a(\"\",n&&n.search||r(\"search\")),species:a(\"\",n&&n.species||r(\"species\")),split:a(\"\",n&&n.split||r(\"split\")),toPrimitive:a(\"\",n&&n.toPrimitive||r(\"toPrimitive\")),toStringTag:a(\"\",n&&n.toStringTag||r(\"toStringTag\")),unscopables:a(\"\",n&&n.unscopables||r(\"unscopables\"))}),c(o.prototype,{constructor:a(r),toString:a(\"\",function(){return this.__name__})}),c(r.prototype,{toString:a(function(){return\"Symbol (\"+l(this).__description__+\")\"}),valueOf:a(function(){return l(this)})}),u(r.prototype,r.toPrimitive,a(\"\",function(){var t=l(this);return\"symbol\"==typeof t?t:t.toString()})),u(r.prototype,r.toStringTag,a(\"c\",\"Symbol\")),u(o.prototype,r.toStringTag,a(\"c\",r.prototype[r.toStringTag])),u(o.prototype,r.toPrimitive,a(\"c\",r.prototype[r.toPrimitive]))},function(t,e,i){var n=t(334);e.exports=function(t){if(!n(t))throw new TypeError(t+\" is not a symbol\");return t}},function(t,e,i){t(338)()||Object.defineProperty(t(284),\"WeakMap\",{value:t(340),configurable:!0,enumerable:!1,writable:!0})},function(t,e,i){e.exports=function(){var t,e;if(\"function\"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},\"one\"],[{},\"two\"],[{},\"three\"]])}catch(t){return!1}return\"[object WeakMap]\"===String(t)&&\"function\"==typeof t.set&&t.set({},1)===t&&\"function\"==typeof t.delete&&\"function\"==typeof t.has&&\"one\"===t.get(e)}},function(t,e,i){e.exports=\"function\"==typeof WeakMap&&\"[object WeakMap]\"===Object.prototype.toString.call(new WeakMap)},function(t,e,i){var n,r=t(308),o=t(312),s=t(313),a=t(318),l=t(275),h=t(321),c=t(320),u=t(332).toStringTag,_=t(339),p=Array.isArray,d=Object.defineProperty,f=Object.prototype.hasOwnProperty,v=Object.getPrototypeOf;e.exports=n=function(){var e,t=arguments[0];if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");return e=_&&r&&WeakMap!==n?r(new WeakMap,v(this)):this,null!=t&&(p(t)||(t=h(t))),d(e,\"__weakMapData__\",l(\"c\",\"$weakMap$\"+a())),t&&c(t,function(t){s(t),e.set(t[0],t[1])}),e},_&&(r&&r(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:l(n)})),Object.defineProperties(n.prototype,{delete:l(function(t){return!!f.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)}),get:l(function(t){if(f.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]}),has:l(function(t){return f.call(o(t),this.__weakMapData__)}),set:l(function(t,e){return d(o(t),this.__weakMapData__,l(\"c\",e)),this}),toString:l(function(){return\"[object WeakMap]\"})}),d(n.prototype,u,l(\"c\",\"WeakMap\"))},function(t,e,i){var r,n,o,s,a,l,h,c=t(275),u=t(311),_=Function.prototype.apply,p=Function.prototype.call,d=Object.create,f=Object.defineProperty,v=Object.defineProperties,m=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};n=function(t,e){var i,n;return u(e),r.call(n=this,t,i=function(){o.call(n,t,i),_.call(e,this,arguments)}),i.__eeOnceListener__=e,this},a={on:r=function(t,e){var i;return u(e),m.call(this,\"__ee__\")?i=this.__ee__:(i=g.value=d(null),f(this,\"__ee__\",g),g.value=null),i[t]?\"object\"==typeof i[t]?i[t].push(e):i[t]=[i[t],e]:i[t]=e,this},once:n,off:o=function(t,e){var i,n,r,o;if(u(e),!m.call(this,\"__ee__\"))return this;if(!(i=this.__ee__)[t])return this;if(\"object\"==typeof(n=i[t]))for(o=0;r=n[o];++o)r!==e&&r.__eeOnceListener__!==e||(2===n.length?i[t]=n[o?0:1]:n.splice(o,1));else n!==e&&n.__eeOnceListener__!==e||delete i[t];return this},emit:s=function(t){var e,i,n,r,o;if(m.call(this,\"__ee__\")&&(r=this.__ee__[t]))if(\"object\"==typeof r){for(i=arguments.length,o=new Array(i-1),e=1;e<i;++e)o[e-1]=arguments[e];for(r=r.slice(),e=0;n=r[e];++e)_.call(n,this,o)}else switch(arguments.length){case 1:p.call(r,this);break;case 2:p.call(r,this,arguments[1]);break;case 3:p.call(r,this,arguments[1],arguments[2]);break;default:for(i=arguments.length,o=new Array(i-1),e=1;e<i;++e)o[e-1]=arguments[e];_.call(r,this,o)}}},l={on:c(r),once:c(n),off:c(o),emit:c(s)},h=v({},l),e.exports=i=function(t){return null==t?d(h):v(Object(t),l)},i.methods=a},function(t,e,i){var n,r;n=this,r=function(){\"use strict\";var l=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],h=function(t,e,i,n){if(void 0===t)throw new Error(\"Missing required argument: numItems.\");if(isNaN(t)||t<=0)throw new Error(\"Unpexpected numItems value: \"+t+\".\");this.numItems=+t,this.nodeSize=Math.min(Math.max(+e||16,2),65535);var r=t,o=r;for(this._levelBounds=[4*r];r=Math.ceil(r/this.nodeSize),o+=r,this._levelBounds.push(4*o),1!==r;);this.ArrayType=i||Float64Array,this.IndexArrayType=o<16384?Uint16Array:Uint32Array;var s=l.indexOf(this.ArrayType),a=4*o*this.ArrayType.BYTES_PER_ELEMENT;if(s<0)throw new Error(\"Unexpected typed array class: \"+i+\".\");n&&n instanceof ArrayBuffer?(this.data=n,this._boxes=new this.ArrayType(this.data,8,4*o),this._indices=new this.IndexArrayType(this.data,8+a,o),this._pos=4*o,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1]):(this.data=new ArrayBuffer(8+a+o*this.IndexArrayType.BYTES_PER_ELEMENT),this._boxes=new this.ArrayType(this.data,8,4*o),this._indices=new this.IndexArrayType(this.data,8+a,o),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(this.data,0,2).set([251,48+s]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)};function T(t,e,i,n,r){var o=t[n];t[n]=t[r],t[r]=o;var s=4*n,a=4*r,l=e[s],h=e[s+1],c=e[s+2],u=e[s+3];e[s]=e[a],e[s+1]=e[a+1],e[s+2]=e[a+2],e[s+3]=e[a+3],e[a]=l,e[a+1]=h,e[a+2]=c,e[a+3]=u;var _=i[n];i[n]=i[r],i[r]=_}function C(t,e){var i=t^e,n=65535^i,r=65535^(t|e),o=t&(65535^e),s=i|n>>1,a=i>>1^i,l=r>>1^n&o>>1^r,h=i&r>>1^o>>1^o;a=(i=s)&(n=a)>>2^n&(i^n)>>2,l^=i&(r=l)>>2^n&(o=h)>>2,h^=n&r>>2^(i^n)&o>>2,a=(i=s=i&i>>2^n&n>>2)&(n=a)>>4^n&(i^n)>>4,l^=i&(r=l)>>4^n&(o=h)>>4,h^=n&r>>4^(i^n)&o>>4,l^=(i=s=i&i>>4^n&n>>4)&(r=l)>>8^(n=a)&(o=h)>>8;var c=t^e,u=(n=(h^=n&r>>8^(i^n)&o>>8)^h>>1)|65535^(c|(i=l^l>>1));return((u=1431655765&((u=858993459&((u=252645135&((u=16711935&(u|u<<8))|u<<4))|u<<2))|u<<1))<<1|(c=1431655765&((c=858993459&((c=252645135&((c=16711935&(c|c<<8))|c<<4))|c<<2))|c<<1)))>>>0}return h.from=function(t){if(!(t instanceof ArrayBuffer))throw new Error(\"Data must be an instance of ArrayBuffer.\");var e=new Uint8Array(t,0,2),i=e[0],n=e[1];if(251!==i)throw new Error(\"Data does not appear to be in a Flatbush format.\");if(n>>4!=3)throw new Error(\"Got v\"+(n>>4)+\" data when expected v3.\");var r=new Uint16Array(t,2,1),o=r[0],s=new Uint32Array(t,4,1),a=s[0];return new h(a,o,l[15&n],t)},h.prototype.add=function(t,e,i,n){var r=this._pos>>2;this._indices[r]=r,this._boxes[this._pos++]=t,this._boxes[this._pos++]=e,this._boxes[this._pos++]=i,this._boxes[this._pos++]=n,t<this.minX&&(this.minX=t),e<this.minY&&(this.minY=e),i>this.maxX&&(this.maxX=i),n>this.maxY&&(this.maxY=n)},h.prototype.finish=function(){var t=this;if(this._pos>>2!==this.numItems)throw new Error(\"Added \"+(this._pos>>2)+\" items when expected \"+this.numItems+\".\");for(var e=this.maxX-this.minX,i=this.maxY-this.minY,n=new Uint32Array(this.numItems),r=0;r<this.numItems;r++){var o=4*r,s=t._boxes[o++],a=t._boxes[o++],l=t._boxes[o++],h=t._boxes[o++],c=Math.floor(65535*((s+l)/2-t.minX)/e),u=Math.floor(65535*((a+h)/2-t.minY)/i);n[r]=C(c,u)}!function t(e,i,n,r,o){if(!(o<=r)){for(var s=e[r+o>>1],a=r-1,l=o+1;;){for(;e[++a]<s;);for(;e[--l]>s;);if(l<=a)break;T(e,i,n,a,l)}t(e,i,n,r,l),t(e,i,n,l+1,o)}}(n,this._boxes,this._indices,0,this.numItems-1);for(var _=0,p=0;_<this._levelBounds.length-1;_++)for(var d=t._levelBounds[_];p<d;){for(var f=1/0,v=1/0,m=-1/0,g=-1/0,y=p,b=0;b<this.nodeSize&&p<d;b++){var x=t._boxes[p++],w=t._boxes[p++],k=t._boxes[p++],S=t._boxes[p++];x<f&&(f=x),w<v&&(v=w),m<k&&(m=k),g<S&&(g=S)}t._indices[t._pos>>2]=y,t._boxes[t._pos++]=f,t._boxes[t._pos++]=v,t._boxes[t._pos++]=m,t._boxes[t._pos++]=g}},h.prototype.search=function(t,e,i,n,r){if(this._pos!==this._boxes.length)throw new Error(\"Data not yet indexed - call index.finish().\");for(var o=this._boxes.length-4,s=this._levelBounds.length-1,a=[],l=[];void 0!==o;){for(var h=Math.min(o+4*this.nodeSize,this._levelBounds[s]),c=o;c<h;c+=4){var u=this._indices[c>>2];i<this._boxes[c]||n<this._boxes[c+1]||t>this._boxes[c+2]||e>this._boxes[c+3]||(o<4*this.numItems?(void 0===r||r(u))&&l.push(u):(a.push(u),a.push(s-1)))}s=a.pop(),o=a.pop()}return l},h},\"object\"==typeof i&&void 0!==e?e.exports=r():n.Flatbush=r()},function(t,Yt,e){\n",
" /*! Hammer.JS - v2.0.7 - 2016-04-22\n",
" * http://hammerjs.github.io/\n",
" *\n",
" * Copyright (c) 2016 Jorik Tangelder;\n",
" * Licensed under the MIT license */\n",
" !function(o,a,t,x){\"use strict\";var s,l=[\"\",\"webkit\",\"Moz\",\"MS\",\"ms\",\"o\"],e=a.createElement(\"div\"),i=\"function\",h=Math.round,w=Math.abs,k=Date.now;function c(t,e,i){return setTimeout(f(t,i),e)}function n(t,e,i){return!!Array.isArray(t)&&(u(t,i[e],i),!0)}function u(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==x)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function r(n,t,e){var r=\"DEPRECATED METHOD: \"+t+\"\\n\"+e+\" AT \\n\";return function(){var t=new Error(\"get-stack-trace\"),e=t&&t.stack?t.stack.replace(/^[^\\(]+?[\\n$]/gm,\"\").replace(/^\\s+at\\s+/gm,\"\").replace(/^Object.<anonymous>\\s*\\(/gm,\"{anonymous}()@\"):\"Unknown Stack Trace\",i=o.console&&(o.console.warn||o.console.log);return i&&i.call(o.console,r,e),n.apply(this,arguments)}}s=\"function\"!=typeof Object.assign?function(t){if(t===x||null===t)throw new TypeError(\"Cannot convert undefined or null to object\");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==x&&null!==n)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}:Object.assign;var _=r(function(t,e,i){for(var n=Object.keys(e),r=0;r<n.length;)(!i||i&&t[n[r]]===x)&&(t[n[r]]=e[n[r]]),r++;return t},\"extend\",\"Use `assign`.\"),p=r(function(t,e){return _(t,e,!0)},\"merge\",\"Use `assign`.\");function d(t,e,i){var n,r=e.prototype;(n=t.prototype=Object.create(r)).constructor=t,n._super=r,i&&s(n,i)}function f(t,e){return function(){return t.apply(e,arguments)}}function v(t,e){return typeof t==i?t.apply(e&&e[0]||x,e):t}function m(t,e){return t===x?e:t}function g(e,t,i){u(T(t),function(t){e.addEventListener(t,i,!1)})}function y(e,t,i){u(T(t),function(t){e.removeEventListener(t,i,!1)})}function S(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function b(t,e){return-1<t.indexOf(e)}function T(t){return t.trim().split(/\\s+/g)}function C(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function A(t){return Array.prototype.slice.call(t,0)}function E(t,i,e){for(var n=[],r=[],o=0;o<t.length;){var s=i?t[o][i]:t[o];C(r,s)<0&&n.push(t[o]),r[o]=s,o++}return e&&(n=i?n.sort(function(t,e){return t[i]>e[i]}):n.sort()),n}function M(t,e){for(var i,n,r=e[0].toUpperCase()+e.slice(1),o=0;o<l.length;){if(i=l[o],(n=i?i+r:e)in t)return n;o++}return x}var O=1;function z(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||o}var P=\"ontouchstart\"in o,j=M(o,\"PointerEvent\")!==x,N=P&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),F=\"touch\",D=25,I=1,R=4,B=8,L=1,V=2,G=4,U=8,q=16,Y=V|G,X=U|q,H=Y|X,W=[\"x\",\"y\"],J=[\"clientX\",\"clientY\"];function Q(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){v(e.options.enable,[e])&&i.handler(t)},this.init()}function $(t,e,i){var n=i.pointers.length,r=i.changedPointers.length,o=e&I&&n-r==0,s=e&(R|B)&&n-r==0;i.isFirst=!!o,i.isFinal=!!s,o&&(t.session={}),i.eventType=e,function(t,e){var i=t.session,n=e.pointers,r=n.length;i.firstInput||(i.firstInput=K(e)),1<r&&!i.firstMultiple?i.firstMultiple=K(e):1===r&&(i.firstMultiple=!1);var o,s,a,l,h,c,u=i.firstInput,_=i.firstMultiple,p=_?_.center:u.center,d=e.center=Z(n);e.timeStamp=k(),e.deltaTime=e.timeStamp-u.timeStamp,e.angle=nt(p,d),e.distance=it(p,d),o=i,a=(s=e).center,l=o.offsetDelta||{},h=o.prevDelta||{},c=o.prevInput||{},s.eventType!==I&&c.eventType!==R||(h=o.prevDelta={x:c.deltaX||0,y:c.deltaY||0},l=o.offsetDelta={x:a.x,y:a.y}),s.deltaX=h.x+(a.x-l.x),s.deltaY=h.y+(a.y-l.y),e.offsetDirection=et(e.deltaX,e.deltaY);var f,v,m,g,y=tt(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=y.x,e.overallVelocityY=y.y,e.overallVelocity=w(y.x)>w(y.y)?y.x:y.y,e.scale=_?(m=_.pointers,it((g=n)[0],g[1],J)/it(m[0],m[1],J)):1,e.rotation=_?(f=_.pointers,nt((v=n)[1],v[0],J)+nt(f[1],f[0],J)):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,r,o,s=t.lastInterval||e,a=e.timeStamp-s.timeStamp;if(e.eventType!=B&&(D<a||s.velocity===x)){var l=e.deltaX-s.deltaX,h=e.deltaY-s.deltaY,c=tt(a,l,h);n=c.x,r=c.y,i=w(c.x)>w(c.y)?c.x:c.y,o=et(l,h),t.lastInterval=e}else i=s.velocity,n=s.velocityX,r=s.velocityY,o=s.direction;e.velocity=i,e.velocityX=n,e.velocityY=r,e.direction=o}(i,e);var b=t.element;S(e.srcEvent.target,b)&&(b=e.srcEvent.target),e.target=b}(t,i),t.emit(\"hammer.input\",i),t.recognize(i),t.session.prevInput=i}function K(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:h(t.pointers[i].clientX),clientY:h(t.pointers[i].clientY)},i++;return{timeStamp:k(),pointers:e,center:Z(e),deltaX:t.deltaX,deltaY:t.deltaY}}function Z(t){var e=t.length;if(1===e)return{x:h(t[0].clientX),y:h(t[0].clientY)};for(var i=0,n=0,r=0;r<e;)i+=t[r].clientX,n+=t[r].clientY,r++;return{x:h(i/e),y:h(n/e)}}function tt(t,e,i){return{x:e/t||0,y:i/t||0}}function et(t,e){return t===e?L:w(t)>=w(e)?t<0?V:G:e<0?U:q}function it(t,e,i){i||(i=W);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return Math.sqrt(n*n+r*r)}function nt(t,e,i){i||(i=W);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return 180*Math.atan2(r,n)/Math.PI}Q.prototype={handler:function(){},init:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(z(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(z(this.element),this.evWin,this.domHandler)}};var rt={mousedown:I,mousemove:2,mouseup:R},ot=\"mousedown\",st=\"mousemove mouseup\";function at(){this.evEl=ot,this.evWin=st,this.pressed=!1,Q.apply(this,arguments)}d(at,Q,{handler:function(t){var e=rt[t.type];e&I&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=R),this.pressed&&(e&R&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:\"mouse\",srcEvent:t}))}});var lt={pointerdown:I,pointermove:2,pointerup:R,pointercancel:B,pointerout:B},ht={2:F,3:\"pen\",4:\"mouse\",5:\"kinect\"},ct=\"pointerdown\",ut=\"pointermove pointerup pointercancel\";function _t(){this.evEl=ct,this.evWin=ut,Q.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(ct=\"MSPointerDown\",ut=\"MSPointerMove MSPointerUp MSPointerCancel\"),d(_t,Q,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace(\"ms\",\"\"),r=lt[n],o=ht[t.pointerType]||t.pointerType,s=o==F,a=C(e,t.pointerId,\"pointerId\");r&I&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):r&(R|B)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),i&&e.splice(a,1))}});var pt={touchstart:I,touchmove:2,touchend:R,touchcancel:B};function dt(){this.evTarget=\"touchstart\",this.evWin=\"touchstart touchmove touchend touchcancel\",this.started=!1,Q.apply(this,arguments)}d(dt,Q,{handler:function(t){var e=pt[t.type];if(e===I&&(this.started=!0),this.started){var i=function(t,e){var i=A(t.touches),n=A(t.changedTouches);return e&(R|B)&&(i=E(i.concat(n),\"identifier\",!0)),[i,n]}.call(this,t,e);e&(R|B)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:F,srcEvent:t})}}});var ft={touchstart:I,touchmove:2,touchend:R,touchcancel:B},vt=\"touchstart touchmove touchend touchcancel\";function mt(){this.evTarget=vt,this.targetIds={},Q.apply(this,arguments)}d(mt,Q,{handler:function(t){var e=ft[t.type],i=function(t,e){var i=A(t.touches),n=this.targetIds;if(e&(2|I)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,s=A(t.changedTouches),a=[],l=this.target;if(o=i.filter(function(t){return S(t.target,l)}),e===I)for(r=0;r<o.length;)n[o[r].identifier]=!0,r++;for(r=0;r<s.length;)n[s[r].identifier]&&a.push(s[r]),e&(R|B)&&delete n[s[r].identifier],r++;return a.length?[E(o.concat(a),\"identifier\",!0),a]:void 0}.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:F,srcEvent:t})}});var gt=2500;function yt(){Q.apply(this,arguments);var t=f(this.handler,this);this.touch=new mt(this.manager,t),this.mouse=new at(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function bt(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout(function(){var t=n.indexOf(i);-1<t&&n.splice(t,1)},gt)}}d(yt,Q,{handler:function(t,e,i){var n=i.pointerType==F,r=\"mouse\"==i.pointerType;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)(function(t,e){t&I?(this.primaryTouch=e.changedPointers[0].identifier,bt.call(this,e)):t&(R|B)&&bt.call(this,e)}).call(this,e,i);else if(r&&function(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],o=Math.abs(e-r.x),s=Math.abs(i-r.y);if(o<=25&&s<=25)return!0}return!1}.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var xt=M(e.style,\"touchAction\"),wt=xt!==x,kt=\"manipulation\",St=\"none\",Tt=\"pan-x\",Ct=\"pan-y\",At=function(){if(!wt)return!1;var e={},i=o.CSS&&o.CSS.supports;return[\"auto\",\"manipulation\",\"pan-y\",\"pan-x\",\"pan-x pan-y\",\"none\"].forEach(function(t){e[t]=!i||o.CSS.supports(\"touch-action\",t)}),e}();function Et(t,e){this.manager=t,this.set(e)}Et.prototype={set:function(t){\"compute\"==t&&(t=this.compute()),wt&&this.manager.element.style&&At[t]&&(this.manager.element.style[xt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return u(this.manager.recognizers,function(t){v(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(t){if(b(t,St))return St;var e=b(t,Tt),i=b(t,Ct);return e&&i?St:e||i?e?Tt:Ct:b(t,kt)?kt:\"auto\"}(e.join(\" \"))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,r=b(n,St)&&!At.none,o=b(n,Ct)&&!At[Ct],s=b(n,Tt)&&!At[Tt];if(r){var a=1===t.pointers.length,l=t.distance<2,h=t.deltaTime<250;if(a&&l&&h)return}if(!s||!o)return r||o&&i&Y||s&&i&X?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Mt=1;function Ot(t){this.options=s({},this.defaults,t||{}),this.id=O++,this.manager=null,this.options.enable=m(this.options.enable,!0),this.state=Mt,this.simultaneous={},this.requireFail=[]}function zt(t){return 16&t?\"cancel\":8&t?\"end\":4&t?\"move\":2&t?\"start\":\"\"}function Pt(t){return t==q?\"down\":t==U?\"up\":t==V?\"left\":t==G?\"right\":\"\"}function jt(t,e){var i=e.manager;return i?i.get(t):t}function Nt(){Ot.apply(this,arguments)}function Ft(){Nt.apply(this,arguments),this.pX=null,this.pY=null}function Dt(){Nt.apply(this,arguments)}function It(){Ot.apply(this,arguments),this._timer=null,this._input=null}function Rt(){Nt.apply(this,arguments)}function Bt(){Nt.apply(this,arguments)}function Lt(){Ot.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Vt(t,e){return(e=e||{}).recognizers=m(e.recognizers,Vt.defaults.preset),new Gt(t,e)}function Gt(t,e){var i;this.options=s({},Vt.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||(j?_t:N?mt:P?yt:at))(i,$),this.touchAction=new Et(this,this.options.touchAction),Ut(this,!0),u(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function Ut(i,n){var r,o=i.element;o.style&&(u(i.options.cssProps,function(t,e){r=M(o.style,e),n?(i.oldCssProps[r]=o.style[r],o.style[r]=t):o.style[r]=i.oldCssProps[r]||\"\"}),n||(i.oldCssProps={}))}Ot.prototype={defaults:{},set:function(t){return s(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(n(t,\"recognizeWith\",this))return this;var e=this.simultaneous;return t=jt(t,this),e[t.id]||(e[t.id]=t).recognizeWith(this),this},dropRecognizeWith:function(t){return n(t,\"dropRecognizeWith\",this)||(t=jt(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(n(t,\"requireFailure\",this))return this;var e=this.requireFail;return t=jt(t,this),-1===C(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(n(t,\"dropRequireFailure\",this))return this;t=jt(t,this);var e=C(this.requireFail,t);return-1<e&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return 0<this.requireFail.length},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(e){var i=this,t=this.state;function n(t){i.manager.emit(t,e)}t<8&&n(i.options.event+zt(t)),n(i.options.event),e.additionalEvent&&n(e.additionalEvent),8<=t&&n(i.options.event+zt(t))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(32|Mt)))return!1;t++}return!0},recognize:function(t){var e=s({},t);if(!v(this.options.enable,[this,e]))return this.reset(),void(this.state=32);56&this.state&&(this.state=Mt),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},d(Nt,Ot,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=6&e,r=this.attrTest(t);return n&&(i&B||!r)?16|e:n||r?i&R?8|e:2&e?4|e:2:32}}),d(Ft,Nt,{defaults:{event:\"pan\",threshold:10,pointers:1,direction:H},getTouchAction:function(){var t=this.options.direction,e=[];return t&Y&&e.push(Ct),t&X&&e.push(Tt),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(e.direction&Y?(r=0===o?L:o<0?V:G,i=o!=this.pX,n=Math.abs(t.deltaX)):(r=0===s?L:s<0?U:q,i=s!=this.pY,n=Math.abs(t.deltaY))),t.direction=r,i&&n>e.threshold&&r&e.direction},attrTest:function(t){return Nt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Pt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),d(Dt,Nt,{defaults:{event:\"pinch\",threshold:0,pointers:2},getTouchAction:function(){return[St]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?\"in\":\"out\";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),d(It,Ot,{defaults:{event:\"press\",pointers:1,time:251,threshold:9},getTouchAction:function(){return[\"auto\"]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!n||!i||t.eventType&(R|B)&&!r)this.reset();else if(t.eventType&I)this.reset(),this._timer=c(function(){this.state=8,this.tryEmit()},e.time,this);else if(t.eventType&R)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&R?this.manager.emit(this.options.event+\"up\",t):(this._input.timeStamp=k(),this.manager.emit(this.options.event,this._input)))}}),d(Rt,Nt,{defaults:{event:\"rotate\",threshold:0,pointers:2},getTouchAction:function(){return[St]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),d(Bt,Nt,{defaults:{event:\"swipe\",threshold:10,velocity:.3,direction:Y|X,pointers:1},getTouchAction:function(){return Ft.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Y|X)?e=t.overallVelocity:i&Y?e=t.overallVelocityX:i&X&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&w(e)>this.options.velocity&&t.eventType&R},emit:function(t){var e=Pt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),d(Lt,Ot,{defaults:{event:\"tap\",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[kt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&I&&0===this.count)return this.failTimeout();if(n&&r&&i){if(t.eventType!=R)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,s=!this.pCenter||it(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,s&&o?this.count+=1:this.count=1,this._input=t;var a=this.count%e.taps;if(0===a)return this.hasRequireFailures()?(this._timer=c(function(){this.state=8,this.tryEmit()},e.interval,this),2):8}return 32},failTimeout:function(){return this._timer=c(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Vt.VERSION=\"2.0.7\",Vt.defaults={domEvents:!1,touchAction:\"compute\",enable:!0,inputTarget:null,inputClass:null,preset:[[Rt,{enable:!1}],[Dt,{enable:!1},[\"rotate\"]],[Bt,{direction:Y}],[Ft,{direction:Y},[\"swipe\"]],[Lt],[Lt,{event:\"doubletap\",taps:2},[\"tap\"]],[It]],cssProps:{userSelect:\"none\",touchSelect:\"none\",touchCallout:\"none\",contentZooming:\"none\",userDrag:\"none\",tapHighlightColor:\"rgba(0,0,0,0)\"}},Gt.prototype={set:function(t){return s(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,r=e.curRecognizer;(!r||r&&8&r.state)&&(r=e.curRecognizer=null);for(var o=0;o<n.length;)i=n[o],2===e.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(t),!r&&14&i.state&&(r=e.curRecognizer=i),o++}},get:function(t){if(t instanceof Ot)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(n(t,\"add\",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),(t.manager=this).touchAction.update(),t},remove:function(t){if(n(t,\"remove\",this))return this;if(t=this.get(t)){var e=this.recognizers,i=C(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(t!==x&&e!==x){var i=this.handlers;return u(T(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this}},off:function(t,e){if(t!==x){var i=this.handlers;return u(T(t),function(t){e?i[t]&&i[t].splice(C(i[t],e),1):delete i[t]}),this}},emit:function(t,e){var i,n,r;this.options.domEvents&&(i=t,n=e,(r=a.createEvent(\"Event\")).initEvent(i,!0,!0),(r.gesture=n).target.dispatchEvent(r));var o=this.handlers[t]&&this.handlers[t].slice();if(o&&o.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var s=0;s<o.length;)o[s](e),s++}},destroy:function(){this.element&&Ut(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},s(Vt,{INPUT_START:I,INPUT_MOVE:2,INPUT_END:R,INPUT_CANCEL:B,STATE_POSSIBLE:Mt,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:L,DIRECTION_LEFT:V,DIRECTION_RIGHT:G,DIRECTION_UP:U,DIRECTION_DOWN:q,DIRECTION_HORIZONTAL:Y,DIRECTION_VERTICAL:X,DIRECTION_ALL:H,Manager:Gt,Input:Q,TouchAction:Et,TouchInput:mt,MouseInput:at,PointerEventInput:_t,TouchMouseInput:yt,SingleTouchInput:dt,Recognizer:Ot,AttrRecognizer:Nt,Tap:Lt,Pan:Ft,Swipe:Bt,Pinch:Dt,Rotate:Rt,Press:It,on:g,off:y,each:u,merge:p,extend:_,assign:s,inherit:d,bindFn:f,prefixed:M});var qt=void 0!==o?o:\"undefined\"!=typeof self?self:{};qt.Hammer=Vt,void 0!==Yt&&Yt.exports?Yt.exports=Vt:o.Hammer=Vt}(window,document)},function(t,e,i){var n,r,o=t(349);(r=n=i.Operator||(i.Operator={}))[r.Le=0]=\"Le\",r[r.Ge=1]=\"Ge\",r[r.Eq=2]=\"Eq\";var s=function(){function t(t,e,i){void 0===i&&(i=o.Strength.required),this._id=a++,this._operator=e,this._expression=t,this._strength=o.Strength.clip(i)}return t.Compare=function(t,e){return t.id-e.id},t.prototype.toString=function(){var t=this;return this._expression+\" \"+function(){switch(t._operator){case n.Le:return\"<=\";case n.Ge:return\">=\";case n.Eq:return\"==\"}}()+\" 0\"},Object.defineProperty(t.prototype,\"id\",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"expression\",{get:function(){return this._expression},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"op\",{get:function(){return this._operator},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"strength\",{get:function(){return this._strength},enumerable:!0,configurable:!0}),t}();i.Constraint=s;var a=0},function(t,e,i){var h=t(353),c=t(356),u=t(347),n=function(){function t(){var t=function(t){for(var e=0,i=function(){return 0},n=u.createMap(c.Variable.Compare),r=0,o=t.length;r<o;++r){var s=t[r];if(\"number\"==typeof s)e+=s;else if(s instanceof c.Variable)n.setDefault(s,i).second+=1;else{if(!(s instanceof Array))throw new Error(\"invalid Expression argument: \"+JSON.stringify(s));if(2!==s.length)throw new Error(\"array must have length 2\");var a=s[0],l=s[1];if(\"number\"!=typeof a)throw new Error(\"array item 0 must be a number\");if(!(l instanceof c.Variable))throw new Error(\"array item 1 must be a variable\");n.setDefault(l,i).second+=a}}return{terms:n,constant:e}}(arguments);this._terms=t.terms,this._constant=t.constant}return t.prototype.toString=function(){var e=[];h.forEach(this._terms,function(t){e.push([t.first,t.second])});for(var t=!0,i=\"\",n=0,r=e;n<r.length;n++){var o=r[n],s=o[0],a=o[1];t?(t=!1,i+=1==a?\"\"+s:-1==a?\"-\"+s:a+\"*\"+s):i+=1==a?\" + \"+s:-1==a?\" - \"+s:0<=a?\" + \"+a+s:\" - \"+-a+s}var l=this.constant;return l<0?i+=\" - \"+-l:0<l&&(i+=\" + \"+l),i},Object.defineProperty(t.prototype,\"terms\",{get:function(){return this._terms},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"constant\",{get:function(){return this._constant},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"value\",{get:function(){var e=this._constant;return h.forEach(this._terms,function(t){e+=t.first.value*t.second}),e},enumerable:!0,configurable:!0}),t}();i.Expression=n},function(t,e,i){\n",
" /*-----------------------------------------------------------------------------\n",
" | Copyright (c) 2014, Nucleic Development Team.\n",
" |\n",
" | Distributed under the terms of the Modified BSD License.\n",
" |\n",
" | The full license is in the file COPYING.txt, distributed with this software.\n",
" |----------------------------------------------------------------------------*/\n",
" function n(t){for(var e in t)i.hasOwnProperty(e)||(i[e]=t[e])}n(t(356)),n(t(345)),n(t(344)),n(t(349)),n(t(348))},function(t,e,i){var n=t(353);i.createMap=function(t){return new n.AssociativeArray(t)}},function(t,e,i){var g,n,r=t(356),a=t(345),y=t(344),b=t(349),o=t(347),s=t(353),l=function(){function t(){this._cnMap=o.createMap(y.Constraint.Compare),this._rowMap=o.createMap(h.Compare),this._varMap=o.createMap(r.Variable.Compare),this._editMap=o.createMap(r.Variable.Compare),this._infeasibleRows=[],this._objective=new k,this._artificial=null,this._idTick=0}return t.prototype.addConstraint=function(t){var e=this._cnMap.find(t);if(void 0!==e)throw new Error(\"duplicate constraint\");var i=this._createRow(t),n=i.row,r=i.tag,o=this._chooseSubject(n,r);if(o.type()===g.Invalid&&n.allDummies()){if(!x(n.constant())){for(var s=[],a=0,l=t.expression.terms._array;a<l.length;a++){var h=l[a];s.push(h.first.name)}var c=[\"LE\",\"GE\",\"EQ\"][t.op];throw new Error(\"unsatisfiable constraint [\"+s.join(\",\")+\"] operator: \"+c)}o=r.marker}if(o.type()===g.Invalid){if(!this._addWithArtificialVariable(n))throw new Error(\"unsatisfiable constraint\")}else n.solveFor(o),this._substitute(o,n),this._rowMap.insert(o,n);this._cnMap.insert(t,r),this._optimize(this._objective)},t.prototype.removeConstraint=function(t,e){void 0===e&&(e=!1);var i=this._cnMap.erase(t);if(void 0===i){if(e)return;throw new Error(\"unknown constraint\")}this._removeConstraintEffects(t,i.second);var n=i.second.marker,r=this._rowMap.erase(n);if(void 0===r){var o=this._getMarkerLeavingSymbol(n);if(o.type()===g.Invalid)throw new Error(\"failed to find leaving row\");(r=this._rowMap.erase(o)).second.solveForEx(o,n),this._substitute(n,r.second)}this._optimize(this._objective)},t.prototype.hasConstraint=function(t){return this._cnMap.contains(t)},t.prototype.addEditVariable=function(t,e){var i=this._editMap.find(t);if(void 0!==i)throw new Error(\"duplicate edit variable: \"+t.name);if((e=b.Strength.clip(e))===b.Strength.required)throw new Error(\"bad required strength\");var n=new a.Expression(t),r=new y.Constraint(n,y.Operator.Eq,e);this.addConstraint(r);var o=this._cnMap.find(r).second,s={tag:o,constraint:r,constant:0};this._editMap.insert(t,s)},t.prototype.removeEditVariable=function(t,e){void 0===e&&(e=!1);var i=this._editMap.erase(t);if(void 0===i){if(e)return;throw new Error(\"unknown edit variable: \"+t.name)}this.removeConstraint(i.second.constraint,e)},t.prototype.hasEditVariable=function(t){return this._editMap.contains(t)},t.prototype.suggestValue=function(t,e){var i=this._editMap.find(t);if(void 0===i)throw new Error(\"unknown edit variable: \"+t.name);var n=this._rowMap,r=i.second,o=e-r.constant;r.constant=e;var s=r.tag.marker,a=n.find(s);if(void 0!==a)return a.second.add(-o)<0&&this._infeasibleRows.push(s),void this._dualOptimize();var l=r.tag.other;if(void 0!==(a=n.find(l)))return a.second.add(o)<0&&this._infeasibleRows.push(l),void this._dualOptimize();for(var h=0,c=n.size();h<c;++h){var u=n.itemAt(h),_=u.second,p=_.coefficientFor(s);0!==p&&_.add(o*p)<0&&u.first.type()!==g.External&&this._infeasibleRows.push(u.first)}this._dualOptimize()},t.prototype.updateVariables=function(){for(var t=this._varMap,e=this._rowMap,i=0,n=t.size();i<n;++i){var r=t.itemAt(i),o=e.find(r.second),s=0;void 0!==o&&-0===(s=o.second.constant())&&(s=0),r.first.setValue(s)}},t.prototype.getConstraints=function(){var e=[];return s.forEach(this._cnMap,function(t){e.push(t.first)}),e},Object.defineProperty(t.prototype,\"numConstraints\",{get:function(){return this._cnMap.size()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"numEditVariables\",{get:function(){return this._editMap.size()},enumerable:!0,configurable:!0}),t.prototype._getVarSymbol=function(t){var e=this;return this._varMap.setDefault(t,function(){return e._makeSymbol(g.External)}).second},t.prototype._createRow=function(t){for(var e=t.expression,i=new k(e.constant),n=e.terms,r=0,o=n.size();r<o;++r){var s=n.itemAt(r);if(!x(s.second)){var a=this._getVarSymbol(s.first),l=this._rowMap.find(a);void 0!==l?i.insertRow(l.second,s.second):i.insertSymbol(a,s.second)}}var h=this._objective,c=t.strength,u={marker:w,other:w};switch(t.op){case y.Operator.Le:case y.Operator.Ge:var _=t.op===y.Operator.Le?1:-1,p=this._makeSymbol(g.Slack);if(u.marker=p,i.insertSymbol(p,_),c<b.Strength.required){var d=this._makeSymbol(g.Error);u.other=d,i.insertSymbol(d,-_),h.insertSymbol(d,c)}break;case y.Operator.Eq:if(c<b.Strength.required){var f=this._makeSymbol(g.Error),v=this._makeSymbol(g.Error);u.marker=f,u.other=v,i.insertSymbol(f,-1),i.insertSymbol(v,1),h.insertSymbol(f,c),h.insertSymbol(v,c)}else{var m=this._makeSymbol(g.Dummy);u.marker=m,i.insertSymbol(m)}}return i.constant()<0&&i.reverseSign(),{row:i,tag:u}},t.prototype._chooseSubject=function(t,e){for(var i=t.cells(),n=0,r=i.size();n<r;++n){var o=i.itemAt(n);if(o.first.type()===g.External)return o.first}var s=e.marker.type();return(s===g.Slack||s===g.Error)&&t.coefficientFor(e.marker)<0?e.marker:((s=e.other.type())===g.Slack||s===g.Error)&&t.coefficientFor(e.other)<0?e.other:w},t.prototype._addWithArtificialVariable=function(t){var e=this._makeSymbol(g.Slack);this._rowMap.insert(e,t.copy()),this._artificial=t.copy(),this._optimize(this._artificial);var i=x(this._artificial.constant());this._artificial=null;var n=this._rowMap.erase(e);if(void 0!==n){var r=n.second;if(r.isConstant())return i;var o=this._anyPivotableSymbol(r);if(o.type()===g.Invalid)return!1;r.solveForEx(e,o),this._substitute(o,r),this._rowMap.insert(o,r)}for(var s=this._rowMap,a=0,l=s.size();a<l;++a)s.itemAt(a).second.removeSymbol(e);return this._objective.removeSymbol(e),i},t.prototype._substitute=function(t,e){for(var i=this._rowMap,n=0,r=i.size();n<r;++n){var o=i.itemAt(n);o.second.substitute(t,e),o.second.constant()<0&&o.first.type()!==g.External&&this._infeasibleRows.push(o.first)}this._objective.substitute(t,e),this._artificial&&this._artificial.substitute(t,e)},t.prototype._optimize=function(t){for(;;){var e=this._getEnteringSymbol(t);if(e.type()===g.Invalid)return;var i=this._getLeavingSymbol(e);if(i.type()===g.Invalid)throw new Error(\"the objective is unbounded\");var n=this._rowMap.erase(i).second;n.solveForEx(i,e),this._substitute(e,n),this._rowMap.insert(e,n)}},t.prototype._dualOptimize=function(){for(var t=this._rowMap,e=this._infeasibleRows;0!==e.length;){var i=e.pop(),n=t.find(i);if(void 0!==n&&n.second.constant()<0){var r=this._getDualEnteringSymbol(n.second);if(r.type()===g.Invalid)throw new Error(\"dual optimize failed\");var o=n.second;t.erase(i),o.solveForEx(i,r),this._substitute(r,o),t.insert(r,o)}}},t.prototype._getEnteringSymbol=function(t){for(var e=t.cells(),i=0,n=e.size();i<n;++i){var r=e.itemAt(i),o=r.first;if(r.second<0&&o.type()!==g.Dummy)return o}return w},t.prototype._getDualEnteringSymbol=function(t){for(var e=Number.MAX_VALUE,i=w,n=t.cells(),r=0,o=n.size();r<o;++r){var s=n.itemAt(r),a=s.first,l=s.second;if(0<l&&a.type()!==g.Dummy){var h=this._objective.coefficientFor(a),c=h/l;c<e&&(e=c,i=a)}}return i},t.prototype._getLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,i=w,n=this._rowMap,r=0,o=n.size();r<o;++r){var s=n.itemAt(r),a=s.first;if(a.type()!==g.External){var l=s.second,h=l.coefficientFor(t);if(h<0){var c=-l.constant()/h;c<e&&(e=c,i=a)}}}return i},t.prototype._getMarkerLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,i=e,n=e,r=w,o=r,s=r,a=r,l=this._rowMap,h=0,c=l.size();h<c;++h){var u=l.itemAt(h),_=u.second,p=_.coefficientFor(t);if(0!==p){var d=u.first;if(d.type()===g.External)a=d;else if(p<0){var f=-_.constant()/p;f<i&&(i=f,o=d)}else{var f=_.constant()/p;f<n&&(n=f,s=d)}}}return o!==r?o:s!==r?s:a},t.prototype._removeConstraintEffects=function(t,e){e.marker.type()===g.Error&&this._removeMarkerEffects(e.marker,t.strength),e.other.type()===g.Error&&this._removeMarkerEffects(e.other,t.strength)},t.prototype._removeMarkerEffects=function(t,e){var i=this._rowMap.find(t);void 0!==i?this._objective.insertRow(i.second,-e):this._objective.insertSymbol(t,-e)},t.prototype._anyPivotableSymbol=function(t){for(var e=t.cells(),i=0,n=e.size();i<n;++i){var r=e.itemAt(i),o=r.first.type();if(o===g.Slack||o===g.Error)return r.first}return w},t.prototype._makeSymbol=function(t){return new h(t,this._idTick++)},t}();function x(t){return t<0?-t<1e-8:t<1e-8}i.Solver=l,(n=g||(g={}))[n.Invalid=0]=\"Invalid\",n[n.External=1]=\"External\",n[n.Slack=2]=\"Slack\",n[n.Error=3]=\"Error\",n[n.Dummy=4]=\"Dummy\";var h=function(){function t(t,e){this._id=e,this._type=t}return t.Compare=function(t,e){return t.id()-e.id()},t.prototype.id=function(){return this._id},t.prototype.type=function(){return this._type},t}(),w=new h(g.Invalid,-1),k=function(){function e(t){void 0===t&&(t=0),this._cellMap=o.createMap(h.Compare),this._constant=t}return e.prototype.cells=function(){return this._cellMap},e.prototype.constant=function(){return this._constant},e.prototype.isConstant=function(){return this._cellMap.empty()},e.prototype.allDummies=function(){for(var t=this._cellMap,e=0,i=t.size();e<i;++e){var n=t.itemAt(e);if(n.first.type()!==g.Dummy)return!1}return!0},e.prototype.copy=function(){var t=new e(this._constant);return t._cellMap=this._cellMap.copy(),t},e.prototype.add=function(t){return this._constant+=t},e.prototype.insertSymbol=function(t,e){void 0===e&&(e=1);var i=this._cellMap.setDefault(t,function(){return 0});x(i.second+=e)&&this._cellMap.erase(t)},e.prototype.insertRow=function(t,e){void 0===e&&(e=1),this._constant+=t._constant*e;for(var i=t._cellMap,n=0,r=i.size();n<r;++n){var o=i.itemAt(n);this.insertSymbol(o.first,o.second*e)}},e.prototype.removeSymbol=function(t){this._cellMap.erase(t)},e.prototype.reverseSign=function(){this._constant=-this._constant;for(var t=this._cellMap,e=0,i=t.size();e<i;++e){var n=t.itemAt(e);n.second=-n.second}},e.prototype.solveFor=function(t){var e=this._cellMap,i=e.erase(t),n=-1/i.second;this._constant*=n;for(var r=0,o=e.size();r<o;++r)e.itemAt(r).second*=n},e.prototype.solveForEx=function(t,e){this.insertSymbol(t,-1),this.solveFor(e)},e.prototype.coefficientFor=function(t){var e=this._cellMap.find(t);return void 0!==e?e.second:0},e.prototype.substitute=function(t,e){var i=this._cellMap.erase(t);void 0!==i&&this.insertRow(e,i.second)},e}()},function(t,e,i){!function(e){function t(t,e,i,n){void 0===n&&(n=1);var r=0;return r+=1e6*Math.max(0,Math.min(1e3,t*n)),r+=1e3*Math.max(0,Math.min(1e3,e*n)),r+=Math.max(0,Math.min(1e3,i*n))}e.create=t,e.required=t(1e3,1e3,1e3),e.strong=t(1,0,0),e.medium=t(0,1,0),e.weak=t(0,0,1),e.clip=function(t){return Math.max(0,Math.min(e.required,t))}}(i.Strength||(i.Strength={}))},function(t,e,i){var l=t(354);function o(t,e,i){for(var n,r,o=0,s=t.length;0<s;)i(t[r=o+(n=s>>1)],e)<0?(o=r+1,s-=n+1):s=n;return o}i.lowerBound=o,i.binarySearch=function(t,e,i){var n=o(t,e,i);if(n===t.length)return-1;var r=t[n];return 0!==i(r,e)?-1:n},i.binaryFind=function(t,e,i){var n=o(t,e,i);if(n!==t.length){var r=t[n];if(0===i(r,e))return r}},i.asSet=function(t,e){var i=l.asArray(t),n=i.length;if(n<=1)return i;i.sort(e);for(var r=[i[0]],o=1,s=0;o<n;++o){var a=i[o];0!==e(r[s],a)&&(r.push(a),++s)}return r},i.setIsDisjoint=function(t,e,i){for(var n=0,r=0,o=t.length,s=e.length;n<o&&r<s;){var a=i(t[n],e[r]);if(a<0)++n;else{if(!(0<a))return!1;++r}}return!0},i.setIsSubset=function(t,e,i){var n=t.length,r=e.length;if(r<n)return!1;for(var o=0,s=0;o<n&&s<r;){var a=i(t[o],e[s]);if(a<0)return!1;0<a||++o,++s}return!(o<n)},i.setUnion=function(t,e,i){for(var n=0,r=0,o=t.length,s=e.length,a=[];n<o&&r<s;){var l=t[n],h=e[r],c=i(l,h);c<0?(a.push(l),++n):(0<c?a.push(h):(a.push(l),++n),++r)}for(;n<o;)a.push(t[n]),++n;for(;r<s;)a.push(e[r]),++r;return a},i.setIntersection=function(t,e,i){for(var n=0,r=0,o=t.length,s=e.length,a=[];n<o&&r<s;){var l=t[n],h=e[r],c=i(l,h);c<0?++n:(0<c||(a.push(l),++n),++r)}return a},i.setDifference=function(t,e,i){for(var n=0,r=0,o=t.length,s=e.length,a=[];n<o&&r<s;){var l=t[n],h=e[r],c=i(l,h);c<0?(a.push(l),++n):(0<c||++n,++r)}for(;n<o;)a.push(t[n]),++n;return a},i.setSymmetricDifference=function(t,e,i){for(var n=0,r=0,o=t.length,s=e.length,a=[];n<o&&r<s;){var l=t[n],h=e[r],c=i(l,h);c<0?(a.push(l),++n):(0<c?a.push(h):++n,++r)}for(;n<o;)a.push(t[n]),++n;for(;r<s;)a.push(e[r]),++r;return a}},function(t,e,i){var n=t(354),r=function(){function t(){this._array=[]}return t.prototype.size=function(){return this._array.length},t.prototype.empty=function(){return 0===this._array.length},t.prototype.itemAt=function(t){return this._array[t]},t.prototype.takeAt=function(t){return this._array.splice(t,1)[0]},t.prototype.clear=function(){this._array=[]},t.prototype.swap=function(t){var e=this._array;this._array=t._array,t._array=e},t.prototype.__iter__=function(){return n.iter(this._array)},t.prototype.__reversed__=function(){return n.reversed(this._array)},t}();i.ArrayBase=r},function(t,e,i){\n",
" /*-----------------------------------------------------------------------------\n",
" | Copyright (c) 2014, Nucleic Development Team.\n",
" |\n",
" | Distributed under the terms of the Modified BSD License.\n",
" |\n",
" | The full license is in the file COPYING.txt, distributed with this software.\n",
" |----------------------------------------------------------------------------*/\n",
" var n,r=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),s=t(355),o=t(351),a=t(350),l=t(354),h=function(n){function o(t){var i,e=n.call(this)||this;return e._compare=t,e._wrapped=(i=t,function(t,e){return i(t.first,e)}),e}return r(o,n),o.prototype.comparitor=function(){return this._compare},o.prototype.indexOf=function(t){return a.binarySearch(this._array,t,this._wrapped)},o.prototype.contains=function(t){return 0<=a.binarySearch(this._array,t,this._wrapped)},o.prototype.find=function(t){return a.binaryFind(this._array,t,this._wrapped)},o.prototype.setDefault=function(t,e){var i=this._array,n=a.lowerBound(i,t,this._wrapped);if(n===i.length){var r=new s.Pair(t,e());return i.push(r),r}var o=i[n];if(0!==this._compare(o.first,t)){var r=new s.Pair(t,e());return i.splice(n,0,r),r}return o},o.prototype.insert=function(t,e){var i=this._array,n=a.lowerBound(i,t,this._wrapped);if(n===i.length){var r=new s.Pair(t,e);return i.push(r),r}var o=i[n];if(0!==this._compare(o.first,t)){var r=new s.Pair(t,e);return i.splice(n,0,r),r}return o.second=e,o},o.prototype.update=function(t){var e=this;t instanceof o?this._array=function(t,e,i){for(var n=0,r=0,o=t.length,s=e.length,a=[];n<o&&r<s;){var l=t[n],h=e[r],c=i(l.first,h.first);c<0?(a.push(l.copy()),++n):(0<c?a.push(h.copy()):(a.push(h.copy()),++n),++r)}for(;n<o;)a.push(t[n].copy()),++n;for(;r<s;)a.push(e[r].copy()),++r;return a}(this._array,t._array,this._compare):l.forEach(t,function(t){e.insert(t.first,t.second)})},o.prototype.erase=function(t){var e=this._array,i=a.binarySearch(e,t,this._wrapped);if(!(i<0))return e.splice(i,1)[0]},o.prototype.copy=function(){for(var t=new o(this._compare),e=t._array,i=this._array,n=0,r=i.length;n<r;++n)e.push(i[n].copy());return t},o}(o.ArrayBase);i.AssociativeArray=h},function(t,e,i){function n(t){for(var e in t)i.hasOwnProperty(e)||(i[e]=t[e])}n(t(350)),n(t(351)),n(t(352)),n(t(354)),n(t(355))},function(t,e,i){var n=function(){function t(t,e){void 0===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}();i.ArrayIterator=n;var r=function(){function t(t,e){void 0===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}();i.ReverseArrayIterator=r,i.iter=function(t){return t instanceof Array?new n(t):t.__iter__()},i.reversed=function(t){return t instanceof Array?new r(t):t.__reversed__()},i.next=function(t){return t.__next__()},i.asArray=function(t){if(t instanceof Array)return t.slice();for(var e,i=[],n=t.__iter__();void 0!==(e=n.__next__());)i.push(e);return i},i.forEach=function(t,e){if(t instanceof Array){for(var i=0,n=t.length;i<n;++i)if(!1===e(t[i]))return}else for(var r,o=t.__iter__();void 0!==(r=o.__next__());)if(!1===e(r))return},i.map=function(t,e){var i=[];if(t instanceof Array)for(var n=0,r=t.length;n<r;++n)i.push(e(t[n]));else for(var o,s=t.__iter__();void 0!==(o=s.__next__());)i.push(e(o));return i},i.filter=function(t,e){var i,n=[];if(t instanceof Array)for(var r=0,o=t.length;r<o;++r)i=t[r],e(i)&&n.push(i);else for(var s=t.__iter__();void 0!==(i=s.__next__());)e(i)&&n.push(i);return n}},function(t,e,i){var n=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.copy=function(){return new t(this.first,this.second)},t}();i.Pair=n},function(t,e,i){var n=function(){function t(t){void 0===t&&(t=\"\"),this._value=0,this._context=null,this._id=r++,this._name=t}return t.Compare=function(t,e){return t.id-e.id},t.prototype.toString=function(){return this._name},Object.defineProperty(t.prototype,\"id\",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"name\",{get:function(){return this._name},enumerable:!0,configurable:!0}),t.prototype.setName=function(t){this._name=t},Object.defineProperty(t.prototype,\"context\",{get:function(){return this._context},enumerable:!0,configurable:!0}),t.prototype.setContext=function(t){this._context=t},Object.defineProperty(t.prototype,\"value\",{get:function(){return this._value},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t){this._value=t},t}();i.Variable=n;var r=0},function(t,e,i){\n",
" /*!\n",
" * numbro.js\n",
" * version : 1.6.2\n",
" * author : Företagsplatsen AB\n",
" * license : MIT\n",
" * http://www.foretagsplatsen.se\n",
" */\n",
" var c,U={},o=U,q=\"en-US\",Y=null,r=\"0,0\";function n(t){this._value=t}function p(t){var e,i=\"\";for(e=0;e<t;e++)i+=\"0\";return i}function X(t,e,i,n){var r,o,s,a,l,h,c,u,_=Math.pow(10,e);return o=-1<t.toFixed(0).search(\"e\")?(s=e,u=t.toString(),a=u.split(\"e\")[0],c=u.split(\"e\")[1],l=a.split(\".\")[0],h=a.split(\".\")[1]||\"\",u=l+h+p(c-h.length),0<s&&(u+=\".\"+p(s)),u):(i(t*_)/_).toFixed(e),n&&(r=new RegExp(\"0{1,\"+n+\"}$\"),o=o.replace(r,\"\")),o}function s(t,e,i){var n,r,o,s,a,l,h,c,u,_;return-1<e.indexOf(\"$\")?n=function(t,e,i){var n,r,o=e,s=o.indexOf(\"$\"),a=o.indexOf(\"(\"),l=o.indexOf(\"+\"),h=o.indexOf(\"-\"),c=\"\",u=\"\";if(-1===o.indexOf(\"$\")?\"infix\"===U[q].currency.position?(u=U[q].currency.symbol,U[q].currency.spaceSeparated&&(u=\" \"+u+\" \")):U[q].currency.spaceSeparated&&(c=\" \"):-1<o.indexOf(\" $\")?(c=\" \",o=o.replace(\" $\",\"\")):-1<o.indexOf(\"$ \")?(c=\" \",o=o.replace(\"$ \",\"\")):o=o.replace(\"$\",\"\"),r=d(t,o,i,u),-1===e.indexOf(\"$\"))switch(U[q].currency.position){case\"postfix\":-1<r.indexOf(\")\")?((r=r.split(\"\")).splice(-1,0,c+U[q].currency.symbol),r=r.join(\"\")):r=r+c+U[q].currency.symbol;break;case\"infix\":break;case\"prefix\":-1<r.indexOf(\"(\")||-1<r.indexOf(\"-\")?(r=r.split(\"\"),n=Math.max(a,h)+1,r.splice(n,0,U[q].currency.symbol+c),r=r.join(\"\")):r=U[q].currency.symbol+c+r;break;default:throw Error('Currency position should be among [\"prefix\", \"infix\", \"postfix\"]')}else s<=1?-1<r.indexOf(\"(\")||-1<r.indexOf(\"+\")||-1<r.indexOf(\"-\")?(r=r.split(\"\"),n=1,(s<a||s<l||s<h)&&(n=0),r.splice(n,0,U[q].currency.symbol+c),r=r.join(\"\")):r=U[q].currency.symbol+c+r:-1<r.indexOf(\")\")?((r=r.split(\"\")).splice(-1,0,c+U[q].currency.symbol),r=r.join(\"\")):r=r+c+U[q].currency.symbol;return r}(t,e,i):-1<e.indexOf(\"%\")?(l=t,c=i,_=\"\",l*=100,-1<(h=e).indexOf(\" %\")?(_=\" \",h=h.replace(\" %\",\"\")):h=h.replace(\"%\",\"\"),-1<(u=d(l,h,c)).indexOf(\")\")?((u=u.split(\"\")).splice(-1,0,_+\"%\"),u=u.join(\"\")):u=u+_+\"%\",n=u):-1<e.indexOf(\":\")?(r=t,o=Math.floor(r/60/60),s=Math.floor((r-60*o*60)/60),a=Math.round(r-60*o*60-60*s),n=o+\":\"+(s<10?\"0\"+s:s)+\":\"+(a<10?\"0\"+a:a)):n=d(t,e,i),n}function d(t,e,i,n){var r,o,s,a,l,h,c,u,_,p,d,f,v,m,g,y,b,x,w,k=!1,S=!1,T=!1,C=\"\",A=!1,E=!1,M=!1,O=!1,z=!1,P=\"\",j=\"\",N=Math.abs(t),F=[\"B\",\"KiB\",\"MiB\",\"GiB\",\"TiB\",\"PiB\",\"EiB\",\"ZiB\",\"YiB\"],D=[\"B\",\"KB\",\"MB\",\"GB\",\"TB\",\"PB\",\"EB\",\"ZB\",\"YB\"],I=\"\",R=!1,B=!1;if(0===t&&null!==Y)return Y;if(!isFinite(t))return\"\"+t;if(0===e.indexOf(\"{\")){var L=e.indexOf(\"}\");if(-1===L)throw Error('Format should also contain a \"}\"');f=e.slice(1,L),e=e.slice(L+1)}else f=\"\";if(e.indexOf(\"}\")===e.length-1){var V=e.indexOf(\"{\");if(-1===V)throw Error('Format should also contain a \"{\"');v=e.slice(V+1,-1),e=e.slice(0,V+1)}else v=\"\";if(w=-1===e.indexOf(\".\")?e.match(/([0-9]+).*/):e.match(/([0-9]+)\\..*/),x=null===w?-1:w[1].length,-1!==e.indexOf(\"-\")&&(R=!0),-1<e.indexOf(\"(\")?(k=!0,e=e.slice(1,-1)):-1<e.indexOf(\"+\")&&(S=!0,e=e.replace(/\\+/g,\"\")),-1<e.indexOf(\"a\")){if(p=e.split(\".\")[0].match(/[0-9]+/g)||[\"0\"],p=parseInt(p[0],10),A=0<=e.indexOf(\"aK\"),E=0<=e.indexOf(\"aM\"),M=0<=e.indexOf(\"aB\"),O=0<=e.indexOf(\"aT\"),z=A||E||M||O,-1<e.indexOf(\" a\")?(C=\" \",e=e.replace(\" a\",\"\")):e=e.replace(\"a\",\"\"),l=Math.floor(Math.log(N)/Math.LN10)+1,c=0==(c=l%3)?3:c,p&&0!==N&&(h=Math.floor(Math.log(N)/Math.LN10)+1-p,u=3*~~((Math.min(p,l)-c)/3),N/=Math.pow(10,u),-1===e.indexOf(\".\")&&3<p))for(e+=\"[.]\",y=(y=0===h?0:3*~~(h/3)-h)<0?y+3:y,r=0;r<y;r++)e+=\"0\";Math.floor(Math.log(Math.abs(t))/Math.LN10)+1!==p&&(N>=Math.pow(10,12)&&!z||O?(C+=U[q].abbreviations.trillion,t/=Math.pow(10,12)):N<Math.pow(10,12)&&N>=Math.pow(10,9)&&!z||M?(C+=U[q].abbreviations.billion,t/=Math.pow(10,9)):N<Math.pow(10,9)&&N>=Math.pow(10,6)&&!z||E?(C+=U[q].abbreviations.million,t/=Math.pow(10,6)):(N<Math.pow(10,6)&&N>=Math.pow(10,3)&&!z||A)&&(C+=U[q].abbreviations.thousand,t/=Math.pow(10,3)))}if(-1<e.indexOf(\"b\"))for(-1<e.indexOf(\" b\")?(P=\" \",e=e.replace(\" b\",\"\")):e=e.replace(\"b\",\"\"),a=0;a<=F.length;a++)if(o=Math.pow(1024,a),s=Math.pow(1024,a+1),o<=t&&t<s){P+=F[a],0<o&&(t/=o);break}if(-1<e.indexOf(\"d\"))for(-1<e.indexOf(\" d\")?(P=\" \",e=e.replace(\" d\",\"\")):e=e.replace(\"d\",\"\"),a=0;a<=D.length;a++)if(o=Math.pow(1e3,a),s=Math.pow(1e3,a+1),o<=t&&t<s){P+=D[a],0<o&&(t/=o);break}if(-1<e.indexOf(\"o\")&&(-1<e.indexOf(\" o\")?(j=\" \",e=e.replace(\" o\",\"\")):e=e.replace(\"o\",\"\"),U[q].ordinal&&(j+=U[q].ordinal(t))),-1<e.indexOf(\"[.]\")&&(T=!0,e=e.replace(\"[.]\",\".\")),_=t.toString().split(\".\")[0],d=e.split(\".\")[1],m=e.indexOf(\",\"),d){if(-1!==d.indexOf(\"*\")?I=X(t,t.toString().split(\".\")[1].length,i):-1<d.indexOf(\"[\")?(d=(d=d.replace(\"]\",\"\")).split(\"[\"),I=X(t,d[0].length+d[1].length,i,d[1].length)):I=X(t,d.length,i),_=I.split(\".\")[0],I.split(\".\")[1].length){var G=n?C+n:U[q].delimiters.decimal;I=G+I.split(\".\")[1]}else I=\"\";T&&0===Number(I.slice(1))&&(I=\"\")}else _=X(t,null,i);return-1<_.indexOf(\"-\")&&(_=_.slice(1),B=!0),_.length<x&&(_=new Array(x-_.length+1).join(\"0\")+_),-1<m&&(_=_.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g,\"$1\"+U[q].delimiters.thousands)),0===e.indexOf(\".\")&&(_=\"\"),g=e.indexOf(\"(\"),b=e.indexOf(\"-\"),f+(g<b?(k&&B?\"(\":\"\")+(R&&B||!k&&B?\"-\":\"\"):(R&&B||!k&&B?\"-\":\"\")+(k&&B?\"(\":\"\"))+(!B&&S&&0!==t?\"+\":\"\")+_+I+(j||\"\")+(C&&!n?C:\"\")+(P||\"\")+(k&&B?\")\":\"\")+v}function a(t,e){U[t]=e}function l(t){var e=U[q=t].defaults;e&&e.format&&c.defaultFormat(e.format),e&&e.currencyFormat&&c.defaultCurrencyFormat(e.currencyFormat)}void 0!==e&&e.exports,(c=function(t){return c.isNumbro(t)?t=t.value():0===t||void 0===t?t=0:Number(t)||(t=c.fn.unformat(t)),new n(Number(t))}).version=\"1.6.2\",c.isNumbro=function(t){return t instanceof n},c.setLanguage=function(t,e){console.warn(\"`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead\");var i=t,n=t.split(\"-\")[0],r=null;o[i]||(Object.keys(o).forEach(function(t){r||t.split(\"-\")[0]!==n||(r=t)}),i=r||e||\"en-US\"),l(i)},c.setCulture=function(t,e){var i=t,n=t.split(\"-\")[1],r=null;U[i]||(n&&Object.keys(U).forEach(function(t){r||t.split(\"-\")[1]!==n||(r=t)}),i=r||e||\"en-US\"),l(i)},c.language=function(t,e){if(console.warn(\"`language` is deprecated since version 1.6.0. Use `culture` instead\"),!t)return q;if(t&&!e){if(!o[t])throw new Error(\"Unknown language : \"+t);l(t)}return!e&&o[t]||a(t,e),c},c.culture=function(t,e){if(!t)return q;if(t&&!e){if(!U[t])throw new Error(\"Unknown culture : \"+t);l(t)}return!e&&U[t]||a(t,e),c},c.languageData=function(t){if(console.warn(\"`languageData` is deprecated since version 1.6.0. Use `cultureData` instead\"),!t)return o[q];if(!o[t])throw new Error(\"Unknown language : \"+t);return o[t]},c.cultureData=function(t){if(!t)return U[q];if(!U[t])throw new Error(\"Unknown culture : \"+t);return U[t]},c.culture(\"en-US\",{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\"}}),c.languages=function(){return console.warn(\"`languages` is deprecated since version 1.6.0. Use `cultures` instead\"),o},c.cultures=function(){return U},c.zeroFormat=function(t){Y=\"string\"==typeof t?t:null},c.defaultFormat=function(t){r=\"string\"==typeof t?t:\"0.0\"},c.defaultCurrencyFormat=function(t){},c.validate=function(t,e){var i,n,r,o,s,a,l,h;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()).match(/^\\d+$/))return!0;if(\"\"===t)return!1;try{l=c.cultureData(e)}catch(t){l=c.cultureData(c.culture())}return r=l.currency.symbol,s=l.abbreviations,i=l.delimiters.decimal,n=\".\"===l.delimiters.thousands?\"\\\\.\":l.delimiters.thousands,!(null!==(h=t.match(/^[^\\d]+/))&&(t=t.substr(1),h[0]!==r)||null!==(h=t.match(/[^\\d]+$/))&&(t=t.slice(0,-1),h[0]!==s.thousand&&h[0]!==s.million&&h[0]!==s.billion&&h[0]!==s.trillion)||(a=new RegExp(n+\"{2}\"),t.match(/[^\\d.,]/g)||2<(o=t.split(i)).length||(o.length<2?!o[0].match(/^\\d+.*\\d$/)||o[0].match(a):1===o[0].length?!o[0].match(/^\\d+$/)||o[0].match(a)||!o[1].match(/^\\d+$/):!o[0].match(/^\\d+.*\\d$/)||o[0].match(a)||!o[1].match(/^\\d+$/))))},e.exports={format:function(t,e,i,n){return null!=i&&i!==c.culture()&&c.setCulture(i),s(Number(t),null!=e?e:r,null==n?Math.round:n)}}},function(t,e,i){var l=t(378),h=t(376),n=t(380),c=t(375),u=t(366),_=t(371);function p(t,e){if(!(this instanceof p))return new p(t);e=e||function(t){if(t)throw t};var i=l(t);if(\"object\"==typeof i){var n=p.projections.get(i.projName);if(n){if(i.datumCode&&\"none\"!==i.datumCode){var r=u[i.datumCode];r&&(i.datum_params=r.towgs84?r.towgs84.split(\",\"):null,i.ellps=r.ellipse,i.datumName=r.datumName?r.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||\"enu\";var o=c.sphere(i.a,i.b,i.rf,i.ellps,i.sphere),s=c.eccentricity(o.a,o.b,o.rf,i.R_A),a=i.datum||_(i.datumCode,i.datum_params,o.a,o.b,s.es,s.ep2);h(this,i),h(this,n),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=s.es,this.e=s.e,this.ep2=s.ep2,this.datum=a,this.init(),e(null,this)}else e(t)}else e(t)}(p.projections=n).start(),e.exports=p},function(t,e,i){e.exports=function(t,e,i){var n,r,o,s=i.x,a=i.y,l=i.z||0,h={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==i.z)switch(0===o?(n=s,r=\"x\"):1===o?(n=a,r=\"y\"):(n=l,r=\"z\"),t.axis[o]){case\"e\":h[r]=n;break;case\"w\":h[r]=-n;break;case\"n\":h[r]=n;break;case\"s\":h[r]=-n;break;case\"u\":void 0!==i[r]&&(h.z=n);break;case\"d\":void 0!==i[r]&&(h.z=-n);break;default:return null}return h}},function(t,e,i){var n=2*Math.PI,r=t(363);e.exports=function(t){return Math.abs(t)<=3.14159265359?t:t-r(t)*n}},function(t,e,i){e.exports=function(t,e,i){var n=t*e;return i/Math.sqrt(1-n*n)}},function(t,e,i){var a=Math.PI/2;e.exports=function(t,e){for(var i,n,r=.5*t,o=a-2*Math.atan(e),s=0;s<=15;s++)if(i=t*Math.sin(o),n=a-2*Math.atan(e*Math.pow((1-i)/(1+i),r))-o,o+=n,Math.abs(n)<=1e-10)return o;return-9999}},function(t,e,i){e.exports=function(t){return t<0?-1:1}},function(t,e,i){e.exports=function(t){var e={x:t[0],y:t[1]};return 2<t.length&&(e.z=t[2]),3<t.length&&(e.m=t[3]),e}},function(t,e,i){var o=Math.PI/2;e.exports=function(t,e,i){var n=t*i,r=.5*t;return n=Math.pow((1-n)/(1+n),r),Math.tan(.5*(o-e))/n}},function(t,e,i){i.wgs84={towgs84:\"0,0,0\",ellipse:\"WGS84\",datumName:\"WGS84\"},i.ch1903={towgs84:\"674.374,15.056,405.346\",ellipse:\"bessel\",datumName:\"swiss\"},i.ggrs87={towgs84:\"-199.87,74.79,246.62\",ellipse:\"GRS80\",datumName:\"Greek_Geodetic_Reference_System_1987\"},i.nad83={towgs84:\"0,0,0\",ellipse:\"GRS80\",datumName:\"North_American_Datum_1983\"},i.nad27={nadgrids:\"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat\",ellipse:\"clrk66\",datumName:\"North_American_Datum_1927\"},i.potsdam={towgs84:\"606.0,23.0,413.0\",ellipse:\"bessel\",datumName:\"Potsdam Rauenberg 1950 DHDN\"},i.carthage={towgs84:\"-263.0,6.0,431.0\",ellipse:\"clark80\",datumName:\"Carthage 1934 Tunisia\"},i.hermannskogel={towgs84:\"653.0,-212.0,449.0\",ellipse:\"bessel\",datumName:\"Hermannskogel\"},i.ire65={towgs84:\"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",ellipse:\"mod_airy\",datumName:\"Ireland 1965\"},i.rassadiran={towgs84:\"-133.63,-157.5,-158.62\",ellipse:\"intl\",datumName:\"Rassadiran\"},i.nzgd49={towgs84:\"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993\",ellipse:\"intl\",datumName:\"New Zealand Geodetic Datum 1949\"},i.osgb36={towgs84:\"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894\",ellipse:\"airy\",datumName:\"Airy 1830\"},i.s_jtsk={towgs84:\"589,76,480\",ellipse:\"bessel\",datumName:\"S-JTSK (Ferro)\"},i.beduaram={towgs84:\"-106,-87,188\",ellipse:\"clrk80\",datumName:\"Beduaram\"},i.gunung_segara={towgs84:\"-403,684,41\",ellipse:\"bessel\",datumName:\"Gunung Segara Jakarta\"},i.rnb72={towgs84:\"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1\",ellipse:\"intl\",datumName:\"Reseau National Belge 1972\"}},function(t,e,i){i.MERIT={a:6378137,rf:298.257,ellipseName:\"MERIT 1983\"},i.SGS85={a:6378136,rf:298.257,ellipseName:\"Soviet Geodetic System 85\"},i.GRS80={a:6378137,rf:298.257222101,ellipseName:\"GRS 1980(IUGG, 1980)\"},i.IAU76={a:6378140,rf:298.257,ellipseName:\"IAU 1976\"},i.airy={a:6377563.396,b:6356256.91,ellipseName:\"Airy 1830\"},i.APL4={a:6378137,rf:298.25,ellipseName:\"Appl. Physics. 1965\"},i.NWL9D={a:6378145,rf:298.25,ellipseName:\"Naval Weapons Lab., 1965\"},i.mod_airy={a:6377340.189,b:6356034.446,ellipseName:\"Modified Airy\"},i.andrae={a:6377104.43,rf:300,ellipseName:\"Andrae 1876 (Den., Iclnd.)\"},i.aust_SA={a:6378160,rf:298.25,ellipseName:\"Australian Natl & S. Amer. 1969\"},i.GRS67={a:6378160,rf:298.247167427,ellipseName:\"GRS 67(IUGG 1967)\"},i.bessel={a:6377397.155,rf:299.1528128,ellipseName:\"Bessel 1841\"},i.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:\"Bessel 1841 (Namibia)\"},i.clrk66={a:6378206.4,b:6356583.8,ellipseName:\"Clarke 1866\"},i.clrk80={a:6378249.145,rf:293.4663,ellipseName:\"Clarke 1880 mod.\"},i.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:\"Clarke 1858\"},i.CPM={a:6375738.7,rf:334.29,ellipseName:\"Comm. des Poids et Mesures 1799\"},i.delmbr={a:6376428,rf:311.5,ellipseName:\"Delambre 1810 (Belgium)\"},i.engelis={a:6378136.05,rf:298.2566,ellipseName:\"Engelis 1985\"},i.evrst30={a:6377276.345,rf:300.8017,ellipseName:\"Everest 1830\"},i.evrst48={a:6377304.063,rf:300.8017,ellipseName:\"Everest 1948\"},i.evrst56={a:6377301.243,rf:300.8017,ellipseName:\"Everest 1956\"},i.evrst69={a:6377295.664,rf:300.8017,ellipseName:\"Everest 1969\"},i.evrstSS={a:6377298.556,rf:300.8017,ellipseName:\"Everest (Sabah & Sarawak)\"},i.fschr60={a:6378166,rf:298.3,ellipseName:\"Fischer (Mercury Datum) 1960\"},i.fschr60m={a:6378155,rf:298.3,ellipseName:\"Fischer 1960\"},i.fschr68={a:6378150,rf:298.3,ellipseName:\"Fischer 1968\"},i.helmert={a:6378200,rf:298.3,ellipseName:\"Helmert 1906\"},i.hough={a:6378270,rf:297,ellipseName:\"Hough\"},i.intl={a:6378388,rf:297,ellipseName:\"International 1909 (Hayford)\"},i.kaula={a:6378163,rf:298.24,ellipseName:\"Kaula 1961\"},i.lerch={a:6378139,rf:298.257,ellipseName:\"Lerch 1979\"},i.mprts={a:6397300,rf:191,ellipseName:\"Maupertius 1738\"},i.new_intl={a:6378157.5,b:6356772.2,ellipseName:\"New International 1967\"},i.plessis={a:6376523,rf:6355863,ellipseName:\"Plessis 1817 (France)\"},i.krass={a:6378245,rf:298.3,ellipseName:\"Krassovsky, 1942\"},i.SEasia={a:6378155,b:6356773.3205,ellipseName:\"Southeast Asia\"},i.walbeck={a:6376896,b:6355834.8467,ellipseName:\"Walbeck\"},i.WGS60={a:6378165,rf:298.3,ellipseName:\"WGS 60\"},i.WGS66={a:6378145,rf:298.25,ellipseName:\"WGS 66\"},i.WGS7={a:6378135,rf:298.26,ellipseName:\"WGS 72\"},i.WGS84={a:6378137,rf:298.257223563,ellipseName:\"WGS 84\"},i.sphere={a:6370997,b:6370997,ellipseName:\"Normal Sphere (r=6370997)\"}},function(t,e,i){i.greenwich=0,i.lisbon=-9.131906111111,i.paris=2.337229166667,i.bogota=-74.080916666667,i.madrid=-3.687938888889,i.rome=12.452333333333,i.bern=7.439583333333,i.jakarta=106.807719444444,i.ferro=-17.666666666667,i.brussels=4.367975,i.stockholm=18.058277777778,i.athens=23.7163375,i.oslo=10.722916666667},function(t,e,i){i.ft={to_meter:.3048},i[\"us-ft\"]={to_meter:1200/3937}},function(t,e,i){var n=t(358),r=t(383),o=n(\"WGS84\");function s(t,e,i){var n;return Array.isArray(i)?(n=r(t,e,i),3===i.length?[n.x,n.y,n.z]:[n.x,n.y]):r(t,e,i)}function a(t){return t instanceof n?t:t.oProj?t.oProj:n(t)}e.exports=function(e,i,t){e=a(e);var n,r=!1;return void 0===i?(i=e,e=o,r=!0):(void 0!==i.x||Array.isArray(i))&&(t=i,i=e,e=o,r=!0),i=a(i),t?s(e,i,t):(n={forward:function(t){return s(e,i,t)},inverse:function(t){return s(i,e,t)}},r&&(n.oProj=i),n)}},function(t,e,i){var a=484813681109536e-20;e.exports=function(t,e,i,n,r,o){var s={datum_type:4};return t&&\"none\"===t&&(s.datum_type=5),e&&(s.datum_params=e.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=1),3<s.datum_params.length&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=2,s.datum_params[3]*=a,s.datum_params[4]*=a,s.datum_params[5]*=a,s.datum_params[6]=s.datum_params[6]/1e6+1))),s.a=i,s.b=n,s.es=r,s.ep2=o,s}},function(t,e,i){var k=Math.PI/2;i.compareDatums=function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||5e-11<Math.abs(this.es-e.es))&&(1===t.datum_type?this.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])},i.geodeticToGeocentric=function(t,e,i){var n,r,o,s,a=t.x,l=t.y,h=t.z?t.z:0;if(l<-k&&-1.001*k<l)l=-k;else if(k<l&&l<1.001*k)l=k;else if(l<-k||k<l)return null;return a>Math.PI&&(a-=2*Math.PI),r=Math.sin(l),s=Math.cos(l),o=r*r,{x:((n=i/Math.sqrt(1-e*o))+h)*s*Math.cos(a),y:(n+h)*s*Math.sin(a),z:(n*(1-e)+h)*r}},i.geocentricToGeodetic=function(t,e,i,n){var r,o,s,a,l,h,c,u,_,p,d,f,v,m,g,y,b=t.x,x=t.y,w=t.z?t.z:0;if(r=Math.sqrt(b*b+x*x),o=Math.sqrt(b*b+x*x+w*w),r/i<1e-12){if(m=0,o/i<1e-12)return g=k,y=-n,{x:t.x,y:t.y,z:t.z}}else m=Math.atan2(x,b);for(s=w/o,a=r/o,l=1/Math.sqrt(1-e*(2-e)*a*a),u=a*(1-e)*l,_=s*l,v=0;v++,c=i/Math.sqrt(1-e*_*_),h=e*c/(c+(y=r*u+w*_-c*(1-e*_*_))),l=1/Math.sqrt(1-h*(2-h)*a*a),f=(d=s*l)*u-(p=a*(1-h)*l)*_,u=p,_=d,1e-24<f*f&&v<30;);return g=Math.atan(d/Math.abs(p)),{x:m,y:g,z:y}},i.geocentricToWgs84=function(t,e,i){if(1===e)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(2===e){var n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5],h=i[6];return{x:h*(t.x-l*t.y+a*t.z)+n,y:h*(l*t.x+t.y-s*t.z)+r,z:h*(-a*t.x+s*t.y+t.z)+o}}},i.geocentricFromWgs84=function(t,e,i){if(1===e)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(2===e){var n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5],h=i[6],c=(t.x-n)/h,u=(t.y-r)/h,_=(t.z-o)/h;return{x:c+l*u-a*_,y:-l*c+u+s*_,z:a*c-s*u+_}}}},function(t,e,i){var n=t(372);function r(t){return 1===t||2===t}e.exports=function(t,e,i){return n.compareDatums(t,e)?i:5===t.datum_type||5===e.datum_type?i:t.es!==e.es||t.a!==e.a||r(t.datum_type)||r(e.datum_type)?(i=n.geodeticToGeocentric(i,t.es,t.a),r(t.datum_type)&&(i=n.geocentricToWgs84(i,t.datum_type,t.datum_params)),r(e.datum_type)&&(i=n.geocentricFromWgs84(i,e.datum_type,e.datum_params)),n.geocentricToGeodetic(i,e.es,e.a,e.b)):i}},function(t,e,i){var n=t(377),r=t(379),o=t(384);function s(t){var e=this;if(2===arguments.length){var i=arguments[1];s[t]=\"string\"==typeof i?\"+\"===i.charAt(0)?r(arguments[1]):o(arguments[1]):i}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?s.apply(e,t):s(t)});if(\"string\"==typeof t){if(t in s)return s[t]}else\"EPSG\"in t?s[\"EPSG:\"+t.EPSG]=t:\"ESRI\"in t?s[\"ESRI:\"+t.ESRI]=t:\"IAU2000\"in t?s[\"IAU2000:\"+t.IAU2000]=t:console.log(t);return}}n(s),e.exports=s},function(t,e,i){var s=t(367);i.eccentricity=function(t,e,i,n){var r=t*t,o=e*e,s=(r-o)/r,a=0;n?(r=(t*=1-s*(.16666666666666666+s*(.04722222222222222+.022156084656084655*s)))*t,s=0):a=Math.sqrt(s);var l=(r-o)/o;return{es:s,e:a,ep2:l}},i.sphere=function(t,e,i,n,r){if(!t){var o=s[n];o||(o=s.WGS84),t=o.a,e=o.b,i=o.rf}return i&&!e&&(e=(1-1/i)*t),(0===i||Math.abs(t-e)<1e-10)&&(r=!0,e=t),{a:t,b:e,rf:i,sphere:r}}},function(t,e,i){e.exports=function(t,e){var i,n;if(t=t||{},!e)return t;for(n in e)void 0!==(i=e[n])&&(t[n]=i);return t}},function(t,e,i){e.exports=function(t){t(\"EPSG:4326\",\"+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees\"),t(\"EPSG:4269\",\"+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees\"),t(\"EPSG:3857\",\"+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs\"),t.WGS84=t[\"EPSG:4326\"],t[\"EPSG:3785\"]=t[\"EPSG:3857\"],t.GOOGLE=t[\"EPSG:3857\"],t[\"EPSG:900913\"]=t[\"EPSG:3857\"],t[\"EPSG:102113\"]=t[\"EPSG:3857\"]}},function(t,e,i){var n=t(374),r=t(384),o=t(379),s=[\"GEOGCS\",\"GEOCCS\",\"PROJCS\",\"LOCAL_CS\"];e.exports=function(t){return\"string\"!=typeof t?t:t in n?n[t]:(e=t,s.some(function(t){return-1<e.indexOf(t)})?r(t):\"+\"===t[0]?o(t):void 0);var e}},function(t,e,i){var a=.017453292519943295,l=t(368),h=t(369);e.exports=function(t){var e,i,n,r={},o=t.split(\"+\").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var i=e.split(\"=\");return i.push(!0),t[i[0].toLowerCase()]=i[1],t},{}),s={proj:\"projName\",datum:\"datumCode\",rf:function(t){r.rf=parseFloat(t)},lat_0:function(t){r.lat0=t*a},lat_1:function(t){r.lat1=t*a},lat_2:function(t){r.lat2=t*a},lat_ts:function(t){r.lat_ts=t*a},lon_0:function(t){r.long0=t*a},lon_1:function(t){r.long1=t*a},lon_2:function(t){r.long2=t*a},alpha:function(t){r.alpha=parseFloat(t)*a},lonc:function(t){r.longc=t*a},x_0:function(t){r.x0=parseFloat(t)},y_0:function(t){r.y0=parseFloat(t)},k_0:function(t){r.k0=parseFloat(t)},k:function(t){r.k0=parseFloat(t)},a:function(t){r.a=parseFloat(t)},b:function(t){r.b=parseFloat(t)},r_a:function(){r.R_A=!0},zone:function(t){r.zone=parseInt(t,10)},south:function(){r.utmSouth=!0},towgs84:function(t){r.datum_params=t.split(\",\").map(function(t){return parseFloat(t)})},to_meter:function(t){r.to_meter=parseFloat(t)},units:function(t){r.units=t,h[t]&&(r.to_meter=h[t].to_meter)},from_greenwich:function(t){r.from_greenwich=t*a},pm:function(t){r.from_greenwich=(l[t]?l[t]:parseFloat(t))*a},nadgrids:function(t){\"@null\"===t?r.datumCode=\"none\":r.nadgrids=t},axis:function(t){var e=\"ewnsud\";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(r.axis=t)}};for(e in o)i=o[e],e in s?\"function\"==typeof(n=s[e])?n(i):r[n]=i:r[e]=i;return\"string\"==typeof r.datumCode&&\"WGS84\"!==r.datumCode&&(r.datumCode=r.datumCode.toLowerCase()),r}},function(t,e,i){var n=[t(382),t(381)],r={},o=[];function s(t,e){var i=o.length;return t.names?((o[i]=t).names.forEach(function(t){r[t.toLowerCase()]=i}),this):(console.log(e),!0)}i.add=s,i.get=function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==r[e]&&o[r[e]]?o[r[e]]:void 0},i.start=function(){n.forEach(s)}},function(t,e,i){function n(t){return t}i.init=function(){},i.forward=n,i.inverse=n,i.names=[\"longlat\",\"identity\"]},function(t,e,i){var n=t(361),a=Math.PI/2,l=57.29577951308232,h=t(360),c=Math.PI/4,u=t(365),s=t(362);i.init=function(){var t=this.b/this.a;this.es=1-t*t,\"x0\"in this||(this.x0=0),\"y0\"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=n(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},i.forward=function(t){var e,i,n=t.x,r=t.y;if(90<r*l&&r*l<-90&&180<n*l&&n*l<-180)return null;if(Math.abs(Math.abs(r)-a)<=1e-10)return null;if(this.sphere)e=this.x0+this.a*this.k0*h(n-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(c+.5*r));else{var o=Math.sin(r),s=u(this.e,r,o);e=this.x0+this.a*this.k0*h(n-this.long0),i=this.y0-this.a*this.k0*Math.log(s)}return t.x=e,t.y=i,t},i.inverse=function(t){var e,i,n=t.x-this.x0,r=t.y-this.y0;if(this.sphere)i=a-2*Math.atan(Math.exp(-r/(this.a*this.k0)));else{var o=Math.exp(-r/(this.a*this.k0));if(-9999===(i=s(this.e,o)))return null}return e=h(this.long0+n/(this.a*this.k0)),t.x=e,t.y=i,t},i.names=[\"Mercator\",\"Popular Visualisation Pseudo Mercator\",\"Mercator_1SP\",\"Mercator_Auxiliary_Sphere\",\"merc\"]},function(t,e,i){var a=.017453292519943295,l=57.29577951308232,h=t(373),c=t(359),u=t(358),_=t(364);e.exports=function t(e,i,n){var r,o,s;return Array.isArray(n)&&(n=_(n)),e.datum&&i.datum&&(s=i,(1===(o=e).datum.datum_type||2===o.datum.datum_type)&&\"WGS84\"!==s.datumCode||(1===s.datum.datum_type||2===s.datum.datum_type)&&\"WGS84\"!==o.datumCode)&&(r=new u(\"WGS84\"),n=t(e,r,n),e=r),\"enu\"!==e.axis&&(n=c(e,!1,n)),\"longlat\"===e.projName?n={x:n.x*a,y:n.y*a}:(e.to_meter&&(n={x:n.x*e.to_meter,y:n.y*e.to_meter}),n=e.inverse(n)),e.from_greenwich&&(n.x+=e.from_greenwich),n=h(e.datum,i.datum,n),i.from_greenwich&&(n={x:n.x-i.grom_greenwich,y:n.y}),\"longlat\"===i.projName?n={x:n.x*l,y:n.y*l}:(n=i.forward(n),i.to_meter&&(n={x:n.x/i.to_meter,y:n.y/i.to_meter})),\"enu\"!==i.axis?c(i,!0,n):n}},function(t,e,i){var n=.017453292519943295,s=t(376);function r(t,e,i){t[e]=i.map(function(t){var e={};return a(t,e),e}).reduce(function(t,e){return s(t,e)},{})}function a(t,e){var i;Array.isArray(t)?(\"PARAMETER\"===(i=t.shift())&&(i=t.shift()),1===t.length?Array.isArray(t[0])?(e[i]={},a(t[0],e[i])):e[i]=t[0]:t.length?\"TOWGS84\"===i?e[i]=t:(e[i]={},-1<[\"UNIT\",\"PRIMEM\",\"VERT_DATUM\"].indexOf(i)?(e[i]={name:t[0].toLowerCase(),convert:t[1]},3===t.length&&(e[i].auth=t[2])):\"SPHEROID\"===i?(e[i]={name:t[0],a:t[1],rf:t[2]},4===t.length&&(e[i].auth=t[3])):-1<[\"GEOGCS\",\"GEOCCS\",\"DATUM\",\"VERT_CS\",\"COMPD_CS\",\"LOCAL_CS\",\"FITTED_CS\",\"LOCAL_DATUM\"].indexOf(i)?(t[0]=[\"name\",t[0]],r(e,i,t)):t.every(function(t){return Array.isArray(t)})?r(e,i,t):a(t,e[i])):e[i]=!0):e[t]=!0}function l(t){return t*n}e.exports=function(t,e){var i=JSON.parse((\",\"+t).replace(/\\s*\\,\\s*([A-Z_0-9]+?)(\\[)/g,',[\"$1\",').slice(1).replace(/\\s*\\,\\s*([A-Z_0-9]+?)\\]/g,',\"$1\"]').replace(/,\\[\"VERTCS\".+/,\"\")),n=i.shift(),r=i.shift();i.unshift([\"name\",r]),i.unshift([\"type\",n]),i.unshift(\"output\");var o={};return a(i,o),function(o){function t(t){var e=o.to_meter||1;return parseFloat(t,10)*e}\"GEOGCS\"===o.type?o.projName=\"longlat\":\"LOCAL_CS\"===o.type?(o.projName=\"identity\",o.local=!0):\"object\"==typeof o.PROJECTION?o.projName=Object.keys(o.PROJECTION)[0]:o.projName=o.PROJECTION,o.UNIT&&(o.units=o.UNIT.name.toLowerCase(),\"metre\"===o.units&&(o.units=\"meter\"),o.UNIT.convert&&(\"GEOGCS\"===o.type?o.DATUM&&o.DATUM.SPHEROID&&(o.to_meter=parseFloat(o.UNIT.convert,10)*o.DATUM.SPHEROID.a):o.to_meter=parseFloat(o.UNIT.convert,10))),o.GEOGCS&&(o.GEOGCS.DATUM?o.datumCode=o.GEOGCS.DATUM.name.toLowerCase():o.datumCode=o.GEOGCS.name.toLowerCase(),\"d_\"===o.datumCode.slice(0,2)&&(o.datumCode=o.datumCode.slice(2)),\"new_zealand_geodetic_datum_1949\"!==o.datumCode&&\"new_zealand_1949\"!==o.datumCode||(o.datumCode=\"nzgd49\"),\"wgs_1984\"===o.datumCode&&(\"Mercator_Auxiliary_Sphere\"===o.PROJECTION&&(o.sphere=!0),o.datumCode=\"wgs84\"),\"_ferro\"===o.datumCode.slice(-6)&&(o.datumCode=o.datumCode.slice(0,-6)),\"_jakarta\"===o.datumCode.slice(-8)&&(o.datumCode=o.datumCode.slice(0,-8)),~o.datumCode.indexOf(\"belge\")&&(o.datumCode=\"rnb72\"),o.GEOGCS.DATUM&&o.GEOGCS.DATUM.SPHEROID&&(o.ellps=o.GEOGCS.DATUM.SPHEROID.name.replace(\"_19\",\"\").replace(/[Cc]larke\\_18/,\"clrk\"),\"international\"===o.ellps.toLowerCase().slice(0,13)&&(o.ellps=\"intl\"),o.a=o.GEOGCS.DATUM.SPHEROID.a,o.rf=parseFloat(o.GEOGCS.DATUM.SPHEROID.rf,10)),~o.datumCode.indexOf(\"osgb_1936\")&&(o.datumCode=\"osgb36\")),o.b&&!isFinite(o.b)&&(o.b=o.a),[[\"standard_parallel_1\",\"Standard_Parallel_1\"],[\"standard_parallel_2\",\"Standard_Parallel_2\"],[\"false_easting\",\"False_Easting\"],[\"false_northing\",\"False_Northing\"],[\"central_meridian\",\"Central_Meridian\"],[\"latitude_of_origin\",\"Latitude_Of_Origin\"],[\"latitude_of_origin\",\"Central_Parallel\"],[\"scale_factor\",\"Scale_Factor\"],[\"k0\",\"scale_factor\"],[\"latitude_of_center\",\"Latitude_of_center\"],[\"lat0\",\"latitude_of_center\",l],[\"longitude_of_center\",\"Longitude_Of_Center\"],[\"longc\",\"longitude_of_center\",l],[\"x0\",\"false_easting\",t],[\"y0\",\"false_northing\",t],[\"long0\",\"central_meridian\",l],[\"lat0\",\"latitude_of_origin\",l],[\"lat0\",\"standard_parallel_1\",l],[\"lat1\",\"standard_parallel_1\",l],[\"lat2\",\"standard_parallel_2\",l],[\"alpha\",\"azimuth\",l],[\"srsCode\",\"name\"]].forEach(function(t){return e=o,n=(i=t)[0],r=i[1],void(!(n in e)&&r in e&&(e[n]=e[r],3===i.length&&(e[n]=i[2](e[n]))));var e,i,n,r}),o.long0||!o.longc||\"Albers_Conic_Equal_Area\"!==o.projName&&\"Lambert_Azimuthal_Equal_Area\"!==o.projName||(o.long0=o.longc),o.lat_ts||!o.lat1||\"Stereographic_South_Pole\"!==o.projName&&\"Polar Stereographic (variant B)\"!==o.projName||(o.lat0=l(0<o.lat1?90:-90),o.lat_ts=o.lat1)}(o.output),s(e,o.output)}},function(t,e,i){!function(){\"use strict\";var d={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\\x25]+/,modulo:/^\\x25{2}/,placeholder:/^\\x25(?:([1-9]\\d*)\\$|\\(([^\\)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\\d]*)/i,key_access:/^\\.([a-z_][a-z_\\d]*)/i,index_access:/^\\[(\\d+)\\]/,sign:/^[\\+\\-]/};function f(t){return function(t,e){var i,n,r,o,s,a,l,h,c,u=1,_=t.length,p=\"\";for(n=0;n<_;n++)if(\"string\"==typeof t[n])p+=t[n];else if(Array.isArray(t[n])){if((o=t[n])[2])for(i=e[u],r=0;r<o[2].length;r++){if(!i.hasOwnProperty(o[2][r]))throw new Error(f('[sprintf] property \"%s\" does not exist',o[2][r]));i=i[o[2][r]]}else i=o[1]?e[o[1]]:e[u++];if(d.not_type.test(o[8])&&d.not_primitive.test(o[8])&&i instanceof Function&&(i=i()),d.numeric_arg.test(o[8])&&\"number\"!=typeof i&&isNaN(i))throw new TypeError(f(\"[sprintf] expecting number but found %T\",i));switch(d.number.test(o[8])&&(h=0<=i),o[8]){case\"b\":i=parseInt(i,10).toString(2);break;case\"c\":i=String.fromCharCode(parseInt(i,10));break;case\"d\":case\"i\":i=parseInt(i,10);break;case\"j\":i=JSON.stringify(i,null,o[6]?parseInt(o[6]):0);break;case\"e\":i=o[7]?parseFloat(i).toExponential(o[7]):parseFloat(i).toExponential();break;case\"f\":i=o[7]?parseFloat(i).toFixed(o[7]):parseFloat(i);break;case\"g\":i=o[7]?String(Number(i.toPrecision(o[7]))):parseFloat(i);break;case\"o\":i=(parseInt(i,10)>>>0).toString(8);break;case\"s\":i=String(i),i=o[7]?i.substring(0,o[7]):i;break;case\"t\":i=String(!!i),i=o[7]?i.substring(0,o[7]):i;break;case\"T\":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=o[7]?i.substring(0,o[7]):i;break;case\"u\":i=parseInt(i,10)>>>0;break;case\"v\":i=i.valueOf(),i=o[7]?i.substring(0,o[7]):i;break;case\"x\":i=(parseInt(i,10)>>>0).toString(16);break;case\"X\":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}d.json.test(o[8])?p+=i:(!d.number.test(o[8])||h&&!o[3]?c=\"\":(c=h?\"+\":\"-\",i=i.toString().replace(d.sign,\"\")),a=o[4]?\"0\"===o[4]?\"0\":o[4].charAt(1):\" \",l=o[6]-(c+i).length,s=o[6]&&0<l?a.repeat(l):\"\",p+=o[5]?c+i+s:\"0\"===a?c+s+i:s+c+i)}return p}(function(t){if(l[t])return l[t];for(var e,i=t,n=[],r=0;i;){if(null!==(e=d.text.exec(i)))n.push(e[0]);else if(null!==(e=d.modulo.exec(i)))n.push(\"%\");else{if(null===(e=d.placeholder.exec(i)))throw new SyntaxError(\"[sprintf] unexpected placeholder\");if(e[2]){r|=1;var o=[],s=e[2],a=[];if(null===(a=d.key.exec(s)))throw new SyntaxError(\"[sprintf] failed to parse named argument key\");for(o.push(a[1]);\"\"!==(s=s.substring(a[0].length));)if(null!==(a=d.key_access.exec(s)))o.push(a[1]);else{if(null===(a=d.index_access.exec(s)))throw new SyntaxError(\"[sprintf] failed to parse named argument key\");o.push(a[1])}e[2]=o}else r|=2;if(3===r)throw new Error(\"[sprintf] mixing positional and named placeholders is not (yet) supported\");n.push(e)}i=i.substring(e[0].length)}return l[t]=n}(t),arguments)}function t(t,e){return f.apply(null,[t].concat(e||[]))}var l=Object.create(null);void 0!==i&&(i.sprintf=f,i.vsprintf=t),\"undefined\"!=typeof window&&(window.sprintf=f,window.vsprintf=t)}()},function(t,e,i){!function(t){\"object\"==typeof e&&e.exports?e.exports=t():this.tz=t()}(function(){function d(t,e,i){for(var n,r=e.day[1];n=new Date(Date.UTC(i,e.month,Math.abs(r++))),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.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 r(t,e,i){var n,r,o,s,a,l,h,c=t[t.zone],u=[],_=new Date(i).getUTCFullYear(),p=1;for(n=1,r=c.length;n<r&&!(c[n][e]<=i);n++);if((o=c[n]).rules){for(l=t[o.rules],h=_+1;_-p<=h;--h)for(n=0,r=l.length;n<r;n++)l[n].from<=h&&h<=l[n].to?u.push(d(o,l[n],h)):l[n].to<h&&1==p&&(p=h-l[n].to);for(u.sort(function(t,e){return t.sort-e.sort}),n=0,r=u.length;n<r;n++)i>=u[n][e]&&u[n][u[n].clock]>o[u[n].clock]&&(s=u[n])}return s&&((a=/^(.*)\\/(.*)$/.exec(o.format))?s.abbrev=a[s.save?2:1]:s.abbrev=o.format.replace(/%s/,s.rule.letter)),s||o}function a(t,e){return\"UTC\"==t.zone?e:(t.entry=r(t,\"posix\",e),e+t.entry.offset+t.entry.save)}function u(t,e){return\"UTC\"==t.zone?e:(t.entry=i=r(t,\"wallclock\",e),0<(n=e-i.wallclock)&&n<i.save?null:e-i.offset-i.save);var i,n}function o(t,e,i){var n,r=+(i[1]+1),o=i[2]*r,s=l.indexOf(i[3].toLowerCase());if(9<s)e+=o*h[s-10];else{if(n=new Date(a(t,e)),s<7)for(;o;)n.setUTCDate(n.getUTCDate()+r),n.getUTCDay()==s&&(o-=r);else 7==s?n.setUTCFullYear(n.getUTCFullYear()+o):8==s?n.setUTCMonth(n.getUTCMonth()+o):n.setUTCDate(n.getUTCDate()+o);null==(e=u(t,n.getTime()))&&(e=u(t,n.getTime()+864e5*r)-864e5*r)}return e}var e={clock:function(){return+new Date},zone:\"UTC\",entry:{abbrev:\"UTC\",offset:0,save:0},UTC:1,z:function(t,e,i,n){var r,o,s=this.entry.offset+this.entry.save,a=Math.abs(s/1e3),l=[],h=3600;for(r=0;r<3;r++)l.push((\"0\"+Math.floor(a/h)).slice(-2)),a%=h,h/=60;return\"^\"!=i||s?(\"^\"==i&&(n=3),3==n?(o=(o=l.join(\":\")).replace(/:00$/,\"\"),\"^\"!=i&&(o=o.replace(/:00$/,\"\"))):n?(o=l.slice(0,n+1).join(\":\"),\"^\"==i&&(o=o.replace(/:00$/,\"\"))):o=l.slice(0,2).join(\"\"),o=(o=(s<0?\"-\":\"+\")+o).replace(/([-+])(0)/,{_:\" $1\",\"-\":\"$1\"}[i]||\"$1$2\")):\"Z\"},\"%\":function(t){return\"%\"},n:function(t){return\"\\n\"},t:function(t){return\"\\t\"},U:function(t){return c(t,0)},W:function(t){return c(t,1)},V:function(t){return i(t)[0]},G:function(t){return i(t)[1]},g:function(t){return i(t)[1]%100},j:function(t){return Math.floor((t.getTime()-Date.UTC(t.getUTCFullYear(),0))/864e5)+1},s:function(t){return Math.floor(t.getTime()/1e3)},C:function(t){return Math.floor(t.getUTCFullYear()/100)},N:function(t){return t.getTime()%1e3*1e6},m:function(t){return t.getUTCMonth()+1},Y:function(t){return t.getUTCFullYear()},y:function(t){return t.getUTCFullYear()%100},H:function(t){return t.getUTCHours()},M:function(t){return t.getUTCMinutes()},S:function(t){return t.getUTCSeconds()},e:function(t){return t.getUTCDate()},d:function(t){return t.getUTCDate()},u:function(t){return t.getUTCDay()||7},w:function(t){return t.getUTCDay()},l:function(t){return t.getUTCHours()%12||12},I:function(t){return t.getUTCHours()%12||12},k:function(t){return t.getUTCHours()},Z:function(t){return this.entry.abbrev},a:function(t){return this[this.locale].day.abbrev[t.getUTCDay()]},A:function(t){return this[this.locale].day.full[t.getUTCDay()]},h:function(t){return this[this.locale].month.abbrev[t.getUTCMonth()]},b:function(t){return this[this.locale].month.abbrev[t.getUTCMonth()]},B:function(t){return this[this.locale].month.full[t.getUTCMonth()]},P:function(t){return this[this.locale].meridiem[Math.floor(t.getUTCHours()/12)].toLowerCase()},p:function(t){return this[this.locale].meridiem[Math.floor(t.getUTCHours()/12)]},R:function(t,e){return this.convert([e,\"%H:%M\"])},T:function(t,e){return this.convert([e,\"%H:%M:%S\"])},D:function(t,e){return this.convert([e,\"%m/%d/%y\"])},F:function(t,e){return this.convert([e,\"%Y-%m-%d\"])},x:function(t,e){return this.convert([e,this[this.locale].date])},r:function(t,e){return this.convert([e,this[this.locale].time12||\"%I:%M:%S\"])},X:function(t,e){return this.convert([e,this[this.locale].time24])},c:function(t,e){return this.convert([e,this[this.locale].dateTime])},convert:function(t){if(!t.length)return\"1.0.13\";var e,i,l,n,h,c=Object.create(this),r=[];for(e=0;e<t.length;e++)if(n=t[e],Array.isArray(n))e||isNaN(n[1])?n.splice.apply(t,[e--,1].concat(n)):h=n;else if(isNaN(n)){if(\"string\"==(l=typeof n))~n.indexOf(\"%\")?c.format=n:e||\"*\"!=n?!e&&(l=/^(\\d{4})-(\\d{2})-(\\d{2})(?:[T\\s](\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d+))?)?(Z|(([+-])(\\d{2}(:\\d{2}){0,2})))?)?$/.exec(n))?((h=[]).push.apply(h,l.slice(1,8)),l[9]?(h.push(l[10]+1),h.push.apply(h,l[11].split(/:/))):l[8]&&h.push(1)):/^\\w{2,3}_\\w{2}$/.test(n)?c.locale=n:(l=s.exec(n))?r.push(l):c.zone=n:h=n;else if(\"function\"==l){if(l=n.call(c))return l}else if(/^\\w{2,3}_\\w{2}$/.test(n.name))c[n.name]=n;else if(n.zones){for(l in n.zones)c[l]=n.zones[l];for(l in n.rules)c[l]=n.rules[l]}}else e||(h=n);if(c[c.locale]||delete c.locale,c[c.zone]||delete c.zone,null!=h){if(\"*\"==h)h=c.clock();else if(Array.isArray(h)){for(l=[],i=!h[7],e=0;e<11;e++)l[e]=+(h[e]||0);--l[1],h=Date.UTC.apply(Date.UTC,l)+-l[7]*(36e5*l[8]+6e4*l[9]+1e3*l[10])}else h=Math.floor(h);if(!isNaN(h)){if(i&&(h=u(c,h)),null==h)return h;for(e=0,i=r.length;e<i;e++)h=o(c,h,r[e]);return c.format?(l=new Date(a(c,h)),c.format.replace(/%([-0_^]?)(:{0,3})(\\d*)(.)/g,function(t,e,i,n,r){var o,s,a=\"0\";if(o=c[r]){for(t=String(o.call(c,l,h,e,i.length)),\"_\"==(e||o.style)&&(a=\" \"),s=\"-\"==e?0:o.pad||0;t.length<s;)t=a+t;for(s=\"-\"==e?0:n||o.pad;t.length<s;)t=a+t;\"N\"==r&&s<t.length&&(t=t.slice(0,s)),\"^\"==e&&(t=t.toUpperCase())}return t})):h}}return function(){return c.convert(arguments)}},locale:\"en_US\",en_US:{date:\"%m/%d/%Y\",time24:\"%I:%M:%S %p\",time12:\"%I:%M:%S %p\",dateTime:\"%a %d %b %Y %I:%M:%S %p %Z\",meridiem:[\"AM\",\"PM\"],month:{abbrev:\"Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec\".split(\"|\"),full:\"January|February|March|April|May|June|July|August|September|October|November|December\".split(\"|\")},day:{abbrev:\"Sun|Mon|Tue|Wed|Thu|Fri|Sat\".split(\"|\"),full:\"Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday\".split(\"|\")}}},l=\"Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|year|month|day|hour|minute|second|millisecond\",s=new RegExp(\"^\\\\s*([+-])(\\\\d+)\\\\s+(\"+l+\")s?\\\\s*$\",\"i\"),h=[36e5,6e4,1e3,1];function c(t,e){var i,n,r;return n=new Date(Date.UTC(t.getUTCFullYear(),0)),i=Math.floor((t.getTime()-n.getTime())/864e5),n.getUTCDay()==e?r=0:8==(r=7-n.getUTCDay()+e)&&(r=1),r<=i?Math.floor((i-r)/7)+1:0}function i(t){var e,i,n;return i=t.getUTCFullYear(),e=new Date(Date.UTC(i,0)).getUTCDay(),(n=c(t,1)+(1<e&&e<=4?1:0))?53!=n||4==e||3==e&&29==new Date(i,1,29).getDate()?[n,t.getUTCFullYear()]:[1,t.getUTCFullYear()+1]:(i=t.getUTCFullYear()-1,e=new Date(Date.UTC(i,0)).getUTCDay(),[n=4==e||3==e&&29==new Date(i,1,29).getDate()?53:52,t.getUTCFullYear()-1])}return l=l.toLowerCase().split(\"|\"),\"delmHMSUWVgCIky\".replace(/./g,function(t){e[t].pad=2}),e.N.pad=9,e.j.pad=3,e.k.style=\"_\",e.l.style=\"_\",e.e.style=\"_\",function(){return e.convert(arguments)}})},function(t,n,e){\n",
" /*! *****************************************************************************\n",
" Copyright (c) Microsoft Corporation. All rights reserved.\n",
" Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n",
" this file except in compliance with the License. You may obtain a copy of the\n",
" License at http://www.apache.org/licenses/LICENSE-2.0\n",
" \n",
" THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n",
" KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\n",
" WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\n",
" MERCHANTABLITY OR NON-INFRINGEMENT.\n",
" \n",
" See the Apache Version 2.0 License for specific language governing permissions\n",
" and limitations under the License.\n",
" ***************************************************************************** */\n",
" var i,r,o,s,a,l,h,c,u,_,p,d,f,v,m,g,y,b,x;!function(t){var e=\"object\"==typeof global?global:\"object\"==typeof self?self:\"object\"==typeof this?this:{};function i(i,n){return i!==e&&(\"function\"==typeof Object.create?Object.defineProperty(i,\"__esModule\",{value:!0}):i.__esModule=!0),function(t,e){return i[t]=n?n(t,e):e}}\"object\"==typeof n&&\"object\"==typeof n.exports?t(i(e,i(n.exports))):t(i(e))}(function(t){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};i=function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},r=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},o=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&\"function\"==typeof Object.getOwnPropertySymbols)for(var r=0,n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&(i[n[r]]=t[n[r]]);return i},s=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(s=(o<3?r(s):3<o?r(e,i,s):r(e,i))||s);return 3<o&&s&&Object.defineProperty(e,i,s),s},a=function(i,n){return function(t,e){n(t,e,i)}},l=function(t,e){if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.metadata)return Reflect.metadata(t,e)},h=function(o,s,a,l){return new(a||(a=Promise))(function(t,e){function i(t){try{r(l.next(t))}catch(t){e(t)}}function n(t){try{r(l.throw(t))}catch(t){e(t)}}function r(e){e.done?t(e.value):new a(function(t){t(e.value)}).then(i,n)}r((l=l.apply(o,s||[])).next())})},c=function(i,n){var r,o,s,t,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},\"function\"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError(\"Generator is already executing.\");for(;a;)try{if(r=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,o=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(i,a)}catch(t){e=[6,t],o=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},u=function(t,e){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])},_=function(t){var e=\"function\"==typeof Symbol&&t[Symbol.iterator],i=0;return e?e.call(t):{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}},p=function(t,e){var i=\"function\"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,o=i.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=o.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s},d=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t},f=function(t){return this instanceof f?(this.v=t,this):new f(t)},v=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError(\"Symbol.asyncIterator is not defined.\");var r,o=i.apply(t,e||[]),s=[];return r={},n(\"next\"),n(\"throw\"),n(\"return\"),r[Symbol.asyncIterator]=function(){return this},r;function n(n){o[n]&&(r[n]=function(i){return new Promise(function(t,e){1<s.push([n,i,t,e])||a(n,i)})})}function a(t,e){try{(i=o[t](e)).value instanceof f?Promise.resolve(i.value.v).then(l,h):c(s[0][2],i)}catch(t){c(s[0][3],t)}var i}function l(t){a(\"next\",t)}function h(t){a(\"throw\",t)}function c(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}},m=function(n){var t,r;return t={},e(\"next\"),e(\"throw\",function(t){throw t}),e(\"return\"),t[Symbol.iterator]=function(){return this},t;function e(e,i){t[e]=n[e]?function(t){return(r=!r)?{value:f(n[e](t)),done:\"return\"===e}:i?i(t):t}:i}},g=function(l){if(!Symbol.asyncIterator)throw new TypeError(\"Symbol.asyncIterator is not defined.\");var t,e=l[Symbol.asyncIterator];return e?e.call(l):(l=_(l),t={},i(\"next\"),i(\"throw\"),i(\"return\"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=l[a]&&function(s){return new Promise(function(t,e){var i,n,r,o;s=l[a](s),i=t,n=e,r=s.done,o=s.value,Promise.resolve(o).then(function(t){i({value:t,done:r})},n)})}}},y=function(t,e){return Object.defineProperty?Object.defineProperty(t,\"raw\",{value:e}):t.raw=e,t},b=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e},x=function(t){return t&&t.__esModule?t:{default:t}},t(\"__extends\",i),t(\"__assign\",r),t(\"__rest\",o),t(\"__decorate\",s),t(\"__param\",a),t(\"__metadata\",l),t(\"__awaiter\",h),t(\"__generator\",c),t(\"__exportStar\",u),t(\"__values\",_),t(\"__read\",p),t(\"__spread\",d),t(\"__await\",f),t(\"__asyncGenerator\",v),t(\"__asyncDelegator\",m),t(\"__asyncValues\",g),t(\"__makeTemplateObject\",y),t(\"__importStar\",b),t(\"__importDefault\",x)})}],s={base:0,\"client/connection\":1,\"client/session\":2,\"core/bokeh_events\":3,\"core/build_views\":4,\"core/dom\":5,\"core/dom_view\":6,\"core/enums\":7,\"core/has_props\":8,\"core/hittest\":9,\"core/layout/alignments\":10,\"core/layout/layout_canvas\":11,\"core/layout/side_panel\":12,\"core/layout/solver\":13,\"core/logging\":14,\"core/properties\":15,\"core/property_mixins\":16,\"core/selection_manager\":17,\"core/settings\":18,\"core/signaling\":19,\"core/ui_events\":20,\"core/util/array\":21,\"core/util/arrayable\":22,\"core/util/assert\":23,\"core/util/bbox\":24,\"core/util/callback\":25,\"core/util/canvas\":26,\"core/util/color\":27,\"core/util/compat\":28,\"core/util/data_structures\":29,\"core/util/eq\":30,\"core/util/math\":31,\"core/util/object\":32,\"core/util/projections\":33,\"core/util/refs\":34,\"core/util/selection\":35,\"core/util/serialization\":36,\"core/util/spatial\":37,\"core/util/string\":38,\"core/util/svg_colors\":39,\"core/util/templating\":40,\"core/util/text\":41,\"core/util/throttle\":42,\"core/util/typed_array\":43,\"core/util/types\":44,\"core/util/wheel\":45,\"core/util/zoom\":46,\"core/vectorization\":47,\"core/view\":48,\"core/visuals\":49,document:50,\"embed/dom\":51,\"embed/index\":52,\"embed/notebook\":53,\"embed/server\":54,\"embed/standalone\":55,main:56,model:57,\"models/annotations/annotation\":58,\"models/annotations/arrow\":59,\"models/annotations/arrow_head\":60,\"models/annotations/band\":61,\"models/annotations/box_annotation\":62,\"models/annotations/color_bar\":63,\"models/annotations/index\":64,\"models/annotations/label\":65,\"models/annotations/label_set\":66,\"models/annotations/legend\":67,\"models/annotations/legend_item\":68,\"models/annotations/poly_annotation\":69,\"models/annotations/slope\":70,\"models/annotations/span\":71,\"models/annotations/text_annotation\":72,\"models/annotations/title\":73,\"models/annotations/toolbar_panel\":74,\"models/annotations/tooltip\":75,\"models/annotations/whisker\":76,\"models/axes/axis\":77,\"models/axes/categorical_axis\":78,\"models/axes/continuous_axis\":79,\"models/axes/datetime_axis\":80,\"models/axes/index\":81,\"models/axes/linear_axis\":82,\"models/axes/log_axis\":83,\"models/axes/mercator_axis\":84,\"models/callbacks/callback\":85,\"models/callbacks/customjs\":86,\"models/callbacks/index\":87,\"models/callbacks/open_url\":88,\"models/canvas/canvas\":89,\"models/canvas/cartesian_frame\":90,\"models/canvas/index\":91,\"models/expressions/cumsum\":92,\"models/expressions/expression\":93,\"models/expressions/index\":94,\"models/expressions/stack\":95,\"models/filters/boolean_filter\":96,\"models/filters/customjs_filter\":97,\"models/filters/filter\":98,\"models/filters/group_filter\":99,\"models/filters/index\":100,\"models/filters/index_filter\":101,\"models/formatters/basic_tick_formatter\":102,\"models/formatters/categorical_tick_formatter\":103,\"models/formatters/datetime_tick_formatter\":104,\"models/formatters/func_tick_formatter\":105,\"models/formatters/index\":106,\"models/formatters/log_tick_formatter\":107,\"models/formatters/mercator_tick_formatter\":108,\"models/formatters/numeral_tick_formatter\":109,\"models/formatters/printf_tick_formatter\":110,\"models/formatters/tick_formatter\":111,\"models/glyphs/annular_wedge\":112,\"models/glyphs/annulus\":113,\"models/glyphs/arc\":114,\"models/glyphs/bezier\":115,\"models/glyphs/box\":116,\"models/glyphs/circle\":117,\"models/glyphs/ellipse\":118,\"models/glyphs/glyph\":119,\"models/glyphs/hbar\":120,\"models/glyphs/hex_tile\":121,\"models/glyphs/image\":122,\"models/glyphs/image_rgba\":123,\"models/glyphs/image_url\":124,\"models/glyphs/index\":125,\"models/glyphs/line\":126,\"models/glyphs/multi_line\":127,\"models/glyphs/oval\":128,\"models/glyphs/patch\":129,\"models/glyphs/patches\":130,\"models/glyphs/quad\":131,\"models/glyphs/quadratic\":132,\"models/glyphs/ray\":133,\"models/glyphs/rect\":134,\"models/glyphs/segment\":135,\"models/glyphs/step\":136,\"models/glyphs/text\":137,\"models/glyphs/utils\":138,\"models/glyphs/vbar\":139,\"models/glyphs/wedge\":140,\"models/glyphs/xy_glyph\":141,\"models/graphs/graph_hit_test_policy\":142,\"models/graphs/index\":143,\"models/graphs/layout_provider\":144,\"models/graphs/static_layout_provider\":145,\"models/grids/grid\":146,\"models/grids/index\":147,\"models/index\":148,\"models/layouts/box\":149,\"models/layouts/column\":150,\"models/layouts/index\":151,\"models/layouts/layout_dom\":152,\"models/layouts/row\":153,\"models/layouts/spacer\":154,\"models/layouts/widget_box\":155,\"models/mappers/categorical_color_mapper\":156,\"models/mappers/color_mapper\":157,\"models/mappers/continuous_color_mapper\":158,\"models/mappers/index\":159,\"models/mappers/linear_color_mapper\":160,\"models/mappers/log_color_mapper\":161,\"models/markers/index\":162,\"models/markers/marker\":163,\"models/plots/gmap_plot\":164,\"models/plots/gmap_plot_canvas\":165,\"models/plots/index\":166,\"models/plots/plot\":167,\"models/plots/plot_canvas\":168,\"models/ranges/data_range\":169,\"models/ranges/data_range1d\":170,\"models/ranges/factor_range\":171,\"models/ranges/index\":172,\"models/ranges/range\":173,\"models/ranges/range1d\":174,\"models/renderers/glyph_renderer\":175,\"models/renderers/graph_renderer\":176,\"models/renderers/guide_renderer\":177,\"models/renderers/index\":178,\"models/renderers/renderer\":179,\"models/scales/categorical_scale\":180,\"models/scales/index\":181,\"models/scales/linear_scale\":182,\"models/scales/log_scale\":183,\"models/scales/scale\":184,\"models/selections/index\":185,\"models/selections/interaction_policy\":186,\"models/selections/selection\":187,\"models/sources/ajax_data_source\":188,\"models/sources/cds_view\":189,\"models/sources/column_data_source\":190,\"models/sources/columnar_data_source\":191,\"models/sources/data_source\":192,\"models/sources/geojson_data_source\":193,\"models/sources/index\":194,\"models/sources/remote_data_source\":195,\"models/tickers/adaptive_ticker\":196,\"models/tickers/basic_ticker\":197,\"models/tickers/categorical_ticker\":198,\"models/tickers/composite_ticker\":199,\"models/tickers/continuous_ticker\":200,\"models/tickers/datetime_ticker\":201,\"models/tickers/days_ticker\":202,\"models/tickers/fixed_ticker\":203,\"models/tickers/index\":204,\"models/tickers/log_ticker\":205,\"models/tickers/mercator_ticker\":206,\"models/tickers/months_ticker\":207,\"models/tickers/single_interval_ticker\":208,\"models/tickers/ticker\":209,\"models/tickers/util\":210,\"models/tickers/years_ticker\":211,\"models/tiles/bbox_tile_source\":212,\"models/tiles/image_pool\":213,\"models/tiles/index\":214,\"models/tiles/mercator_tile_source\":215,\"models/tiles/quadkey_tile_source\":216,\"models/tiles/tile_renderer\":217,\"models/tiles/tile_source\":218,\"models/tiles/tile_utils\":219,\"models/tiles/tms_tile_source\":220,\"models/tiles/wmts_tile_source\":221,\"models/tools/actions/action_tool\":222,\"models/tools/actions/help_tool\":223,\"models/tools/actions/redo_tool\":224,\"models/tools/actions/reset_tool\":225,\"models/tools/actions/save_tool\":226,\"models/tools/actions/undo_tool\":227,\"models/tools/actions/zoom_in_tool\":228,\"models/tools/actions/zoom_out_tool\":229,\"models/tools/button_tool\":230,\"models/tools/edit/box_edit_tool\":231,\"models/tools/edit/edit_tool\":232,\"models/tools/edit/point_draw_tool\":233,\"models/tools/edit/poly_draw_tool\":234,\"models/tools/edit/poly_edit_tool\":235,\"models/tools/gestures/box_select_tool\":236,\"models/tools/gestures/box_zoom_tool\":237,\"models/tools/gestures/gesture_tool\":238,\"models/tools/gestures/lasso_select_tool\":239,\"models/tools/gestures/pan_tool\":240,\"models/tools/gestures/poly_select_tool\":241,\"models/tools/gestures/range_tool\":242,\"models/tools/gestures/select_tool\":243,\"models/tools/gestures/tap_tool\":244,\"models/tools/gestures/wheel_pan_tool\":245,\"models/tools/gestures/wheel_zoom_tool\":246,\"models/tools/index\":247,\"models/tools/inspectors/crosshair_tool\":248,\"models/tools/inspectors/customjs_hover\":249,\"models/tools/inspectors/hover_tool\":250,\"models/tools/inspectors/inspect_tool\":251,\"models/tools/on_off_button\":252,\"models/tools/tool\":253,\"models/tools/tool_proxy\":254,\"models/tools/toolbar\":255,\"models/tools/toolbar_base\":256,\"models/tools/toolbar_box\":257,\"models/tools/util\":258,\"models/transforms/customjs_transform\":259,\"models/transforms/dodge\":260,\"models/transforms/index\":261,\"models/transforms/interpolator\":262,\"models/transforms/jitter\":263,\"models/transforms/linear_interpolator\":264,\"models/transforms/step_interpolator\":265,\"models/transforms/transform\":266,polyfill:267,\"protocol/index\":268,\"protocol/message\":269,\"protocol/receiver\":270,safely:271,version:272},r={},(l=(a=function(t){var e=null!=s[t]?s[t]:t;if(!r[e]){if(!o[e]){var i=new Error(\"Cannot find module '\"+t+\"'\");throw i.code=\"MODULE_NOT_FOUND\",i}var n=r[e]={exports:{}};o[e].call(n.exports,a,n,n.exports)}return r[e].exports})(56)).require=a,l.register_plugin=function(t,e,i){for(var n in t)o[n]=t[n];for(var n in e)s[n]=e[n];var r=a(i);for(var n in r)l[n]=r[n];return r},l)}(this);\n",
" //# sourceMappingURL=bokeh.min.js.map\n",
" /* END bokeh.min.js */\n",
" },\n",
" \n",
" function(Bokeh) {\n",
" /* BEGIN bokeh-widgets.min.js */\n",
" /*!\n",
" * Copyright (c) 2012, Anaconda, Inc.\n",
" * All rights reserved.\n",
" * \n",
" * Redistribution and use in source and binary forms, with or without modification,\n",
" * are permitted provided that the following conditions are met:\n",
" * \n",
" * Redistributions of source code must retain the above copyright notice,\n",
" * this list of conditions and the following disclaimer.\n",
" * \n",
" * Redistributions in binary form must reproduce the above copyright notice,\n",
" * this list of conditions and the following disclaimer in the documentation\n",
" * and/or other materials provided with the distribution.\n",
" * \n",
" * Neither the name of Anaconda nor the names of any contributors\n",
" * may be used to endorse or promote products derived from this software\n",
" * without specific prior written permission.\n",
" * \n",
" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n",
" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n",
" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n",
" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n",
" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n",
" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n",
" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n",
" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n",
" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n",
" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\n",
" * THE POSSIBILITY OF SUCH DAMAGE.\n",
" */\n",
" !function(t,e){var i;i=t.Bokeh,function(t,e,n){if(null!=i)return i.register_plugin(t,{\"core/menus\":396,\"models/widgets/abstract_button\":397,\"models/widgets/abstract_icon\":398,\"models/widgets/abstract_slider\":399,\"models/widgets/autocomplete_input\":400,\"models/widgets/button\":401,\"models/widgets/checkbox_button_group\":402,\"models/widgets/checkbox_group\":403,\"models/widgets/date_picker\":404,\"models/widgets/date_range_slider\":405,\"models/widgets/date_slider\":406,\"models/widgets/div\":407,\"models/widgets/dropdown\":408,\"models/widgets/index\":409,\"models/widgets/input_widget\":410,\"models/widgets/main\":411,\"models/widgets/markup\":412,\"models/widgets/multiselect\":413,\"models/widgets/panel\":414,\"models/widgets/paragraph\":415,\"models/widgets/password_input\":416,\"models/widgets/pretext\":417,\"models/widgets/radio_button_group\":418,\"models/widgets/radio_group\":419,\"models/widgets/range_slider\":420,\"models/widgets/selectbox\":421,\"models/widgets/slider\":422,\"models/widgets/tabs\":423,\"models/widgets/text_input\":424,\"models/widgets/toggle\":425,\"models/widgets/widget\":436},411);throw new Error(\"Cannot find Bokeh. You have to load it prior to loading plugins.\")}({396:function(t,e,n){var i=t(19);n.clear_menus=new i.Signal0({},\"clear_menus\"),document.addEventListener(\"click\",function(){return n.clear_menus.emit()})},397:function(t,e,n){var i=t(387),r=t(15),o=t(5),s=t(4),a=t(436),l=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i.__extends(t,n),t.prototype.initialize=function(t){n.prototype.initialize.call(this,t),this.icon_views={},this.render()},t.prototype.connect_signals=function(){var t=this;n.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.render()})},t.prototype.remove=function(){s.remove_views(this.icon_views),n.prototype.remove.call(this)},t.prototype._render_button=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.button.apply(void 0,[{type:\"button\",disabled:this.model.disabled,class:[\"bk-bs-btn\",\"bk-bs-btn-\"+this.model.button_type]}].concat(t))},t.prototype.render=function(){var e=this;n.prototype.render.call(this),o.empty(this.el),this.buttonEl=this._render_button(this.model.label),this.buttonEl.addEventListener(\"click\",function(t){return e._button_click(t)}),this.el.appendChild(this.buttonEl);var t=this.model.icon;null!=t&&(s.build_views(this.icon_views,[t],{parent:this}),o.prepend(this.buttonEl,this.icon_views[t.id].el,o.nbsp))},t.prototype._button_click=function(t){t.preventDefault(),this.change_input()},t.prototype.change_input=function(){null!=this.model.callback&&this.model.callback.execute(this.model)},t}(a.WidgetView);n.AbstractButtonView=l;var u=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"AbstractButton\",this.define({label:[r.String,\"Button\"],icon:[r.Instance],button_type:[r.String,\"default\"],callback:[r.Instance]})},t}(a.Widget);(n.AbstractButton=u).initClass()},398:function(t,e,n){var i=t(387),r=t(436),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.WidgetView);n.AbstractIconView=o;var s=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"AbstractIcon\"},t}(r.Widget);(n.AbstractIcon=s).initClass()},399:function(t,e,n){var i=t(387),f=t(427),r=t(15),m=t(5),v=t(14),g=t(21),y=t(25),o=t(436),s=function(p){function t(){return null!==p&&p.apply(this,arguments)||this}return i.__extends(t,p),t.prototype.initialize=function(t){p.prototype.initialize.call(this,t),this.render()},t.prototype.connect_signals=function(){var t=this;p.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.render()})},t.prototype.render=function(){var r=this;if(null==this.sliderEl&&p.prototype.render.call(this),null!=this.model.callback){var t=function(){return r.model.callback.execute(r.model)};switch(this.model.callback_policy){case\"continuous\":this.callback_wrapper=t;break;case\"throttle\":this.callback_wrapper=y.throttle(t,this.model.callback_throttle)}}var e,o=\"bk-noUi-\",n=this._calc_to(),i=n.start,s=n.end,a=n.value,l=n.step;if(this.model.tooltips){var u={to:function(t){return r.model.pretty(t)}};e=g.repeat(u,a.length)}else e=!1;if(this.el.classList.add(\"bk-slider\"),null==this.sliderEl){this.sliderEl=m.div(),this.el.appendChild(this.sliderEl),f.create(this.sliderEl,{cssPrefix:o,range:{min:i,max:s},start:a,step:l,behaviour:this.model.behaviour,connect:this.model.connected,tooltips:e,orientation:this.model.orientation,direction:this.model.direction}),this.sliderEl.noUiSlider.on(\"slide\",function(t,e,n){return r._slide(n)}),this.sliderEl.noUiSlider.on(\"change\",function(t,e,n){return r._change(n)});var c=this.sliderEl.querySelector(\".\"+o+\"handle\");c.setAttribute(\"tabindex\",\"0\"),c.addEventListener(\"keydown\",function(t){var e=r._calc_to().value[0];switch(t.which){case 37:e=Math.max(e-l,i);break;case 39:e=Math.min(e+l,s);break;default:return}var n=r.model.pretty(e);v.logger.debug(\"[slider keypress] value = \"+n),r.model.value=e,r.sliderEl.noUiSlider.set(e),null!=r.valueEl&&(r.valueEl.textContent=n),null!=r.callback_wrapper&&r.callback_wrapper()});var d=function(t,e){var n=r.sliderEl.querySelectorAll(\".\"+o+\"handle\")[t],i=n.querySelector(\".\"+o+\"tooltip\");i.style.display=e?\"block\":\"\"};this.sliderEl.noUiSlider.on(\"start\",function(t,e){return d(e,!0)}),this.sliderEl.noUiSlider.on(\"end\",function(t,e){return d(e,!1)})}else this.sliderEl.noUiSlider.updateOptions({range:{min:i,max:s},start:a,step:l});if(null!=this.titleEl&&this.el.removeChild(this.titleEl),null!=this.valueEl&&this.el.removeChild(this.valueEl),null!=this.model.title&&(0!=this.model.title.length&&(this.titleEl=m.label({},this.model.title+\":\"),this.el.insertBefore(this.titleEl,this.sliderEl)),this.model.show_value)){var h=a.map(function(t){return r.model.pretty(t)}).join(\" .. \");this.valueEl=m.div({class:\"bk-slider-value\"},h),this.el.insertBefore(this.valueEl,this.sliderEl)}this.model.disabled||(this.sliderEl.querySelector(\".\"+o+\"connect\").style.backgroundColor=this.model.bar_color),this.model.disabled?this.sliderEl.setAttribute(\"disabled\",\"true\"):this.sliderEl.removeAttribute(\"disabled\")},t.prototype._slide=function(t){var e=this,n=this._calc_from(t),i=t.map(function(t){return e.model.pretty(t)}).join(\" .. \");v.logger.debug(\"[slider slide] value = \"+i),null!=this.valueEl&&(this.valueEl.textContent=i),this.model.value=n,null!=this.callback_wrapper&&this.callback_wrapper()},t.prototype._change=function(t){var e=this,n=this._calc_from(t),i=t.map(function(t){return e.model.pretty(t)}).join(\" .. \");switch(v.logger.debug(\"[slider change] value = \"+i),null!=this.valueEl&&(this.valueEl.dataset.value=i),this.model.value=n,this.model.callback_policy){case\"mouseup\":case\"throttle\":null!=this.model.callback&&this.model.callback.execute(this.model)}},t}(o.WidgetView);n.AbstractSliderView=s;var a=function(n){function t(t){var e=n.call(this,t)||this;return e.connected=!1,e}return i.__extends(t,n),t.initClass=function(){this.prototype.type=\"AbstractSlider\",this.define({title:[r.String,\"\"],show_value:[r.Bool,!0],start:[r.Any],end:[r.Any],value:[r.Any],step:[r.Number,1],format:[r.String],orientation:[r.Orientation,\"horizontal\"],direction:[r.Any,\"ltr\"],tooltips:[r.Boolean,!0],callback:[r.Instance],callback_throttle:[r.Number,200],callback_policy:[r.String,\"throttle\"],bar_color:[r.Color,\"#e6e6e6\"]})},t.prototype._formatter=function(t,e){return\"\"+t},t.prototype.pretty=function(t){return this._formatter(t,this.format)},t}(o.Widget);(n.AbstractSlider=a).initClass()},400:function(t,e,n){var i=t(387),r=t(424),s=t(5),o=t(396),a=t(15),l=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i.__extends(t,n),t.prototype.connect_signals=function(){var t=this;n.prototype.connect_signals.call(this),o.clear_menus.connect(function(){return t._clear_menu()})},t.prototype.render=function(){var e=this;n.prototype.render.call(this),this.inputEl.classList.add(\"bk-autocomplete-input\"),this.inputEl.addEventListener(\"keydown\",function(t){return e._keydown(t)}),this.inputEl.addEventListener(\"keyup\",function(t){return e._keyup(t)}),this.menuEl=s.ul({class:\"bk-bs-dropdown-menu\"}),this.menuEl.addEventListener(\"click\",function(t){return e._item_click(t)}),this.el.appendChild(this.menuEl)},t.prototype._render_items=function(t){s.empty(this.menuEl);for(var e=0,n=t;e<n.length;e++){var i=n[e],r=s.li({},s.a({data:{text:i}},i));this.menuEl.appendChild(r)}},t.prototype._open_menu=function(){this.el.classList.add(\"bk-bs-open\")},t.prototype._clear_menu=function(){this.el.classList.remove(\"bk-bs-open\")},t.prototype._item_click=function(t){if(t.preventDefault(),t.target!=t.currentTarget){var e=t.target,n=e.dataset.text;this.model.value=n}},t.prototype._keydown=function(t){},t.prototype._keyup=function(t){switch(t.keyCode){case s.Keys.Enter:console.log(\"enter\");break;case s.Keys.Esc:this._clear_menu();break;case s.Keys.Up:case s.Keys.Down:console.log(\"up/down\");break;default:var e=this.inputEl.value;if(e.length<=1)return void this._clear_menu();for(var n=[],i=0,r=this.model.completions;i<r.length;i++){var o=r[i];-1!=o.indexOf(e)&&n.push(o)}0==n.length?this._clear_menu():(this._render_items(n),this._open_menu())}},t}(r.TextInputView);n.AutocompleteInputView=l;var u=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"AutocompleteInput\",this.prototype.default_view=l,this.define({completions:[a.Array,[]]}),this.internal({active:[a.Boolean,!0]})},t}(r.TextInput);(n.AutocompleteInput=u).initClass()},401:function(t,e,n){var i=t(387),r=t(15),o=t(3),s=t(397),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.change_input=function(){this.model.trigger_event(new o.ButtonClick({})),this.model.clicks=this.model.clicks+1,t.prototype.change_input.call(this)},e}(s.AbstractButtonView);n.ButtonView=a;var l=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"Button\",this.prototype.default_view=a,this.define({clicks:[r.Number,0]}),o.register_with_event(o.ButtonClick,this)},t}(s.AbstractButton);(n.Button=l).initClass()},402:function(t,e,n){var i=t(387),l=t(5),r=t(15),u=t(21),o=t(436),s=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i.__extends(t,n),t.prototype.initialize=function(t){n.prototype.initialize.call(this,t),this.render()},t.prototype.connect_signals=function(){var t=this;n.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.render()})},t.prototype.render=function(){var i=this;n.prototype.render.call(this),l.empty(this.el);var r=l.div({class:\"bk-bs-btn-group\"});this.el.appendChild(r);for(var o=this.model.active,s=this.model.labels,t=function(t){var e=l.input({type:\"checkbox\",value:\"\"+t,checked:t in o});e.addEventListener(\"change\",function(){return i.model.change_input(t)});var n=l.label({class:[\"bk-bs-btn\",\"bk-bs-btn-\"+a.model.button_type]},e,s[t]);u.includes(o,t)&&n.classList.add(\"bk-bs-active\"),r.appendChild(n)},a=this,e=0;e<s.length;e++)t(e)},t}(o.WidgetView);n.CheckboxButtonGroupView=s;var a=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.prototype.change_input=function(e){var t=u.copy(this.active);u.includes(t,e)?u.removeBy(t,function(t){return e==t}):t.push(e),t.sort(),this.active=t,null!=this.callback&&this.callback.execute(this)},t.initClass=function(){this.prototype.type=\"CheckboxButtonGroup\",this.prototype.default_view=s,this.define({active:[r.Array,[]],labels:[r.Array,[]],button_type:[r.String,\"default\"],callback:[r.Instance]})},t}(o.Widget);(n.CheckboxButtonGroup=a).initClass()},403:function(t,e,n){var i=t(387),u=t(5),r=t(15),c=t(21),o=t(436),s=function(l){function t(){return null!==l&&l.apply(this,arguments)||this}return i.__extends(t,l),t.prototype.initialize=function(t){l.prototype.initialize.call(this,t),this.render()},t.prototype.connect_signals=function(){var t=this;l.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.render()})},t.prototype.render=function(){var t=this;l.prototype.render.call(this),u.empty(this.el);for(var e=this.model.active,n=this.model.labels,i=0;i<n.length;i++){var r=n[i],o=u.input({type:\"checkbox\",value:\"\"+i});o.addEventListener(\"change\",function(){return t.change_input()}),this.model.disabled&&(o.disabled=!0),c.includes(e,i)&&(o.checked=!0);var s=u.label({},o,r);if(this.model.inline)s.classList.add(\"bk-bs-checkbox-inline\"),this.el.appendChild(s);else{var a=u.div({class:\"bk-bs-checkbox\"},s);this.el.appendChild(a)}}},t.prototype.change_input=function(){for(var t=this.el.querySelectorAll(\"input\"),e=[],n=0;n<t.length;n++){var i=t[n];i.checked&&e.push(n)}this.model.active=e,null!=this.model.callback&&this.model.callback.execute(this.model)},t}(o.WidgetView);n.CheckboxGroupView=s;var a=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"CheckboxGroup\",this.prototype.default_view=s,this.define({active:[r.Array,[]],labels:[r.Array,[]],inline:[r.Bool,!1],callback:[r.Instance]})},t}(o.Widget);(n.CheckboxGroup=a).initClass()},404:function(t,e,n){var i=t(387),r=t(410),o=t(5),s=t(15),a=t(428);a.prototype.adjustPosition=function(){if(!this._o.container){this.el.style.position=\"absolute\";var t=this._o.trigger,e=this.el.offsetWidth,n=this.el.offsetHeight,i=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,o=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop,s=t.getBoundingClientRect(),a=s.left+window.pageXOffset,l=s.bottom+window.pageYOffset;a-=this.el.parentElement.offsetLeft,l-=this.el.parentElement.offsetTop,(this._o.reposition&&i<a+e||-1<this._o.position.indexOf(\"right\")&&0<a-e+t.offsetWidth)&&(a=a-e+t.offsetWidth),(this._o.reposition&&r+o<l+n||-1<this._o.position.indexOf(\"top\")&&0<l-n-t.offsetHeight)&&(l=l-n-t.offsetHeight),this.el.style.left=a+\"px\",this.el.style.top=l+\"px\"}};var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-widget-form-group\")},e.prototype.render=function(){var e=this;t.prototype.render.call(this),null!=this._picker&&this._picker.destroy(),o.empty(this.el),this.labelEl=o.label({},this.model.title),this.el.appendChild(this.labelEl),this.inputEl=o.input({type:\"text\",class:\"bk-widget-form-input\",disabled:this.model.disabled}),this.el.appendChild(this.inputEl),this._picker=new a({field:this.inputEl,defaultDate:new Date(this.model.value),setDefaultDate:!0,minDate:null!=this.model.min_date?new Date(this.model.min_date):void 0,maxDate:null!=this.model.max_date?new Date(this.model.max_date):void 0,onSelect:function(t){return e._on_select(t)}}),this._root_element.appendChild(this._picker.el)},e.prototype._on_select=function(t){this.model.value=t.toDateString(),this.change_input()},e}(r.InputWidgetView);n.DatePickerView=l;var u=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"DatePicker\",this.prototype.default_view=l,this.define({value:[s.Any,(new Date).toDateString()],min_date:[s.Any],max_date:[s.Any]})},t}(r.InputWidget);(n.DatePicker=u).initClass()},405:function(t,e,n){var i=t(387),r=t(386),o=t(399),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._calc_to=function(){return{start:this.model.start,end:this.model.end,value:this.model.value,step:this.model.step}},e.prototype._calc_from=function(t){return t},e}(o.AbstractSliderView);n.DateRangeSliderView=s;var a=function(n){function t(t){var e=n.call(this,t)||this;return e.behaviour=\"drag\",e.connected=[!1,!0,!1],e}return i.__extends(t,n),t.initClass=function(){this.prototype.type=\"DateRangeSlider\",this.prototype.default_view=s,this.override({format:\"%d %b %Y\"})},t.prototype._formatter=function(t,e){return r(t,e)},t}(o.AbstractSlider);(n.DateRangeSlider=a).initClass()},406:function(t,e,n){var i=t(387),r=t(386),o=t(399),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._calc_to=function(){return{start:this.model.start,end:this.model.end,value:[this.model.value],step:this.model.step}},e.prototype._calc_from=function(t){var e=t[0];return e},e}(o.AbstractSliderView);n.DateSliderView=s;var a=function(n){function t(t){var e=n.call(this,t)||this;return e.behaviour=\"tap\",e.connected=[!0,!1],e}return i.__extends(t,n),t.initClass=function(){this.prototype.type=\"DateSlider\",this.prototype.default_view=s,this.override({format:\"%d %b %Y\"})},t.prototype._formatter=function(t,e){return r(t,e)},t}(o.AbstractSlider);(n.DateSlider=a).initClass()},407:function(t,e,n){var i=t(387),r=t(412),o=t(5),s=t(15),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.render=function(){e.prototype.render.call(this);var t=o.div();this.model.render_as_text?t.textContent=this.model.text:t.innerHTML=this.model.text,this.markupEl.appendChild(t)},t}(r.MarkupView);n.DivView=a;var l=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"Div\",this.prototype.default_view=a,this.define({render_as_text:[s.Bool,!1]})},t}(r.Markup);(n.Div=l).initClass()},408:function(t,e,n){var i=t(387),h=t(5),r=t(396),o=t(15),s=t(397),a=function(d){function t(){return null!==d&&d.apply(this,arguments)||this}return i.__extends(t,d),t.prototype.connect_signals=function(){var t=this;d.prototype.connect_signals.call(this),r.clear_menus.connect(function(){return t._clear_menu()})},t.prototype.render=function(){var e=this;if(d.prototype.render.call(this),this.model.is_split_button){this.el.classList.add(\"bk-bs-btn-group\");var t=this._render_button(h.span({class:\"bk-bs-caret\"}));t.classList.add(\"bk-bs-dropdown-toggle\"),t.addEventListener(\"click\",function(t){return e._caret_click(t)}),this.el.appendChild(t)}else this.el.classList.add(\"bk-bs-dropdown\"),this.buttonEl.classList.add(\"bk-bs-dropdown-toggle\"),this.buttonEl.appendChild(h.span({class:\"bk-bs-caret\"}));this.model.active&&this.el.classList.add(\"bk-bs-open\");for(var n=[],i=0,r=this.model.menu;i<r.length;i++){var o=r[i],s=void 0;if(null!=o){var a=o[0],l=o[1],u=h.a({},a);u.dataset.value=l,u.addEventListener(\"click\",function(t){return e._item_click(t)}),s=h.li({},u)}else s=h.li({class:\"bk-bs-divider\"});n.push(s)}var c=h.ul({class:\"bk-bs-dropdown-menu\"},n);this.el.appendChild(c)},t.prototype._clear_menu=function(){this.model.active=!1},t.prototype._toggle_menu=function(){var t=this.model.active;r.clear_menus.emit(),t||(this.model.active=!0)},t.prototype._button_click=function(t){t.preventDefault(),t.stopPropagation(),this.model.is_split_button?(this._clear_menu(),this.set_value(this.model.default_value)):this._toggle_menu()},t.prototype._caret_click=function(t){t.preventDefault(),t.stopPropagation(),this._toggle_menu()},t.prototype._item_click=function(t){t.preventDefault(),this._clear_menu(),this.set_value(t.currentTarget.dataset.value)},t.prototype.set_value=function(t){this.buttonEl.value=this.model.value=t,this.change_input()},t}(s.AbstractButtonView);n.DropdownView=a;var l=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"Dropdown\",this.prototype.default_view=a,this.define({value:[o.String],default_value:[o.String],menu:[o.Array,[]]}),this.override({label:\"Dropdown\"}),this.internal({active:[o.Boolean,!1]})},Object.defineProperty(t.prototype,\"is_split_button\",{get:function(){return null!=this.default_value},enumerable:!0,configurable:!0}),t}(s.AbstractButton);(n.Dropdown=l).initClass()},409:function(t,e,n){var i=t(397);n.AbstractButton=i.AbstractButton;var r=t(398);n.AbstractIcon=r.AbstractIcon;var o=t(400);n.AutocompleteInput=o.AutocompleteInput;var s=t(401);n.Button=s.Button;var a=t(402);n.CheckboxButtonGroup=a.CheckboxButtonGroup;var l=t(403);n.CheckboxGroup=l.CheckboxGroup;var u=t(404);n.DatePicker=u.DatePicker;var c=t(405);n.DateRangeSlider=c.DateRangeSlider;var d=t(406);n.DateSlider=d.DateSlider;var h=t(407);n.Div=h.Div;var p=t(408);n.Dropdown=p.Dropdown;var f=t(410);n.InputWidget=f.InputWidget;var m=t(412);n.Markup=m.Markup;var v=t(413);n.MultiSelect=v.MultiSelect;var g=t(414);n.Panel=g.Panel;var y=t(415);n.Paragraph=y.Paragraph;var b=t(416);n.PasswordInput=b.PasswordInput;var _=t(417);n.PreText=_.PreText;var w=t(418);n.RadioButtonGroup=w.RadioButtonGroup;var x=t(419);n.RadioGroup=x.RadioGroup;var k=t(420);n.RangeSlider=k.RangeSlider;var S=t(421);n.Select=S.Select;var C=t(422);n.Slider=C.Slider;var E=t(423);n.Tabs=E.Tabs;var D=t(424);n.TextInput=D.TextInput;var M=t(425);n.Toggle=M.Toggle;var A=t(436);n.Widget=A.Widget},410:function(t,e,n){var i=t(387),r=t(436),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.change_input=function(){null!=this.model.callback&&this.model.callback.execute(this.model)},e}(r.WidgetView);n.InputWidgetView=s;var a=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"InputWidget\",this.prototype.default_view=s,this.define({title:[o.String,\"\"],callback:[o.Instance]})},t}(r.Widget);(n.InputWidget=a).initClass()},411:function(t,e,n){var i=t(409);n.Widgets=i;var r=t(0);r.register_models(i)},412:function(t,e,n){var i=t(387),r=t(15),o=t(5),s=t(436),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.render()},t.prototype.connect_signals=function(){var t=this;e.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.render()})},t.prototype.render=function(){e.prototype.render.call(this),o.empty(this.el);var t=i.__assign({width:this.model.width+\"px\",height:this.model.height+\"px\"},this.model.style);this.markupEl=o.div({style:t}),this.el.appendChild(this.markupEl)},t}(s.WidgetView);n.MarkupView=a;var l=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"Markup\",this.define({text:[r.String,\"\"],style:[r.Any,{}]})},t}(s.Widget);(n.Markup=l).initClass()},413:function(t,e,n){var i=t(387),r=t(5),s=t(44),o=t(15),a=t(410),l=function(o){function t(){return null!==o&&o.apply(this,arguments)||this}return i.__extends(t,o),t.prototype.initialize=function(t){o.prototype.initialize.call(this,t),this.render()},t.prototype.connect_signals=function(){var t=this;o.prototype.connect_signals.call(this),this.connect(this.model.properties.value.change,function(){return t.render_selection()}),this.connect(this.model.properties.options.change,function(){return t.render()}),this.connect(this.model.properties.name.change,function(){return t.render()}),this.connect(this.model.properties.title.change,function(){return t.render()}),this.connect(this.model.properties.size.change,function(){return t.render()}),this.connect(this.model.properties.disabled.change,function(){return t.render()})},t.prototype.render=function(){var t=this;o.prototype.render.call(this),r.empty(this.el);var e=r.label({for:this.model.id},this.model.title);this.el.appendChild(e);var n=this.model.options.map(function(t){var e,n;return s.isString(t)?e=n=t:(e=t[0],n=t[1]),r.option({value:e},n)});this.selectEl=r.select({multiple:!0,class:\"bk-widget-form-input\",id:this.model.id,name:this.model.name,disabled:this.model.disabled},n),this.selectEl.addEventListener(\"change\",function(){return t.change_input()}),this.el.appendChild(this.selectEl),this.render_selection()},t.prototype.render_selection=function(){for(var t=new Set(this.model.value),e=0,n=Array.from(this.el.querySelectorAll(\"option\"));e<n.length;e++){var i=n[e];i.selected=t.has(i.value)}this.selectEl.size=this.model.size},t.prototype.change_input=function(){for(var t=null!=this.el.querySelector(\"select:focus\"),e=[],n=0,i=Array.from(this.el.querySelectorAll(\"option\"));n<i.length;n++){var r=i[n];r.selected&&e.push(r.value)}this.model.value=e,o.prototype.change_input.call(this),t&&this.selectEl.focus()},t}(a.InputWidgetView);n.MultiSelectView=l;var u=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"MultiSelect\",this.prototype.default_view=l,this.define({value:[o.Array,[]],options:[o.Array,[]],size:[o.Number,4]})},t}(a.InputWidget);(n.MultiSelect=u).initClass()},414:function(t,e,n){var i=t(387),r=t(436),o=t(15),s=t(5),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this),s.empty(this.el)},e}(r.WidgetView);n.PanelView=a;var l=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"Panel\",this.prototype.default_view=a,this.define({title:[o.String,\"\"],child:[o.Instance],closable:[o.Bool,!1]})},t}(r.Widget);(n.Panel=l).initClass()},415:function(t,e,n){var i=t(387),r=t(412),o=t(5),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.render=function(){e.prototype.render.call(this);var t=o.p({style:{margin:0}},this.model.text);this.markupEl.appendChild(t)},t}(r.MarkupView);n.ParagraphView=s;var a=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"Paragraph\",this.prototype.default_view=s},t}(r.Markup);(n.Paragraph=a).initClass()},416:function(t,e,n){var i=t(387),r=t(424),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.inputEl.type=\"password\"},e}(r.TextInputView);n.PasswordInputView=o;var s=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"PasswordInput\",this.prototype.default_view=o},t}(r.TextInput);(n.PasswordInput=s).initClass()},417:function(t,e,n){var i=t(387),r=t(412),o=t(5),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.render=function(){e.prototype.render.call(this);var t=o.pre({style:{overflow:\"auto\"}},this.model.text);this.markupEl.appendChild(t)},t}(r.MarkupView);n.PreTextView=s;var a=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"PreText\",this.prototype.default_view=s},t}(r.Markup);(n.PreText=a).initClass()},418:function(t,e,n){var i=t(387),c=t(5),d=t(38),r=t(15),o=t(436),s=function(u){function t(){return null!==u&&u.apply(this,arguments)||this}return i.__extends(t,u),t.prototype.initialize=function(t){u.prototype.initialize.call(this,t),this.render()},t.prototype.connect_signals=function(){var t=this;u.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.render()})},t.prototype.render=function(){var t=this;u.prototype.render.call(this),c.empty(this.el);var e=c.div({class:\"bk-bs-btn-group\"});this.el.appendChild(e);for(var n=d.uniqueId(),i=this.model.active,r=this.model.labels,o=0;o<r.length;o++){var s=r[o],a=c.input({type:\"radio\",name:n,value:\"\"+o,checked:o==i});a.addEventListener(\"change\",function(){return t.change_input()});var l=c.label({class:[\"bk-bs-btn\",\"bk-bs-btn-\"+this.model.button_type]},a,s);o==i&&l.classList.add(\"bk-bs-active\"),e.appendChild(l)}},t.prototype.change_input=function(){for(var t=this.el.querySelectorAll(\"input\"),e=[],n=0;n<t.length;n++){var i=t[n];i.checked&&e.push(n)}this.model.active=e[0],null!=this.model.callback&&this.model.callback.execute(this.model)},t}(o.WidgetView);n.RadioButtonGroupView=s;var a=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"RadioButtonGroup\",this.prototype.default_view=s,this.define({active:[r.Any,null],labels:[r.Array,[]],button_type:[r.String,\"default\"],callback:[r.Instance]})},t}(o.Widget);(n.RadioButtonGroup=a).initClass()},419:function(t,e,n){var i=t(387),c=t(5),d=t(38),r=t(15),o=t(436),s=function(u){function t(){return null!==u&&u.apply(this,arguments)||this}return i.__extends(t,u),t.prototype.initialize=function(t){u.prototype.initialize.call(this,t),this.render()},t.prototype.connect_signals=function(){var t=this;u.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.render()})},t.prototype.render=function(){var t=this;u.prototype.render.call(this),c.empty(this.el);for(var e=d.uniqueId(),n=this.model.active,i=this.model.labels,r=0;r<i.length;r++){var o=i[r],s=c.input({type:\"radio\",name:e,value:\"\"+r});s.addEventListener(\"change\",function(){return t.change_input()}),this.model.disabled&&(s.disabled=!0),r==n&&(s.checked=!0);var a=c.label({},s,o);if(this.model.inline)a.classList.add(\"bk-bs-radio-inline\"),this.el.appendChild(a);else{var l=c.div({class:\"bk-bs-radio\"},a);this.el.appendChild(l)}}},t.prototype.change_input=function(){for(var t=this.el.querySelectorAll(\"input\"),e=[],n=0;n<t.length;n++){var i=t[n];i.checked&&e.push(n)}this.model.active=e[0],null!=this.model.callback&&this.model.callback.execute(this.model)},t}(o.WidgetView);n.RadioGroupView=s;var a=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"RadioGroup\",this.prototype.default_view=s,this.define({active:[r.Any,null],labels:[r.Array,[]],inline:[r.Bool,!1],callback:[r.Instance]})},t}(o.Widget);(n.RadioGroup=a).initClass()},420:function(t,e,n){var i=t(387),r=t(357),o=t(399),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._calc_to=function(){return{start:this.model.start,end:this.model.end,value:this.model.value,step:this.model.step}},e.prototype._calc_from=function(t){return t},e}(o.AbstractSliderView);n.RangeSliderView=s;var a=function(n){function t(t){var e=n.call(this,t)||this;return e.behaviour=\"drag\",e.connected=[!1,!0,!1],e}return i.__extends(t,n),t.initClass=function(){this.prototype.type=\"RangeSlider\",this.prototype.default_view=s,this.override({format:\"0[.]00\"})},t.prototype._formatter=function(t,e){return r.format(t,e)},t}(o.AbstractSlider);(n.RangeSlider=a).initClass()},421:function(t,e,n){var i=t(387),a=t(5),l=t(44),r=t(14),o=t(15),s=t(410),u=function(s){function t(){return null!==s&&s.apply(this,arguments)||this}return i.__extends(t,s),t.prototype.initialize=function(t){s.prototype.initialize.call(this,t),this.render()},t.prototype.connect_signals=function(){var t=this;s.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.render()})},t.prototype.build_options=function(t){var r=this;return t.map(function(t){var e,n;l.isString(t)?e=n=t:(e=t[0],n=t[1]);var i=r.model.value==e;return a.option({selected:i,value:e},n)})},t.prototype.render=function(){var t=this;s.prototype.render.call(this),a.empty(this.el);var e,n=a.label({for:this.model.id},this.model.title);if(this.el.appendChild(n),l.isArray(this.model.options))e=this.build_options(this.model.options);else{e=[];var i=this.model.options;for(var r in i){var o=i[r];e.push(a.optgroup({label:r},this.build_options(o)))}}this.selectEl=a.select({class:\"bk-widget-form-input\",id:this.model.id,name:this.model.name,disabled:this.model.disabled},e),this.selectEl.addEventListener(\"change\",function(){return t.change_input()}),this.el.appendChild(this.selectEl)},t.prototype.change_input=function(){var t=this.selectEl.value;r.logger.debug(\"selectbox: value = \"+t),this.model.value=t,s.prototype.change_input.call(this)},t}(s.InputWidgetView);n.SelectView=u;var c=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"Select\",this.prototype.default_view=u,this.define({value:[o.String,\"\"],options:[o.Any,[]]})},t}(s.InputWidget);(n.Select=c).initClass()},422:function(t,e,n){var i=t(387),r=t(357),o=t(399),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._calc_to=function(){return{start:this.model.start,end:this.model.end,value:[this.model.value],step:this.model.step}},e.prototype._calc_from=function(t){var e=t[0];return Number.isInteger(this.model.start)&&Number.isInteger(this.model.end)&&Number.isInteger(this.model.step)?Math.round(e):e},e}(o.AbstractSliderView);n.SliderView=s;var a=function(n){function t(t){var e=n.call(this,t)||this;return e.behaviour=\"tap\",e.connected=[!0,!1],e}return i.__extends(t,n),t.initClass=function(){this.prototype.type=\"Slider\",this.prototype.default_view=s,this.override({format:\"0[.]00\"})},t.prototype._formatter=function(t,e){return r.format(t,e)},t}(o.AbstractSlider);(n.Slider=a).initClass()},423:function(t,e,n){var i=t(387),h=t(5),p=t(21),r=t(15),o=t(436),s=function(d){function t(){return null!==d&&d.apply(this,arguments)||this}return i.__extends(t,d),t.prototype.connect_signals=function(){var t=this;d.prototype.connect_signals.call(this),this.connect(this.model.properties.tabs.change,function(){return t.rebuild_child_views()}),this.connect(this.model.properties.active.change,function(){return t.render()})},t.prototype.render=function(){var r=this;d.prototype.render.call(this),h.empty(this.el);var t=this.model.tabs.length;if(0!=t){this.model.active>=t&&(this.model.active=t-1);var o=this.model.tabs.map(function(t,e){return h.li({},h.span({data:{index:e}},t.title))});o[this.model.active].classList.add(\"bk-bs-active\");var e=h.ul({class:[\"bk-bs-nav\",\"bk-bs-nav-tabs\"]},o);this.el.appendChild(e);var s=this.model.tabs.map(function(t){return h.div({class:\"bk-bs-tab-pane\"})});s[this.model.active].classList.add(\"bk-bs-active\");var n=h.div({class:\"bk-bs-tab-content\"},s);this.el.appendChild(n),e.addEventListener(\"click\",function(t){if(t.preventDefault(),t.target!=t.currentTarget){var e=t.target,n=r.model.active,i=parseInt(e.dataset.index);n!=i&&(o[n].classList.remove(\"bk-bs-active\"),s[n].classList.remove(\"bk-bs-active\"),o[i].classList.add(\"bk-bs-active\"),s[i].classList.add(\"bk-bs-active\"),r.model.active=i,null!=r.model.callback&&r.model.callback.execute(r.model))}});for(var i=0,a=p.zip(this.model.children,s);i<a.length;i++){var l=a[i],u=l[0],c=l[1];c.appendChild(this.child_views[u.id].el)}}},t}(o.WidgetView);n.TabsView=s;var a=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"Tabs\",this.prototype.default_view=s,this.define({tabs:[r.Array,[]],active:[r.Number,0],callback:[r.Instance]})},t.prototype.get_layoutable_children=function(){return this.children},Object.defineProperty(t.prototype,\"children\",{get:function(){return this.tabs.map(function(t){return t.child})},enumerable:!0,configurable:!0}),t}(o.Widget);(n.Tabs=a).initClass()},424:function(t,e,n){var i=t(387),r=t(14),o=t(15),s=t(5),a=t(410),l=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i.__extends(t,n),t.prototype.initialize=function(t){n.prototype.initialize.call(this,t),this.render()},t.prototype.connect_signals=function(){var t=this;n.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.render()})},t.prototype.css_classes=function(){return n.prototype.css_classes.call(this).concat(\"bk-widget-form-group\")},t.prototype.render=function(){var t=this;n.prototype.render.call(this),s.empty(this.el);var e=s.label({for:this.model.id},this.model.title);this.el.appendChild(e),this.inputEl=s.input({type:\"text\",class:\"bk-widget-form-input\",id:this.model.id,name:this.model.name,value:this.model.value,disabled:this.model.disabled,placeholder:this.model.placeholder}),this.inputEl.addEventListener(\"change\",function(){return t.change_input()}),this.el.appendChild(this.inputEl),this.model.height&&(this.inputEl.style.height=this.model.height-35+\"px\")},t.prototype.change_input=function(){var t=this.inputEl.value;r.logger.debug(\"widget/text_input: value = \"+t),this.model.value=t,n.prototype.change_input.call(this)},t}(a.InputWidgetView);n.TextInputView=l;var u=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"TextInput\",this.prototype.default_view=l,this.define({value:[o.String,\"\"],placeholder:[o.String,\"\"]})},t}(a.InputWidget);(n.TextInput=u).initClass()},425:function(t,e,n){var i=t(387),r=t(397),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.model.active&&this.buttonEl.classList.add(\"bk-bs-active\")},e.prototype.change_input=function(){this.model.active=!this.model.active,t.prototype.change_input.call(this)},e}(r.AbstractButtonView);n.ToggleView=s;var a=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"Toggle\",this.prototype.default_view=s,this.define({active:[o.Bool,!1]}),this.override({label:\"Toggle\"})},t}(r.AbstractButton);(n.Toggle=a).initClass()},436:function(t,e,n){var i=t(387),r=t(152),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-widget\")},e.prototype.render=function(){this._render_classes(),null!=this.model.height&&(this.el.style.height=this.model.height+\"px\"),null!=this.model.width&&(this.el.style.width=this.model.width+\"px\")},e.prototype.get_width=function(){throw new Error(\"unused\")},e.prototype.get_height=function(){throw new Error(\"unused\")},e}(r.LayoutDOMView);n.WidgetView=o;var s=function(e){function t(t){return e.call(this,t)||this}return i.__extends(t,e),t.initClass=function(){this.prototype.type=\"Widget\"},t}(r.LayoutDOM);(n.Widget=s).initClass()},427:function(t,e,n){\n",
" /*! nouislider - 10.1.0 - 2017-07-28 17:11:18 */var i;i=function(){\"use strict\";var $=\"10.1.0\";function Q(t){t.preventDefault()}function r(t){return\"number\"==typeof t&&!isNaN(t)&&isFinite(t)}function Z(t,e,n){0<n&&(et(t,e),setTimeout(function(){nt(t,e)},n))}function tt(t){return Array.isArray(t)?t:[t]}function e(t){var e=(t=String(t)).split(\".\");return 1<e.length?e[1].length:0}function et(t,e){t.classList?t.classList.add(e):t.className+=\" \"+e}function nt(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp(\"(^|\\\\b)\"+e.split(\" \").join(\"|\")+\"(\\\\b|$)\",\"gi\"),\" \")}function it(t){var e=void 0!==window.pageXOffset,n=\"CSS1Compat\"===(t.compatMode||\"\"),i=e?window.pageXOffset:n?t.documentElement.scrollLeft:t.body.scrollLeft,r=e?window.pageYOffset:n?t.documentElement.scrollTop:t.body.scrollTop;return{x:i,y:r}}function c(t,e){return 100/(e-t)}function d(t,e){return 100*e/(t[1]-t[0])}function h(t,e){for(var n=1;t>=e[n];)n+=1;return n}function n(t,e,n){if(n>=t.slice(-1)[0])return 100;var i,r,o,s,a,l,u=h(n,t);return i=t[u-1],r=t[u],o=e[u-1],s=e[u],o+(l=n,d(a=[i,r],a[0]<0?l+Math.abs(a[0]):l-a[0])/c(o,s))}function i(t,e,n,i){if(100===i)return i;var r,o,s,a,l=h(i,t);return n?(r=t[l-1],((o=t[l])-r)/2<i-r?o:r):e[l-1]?t[l-1]+(s=i-t[l-1],a=e[l-1],Math.round(s/a)*a):i}function o(t,e,n){var i;if(\"number\"==typeof e&&(e=[e]),\"[object Array]\"!==Object.prototype.toString.call(e))throw new Error(\"noUiSlider (\"+$+\"): 'range' contains invalid value.\");if(!r(i=\"min\"===t?0:\"max\"===t?100:parseFloat(t))||!r(e[0]))throw new Error(\"noUiSlider (\"+$+\"): 'range' value isn't numeric.\");n.xPct.push(i),n.xVal.push(e[0]),i?n.xSteps.push(!isNaN(e[1])&&e[1]):isNaN(e[1])||(n.xSteps[0]=e[1]),n.xHighestCompleteStep.push(0)}function s(t,e,n){if(!e)return!0;n.xSteps[t]=d([n.xVal[t],n.xVal[t+1]],e)/c(n.xPct[t],n.xPct[t+1]);var i=(n.xVal[t+1]-n.xVal[t])/n.xNumSteps[t],r=Math.ceil(Number(i.toFixed(3))-1),o=n.xVal[t]+n.xNumSteps[t]*r;n.xHighestCompleteStep[t]=o}function a(t,e,n){this.xPct=[],this.xVal=[],this.xSteps=[n||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e;var i,r=[];for(i in t)t.hasOwnProperty(i)&&r.push([t[i],i]);for(r.length&&\"object\"==typeof r[0][0]?r.sort(function(t,e){return t[0][0]-e[0][0]}):r.sort(function(t,e){return t[0]-e[0]}),i=0;i<r.length;i++)o(r[i][1],r[i][0],this);for(this.xNumSteps=this.xSteps.slice(0),i=0;i<this.xNumSteps.length;i++)s(i,this.xNumSteps[i],this)}a.prototype.getMargin=function(t){var e=this.xNumSteps[0];if(e&&t/e%1!=0)throw new Error(\"noUiSlider (\"+$+\"): 'limit', 'margin' and 'padding' must be divisible by step.\");return 2===this.xPct.length&&d(this.xVal,t)},a.prototype.toStepping=function(t){return t=n(this.xVal,this.xPct,t)},a.prototype.fromStepping=function(t){return function(t,e,n){if(100<=n)return t.slice(-1)[0];var i,r,o,s,a,l=h(n,e);return i=t[l-1],r=t[l],o=e[l-1],s=e[l],a=[i,r],(n-o)*c(o,s)*(a[1]-a[0])/100+a[0]}(this.xVal,this.xPct,t)},a.prototype.getStep=function(t){return t=i(this.xPct,this.xSteps,this.snap,t)},a.prototype.getNearbySteps=function(t){var e=h(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e-0],step:this.xNumSteps[e-0],highestStep:this.xHighestCompleteStep[e-0]}}},a.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(e);return Math.max.apply(null,t)},a.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var l={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};function u(t){if(\"object\"==typeof(e=t)&&\"function\"==typeof e.to&&\"function\"==typeof e.from)return!0;var e;throw new Error(\"noUiSlider (\"+$+\"): 'format' requires 'to' and 'from' methods.\")}function p(t,e){if(!r(e))throw new Error(\"noUiSlider (\"+$+\"): 'step' is not numeric.\");t.singleStep=e}function f(t,e){if(\"object\"!=typeof e||Array.isArray(e))throw new Error(\"noUiSlider (\"+$+\"): 'range' is not an object.\");if(void 0===e.min||void 0===e.max)throw new Error(\"noUiSlider (\"+$+\"): Missing 'min' or 'max' in 'range'.\");if(e.min===e.max)throw new Error(\"noUiSlider (\"+$+\"): 'range' 'min' and 'max' cannot be equal.\");t.spectrum=new a(e,t.snap,t.singleStep)}function m(t,e){if(e=tt(e),!Array.isArray(e)||!e.length)throw new Error(\"noUiSlider (\"+$+\"): 'start' option is incorrect.\");t.handles=e.length,t.start=e}function v(t,e){if(\"boolean\"!=typeof(t.snap=e))throw new Error(\"noUiSlider (\"+$+\"): 'snap' option must be a boolean.\")}function g(t,e){if(\"boolean\"!=typeof(t.animate=e))throw new Error(\"noUiSlider (\"+$+\"): 'animate' option must be a boolean.\")}function y(t,e){if(\"number\"!=typeof(t.animationDuration=e))throw new Error(\"noUiSlider (\"+$+\"): 'animationDuration' option must be a number.\")}function b(t,e){var n,i=[!1];if(\"lower\"===e?e=[!0,!1]:\"upper\"===e&&(e=[!1,!0]),!0===e||!1===e){for(n=1;n<t.handles;n++)i.push(e);i.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error(\"noUiSlider (\"+$+\"): 'connect' option doesn't match handle count.\");i=e}t.connect=i}function _(t,e){switch(e){case\"horizontal\":t.ort=0;break;case\"vertical\":t.ort=1;break;default:throw new Error(\"noUiSlider (\"+$+\"): 'orientation' option is invalid.\")}}function w(t,e){if(!r(e))throw new Error(\"noUiSlider (\"+$+\"): 'margin' option must be numeric.\");if(0!==e&&(t.margin=t.spectrum.getMargin(e),!t.margin))throw new Error(\"noUiSlider (\"+$+\"): 'margin' option is only supported on linear sliders.\")}function x(t,e){if(!r(e))throw new Error(\"noUiSlider (\"+$+\"): 'limit' option must be numeric.\");if(t.limit=t.spectrum.getMargin(e),!t.limit||t.handles<2)throw new Error(\"noUiSlider (\"+$+\"): 'limit' option is only supported on linear sliders with 2 or more handles.\")}function k(t,e){if(!r(e))throw new Error(\"noUiSlider (\"+$+\"): 'padding' option must be numeric.\");if(0!==e){if(t.padding=t.spectrum.getMargin(e),!t.padding)throw new Error(\"noUiSlider (\"+$+\"): 'padding' option is only supported on linear sliders.\");if(t.padding<0)throw new Error(\"noUiSlider (\"+$+\"): 'padding' option must be a positive number.\");if(50<=t.padding)throw new Error(\"noUiSlider (\"+$+\"): 'padding' option must be less than half the range.\")}}function S(t,e){switch(e){case\"ltr\":t.dir=0;break;case\"rtl\":t.dir=1;break;default:throw new Error(\"noUiSlider (\"+$+\"): 'direction' option was not recognized.\")}}function C(t,e){if(\"string\"!=typeof e)throw new Error(\"noUiSlider (\"+$+\"): 'behaviour' must be a string containing options.\");var n=0<=e.indexOf(\"tap\"),i=0<=e.indexOf(\"drag\"),r=0<=e.indexOf(\"fixed\"),o=0<=e.indexOf(\"snap\"),s=0<=e.indexOf(\"hover\");if(r){if(2!==t.handles)throw new Error(\"noUiSlider (\"+$+\"): 'fixed' behaviour must be used with 2 handles\");w(t,t.start[1]-t.start[0])}t.events={tap:n||o,drag:i,fixed:r,snap:o,hover:s}}function E(t,e){if(\"boolean\"!=typeof(t.multitouch=e))throw new Error(\"noUiSlider (\"+$+\"): 'multitouch' option must be a boolean.\")}function D(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var n=0;n<t.handles;n++)t.tooltips.push(!0)}else{if(t.tooltips=tt(e),t.tooltips.length!==t.handles)throw new Error(\"noUiSlider (\"+$+\"): must pass a formatter for all handles.\");t.tooltips.forEach(function(t){if(\"boolean\"!=typeof t&&(\"object\"!=typeof t||\"function\"!=typeof t.to))throw new Error(\"noUiSlider (\"+$+\"): 'tooltips' must be passed a formatter or 'false'.\")})}}function M(t,e){u(t.ariaFormat=e)}function A(t,e){u(t.format=e)}function N(t,e){if(void 0!==e&&\"string\"!=typeof e&&!1!==e)throw new Error(\"noUiSlider (\"+$+\"): 'cssPrefix' must be a string or `false`.\");t.cssPrefix=e}function V(t,e){if(void 0!==e&&\"object\"!=typeof e)throw new Error(\"noUiSlider (\"+$+\"): 'cssClasses' must be an object.\");if(\"string\"==typeof t.cssPrefix)for(var n in t.cssClasses={},e)e.hasOwnProperty(n)&&(t.cssClasses[n]=t.cssPrefix+e[n]);else t.cssClasses=e}function I(t,e){if(!0!==e&&!1!==e)throw new Error(\"noUiSlider (\"+$+\"): 'useRequestAnimationFrame' option should be true (default) or false.\");t.useRequestAnimationFrame=e}function rt(e){var n={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,ariaFormat:l,format:l},i={step:{r:!1,t:p},start:{r:!0,t:m},connect:{r:!0,t:b},direction:{r:!0,t:S},snap:{r:!1,t:v},animate:{r:!1,t:g},animationDuration:{r:!1,t:y},range:{r:!0,t:f},orientation:{r:!1,t:_},margin:{r:!1,t:w},limit:{r:!1,t:x},padding:{r:!1,t:k},behaviour:{r:!0,t:C},multitouch:{r:!0,t:E},ariaFormat:{r:!1,t:M},format:{r:!1,t:A},tooltips:{r:!1,t:D},cssPrefix:{r:!1,t:N},cssClasses:{r:!1,t:V},useRequestAnimationFrame:{r:!1,t:I}},r={connect:!1,direction:\"ltr\",behaviour:\"tap\",multitouch:!1,orientation:\"horizontal\",cssPrefix:\"noUi-\",cssClasses:{target:\"target\",base:\"base\",origin:\"origin\",handle:\"handle\",handleLower:\"handle-lower\",handleUpper:\"handle-upper\",horizontal:\"horizontal\",vertical:\"vertical\",background:\"background\",connect:\"connect\",ltr:\"ltr\",rtl:\"rtl\",draggable:\"draggable\",drag:\"state-drag\",tap:\"state-tap\",active:\"active\",tooltip:\"tooltip\",pips:\"pips\",pipsHorizontal:\"pips-horizontal\",pipsVertical:\"pips-vertical\",marker:\"marker\",markerHorizontal:\"marker-horizontal\",markerVertical:\"marker-vertical\",markerNormal:\"marker-normal\",markerLarge:\"marker-large\",markerSub:\"marker-sub\",value:\"value\",valueHorizontal:\"value-horizontal\",valueVertical:\"value-vertical\",valueNormal:\"value-normal\",valueLarge:\"value-large\",valueSub:\"value-sub\"},useRequestAnimationFrame:!0};e.format&&!e.ariaFormat&&(e.ariaFormat=e.format),Object.keys(i).forEach(function(t){if(void 0===e[t]&&void 0===r[t]){if(i[t].r)throw new Error(\"noUiSlider (\"+$+\"): '\"+t+\"' is required.\");return!0}i[t].t(n,void 0===e[t]?r[t]:e[t])}),n.pips=e.pips;var t=[[\"left\",\"top\"],[\"right\",\"bottom\"]];return n.style=t[n.dir][n.ort],n.styleOposite=t[n.dir?0:1][n.ort],n}function P(t,d,o){var u,l,s,a,h,r,c,e,p=window.navigator.pointerEnabled?{start:\"pointerdown\",move:\"pointermove\",end:\"pointerup\"}:window.navigator.msPointerEnabled?{start:\"MSPointerDown\",move:\"MSPointerMove\",end:\"MSPointerUp\"}:{start:\"mousedown touchstart\",move:\"mousemove touchmove\",end:\"mouseup touchend\"},n=window.CSS&&CSS.supports&&CSS.supports(\"touch-action\",\"none\"),f=n&&function(){var t=!1;try{var e=Object.defineProperty({},\"passive\",{get:function(){t=!0}});window.addEventListener(\"test\",null,e)}catch(t){}return t}(),_=t,m=[],v=[],g=0,w=d.spectrum,y=[],b={},x=t.ownerDocument,k=x.documentElement,S=x.body;function C(t,e){var n=x.createElement(\"div\");return e&&et(n,e),t.appendChild(n),n}function i(t,e){var n=C(t,d.cssClasses.origin),i=C(n,d.cssClasses.handle);return i.setAttribute(\"data-handle\",e),i.setAttribute(\"tabindex\",\"0\"),i.setAttribute(\"role\",\"slider\"),i.setAttribute(\"aria-orientation\",d.ort?\"vertical\":\"horizontal\"),0===e?et(i,d.cssClasses.handleLower):e===d.handles-1&&et(i,d.cssClasses.handleUpper),n}function E(t,e){return!!e&&C(t,d.cssClasses.connect)}function D(t,e){return!!d.tooltips[e]&&C(t.firstChild,d.cssClasses.tooltip)}function M(e,i,r){var o=x.createElement(\"div\"),s=[d.cssClasses.valueNormal,d.cssClasses.valueLarge,d.cssClasses.valueSub],a=[d.cssClasses.markerNormal,d.cssClasses.markerLarge,d.cssClasses.markerSub],l=[d.cssClasses.valueHorizontal,d.cssClasses.valueVertical],u=[d.cssClasses.markerHorizontal,d.cssClasses.markerVertical];function c(t,e){var n=e===d.cssClasses.value,i=n?l:u,r=n?s:a;return e+\" \"+i[d.ort]+\" \"+r[t]}return et(o,d.cssClasses.pips),et(o,0===d.ort?d.cssClasses.pipsHorizontal:d.cssClasses.pipsVertical),Object.keys(e).forEach(function(t){!function(t,e){e[1]=e[1]&&i?i(e[0],e[1]):e[1];var n=C(o,!1);n.className=c(e[1],d.cssClasses.marker),n.style[d.style]=t+\"%\",e[1]&&((n=C(o,!1)).className=c(e[1],d.cssClasses.value),n.style[d.style]=t+\"%\",n.innerText=r.to(e[0]))}(t,e[t])}),o}function A(){var t;h&&((t=h).parentElement.removeChild(t),h=null)}function N(t){A();var p,f,m,e,v,n,i,g,y,b,r=t.mode,o=t.density||1,s=t.filter||!1,a=t.values||!1,l=t.stepped||!1,u=function(t,e,n){if(\"range\"===t||\"steps\"===t)return w.xVal;if(\"count\"===t){if(!e)throw new Error(\"noUiSlider (\"+$+\"): 'values' required for mode 'count'.\");var i,r=100/(e-1),o=0;for(e=[];(i=o++*r)<=100;)e.push(i);t=\"positions\"}return\"positions\"===t?e.map(function(t){return w.fromStepping(n?w.getStep(t):t)}):\"values\"===t?n?e.map(function(t){return w.fromStepping(w.getStep(w.toStepping(t)))}):e:void 0}(r,a,l),c=(p=o,f=r,m=u,v={},n=w.xVal[0],i=w.xVal[w.xVal.length-1],y=g=!1,b=0,(e=m.slice().sort(function(t,e){return t-e}),m=e.filter(function(t){return!this[t]&&(this[t]=!0)},{}))[0]!==n&&(m.unshift(n),g=!0),m[m.length-1]!==i&&(m.push(i),y=!0),m.forEach(function(t,e){var n,i,r,o,s,a,l,u,c,d=t,h=m[e+1];if(\"steps\"===f&&(n=w.xNumSteps[e]),n||(n=h-d),!1!==d&&void 0!==h)for(n=Math.max(n,1e-7),i=d;i<=h;i=(i+n).toFixed(7)/1){for(l=(s=(o=w.toStepping(i))-b)/p,c=s/(u=Math.round(l)),r=1;r<=u;r+=1)v[(b+r*c).toFixed(5)]=[\"x\",0];a=-1<m.indexOf(i)?1:\"steps\"===f?2:0,!e&&g&&(a=0),i===h&&y||(v[o.toFixed(5)]=[i,a]),b=o}}),v),d=t.format||{to:Math.round};return h=_.appendChild(M(c,s,d))}function V(){var t=u.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][d.ort];return 0===d.ort?t.width||u[e]:t.height||u[e]}function I(i,r,o,s){var e=function(t){return!_.hasAttribute(\"disabled\")&&(e=_,n=d.cssClasses.tap,(e.classList?!e.classList.contains(n):!new RegExp(\"\\\\b\"+n+\"\\\\b\").test(e.className))&&!!(t=function(t,e,n){var i,r,o=0===t.type.indexOf(\"touch\"),s=0===t.type.indexOf(\"mouse\"),a=0===t.type.indexOf(\"pointer\");if(0===t.type.indexOf(\"MSPointer\")&&(a=!0),o&&d.multitouch){var l=function(t){return t.target===n||n.contains(t.target)};if(\"touchstart\"===t.type){var u=Array.prototype.filter.call(t.touches,l);if(1<u.length)return!1;i=u[0].pageX,r=u[0].pageY}else{var c=Array.prototype.find.call(t.changedTouches,l);if(!c)return!1;i=c.pageX,r=c.pageY}}else if(o){if(1<t.touches.length)return!1;i=t.changedTouches[0].pageX,r=t.changedTouches[0].pageY}return e=e||it(x),(s||a)&&(i=t.clientX+e.x,r=t.clientY+e.y),t.pageOffset=e,t.points=[i,r],t.cursor=s||a,t}(t,s.pageOffset,s.target||r))&&!(i===p.start&&void 0!==t.buttons&&1<t.buttons)&&(!s.hover||!t.buttons)&&(f||t.preventDefault(),t.calcPoint=t.points[d.ort],void o(t,s)));var e,n},n=[];return i.split(\" \").forEach(function(t){r.addEventListener(t,e,!!f&&{passive:!0}),n.push([t,e])}),n}function P(t){var e,n,i,r,o,s,a=t-(e=u,n=d.ort,i=e.getBoundingClientRect(),r=e.ownerDocument,o=r.documentElement,s=it(r),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(s.x=0),n?i.top+s.y-o.clientTop:i.left+s.x-o.clientLeft),l=100*a/V();return d.dir?100-l:l}function R(t,i,n,e){var r=n.slice(),o=[!t,t],s=[t,!t];e=e.slice(),t&&e.reverse(),1<e.length?e.forEach(function(t,e){var n=z(r,t,r[t]+i,o[e],s[e],!1);!1===n?i=0:(i=n-r[t],r[t]=n)}):o=s=[!0];var a=!1;e.forEach(function(t,e){a=H(t,n[t]+i,o[e],s[e])||a}),a&&e.forEach(function(t){L(\"update\",t),L(\"slide\",t)})}function L(n,i,r){Object.keys(b).forEach(function(t){var e=t.split(\".\")[0];n===e&&b[t].forEach(function(t){t.call(a,y.map(d.format.to),i,y.slice(),r||!1,m.slice())})})}function T(t,e){\"mouseout\"===t.type&&\"HTML\"===t.target.nodeName&&null===t.relatedTarget&&W(t,e)}function O(t,e){if(-1===navigator.appVersion.indexOf(\"MSIE 9\")&&0===t.buttons&&0!==e.buttonsProperty)return W(t,e);var n=(d.dir?-1:1)*(t.calcPoint-e.startCalcPoint),i=100*n/e.baseSize;R(0<n,i,e.locations,e.handleNumbers)}function W(t,e){e.handle&&(nt(e.handle,d.cssClasses.active),g-=1),e.listeners.forEach(function(t){k.removeEventListener(t[0],t[1])}),0===g&&(nt(_,d.cssClasses.drag),Y(),t.cursor&&(S.style.cursor=\"\",S.removeEventListener(\"selectstart\",Q))),e.handleNumbers.forEach(function(t){L(\"change\",t),L(\"set\",t),L(\"end\",t)})}function B(t,e){var n;if(1===e.handleNumbers.length){var i=l[e.handleNumbers[0]];if(i.hasAttribute(\"disabled\"))return!1;n=i.children[0],g+=1,et(n,d.cssClasses.active)}t.stopPropagation();var r=[],o=I(p.move,k,O,{target:t.target,handle:n,listeners:r,startCalcPoint:t.calcPoint,baseSize:V(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:m.slice()}),s=I(p.end,k,W,{target:t.target,handle:n,listeners:r,handleNumbers:e.handleNumbers}),a=I(\"mouseout\",k,T,{target:t.target,handle:n,listeners:r,handleNumbers:e.handleNumbers});r.push.apply(r,o.concat(s,a)),t.cursor&&(S.style.cursor=getComputedStyle(t.target).cursor,1<l.length&&et(_,d.cssClasses.drag),S.addEventListener(\"selectstart\",Q,!1)),e.handleNumbers.forEach(function(t){L(\"start\",t)})}function U(t){t.stopPropagation();var i,r,o,e=P(t.calcPoint),n=(i=e,o=!(r=100),l.forEach(function(t,e){if(!t.hasAttribute(\"disabled\")){var n=Math.abs(m[e]-i);n<r&&(o=e,r=n)}}),o);if(!1===n)return!1;d.events.snap||Z(_,d.cssClasses.tap,d.animationDuration),H(n,e,!0,!0),Y(),L(\"slide\",n,!0),L(\"update\",n,!0),L(\"change\",n,!0),L(\"set\",n,!0),d.events.snap&&B(t,{handleNumbers:[n]})}function j(t){var e=P(t.calcPoint),n=w.getStep(e),i=w.fromStepping(n);Object.keys(b).forEach(function(t){\"hover\"===t.split(\".\")[0]&&b[t].forEach(function(t){t.call(a,i)})})}function z(t,e,n,i,r,o){var s;return 1<l.length&&(i&&0<e&&(n=Math.max(n,t[e-1]+d.margin)),r&&e<l.length-1&&(n=Math.min(n,t[e+1]-d.margin))),1<l.length&&d.limit&&(i&&0<e&&(n=Math.min(n,t[e-1]+d.limit)),r&&e<l.length-1&&(n=Math.max(n,t[e+1]-d.limit))),d.padding&&(0===e&&(n=Math.max(n,d.padding)),e===l.length-1&&(n=Math.min(n,100-d.padding))),n=w.getStep(n),s=n,!((n=Math.max(Math.min(s,100),0))===t[e]&&!o)&&n}function F(t){return t+\"%\"}function Y(){v.forEach(function(t){var e=50<m[t]?-1:1,n=3+(l.length+e*t);l[t].childNodes[0].style.zIndex=n})}function H(t,e,n,i){return!1!==(e=z(m,t,e,n,i,!1))&&(function(t,e){m[t]=e,y[t]=w.fromStepping(e);var n=function(){l[t].style[d.style]=F(e),q(t),q(t+1)};window.requestAnimationFrame&&d.useRequestAnimationFrame?window.requestAnimationFrame(n):n()}(t,e),!0)}function q(t){if(s[t]){var e=0,n=100;0!==t&&(e=m[t-1]),t!==s.length-1&&(n=m[t]),s[t].style[d.style]=F(e),s[t].style[d.styleOposite]=F(100-n)}}function G(t,e){null!==t&&!1!==t&&(\"number\"==typeof t&&(t=String(t)),!1===(t=d.format.from(t))||isNaN(t)||H(e,w.toStepping(t),!1,!1))}function X(t,e){var n=tt(t),i=void 0===m[0];e=void 0===e||!!e,n.forEach(G),d.animate&&!i&&Z(_,d.cssClasses.tap,d.animationDuration),v.forEach(function(t){H(t,m[t],!0,!1)}),Y(),v.forEach(function(t){L(\"update\",t),null!==n[t]&&e&&L(\"set\",t)})}function K(){var t=y.map(d.format.to);return 1===t.length?t[0]:t}function J(t,e){b[t]=b[t]||[],b[t].push(e),\"update\"===t.split(\".\")[0]&&l.forEach(function(t,e){L(\"update\",e)})}if(_.noUiSlider)throw new Error(\"noUiSlider (\"+$+\"): Slider was already initialized.\");return et(e=_,d.cssClasses.target),0===d.dir?et(e,d.cssClasses.ltr):et(e,d.cssClasses.rtl),0===d.ort?et(e,d.cssClasses.horizontal):et(e,d.cssClasses.vertical),u=C(e,d.cssClasses.base),function(t,e){l=[],(s=[]).push(E(e,t[0]));for(var n=0;n<d.handles;n++)l.push(i(e,n)),v[n]=n,s.push(E(e,t[n+1]))}(d.connect,u),a={destroy:function(){for(var t in d.cssClasses)d.cssClasses.hasOwnProperty(t)&&nt(_,d.cssClasses[t]);for(;_.firstChild;)_.removeChild(_.firstChild);delete _.noUiSlider},steps:function(){return m.map(function(t,e){var n=w.getNearbySteps(t),i=y[e],r=n.thisStep.step,o=null;!1!==r&&i+r>n.stepAfter.startValue&&(r=n.stepAfter.startValue-i),o=i>n.thisStep.startValue?n.thisStep.step:!1!==n.stepBefore.step&&i-n.stepBefore.highestStep,100===t?r=null:0===t&&(o=null);var s=w.countStepDecimals();return null!==r&&!1!==r&&(r=Number(r.toFixed(s))),null!==o&&!1!==o&&(o=Number(o.toFixed(s))),[o,r]})},on:J,off:function(t){var i=t&&t.split(\".\")[0],r=i&&t.substring(i.length);Object.keys(b).forEach(function(t){var e=t.split(\".\")[0],n=t.substring(e.length);i&&i!==e||r&&r!==n||delete b[t]})},get:K,set:X,reset:function(t){X(d.start,t)},__moveHandles:function(t,e,n){R(t,e,m,n)},options:o,updateOptions:function(e,t){var n=K(),i=[\"margin\",\"limit\",\"padding\",\"range\",\"animate\",\"snap\",\"step\",\"format\"];i.forEach(function(t){void 0!==e[t]&&(o[t]=e[t])});var r=rt(o);i.forEach(function(t){void 0!==e[t]&&(d[t]=r[t])}),w=r.spectrum,d.margin=r.margin,d.limit=r.limit,d.padding=r.padding,d.pips&&N(d.pips),m=[],X(e.start||n,t)},target:_,removePips:A,pips:N},(c=d.events).fixed||l.forEach(function(t,e){I(p.start,t.children[0],B,{handleNumbers:[e]})}),c.tap&&I(p.start,u,U,{}),c.hover&&I(p.move,u,j,{hover:!0}),c.drag&&s.forEach(function(t,e){if(!1!==t&&0!==e&&e!==s.length-1){var n=l[e-1],i=l[e],r=[t];et(t,d.cssClasses.draggable),c.fixed&&(r.push(n.children[0]),r.push(i.children[0])),r.forEach(function(t){I(p.start,t,B,{handles:[n,i],handleNumbers:[e-1,e]})})}}),X(d.start),d.pips&&N(d.pips),d.tooltips&&(r=l.map(D),J(\"update\",function(t,e,n){if(r[e]){var i=t[e];!0!==d.tooltips[e]&&(i=d.tooltips[e].to(n[e])),r[e].innerHTML=i}})),J(\"update\",function(t,e,s,n,a){v.forEach(function(t){var e=l[t],n=z(m,t,0,!0,!0,!0),i=z(m,t,100,!0,!0,!0),r=a[t],o=d.ariaFormat.to(s[t]);e.children[0].setAttribute(\"aria-valuemin\",n.toFixed(1)),e.children[0].setAttribute(\"aria-valuemax\",i.toFixed(1)),e.children[0].setAttribute(\"aria-valuenow\",r.toFixed(1)),e.children[0].setAttribute(\"aria-valuetext\",o)})}),a}return{version:$,create:function(t,e){if(!t||!t.nodeName)throw new Error(\"noUiSlider (\"+$+\"): create requires a single element, got: \"+t);var n=rt(e),i=P(t,n,e);return t.noUiSlider=i}}},\"object\"==typeof n?e.exports=i():window.noUiSlider=i()},428:function(i,r,o){\n",
" /*!\n",
" * Pikaday\n",
" *\n",
" * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday\n",
" */\n",
" !function(t,e){\"use strict\";var n;if(\"object\"==typeof o){try{n=i(\"moment\")}catch(t){}r.exports=e(n)}else t.Pikaday=e(t.moment)}(this,function(n){\"use strict\";var o=\"function\"==typeof n,s=!!window.addEventListener,c=window.document,u=window.setTimeout,a=function(t,e,n,i){s?t.addEventListener(e,n,!!i):t.attachEvent(\"on\"+e,n)},i=function(t,e,n,i){s?t.removeEventListener(e,n,!!i):t.detachEvent(\"on\"+e,n)},l=function(t,e){return-1!==(\" \"+t.className+\" \").indexOf(\" \"+e+\" \")},g=function(t){return/Array/.test(Object.prototype.toString.call(t))},B=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},U=function(t,e){return[31,(n=t,n%4==0&&n%100!=0||n%400==0?29:28),31,30,31,30,31,31,30,31,30,31][e];var n},j=function(t){B(t)&&t.setHours(0,0,0,0)},z=function(t,e){return t.getTime()===e.getTime()},d=function(t,e,n){var i,r;for(i in e)(r=void 0!==t[i])&&\"object\"==typeof e[i]&&null!==e[i]&&void 0===e[i].nodeName?B(e[i])?n&&(t[i]=new Date(e[i].getTime())):g(e[i])?n&&(t[i]=e[i].slice(0)):t[i]=d({},e[i],n):!n&&r||(t[i]=e[i]);return t},r=function(t,e,n){var i;c.createEvent?((i=c.createEvent(\"HTMLEvents\")).initEvent(e,!0,!1),i=d(i,n),t.dispatchEvent(i)):c.createEventObject&&(i=c.createEventObject(),i=d(i,n),t.fireEvent(\"on\"+e,i))},e=function(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),11<t.month&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t},h={field:null,bound:void 0,position:\"bottom left\",reposition:!0,format:\"YYYY-MM-DD\",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:\"\",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:\"left\",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:\"Previous Month\",nextMonth:\"Next Month\",months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],weekdays:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],weekdaysShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},p=function(t,e,n){for(e+=t.firstDay;7<=e;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},F=function(t){var e=[],n=\"false\";if(t.isEmpty){if(!t.showDaysInNextAndPreviousMonths)return'<td class=\"is-empty\"></td>';e.push(\"is-outside-current-month\"),t.enableSelectionDaysInNextAndPreviousMonths||e.push(\"is-selection-disabled\")}return t.isDisabled&&e.push(\"is-disabled\"),t.isToday&&e.push(\"is-today\"),t.isSelected&&(e.push(\"is-selected\"),n=\"true\"),t.hasEvent&&e.push(\"has-event\"),t.isInRange&&e.push(\"is-inrange\"),t.isStartRange&&e.push(\"is-startrange\"),t.isEndRange&&e.push(\"is-endrange\"),'<td data-day=\"'+t.day+'\" class=\"'+e.join(\" \")+'\" aria-selected=\"'+n+'\"><button class=\"pika-button pika-day\" type=\"button\" data-pika-year=\"'+t.year+'\" data-pika-month=\"'+t.month+'\" data-pika-day=\"'+t.day+'\">'+t.day+\"</button></td>\"},f=function(t,e,n,i,r,o){var s,a,l,u,c,d=t._o,h=n===d.minYear,p=n===d.maxYear,f='<div id=\"'+o+'\" class=\"pika-title\" role=\"heading\" aria-live=\"assertive\">',m=!0,v=!0;for(l=[],s=0;s<12;s++)l.push('<option value=\"'+(n===r?s-e:12+s-e)+'\"'+(s===i?' selected=\"selected\"':\"\")+(h&&s<d.minMonth||p&&s>d.maxMonth?'disabled=\"disabled\"':\"\")+\">\"+d.i18n.months[s]+\"</option>\");for(u='<div class=\"pika-label\">'+d.i18n.months[i]+'<select class=\"pika-select pika-select-month\" tabindex=\"-1\">'+l.join(\"\")+\"</select></div>\",g(d.yearRange)?(s=d.yearRange[0],a=d.yearRange[1]+1):(s=n-d.yearRange,a=1+n+d.yearRange),l=[];s<a&&s<=d.maxYear;s++)s>=d.minYear&&l.push('<option value=\"'+s+'\"'+(s===n?' selected=\"selected\"':\"\")+\">\"+s+\"</option>\");return c='<div class=\"pika-label\">'+n+d.yearSuffix+'<select class=\"pika-select pika-select-year\" tabindex=\"-1\">'+l.join(\"\")+\"</select></div>\",d.showMonthAfterYear?f+=c+u:f+=u+c,h&&(0===i||d.minMonth>=i)&&(m=!1),p&&(11===i||d.maxMonth<=i)&&(v=!1),0===e&&(f+='<button class=\"pika-prev'+(m?\"\":\" is-disabled\")+'\" type=\"button\">'+d.i18n.previousMonth+\"</button>\"),e===t._o.numberOfMonths-1&&(f+='<button class=\"pika-next'+(v?\"\":\" is-disabled\")+'\" type=\"button\">'+d.i18n.nextMonth+\"</button>\"),f+=\"</div>\"},Y=function(t,e,n){return'<table cellpadding=\"0\" cellspacing=\"0\" class=\"pika-table\" role=\"grid\" aria-labelledby=\"'+n+'\">'+function(t){var e,n=[];for(t.showWeekNumber&&n.push(\"<th></th>\"),e=0;e<7;e++)n.push('<th scope=\"col\"><abbr title=\"'+p(t,e)+'\">'+p(t,e,!0)+\"</abbr></th>\");return\"<thead><tr>\"+(t.isRTL?n.reverse():n).join(\"\")+\"</tr></thead>\"}(t)+\"<tbody>\"+e.join(\"\")+\"</tbody></table>\"},t=function(t){var i=this,r=i.config(t);i._onMouseDown=function(t){if(i._v){var e=(t=t||window.event).target||t.srcElement;if(e)if(l(e,\"is-disabled\")||(!l(e,\"pika-button\")||l(e,\"is-empty\")||l(e.parentNode,\"is-disabled\")?l(e,\"pika-prev\")?i.prevMonth():l(e,\"pika-next\")&&i.nextMonth():(i.setDate(new Date(e.getAttribute(\"data-pika-year\"),e.getAttribute(\"data-pika-month\"),e.getAttribute(\"data-pika-day\"))),r.bound&&u(function(){i.hide(),r.blurFieldOnSelect&&r.field&&r.field.blur()},100))),l(e,\"pika-select\"))i._c=!0;else{if(!t.preventDefault)return t.returnValue=!1;t.preventDefault()}}},i._onChange=function(t){var e=(t=t||window.event).target||t.srcElement;e&&(l(e,\"pika-select-month\")?i.gotoMonth(e.value):l(e,\"pika-select-year\")&&i.gotoYear(e.value))},i._onKeyChange=function(t){if(t=t||window.event,i.isVisible())switch(t.keyCode){case 13:case 27:r.field&&r.field.blur();break;case 37:t.preventDefault(),i.adjustDate(\"subtract\",1);break;case 38:i.adjustDate(\"subtract\",7);break;case 39:i.adjustDate(\"add\",1);break;case 40:i.adjustDate(\"add\",7)}},i._onInputChange=function(t){var e;t.firedBy!==i&&(e=r.parse?r.parse(r.field.value,r.format):o?(e=n(r.field.value,r.format,r.formatStrict))&&e.isValid()?e.toDate():null:new Date(Date.parse(r.field.value)),B(e)&&i.setDate(e),i._v||i.show())},i._onInputFocus=function(){i.show()},i._onInputClick=function(){i.show()},i._onInputBlur=function(){var t=c.activeElement;do{if(l(t,\"pika-single\"))return}while(t=t.parentNode);i._c||(i._b=u(function(){i.hide()},50)),i._c=!1},i._onClick=function(t){var e=(t=t||window.event).target||t.srcElement,n=e;if(e){!s&&l(e,\"pika-select\")&&(e.onchange||(e.setAttribute(\"onchange\",\"return;\"),a(e,\"change\",i._onChange)));do{if(l(n,\"pika-single\")||n===r.trigger)return}while(n=n.parentNode);i._v&&e!==r.trigger&&n!==r.trigger&&i.hide()}},i.el=c.createElement(\"div\"),i.el.className=\"pika-single\"+(r.isRTL?\" is-rtl\":\"\")+(r.theme?\" \"+r.theme:\"\"),a(i.el,\"mousedown\",i._onMouseDown,!0),a(i.el,\"touchend\",i._onMouseDown,!0),a(i.el,\"change\",i._onChange),r.keyboardInput&&a(c,\"keydown\",i._onKeyChange),r.field&&(r.container?r.container.appendChild(i.el):r.bound?c.body.appendChild(i.el):r.field.parentNode.insertBefore(i.el,r.field.nextSibling),a(r.field,\"change\",i._onInputChange),r.defaultDate||(o&&r.field.value?r.defaultDate=n(r.field.value,r.format).toDate():r.defaultDate=new Date(Date.parse(r.field.value)),r.setDefaultDate=!0));var e=r.defaultDate;B(e)?r.setDefaultDate?i.setDate(e,!0):i.gotoDate(e):i.gotoDate(new Date),r.bound?(this.hide(),i.el.className+=\" is-bound\",a(r.trigger,\"click\",i._onInputClick),a(r.trigger,\"focus\",i._onInputFocus),a(r.trigger,\"blur\",i._onInputBlur)):this.show()};return t.prototype={config:function(t){this._o||(this._o=d({},h,!0));var e=d(this._o,t,!0);e.isRTL=!!e.isRTL,e.field=e.field&&e.field.nodeName?e.field:null,e.theme=\"string\"==typeof e.theme&&e.theme?e.theme:null,e.bound=!!(void 0!==e.bound?e.field&&e.bound:e.field),e.trigger=e.trigger&&e.trigger.nodeName?e.trigger:e.field,e.disableWeekends=!!e.disableWeekends,e.disableDayFn=\"function\"==typeof e.disableDayFn?e.disableDayFn:null;var n=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=4<n?4:n,B(e.minDate)||(e.minDate=!1),B(e.maxDate)||(e.maxDate=!1),e.minDate&&e.maxDate&&e.maxDate<e.minDate&&(e.maxDate=e.minDate=!1),e.minDate&&this.setMinDate(e.minDate),e.maxDate&&this.setMaxDate(e.maxDate),g(e.yearRange)){var i=(new Date).getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||i,e.yearRange[1]=parseInt(e.yearRange[1],10)||i}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||h.yearRange,100<e.yearRange&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,B(this._d)?this._o.toString?this._o.toString(this._d,t):o?n(this._d).format(t):this._d.toDateString():\"\"},getMoment:function(){return o?n(this._d):null},setMoment:function(t,e){o&&n.isMoment(t)&&this.setDate(t.toDate(),e)},getDate:function(){return B(this._d)?new Date(this._d.getTime()):null},setDate:function(t,e){if(!t)return this._d=null,this._o.field&&(this._o.field.value=\"\",r(this._o.field,\"change\",{firedBy:this})),this.draw();if(\"string\"==typeof t&&(t=new Date(Date.parse(t))),B(t)){var n=this._o.minDate,i=this._o.maxDate;B(n)&&t<n?t=n:B(i)&&i<t&&(t=i),this._d=new Date(t.getTime()),j(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),r(this._o.field,\"change\",{firedBy:this})),e||\"function\"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(t){var e=!0;if(B(t)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),i=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),r=t.getTime();i.setMonth(i.getMonth()+1),i.setDate(i.getDate()-1),e=r<n.getTime()||i.getTime()<r}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}],\"right\"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(t,e){var n,i=this.getDate()||new Date,r=24*parseInt(e)*60*60*1e3;\"add\"===t?n=new Date(i.valueOf()+r):\"subtract\"===t&&(n=new Date(i.valueOf()-r)),this.setDate(n)},adjustCalendars:function(){this.calendars[0]=e(this.calendars[0]);for(var t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=e({month:this.calendars[0].month+t,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())},setMinDate:function(t){t instanceof Date?(j(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=h.minDate,this._o.minYear=h.minYear,this._o.minMonth=h.minMonth,this._o.startRange=h.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(j(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=h.maxDate,this._o.maxYear=h.maxYear,this._o.maxMonth=h.maxMonth,this._o.endRange=h.endRange),this.draw()},setStartRange:function(t){this._o.startRange=t},setEndRange:function(t){this._o.endRange=t},draw:function(t){if(this._v||t){var e,n=this._o,i=n.minYear,r=n.maxYear,o=n.minMonth,s=n.maxMonth,a=\"\";this._y<=i&&(this._y=i,!isNaN(o)&&this._m<o&&(this._m=o)),this._y>=r&&(this._y=r,!isNaN(s)&&this._m>s&&(this._m=s)),e=\"pika-title-\"+Math.random().toString(36).replace(/[^a-z]+/g,\"\").substr(0,2);for(var l=0;l<n.numberOfMonths;l++)a+='<div class=\"pika-lendar\">'+f(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,e)+this.render(this.calendars[l].year,this.calendars[l].month,e)+\"</div>\";this.el.innerHTML=a,n.bound&&\"hidden\"!==n.field.type&&u(function(){n.trigger.focus()},1),\"function\"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute(\"aria-label\",\"Use the arrow keys to pick a date\")}},adjustPosition:function(){var t,e,n,i,r,o,s,a,l,u;if(!this._o.container){if(this.el.style.position=\"absolute\",t=this._o.trigger,e=t,n=this.el.offsetWidth,i=this.el.offsetHeight,r=window.innerWidth||c.documentElement.clientWidth,o=window.innerHeight||c.documentElement.clientHeight,s=window.pageYOffset||c.body.scrollTop||c.documentElement.scrollTop,\"function\"==typeof t.getBoundingClientRect)u=t.getBoundingClientRect(),a=u.left+window.pageXOffset,l=u.bottom+window.pageYOffset;else for(a=e.offsetLeft,l=e.offsetTop+e.offsetHeight;e=e.offsetParent;)a+=e.offsetLeft,l+=e.offsetTop;(this._o.reposition&&r<a+n||-1<this._o.position.indexOf(\"right\")&&0<a-n+t.offsetWidth)&&(a=a-n+t.offsetWidth),(this._o.reposition&&o+s<l+i||-1<this._o.position.indexOf(\"top\")&&0<l-i-t.offsetHeight)&&(l=l-i-t.offsetHeight),this.el.style.left=a+\"px\",this.el.style.top=l+\"px\"}},render:function(t,e,n){var i=this._o,r=new Date,o=U(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];j(r),0<i.firstDay&&(s-=i.firstDay)<0&&(s+=7);for(var u=0===e?11:e-1,c=11===e?0:e+1,d=0===e?t-1:t,h=11===e?t+1:t,p=U(d,u),f=o+s,m=f;7<m;)m-=7;f+=7-m;for(var v,g,y,b,_,w,x,k=!1,S=0,C=0;S<f;S++){var E=new Date(t,e,S-s+1),D=!!B(this._d)&&z(E,this._d),M=z(E,r),A=-1!==i.events.indexOf(E.toDateString()),N=S<s||o+s<=S,V=S-s+1,I=e,P=t,R=i.startRange&&z(i.startRange,E),L=i.endRange&&z(i.endRange,E),T=i.startRange&&i.endRange&&i.startRange<E&&E<i.endRange,O=i.minDate&&E<i.minDate||i.maxDate&&E>i.maxDate||i.disableWeekends&&(0===(x=E.getDay())||6===x)||i.disableDayFn&&i.disableDayFn(E);N&&(S<s?(V=p+V,I=u,P=d):(V-=o,I=c,P=h));var W={day:V,month:I,year:P,hasEvent:A,isSelected:D,isToday:M,isDisabled:O,isEmpty:N,isStartRange:R,isEndRange:L,isInRange:T,showDaysInNextAndPreviousMonths:i.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:i.enableSelectionDaysInNextAndPreviousMonths};i.pickWholeWeek&&D&&(k=!0),l.push(F(W)),7==++C&&(i.showWeekNumber&&l.unshift((y=S-s,b=e,_=t,w=void 0,w=new Date(_,0,1),'<td class=\"pika-week\">'+Math.ceil(((new Date(_,b,y)-w)/864e5+w.getDay()+1)/7)+\"</td>\")),a.push((v=l,g=i.isRTL,'<tr class=\"pika-row'+(i.pickWholeWeek?\" pick-whole-week\":\"\")+(k?\" is-selected\":\"\")+'\">'+(g?v.reverse():v).join(\"\")+\"</tr>\")),C=0,k=!(l=[]))}return Y(i,a,n)},isVisible:function(){return this._v},show:function(){var t,e,n;this.isVisible()||(this._v=!0,this.draw(),t=this.el,e=\"is-hidden\",t.className=(n=(\" \"+t.className+\" \").replace(\" \"+e+\" \",\" \")).trim?n.trim():n.replace(/^\\s+|\\s+$/g,\"\"),this._o.bound&&(a(c,\"click\",this._onClick),this.adjustPosition()),\"function\"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var t,e,n=this._v;!1!==n&&(this._o.bound&&i(c,\"click\",this._onClick),this.el.style.position=\"static\",this.el.style.left=\"auto\",this.el.style.top=\"auto\",t=this.el,l(t,e=\"is-hidden\")||(t.className=\"\"===t.className?e:t.className+\" \"+e),this._v=!1,void 0!==n&&\"function\"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){var t=this._o;this.hide(),i(this.el,\"mousedown\",this._onMouseDown,!0),i(this.el,\"touchend\",this._onMouseDown,!0),i(this.el,\"change\",this._onChange),t.keyboardInput&&i(c,\"keydown\",this._onKeyChange),t.field&&(i(t.field,\"change\",this._onInputChange),t.bound&&(i(t.trigger,\"click\",this._onInputClick),i(t.trigger,\"focus\",this._onInputFocus),i(t.trigger,\"blur\",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},t})}})}(this);\n",
" //# sourceMappingURL=bokeh-widgets.min.js.map\n",
" /* END bokeh-widgets.min.js */\n",
" },\n",
" \n",
" function(Bokeh) {\n",
" /* BEGIN bokeh-tables.min.js */\n",
" /*!\n",
" * Copyright (c) 2012, Anaconda, Inc.\n",
" * All rights reserved.\n",
" * \n",
" * Redistribution and use in source and binary forms, with or without modification,\n",
" * are permitted provided that the following conditions are met:\n",
" * \n",
" * Redistributions of source code must retain the above copyright notice,\n",
" * this list of conditions and the following disclaimer.\n",
" * \n",
" * Redistributions in binary form must reproduce the above copyright notice,\n",
" * this list of conditions and the following disclaimer in the documentation\n",
" * and/or other materials provided with the distribution.\n",
" * \n",
" * Neither the name of Anaconda nor the names of any contributors\n",
" * may be used to endorse or promote products derived from this software\n",
" * without specific prior written permission.\n",
" * \n",
" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n",
" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n",
" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n",
" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n",
" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n",
" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n",
" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n",
" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n",
" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n",
" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\n",
" * THE POSSIBILITY OF SUCH DAMAGE.\n",
" */\n",
" !function(a,b){!function(Bokeh){var define;(function(e,t,n){if(null!=Bokeh)return Bokeh.register_plugin(e,{\"models/widgets/tables/cell_editors\":429,\"models/widgets/tables/cell_formatters\":430,\"models/widgets/tables/data_table\":431,\"models/widgets/tables/index\":432,\"models/widgets/tables/main\":433,\"models/widgets/tables/table_column\":434,\"models/widgets/tables/table_widget\":435,\"models/widgets/widget\":436},433);throw new Error(\"Cannot find Bokeh. You have to load it prior to loading plugins.\")})({429:function(e,t,n){var o=e(387),r=e(15),i=e(5),l=e(6),s=e(57),a=e(431),c=function(t){function e(e){return t.call(this,o.__assign({model:e.column.model},e))||this}return o.__extends(e,t),Object.defineProperty(e.prototype,\"emptyValue\",{get:function(){return null},enumerable:!0,configurable:!0}),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.inputEl=this._createInput(),this.defaultValue=null,this.args=e,this.render()},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-cell-editor\")},e.prototype.render=function(){t.prototype.render.call(this),this.args.container.appendChild(this.el),this.el.appendChild(this.inputEl),this.renderEditor(),this.disableNavigation()},e.prototype.renderEditor=function(){},e.prototype.disableNavigation=function(){this.inputEl.addEventListener(\"keydown\",function(e){switch(e.keyCode){case i.Keys.Left:case i.Keys.Right:case i.Keys.Up:case i.Keys.Down:case i.Keys.PageUp:case i.Keys.PageDown:e.stopImmediatePropagation()}})},e.prototype.destroy=function(){this.remove()},e.prototype.focus=function(){this.inputEl.focus()},e.prototype.show=function(){},e.prototype.hide=function(){},e.prototype.position=function(){},e.prototype.getValue=function(){return this.inputEl.value},e.prototype.setValue=function(e){this.inputEl.value=e},e.prototype.serializeValue=function(){return this.getValue()},e.prototype.isValueChanged=function(){return!(\"\"==this.getValue()&&null==this.defaultValue)&&this.getValue()!==this.defaultValue},e.prototype.applyValue=function(e,t){this.args.grid.getData().setField(e[a.DTINDEX_NAME],this.args.column.field,t)},e.prototype.loadValue=function(e){var t=e[this.args.column.field];this.defaultValue=null!=t?t:this.emptyValue,this.setValue(this.defaultValue)},e.prototype.validateValue=function(e){if(this.args.column.validator){var t=this.args.column.validator(e);if(!t.valid)return t}return{valid:!0,msg:null}},e.prototype.validate=function(){return this.validateValue(this.getValue())},e}(l.DOMView);n.CellEditorView=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"CellEditor\"},t}(s.Model);(n.CellEditor=u).initClass();var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),Object.defineProperty(e.prototype,\"emptyValue\",{get:function(){return\"\"},enumerable:!0,configurable:!0}),e.prototype._createInput=function(){return i.input({type:\"text\"})},e.prototype.renderEditor=function(){this.inputEl.focus(),this.inputEl.select()},e.prototype.loadValue=function(e){t.prototype.loadValue.call(this,e),this.inputEl.defaultValue=this.defaultValue,this.inputEl.select()},e}(c);n.StringEditorView=d;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"StringEditor\",this.prototype.default_view=d,this.define({completions:[r.Array,[]]})},t}(u);(n.StringEditor=p).initClass();var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.textarea()},t}(c);n.TextEditorView=f;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"TextEditor\",this.prototype.default_view=f},t}(u);(n.TextEditor=h).initClass();var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.select()},t.prototype.renderEditor=function(){for(var e=0,t=this.model.options;e<t.length;e++){var n=t[e];this.inputEl.appendChild(i.option({value:n},n))}this.focus()},t}(c);n.SelectEditorView=g;var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"SelectEditor\",this.prototype.default_view=g,this.define({options:[r.Array,[]]})},t}(u);(n.SelectEditor=m).initClass();var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.input({type:\"text\"})},t}(c);n.PercentEditorView=v;var w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"PercentEditor\",this.prototype.default_view=v},t}(u);(n.PercentEditor=w).initClass();var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.input({type:\"checkbox\",value:\"true\"})},t.prototype.renderEditor=function(){this.focus()},t.prototype.loadValue=function(e){this.defaultValue=!!e[this.args.column.field],this.inputEl.checked=this.defaultValue},t.prototype.serializeValue=function(){return this.inputEl.checked},t}(c);n.CheckboxEditorView=y;var C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"CheckboxEditor\",this.prototype.default_view=y},t}(u);(n.CheckboxEditor=C).initClass();var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype._createInput=function(){return i.input({type:\"text\"})},e.prototype.renderEditor=function(){this.inputEl.focus(),this.inputEl.select()},e.prototype.remove=function(){t.prototype.remove.call(this)},e.prototype.serializeValue=function(){return parseInt(this.getValue(),10)||0},e.prototype.loadValue=function(e){t.prototype.loadValue.call(this,e),this.inputEl.defaultValue=this.defaultValue,this.inputEl.select()},e.prototype.validateValue=function(e){return isNaN(e)?{valid:!1,msg:\"Please enter a valid integer\"}:t.prototype.validateValue.call(this,e)},e}(c);n.IntEditorView=b;var x=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"IntEditor\",this.prototype.default_view=b,this.define({step:[r.Number,1]})},t}(u);(n.IntEditor=x).initClass();var R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype._createInput=function(){return i.input({type:\"text\"})},e.prototype.renderEditor=function(){this.inputEl.focus(),this.inputEl.select()},e.prototype.remove=function(){t.prototype.remove.call(this)},e.prototype.serializeValue=function(){return parseFloat(this.getValue())||0},e.prototype.loadValue=function(e){t.prototype.loadValue.call(this,e),this.inputEl.defaultValue=this.defaultValue,this.inputEl.select()},e.prototype.validateValue=function(e){return isNaN(e)?{valid:!1,msg:\"Please enter a valid number\"}:t.prototype.validateValue.call(this,e)},e}(c);n.NumberEditorView=R;var S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"NumberEditor\",this.prototype.default_view=R,this.define({step:[r.Number,.01]})},t}(u);(n.NumberEditor=S).initClass();var E=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.input({type:\"text\"})},t}(c);n.TimeEditorView=E;var k=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"TimeEditor\",this.prototype.default_view=E},t}(u);(n.TimeEditor=k).initClass();var T=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.input({type:\"text\"})},Object.defineProperty(t.prototype,\"emptyValue\",{get:function(){return new Date},enumerable:!0,configurable:!0}),t.prototype.renderEditor=function(){this.inputEl.focus(),this.inputEl.select()},t.prototype.destroy=function(){e.prototype.destroy.call(this)},t.prototype.show=function(){e.prototype.show.call(this)},t.prototype.hide=function(){e.prototype.hide.call(this)},t.prototype.position=function(){return e.prototype.position.call(this)},t.prototype.getValue=function(){},t.prototype.setValue=function(e){},t}(c);n.DateEditorView=T;var P=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"DateEditor\",this.prototype.default_view=T},t}(u);(n.DateEditor=P).initClass()},430:function(e,t,n){var a=e(387),u=e(357),c=e(445),s=e(386),o=e(15),d=e(5),p=e(44),r=e(57),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),t.prototype.doFormat=function(e,t,n,o,r){return null==n?\"\":(n+\"\").replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\")},t}(r.Model),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),t.initClass=function(){this.prototype.type=\"StringFormatter\",this.define({font_style:[o.FontStyle,\"normal\"],text_align:[o.TextAlign,\"left\"],text_color:[o.Color]})},t.prototype.doFormat=function(e,t,n,o,r){var i=this.font_style,l=this.text_align,s=this.text_color,a=d.span({},null==n?\"\":\"\"+n);switch(i){case\"bold\":a.style.fontWeight=\"bold\";break;case\"italic\":a.style.fontStyle=\"italic\"}return null!=l&&(a.style.textAlign=l),null!=s&&(a.style.color=s),a.outerHTML},t}(n.CellFormatter=i);(n.StringFormatter=l).initClass();var f=function(c){function e(){return null!==c&&c.apply(this,arguments)||this}return a.__extends(e,c),e.initClass=function(){this.prototype.type=\"NumberFormatter\",this.define({format:[o.String,\"0,0\"],language:[o.String,\"en\"],rounding:[o.String,\"round\"]})},e.prototype.doFormat=function(e,t,n,o,r){var i=this,l=this.format,s=this.language,a=function(){switch(i.rounding){case\"round\":case\"nearest\":return Math.round;case\"floor\":case\"rounddown\":return Math.floor;case\"ceil\":case\"roundup\":return Math.ceil}}();return n=u.format(n,l,s,a),c.prototype.doFormat.call(this,e,t,n,o,r)},e}(l);(n.NumberFormatter=f).initClass();var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),t.initClass=function(){this.prototype.type=\"BooleanFormatter\",this.define({icon:[o.String,\"check\"]})},t.prototype.doFormat=function(e,t,n,o,r){return n?d.i({class:this.icon}).outerHTML:\"\"},t}(i);(n.BooleanFormatter=h).initClass();var g=function(l){function e(){return null!==l&&l.apply(this,arguments)||this}return a.__extends(e,l),e.initClass=function(){this.prototype.type=\"DateFormatter\",this.define({format:[o.String,\"ISO-8601\"]})},e.prototype.getFormat=function(){switch(this.format){case\"ATOM\":case\"W3C\":case\"RFC-3339\":case\"ISO-8601\":return\"%Y-%m-%d\";case\"COOKIE\":return\"%a, %d %b %Y\";case\"RFC-850\":return\"%A, %d-%b-%y\";case\"RFC-1123\":case\"RFC-2822\":return\"%a, %e %b %Y\";case\"RSS\":case\"RFC-822\":case\"RFC-1036\":return\"%a, %e %b %y\";case\"TIMESTAMP\":return;default:return this.format}},e.prototype.doFormat=function(e,t,n,o,r){n=p.isString(n)?parseInt(n,10):n;var i=s(n,this.getFormat());return l.prototype.doFormat.call(this,e,t,i,o,r)},e}(i);(n.DateFormatter=g).initClass();var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),t.initClass=function(){this.prototype.type=\"HTMLTemplateFormatter\",this.define({template:[o.String,\"<%= value %>\"]})},t.prototype.doFormat=function(e,t,n,o,r){var i=this.template;if(null==n)return\"\";var l=c(i),s=a.__assign({},r,{value:n});return l(s)},t}(i);(n.HTMLTemplateFormatter=m).initClass()},431:function(e,t,i){var o=e(387),s=e(443).Grid,a=e(441).RowSelectionModel,c=e(440).CheckboxSelectColumn,r=e(15),n=e(38),l=e(21),u=e(32),d=e(14),p=e(435),f=e(436);i.DTINDEX_NAME=\"__bkdt_internal_index__\";var h=function(){function e(e,t){if(this.source=e,this.view=t,i.DTINDEX_NAME in this.source.data)throw new Error(\"special name \"+i.DTINDEX_NAME+\" cannot be used as a data table column\");this.index=this.view.indices}return e.prototype.getLength=function(){return this.index.length},e.prototype.getItem=function(e){for(var t={},n=0,o=u.keys(this.source.data);n<o.length;n++){var r=o[n];t[r]=this.source.data[r][this.index[e]]}return t[i.DTINDEX_NAME]=this.index[e],t},e.prototype.setItem=function(e,t){for(var n in t){var o=t[n];n!=i.DTINDEX_NAME&&(this.source.data[n][this.index[e]]=o)}this._update_source_inplace()},e.prototype.getField=function(e,t){return t==i.DTINDEX_NAME?this.index[e]:this.source.data[t][this.index[e]]},e.prototype.setField=function(e,t,n){this.source.data[t][this.index[e]]=n,this._update_source_inplace()},e.prototype.getItemMetadata=function(e){return null},e.prototype.getRecords=function(){var t=this;return l.range(0,this.getLength()).map(function(e){return t.getItem(e)})},e.prototype.sort=function(e){var u=e.map(function(e){return[e.sortCol.field,e.sortAsc?1:-1]});0==u.length&&(u=[[i.DTINDEX_NAME,1]]);var d=this.getRecords(),p=this.index.slice();this.index.sort(function(e,t){for(var n=0,o=u;n<o.length;n++){var r=o[n],i=r[0],l=r[1],s=d[p.indexOf(e)][i],a=d[p.indexOf(t)][i],c=s==a?0:a<s?l:-l;if(0!=c)return c}return 0})},e.prototype._update_source_inplace=function(){this.source.properties.data.change.emit()},e}();i.DataProvider=h;var g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._in_selection_update=!1,e._warned_not_reorderable=!1,e}return o.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.render()}),this.connect(this.model.source.streaming,function(){return e.updateGrid()}),this.connect(this.model.source.patching,function(){return e.updateGrid()}),this.connect(this.model.source.change,function(){return e.updateGrid(!0)}),this.connect(this.model.source.properties.data.change,function(){return e.updateGrid()}),this.connect(this.model.source.selected.change,function(){return e.updateSelection()})},e.prototype.updateGrid=function(e){void 0===e&&(e=!1),this.model.view.compute_indices(),this.data.constructor(this.model.source,this.model.view),this.grid.invalidate(),this.grid.render(),e||(this.model.source.data=this.model.source.data,this.model.source.change.emit())},e.prototype.updateSelection=function(){var t=this;if(!this._in_selection_update){var e=this.model.source.selected,n=e.indices.map(function(e){return t.data.index.indexOf(e)});this._in_selection_update=!0,this.grid.setSelectedRows(n),this._in_selection_update=!1;var o=this.grid.getViewport(),r=this.model.get_scroll_index(o,n);null!=r&&this.grid.scrollRowToTop(r)}},e.prototype.newIndexColumn=function(){return{id:n.uniqueId(),name:this.model.index_header,field:i.DTINDEX_NAME,width:this.model.index_width,behavior:\"select\",cannotTriggerInsert:!0,resizable:!1,selectable:!1,sortable:!0,cssClass:\"bk-cell-index\",headerCssClass:\"bk-header-index\"}},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-data-table\")},e.prototype.render=function(){var e,n=this,o=this.model.columns.map(function(e){return e.toColumn()});if(\"checkbox\"==this.model.selectable&&(e=new c({cssClass:\"bk-cell-select\"}),o.unshift(e.getColumnDefinition())),null!=this.model.index_position){var t=this.model.index_position,r=this.newIndexColumn();-1==t?o.push(r):t<-1?o.splice(t+1,0,r):o.splice(t,0,r)}var i=this.model.reorderable;!i||\"undefined\"!=typeof $&&null!=$.fn&&null!=$.fn.sortable||(this._warned_not_reorderable||(d.logger.warn(\"jquery-ui is required to enable DataTable.reorderable\"),this._warned_not_reorderable=!0),i=!1);var l={enableCellNavigation:!1!==this.model.selectable,enableColumnReorder:i,forceFitColumns:this.model.fit_columns,autoHeight:\"auto\"==this.model.height,multiColumnSort:this.model.sortable,editable:this.model.editable,autoEdit:!1};null!=this.model.width?this.el.style.width=this.model.width+\"px\":this.el.style.width=this.model.default_width+\"px\",null!=this.model.height&&\"auto\"!=this.model.height&&(this.el.style.height=this.model.height+\"px\"),this.data=new h(this.model.source,this.model.view),this.grid=new s(this.el,this.data,o,l),this.grid.onSort.subscribe(function(e,t){o=t.sortCols,n.data.sort(o),n.grid.invalidate(),n.updateSelection(),n.grid.render()}),!1!==this.model.selectable&&(this.grid.setSelectionModel(new a({selectActiveRow:null==e})),null!=e&&this.grid.registerPlugin(e),this.grid.onSelectedRowsChanged.subscribe(function(e,t){n._in_selection_update||(n.model.source.selected.indices=t.rows.map(function(e){return n.data.index[e]}))}),this.updateSelection())},e}(f.WidgetView);i.DataTableView=g;var m=function(n){function e(e){var t=n.call(this,e)||this;return t.default_width=600,t}return o.__extends(e,n),e.initClass=function(){this.prototype.type=\"DataTable\",this.prototype.default_view=g,this.define({columns:[r.Array,[]],fit_columns:[r.Bool,!0],sortable:[r.Bool,!0],reorderable:[r.Bool,!0],editable:[r.Bool,!1],selectable:[r.Bool,!0],index_position:[r.Int,0],index_header:[r.String,\"#\"],index_width:[r.Int,40],scroll_to_selection:[r.Bool,!0]}),this.override({height:400})},e.prototype.get_scroll_index=function(t,e){return this.scroll_to_selection&&0!=e.length?l.any(e,function(e){return t.top<=e&&e<=t.bottom})?null:Math.max(0,Math.min.apply(Math,e)-1):null},e}(p.TableWidget);(i.DataTable=m).initClass()},432:function(e,t,n){var o=e(387);o.__exportStar(e(429),n),o.__exportStar(e(430),n);var r=e(431);n.DataTable=r.DataTable;var i=e(434);n.TableColumn=i.TableColumn;var l=e(435);n.TableWidget=l.TableWidget},433:function(e,t,n){var o=e(432);n.Tables=o;var r=e(0);r.register_models(o)},434:function(e,t,n){var o=e(387),r=e(430),i=e(429),l=e(15),s=e(38),a=e(57),c=function(t){function e(e){return t.call(this,e)||this}return o.__extends(e,t),e.initClass=function(){this.prototype.type=\"TableColumn\",this.define({field:[l.String],title:[l.String],width:[l.Number,300],formatter:[l.Instance,function(){return new r.StringFormatter}],editor:[l.Instance,function(){return new i.StringEditor}],sortable:[l.Bool,!0],default_sort:[l.String,\"ascending\"]})},e.prototype.toColumn=function(){return{id:s.uniqueId(),field:this.field,name:this.title,width:this.width,formatter:null!=this.formatter?this.formatter.doFormat.bind(this.formatter):void 0,model:this.editor,editor:this.editor.default_view,sortable:this.sortable,defaultSortAsc:\"ascending\"==this.default_sort}},e}(a.Model);(n.TableColumn=c).initClass()},435:function(e,t,n){var o=e(387),r=e(436),i=e(189),l=e(15),s=function(t){function e(e){return t.call(this,e)||this}return o.__extends(e,t),e.initClass=function(){this.prototype.type=\"TableWidget\",this.define({source:[l.Instance],view:[l.Instance,function(){return new i.CDSView}]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),null==this.view.source&&(this.view.source=this.source,this.view.compute_indices())},e}(r.Widget);(n.TableWidget=s).initClass()},436:function(e,t,n){var o=e(387),r=e(152),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.css_classes=function(){return e.prototype.css_classes.call(this).concat(\"bk-widget\")},t.prototype.render=function(){this._render_classes(),null!=this.model.height&&(this.el.style.height=this.model.height+\"px\"),null!=this.model.width&&(this.el.style.width=this.model.width+\"px\")},t.prototype.get_width=function(){throw new Error(\"unused\")},t.prototype.get_height=function(){throw new Error(\"unused\")},t}(r.LayoutDOMView);n.WidgetView=i;var l=function(t){function e(e){return t.call(this,e)||this}return o.__extends(e,t),e.initClass=function(){this.prototype.type=\"Widget\"},e}(r.LayoutDOM);(n.Widget=l).initClass()},437:function(e,n,t){\n",
" /*!\n",
" * jQuery JavaScript Library v3.2.1\n",
" * https://jquery.com/\n",
" *\n",
" * Includes Sizzle.js\n",
" * https://sizzlejs.com/\n",
" *\n",
" * Copyright JS Foundation and other contributors\n",
" * Released under the MIT license\n",
" * https://jquery.org/license\n",
" *\n",
" * Date: 2017-03-20T18:59Z\n",
" */\n",
" !function(e,t){\"use strict\";\"object\"==typeof n&&\"object\"==typeof n.exports?n.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error(\"jQuery requires a window with a document\");return t(e)}:t(e)}(\"undefined\"!=typeof window?window:this,function(R,e){\"use strict\";var t=[],S=R.document,o=Object.getPrototypeOf,s=t.slice,g=t.concat,a=t.push,r=t.indexOf,n={},i=n.toString,h=n.hasOwnProperty,l=h.toString,c=l.call(Object),m={};function v(e,t){var n=(t=t||S).createElement(\"script\");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}var E=function(e,t){return new E.fn.init(e,t)},u=/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,d=/^-ms-/,p=/-([a-z])/g,f=function(e,t){return t.toUpperCase()};function w(e){var t=!!e&&\"length\"in e&&e.length,n=E.type(e);return\"function\"!==n&&!E.isWindow(e)&&(\"array\"===n||0===t||\"number\"==typeof t&&0<t&&t-1 in e)}E.fn=E.prototype={jquery:\"3.2.1\",constructor:E,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=E.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return E.each(this,e)},map:function(n){return this.pushStack(E.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:a,sort:t.sort,splice:t.splice},E.extend=E.fn.extend=function(){var e,t,n,o,r,i,l=arguments[0]||{},s=1,a=arguments.length,c=!1;for(\"boolean\"==typeof l&&(c=l,l=arguments[s]||{},s++),\"object\"==typeof l||E.isFunction(l)||(l={}),s===a&&(l=this,s--);s<a;s++)if(null!=(e=arguments[s]))for(t in e)n=l[t],o=e[t],l!==o&&(c&&o&&(E.isPlainObject(o)||(r=Array.isArray(o)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&E.isPlainObject(n)?n:{},l[t]=E.extend(c,i,o)):void 0!==o&&(l[t]=o));return l},E.extend({expando:\"jQuery\"+(\"3.2.1\"+Math.random()).replace(/\\D/g,\"\"),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return\"function\"===E.type(e)},isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=E.type(e);return(\"number\"===t||\"string\"===t)&&!isNaN(e-parseFloat(e))},isPlainObject:function(e){var t,n;return!(!e||\"[object Object]\"!==i.call(e))&&(!(t=o(e))||\"function\"==typeof(n=h.call(t,\"constructor\")&&t.constructor)&&l.call(n)===c)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+\"\":\"object\"==typeof e||\"function\"==typeof e?n[i.call(e)]||\"object\":typeof e},globalEval:function(e){v(e)},camelCase:function(e){return e.replace(d,\"ms-\").replace(p,f)},each:function(e,t){var n,o=0;if(w(e))for(n=e.length;o<n&&!1!==t.call(e[o],o,e[o]);o++);else for(o in e)if(!1===t.call(e[o],o,e[o]))break;return e},trim:function(e){return null==e?\"\":(e+\"\").replace(u,\"\")},makeArray:function(e,t){var n=t||[];return null!=e&&(w(Object(e))?E.merge(n,\"string\"==typeof e?[e]:e):a.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:r.call(t,e,n)},merge:function(e,t){for(var n=+t.length,o=0,r=e.length;o<n;o++)e[r++]=t[o];return e.length=r,e},grep:function(e,t,n){for(var o=[],r=0,i=e.length,l=!n;r<i;r++)!t(e[r],r)!==l&&o.push(e[r]);return o},map:function(e,t,n){var o,r,i=0,l=[];if(w(e))for(o=e.length;i<o;i++)null!=(r=t(e[i],i,n))&&l.push(r);else for(i in e)null!=(r=t(e[i],i,n))&&l.push(r);return g.apply([],l)},guid:1,proxy:function(e,t){var n,o,r;if(\"string\"==typeof t&&(n=e[t],t=e,e=n),E.isFunction(e))return o=s.call(arguments,2),(r=function(){return e.apply(t||this,o.concat(s.call(arguments)))}).guid=e.guid=e.guid||E.guid++,r},now:Date.now,support:m}),\"function\"==typeof Symbol&&(E.fn[Symbol.iterator]=t[Symbol.iterator]),E.each(\"Boolean Number String Function Array Date RegExp Object Error Symbol\".split(\" \"),function(e,t){n[\"[object \"+t+\"]\"]=t.toLowerCase()});var y=\n",
" /*!\n",
" * Sizzle CSS Selector Engine v2.3.3\n",
" * https://sizzlejs.com/\n",
" *\n",
" * Copyright jQuery Foundation and other contributors\n",
" * Released under the MIT license\n",
" * http://jquery.org/license\n",
" *\n",
" * Date: 2016-08-08\n",
" */\n",
" function(n){var e,f,C,i,r,h,d,g,b,a,c,x,R,l,S,m,s,u,v,E=\"sizzle\"+1*new Date,w=n.document,k=0,o=0,p=le(),y=le(),T=le(),P=function(e,t){return e===t&&(c=!0),0},D={}.hasOwnProperty,t=[],N=t.pop,A=t.push,$=t.push,H=t.slice,L=function(e,t){for(var n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},_=\"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",F=\"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",I=\"(?:\\\\\\\\.|[\\\\w-]|[^\\0-\\\\xa0])+\",M=\"\\\\[\"+F+\"*(\"+I+\")(?:\"+F+\"*([*^$|!~]?=)\"+F+\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\"+I+\"))|)\"+F+\"*\\\\]\",W=\":(\"+I+\")(?:\\\\((('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\"+M+\")*)|.*)\\\\)|)\",j=new RegExp(F+\"+\",\"g\"),V=new RegExp(\"^\"+F+\"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\"+F+\"+$\",\"g\"),B=new RegExp(\"^\"+F+\"*,\"+F+\"*\"),q=new RegExp(\"^\"+F+\"*([>+~]|\"+F+\")\"+F+\"*\"),O=new RegExp(\"=\"+F+\"*([^\\\\]'\\\"]*?)\"+F+\"*\\\\]\",\"g\"),z=new RegExp(W),X=new RegExp(\"^\"+I+\"$\"),U={ID:new RegExp(\"^#(\"+I+\")\"),CLASS:new RegExp(\"^\\\\.(\"+I+\")\"),TAG:new RegExp(\"^(\"+I+\"|[*])\"),ATTR:new RegExp(\"^\"+M),PSEUDO:new RegExp(\"^\"+W),CHILD:new RegExp(\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\"+F+\"*(even|odd|(([+-]|)(\\\\d*)n|)\"+F+\"*(?:([+-]|)\"+F+\"*(\\\\d+)|))\"+F+\"*\\\\)|)\",\"i\"),bool:new RegExp(\"^(?:\"+_+\")$\",\"i\"),needsContext:new RegExp(\"^\"+F+\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\"+F+\"*((?:-\\\\d)?\\\\d*)\"+F+\"*\\\\)|)(?=[^-]|$)\",\"i\")},K=/^(?:input|select|textarea|button)$/i,G=/^h\\d$/i,Y=/^[^{]+\\{\\s*\\[native \\w/,Q=/^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,J=/[+~]/,Z=new RegExp(\"\\\\\\\\([\\\\da-f]{1,6}\"+F+\"?|(\"+F+\")|.)\",\"ig\"),ee=function(e,t,n){var o=\"0x\"+t-65536;return o!=o||n?t:o<0?String.fromCharCode(o+65536):String.fromCharCode(o>>10|55296,1023&o|56320)},te=/([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,ne=function(e,t){return t?\"\\0\"===e?\"�\":e.slice(0,-1)+\"\\\\\"+e.charCodeAt(e.length-1).toString(16)+\" \":\"\\\\\"+e},oe=function(){x()},re=we(function(e){return!0===e.disabled&&(\"form\"in e||\"label\"in e)},{dir:\"parentNode\",next:\"legend\"});try{$.apply(t=H.call(w.childNodes),w.childNodes),t[w.childNodes.length].nodeType}catch(e){$={apply:t.length?function(e,t){A.apply(e,H.call(t))}:function(e,t){for(var n=e.length,o=0;e[n++]=t[o++];);e.length=n-1}}}function ie(e,t,n,o){var r,i,l,s,a,c,u,d=t&&t.ownerDocument,p=t?t.nodeType:9;if(n=n||[],\"string\"!=typeof e||!e||1!==p&&9!==p&&11!==p)return n;if(!o&&((t?t.ownerDocument||t:w)!==R&&x(t),t=t||R,S)){if(11!==p&&(a=Q.exec(e)))if(r=a[1]){if(9===p){if(!(l=t.getElementById(r)))return n;if(l.id===r)return n.push(l),n}else if(d&&(l=d.getElementById(r))&&v(t,l)&&l.id===r)return n.push(l),n}else{if(a[2])return $.apply(n,t.getElementsByTagName(e)),n;if((r=a[3])&&f.getElementsByClassName&&t.getElementsByClassName)return $.apply(n,t.getElementsByClassName(r)),n}if(f.qsa&&!T[e+\" \"]&&(!m||!m.test(e))){if(1!==p)d=t,u=e;else if(\"object\"!==t.nodeName.toLowerCase()){for((s=t.getAttribute(\"id\"))?s=s.replace(te,ne):t.setAttribute(\"id\",s=E),c=h(e),i=c.length;i--;)c[i]=\"#\"+s+\" \"+ve(c[i]);u=c.join(\",\"),d=J.test(e)&&ge(t.parentNode)||t}if(u)try{return $.apply(n,d.querySelectorAll(u)),n}catch(e){}finally{s===E&&t.removeAttribute(\"id\")}}}return g(e.replace(V,\"$1\"),t,n,o)}function le(){var o=[];return function e(t,n){o.push(t+\" \")>C.cacheLength&&delete e[o.shift()];return e[t+\" \"]=n}}function se(e){return e[E]=!0,e}function ae(e){var t=R.createElement(\"fieldset\");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ce(e,t){for(var n=e.split(\"|\"),o=n.length;o--;)C.attrHandle[n[o]]=t}function ue(e,t){var n=t&&e,o=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(o)return o;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(n){return function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&e.type===n}}function pe(n){return function(e){var t=e.nodeName.toLowerCase();return(\"input\"===t||\"button\"===t)&&e.type===n}}function fe(t){return function(e){return\"form\"in e?e.parentNode&&!1===e.disabled?\"label\"in e?\"label\"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&re(e)===t:e.disabled===t:\"label\"in e&&e.disabled===t}}function he(l){return se(function(i){return i=+i,se(function(e,t){for(var n,o=l([],e.length,i),r=o.length;r--;)e[n=o[r]]&&(e[n]=!(t[n]=e[n]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(e in f=ie.support={},r=ie.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&\"HTML\"!==t.nodeName},x=ie.setDocument=function(e){var t,n,o=e?e.ownerDocument||e:w;return o!==R&&9===o.nodeType&&o.documentElement&&(l=(R=o).documentElement,S=!r(R),w!==R&&(n=R.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener(\"unload\",oe,!1):n.attachEvent&&n.attachEvent(\"onunload\",oe)),f.attributes=ae(function(e){return e.className=\"i\",!e.getAttribute(\"className\")}),f.getElementsByTagName=ae(function(e){return e.appendChild(R.createComment(\"\")),!e.getElementsByTagName(\"*\").length}),f.getElementsByClassName=Y.test(R.getElementsByClassName),f.getById=ae(function(e){return l.appendChild(e).id=E,!R.getElementsByName||!R.getElementsByName(E).length}),f.getById?(C.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute(\"id\")===t}},C.find.ID=function(e,t){if(void 0!==t.getElementById&&S){var n=t.getElementById(e);return n?[n]:[]}}):(C.filter.ID=function(e){var n=e.replace(Z,ee);return function(e){var t=void 0!==e.getAttributeNode&&e.getAttributeNode(\"id\");return t&&t.value===n}},C.find.ID=function(e,t){if(void 0!==t.getElementById&&S){var n,o,r,i=t.getElementById(e);if(i){if((n=i.getAttributeNode(\"id\"))&&n.value===e)return[i];for(r=t.getElementsByName(e),o=0;i=r[o++];)if((n=i.getAttributeNode(\"id\"))&&n.value===e)return[i]}return[]}}),C.find.TAG=f.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):f.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,o=[],r=0,i=t.getElementsByTagName(e);if(\"*\"===e){for(;n=i[r++];)1===n.nodeType&&o.push(n);return o}return i},C.find.CLASS=f.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&S)return t.getElementsByClassName(e)},s=[],m=[],(f.qsa=Y.test(R.querySelectorAll))&&(ae(function(e){l.appendChild(e).innerHTML=\"<a id='\"+E+\"'></a><select id='\"+E+\"-\\r\\\\' msallowcapture=''><option selected=''></option></select>\",e.querySelectorAll(\"[msallowcapture^='']\").length&&m.push(\"[*^$]=\"+F+\"*(?:''|\\\"\\\")\"),e.querySelectorAll(\"[selected]\").length||m.push(\"\\\\[\"+F+\"*(?:value|\"+_+\")\"),e.querySelectorAll(\"[id~=\"+E+\"-]\").length||m.push(\"~=\"),e.querySelectorAll(\":checked\").length||m.push(\":checked\"),e.querySelectorAll(\"a#\"+E+\"+*\").length||m.push(\".#.+[+~]\")}),ae(function(e){e.innerHTML=\"<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>\";var t=R.createElement(\"input\");t.setAttribute(\"type\",\"hidden\"),e.appendChild(t).setAttribute(\"name\",\"D\"),e.querySelectorAll(\"[name=d]\").length&&m.push(\"name\"+F+\"*[*^$|!~]?=\"),2!==e.querySelectorAll(\":enabled\").length&&m.push(\":enabled\",\":disabled\"),l.appendChild(e).disabled=!0,2!==e.querySelectorAll(\":disabled\").length&&m.push(\":enabled\",\":disabled\"),e.querySelectorAll(\"*,:x\"),m.push(\",.*:\")})),(f.matchesSelector=Y.test(u=l.matches||l.webkitMatchesSelector||l.mozMatchesSelector||l.oMatchesSelector||l.msMatchesSelector))&&ae(function(e){f.disconnectedMatch=u.call(e,\"*\"),u.call(e,\"[s!='']:x\"),s.push(\"!=\",W)}),m=m.length&&new RegExp(m.join(\"|\")),s=s.length&&new RegExp(s.join(\"|\")),t=Y.test(l.compareDocumentPosition),v=t||Y.test(l.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,o=t&&t.parentNode;return e===o||!(!o||1!==o.nodeType||!(n.contains?n.contains(o):e.compareDocumentPosition&&16&e.compareDocumentPosition(o)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},P=t?function(e,t){if(e===t)return c=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!f.sortDetached&&t.compareDocumentPosition(e)===n?e===R||e.ownerDocument===w&&v(w,e)?-1:t===R||t.ownerDocument===w&&v(w,t)?1:a?L(a,e)-L(a,t):0:4&n?-1:1)}:function(e,t){if(e===t)return c=!0,0;var n,o=0,r=e.parentNode,i=t.parentNode,l=[e],s=[t];if(!r||!i)return e===R?-1:t===R?1:r?-1:i?1:a?L(a,e)-L(a,t):0;if(r===i)return ue(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;l[o]===s[o];)o++;return o?ue(l[o],s[o]):l[o]===w?-1:s[o]===w?1:0}),R},ie.matches=function(e,t){return ie(e,null,null,t)},ie.matchesSelector=function(e,t){if((e.ownerDocument||e)!==R&&x(e),t=t.replace(O,\"='$1']\"),f.matchesSelector&&S&&!T[t+\" \"]&&(!s||!s.test(t))&&(!m||!m.test(t)))try{var n=u.call(e,t);if(n||f.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0<ie(t,R,null,[e]).length},ie.contains=function(e,t){return(e.ownerDocument||e)!==R&&x(e),v(e,t)},ie.attr=function(e,t){(e.ownerDocument||e)!==R&&x(e);var n=C.attrHandle[t.toLowerCase()],o=n&&D.call(C.attrHandle,t.toLowerCase())?n(e,t,!S):void 0;return void 0!==o?o:f.attributes||!S?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},ie.escape=function(e){return(e+\"\").replace(te,ne)},ie.error=function(e){throw new Error(\"Syntax error, unrecognized expression: \"+e)},ie.uniqueSort=function(e){var t,n=[],o=0,r=0;if(c=!f.detectDuplicates,a=!f.sortStable&&e.slice(0),e.sort(P),c){for(;t=e[r++];)t===e[r]&&(o=n.push(r));for(;o--;)e.splice(n[o],1)}return a=null,e},i=ie.getText=function(e){var t,n=\"\",o=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if(\"string\"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[o++];)n+=i(t);return n},(C=ie.selectors={cacheLength:50,createPseudo:se,match:U,attrHandle:{},find:{},relative:{\">\":{dir:\"parentNode\",first:!0},\" \":{dir:\"parentNode\"},\"+\":{dir:\"previousSibling\",first:!0},\"~\":{dir:\"previousSibling\"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||\"\").replace(Z,ee),\"~=\"===e[2]&&(e[3]=\" \"+e[3]+\" \"),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),\"nth\"===e[1].slice(0,3)?(e[3]||ie.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(\"even\"===e[3]||\"odd\"===e[3])),e[5]=+(e[7]+e[8]||\"odd\"===e[3])):e[3]&&ie.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return U.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||\"\":n&&z.test(n)&&(t=h(n,!0))&&(t=n.indexOf(\")\",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return\"*\"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+\" \"];return t||(t=new RegExp(\"(^|\"+F+\")\"+e+\"(\"+F+\"|$)\"))&&p(e,function(e){return t.test(\"string\"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute(\"class\")||\"\")})},ATTR:function(n,o,r){return function(e){var t=ie.attr(e,n);return null==t?\"!=\"===o:!o||(t+=\"\",\"=\"===o?t===r:\"!=\"===o?t!==r:\"^=\"===o?r&&0===t.indexOf(r):\"*=\"===o?r&&-1<t.indexOf(r):\"$=\"===o?r&&t.slice(-r.length)===r:\"~=\"===o?-1<(\" \"+t.replace(j,\" \")+\" \").indexOf(r):\"|=\"===o&&(t===r||t.slice(0,r.length+1)===r+\"-\"))}},CHILD:function(h,e,t,g,m){var v=\"nth\"!==h.slice(0,3),w=\"last\"!==h.slice(-4),y=\"of-type\"===e;return 1===g&&0===m?function(e){return!!e.parentNode}:function(e,t,n){var o,r,i,l,s,a,c=v!==w?\"nextSibling\":\"previousSibling\",u=e.parentNode,d=y&&e.nodeName.toLowerCase(),p=!n&&!y,f=!1;if(u){if(v){for(;c;){for(l=e;l=l[c];)if(y?l.nodeName.toLowerCase()===d:1===l.nodeType)return!1;a=c=\"only\"===h&&!a&&\"nextSibling\"}return!0}if(a=[w?u.firstChild:u.lastChild],w&&p){for(i=(l=u)[E]||(l[E]={}),r=i[l.uniqueID]||(i[l.uniqueID]={}),o=r[h]||[],s=o[0]===k&&o[1],f=s&&o[2],l=s&&u.childNodes[s];l=++s&&l&&l[c]||(f=s=0)||a.pop();)if(1===l.nodeType&&++f&&l===e){r[h]=[k,s,f];break}}else if(p&&(i=(l=e)[E]||(l[E]={}),r=i[l.uniqueID]||(i[l.uniqueID]={}),o=r[h]||[],s=o[0]===k&&o[1],f=s),!1===f)for(;(l=++s&&l&&l[c]||(f=s=0)||a.pop())&&((y?l.nodeName.toLowerCase()!==d:1!==l.nodeType)||!++f||(p&&(i=l[E]||(l[E]={}),(r=i[l.uniqueID]||(i[l.uniqueID]={}))[h]=[k,f]),l!==e)););return(f-=m)===g||f%g==0&&0<=f/g}}},PSEUDO:function(e,i){var t,l=C.pseudos[e]||C.setFilters[e.toLowerCase()]||ie.error(\"unsupported pseudo: \"+e);return l[E]?l(i):1<l.length?(t=[e,e,\"\",i],C.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,t){for(var n,o=l(e,i),r=o.length;r--;)n=L(e,o[r]),e[n]=!(t[n]=o[r])}):function(e){return l(e,0,t)}):l}},pseudos:{not:se(function(e){var o=[],r=[],s=d(e.replace(V,\"$1\"));return s[E]?se(function(e,t,n,o){for(var r,i=s(e,null,o,[]),l=e.length;l--;)(r=i[l])&&(e[l]=!(t[l]=r))}):function(e,t,n){return o[0]=e,s(o,null,n,r),o[0]=null,!r.pop()}}),has:se(function(t){return function(e){return 0<ie(t,e).length}}),contains:se(function(t){return t=t.replace(Z,ee),function(e){return-1<(e.textContent||e.innerText||i(e)).indexOf(t)}}),lang:se(function(n){return X.test(n||\"\")||ie.error(\"unsupported lang: \"+n),n=n.replace(Z,ee).toLowerCase(),function(e){var t;do{if(t=S?e.lang:e.getAttribute(\"xml:lang\")||e.getAttribute(\"lang\"))return(t=t.toLowerCase())===n||0===t.indexOf(n+\"-\")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===l},focus:function(e){return e===R.activeElement&&(!R.hasFocus||R.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:fe(!1),disabled:fe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&!!e.checked||\"option\"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return G.test(e.nodeName)},input:function(e){return K.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&\"button\"===e.type||\"button\"===t},text:function(e){var t;return\"input\"===e.nodeName.toLowerCase()&&\"text\"===e.type&&(null==(t=e.getAttribute(\"type\"))||\"text\"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var o=n<0?n+t:n;0<=--o;)e.push(o);return e}),gt:he(function(e,t,n){for(var o=n<0?n+t:n;++o<t;)e.push(o);return e})}}).pseudos.nth=C.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})C.pseudos[e]=pe(e);function me(){}function ve(e){for(var t=0,n=e.length,o=\"\";t<n;t++)o+=e[t].value;return o}function we(s,e,t){var a=e.dir,c=e.next,u=c||a,d=t&&\"parentNode\"===u,p=o++;return e.first?function(e,t,n){for(;e=e[a];)if(1===e.nodeType||d)return s(e,t,n);return!1}:function(e,t,n){var o,r,i,l=[k,p];if(n){for(;e=e[a];)if((1===e.nodeType||d)&&s(e,t,n))return!0}else for(;e=e[a];)if(1===e.nodeType||d)if(i=e[E]||(e[E]={}),r=i[e.uniqueID]||(i[e.uniqueID]={}),c&&c===e.nodeName.toLowerCase())e=e[a]||e;else{if((o=r[u])&&o[0]===k&&o[1]===p)return l[2]=o[2];if((r[u]=l)[2]=s(e,t,n))return!0}return!1}}function ye(r){return 1<r.length?function(e,t,n){for(var o=r.length;o--;)if(!r[o](e,t,n))return!1;return!0}:r[0]}function Ce(e,t,n,o,r){for(var i,l=[],s=0,a=e.length,c=null!=t;s<a;s++)(i=e[s])&&(n&&!n(i,o,r)||(l.push(i),c&&t.push(s)));return l}function be(f,h,g,m,v,e){return m&&!m[E]&&(m=be(m)),v&&!v[E]&&(v=be(v,e)),se(function(e,t,n,o){var r,i,l,s=[],a=[],c=t.length,u=e||function(e,t,n){for(var o=0,r=t.length;o<r;o++)ie(e,t[o],n);return n}(h||\"*\",n.nodeType?[n]:n,[]),d=!f||!e&&h?u:Ce(u,s,f,n,o),p=g?v||(e?f:c||m)?[]:t:d;if(g&&g(d,p,n,o),m)for(r=Ce(p,a),m(r,[],n,o),i=r.length;i--;)(l=r[i])&&(p[a[i]]=!(d[a[i]]=l));if(e){if(v||f){if(v){for(r=[],i=p.length;i--;)(l=p[i])&&r.push(d[i]=l);v(null,p=[],r,o)}for(i=p.length;i--;)(l=p[i])&&-1<(r=v?L(e,l):s[i])&&(e[r]=!(t[r]=l))}}else p=Ce(p===t?p.splice(c,p.length):p),v?v(null,t,p,o):$.apply(t,p)})}function xe(e){for(var r,t,n,o=e.length,i=C.relative[e[0].type],l=i||C.relative[\" \"],s=i?1:0,a=we(function(e){return e===r},l,!0),c=we(function(e){return-1<L(r,e)},l,!0),u=[function(e,t,n){var o=!i&&(n||t!==b)||((r=t).nodeType?a(e,t,n):c(e,t,n));return r=null,o}];s<o;s++)if(t=C.relative[e[s].type])u=[we(ye(u),t)];else{if((t=C.filter[e[s].type].apply(null,e[s].matches))[E]){for(n=++s;n<o&&!C.relative[e[n].type];n++);return be(1<s&&ye(u),1<s&&ve(e.slice(0,s-1).concat({value:\" \"===e[s-2].type?\"*\":\"\"})).replace(V,\"$1\"),t,s<n&&xe(e.slice(s,n)),n<o&&xe(e=e.slice(n)),n<o&&ve(e))}u.push(t)}return ye(u)}return me.prototype=C.filters=C.pseudos,C.setFilters=new me,h=ie.tokenize=function(e,t){var n,o,r,i,l,s,a,c=y[e+\" \"];if(c)return t?0:c.slice(0);for(l=e,s=[],a=C.preFilter;l;){for(i in n&&!(o=B.exec(l))||(o&&(l=l.slice(o[0].length)||l),s.push(r=[])),n=!1,(o=q.exec(l))&&(n=o.shift(),r.push({value:n,type:o[0].replace(V,\" \")}),l=l.slice(n.length)),C.filter)!(o=U[i].exec(l))||a[i]&&!(o=a[i](o))||(n=o.shift(),r.push({value:n,type:i,matches:o}),l=l.slice(n.length));if(!n)break}return t?l.length:l?ie.error(e):y(e,s).slice(0)},d=ie.compile=function(e,t){var n,m,v,w,y,o,r=[],i=[],l=T[e+\" \"];if(!l){for(t||(t=h(e)),n=t.length;n--;)(l=xe(t[n]))[E]?r.push(l):i.push(l);(l=T(e,(m=i,w=0<(v=r).length,y=0<m.length,o=function(e,t,n,o,r){var i,l,s,a=0,c=\"0\",u=e&&[],d=[],p=b,f=e||y&&C.find.TAG(\"*\",r),h=k+=null==p?1:Math.random()||.1,g=f.length;for(r&&(b=t===R||t||r);c!==g&&null!=(i=f[c]);c++){if(y&&i){for(l=0,t||i.ownerDocument===R||(x(i),n=!S);s=m[l++];)if(s(i,t||R,n)){o.push(i);break}r&&(k=h)}w&&((i=!s&&i)&&a--,e&&u.push(i))}if(a+=c,w&&c!==a){for(l=0;s=v[l++];)s(u,d,t,n);if(e){if(0<a)for(;c--;)u[c]||d[c]||(d[c]=N.call(o));d=Ce(d)}$.apply(o,d),r&&!e&&0<d.length&&1<a+v.length&&ie.uniqueSort(o)}return r&&(k=h,b=p),u},w?se(o):o))).selector=e}return l},g=ie.select=function(e,t,n,o){var r,i,l,s,a,c=\"function\"==typeof e&&e,u=!o&&h(e=c.selector||e);if(n=n||[],1===u.length){if(2<(i=u[0]=u[0].slice(0)).length&&\"ID\"===(l=i[0]).type&&9===t.nodeType&&S&&C.relative[i[1].type]){if(!(t=(C.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(r=U.needsContext.test(e)?0:i.length;r--&&(l=i[r],!C.relative[s=l.type]);)if((a=C.find[s])&&(o=a(l.matches[0].replace(Z,ee),J.test(i[0].type)&&ge(t.parentNode)||t))){if(i.splice(r,1),!(e=o.length&&ve(i)))return $.apply(n,o),n;break}}return(c||d(e,u))(o,t,!S,n,!t||J.test(e)&&ge(t.parentNode)||t),n},f.sortStable=E.split(\"\").sort(P).join(\"\")===E,f.detectDuplicates=!!c,x(),f.sortDetached=ae(function(e){return 1&e.compareDocumentPosition(R.createElement(\"fieldset\"))}),ae(function(e){return e.innerHTML=\"<a href='#'></a>\",\"#\"===e.firstChild.getAttribute(\"href\")})||ce(\"type|href|height|width\",function(e,t,n){if(!n)return e.getAttribute(t,\"type\"===t.toLowerCase()?1:2)}),f.attributes&&ae(function(e){return e.innerHTML=\"<input/>\",e.firstChild.setAttribute(\"value\",\"\"),\"\"===e.firstChild.getAttribute(\"value\")})||ce(\"value\",function(e,t,n){if(!n&&\"input\"===e.nodeName.toLowerCase())return e.defaultValue}),ae(function(e){return null==e.getAttribute(\"disabled\")})||ce(_,function(e,t,n){var o;if(!n)return!0===e[t]?t.toLowerCase():(o=e.getAttributeNode(t))&&o.specified?o.value:null}),ie}(R);E.find=y,E.expr=y.selectors,E.expr[\":\"]=E.expr.pseudos,E.uniqueSort=E.unique=y.uniqueSort,E.text=y.getText,E.isXMLDoc=y.isXML,E.contains=y.contains,E.escapeSelector=y.escape;var C=function(e,t,n){for(var o=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&E(e).is(n))break;o.push(e)}return o},b=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},x=E.expr.match.needsContext;function k(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var T=/^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i,P=/^.[^:#\\[\\.,]*$/;function D(e,n,o){return E.isFunction(n)?E.grep(e,function(e,t){return!!n.call(e,t,e)!==o}):n.nodeType?E.grep(e,function(e){return e===n!==o}):\"string\"!=typeof n?E.grep(e,function(e){return-1<r.call(n,e)!==o}):P.test(n)?E.filter(n,e,o):(n=E.filter(n,e),E.grep(e,function(e){return-1<r.call(n,e)!==o&&1===e.nodeType}))}E.filter=function(e,t,n){var o=t[0];return n&&(e=\":not(\"+e+\")\"),1===t.length&&1===o.nodeType?E.find.matchesSelector(o,e)?[o]:[]:E.find.matches(e,E.grep(t,function(e){return 1===e.nodeType}))},E.fn.extend({find:function(e){var t,n,o=this.length,r=this;if(\"string\"!=typeof e)return this.pushStack(E(e).filter(function(){for(t=0;t<o;t++)if(E.contains(r[t],this))return!0}));for(n=this.pushStack([]),t=0;t<o;t++)E.find(e,r[t],n);return 1<o?E.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,\"string\"==typeof e&&x.test(e)?E(e):e||[],!1).length}});var N,A=/^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,$=E.fn.init=function(e,t,n){var o,r;if(!e)return this;if(n=n||N,\"string\"==typeof e){if(!(o=\"<\"===e[0]&&\">\"===e[e.length-1]&&3<=e.length?[null,e,null]:A.exec(e))||!o[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(o[1]){if(t=t instanceof E?t[0]:t,E.merge(this,E.parseHTML(o[1],t&&t.nodeType?t.ownerDocument||t:S,!0)),T.test(o[1])&&E.isPlainObject(t))for(o in t)E.isFunction(this[o])?this[o](t[o]):this.attr(o,t[o]);return this}return(r=S.getElementById(o[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):E.isFunction(e)?void 0!==n.ready?n.ready(e):e(E):E.makeArray(e,this)};$.prototype=E.fn,N=E(S);var H=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};function _(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}E.fn.extend({has:function(e){var t=E(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(E.contains(this,t[e]))return!0})},closest:function(e,t){var n,o=0,r=this.length,i=[],l=\"string\"!=typeof e&&E(e);if(!x.test(e))for(;o<r;o++)for(n=this[o];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(l?-1<l.index(n):1===n.nodeType&&E.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(1<i.length?E.uniqueSort(i):i)},index:function(e){return e?\"string\"==typeof e?r.call(E(e),this[0]):r.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(E.uniqueSort(E.merge(this.get(),E(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),E.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return C(e,\"parentNode\")},parentsUntil:function(e,t,n){return C(e,\"parentNode\",n)},next:function(e){return _(e,\"nextSibling\")},prev:function(e){return _(e,\"previousSibling\")},nextAll:function(e){return C(e,\"nextSibling\")},prevAll:function(e){return C(e,\"previousSibling\")},nextUntil:function(e,t,n){return C(e,\"nextSibling\",n)},prevUntil:function(e,t,n){return C(e,\"previousSibling\",n)},siblings:function(e){return b((e.parentNode||{}).firstChild,e)},children:function(e){return b(e.firstChild)},contents:function(e){return k(e,\"iframe\")?e.contentDocument:(k(e,\"template\")&&(e=e.content||e),E.merge([],e.childNodes))}},function(o,r){E.fn[o]=function(e,t){var n=E.map(this,r,e);return\"Until\"!==o.slice(-5)&&(t=e),t&&\"string\"==typeof t&&(n=E.filter(t,n)),1<this.length&&(L[o]||E.uniqueSort(n),H.test(o)&&n.reverse()),this.pushStack(n)}});var F=/[^\\x20\\t\\r\\n\\f]+/g;function I(e){return e}function M(e){throw e}function W(e,t,n,o){var r;try{e&&E.isFunction(r=e.promise)?r.call(e).done(t).fail(n):e&&E.isFunction(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(o))}catch(e){n.apply(void 0,[e])}}E.Callbacks=function(o){var e,n;o=\"string\"==typeof o?(e=o,n={},E.each(e.match(F)||[],function(e,t){n[t]=!0}),n):E.extend({},o);var r,t,i,l,s=[],a=[],c=-1,u=function(){for(l=l||o.once,i=r=!0;a.length;c=-1)for(t=a.shift();++c<s.length;)!1===s[c].apply(t[0],t[1])&&o.stopOnFalse&&(c=s.length,t=!1);o.memory||(t=!1),r=!1,l&&(s=t?[]:\"\")},d={add:function(){return s&&(t&&!r&&(c=s.length-1,a.push(t)),function n(e){E.each(e,function(e,t){E.isFunction(t)?o.unique&&d.has(t)||s.push(t):t&&t.length&&\"string\"!==E.type(t)&&n(t)})}(arguments),t&&!r&&u()),this},remove:function(){return E.each(arguments,function(e,t){for(var n;-1<(n=E.inArray(t,s,n));)s.splice(n,1),n<=c&&c--}),this},has:function(e){return e?-1<E.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return l=a=[],s=t=\"\",this},disabled:function(){return!s},lock:function(){return l=a=[],t||r||(s=t=\"\"),this},locked:function(){return!!l},fireWith:function(e,t){return l||(t=[e,(t=t||[]).slice?t.slice():t],a.push(t),r||u()),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!i}};return d},E.extend({Deferred:function(e){var i=[[\"notify\",\"progress\",E.Callbacks(\"memory\"),E.Callbacks(\"memory\"),2],[\"resolve\",\"done\",E.Callbacks(\"once memory\"),E.Callbacks(\"once memory\"),0,\"resolved\"],[\"reject\",\"fail\",E.Callbacks(\"once memory\"),E.Callbacks(\"once memory\"),1,\"rejected\"]],r=\"pending\",l={state:function(){return r},always:function(){return s.done(arguments).fail(arguments),this},catch:function(e){return l.then(null,e)},pipe:function(){var r=arguments;return E.Deferred(function(o){E.each(i,function(e,t){var n=E.isFunction(r[t[4]])&&r[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&E.isFunction(e.promise)?e.promise().progress(o.notify).done(o.resolve).fail(o.reject):o[t[0]+\"With\"](this,n?[e]:arguments)})}),r=null}).promise()},then:function(t,n,o){var a=0;function c(r,i,l,s){return function(){var n=this,o=arguments,e=function(){var e,t;if(!(r<a)){if((e=l.apply(n,o))===i.promise())throw new TypeError(\"Thenable self-resolution\");t=e&&(\"object\"==typeof e||\"function\"==typeof e)&&e.then,E.isFunction(t)?s?t.call(e,c(a,i,I,s),c(a,i,M,s)):(a++,t.call(e,c(a,i,I,s),c(a,i,M,s),c(a,i,I,i.notifyWith))):(l!==I&&(n=void 0,o=[e]),(s||i.resolveWith)(n,o))}},t=s?e:function(){try{e()}catch(e){E.Deferred.exceptionHook&&E.Deferred.exceptionHook(e,t.stackTrace),a<=r+1&&(l!==M&&(n=void 0,o=[e]),i.rejectWith(n,o))}};r?t():(E.Deferred.getStackHook&&(t.stackTrace=E.Deferred.getStackHook()),R.setTimeout(t))}}return E.Deferred(function(e){i[0][3].add(c(0,e,E.isFunction(o)?o:I,e.notifyWith)),i[1][3].add(c(0,e,E.isFunction(t)?t:I)),i[2][3].add(c(0,e,E.isFunction(n)?n:M))}).promise()},promise:function(e){return null!=e?E.extend(e,l):l}},s={};return E.each(i,function(e,t){var n=t[2],o=t[5];l[t[1]]=n.add,o&&n.add(function(){r=o},i[3-e][2].disable,i[0][2].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+\"With\"](this===s?void 0:this,arguments),this},s[t[0]+\"With\"]=n.fireWith}),l.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,o=Array(t),r=s.call(arguments),i=E.Deferred(),l=function(t){return function(e){o[t]=this,r[t]=1<arguments.length?s.call(arguments):e,--n||i.resolveWith(o,r)}};if(n<=1&&(W(e,i.done(l(t)).resolve,i.reject,!n),\"pending\"===i.state()||E.isFunction(r[t]&&r[t].then)))return i.then();for(;t--;)W(r[t],l(t),i.reject);return i.promise()}});var j=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;E.Deferred.exceptionHook=function(e,t){R.console&&R.console.warn&&e&&j.test(e.name)&&R.console.warn(\"jQuery.Deferred exception: \"+e.message,e.stack,t)},E.readyException=function(e){R.setTimeout(function(){throw e})};var V=E.Deferred();function B(){S.removeEventListener(\"DOMContentLoaded\",B),R.removeEventListener(\"load\",B),E.ready()}E.fn.ready=function(e){return V.then(e).catch(function(e){E.readyException(e)}),this},E.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--E.readyWait:E.isReady)||(E.isReady=!0)!==e&&0<--E.readyWait||V.resolveWith(S,[E])}}),E.ready.then=V.then,\"complete\"===S.readyState||\"loading\"!==S.readyState&&!S.documentElement.doScroll?R.setTimeout(E.ready):(S.addEventListener(\"DOMContentLoaded\",B),R.addEventListener(\"load\",B));var q=function(e,t,n,o,r,i,l){var s=0,a=e.length,c=null==n;if(\"object\"===E.type(n))for(s in r=!0,n)q(e,t,s,n[s],!0,i,l);else if(void 0!==o&&(r=!0,E.isFunction(o)||(l=!0),c&&(l?(t.call(e,o),t=null):(c=t,t=function(e,t,n){return c.call(E(e),n)})),t))for(;s<a;s++)t(e[s],n,l?o:o.call(e[s],s,t(e[s],n)));return r?e:c?t.call(e):a?t(e[0],n):i},O=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function z(){this.expando=E.expando+z.uid++}z.uid=1,z.prototype={cache:function(e){var t=e[this.expando];return t||(t={},O(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var o,r=this.cache(e);if(\"string\"==typeof t)r[E.camelCase(t)]=n;else for(o in t)r[E.camelCase(o)]=t[o];return r},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][E.camelCase(t)]},access:function(e,t,n){return void 0===t||t&&\"string\"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,o=e[this.expando];if(void 0!==o){if(void 0!==t){t=Array.isArray(t)?t.map(E.camelCase):(t=E.camelCase(t))in o?[t]:t.match(F)||[],n=t.length;for(;n--;)delete o[t[n]]}(void 0===t||E.isEmptyObject(o))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!E.isEmptyObject(t)}};var X=new z,U=new z,K=/^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,G=/[A-Z]/g;function Y(e,t,n){var o;if(void 0===n&&1===e.nodeType)if(o=\"data-\"+t.replace(G,\"-$&\").toLowerCase(),\"string\"==typeof(n=e.getAttribute(o))){try{n=function(e){if(\"true\"===e)return!0;if(\"false\"===e)return!1;if(\"null\"===e)return null;if(e===+e+\"\")return+e;if(K.test(e))return JSON.parse(e);return e}(n)}catch(e){}U.set(e,t,n)}else n=void 0;return n}E.extend({hasData:function(e){return U.hasData(e)||X.hasData(e)},data:function(e,t,n){return U.access(e,t,n)},removeData:function(e,t){U.remove(e,t)},_data:function(e,t,n){return X.access(e,t,n)},_removeData:function(e,t){X.remove(e,t)}}),E.fn.extend({data:function(n,e){var t,o,r,i=this[0],l=i&&i.attributes;if(void 0===n){if(this.length&&(r=U.get(i),1===i.nodeType&&!X.get(i,\"hasDataAttrs\"))){for(t=l.length;t--;)l[t]&&0===(o=l[t].name).indexOf(\"data-\")&&(o=E.camelCase(o.slice(5)),Y(i,o,r[o]));X.set(i,\"hasDataAttrs\",!0)}return r}return\"object\"==typeof n?this.each(function(){U.set(this,n)}):q(this,function(e){var t;if(i&&void 0===e)return void 0!==(t=U.get(i,n))?t:void 0!==(t=Y(i,n))?t:void 0;this.each(function(){U.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){U.remove(this,e)})}}),E.extend({queue:function(e,t,n){var o;if(e)return t=(t||\"fx\")+\"queue\",o=X.get(e,t),n&&(!o||Array.isArray(n)?o=X.access(e,t,E.makeArray(n)):o.push(n)),o||[]},dequeue:function(e,t){t=t||\"fx\";var n=E.queue(e,t),o=n.length,r=n.shift(),i=E._queueHooks(e,t);\"inprogress\"===r&&(r=n.shift(),o--),r&&(\"fx\"===t&&n.unshift(\"inprogress\"),delete i.stop,r.call(e,function(){E.dequeue(e,t)},i)),!o&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+\"queueHooks\";return X.get(e,n)||X.access(e,n,{empty:E.Callbacks(\"once memory\").add(function(){X.remove(e,[t+\"queue\",n])})})}}),E.fn.extend({queue:function(t,n){var e=2;return\"string\"!=typeof t&&(n=t,t=\"fx\",e--),arguments.length<e?E.queue(this[0],t):void 0===n?this:this.each(function(){var e=E.queue(this,t,n);E._queueHooks(this,t),\"fx\"===t&&\"inprogress\"!==e[0]&&E.dequeue(this,t)})},dequeue:function(e){return this.each(function(){E.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||\"fx\",[])},promise:function(e,t){var n,o=1,r=E.Deferred(),i=this,l=this.length,s=function(){--o||r.resolveWith(i,[i])};for(\"string\"!=typeof e&&(t=e,e=void 0),e=e||\"fx\";l--;)(n=X.get(i[l],e+\"queueHooks\"))&&n.empty&&(o++,n.empty.add(s));return s(),r.promise(t)}});var Q=/[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source,J=new RegExp(\"^(?:([+-])=|)(\"+Q+\")([a-z%]*)$\",\"i\"),Z=[\"Top\",\"Right\",\"Bottom\",\"Left\"],ee=function(e,t){return\"none\"===(e=t||e).style.display||\"\"===e.style.display&&E.contains(e.ownerDocument,e)&&\"none\"===E.css(e,\"display\")},te=function(e,t,n,o){var r,i,l={};for(i in t)l[i]=e.style[i],e.style[i]=t[i];for(i in r=n.apply(e,o||[]),t)e.style[i]=l[i];return r};function ne(e,t,n,o){var r,i=1,l=20,s=o?function(){return o.cur()}:function(){return E.css(e,t,\"\")},a=s(),c=n&&n[3]||(E.cssNumber[t]?\"\":\"px\"),u=(E.cssNumber[t]||\"px\"!==c&&+a)&&J.exec(E.css(e,t));if(u&&u[3]!==c)for(c=c||u[3],n=n||[],u=+a||1;u/=i=i||\".5\",E.style(e,t,u+c),i!==(i=s()/a)&&1!==i&&--l;);return n&&(u=+u||+a||0,r=n[1]?u+(n[1]+1)*n[2]:+n[2],o&&(o.unit=c,o.start=u,o.end=r)),r}var oe={};function re(e){var t,n=e.ownerDocument,o=e.nodeName,r=oe[o];return r||(t=n.body.appendChild(n.createElement(o)),r=E.css(t,\"display\"),t.parentNode.removeChild(t),\"none\"===r&&(r=\"block\"),oe[o]=r)}function ie(e,t){for(var n,o,r=[],i=0,l=e.length;i<l;i++)(o=e[i]).style&&(n=o.style.display,t?(\"none\"===n&&(r[i]=X.get(o,\"display\")||null,r[i]||(o.style.display=\"\")),\"\"===o.style.display&&ee(o)&&(r[i]=re(o))):\"none\"!==n&&(r[i]=\"none\",X.set(o,\"display\",n)));for(i=0;i<l;i++)null!=r[i]&&(e[i].style.display=r[i]);return e}E.fn.extend({show:function(){return ie(this,!0)},hide:function(){return ie(this)},toggle:function(e){return\"boolean\"==typeof e?e?this.show():this.hide():this.each(function(){ee(this)?E(this).show():E(this).hide()})}});var le=/^(?:checkbox|radio)$/i,se=/<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]+)/i,ae=/^$|\\/(?:java|ecma)script/i,ce={option:[1,\"<select multiple='multiple'>\",\"</select>\"],thead:[1,\"<table>\",\"</table>\"],col:[2,\"<table><colgroup>\",\"</colgroup></table>\"],tr:[2,\"<table><tbody>\",\"</tbody></table>\"],td:[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],_default:[0,\"\",\"\"]};function ue(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||\"*\"):void 0!==e.querySelectorAll?e.querySelectorAll(t||\"*\"):[],void 0===t||t&&k(e,t)?E.merge([e],n):n}function de(e,t){for(var n=0,o=e.length;n<o;n++)X.set(e[n],\"globalEval\",!t||X.get(t[n],\"globalEval\"))}ce.optgroup=ce.option,ce.tbody=ce.tfoot=ce.colgroup=ce.caption=ce.thead,ce.th=ce.td;var pe,fe,he,ge=/<|&#?\\w+;/;function me(e,t,n,o,r){for(var i,l,s,a,c,u,d=t.createDocumentFragment(),p=[],f=0,h=e.length;f<h;f++)if((i=e[f])||0===i)if(\"object\"===E.type(i))E.merge(p,i.nodeType?[i]:i);else if(ge.test(i)){for(l=l||d.appendChild(t.createElement(\"div\")),s=(se.exec(i)||[\"\",\"\"])[1].toLowerCase(),a=ce[s]||ce._default,l.innerHTML=a[1]+E.htmlPrefilter(i)+a[2],u=a[0];u--;)l=l.lastChild;E.merge(p,l.childNodes),(l=d.firstChild).textContent=\"\"}else p.push(t.createTextNode(i));for(d.textContent=\"\",f=0;i=p[f++];)if(o&&-1<E.inArray(i,o))r&&r.push(i);else if(c=E.contains(i.ownerDocument,i),l=ue(d.appendChild(i),\"script\"),c&&de(l),n)for(u=0;i=l[u++];)ae.test(i.type||\"\")&&n.push(i);return d}pe=S.createDocumentFragment(),fe=pe.appendChild(S.createElement(\"div\")),(he=S.createElement(\"input\")).setAttribute(\"type\",\"radio\"),he.setAttribute(\"checked\",\"checked\"),he.setAttribute(\"name\",\"t\"),fe.appendChild(he),m.checkClone=fe.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.innerHTML=\"<textarea>x</textarea>\",m.noCloneChecked=!!fe.cloneNode(!0).lastChild.defaultValue;var ve=S.documentElement,we=/^key/,ye=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\\.(.+)|)/;function be(){return!0}function xe(){return!1}function Re(){try{return S.activeElement}catch(e){}}function Se(e,t,n,o,r,i){var l,s;if(\"object\"==typeof t){for(s in\"string\"!=typeof n&&(o=o||n,n=void 0),t)Se(e,s,n,o,t[s],i);return e}if(null==o&&null==r?(r=n,o=n=void 0):null==r&&(\"string\"==typeof n?(r=o,o=void 0):(r=o,o=n,n=void 0)),!1===r)r=xe;else if(!r)return e;return 1===i&&(l=r,(r=function(e){return E().off(e),l.apply(this,arguments)}).guid=l.guid||(l.guid=E.guid++)),e.each(function(){E.event.add(this,t,r,o,n)})}E.event={global:{},add:function(t,e,n,o,r){var i,l,s,a,c,u,d,p,f,h,g,m=X.get(t);if(m)for(n.handler&&(n=(i=n).handler,r=i.selector),r&&E.find.matchesSelector(ve,r),n.guid||(n.guid=E.guid++),(a=m.events)||(a=m.events={}),(l=m.handle)||(l=m.handle=function(e){return void 0!==E&&E.event.triggered!==e.type?E.event.dispatch.apply(t,arguments):void 0}),e=(e||\"\").match(F)||[\"\"],c=e.length;c--;)s=Ce.exec(e[c])||[],f=g=s[1],h=(s[2]||\"\").split(\".\").sort(),f&&(d=E.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=E.event.special[f]||{},u=E.extend({type:f,origType:g,data:o,handler:n,guid:n.guid,selector:r,needsContext:r&&E.expr.match.needsContext.test(r),namespace:h.join(\".\")},i),(p=a[f])||((p=a[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,o,h,l)||t.addEventListener&&t.addEventListener(f,l)),d.add&&(d.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),r?p.splice(p.delegateCount++,0,u):p.push(u),E.event.global[f]=!0)},remove:function(e,t,n,o,r){var i,l,s,a,c,u,d,p,f,h,g,m=X.hasData(e)&&X.get(e);if(m&&(a=m.events)){for(t=(t||\"\").match(F)||[\"\"],c=t.length;c--;)if(s=Ce.exec(t[c])||[],f=g=s[1],h=(s[2]||\"\").split(\".\").sort(),f){for(d=E.event.special[f]||{},f=(o?d.delegateType:d.bindType)||f,p=a[f]||[],s=s[2]&&new RegExp(\"(^|\\\\.)\"+h.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"),l=i=p.length;i--;)u=p[i],!r&&g!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||o&&o!==u.selector&&(\"**\"!==o||!u.selector)||(p.splice(i,1),u.selector&&p.delegateCount--,d.remove&&d.remove.call(e,u));l&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,h,m.handle)||E.removeEvent(e,f,m.handle),delete a[f])}else for(f in a)E.event.remove(e,f+t[c],n,o,!0);E.isEmptyObject(a)&&X.remove(e,\"handle events\")}},dispatch:function(e){var t,n,o,r,i,l,s=E.event.fix(e),a=new Array(arguments.length),c=(X.get(this,\"events\")||{})[s.type]||[],u=E.event.special[s.type]||{};for(a[0]=s,t=1;t<arguments.length;t++)a[t]=arguments[t];if(s.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,s)){for(l=E.event.handlers.call(this,s,c),t=0;(r=l[t++])&&!s.isPropagationStopped();)for(s.currentTarget=r.elem,n=0;(i=r.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!s.rnamespace.test(i.namespace)||(s.handleObj=i,s.data=i.data,void 0!==(o=((E.event.special[i.origType]||{}).handle||i.handler).apply(r.elem,a))&&!1===(s.result=o)&&(s.preventDefault(),s.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,o,r,i,l,s=[],a=t.delegateCount,c=e.target;if(a&&c.nodeType&&!(\"click\"===e.type&&1<=e.button))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&(\"click\"!==e.type||!0!==c.disabled)){for(i=[],l={},n=0;n<a;n++)o=t[n],r=o.selector+\" \",void 0===l[r]&&(l[r]=o.needsContext?-1<E(r,this).index(c):E.find(r,this,null,[c]).length),l[r]&&i.push(o);i.length&&s.push({elem:c,handlers:i})}return c=this,a<t.length&&s.push({elem:c,handlers:t.slice(a)}),s},addProp:function(t,e){Object.defineProperty(E.Event.prototype,t,{enumerable:!0,configurable:!0,get:E.isFunction(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[E.expando]?e:new E.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Re()&&this.focus)return this.focus(),!1},delegateType:\"focusin\"},blur:{trigger:function(){if(this===Re()&&this.blur)return this.blur(),!1},delegateType:\"focusout\"},click:{trigger:function(){if(\"checkbox\"===this.type&&this.click&&k(this,\"input\"))return this.click(),!1},_default:function(e){return k(e.target,\"a\")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},E.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},E.Event=function(e,t){if(!(this instanceof E.Event))return new E.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?be:xe,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&E.extend(this,t),this.timeStamp=e&&e.timeStamp||E.now(),this[E.expando]=!0},E.Event.prototype={constructor:E.Event,isDefaultPrevented:xe,isPropagationStopped:xe,isImmediatePropagationStopped:xe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=be,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=be,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=be,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},E.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&we.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&ye.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},E.event.addProp),E.each({mouseenter:\"mouseover\",mouseleave:\"mouseout\",pointerenter:\"pointerover\",pointerleave:\"pointerout\"},function(e,r){E.event.special[e]={delegateType:r,bindType:r,handle:function(e){var t,n=e.relatedTarget,o=e.handleObj;return n&&(n===this||E.contains(this,n))||(e.type=o.origType,t=o.handler.apply(this,arguments),e.type=r),t}}}),E.fn.extend({on:function(e,t,n,o){return Se(this,e,t,n,o)},one:function(e,t,n,o){return Se(this,e,t,n,o,1)},off:function(e,t,n){var o,r;if(e&&e.preventDefault&&e.handleObj)return o=e.handleObj,E(e.delegateTarget).off(o.namespace?o.origType+\".\"+o.namespace:o.origType,o.selector,o.handler),this;if(\"object\"==typeof e){for(r in e)this.off(r,t,e[r]);return this}return!1!==t&&\"function\"!=typeof t||(n=t,t=void 0),!1===n&&(n=xe),this.each(function(){E.event.remove(this,e,n,t)})}});var Ee=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)[^>]*)\\/>/gi,ke=/<script|<style|<link/i,Te=/checked\\s*(?:[^=]|=\\s*.checked.)/i,Pe=/^true\\/(.*)/,De=/^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;function Ne(e,t){return k(e,\"table\")&&k(11!==t.nodeType?t:t.firstChild,\"tr\")&&E(\">tbody\",e)[0]||e}function Ae(e){return e.type=(null!==e.getAttribute(\"type\"))+\"/\"+e.type,e}function $e(e){var t=Pe.exec(e.type);return t?e.type=t[1]:e.removeAttribute(\"type\"),e}function He(e,t){var n,o,r,i,l,s,a,c;if(1===t.nodeType){if(X.hasData(e)&&(i=X.access(e),l=X.set(t,i),c=i.events))for(r in delete l.handle,l.events={},c)for(n=0,o=c[r].length;n<o;n++)E.event.add(t,r,c[r][n]);U.hasData(e)&&(s=U.access(e),a=E.extend({},s),U.set(t,a))}}function Le(e,t){var n=t.nodeName.toLowerCase();\"input\"===n&&le.test(e.type)?t.checked=e.checked:\"input\"!==n&&\"textarea\"!==n||(t.defaultValue=e.defaultValue)}function _e(n,o,r,i){o=g.apply([],o);var e,t,l,s,a,c,u=0,d=n.length,p=d-1,f=o[0],h=E.isFunction(f);if(h||1<d&&\"string\"==typeof f&&!m.checkClone&&Te.test(f))return n.each(function(e){var t=n.eq(e);h&&(o[0]=f.call(this,e,t.html())),_e(t,o,r,i)});if(d&&(e=me(o,n[0].ownerDocument,!1,n,i),t=e.firstChild,1===e.childNodes.length&&(e=t),t||i)){for(l=E.map(ue(e,\"script\"),Ae),s=l.length;u<d;u++)a=e,u!==p&&(a=E.clone(a,!0,!0),s&&E.merge(l,ue(a,\"script\"))),r.call(n[u],a,u);if(s)for(c=l[l.length-1].ownerDocument,E.map(l,$e),u=0;u<s;u++)a=l[u],ae.test(a.type||\"\")&&!X.access(a,\"globalEval\")&&E.contains(c,a)&&(a.src?E._evalUrl&&E._evalUrl(a.src):v(a.textContent.replace(De,\"\"),c))}return n}function Fe(e,t,n){for(var o,r=t?E.filter(t,e):e,i=0;null!=(o=r[i]);i++)n||1!==o.nodeType||E.cleanData(ue(o)),o.parentNode&&(n&&E.contains(o.ownerDocument,o)&&de(ue(o,\"script\")),o.parentNode.removeChild(o));return e}E.extend({htmlPrefilter:function(e){return e.replace(Ee,\"<$1></$2>\")},clone:function(e,t,n){var o,r,i,l,s=e.cloneNode(!0),a=E.contains(e.ownerDocument,e);if(!(m.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||E.isXMLDoc(e)))for(l=ue(s),i=ue(e),o=0,r=i.length;o<r;o++)Le(i[o],l[o]);if(t)if(n)for(i=i||ue(e),l=l||ue(s),o=0,r=i.length;o<r;o++)He(i[o],l[o]);else He(e,s);return 0<(l=ue(s,\"script\")).length&&de(l,!a&&ue(e,\"script\")),s},cleanData:function(e){for(var t,n,o,r=E.event.special,i=0;void 0!==(n=e[i]);i++)if(O(n)){if(t=n[X.expando]){if(t.events)for(o in t.events)r[o]?E.event.remove(n,o):E.removeEvent(n,o,t.handle);n[X.expando]=void 0}n[U.expando]&&(n[U.expando]=void 0)}}}),E.fn.extend({detach:function(e){return Fe(this,e,!0)},remove:function(e){return Fe(this,e)},text:function(e){return q(this,function(e){return void 0===e?E.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return _e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ne(this,e);t.appendChild(e)}})},prepend:function(){return _e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ne(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return _e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return _e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(E.cleanData(ue(e,!1)),e.textContent=\"\");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return E.clone(this,e,t)})},html:function(e){return q(this,function(e){var t=this[0]||{},n=0,o=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if(\"string\"==typeof e&&!ke.test(e)&&!ce[(se.exec(e)||[\"\",\"\"])[1].toLowerCase()]){e=E.htmlPrefilter(e);try{for(;n<o;n++)1===(t=this[n]||{}).nodeType&&(E.cleanData(ue(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return _e(this,arguments,function(e){var t=this.parentNode;E.inArray(this,n)<0&&(E.cleanData(ue(this)),t&&t.replaceChild(e,this))},n)}}),E.each({appendTo:\"append\",prependTo:\"prepend\",insertBefore:\"before\",insertAfter:\"after\",replaceAll:\"replaceWith\"},function(e,l){E.fn[e]=function(e){for(var t,n=[],o=E(e),r=o.length-1,i=0;i<=r;i++)t=i===r?this:this.clone(!0),E(o[i])[l](t),a.apply(n,t.get());return this.pushStack(n)}});var Ie=/^margin/,Me=new RegExp(\"^(\"+Q+\")(?!px)[a-z%]+$\",\"i\"),We=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=R),t.getComputedStyle(e)};function je(e,t,n){var o,r,i,l,s=e.style;return(n=n||We(e))&&(\"\"!==(l=n.getPropertyValue(t)||n[t])||E.contains(e.ownerDocument,e)||(l=E.style(e,t)),!m.pixelMarginRight()&&Me.test(l)&&Ie.test(t)&&(o=s.width,r=s.minWidth,i=s.maxWidth,s.minWidth=s.maxWidth=s.width=l,l=n.width,s.width=o,s.minWidth=r,s.maxWidth=i)),void 0!==l?l+\"\":l}function Ve(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){l.style.cssText=\"box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%\",l.innerHTML=\"\",ve.appendChild(i);var e=R.getComputedStyle(l);t=\"1%\"!==e.top,r=\"2px\"===e.marginLeft,n=\"4px\"===e.width,l.style.marginRight=\"50%\",o=\"4px\"===e.marginRight,ve.removeChild(i),l=null}}var t,n,o,r,i=S.createElement(\"div\"),l=S.createElement(\"div\");l.style&&(l.style.backgroundClip=\"content-box\",l.cloneNode(!0).style.backgroundClip=\"\",m.clearCloneStyle=\"content-box\"===l.style.backgroundClip,i.style.cssText=\"border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute\",i.appendChild(l),E.extend(m,{pixelPosition:function(){return e(),t},boxSizingReliable:function(){return e(),n},pixelMarginRight:function(){return e(),o},reliableMarginLeft:function(){return e(),r}}))}();var Be=/^(none|table(?!-c[ea]).+)/,qe=/^--/,Oe={position:\"absolute\",visibility:\"hidden\",display:\"block\"},ze={letterSpacing:\"0\",fontWeight:\"400\"},Xe=[\"Webkit\",\"Moz\",\"ms\"],Ue=S.createElement(\"div\").style;function Ke(e){var t=E.cssProps[e];return t||(t=E.cssProps[e]=function(e){if(e in Ue)return e;var t=e[0].toUpperCase()+e.slice(1),n=Xe.length;for(;n--;)if((e=Xe[n]+t)in Ue)return e}(e)||e),t}function Ge(e,t,n){var o=J.exec(t);return o?Math.max(0,o[2]-(n||0))+(o[3]||\"px\"):t}function Ye(e,t,n,o,r){var i,l=0;for(i=n===(o?\"border\":\"content\")?4:\"width\"===t?1:0;i<4;i+=2)\"margin\"===n&&(l+=E.css(e,n+Z[i],!0,r)),o?(\"content\"===n&&(l-=E.css(e,\"padding\"+Z[i],!0,r)),\"margin\"!==n&&(l-=E.css(e,\"border\"+Z[i]+\"Width\",!0,r))):(l+=E.css(e,\"padding\"+Z[i],!0,r),\"padding\"!==n&&(l+=E.css(e,\"border\"+Z[i]+\"Width\",!0,r)));return l}function Qe(e,t,n){var o,r=We(e),i=je(e,t,r),l=\"border-box\"===E.css(e,\"boxSizing\",!1,r);return Me.test(i)?i:(o=l&&(m.boxSizingReliable()||i===e.style[t]),\"auto\"===i&&(i=e[\"offset\"+t[0].toUpperCase()+t.slice(1)]),(i=parseFloat(i)||0)+Ye(e,t,n||(l?\"border\":\"content\"),o,r)+\"px\")}function Je(e,t,n,o,r){return new Je.prototype.init(e,t,n,o,r)}E.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=je(e,\"opacity\");return\"\"===n?\"1\":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:\"cssFloat\"},style:function(e,t,n,o){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,i,l,s=E.camelCase(t),a=qe.test(t),c=e.style;if(a||(t=Ke(s)),l=E.cssHooks[t]||E.cssHooks[s],void 0===n)return l&&\"get\"in l&&void 0!==(r=l.get(e,!1,o))?r:c[t];\"string\"===(i=typeof n)&&(r=J.exec(n))&&r[1]&&(n=ne(e,t,r),i=\"number\"),null!=n&&n==n&&(\"number\"===i&&(n+=r&&r[3]||(E.cssNumber[s]?\"\":\"px\")),m.clearCloneStyle||\"\"!==n||0!==t.indexOf(\"background\")||(c[t]=\"inherit\"),l&&\"set\"in l&&void 0===(n=l.set(e,n,o))||(a?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,o){var r,i,l,s=E.camelCase(t),a=qe.test(t);return a||(t=Ke(s)),(l=E.cssHooks[t]||E.cssHooks[s])&&\"get\"in l&&(r=l.get(e,!0,n)),void 0===r&&(r=je(e,t,o)),\"normal\"===r&&t in ze&&(r=ze[t]),\"\"===n||n?(i=parseFloat(r),!0===n||isFinite(i)?i||0:r):r}}),E.each([\"height\",\"width\"],function(e,l){E.cssHooks[l]={get:function(e,t,n){if(t)return!Be.test(E.css(e,\"display\"))||e.getClientRects().length&&e.getBoundingClientRect().width?Qe(e,l,n):te(e,Oe,function(){return Qe(e,l,n)})},set:function(e,t,n){var o,r=n&&We(e),i=n&&Ye(e,l,n,\"border-box\"===E.css(e,\"boxSizing\",!1,r),r);return i&&(o=J.exec(t))&&\"px\"!==(o[3]||\"px\")&&(e.style[l]=t,t=E.css(e,l)),Ge(e,t,i)}}}),E.cssHooks.marginLeft=Ve(m.reliableMarginLeft,function(e,t){if(t)return(parseFloat(je(e,\"marginLeft\"))||e.getBoundingClientRect().left-te(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+\"px\"}),E.each({margin:\"\",padding:\"\",border:\"Width\"},function(r,i){E.cssHooks[r+i]={expand:function(e){for(var t=0,n={},o=\"string\"==typeof e?e.split(\" \"):[e];t<4;t++)n[r+Z[t]+i]=o[t]||o[t-2]||o[0];return n}},Ie.test(r)||(E.cssHooks[r+i].set=Ge)}),E.fn.extend({css:function(e,t){return q(this,function(e,t,n){var o,r,i={},l=0;if(Array.isArray(t)){for(o=We(e),r=t.length;l<r;l++)i[t[l]]=E.css(e,t[l],!1,o);return i}return void 0!==n?E.style(e,t,n):E.css(e,t)},e,t,1<arguments.length)}}),((E.Tween=Je).prototype={constructor:Je,init:function(e,t,n,o,r,i){this.elem=e,this.prop=n,this.easing=r||E.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=o,this.unit=i||(E.cssNumber[n]?\"\":\"px\")},cur:function(){var e=Je.propHooks[this.prop];return e&&e.get?e.get(this):Je.propHooks._default.get(this)},run:function(e){var t,n=Je.propHooks[this.prop];return this.options.duration?this.pos=t=E.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Je.propHooks._default.set(this),this}}).init.prototype=Je.prototype,(Je.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=E.css(e.elem,e.prop,\"\"))&&\"auto\"!==t?t:0},set:function(e){E.fx.step[e.prop]?E.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[E.cssProps[e.prop]]&&!E.cssHooks[e.prop]?e.elem[e.prop]=e.now:E.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Je.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},E.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:\"swing\"},E.fx=Je.prototype.init,E.fx.step={};var Ze,et,tt,nt,ot,rt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function lt(){et&&(!1===S.hidden&&R.requestAnimationFrame?R.requestAnimationFrame(lt):R.setTimeout(lt,E.fx.interval),E.fx.tick())}function st(){return R.setTimeout(function(){Ze=void 0}),Ze=E.now()}function at(e,t){var n,o=0,r={height:e};for(t=t?1:0;o<4;o+=2-t)n=Z[o],r[\"margin\"+n]=r[\"padding\"+n]=e;return t&&(r.opacity=r.width=e),r}function ct(e,t,n){for(var o,r=(ut.tweeners[t]||[]).concat(ut.tweeners[\"*\"]),i=0,l=r.length;i<l;i++)if(o=r[i].call(n,t,e))return o}function ut(l,e,t){var n,s,o=0,r=ut.prefilters.length,a=E.Deferred().always(function(){delete i.elem}),i=function(){if(s)return!1;for(var e=Ze||st(),t=Math.max(0,c.startTime+c.duration-e),n=t/c.duration||0,o=1-n,r=0,i=c.tweens.length;r<i;r++)c.tweens[r].run(o);return a.notifyWith(l,[c,o,t]),o<1&&i?t:(i||a.notifyWith(l,[c,1,0]),a.resolveWith(l,[c]),!1)},c=a.promise({elem:l,props:E.extend({},e),opts:E.extend(!0,{specialEasing:{},easing:E.easing._default},t),originalProperties:e,originalOptions:t,startTime:Ze||st(),duration:t.duration,tweens:[],createTween:function(e,t){var n=E.Tween(l,c.opts,e,t,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(n),n},stop:function(e){var t=0,n=e?c.tweens.length:0;if(s)return this;for(s=!0;t<n;t++)c.tweens[t].run(1);return e?(a.notifyWith(l,[c,1,0]),a.resolveWith(l,[c,e])):a.rejectWith(l,[c,e]),this}}),u=c.props;for(!function(e,t){var n,o,r,i,l;for(n in e)if(o=E.camelCase(n),r=t[o],i=e[n],Array.isArray(i)&&(r=i[1],i=e[n]=i[0]),n!==o&&(e[o]=i,delete e[n]),(l=E.cssHooks[o])&&\"expand\"in l)for(n in i=l.expand(i),delete e[o],i)n in e||(e[n]=i[n],t[n]=r);else t[o]=r}(u,c.opts.specialEasing);o<r;o++)if(n=ut.prefilters[o].call(c,l,u,c.opts))return E.isFunction(n.stop)&&(E._queueHooks(c.elem,c.opts.queue).stop=E.proxy(n.stop,n)),n;return E.map(u,ct,c),E.isFunction(c.opts.start)&&c.opts.start.call(l,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),E.fx.timer(E.extend(i,{elem:l,anim:c,queue:c.opts.queue})),c}E.Animation=E.extend(ut,{tweeners:{\"*\":[function(e,t){var n=this.createTween(e,t);return ne(n.elem,e,J.exec(t),n),n}]},tweener:function(e,t){E.isFunction(e)?(t=e,e=[\"*\"]):e=e.match(F);for(var n,o=0,r=e.length;o<r;o++)n=e[o],ut.tweeners[n]=ut.tweeners[n]||[],ut.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var o,r,i,l,s,a,c,u,d=\"width\"in t||\"height\"in t,p=this,f={},h=e.style,g=e.nodeType&&ee(e),m=X.get(e,\"fxshow\");n.queue||(null==(l=E._queueHooks(e,\"fx\")).unqueued&&(l.unqueued=0,s=l.empty.fire,l.empty.fire=function(){l.unqueued||s()}),l.unqueued++,p.always(function(){p.always(function(){l.unqueued--,E.queue(e,\"fx\").length||l.empty.fire()})}));for(o in t)if(r=t[o],rt.test(r)){if(delete t[o],i=i||\"toggle\"===r,r===(g?\"hide\":\"show\")){if(\"show\"!==r||!m||void 0===m[o])continue;g=!0}f[o]=m&&m[o]||E.style(e,o)}if(!(a=!E.isEmptyObject(t))&&E.isEmptyObject(f))return;d&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(c=m&&m.display)&&(c=X.get(e,\"display\")),\"none\"===(u=E.css(e,\"display\"))&&(c?u=c:(ie([e],!0),c=e.style.display||c,u=E.css(e,\"display\"),ie([e]))),(\"inline\"===u||\"inline-block\"===u&&null!=c)&&\"none\"===E.css(e,\"float\")&&(a||(p.done(function(){h.display=c}),null==c&&(u=h.display,c=\"none\"===u?\"\":u)),h.display=\"inline-block\"));n.overflow&&(h.overflow=\"hidden\",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}));for(o in a=!1,f)a||(m?\"hidden\"in m&&(g=m.hidden):m=X.access(e,\"fxshow\",{display:c}),i&&(m.hidden=!g),g&&ie([e],!0),p.done(function(){for(o in g||ie([e]),X.remove(e,\"fxshow\"),f)E.style(e,o,f[o])})),a=ct(g?m[o]:0,o,p),o in m||(m[o]=a.start,g&&(a.end=a.start,a.start=0))}],prefilter:function(e,t){t?ut.prefilters.unshift(e):ut.prefilters.push(e)}}),E.speed=function(e,t,n){var o=e&&\"object\"==typeof e?E.extend({},e):{complete:n||!n&&t||E.isFunction(e)&&e,duration:e,easing:n&&t||t&&!E.isFunction(t)&&t};return E.fx.off?o.duration=0:\"number\"!=typeof o.duration&&(o.duration in E.fx.speeds?o.duration=E.fx.speeds[o.duration]:o.duration=E.fx.speeds._default),null!=o.queue&&!0!==o.queue||(o.queue=\"fx\"),o.old=o.complete,o.complete=function(){E.isFunction(o.old)&&o.old.call(this),o.queue&&E.dequeue(this,o.queue)},o},E.fn.extend({fadeTo:function(e,t,n,o){return this.filter(ee).css(\"opacity\",0).show().end().animate({opacity:t},e,n,o)},animate:function(t,e,n,o){var r=E.isEmptyObject(t),i=E.speed(e,n,o),l=function(){var e=ut(this,E.extend({},t),i);(r||X.get(this,\"finish\"))&&e.stop(!0)};return l.finish=l,r||!1===i.queue?this.each(l):this.queue(i.queue,l)},stop:function(r,e,i){var l=function(e){var t=e.stop;delete e.stop,t(i)};return\"string\"!=typeof r&&(i=e,e=r,r=void 0),e&&!1!==r&&this.queue(r||\"fx\",[]),this.each(function(){var e=!0,t=null!=r&&r+\"queueHooks\",n=E.timers,o=X.get(this);if(t)o[t]&&o[t].stop&&l(o[t]);else for(t in o)o[t]&&o[t].stop&&it.test(t)&&l(o[t]);for(t=n.length;t--;)n[t].elem!==this||null!=r&&n[t].queue!==r||(n[t].anim.stop(i),e=!1,n.splice(t,1));!e&&i||E.dequeue(this,r)})},finish:function(l){return!1!==l&&(l=l||\"fx\"),this.each(function(){var e,t=X.get(this),n=t[l+\"queue\"],o=t[l+\"queueHooks\"],r=E.timers,i=n?n.length:0;for(t.finish=!0,E.queue(this,l,[]),o&&o.stop&&o.stop.call(this,!0),e=r.length;e--;)r[e].elem===this&&r[e].queue===l&&(r[e].anim.stop(!0),r.splice(e,1));for(e=0;e<i;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),E.each([\"toggle\",\"show\",\"hide\"],function(e,o){var r=E.fn[o];E.fn[o]=function(e,t,n){return null==e||\"boolean\"==typeof e?r.apply(this,arguments):this.animate(at(o,!0),e,t,n)}}),E.each({slideDown:at(\"show\"),slideUp:at(\"hide\"),slideToggle:at(\"toggle\"),fadeIn:{opacity:\"show\"},fadeOut:{opacity:\"hide\"},fadeToggle:{opacity:\"toggle\"}},function(e,o){E.fn[e]=function(e,t,n){return this.animate(o,e,t,n)}}),E.timers=[],E.fx.tick=function(){var e,t=0,n=E.timers;for(Ze=E.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||E.fx.stop(),Ze=void 0},E.fx.timer=function(e){E.timers.push(e),E.fx.start()},E.fx.interval=13,E.fx.start=function(){et||(et=!0,lt())},E.fx.stop=function(){et=null},E.fx.speeds={slow:600,fast:200,_default:400},E.fn.delay=function(o,e){return o=E.fx&&E.fx.speeds[o]||o,e=e||\"fx\",this.queue(e,function(e,t){var n=R.setTimeout(e,o);t.stop=function(){R.clearTimeout(n)}})},tt=S.createElement(\"input\"),nt=S.createElement(\"select\"),ot=nt.appendChild(S.createElement(\"option\")),tt.type=\"checkbox\",m.checkOn=\"\"!==tt.value,m.optSelected=ot.selected,(tt=S.createElement(\"input\")).value=\"t\",tt.type=\"radio\",m.radioValue=\"t\"===tt.value;var dt,pt=E.expr.attrHandle;E.fn.extend({attr:function(e,t){return q(this,E.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){E.removeAttr(this,e)})}}),E.extend({attr:function(e,t,n){var o,r,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?E.prop(e,t,n):(1===i&&E.isXMLDoc(e)||(r=E.attrHooks[t.toLowerCase()]||(E.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void E.removeAttr(e,t):r&&\"set\"in r&&void 0!==(o=r.set(e,n,t))?o:(e.setAttribute(t,n+\"\"),n):r&&\"get\"in r&&null!==(o=r.get(e,t))?o:null==(o=E.find.attr(e,t))?void 0:o)},attrHooks:{type:{set:function(e,t){if(!m.radioValue&&\"radio\"===t&&k(e,\"input\")){var n=e.value;return e.setAttribute(\"type\",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,o=0,r=t&&t.match(F);if(r&&1===e.nodeType)for(;n=r[o++];)e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?E.removeAttr(e,n):e.setAttribute(n,n),n}},E.each(E.expr.match.bool.source.match(/\\w+/g),function(e,t){var l=pt[t]||E.find.attr;pt[t]=function(e,t,n){var o,r,i=t.toLowerCase();return n||(r=pt[i],pt[i]=o,o=null!=l(e,t,n)?i:null,pt[i]=r),o}});var ft=/^(?:input|select|textarea|button)$/i,ht=/^(?:a|area)$/i;function gt(e){var t=e.match(F)||[];return t.join(\" \")}function mt(e){return e.getAttribute&&e.getAttribute(\"class\")||\"\"}E.fn.extend({prop:function(e,t){return q(this,E.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[E.propFix[e]||e]})}}),E.extend({prop:function(e,t,n){var o,r,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&E.isXMLDoc(e)||(t=E.propFix[t]||t,r=E.propHooks[t]),void 0!==n?r&&\"set\"in r&&void 0!==(o=r.set(e,n,t))?o:e[t]=n:r&&\"get\"in r&&null!==(o=r.get(e,t))?o:e[t]},propHooks:{tabIndex:{get:function(e){var t=E.find.attr(e,\"tabindex\");return t?parseInt(t,10):ft.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:\"htmlFor\",class:\"className\"}}),m.optSelected||(E.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),E.each([\"tabIndex\",\"readOnly\",\"maxLength\",\"cellSpacing\",\"cellPadding\",\"rowSpan\",\"colSpan\",\"useMap\",\"frameBorder\",\"contentEditable\"],function(){E.propFix[this.toLowerCase()]=this}),E.fn.extend({addClass:function(t){var e,n,o,r,i,l,s,a=0;if(E.isFunction(t))return this.each(function(e){E(this).addClass(t.call(this,e,mt(this)))});if(\"string\"==typeof t&&t)for(e=t.match(F)||[];n=this[a++];)if(r=mt(n),o=1===n.nodeType&&\" \"+gt(r)+\" \"){for(l=0;i=e[l++];)o.indexOf(\" \"+i+\" \")<0&&(o+=i+\" \");s=gt(o),r!==s&&n.setAttribute(\"class\",s)}return this},removeClass:function(t){var e,n,o,r,i,l,s,a=0;if(E.isFunction(t))return this.each(function(e){E(this).removeClass(t.call(this,e,mt(this)))});if(!arguments.length)return this.attr(\"class\",\"\");if(\"string\"==typeof t&&t)for(e=t.match(F)||[];n=this[a++];)if(r=mt(n),o=1===n.nodeType&&\" \"+gt(r)+\" \"){for(l=0;i=e[l++];)for(;-1<o.indexOf(\" \"+i+\" \");)o=o.replace(\" \"+i+\" \",\" \");s=gt(o),r!==s&&n.setAttribute(\"class\",s)}return this},toggleClass:function(r,t){var i=typeof r;return\"boolean\"==typeof t&&\"string\"===i?t?this.addClass(r):this.removeClass(r):E.isFunction(r)?this.each(function(e){E(this).toggleClass(r.call(this,e,mt(this),t),t)}):this.each(function(){var e,t,n,o;if(\"string\"===i)for(t=0,n=E(this),o=r.match(F)||[];e=o[t++];)n.hasClass(e)?n.removeClass(e):n.addClass(e);else void 0!==r&&\"boolean\"!==i||((e=mt(this))&&X.set(this,\"__className__\",e),this.setAttribute&&this.setAttribute(\"class\",e||!1===r?\"\":X.get(this,\"__className__\")||\"\"))})},hasClass:function(e){var t,n,o=0;for(t=\" \"+e+\" \";n=this[o++];)if(1===n.nodeType&&-1<(\" \"+gt(mt(n))+\" \").indexOf(t))return!0;return!1}});var vt=/\\r/g;E.fn.extend({val:function(n){var o,e,r,t=this[0];return arguments.length?(r=E.isFunction(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=r?n.call(this,e,E(this).val()):n)?t=\"\":\"number\"==typeof t?t+=\"\":Array.isArray(t)&&(t=E.map(t,function(e){return null==e?\"\":e+\"\"})),(o=E.valHooks[this.type]||E.valHooks[this.nodeName.toLowerCase()])&&\"set\"in o&&void 0!==o.set(this,t,\"value\")||(this.value=t))})):t?(o=E.valHooks[t.type]||E.valHooks[t.nodeName.toLowerCase()])&&\"get\"in o&&void 0!==(e=o.get(t,\"value\"))?e:\"string\"==typeof(e=t.value)?e.replace(vt,\"\"):null==e?\"\":e:void 0}}),E.extend({valHooks:{option:{get:function(e){var t=E.find.attr(e,\"value\");return null!=t?t:gt(E.text(e))}},select:{get:function(e){var t,n,o,r=e.options,i=e.selectedIndex,l=\"select-one\"===e.type,s=l?null:[],a=l?i+1:r.length;for(o=i<0?a:l?i:0;o<a;o++)if(((n=r[o]).selected||o===i)&&!n.disabled&&(!n.parentNode.disabled||!k(n.parentNode,\"optgroup\"))){if(t=E(n).val(),l)return t;s.push(t)}return s},set:function(e,t){for(var n,o,r=e.options,i=E.makeArray(t),l=r.length;l--;)((o=r[l]).selected=-1<E.inArray(E.valHooks.option.get(o),i))&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),E.each([\"radio\",\"checkbox\"],function(){E.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<E.inArray(E(e).val(),t)}},m.checkOn||(E.valHooks[this].get=function(e){return null===e.getAttribute(\"value\")?\"on\":e.value})});var wt=/^(?:focusinfocus|focusoutblur)$/;E.extend(E.event,{trigger:function(e,t,n,o){var r,i,l,s,a,c,u,d=[n||S],p=h.call(e,\"type\")?e.type:e,f=h.call(e,\"namespace\")?e.namespace.split(\".\"):[];if(i=l=n=n||S,3!==n.nodeType&&8!==n.nodeType&&!wt.test(p+E.event.triggered)&&(-1<p.indexOf(\".\")&&(p=(f=p.split(\".\")).shift(),f.sort()),a=p.indexOf(\":\")<0&&\"on\"+p,(e=e[E.expando]?e:new E.Event(p,\"object\"==typeof e&&e)).isTrigger=o?2:3,e.namespace=f.join(\".\"),e.rnamespace=e.namespace?new RegExp(\"(^|\\\\.)\"+f.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:E.makeArray(t,[e]),u=E.event.special[p]||{},o||!u.trigger||!1!==u.trigger.apply(n,t))){if(!o&&!u.noBubble&&!E.isWindow(n)){for(s=u.delegateType||p,wt.test(s+p)||(i=i.parentNode);i;i=i.parentNode)d.push(i),l=i;l===(n.ownerDocument||S)&&d.push(l.defaultView||l.parentWindow||R)}for(r=0;(i=d[r++])&&!e.isPropagationStopped();)e.type=1<r?s:u.bindType||p,(c=(X.get(i,\"events\")||{})[e.type]&&X.get(i,\"handle\"))&&c.apply(i,t),(c=a&&i[a])&&c.apply&&O(i)&&(e.result=c.apply(i,t),!1===e.result&&e.preventDefault());return e.type=p,o||e.isDefaultPrevented()||u._default&&!1!==u._default.apply(d.pop(),t)||!O(n)||a&&E.isFunction(n[p])&&!E.isWindow(n)&&((l=n[a])&&(n[a]=null),E.event.triggered=p,n[p](),E.event.triggered=void 0,l&&(n[a]=l)),e.result}},simulate:function(e,t,n){var o=E.extend(new E.Event,n,{type:e,isSimulated:!0});E.event.trigger(o,null,t)}}),E.fn.extend({trigger:function(e,t){return this.each(function(){E.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return E.event.trigger(e,t,n,!0)}}),E.each(\"blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu\".split(\" \"),function(e,n){E.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}}),E.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),m.focusin=\"onfocusin\"in R,m.focusin||E.each({focus:\"focusin\",blur:\"focusout\"},function(n,o){var r=function(e){E.event.simulate(o,e.target,E.event.fix(e))};E.event.special[o]={setup:function(){var e=this.ownerDocument||this,t=X.access(e,o);t||e.addEventListener(n,r,!0),X.access(e,o,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this,t=X.access(e,o)-1;t?X.access(e,o,t):(e.removeEventListener(n,r,!0),X.remove(e,o))}}});var yt=R.location,Ct=E.now(),bt=/\\?/;E.parseXML=function(e){var t;if(!e||\"string\"!=typeof e)return null;try{t=(new R.DOMParser).parseFromString(e,\"text/xml\")}catch(e){t=void 0}return t&&!t.getElementsByTagName(\"parsererror\").length||E.error(\"Invalid XML: \"+e),t};var xt=/\\[\\]$/,Rt=/\\r?\\n/g,St=/^(?:submit|button|image|reset|file)$/i,Et=/^(?:input|select|textarea|keygen)/i;function kt(n,e,o,r){var t;if(Array.isArray(e))E.each(e,function(e,t){o||xt.test(n)?r(n,t):kt(n+\"[\"+(\"object\"==typeof t&&null!=t?e:\"\")+\"]\",t,o,r)});else if(o||\"object\"!==E.type(e))r(n,e);else for(t in e)kt(n+\"[\"+t+\"]\",e[t],o,r)}E.param=function(e,t){var n,o=[],r=function(e,t){var n=E.isFunction(t)?t():t;o[o.length]=encodeURIComponent(e)+\"=\"+encodeURIComponent(null==n?\"\":n)};if(Array.isArray(e)||e.jquery&&!E.isPlainObject(e))E.each(e,function(){r(this.name,this.value)});else for(n in e)kt(n,e[n],t,r);return o.join(\"&\")},E.fn.extend({serialize:function(){return E.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=E.prop(this,\"elements\");return e?E.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!E(this).is(\":disabled\")&&Et.test(this.nodeName)&&!St.test(e)&&(this.checked||!le.test(e))}).map(function(e,t){var n=E(this).val();return null==n?null:Array.isArray(n)?E.map(n,function(e){return{name:t.name,value:e.replace(Rt,\"\\r\\n\")}}):{name:t.name,value:n.replace(Rt,\"\\r\\n\")}}).get()}});var Tt=/%20/g,Pt=/#.*$/,Dt=/([?&])_=[^&]*/,Nt=/^(.*?):[ \\t]*([^\\r\\n]*)$/gm,At=/^(?:GET|HEAD)$/,$t=/^\\/\\//,Ht={},Lt={},_t=\"*/\".concat(\"*\"),Ft=S.createElement(\"a\");function It(i){return function(e,t){\"string\"!=typeof e&&(t=e,e=\"*\");var n,o=0,r=e.toLowerCase().match(F)||[];if(E.isFunction(t))for(;n=r[o++];)\"+\"===n[0]?(n=n.slice(1)||\"*\",(i[n]=i[n]||[]).unshift(t)):(i[n]=i[n]||[]).push(t)}}function Mt(t,r,i,l){var s={},a=t===Lt;function c(e){var o;return s[e]=!0,E.each(t[e]||[],function(e,t){var n=t(r,i,l);return\"string\"!=typeof n||a||s[n]?a?!(o=n):void 0:(r.dataTypes.unshift(n),c(n),!1)}),o}return c(r.dataTypes[0])||!s[\"*\"]&&c(\"*\")}function Wt(e,t){var n,o,r=E.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:o||(o={}))[n]=t[n]);return o&&E.extend(!0,e,o),e}Ft.href=yt.href,E.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yt.href,type:\"GET\",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(yt.protocol),global:!0,processData:!0,async:!0,contentType:\"application/x-www-form-urlencoded; charset=UTF-8\",accepts:{\"*\":_t,text:\"text/plain\",html:\"text/html\",xml:\"application/xml, text/xml\",json:\"application/json, text/javascript\"},contents:{xml:/\\bxml\\b/,html:/\\bhtml/,json:/\\bjson\\b/},responseFields:{xml:\"responseXML\",text:\"responseText\",json:\"responseJSON\"},converters:{\"* text\":String,\"text html\":!0,\"text json\":JSON.parse,\"text xml\":E.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Wt(Wt(e,E.ajaxSettings),t):Wt(E.ajaxSettings,e)},ajaxPrefilter:It(Ht),ajaxTransport:It(Lt),ajax:function(e,t){\"object\"==typeof e&&(t=e,e=void 0),t=t||{};var u,d,p,n,f,o,h,g,r,i,m=E.ajaxSetup({},t),v=m.context||m,w=m.context&&(v.nodeType||v.jquery)?E(v):E.event,y=E.Deferred(),C=E.Callbacks(\"once memory\"),b=m.statusCode||{},l={},s={},a=\"canceled\",x={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n)for(n={};t=Nt.exec(p);)n[t[1].toLowerCase()]=t[2];t=n[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,l[e]=t),this},overrideMimeType:function(e){return null==h&&(m.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)x.always(e[x.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||a;return u&&u.abort(t),c(0,t),this}};if(y.promise(x),m.url=((e||m.url||yt.href)+\"\").replace($t,yt.protocol+\"//\"),m.type=t.method||t.type||m.method||m.type,m.dataTypes=(m.dataType||\"*\").toLowerCase().match(F)||[\"\"],null==m.crossDomain){o=S.createElement(\"a\");try{o.href=m.url,o.href=o.href,m.crossDomain=Ft.protocol+\"//\"+Ft.host!=o.protocol+\"//\"+o.host}catch(e){m.crossDomain=!0}}if(m.data&&m.processData&&\"string\"!=typeof m.data&&(m.data=E.param(m.data,m.traditional)),Mt(Ht,m,t,x),h)return x;for(r in(g=E.event&&m.global)&&0==E.active++&&E.event.trigger(\"ajaxStart\"),m.type=m.type.toUpperCase(),m.hasContent=!At.test(m.type),d=m.url.replace(Pt,\"\"),m.hasContent?m.data&&m.processData&&0===(m.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&(m.data=m.data.replace(Tt,\"+\")):(i=m.url.slice(d.length),m.data&&(d+=(bt.test(d)?\"&\":\"?\")+m.data,delete m.data),!1===m.cache&&(d=d.replace(Dt,\"$1\"),i=(bt.test(d)?\"&\":\"?\")+\"_=\"+Ct+++i),m.url=d+i),m.ifModified&&(E.lastModified[d]&&x.setRequestHeader(\"If-Modified-Since\",E.lastModified[d]),E.etag[d]&&x.setRequestHeader(\"If-None-Match\",E.etag[d])),(m.data&&m.hasContent&&!1!==m.contentType||t.contentType)&&x.setRequestHeader(\"Content-Type\",m.contentType),x.setRequestHeader(\"Accept\",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+(\"*\"!==m.dataTypes[0]?\", \"+_t+\"; q=0.01\":\"\"):m.accepts[\"*\"]),m.headers)x.setRequestHeader(r,m.headers[r]);if(m.beforeSend&&(!1===m.beforeSend.call(v,x,m)||h))return x.abort();if(a=\"abort\",C.add(m.complete),x.done(m.success),x.fail(m.error),u=Mt(Lt,m,t,x)){if(x.readyState=1,g&&w.trigger(\"ajaxSend\",[x,m]),h)return x;m.async&&0<m.timeout&&(f=R.setTimeout(function(){x.abort(\"timeout\")},m.timeout));try{h=!1,u.send(l,c)}catch(e){if(h)throw e;c(-1,e)}}else c(-1,\"No Transport\");function c(e,t,n,o){var r,i,l,s,a,c=t;h||(h=!0,f&&R.clearTimeout(f),u=void 0,p=o||\"\",x.readyState=0<e?4:0,r=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var o,r,i,l,s=e.contents,a=e.dataTypes;for(;\"*\"===a[0];)a.shift(),void 0===o&&(o=e.mimeType||t.getResponseHeader(\"Content-Type\"));if(o)for(r in s)if(s[r]&&s[r].test(o)){a.unshift(r);break}if(a[0]in n)i=a[0];else{for(r in n){if(!a[0]||e.converters[r+\" \"+a[0]]){i=r;break}l||(l=r)}i=i||l}if(i)return i!==a[0]&&a.unshift(i),n[i]}(m,x,n)),s=function(e,t,n,o){var r,i,l,s,a,c={},u=e.dataTypes.slice();if(u[1])for(l in e.converters)c[l.toLowerCase()]=e.converters[l];i=u.shift();for(;i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!a&&o&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a=i,i=u.shift())if(\"*\"===i)i=a;else if(\"*\"!==a&&a!==i){if(!(l=c[a+\" \"+i]||c[\"* \"+i]))for(r in c)if((s=r.split(\" \"))[1]===i&&(l=c[a+\" \"+s[0]]||c[\"* \"+s[0]])){!0===l?l=c[r]:!0!==c[r]&&(i=s[0],u.unshift(s[1]));break}if(!0!==l)if(l&&e.throws)t=l(t);else try{t=l(t)}catch(e){return{state:\"parsererror\",error:l?e:\"No conversion from \"+a+\" to \"+i}}}return{state:\"success\",data:t}}(m,s,x,r),r?(m.ifModified&&((a=x.getResponseHeader(\"Last-Modified\"))&&(E.lastModified[d]=a),(a=x.getResponseHeader(\"etag\"))&&(E.etag[d]=a)),204===e||\"HEAD\"===m.type?c=\"nocontent\":304===e?c=\"notmodified\":(c=s.state,i=s.data,l=s.error,r=!l)):(l=c,!e&&c||(c=\"error\",e<0&&(e=0))),x.status=e,x.statusText=(t||c)+\"\",r?y.resolveWith(v,[i,c,x]):y.rejectWith(v,[x,c,l]),x.statusCode(b),b=void 0,g&&w.trigger(r?\"ajaxSuccess\":\"ajaxError\",[x,m,r?i:l]),C.fireWith(v,[x,c]),g&&(w.trigger(\"ajaxComplete\",[x,m]),--E.active||E.event.trigger(\"ajaxStop\")))}return x},getJSON:function(e,t,n){return E.get(e,t,n,\"json\")},getScript:function(e,t){return E.get(e,void 0,t,\"script\")}}),E.each([\"get\",\"post\"],function(e,r){E[r]=function(e,t,n,o){return E.isFunction(t)&&(o=o||n,n=t,t=void 0),E.ajax(E.extend({url:e,type:r,dataType:o,data:t,success:n},E.isPlainObject(e)&&e))}}),E._evalUrl=function(e){return E.ajax({url:e,type:\"GET\",dataType:\"script\",cache:!0,async:!1,global:!1,throws:!0})},E.fn.extend({wrapAll:function(e){var t;return this[0]&&(E.isFunction(e)&&(e=e.call(this[0])),t=E(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return E.isFunction(n)?this.each(function(e){E(this).wrapInner(n.call(this,e))}):this.each(function(){var e=E(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=E.isFunction(t);return this.each(function(e){E(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not(\"body\").each(function(){E(this).replaceWith(this.childNodes)}),this}}),E.expr.pseudos.hidden=function(e){return!E.expr.pseudos.visible(e)},E.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},E.ajaxSettings.xhr=function(){try{return new R.XMLHttpRequest}catch(e){}};var jt={0:200,1223:204},Vt=E.ajaxSettings.xhr();m.cors=!!Vt&&\"withCredentials\"in Vt,m.ajax=Vt=!!Vt,E.ajaxTransport(function(r){var i,l;if(m.cors||Vt&&!r.crossDomain)return{send:function(e,t){var n,o=r.xhr();if(o.open(r.type,r.url,r.async,r.username,r.password),r.xhrFields)for(n in r.xhrFields)o[n]=r.xhrFields[n];for(n in r.mimeType&&o.overrideMimeType&&o.overrideMimeType(r.mimeType),r.crossDomain||e[\"X-Requested-With\"]||(e[\"X-Requested-With\"]=\"XMLHttpRequest\"),e)o.setRequestHeader(n,e[n]);i=function(e){return function(){i&&(i=l=o.onload=o.onerror=o.onabort=o.onreadystatechange=null,\"abort\"===e?o.abort():\"error\"===e?\"number\"!=typeof o.status?t(0,\"error\"):t(o.status,o.statusText):t(jt[o.status]||o.status,o.statusText,\"text\"!==(o.responseType||\"text\")||\"string\"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=i(),l=o.onerror=i(\"error\"),void 0!==o.onabort?o.onabort=l:o.onreadystatechange=function(){4===o.readyState&&R.setTimeout(function(){i&&l()})},i=i(\"abort\");try{o.send(r.hasContent&&r.data||null)}catch(e){if(i)throw e}},abort:function(){i&&i()}}}),E.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),E.ajaxSetup({accepts:{script:\"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"},contents:{script:/\\b(?:java|ecma)script\\b/},converters:{\"text script\":function(e){return E.globalEval(e),e}}}),E.ajaxPrefilter(\"script\",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type=\"GET\")}),E.ajaxTransport(\"script\",function(n){var o,r;if(n.crossDomain)return{send:function(e,t){o=E(\"<script>\").prop({charset:n.scriptCharset,src:n.url}).on(\"load error\",r=function(e){o.remove(),r=null,e&&t(\"error\"===e.type?404:200,e.type)}),S.head.appendChild(o[0])},abort:function(){r&&r()}}});var Bt,qt=[],Ot=/(=)\\?(?=&|$)|\\?\\?/;E.ajaxSetup({jsonp:\"callback\",jsonpCallback:function(){var e=qt.pop()||E.expando+\"_\"+Ct++;return this[e]=!0,e}}),E.ajaxPrefilter(\"json jsonp\",function(e,t,n){var o,r,i,l=!1!==e.jsonp&&(Ot.test(e.url)?\"url\":\"string\"==typeof e.data&&0===(e.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&Ot.test(e.data)&&\"data\");if(l||\"jsonp\"===e.dataTypes[0])return o=e.jsonpCallback=E.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,l?e[l]=e[l].replace(Ot,\"$1\"+o):!1!==e.jsonp&&(e.url+=(bt.test(e.url)?\"&\":\"?\")+e.jsonp+\"=\"+o),e.converters[\"script json\"]=function(){return i||E.error(o+\" was not called\"),i[0]},e.dataTypes[0]=\"json\",r=R[o],R[o]=function(){i=arguments},n.always(function(){void 0===r?E(R).removeProp(o):R[o]=r,e[o]&&(e.jsonpCallback=t.jsonpCallback,qt.push(o)),i&&E.isFunction(r)&&r(i[0]),i=r=void 0}),\"script\"}),m.createHTMLDocument=((Bt=S.implementation.createHTMLDocument(\"\").body).innerHTML=\"<form></form><form></form>\",2===Bt.childNodes.length),E.parseHTML=function(e,t,n){return\"string\"!=typeof e?[]:(\"boolean\"==typeof t&&(n=t,t=!1),t||(m.createHTMLDocument?(t=S.implementation.createHTMLDocument(\"\"),(o=t.createElement(\"base\")).href=S.location.href,t.head.appendChild(o)):t=S),r=T.exec(e),i=!n&&[],r?[t.createElement(r[1])]:(r=me([e],t,i),i&&i.length&&E(i).remove(),E.merge([],r.childNodes)));var o,r,i},E.fn.load=function(e,t,n){var o,r,i,l=this,s=e.indexOf(\" \");return-1<s&&(o=gt(e.slice(s)),e=e.slice(0,s)),E.isFunction(t)?(n=t,t=void 0):t&&\"object\"==typeof t&&(r=\"POST\"),0<l.length&&E.ajax({url:e,type:r||\"GET\",dataType:\"html\",data:t}).done(function(e){i=arguments,l.html(o?E(\"<div>\").append(E.parseHTML(e)).find(o):e)}).always(n&&function(e,t){l.each(function(){n.apply(this,i||[e.responseText,t,e])})}),this},E.each([\"ajaxStart\",\"ajaxStop\",\"ajaxComplete\",\"ajaxError\",\"ajaxSuccess\",\"ajaxSend\"],function(e,t){E.fn[t]=function(e){return this.on(t,e)}}),E.expr.pseudos.animated=function(t){return E.grep(E.timers,function(e){return t===e.elem}).length},E.offset={setOffset:function(e,t,n){var o,r,i,l,s,a,c=E.css(e,\"position\"),u=E(e),d={};\"static\"===c&&(e.style.position=\"relative\"),s=u.offset(),i=E.css(e,\"top\"),a=E.css(e,\"left\"),(\"absolute\"===c||\"fixed\"===c)&&-1<(i+a).indexOf(\"auto\")?(o=u.position(),l=o.top,r=o.left):(l=parseFloat(i)||0,r=parseFloat(a)||0),E.isFunction(t)&&(t=t.call(e,n,E.extend({},s))),null!=t.top&&(d.top=t.top-s.top+l),null!=t.left&&(d.left=t.left-s.left+r),\"using\"in t?t.using.call(e,d):u.css(d)}},E.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){E.offset.setOffset(this,t,e)});var e,n,o,r,i=this[0];return i?i.getClientRects().length?(o=i.getBoundingClientRect(),e=i.ownerDocument,n=e.documentElement,r=e.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n=this[0],o={top:0,left:0};return\"fixed\"===E.css(n,\"position\")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),k(e[0],\"html\")||(o=e.offset()),o={top:o.top+E.css(e[0],\"borderTopWidth\",!0),left:o.left+E.css(e[0],\"borderLeftWidth\",!0)}),{top:t.top-o.top-E.css(n,\"marginTop\",!0),left:t.left-o.left-E.css(n,\"marginLeft\",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&\"static\"===E.css(e,\"position\");)e=e.offsetParent;return e||ve})}}),E.each({scrollLeft:\"pageXOffset\",scrollTop:\"pageYOffset\"},function(t,r){var i=\"pageYOffset\"===r;E.fn[t]=function(e){return q(this,function(e,t,n){var o;if(E.isWindow(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===n)return o?o[r]:e[t];o?o.scrollTo(i?o.pageXOffset:n,i?n:o.pageYOffset):e[t]=n},t,e,arguments.length)}}),E.each([\"top\",\"left\"],function(e,n){E.cssHooks[n]=Ve(m.pixelPosition,function(e,t){if(t)return t=je(e,n),Me.test(t)?E(e).position()[n]+\"px\":t})}),E.each({Height:\"height\",Width:\"width\"},function(l,s){E.each({padding:\"inner\"+l,content:s,\"\":\"outer\"+l},function(o,i){E.fn[i]=function(e,t){var n=arguments.length&&(o||\"boolean\"!=typeof e),r=o||(!0===e||!0===t?\"margin\":\"border\");return q(this,function(e,t,n){var o;return E.isWindow(e)?0===i.indexOf(\"outer\")?e[\"inner\"+l]:e.document.documentElement[\"client\"+l]:9===e.nodeType?(o=e.documentElement,Math.max(e.body[\"scroll\"+l],o[\"scroll\"+l],e.body[\"offset\"+l],o[\"offset\"+l],o[\"client\"+l])):void 0===n?E.css(e,t,r):E.style(e,t,n,r)},s,n?e:void 0,n)}})}),E.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,o){return this.on(t,e,n,o)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,\"**\"):this.off(t,e||\"**\",n)}}),E.holdReady=function(e){e?E.readyWait++:E.ready(!0)},E.isArray=Array.isArray,E.parseJSON=JSON.parse,E.nodeName=k,\"function\"==typeof define&&define.amd&&define(\"jquery\",[],function(){return E});var zt=R.jQuery,Xt=R.$;return E.noConflict=function(e){return R.$===E&&(R.$=Xt),e&&R.jQuery===E&&(R.jQuery=zt),E},e||(R.jQuery=R.$=E),E})},438:function(e,t,n){\n",
" /*!\n",
" * jquery.event.drag - v 2.3.0\n",
" * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com\n",
" * Open Source MIT License - http://threedubmedia.com/code/license\n",
" */\n",
" var f=e(444);f.fn.drag=function(e,t,n){var o=\"string\"==typeof e?e:\"\",r=f.isFunction(e)?e:f.isFunction(t)?t:null;return 0!==o.indexOf(\"drag\")&&(o=\"drag\"+o),n=(e==r?t:n)||{},r?this.on(o,n,r):this.trigger(o)};var h=f.event,o=h.special,g=o.drag={defaults:{which:1,distance:0,not:\":input\",handle:null,relative:!1,drop:!0,click:!1},datakey:\"dragdata\",noBubble:!0,add:function(e){var n=f.data(this,g.datakey),o=e.data||{};n.related+=1,f.each(g.defaults,function(e,t){void 0!==o[e]&&(n[e]=o[e])})},remove:function(){f.data(this,g.datakey).related-=1},setup:function(){if(!f.data(this,g.datakey)){var e=f.extend({related:0},g.defaults);f.data(this,g.datakey,e),h.add(this,\"touchstart mousedown\",g.init,e),this.attachEvent&&this.attachEvent(\"ondragstart\",g.dontstart)}},teardown:function(){var e=f.data(this,g.datakey)||{};e.related||(f.removeData(this,g.datakey),h.remove(this,\"touchstart mousedown\",g.init),g.textselect(!0),this.detachEvent&&this.detachEvent(\"ondragstart\",g.dontstart))},init:function(e){if(!g.touched){var t,n=e.data;if(!(0!=e.which&&0<n.which&&e.which!=n.which)&&!f(e.target).is(n.not)&&(!n.handle||f(e.target).closest(n.handle,e.currentTarget).length)&&(g.touched=\"touchstart\"==e.type?this:null,n.propagates=1,n.mousedown=this,n.interactions=[g.interaction(this,n)],n.target=e.target,n.pageX=e.pageX,n.pageY=e.pageY,n.dragging=null,t=g.hijack(e,\"draginit\",n),n.propagates))return(t=g.flatten(t))&&t.length&&(n.interactions=[],f.each(t,function(){n.interactions.push(g.interaction(this,n))})),n.propagates=n.interactions.length,!1!==n.drop&&o.drop&&o.drop.handler(e,n),g.textselect(!1),g.touched?h.add(g.touched,\"touchmove touchend\",g.handler,n):h.add(document,\"mousemove mouseup\",g.handler,n),!(!g.touched||n.live)&&void 0}},interaction:function(e,t){var n=e&&e.ownerDocument&&f(e)[t.relative?\"position\":\"offset\"]()||{top:0,left:0};return{drag:e,callback:new g.callback,droppable:[],offset:n}},handler:function(e){var t=e.data;switch(e.type){case!t.dragging&&\"touchmove\":e.preventDefault();case!t.dragging&&\"mousemove\":if(Math.pow(e.pageX-t.pageX,2)+Math.pow(e.pageY-t.pageY,2)<Math.pow(t.distance,2))break;e.target=t.target,g.hijack(e,\"dragstart\",t),t.propagates&&(t.dragging=!0);case\"touchmove\":e.preventDefault();case\"mousemove\":if(t.dragging){if(g.hijack(e,\"drag\",t),t.propagates){!1!==t.drop&&o.drop&&o.drop.handler(e,t);break}e.type=\"mouseup\"}case\"touchend\":case\"mouseup\":default:g.touched?h.remove(g.touched,\"touchmove touchend\",g.handler):h.remove(document,\"mousemove mouseup\",g.handler),t.dragging&&(!1!==t.drop&&o.drop&&o.drop.handler(e,t),g.hijack(e,\"dragend\",t)),g.textselect(!0),!1===t.click&&t.dragging&&f.data(t.mousedown,\"suppress.click\",(new Date).getTime()+5),t.dragging=g.touched=!1}},hijack:function(n,o,r,e,t){if(r){var i,l,s,a={event:n.originalEvent,type:n.type},c=o.indexOf(\"drop\")?\"drag\":\"drop\",u=e||0,d=isNaN(e)?r.interactions.length:e;n.type=o;var p=function(){};n.originalEvent=new f.Event(a.event,{preventDefault:p,stopPropagation:p,stopImmediatePropagation:p}),r.results=[];do{if(l=r.interactions[u]){if(\"dragend\"!==o&&l.cancelled)continue;s=g.properties(n,r,l),l.results=[],f(t||l[c]||r.droppable).each(function(e,t){if(s.target=t,!(n.isPropagationStopped=function(){return!1})===(i=t?h.dispatch.call(t,n,s):null)?(\"drag\"==c&&(l.cancelled=!0,r.propagates-=1),\"drop\"==o&&(l[c][e]=null)):\"dropinit\"==o&&l.droppable.push(g.element(i)||t),\"dragstart\"==o&&(l.proxy=f(g.element(i)||l.drag)[0]),l.results.push(i),delete n.result,\"dropinit\"!==o)return i}),r.results[u]=g.flatten(l.results),\"dropinit\"==o&&(l.droppable=g.flatten(l.droppable)),\"dragstart\"!=o||l.cancelled||s.update()}}while(++u<d);return n.type=a.type,n.originalEvent=a.event,g.flatten(r.results)}},properties:function(e,t,n){var o=n.callback;return o.drag=n.drag,o.proxy=n.proxy||n.drag,o.startX=t.pageX,o.startY=t.pageY,o.deltaX=e.pageX-t.pageX,o.deltaY=e.pageY-t.pageY,o.originalX=n.offset.left,o.originalY=n.offset.top,o.offsetX=o.originalX+o.deltaX,o.offsetY=o.originalY+o.deltaY,o.drop=g.flatten((n.drop||[]).slice()),o.available=g.flatten((n.droppable||[]).slice()),o},element:function(e){if(e&&(e.jquery||1==e.nodeType))return e},flatten:function(e){return f.map(e,function(e){return e&&e.jquery?f.makeArray(e):e&&e.length?g.flatten(e):e})},textselect:function(e){f(document)[e?\"off\":\"on\"](\"selectstart\",g.dontstart).css(\"MozUserSelect\",e?\"\":\"none\"),document.unselectable=e?\"off\":\"on\"},dontstart:function(){return!1},callback:function(){}};g.callback.prototype={update:function(){o.drop&&this.available.length&&f.each(this.available,function(e){o.drop.locate(this,e)})}};var r=h.dispatch;h.dispatch=function(e){if(!(0<f.data(this,\"suppress.\"+e.type)-(new Date).getTime()))return r.apply(this,arguments);f.removeData(this,\"suppress.\"+e.type)},o.draginit=o.dragstart=o.dragend=g},439:function(e,t,n){\n",
" /*!\n",
" * jquery.event.drop - v 2.3.0\n",
" * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com\n",
" * Open Source MIT License - http://threedubmedia.com/code/license\n",
" */\n",
" var f=e(444);f.fn.drop=function(e,t,n){var o=\"string\"==typeof e?e:\"\",r=f.isFunction(e)?e:f.isFunction(t)?t:null;return 0!==o.indexOf(\"drop\")&&(o=\"drop\"+o),n=(e==r?t:n)||{},r?this.on(o,n,r):this.trigger(o)},f.drop=function(e){e=e||{},g.multi=!0===e.multi?1/0:!1===e.multi?1:isNaN(e.multi)?g.multi:e.multi,g.delay=e.delay||g.delay,g.tolerance=f.isFunction(e.tolerance)?e.tolerance:null===e.tolerance?null:g.tolerance,g.mode=e.mode||g.mode||\"intersect\"};var o=f.event,h=o.special,g=f.event.special.drop={multi:1,delay:20,mode:\"overlap\",targets:[],datakey:\"dropdata\",noBubble:!0,add:function(e){var t=f.data(this,g.datakey);t.related+=1},remove:function(){f.data(this,g.datakey).related-=1},setup:function(){if(!f.data(this,g.datakey)){f.data(this,g.datakey,{related:0,active:[],anyactive:0,winner:0,location:{}}),g.targets.push(this)}},teardown:function(){var e=f.data(this,g.datakey)||{};if(!e.related){f.removeData(this,g.datakey);var t=this;g.targets=f.grep(g.targets,function(e){return e!==t})}},handler:function(e,t){var n;if(t)switch(e.type){case\"mousedown\":case\"touchstart\":n=f(g.targets),\"string\"==typeof t.drop&&(n=n.filter(t.drop)),n.each(function(){var e=f.data(this,g.datakey);e.active=[],e.anyactive=0,e.winner=0}),t.droppable=n,h.drag.hijack(e,\"dropinit\",t);break;case\"mousemove\":case\"touchmove\":g.event=e,g.timer||g.tolerate(t);break;case\"mouseup\":case\"touchend\":g.timer=clearTimeout(g.timer),t.propagates&&(h.drag.hijack(e,\"drop\",t),h.drag.hijack(e,\"dropend\",t))}},locate:function(e,t){var n=f.data(e,g.datakey),o=f(e),r=o.offset()||{},i=o.outerHeight(),l=o.outerWidth(),s={elem:e,width:l,height:i,top:r.top,left:r.left,right:r.left+l,bottom:r.top+i};return n&&(n.location=s,n.index=t,n.elem=e),s},contains:function(e,t){return(t[0]||t.left)>=e.left&&(t[0]||t.right)<=e.right&&(t[1]||t.top)>=e.top&&(t[1]||t.bottom)<=e.bottom},modes:{intersect:function(e,t,n){return this.contains(n,[e.pageX,e.pageY])?1e9:this.modes.overlap.apply(this,arguments)},overlap:function(e,t,n){return Math.max(0,Math.min(n.bottom,t.bottom)-Math.max(n.top,t.top))*Math.max(0,Math.min(n.right,t.right)-Math.max(n.left,t.left))},fit:function(e,t,n){return this.contains(n,t)?1:0},middle:function(e,t,n){return this.contains(n,[t.left+.5*t.width,t.top+.5*t.height])?1:0}},sort:function(e,t){return t.winner-e.winner||e.index-t.index},tolerate:function(e){var t,n,o,r,i,l,s,a,c=0,u=e.interactions.length,d=[g.event.pageX,g.event.pageY],p=g.tolerance||g.modes[g.mode];do{if(a=e.interactions[c]){if(!a)return;a.drop=[],i=[],l=a.droppable.length,p&&(o=g.locate(a.proxy)),t=0;do{if(s=a.droppable[t]){if(r=f.data(s,g.datakey),!(n=r.location))continue;r.winner=p?p.call(g,g.event,o,n):g.contains(n,d)?1:0,i.push(r)}}while(++t<l);for(i.sort(g.sort),t=0;(r=i[t])&&(r.winner&&a.drop.length<g.multi?(r.active[c]||r.anyactive||(!1!==h.drag.hijack(g.event,\"dropstart\",e,c,r.elem)[0]?(r.active[c]=1,r.anyactive+=1):r.winner=0),r.winner&&a.drop.push(r.elem)):r.active[c]&&1==r.anyactive&&(h.drag.hijack(g.event,\"dropend\",e,c,r.elem),r.active[c]=0,r.anyactive-=1)),++t<l;);}}while(++c<u);g.last&&d[0]==g.last.pageX&&d[1]==g.last.pageY?delete g.timer:g.timer=setTimeout(function(){g.tolerate(e)},g.delay),g.last=g.event}};h.dropinit=h.dropstart=h.dropend=g},440:function(e,t,n){var d=e(444),p=e(442);t.exports={CheckboxSelectColumn:function(e){var l,t=new p.EventHandler,s={},a=d.extend(!0,{},{columnId:\"_checkbox_selector\",cssClass:null,toolTip:\"Select/Deselect All\",width:30},e);function n(e,t){var n,o,r=l.getSelectedRows(),i={};for(o=0;o<r.length;o++)n=r[o],i[n]=!0,i[n]!==s[n]&&(l.invalidateRow(n),delete s[n]);for(o in s)l.invalidateRow(o);s=i,l.render(),r.length&&r.length==l.getDataLength()?l.updateColumnHeader(a.columnId,\"<input type='checkbox' checked='checked'>\",a.toolTip):l.updateColumnHeader(a.columnId,\"<input type='checkbox'>\",a.toolTip)}function o(e,t){32==e.which&&l.getColumns()[t.cell].id===a.columnId&&(l.getEditorLock().isActive()&&!l.getEditorLock().commitCurrentEdit()||i(t.row),e.preventDefault(),e.stopImmediatePropagation())}function r(e,t){if(l.getColumns()[t.cell].id===a.columnId&&d(e.target).is(\":checkbox\")){if(l.getEditorLock().isActive()&&!l.getEditorLock().commitCurrentEdit())return e.preventDefault(),void e.stopImmediatePropagation();i(t.row),e.stopPropagation(),e.stopImmediatePropagation()}}function i(t){s[t]?l.setSelectedRows(d.grep(l.getSelectedRows(),function(e){return e!=t})):l.setSelectedRows(l.getSelectedRows().concat(t))}function c(e,t){if(t.column.id==a.columnId&&d(e.target).is(\":checkbox\")){if(l.getEditorLock().isActive()&&!l.getEditorLock().commitCurrentEdit())return e.preventDefault(),void e.stopImmediatePropagation();if(d(e.target).is(\":checked\")){for(var n=[],o=0;o<l.getDataLength();o++)n.push(o);l.setSelectedRows(n)}else l.setSelectedRows([]);e.stopPropagation(),e.stopImmediatePropagation()}}function u(e,t,n,o,r){return r?s[e]?\"<input type='checkbox' checked='checked'>\":\"<input type='checkbox'>\":null}d.extend(this,{init:function(e){l=e,t.subscribe(l.onSelectedRowsChanged,n).subscribe(l.onClick,r).subscribe(l.onHeaderClick,c).subscribe(l.onKeyDown,o)},destroy:function(){t.unsubscribeAll()},deSelectRows:function(e){var t,n=e.length,o=[];for(t=0;t<n;t++)s[e[t]]&&(o[o.length]=e[t]);l.setSelectedRows(d.grep(l.getSelectedRows(),function(e){return o.indexOf(e)<0}))},selectRows:function(e){var t,n=e.length,o=[];for(t=0;t<n;t++)s[e[t]]||(o[o.length]=e[t]);l.setSelectedRows(l.getSelectedRows().concat(o))},getColumnDefinition:function(){return{id:a.columnId,name:\"<input type='checkbox'>\",toolTip:a.toolTip,field:\"sel\",width:a.width,resizable:!1,sortable:!1,cssClass:a.cssClass,formatter:u}}})}}},441:function(e,t,n){var v=e(444),w=e(442);t.exports={RowSelectionModel:function(t){var c,n,o,u=[],r=this,i=new w.EventHandler,l={selectActiveRow:!0};function s(e){return function(){n||(n=!0,e.apply(this,arguments),n=!1)}}function d(e){for(var t=[],n=0;n<e.length;n++)for(var o=e[n].fromRow;o<=e[n].toRow;o++)t.push(o);return t}function p(e){for(var t=[],n=c.getColumns().length-1,o=0;o<e.length;o++)t.push(new w.Range(e[o],0,e[o],n));return t}function a(){return d(u)}function f(e){(u&&0!==u.length||e&&0!==e.length)&&(u=e,r.onSelectedRangesChanged.notify(u))}function h(e,t){o.selectActiveRow&&null!=t.row&&f([new w.Range(t.row,0,t.row,c.getColumns().length-1)])}function g(e){var t=c.getActiveCell();if(t&&e.shiftKey&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(38==e.which||40==e.which)){var n=a();n.sort(function(e,t){return e-t}),n.length||(n=[t.row]);var o,r=n[0],i=n[n.length-1];if(0<=(o=40==e.which?t.row<i||r==i?++i:++r:t.row<i?--i:--r)&&o<c.getDataLength()){c.scrollRowIntoView(o);var l=p(function(e,t){var n,o=[];for(n=e;n<=t;n++)o.push(n);for(n=t;n<e;n++)o.push(n);return o}(r,i));f(l)}e.preventDefault(),e.stopPropagation()}}function m(e){var n=c.getCellFromEvent(e);if(!n||!c.canCellBeActive(n.row,n.cell))return!1;if(!c.getOptions().multiSelect||!e.ctrlKey&&!e.shiftKey&&!e.metaKey)return!1;var t=d(u),o=v.inArray(n.row,t);if(-1===o&&(e.ctrlKey||e.metaKey))t.push(n.row),c.setActiveCell(n.row,n.cell);else if(-1!==o&&(e.ctrlKey||e.metaKey))t=v.grep(t,function(e,t){return e!==n.row}),c.setActiveCell(n.row,n.cell);else if(t.length&&e.shiftKey){var r=t.pop(),i=Math.min(n.row,r),l=Math.max(n.row,r);t=[];for(var s=i;s<=l;s++)s!==r&&t.push(s);t.push(r),c.setActiveCell(n.row,n.cell)}var a=p(t);return f(a),e.stopImmediatePropagation(),!0}v.extend(this,{getSelectedRows:a,setSelectedRows:function(e){f(p(e))},getSelectedRanges:function(){return u},setSelectedRanges:f,init:function(e){o=v.extend(!0,{},l,t),c=e,i.subscribe(c.onActiveCellChanged,s(h)),i.subscribe(c.onKeyDown,s(g)),i.subscribe(c.onClick,s(m))},destroy:function(){i.unsubscribeAll()},onSelectedRangesChanged:new w.Event})}}},442:function(e,t,n){function l(){var e=!1,t=!1;this.stopPropagation=function(){e=!0},this.isPropagationStopped=function(){return e},this.stopImmediatePropagation=function(){t=!0},this.isImmediatePropagationStopped=function(){return t}}function o(){this.__nonDataRow=!0}function r(){this.__group=!0,this.level=0,this.count=0,this.value=null,this.title=null,this.collapsed=!1,this.selectChecked=!1,this.totals=null,this.rows=[],this.groups=null,this.groupingKey=null}function i(){this.__groupTotals=!0,this.group=null,this.initialized=!1}function s(){var t=null;this.isActive=function(e){return e?t===e:null!==t},this.activate=function(e){if(e!==t){if(null!==t)throw new Error(\"SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController\");if(!e.commitCurrentEdit)throw new Error(\"SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()\");if(!e.cancelCurrentEdit)throw new Error(\"SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()\");t=e}},this.deactivate=function(e){if(t!==e)throw new Error(\"SlickGrid.EditorLock.deactivate: specified editController is not the currently active one\");t=null},this.commitCurrentEdit=function(){return!t||t.commitCurrentEdit()},this.cancelCurrentEdit=function(){return!t||t.cancelCurrentEdit()}}(r.prototype=new o).equals=function(e){return this.value===e.value&&this.count===e.count&&this.collapsed===e.collapsed&&this.title===e.title},i.prototype=new o,t.exports={Event:function(){var i=[];this.subscribe=function(e){i.push(e)},this.unsubscribe=function(e){for(var t=i.length-1;0<=t;t--)i[t]===e&&i.splice(t,1)},this.notify=function(e,t,n){var o;t=t||new l,n=n||this;for(var r=0;r<i.length&&!t.isPropagationStopped()&&!t.isImmediatePropagationStopped();r++)o=i[r].call(n,t,e);return o}},EventData:l,EventHandler:function(){var o=[];this.subscribe=function(e,t){return o.push({event:e,handler:t}),e.subscribe(t),this},this.unsubscribe=function(e,t){for(var n=o.length;n--;)if(o[n].event===e&&o[n].handler===t)return o.splice(n,1),void e.unsubscribe(t);return this},this.unsubscribeAll=function(){for(var e=o.length;e--;)o[e].event.unsubscribe(o[e].handler);return o=[],this}},Range:function(e,t,n,o){void 0===n&&void 0===o&&(n=e,o=t);this.fromRow=Math.min(e,n),this.fromCell=Math.min(t,o),this.toRow=Math.max(e,n),this.toCell=Math.max(t,o),this.isSingleRow=function(){return this.fromRow==this.toRow},this.isSingleCell=function(){return this.fromRow==this.toRow&&this.fromCell==this.toCell},this.contains=function(e,t){return e>=this.fromRow&&e<=this.toRow&&t>=this.fromCell&&t<=this.toCell},this.toString=function(){return this.isSingleCell()?\"(\"+this.fromRow+\":\"+this.fromCell+\")\":\"(\"+this.fromRow+\":\"+this.fromCell+\" - \"+this.toRow+\":\"+this.toCell+\")\"}},NonDataRow:o,Group:r,GroupTotals:i,EditorLock:s,GlobalEditorLock:new s,keyCode:{BACKSPACE:8,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,ESC:27,HOME:36,INSERT:45,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,RIGHT:39,TAB:9,UP:38,C:67,V:86},preClickClassName:\"slick-edit-preclick\"}},443:function _(require,module,exports){\n",
" /**\n",
" * @license\n",
" * (c) 2009-2016 Michael Leibman\n",
" * michael{dot}leibman{at}gmail{dot}com\n",
" * http://github.com/mleibman/slickgrid\n",
" *\n",
" * Distributed under MIT license.\n",
" * All rights reserved.\n",
" *\n",
" * SlickGrid v2.3\n",
" *\n",
" * NOTES:\n",
" * Cell/row DOM manipulations are done directly bypassing jQuery's DOM manipulation methods.\n",
" * This increases the speed dramatically, but can only be done safely because there are no event handlers\n",
" * or data associated with any cell/row DOM nodes. Cell editors must make sure they implement .destroy()\n",
" * and do proper cleanup.\n",
" */\n",
" var $=require(444),Slick=require(442),scrollbarDimensions,maxSupportedCssHeight;function SlickGrid(container,data,columns,options){$.fn.drag||require(438),$.fn.drop||require(439);var defaults={explicitInitialization:!1,rowHeight:25,defaultColumnWidth:80,enableAddRow:!1,leaveSpaceForNewRows:!1,editable:!1,autoEdit:!0,enableCellNavigation:!0,enableColumnReorder:!0,asyncEditorLoading:!1,asyncEditorLoadDelay:100,forceFitColumns:!1,enableAsyncPostRender:!1,asyncPostRenderDelay:50,enableAsyncPostRenderCleanup:!1,asyncPostRenderCleanupDelay:40,autoHeight:!1,editorLock:Slick.GlobalEditorLock,showHeaderRow:!1,headerRowHeight:25,createFooterRow:!1,showFooterRow:!1,footerRowHeight:25,createPreHeaderPanel:!1,showPreHeaderPanel:!1,preHeaderPanelHeight:25,showTopPanel:!1,topPanelHeight:25,formatterFactory:null,editorFactory:null,cellFlashingCssClass:\"flashing\",selectedCellCssClass:\"selected\",multiSelect:!0,enableTextSelectionOnCells:!1,dataItemColumnValueExtractor:null,fullWidthRows:!1,multiColumnSort:!1,numberedMultiColumnSort:!1,tristateMultiColumnSort:!1,defaultFormatter:defaultFormatter,forceSyncScrolling:!1,addNewRowCssClass:\"new-row\",preserveCopiedSelectionOnPaste:!1,showCellSelection:!0},columnDefaults={name:\"\",resizable:!0,sortable:!1,minWidth:30,rerenderOnResize:!1,headerCssClass:null,defaultSortAsc:!0,focusable:!0,selectable:!0},th,h,ph,n,cj,page=0,offset=0,vScrollDir=1,initialized=!1,$container,uid=\"slickgrid_\"+Math.round(1e6*Math.random()),self=this,$focusSink,$focusSink2,$headerScroller,$headers,$headerRow,$headerRowScroller,$headerRowSpacer,$footerRow,$footerRowScroller,$footerRowSpacer,$preHeaderPanel,$preHeaderPanelScroller,$preHeaderPanelSpacer,$topPanelScroller,$topPanel,$viewport,$canvas,$style,$boundAncestors,stylesheet,columnCssRulesL,columnCssRulesR,viewportH,viewportW,canvasWidth,viewportHasHScroll,viewportHasVScroll,headerColumnWidthDiff=0,headerColumnHeightDiff=0,cellWidthDiff=0,cellHeightDiff=0,jQueryNewWidthBehaviour=!1,absoluteColumnMinWidth,sortIndicatorCssClass=\"slick-sort-indicator\",tabbingDirection=1,activePosX,activeRow,activeCell,activeCellNode=null,currentEditor=null,serializedEditorValue,editController,rowsCache={},renderedRows=0,numVisibleRows,prevScrollTop=0,scrollTop=0,lastRenderedScrollTop=0,lastRenderedScrollLeft=0,prevScrollLeft=0,scrollLeft=0,selectionModel,selectedRows=[],plugins=[],cellCssClasses={},columnsById={},sortColumns=[],columnPosLeft=[],columnPosRight=[],pagingActive=!1,pagingIsLastPage=!1,h_editorLoader=null,h_render=null,h_postrender=null,h_postrenderCleanup=null,postProcessedRows={},postProcessToRow=null,postProcessFromRow=null,postProcessedCleanupQueue=[],postProcessgroupId=0,counter_rows_rendered=0,counter_rows_removed=0,rowNodeFromLastMouseWheelEvent,zombieRowNodeFromLastMouseWheelEvent,zombieRowCacheFromLastMouseWheelEvent,zombieRowPostProcessedFromLastMouseWheelEvent,cssShow={position:\"absolute\",visibility:\"hidden\",display:\"block\"},$hiddenParents,oldProps=[];function init(){if(($container=container instanceof $?container:$(container)).length<1)throw new Error(\"SlickGrid requires a valid container, \"+container+\" does not exist in the DOM.\");cacheCssForHiddenInit(),maxSupportedCssHeight=maxSupportedCssHeight||getMaxSupportedCssHeight(),scrollbarDimensions=scrollbarDimensions||measureScrollbar(),options=$.extend({},defaults,options),validateAndEnforceOptions(),columnDefaults.width=options.defaultColumnWidth,columnsById={};for(var e=0;e<columns.length;e++){var t=columns[e]=$.extend({},columnDefaults,columns[e]);columnsById[t.id]=e,t.minWidth&&t.width<t.minWidth&&(t.width=t.minWidth),t.maxWidth&&t.width>t.maxWidth&&(t.width=t.maxWidth)}if(options.enableColumnReorder&&!$.fn.sortable)throw new Error(\"SlickGrid's 'enableColumnReorder = true' option requires jquery-ui.sortable module to be loaded\");editController={commitCurrentEdit:commitCurrentEdit,cancelCurrentEdit:cancelCurrentEdit},$container.empty().css(\"overflow\",\"hidden\").css(\"outline\",0).addClass(uid).addClass(\"ui-widget\"),/relative|absolute|fixed/.test($container.css(\"position\"))||$container.css(\"position\",\"relative\"),$focusSink=$(\"<div tabIndex='0' hideFocus style='position:fixed;width:0;height:0;top:0;left:0;outline:0;'></div>\").appendTo($container),options.createPreHeaderPanel&&($preHeaderPanelScroller=$(\"<div class='slick-preheader-panel ui-state-default' style='overflow:hidden;position:relative;' />\").appendTo($container),$preHeaderPanel=$(\"<div />\").appendTo($preHeaderPanelScroller),$preHeaderPanelSpacer=$(\"<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>\").css(\"width\",getCanvasWidth()+scrollbarDimensions.width+\"px\").appendTo($preHeaderPanelScroller),options.showPreHeaderPanel||$preHeaderPanelScroller.hide()),$headerScroller=$(\"<div class='slick-header ui-state-default' style='overflow:hidden;position:relative;' />\").appendTo($container),($headers=$(\"<div class='slick-header-columns' style='left:-1000px' />\").appendTo($headerScroller)).width(getHeadersWidth()),$headerRowScroller=$(\"<div class='slick-headerrow ui-state-default' style='overflow:hidden;position:relative;' />\").appendTo($container),$headerRow=$(\"<div class='slick-headerrow-columns' />\").appendTo($headerRowScroller),$headerRowSpacer=$(\"<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>\").css(\"width\",getCanvasWidth()+scrollbarDimensions.width+\"px\").appendTo($headerRowScroller),$topPanelScroller=$(\"<div class='slick-top-panel-scroller ui-state-default' style='overflow:hidden;position:relative;' />\").appendTo($container),$topPanel=$(\"<div class='slick-top-panel' style='width:10000px' />\").appendTo($topPanelScroller),options.showTopPanel||$topPanelScroller.hide(),options.showHeaderRow||$headerRowScroller.hide(),($viewport=$(\"<div class='slick-viewport' style='width:100%;overflow:auto;outline:0;position:relative;;'>\").appendTo($container)).css(\"overflow-y\",options.autoHeight?\"hidden\":\"auto\"),$canvas=$(\"<div class='grid-canvas' />\").appendTo($viewport),options.createFooterRow&&($footerRowScroller=$(\"<div class='slick-footerrow ui-state-default' style='overflow:hidden;position:relative;' />\").appendTo($container),$footerRow=$(\"<div class='slick-footerrow-columns' />\").appendTo($footerRowScroller),$footerRowSpacer=$(\"<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>\").css(\"width\",getCanvasWidth()+scrollbarDimensions.width+\"px\").appendTo($footerRowScroller),options.showFooterRow||$footerRowScroller.hide()),options.numberedMultiColumnSort&&(sortIndicatorCssClass=\"slick-sort-indicator-numbered\"),$focusSink2=$focusSink.clone().appendTo($container),options.explicitInitialization||finishInitialization()}function finishInitialization(){initialized||(initialized=!0,viewportW=parseFloat($.css($container[0],\"width\",!0)),measureCellPaddingAndBorder(),disableSelection($headers),options.enableTextSelectionOnCells||$viewport.on(\"selectstart.ui\",function(e){return $(e.target).is(\"input,textarea\")}),updateColumnCaches(),createColumnHeaders(),setupColumnSort(),createCssRules(),resizeCanvas(),bindAncestorScrollEvents(),$container.on(\"resize.slickgrid\",resizeCanvas),$viewport.on(\"scroll\",handleScroll),$headerScroller.on(\"contextmenu\",handleHeaderContextMenu).on(\"click\",handleHeaderClick).on(\"mouseenter\",\".slick-header-column\",handleHeaderMouseEnter).on(\"mouseleave\",\".slick-header-column\",handleHeaderMouseLeave),$headerRowScroller.on(\"scroll\",handleHeaderRowScroll),options.createFooterRow&&$footerRowScroller.on(\"scroll\",handleFooterRowScroll),options.createPreHeaderPanel&&$preHeaderPanelScroller.on(\"scroll\",handlePreHeaderPanelScroll),$focusSink.add($focusSink2).on(\"keydown\",handleKeyDown),$canvas.on(\"keydown\",handleKeyDown).on(\"click\",handleClick).on(\"dblclick\",handleDblClick).on(\"contextmenu\",handleContextMenu).on(\"draginit\",handleDragInit).on(\"dragstart\",{distance:3},handleDragStart).on(\"drag\",handleDrag).on(\"dragend\",handleDragEnd).on(\"mouseenter\",\".slick-cell\",handleMouseEnter).on(\"mouseleave\",\".slick-cell\",handleMouseLeave),navigator.userAgent.toLowerCase().match(/webkit/)&&navigator.userAgent.toLowerCase().match(/macintosh/)&&$canvas.on(\"mousewheel\",handleMouseWheel),restoreCssFromHiddenInit())}function cacheCssForHiddenInit(){($hiddenParents=$container.parents().addBack().not(\":visible\")).each(function(){var e={};for(var t in cssShow)e[t]=this.style[t],this.style[t]=cssShow[t];oldProps.push(e)})}function restoreCssFromHiddenInit(){$hiddenParents.each(function(e){var t=oldProps[e];for(var n in cssShow)this.style[n]=t[n]})}function registerPlugin(e){plugins.unshift(e),e.init(self)}function unregisterPlugin(e){for(var t=plugins.length;0<=t;t--)if(plugins[t]===e){plugins[t].destroy&&plugins[t].destroy(),plugins.splice(t,1);break}}function setSelectionModel(e){selectionModel&&(selectionModel.onSelectedRangesChanged.unsubscribe(handleSelectedRangesChanged),selectionModel.destroy&&selectionModel.destroy()),(selectionModel=e)&&(selectionModel.init(self),selectionModel.onSelectedRangesChanged.subscribe(handleSelectedRangesChanged))}function getSelectionModel(){return selectionModel}function getCanvasNode(){return $canvas[0]}function measureScrollbar(){var e=$(\"<div style='position:absolute; top:-10000px; left:-10000px; width:100px; height:100px; overflow:scroll;'></div>\").appendTo(\"body\"),t={width:e.width()-e[0].clientWidth,height:e.height()-e[0].clientHeight};return e.remove(),t}function getColumnTotalWidth(e){for(var t=0,n=0,o=columns.length;n<o;n++){var r=columns[n].width;t+=r}return e&&(t+=scrollbarDimensions.width),t}function getHeadersWidth(){var e=getColumnTotalWidth(!0);return Math.max(e,viewportW)+1e3}function getCanvasWidth(){for(var e=viewportHasVScroll?viewportW-scrollbarDimensions.width:viewportW,t=0,n=columns.length;n--;)t+=columns[n].width;return options.fullWidthRows?Math.max(t,e):t}function updateCanvasWidth(e){var t=canvasWidth;(canvasWidth=getCanvasWidth())!=t&&($canvas.width(canvasWidth),$headerRow.width(canvasWidth),options.createFooterRow&&$footerRow.width(canvasWidth),options.createPreHeaderPanel&&$preHeaderPanel.width(canvasWidth),$headers.width(getHeadersWidth()),viewportHasHScroll=canvasWidth>viewportW-scrollbarDimensions.width);var n=canvasWidth+(viewportHasVScroll?scrollbarDimensions.width:0);$headerRowSpacer.width(n),options.createFooterRow&&$footerRowSpacer.width(n),options.createPreHeaderPanel&&$preHeaderPanelSpacer.width(n),(canvasWidth!=t||e)&&applyColumnWidths()}function disableSelection(e){e&&e.jquery&&e.attr(\"unselectable\",\"on\").css(\"MozUserSelect\",\"none\").on(\"selectstart.ui\",function(){return!1})}function getMaxSupportedCssHeight(){for(var e=1e6,t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,n=$(\"<div style='display:none' />\").appendTo(document.body);;){var o=2*e;if(n.css(\"height\",o),t<o||n.height()!==o)break;e=o}return n.remove(),e}function getUID(){return uid}function getHeaderColumnWidthDiff(){return headerColumnWidthDiff}function getScrollbarDimensions(){return scrollbarDimensions}function bindAncestorScrollEvents(){for(var e=$canvas[0];(e=e.parentNode)!=document.body&&null!=e;)if(e==$viewport[0]||e.scrollWidth!=e.clientWidth||e.scrollHeight!=e.clientHeight){var t=$(e);$boundAncestors=$boundAncestors?$boundAncestors.add(t):t,t.on(\"scroll.\"+uid,handleActiveCellPositionChange)}}function unbindAncestorScrollEvents(){$boundAncestors&&($boundAncestors.off(\"scroll.\"+uid),$boundAncestors=null)}function updateColumnHeader(e,t,n){if(initialized){var o=getColumnIndex(e);if(null!=o){var r=columns[o],i=$headers.children().eq(o);i&&(void 0!==t&&(columns[o].name=t),void 0!==n&&(columns[o].toolTip=n),trigger(self.onBeforeHeaderCellDestroy,{node:i[0],column:r,grid:self}),i.attr(\"title\",n||\"\").children().eq(0).html(t),trigger(self.onHeaderCellRendered,{node:i[0],column:r,grid:self}))}}}function getHeaderRow(){return $headerRow[0]}function getFooterRow(){return $footerRow[0]}function getPreHeaderPanel(){return $preHeaderPanel[0]}function getHeaderRowColumn(e){var t=getColumnIndex(e),n=$headerRow.children().eq(t);return n&&n[0]}function getFooterRowColumn(e){var t=getColumnIndex(e),n=$footerRow.children().eq(t);return n&&n[0]}function createColumnHeaders(){function e(){$(this).addClass(\"ui-state-hover\")}function t(){$(this).removeClass(\"ui-state-hover\")}$headers.find(\".slick-header-column\").each(function(){var e=$(this).data(\"column\");e&&trigger(self.onBeforeHeaderCellDestroy,{node:this,column:e,grid:self})}),$headers.empty(),$headers.width(getHeadersWidth()),$headerRow.find(\".slick-headerrow-column\").each(function(){var e=$(this).data(\"column\");e&&trigger(self.onBeforeHeaderRowCellDestroy,{node:this,column:e,grid:self})}),$headerRow.empty(),options.createFooterRow&&($footerRow.find(\".slick-footerrow-column\").each(function(){var e=$(this).data(\"column\");e&&trigger(self.onBeforeFooterRowCellDestroy,{node:this,column:e})}),$footerRow.empty());for(var n=0;n<columns.length;n++){var o=columns[n],r=$(\"<div class='ui-state-default slick-header-column' />\").html(\"<span class='slick-column-name'>\"+o.name+\"</span>\").width(o.width-headerColumnWidthDiff).attr(\"id\",\"\"+uid+o.id).attr(\"title\",o.toolTip||\"\").data(\"column\",o).addClass(o.headerCssClass||\"\").appendTo($headers);if((options.enableColumnReorder||o.sortable)&&r.on(\"mouseenter\",e).on(\"mouseleave\",t),o.sortable&&(r.addClass(\"slick-header-sortable\"),r.append(\"<span class='\"+sortIndicatorCssClass+\"' />\")),trigger(self.onHeaderCellRendered,{node:r[0],column:o,grid:self}),options.showHeaderRow){var i=$(\"<div class='ui-state-default slick-headerrow-column l\"+n+\" r\"+n+\"'></div>\").data(\"column\",o).appendTo($headerRow);trigger(self.onHeaderRowCellRendered,{node:i[0],column:o,grid:self})}if(options.createFooterRow&&options.showFooterRow){var l=$(\"<div class='ui-state-default slick-footerrow-column l\"+n+\" r\"+n+\"'></div>\").data(\"column\",o).appendTo($footerRow);trigger(self.onFooterRowCellRendered,{node:l[0],column:o})}}setSortColumns(sortColumns),setupColumnResize(),options.enableColumnReorder&&(\"function\"==typeof options.enableColumnReorder?options.enableColumnReorder(self,$headers,headerColumnWidthDiff,setColumns,setupColumnResize,columns,getColumnIndex,uid,trigger):setupColumnReorder())}function setupColumnSort(){$headers.click(function(e){if(e.metaKey=e.metaKey||e.ctrlKey,!$(e.target).hasClass(\"slick-resizable-handle\")){var t=$(e.target).closest(\".slick-header-column\");if(t.length){var n=t.data(\"column\");if(n.sortable){if(!getEditorLock().commitCurrentEdit())return;for(var o=null,r=0;r<sortColumns.length;r++)if(sortColumns[r].columnId==n.id){(o=sortColumns[r]).sortAsc=!o.sortAsc;break}var i=!!o;options.tristateMultiColumnSort?(o||(o={columnId:n.id,sortAsc:n.defaultSortAsc}),i&&o.sortAsc&&(sortColumns.splice(r,1),o=null),options.multiColumnSort||(sortColumns=[]),!o||i&&options.multiColumnSort||sortColumns.push(o)):e.metaKey&&options.multiColumnSort?o&&sortColumns.splice(r,1):((e.shiftKey||e.metaKey)&&options.multiColumnSort||(sortColumns=[]),o?0==sortColumns.length&&sortColumns.push(o):(o={columnId:n.id,sortAsc:n.defaultSortAsc},sortColumns.push(o))),setSortColumns(sortColumns),0<sortColumns.length&&(options.multiColumnSort?trigger(self.onSort,{multiColumnSort:!0,sortCols:$.map(sortColumns,function(e){return{sortCol:columns[getColumnIndex(e.columnId)],sortAsc:e.sortAsc}}),grid:self},e):trigger(self.onSort,{multiColumnSort:!1,sortCol:n,sortAsc:sortColumns[0].sortAsc,grid:self},e))}}}})}function setupColumnReorder(){$headers.filter(\":ui-sortable\").sortable(\"destroy\"),$headers.sortable({containment:\"parent\",distance:3,axis:\"x\",cursor:\"default\",tolerance:\"intersection\",helper:\"clone\",placeholder:\"slick-sortable-placeholder ui-state-default slick-header-column\",start:function(e,t){t.placeholder.width(t.helper.outerWidth()-headerColumnWidthDiff),$(t.helper).addClass(\"slick-header-column-active\")},beforeStop:function(e,t){$(t.helper).removeClass(\"slick-header-column-active\")},stop:function(e){if(getEditorLock().commitCurrentEdit()){for(var t=$headers.sortable(\"toArray\"),n=[],o=0;o<t.length;o++)n.push(columns[getColumnIndex(t[o].replace(uid,\"\"))]);setColumns(n),trigger(self.onColumnsReordered,{grid:self}),e.stopPropagation(),setupColumnResize()}else $(this).sortable(\"cancel\")}})}function setupColumnResize(){var s,a,c,u,d,p,n,o;(u=$headers.children()).find(\".slick-resizable-handle\").remove(),u.each(function(e,t){e>=columns.length||columns[e].resizable&&(void 0===n&&(n=e),o=e)}),void 0!==n&&u.each(function(l,e){l>=columns.length||l<n||options.forceFitColumns&&o<=l||($(e),$(\"<div class='slick-resizable-handle' />\").appendTo(e).on(\"dragstart\",function(e,t){if(!getEditorLock().commitCurrentEdit())return!1;c=e.pageX,$(this).parent().addClass(\"slick-header-column-active\");var n=null,o=null;if(u.each(function(e,t){e>=columns.length||(columns[e].previousWidth=$(t).outerWidth())}),options.forceFitColumns)for(o=n=0,s=l+1;s<columns.length;s++)(a=columns[s]).resizable&&(null!==o&&(a.maxWidth?o+=a.maxWidth-a.previousWidth:o=null),n+=a.previousWidth-Math.max(a.minWidth||0,absoluteColumnMinWidth));var r=0,i=0;for(s=0;s<=l;s++)(a=columns[s]).resizable&&(null!==i&&(a.maxWidth?i+=a.maxWidth-a.previousWidth:i=null),r+=a.previousWidth-Math.max(a.minWidth||0,absoluteColumnMinWidth));null===n&&(n=1e5),null===r&&(r=1e5),null===o&&(o=1e5),null===i&&(i=1e5),p=c+Math.min(n,i),d=c-Math.min(r,o)}).on(\"drag\",function(e,t){var n,o,r=Math.min(p,Math.max(d,e.pageX))-c;if(r<0){for(o=r,s=l;0<=s;s--)(a=columns[s]).resizable&&(n=Math.max(a.minWidth||0,absoluteColumnMinWidth),o&&a.previousWidth+o<n?(o+=a.previousWidth-n,a.width=n):(a.width=a.previousWidth+o,o=0));if(options.forceFitColumns)for(o=-r,s=l+1;s<columns.length;s++)(a=columns[s]).resizable&&(o&&a.maxWidth&&a.maxWidth-a.previousWidth<o?(o-=a.maxWidth-a.previousWidth,a.width=a.maxWidth):(a.width=a.previousWidth+o,o=0))}else{for(o=r,s=l;0<=s;s--)(a=columns[s]).resizable&&(o&&a.maxWidth&&a.maxWidth-a.previousWidth<o?(o-=a.maxWidth-a.previousWidth,a.width=a.maxWidth):(a.width=a.previousWidth+o,o=0));if(options.forceFitColumns)for(o=-r,s=l+1;s<columns.length;s++)(a=columns[s]).resizable&&(n=Math.max(a.minWidth||0,absoluteColumnMinWidth),o&&a.previousWidth+o<n?(o+=a.previousWidth-n,a.width=n):(a.width=a.previousWidth+o,o=0))}applyColumnHeaderWidths(),options.syncColumnCellResize&&applyColumnWidths()}).on(\"dragend\",function(e,t){var n;for($(this).parent().removeClass(\"slick-header-column-active\"),s=0;s<columns.length;s++)a=columns[s],n=$(u[s]).outerWidth(),a.previousWidth!==n&&a.rerenderOnResize&&invalidateAllRows();updateCanvasWidth(!0),render(),trigger(self.onColumnsResized,{grid:self})}))})}function getVBoxDelta(n){var o=0;return $.each([\"borderTopWidth\",\"borderBottomWidth\",\"paddingTop\",\"paddingBottom\"],function(e,t){o+=parseFloat(n.css(t))||0}),o}function measureCellPaddingAndBorder(){var n,e=[\"borderLeftWidth\",\"borderRightWidth\",\"paddingLeft\",\"paddingRight\"],t=[\"borderTopWidth\",\"borderBottomWidth\",\"paddingTop\",\"paddingBottom\"],o=$.fn.jquery.split(\".\");jQueryNewWidthBehaviour=1==o[0]&&8<=o[1]||2<=o[0],n=$(\"<div class='ui-state-default slick-header-column' style='visibility:hidden'>-</div>\").appendTo($headers),headerColumnWidthDiff=headerColumnHeightDiff=0,\"border-box\"!=n.css(\"box-sizing\")&&\"border-box\"!=n.css(\"-moz-box-sizing\")&&\"border-box\"!=n.css(\"-webkit-box-sizing\")&&($.each(e,function(e,t){headerColumnWidthDiff+=parseFloat(n.css(t))||0}),$.each(t,function(e,t){headerColumnHeightDiff+=parseFloat(n.css(t))||0})),n.remove();var r=$(\"<div class='slick-row' />\").appendTo($canvas);n=$(\"<div class='slick-cell' id='' style='visibility:hidden'>-</div>\").appendTo(r),cellWidthDiff=cellHeightDiff=0,\"border-box\"!=n.css(\"box-sizing\")&&\"border-box\"!=n.css(\"-moz-box-sizing\")&&\"border-box\"!=n.css(\"-webkit-box-sizing\")&&($.each(e,function(e,t){cellWidthDiff+=parseFloat(n.css(t))||0}),$.each(t,function(e,t){cellHeightDiff+=parseFloat(n.css(t))||0})),r.remove(),absoluteColumnMinWidth=Math.max(headerColumnWidthDiff,cellWidthDiff)}function createCssRules(){$style=$(\"<style type='text/css' rel='stylesheet' />\").appendTo($(\"head\"));for(var e=options.rowHeight-cellHeightDiff,t=[\".\"+uid+\" .slick-header-column { left: 1000px; }\",\".\"+uid+\" .slick-top-panel { height:\"+options.topPanelHeight+\"px; }\",\".\"+uid+\" .slick-preheader-panel { height:\"+options.preHeaderPanelHeight+\"px; }\",\".\"+uid+\" .slick-headerrow-columns { height:\"+options.headerRowHeight+\"px; }\",\".\"+uid+\" .slick-footerrow-columns { height:\"+options.footerRowHeight+\"px; }\",\".\"+uid+\" .slick-cell { height:\"+e+\"px; }\",\".\"+uid+\" .slick-row { height:\"+options.rowHeight+\"px; }\"],n=0;n<columns.length;n++)t.push(\".\"+uid+\" .l\"+n+\" { }\"),t.push(\".\"+uid+\" .r\"+n+\" { }\");$style[0].styleSheet?$style[0].styleSheet.cssText=t.join(\" \"):$style[0].appendChild(document.createTextNode(t.join(\" \")))}function getColumnCssRules(e){var t;if(!stylesheet){var n=document.styleSheets;for(t=0;t<n.length;t++)if((n[t].ownerNode||n[t].owningElement)==$style[0]){stylesheet=n[t];break}if(!stylesheet)throw new Error(\"Cannot find stylesheet.\");columnCssRulesL=[],columnCssRulesR=[];var o,r,i=stylesheet.cssRules||stylesheet.rules;for(t=0;t<i.length;t++){var l=i[t].selectorText;(o=/\\.l\\d+/.exec(l))?(r=parseInt(o[0].substr(2,o[0].length-2),10),columnCssRulesL[r]=i[t]):(o=/\\.r\\d+/.exec(l))&&(r=parseInt(o[0].substr(2,o[0].length-2),10),columnCssRulesR[r]=i[t])}}return{left:columnCssRulesL[e],right:columnCssRulesR[e]}}function removeCssRules(){$style.remove(),stylesheet=null}function destroy(){getEditorLock().cancelCurrentEdit(),trigger(self.onBeforeDestroy,{grid:self});for(var e=plugins.length;e--;)unregisterPlugin(plugins[e]);options.enableColumnReorder&&$headers.filter(\":ui-sortable\").sortable(\"destroy\"),unbindAncestorScrollEvents(),$container.off(\".slickgrid\"),removeCssRules(),$canvas.off(\"draginit dragstart dragend drag\"),$container.empty().removeClass(uid)}function trigger(e,t,n){return n=n||new Slick.EventData,(t=t||{}).grid=self,e.notify(t,n,self)}function getEditorLock(){return options.editorLock}function getEditController(){return editController}function getColumnIndex(e){return columnsById[e]}function autosizeColumns(){var e,t,n,o=[],r=0,i=0,l=viewportHasVScroll?viewportW-scrollbarDimensions.width:viewportW;for(e=0;e<columns.length;e++)t=columns[e],o.push(t.width),i+=t.width,t.resizable&&(r+=t.width-Math.max(t.minWidth,absoluteColumnMinWidth));for(n=i;l<i&&r;){var s=(i-l)/r;for(e=0;e<columns.length&&l<i;e++){t=columns[e];var a=o[e];if(!(!t.resizable||a<=t.minWidth||a<=absoluteColumnMinWidth)){var c=Math.max(t.minWidth,absoluteColumnMinWidth),u=Math.floor(s*(a-c))||1;u=Math.min(u,a-c),i-=u,r-=u,o[e]-=u}}if(n<=i)break;n=i}for(n=i;i<l;){var d=l/i;for(e=0;e<columns.length&&i<l;e++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment