PageSourceSearch

https://marqo-clip-benchmarks.hf.space/static/js/6737.20dd8dd6.chunk.js

js marqo-clip-benchmarks.hf.space collected 2026-10-03 10:19:57 UTC 998,654 bytes, 2 lines download raw bytes

1/*! For license information please see 6737.20dd8dd6.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6737],{66737:function(e,t,n){n.r(t),n.d(t,{default:function(){return M}});var i=n(66845),r=n(82673),a=n(62173);function o(e){if(null==e)throw new TypeError("Cannot destructure "+e)}var s=n(19113),l=n(79894),u=n(64649);function c(e,t,n,i){return c="undefined"!==typeof Reflect&&Reflect.set?Reflect.set:function(e,t,n,i){var r,a=(0,l.Z)(e,t);if(a){if((r=Object.getOwnPropertyDescriptor(a,t)).set)return r.set.call(i,n),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(i,t)){if(!r.writable)return!1;r.value=n,Object.defineProperty(i,t,r)}else(0,u.Z)(i,t,n);return!0},c(e,t,n,i)}function h(e,t,n,i,r){if(!c(e,t,n,i||e)&&r)throw new TypeError("failed to set property");return n}var _=n(83138),d=n(27597),f=n(47169),v=n(67591),p=n(94337),m=n(90434),y=n(649),g=n(22951),b=n(91976),w=n(60726),x=n(11092),k=n(11026),Z=n(27791),A=function(e,t,n,i){void 0===n&&(n={}),void 0===i&&(i={});var r={},a=function t(a){var o=r[a];if(!o){var s=function(e){if("number"===typeof e)return e;if("bokehjs"===e)return 0;if(!i[e]){var t="@bokehjs/";e.slice(0,9)===t&&(e=e.slice(9))}var r=n[e];if(null!=r)return r;var a=e.length>0&&"/"===e[e.lenght-1],o=n[e+(a?"":"/")+"index"];return null!=o?o:e}(a);if(o=r[s])r[a]=o;else{if(!e[s]){if(!1===i[s]||1==i[s]&&parent_require)try{return o={exports:i[s]?parent_require(s):{}},r[s]=r[a]=o,o.exports}catch(u){}var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}o={exports:{}},r[s]=r[a]=o,e[s].call(o.exports,t,o,o.exports,(function(){Object.defineProperty(o.exports,"__esModule",{value:!0})}),(function(e,t){Object.defineProperty(o.exports,e,{enumerable:!0,get:function(){return t}})}))}}return o.exports};a.resolve=function(e){return""};var o=a(0);return o.require=a,"undefined"!==typeof Proxy&&(o.loader=new Proxy({},{get:function(e,t){return a(t)}})),o.register_plugin=function(t,r,s,l){for(var u in void 0===s&&(s={}),void 0===l&&(l={}),t)e[u]=t[u];for(var c in s)n[c]=s[c];for(var h in l)i[h]=l[h];var _=a(r);for(var d in _)o[d]=_[d];return _},o}([function(e,t,n,i,r){i(),(0,e(1).__exportStar)(e(2),n)},function(e,t,n,i,r){i();var a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},a(e,t)};function o(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}function l(e){return this instanceof l?(this.v=e,this):new l(e)}n.__extends=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},n.__assign=function(){return n.__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.__assign.apply(this,arguments)},n.__rest=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n},n.__decorate=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},n.__param=function(e,t){return function(n,i){t(n,i,e)}},n.__metadata=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}
vendor: 3,539 bytes, line 2
2,n.__awaiter=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function o(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((i=i.apply(e,t||[])).next())}))},n.__generator=function(e,t){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},n.__createBinding=Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]},n.__exportStar=function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||(0,n.__createBinding)(t,e,i)},n.__values=o,n.__read=s,n.__spread=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e},n.__spreadArrays=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,r++)i[r]=a[o];return i},n.__spreadArray=function(e,t,n){if(n||2===arguments.length)for(var i,r=0,a=t.length;r<a;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},n.__await=l,n.__asyncGenerator=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=n.apply(e,t||[]),a=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(e){r[e]&&(i[e]=function(t){return new Promise((function(n,i){a.push([e,t,n,i])>1||s(e,t)}))})}function s(e,t){try{(n=r[e](t)).value instanceof l?Promise.resolve(n.value.v).then(u,c):h(a[0][2],n)}catch(e){h(a[0][3],e)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function h(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}},n.__asyncDelegator=function(e){var t,n;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,r){t[i]=e[i]?function(t){return(n=!n)?{value:l(e[i](t)),done:"return"===i}:r?r(t):t}:r}},n.__asyncValues=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=o(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,r){!function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)}(i,r,(t=e[n](t)).done,t.value)}))}}}
2,n.__makeTemplateObject=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};var u=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};n.__importStar=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&(0,n.__createBinding)(t,e,i);return u(t,e),t},n.__importDefault=function(e){return e&&e.__esModule?e:{default:e}},n.__classPrivateFieldGet=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},n.__classPrivateFieldSet=function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n}},function(e,t,n,i,r){i();var a=e(1);r("version",e(3).version),r("index",e(4).index),n.embed=(0,a.__importStar)(e(4)),n.protocol=(0,a.__importStar)(e(406)),n._testing=(0,a.__importStar)(e(407));var o=e(19);r("logger",o.logger),r("set_log_level",o.set_log_level),r("settings",e(28).settings),r("Models",e(7).Models),r("documents",e(5).documents),r("safely",e(408).safely)},function(e,t,n,i,r){i(),n.version="2.4.3"},function(e,t,n,i,r){i();var a=e(5),o=e(19),s=e(34),l=e(13),c=e(8),h=e(16),_=e(397),d=e(399),f=e(398),v=e(397);r("add_document_standalone",v.add_document_standalone),r("index",v.index),r("add_document_from_session",e(399).add_document_from_session);var p=e(404);function m(e,t,n,i){return y.apply(this,arguments)}function y(){return y=(0,Z.Z)((0,x.Z)().mark((function e(t,n,i,r){var u,h,v,p,m,y,g,b,Z,A,S,T,M;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(0,c.isString)(t)&&(t=JSON.parse((0,s.unescape)(t))),u={},h=(0,w.Z)((0,l.entries)(t));try{for(h.s();!(v=h.n()).done;)p=(0,k.Z)(v.value,2),m=p[0],y=p[1],u[m]=a.Document.from_json(y)}catch(x){h.e(x)}finally{h.f()}g=[],b=(0,w.Z)(n),e.prev=6,b.s();case 8:if((Z=b.n()).done){e.next=37;break}if(A=Z.value,S=(0,f._resolve_element)(A),T=(0,f._resolve_root_elements)(A),null==A.docid){e.next=19;break}return e.t0=g,e.next=15,(0,_.add_document_standalone)(u[A.docid],S,T,A.use_for_title);case 15:e.t1=e.sent,e.t0.push.call(e.t0,e.t1),e.next=35;break;case 19:if(null!=A.token){e.next=21;break}throw new Error("Error rendering Bokeh items: either 'docid' or 'token' was expected.");case 21:return M=(0,d._get_ws_url)(i,r),o.logger.debug("embed: computed ws url: ".concat(M)),e.prev=23,e.t2=g,e.next=27,(0,d.add_document_from_session)(M,A.token,S,T,A.use_for_title);case 27:e.t3=e.sent,e.t2.push.call(e.t2,e.t3),console.log("Bokeh items were rendered successfully"),e.next=35;break;case 32:e.prev=32,e.t4=e.catch(23),console.log("Error rendering Bokeh items:",e.t4);case 35:e.next=8;break;case 37:e.next=42;break;case 39:e.prev=39,e.t5=e.catch(6),b.e(e.t5);case 42:return e.prev=42,b.f(),e.finish(42);case 45:return e.abrupt("return",g);case 46:case"end":return e.stop()}}),e,null,[[6,39,42,45],[23,32]])}))),y.apply(this,arguments)}r("embed_items_notebook",p.embed_items_notebook),r("kernels",p.kernels),r("BOKEH_ROOT",e(398).BOKEH_ROOT),n.embed_item=function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(t,n){var i,r,a,o,l,c,_;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={},r=(0,s.uuid4)(),i[r]=t.doc,null==n&&(n=t.target_id),null!=(a=document.getElementById(n))&&a.classList.add(f.BOKEH_ROOT),o={roots:(0,u.Z)({},t.root_id,n),root_ids:[t.root_id],docid:r},e.next=7,(0,h.defer)();case 7:return e.next=9,m(i,[o]);case 9:return l=e.sent,c=(0,k.Z)(l,1),_=c[0],e.abrupt("return",_);case 13:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),n.embed_items=function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(t,n,i,r){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,h.defer)();case 2:return e.abrupt("return",m(t,n,i,r));case 3:case"end":return e.stop()}}),e)})));return function(t,n,i,r){return e.apply(this,arguments)}}()},function(e,t,n,i,r){i();var a=e(1);(0,a.__exportStar)(e(6),n),(0,a.__exportStar)(e(35),n)},function(e,t,n,i,r){i();var a=e(1),o=e(7),s=e(3),l=e(19),c=e(251),h=e(14),_=e(30),d=e(15),f=e(17),v=e(31),p=e(29),m=e(9),x=e(13),Z=(0,a.__importStar)(e(77)),A=e(26),S=e(8),T=e(309),M=e(75),C=e(53),z=e(396),E=e(35),R=function(){function e(t){(0,g.Z)(this,e),this.document=t,this.session=null,this.subscribed_models=new Set}return(0,b.Z)(e,[{key:"send_event",value:function(e){var t=new E.MessageSentEvent(this.document,"bokeh_event",e.to_json());this.document._trigger_on_change(t)}
2},{key:"trigger",value:function(e){var t,n=(0,w.Z)(this.subscribed_models);try{for(n.s();!(t=n.n()).done;){var i=t.value;null!=e.origin&&e.origin!=i||i._process_event(e)}}catch(r){n.e(r)}finally{n.f()}}}]),e}();n.EventManager=R,R.__name__="EventManager",n.documents=[],n.DEFAULT_TITLE="Bokeh Application";var B=function(){function e(t){var i;(0,g.Z)(this,e),n.documents.push(this),this._init_timestamp=Date.now(),this._resolver=null!==(i=null==t?void 0:t.resolver)&&void 0!==i?i:new o.ModelResolver,this._title=n.DEFAULT_TITLE,this._roots=[],this._all_models=new Map,this._all_models_freeze_count=0,this._callbacks=new Map,this._message_callbacks=new Map,this.event_manager=new R(this),this.idle=new d.Signal0(this,"idle"),this._idle_roots=new WeakMap,this._interactive_timestamp=null,this._interactive_plot=null}return(0,b.Z)(e,[{key:"layoutables",get:function(){return this._roots.filter((function(e){return e instanceof T.LayoutDOM}))}},{key:"is_idle",get:function(){var e,t=(0,w.Z)(this.layoutables);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(!this._idle_roots.has(n))return!1}}catch(i){t.e(i)}finally{t.f()}return!0}},{key:"notify_idle",value:function(e){this._idle_roots.set(e,!0),this.is_idle&&(l.logger.info("document idle at ".concat(Date.now()-this._init_timestamp," ms")),this.event_manager.send_event(new c.DocumentReady),this.idle.emit())}},{key:"clear",value:function(){this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}}},{key:"interactive_start",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;null==this._interactive_plot&&(this._interactive_plot=e,this._interactive_plot.trigger_event(new c.LODStart)),this._interactive_finalize=t,this._interactive_timestamp=Date.now()}},{key:"interactive_stop",value:function(){null!=this._interactive_plot&&(this._interactive_plot.trigger_event(new c.LODEnd),null!=this._interactive_finalize&&this._interactive_finalize()),this._interactive_plot=null,this._interactive_timestamp=null,this._interactive_finalize=null}},{key:"interactive_duration",value:function(){return null==this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp}},{key:"destructively_move",value:function(e){if(e===this)throw new Error("Attempted to overwrite a document with itself");e.clear();var t=(0,m.copy)(this._roots);this.clear();var n,i=(0,w.Z)(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(null!=r.document)throw new Error("Somehow we didn't detach ".concat(r))}}catch(l){i.e(l)}finally{i.f()}if(0!=this._all_models.size)throw new Error("this._all_models still had stuff in it: ".concat(this._all_models));var a,o=(0,w.Z)(t);try{for(o.s();!(a=o.n()).done;){var s=a.value;e.add_root(s)}}catch(l){o.e(l)}finally{o.f()}e.set_title(this._title)}},{key:"_push_all_models_freeze",value:function(){this._all_models_freeze_count+=1}},{key:"_pop_all_models_freeze",value:function(){this._all_models_freeze_count-=1,0===this._all_models_freeze_count&&this._recompute_all_models()}},{key:"_invalidate_all_models",value:function(){l.logger.debug("invalidating document models"),0===this._all_models_freeze_count&&this._recompute_all_models()}},{key:"_recompute_all_models",value:function(){var e,t=new Set,n=(0,w.Z)(this._roots);try{for(n.s();!(e=n.n()).done;){var i=e.value;t=Z.union(t,i.references())}}catch(v){n.e(v)}finally{n.f()}var r,a=new Set(this._all_models.values()),o=Z.difference(a,t),s=Z.difference(t,a),l=new Map,u=(0,w.Z)(t);try{for(u.s();!(r=u.n()).done;){var c=r.value;l.set(c.id,c)}}catch(v){u.e(v)}finally{u.f()}var h,_=(0,w.Z)(o);try{for(_.s();!(h=_.n()).done;){h.value.detach_document()}}catch(v){_.e(v)}finally{_.f()}var d,f=(0,w.Z)(s);try{for(f.s();!(d=f.n()).done;){d.value.attach_document(this)}}catch(v){f.e(v)}finally{f.f()}this._all_models=l}},{key:"roots",value:function(){return this._roots}},{key:"add_root",value:function(e,t){if(l.logger.debug("Adding root: ".concat(e)),!(0,m.includes)(this._roots,e)){this._push_all_models_freeze();try{this._roots.push(e)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new E.RootAddedEvent(this,e,t))}}},{key:"remove_root",value:function(e,t){var n=this._roots.indexOf(e);if(!(n<0)){this._push_all_models_freeze();try{this._roots.splice(n,1)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new E.RootRemovedEvent(this,e,t))}}},{key:"title",value:function(){return this._title}},{key:"set_title",value:function(e,t){e!==this._title&&(this._title=e,this._trigger_on_change(new E.TitleChangedEvent(this,e,t)))}},{key:"get_model_by_id",value:function(e){var t;return null!==(t=this._all_models.get(e))&&void 0!==t?t:null}},{key:"get_model_by_name",value:function(e){var t,n=[],i=(0,w.Z)(this._all_models.values());try{for(i.s();!(t=i.n()).done;){var r=t.value;r instanceof C.Model&&r.name==e&&n.push(r)}}catch(a){i.e(a)}finally{i.f()}switch(n.length){case 0:return null;case 1:return n[0];default:throw new Error("Multiple models are named '".concat(e,"'"))}}},{key:"on_message",value:function(e,t){var n=this._message_callbacks.get(e);null==n?this._message_callbacks.set(e,new Set([t])):n.add(t)}},{key:"remove_on_message",value:function(e,t){var n;null===(n=this._message_callbacks.get(e))||void 0===n||n.delete(t)}},{key:"_trigger_on_message",value:function(e,t){var n=this._message_callbacks.get(e);if(null!=n){var i,r=(0,w.Z)(n);try{for(r.s();!(i=r.n()).done;){(0,i.value)(t)}}catch(a){r.e(a)}finally{r.f()}}}},{key:"on_change",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._callbacks.has(e)||this._callbacks.set(e,t)}},{key:"remove_on_change",value:function(e){this._callbacks.delete(e)}},{key:"_trigger_on_change",value:function(e){var t,n=(0,w.Z)(this._callbacks);try{for(n.s();!(t=n.n()).done;){var i=(0,k.Z)(t.value,2),r=i[0];if(!i[1]&&e instanceof E.DocumentEventBatch){var a,o=(0,w.Z)(e.events);try{for(o.s();!(a=o.n()).done;){r(a.value)}}catch(s){o.e(s)}finally{o.f()}}else r(e)}}catch(s){n.e(s)}finally{n.f()}}},{key:"_notify_change",value:function(e,t,n,i,r){this._trigger_on_change(new E.ModelChangedEvent(this,e,t,n,i,null==r?void 0:r.setter_id,null==r?void 0:r.hint))}},{key:"to_json_string",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return JSON.stringify(this.to_json(e))}},{key:"to_json",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=new _.Serializer({include_defaults:e}),n=t.to_serializable(this._roots);return{version:s.version,title:this._title,roots:{root_ids:n.map((function(e){return e.id})),references:(0,y.Z)(t.definitions)}}}},{key:"replace_with_json",value:function(t){e.from_json(t).destructively_move(this)}},{key:"create_json_patch_string",value:function(e){return JSON.stringify(this.create_json_patch(e))}},{key:"create_json_patch",value:function(e){var t,n=(0,w.Z)(e);try{for(n.s();!(t=n.n()).done;){if(t.value.document!=this)throw new Error("Cannot create a patch using events from a different document")}}catch(l){n.e(l)}finally{n.f()}
2var i,r=new _.Serializer,a=r.to_serializable(e),o=(0,w.Z)(this._all_models.values());try{for(o.s();!(i=o.n()).done;){var s=i.value;r.remove_def(s)}}catch(l){o.e(l)}finally{o.f()}return{events:a,references:(0,y.Z)(r.definitions)}}},{key:"apply_json_patch",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map,i=arguments.length>2?arguments[2]:void 0,r=t.references,a=t.events,o=e._instantiate_references_json(r,this._all_models,this._resolver);n instanceof Map||(n=new Map(n));var s,c=(0,w.Z)(a);try{for(c.s();!(s=c.n()).done;){var h=s.value;switch(h.kind){case"RootAdded":case"RootRemoved":case"ModelChanged":var _=h.model.id,d=this._all_models.get(_);if(null!=d)o.set(_,d);else if(!o.has(_))throw l.logger.warn("Got an event for unknown model ".concat(h.model,'"')),new Error("event model wasn't known")}}}catch(K){c.e(K)}finally{c.f()}var f,v=new Map(this._all_models),p=new Map,m=(0,w.Z)(o);try{for(m.s();!(f=m.n()).done;){var y=(0,k.Z)(f.value,2),g=y[0],b=y[1];v.has(g)||p.set(g,b)}}catch(K){m.e(K)}finally{m.f()}e._initialize_references_json(r,v,p,n);var x,Z=(0,w.Z)(a);try{for(Z.s();!(x=Z.n()).done;){var A=x.value;switch(A.kind){case"MessageSent":var S=A.msg_type,T=A.msg_data,C=void 0;if(void 0===T){if(1!=n.size)throw new Error("expected exactly one buffer");var z=n,E=(0,k.Z)(z,1);C=(0,k.Z)(E[0],2)[1]}else C=e._resolve_refs(T,v,p,n);this._trigger_on_message(S,C);break;case"ModelChanged":var R=A.model.id,B=this._all_models.get(R);if(null==B)throw new Error("Cannot apply patch to ".concat(R," which is not in the document"));var N=A.attr,O=e._resolve_refs(A.new,v,p,n);B.setv((0,u.Z)({},N,O),{setter_id:i});break;case"ColumnDataChanged":var D=A.column_source.id,I=this._all_models.get(D);if(null==I)throw new Error("Cannot stream to ".concat(D," which is not in the document"));var P=e._resolve_refs(A.new,new Map,new Map,n);if(null!=A.cols)for(var V in I.data)V in P||(P[V]=I.data[V]);I.setv({data:P},{setter_id:i,check_eq:!1});break;case"ColumnsStreamed":var L=A.column_source.id,j=this._all_models.get(L);if(null==j)throw new Error("Cannot stream to ".concat(L," which is not in the document"));if(!(j instanceof M.ColumnDataSource))throw new Error("Cannot stream to non-ColumnDataSource");var U=A.data,F=A.rollover;j.stream(U,F,i);break;case"ColumnsPatched":var G=A.column_source.id,H=this._all_models.get(G);if(null==H)throw new Error("Cannot patch ".concat(G," which is not in the document"));if(!(H instanceof M.ColumnDataSource))throw new Error("Cannot patch non-ColumnDataSource");var Y=A.patches;H.patch(Y,i);break;case"RootAdded":var J=A.model.id,W=o.get(J);this.add_root(W,i);break;case"RootRemoved":var q=A.model.id,X=o.get(q);this.remove_root(X,i);break;case"TitleChanged":this.set_title(A.title,i);break;default:throw new Error("Unknown patch event ".concat(JSON.stringify(A)))}}}catch(K){Z.e(K)}finally{Z.f()}}}],[{key:"_instantiate_object",value:function(e,t,n,i){var r=Object.assign(Object.assign({},n),{id:e,__deferred__:!0});return new(i.get(t))(r)}},{key:"_instantiate_references_json",value:function(t,n,i){var r,a,o=new Map,s=(0,w.Z)(t);try{for(s.s();!(a=s.n()).done;){var l=a.value,u=l.id,c=l.type,h=null!==(r=l.attributes)&&void 0!==r?r:{},_=n.get(u);null==_&&(_=e._instantiate_object(u,c,h,i),null!=l.subtype&&_.set_subtype(l.subtype)),o.set(_.id,_)}}catch(d){s.e(d)}finally{s.f()}return o}},{key:"_resolve_refs",value:function(e,t,n,i){return function e(r){var a;if((0,f.is_ref)(r)){var o=null!==(a=t.get(r.id))&&void 0!==a?a:n.get(r.id);if(null!=o)return o;throw new Error("reference ".concat(JSON.stringify(r)," isn't known (not in Document?)"))}if((0,v.is_NDArray_ref)(r)){var s=(0,v.decode_NDArray)(r,i),l=s.buffer,u=s.dtype,c=s.shape;return(0,p.ndarray)(l,{dtype:u,shape:c})}return(0,S.isArray)(r)?function(t){var n,i=[],r=(0,w.Z)(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;i.push(e(a))}}catch(o){r.e(o)}finally{r.f()}return i}(r):(0,S.isPlainObject)(r)?function(t){var n,i={},r=(0,w.Z)((0,x.entries)(t));try{for(r.s();!(n=r.n()).done;){var a=(0,k.Z)(n.value,2),o=a[0],s=a[1];i[o]=e(s)}}catch(l){r.e(l)}finally{r.f()}return i}(r):r}(e)}},{key:"_initialize_references_json",value:function(t,n,i,r){var a,o=new Map,s=(0,w.Z)(t);try{for(s.s();!(a=s.n()).done;){var l=a.value,u=l.id,c=l.attributes,_=!n.has(u),d=_?i.get(u):n.get(u),f=e._resolve_refs(c,n,i,r);d.setv(f,{silent:!0}),o.set(u,{instance:d,is_new:_})}}catch(Z){s.e(Z)}finally{s.f()}var v=[],p=new Set;function m(e){if(e instanceof h.HasProps){if(o.has(e.id)&&!p.has(e.id)){p.add(e.id);var t,n=o.get(e.id),i=n.instance,r=n.is_new,a=i.attributes,s=(0,w.Z)((0,x.values)(a));try{for(s.s();!(t=s.n()).done;){m(t.value)}}catch(Z){s.e(Z)}finally{s.f()}r&&(i.finalize(),v.push(i))}}else if((0,S.isArray)(e)){var l,u=(0,w.Z)(e);try{for(u.s();!(l=u.n()).done;){m(l.value)}}catch(Z){u.e(Z)}finally{u.f()}}else if((0,S.isPlainObject)(e)){var c,_=(0,w.Z)((0,x.values)(e));try{for(_.s();!(c=_.n()).done;){m(c.value)}}catch(Z){_.e(Z)}finally{_.f()}}}var y,g=(0,w.Z)(o.values());try{for(g.s();!(y=g.n()).done;){m(y.value.instance)}}catch(Z){g.e(Z)}finally{g.f()}for(var b=0,k=v;b<k.length;b++){k[b].connect_signals()}}},{key:"_event_for_attribute_change",value:function(e,t,n,i,r){if(i.get_model_by_id(e.id).property(t).syncable){var a={kind:"ModelChanged",model:{id:e.id},attr:t,new:n};return h.HasProps._json_record_references(i,n,r,{recursive:!0}),a}return null}},{key:"_events_to_sync_objects",value:function(t,n,i,r){var a,o=Object.keys(t.attributes),s=Object.keys(n.attributes),u=(0,m.difference)(o,s),c=(0,m.difference)(s,o),h=(0,m.
2intersection)(o,s),_=[],d=(0,w.Z)(u);try{for(d.s();!(a=d.n()).done;){var f=a.value;l.logger.warn("Server sent key ".concat(f," but we don't seem to have it in our JSON"))}}catch(T){d.e(T)}finally{d.f()}var v,p=(0,w.Z)(c);try{for(p.s();!(v=p.n()).done;){var y=v.value,g=n.attributes[y];_.push(e._event_for_attribute_change(t,y,g,i,r))}}catch(T){p.e(T)}finally{p.f()}var b,x=(0,w.Z)(h);try{for(x.s();!(b=x.n()).done;){var k=b.value,Z=t.attributes[k],S=n.attributes[k];null==Z&&null==S||(null==Z||null==S?_.push(e._event_for_attribute_change(t,k,S,i,r)):"data"==k||(0,A.is_equal)(Z,S)||_.push(e._event_for_attribute_change(t,k,S,i,r)))}}catch(T){x.e(T)}finally{x.f()}return _.filter((function(e){return null!=e}))}},{key:"_compute_patch_since_json",value:function(t,n){var i=n.to_json(!1);function r(e){var t,n=new Map,i=(0,w.Z)(e.roots.references);try{for(i.s();!(t=i.n()).done;){var r=t.value;n.set(r.id,r)}}catch(a){i.e(a)}finally{i.f()}return n}var a,o=r(t),s=new Map,l=[],u=(0,w.Z)(t.roots.root_ids);try{for(u.s();!(a=u.n()).done;){var c=a.value;s.set(c,o.get(c)),l.push(c)}}catch(M){u.e(M)}finally{u.f()}var h,d=r(i),f=new Map,v=[],p=(0,w.Z)(i.roots.root_ids);try{for(p.s();!(h=p.n()).done;){var g=h.value;f.set(g,d.get(g)),v.push(g)}}catch(M){p.e(M)}finally{p.f()}if(l.sort(),v.sort(),(0,m.difference)(l,v).length>0||(0,m.difference)(v,l).length>0)throw new Error("Not implemented: computing add/remove of document roots");var b,x=new Set,k=[],Z=(0,w.Z)(n._all_models.keys());try{for(Z.s();!(b=Z.n()).done;){var A=b.value;if(o.has(A)){var S=e._events_to_sync_objects(o.get(A),d.get(A),n,x);k=k.concat(S)}}}catch(M){Z.e(M)}finally{Z.f()}var T=new _.Serializer({include_defaults:!1});return T.to_serializable((0,y.Z)(x)),{references:(0,y.Z)(T.definitions),events:k}}},{key:"from_json_string",value:function(t){var n=JSON.parse(t);return e.from_json(n)}},{key:"from_json",value:function(t){l.logger.debug("Creating Document from JSON");var n=t.version,i=-1!==n.indexOf("+")||-1!==n.indexOf("-"),r="Library versions: JS (".concat(s.version,") / Python (").concat(n,")");i||s.version.replace(/-(dev|rc)\./,"$1")==n?l.logger.debug(r):(l.logger.warn("JS/Python ver
2sion mismatch"),l.logger.warn(r));var a=new o.ModelResolver;null!=t.defs&&(0,z.resolve_defs)(t.defs,a);var u=t.roots,c=u.root_ids,h=u.references,_=e._instantiate_references_json(h,new Map,a);e._initialize_references_json(h,new Map,_,new Map);var d=new e({resolver:a});d._push_all_models_freeze();var f,v=(0,w.Z)(c);try{for(v.s();!(f=v.n()).done;){var p=f.value,m=_.get(p);null!=m&&d.add_root(m)}}catch(y){v.e(y)}finally{v.f()}return d._pop_all_models_freeze(),d.set_title(t.title),d}}]),e}();n.Document=B,B.__name__="Document"},function(e,t,n,i,r){i();var a=e(1),o=e(8),s=e(13),l=e(14);n.overrides={};var u=new Map;n.Models=function(e){var t=n.Models.get(e);if(null!=t)return t;throw new Error("Model '".concat(e,"' does not exist. This could be due to a widget or a custom model not being registered before first usage."))},n.Models.get=function(e){var t;return null!==(t=n.overrides[e])&&void 0!==t?t:u.get(e)},n.Models.register=function(e,t){n.overrides[e]=t},n.Models.unregister=function(e){delete n.overrides[e]},n.Models.register_models=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;if(null!=e){var r,a=(0,w.Z)((0,o.isArray)(e)?e:(0,s.values)(e));try{for(a.s();!(r=a.n()).done;){var c=r.value;if(t=c,(0,o.isObject)(t)&&t.prototype instanceof l.HasProps){var h=c.__qualified__;n||!u.has(h)?u.set(h,c):null!=i?i(h):console.warn("Model '".concat(h,"' was already registered"))}}}catch(_){a.e(_)}finally{a.f()}}},n.register_models=n.Models.register_models,n.Models.registered_names=function(){return(0,y.Z)(u.keys())};var c=function(){function e(){(0,g.Z)(this,e),this._known_models=new Map}return(0,b.Z)(e,[{key:"get",value:function(e,t){var i,r=null!==(i=n.Models.get(e))&&void 0!==i?i:this._known_models.get(e);if(null!=r)return r;if(void 0!==t)return t;throw new Error("Model '".concat(e,"' does not exist. This could be due to a widget or a custom model not being registered before first usage."))}},{key:"register",value:function(e){var t=e.__qualified__;null==this.get(t,null)?this._known_models.set(t,e):console.warn("Model '".concat(t,"' was already registered with this resolver"))}}]),e}();n.ModelResolver=c,c.__name__="ModelResolver";var h=(0,a.__importStar)(e(38));(0,n.register_models)(h);var _=(0,a.__importStar)(e(392));(0,n.register_models)(_)},function(e,t,n,i,r){i();var a=e(9),o=Object.prototype.toString;function s(e){return!0===e||!1===e||"[object Boolean]"===o.call(e)}function l(e){return"[object Number]"===o.call(e)}function u(e){return"[object String]"===o.call(e)}function c(e){return"symbol"==typeof e}function h(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function _(e){return h(e)&&void 0!==e[Symbol.iterator]}n.isBoolean=s,n.isNumber=l,n.isInteger=function(e){return l(e)&&Number.isInteger(e)},n.isString=u,n.isSymbol=c,n.isPrimitive=function(e){return null===e||s(e)||l(e)||u(e)||c(e)},n.isFunction=function(e){return"[object Function]"===o.call(e)},n.isArray=function(e){return Array.isArray(e)},n.isArrayOf=function(e,t){return(0,a.every)(e,t)},n.isArrayableOf=function(e,t){for(var n=0,i=e.length;n<i;n++)if(!t(e[n]))return!1;return!0},n.isTypedArray=function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},n.isObject=h,n.isPlainObject=function(e){return h(e)&&(null==e.constructor||e.constructor===Object)},n.isIterable=_,n.isArrayable=function(e){return _(e)&&"length"in e}},function(e,t,n,i,r){i();var a=e(10),o=e(11),s=e(12);r("map",s.map),r("reduce",s.reduce),r("min",s.min),r("min_by",s.min_by),r("max",s.max),r("max_by",s.max_by),r("sum",s.sum),r("cumsum",s.cumsum),r("every",s.every),r("some",s.some),r("find",s.find),r("find_last",s.find_last),r("find_index",s.find_index),r("find_last_index",s.find_last_index),r("sorted_index",s.sorted_index),r("is_empty",s.is_empty);var l=Array.prototype.slice;function u(e){return l.call(e)}function c(e){var t;return(t=[]).concat.apply(t,(0,y.Z)(e))}function h(e,t){return-1!==e.indexOf(t)}function _(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;(0,o.assert)(n>0,"'step' must be a positive number"),null==t&&(t=e,e=0);for(var i=e<=t?n:-n,r=(0,Math.max)((0,Math.ceil)((0,Math.abs)(t-e)/n),0),a=new Array(r),s=0;s<r;s++,e+=i)a[s]=e;return a}n.head=function(e){return e[0]},n.tail=function(e){return e[e.length-1]},n.last=function(e){return e[e.length-1]},n.copy=u,n.concat=c,n.includes=h,n.contains=h,n.nth=function(e,t){return e[t>=0?t:e.length+t]},n.zip=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0==t.length)return[];for(var i=(0,s.min)(t.map((function(e){return e.length}))),r=t.length,a=new Array(i),o=0;o<i;o++){a[o]=new Array(r);for(var l=0;l<r;l++)a[o][l]=t[l][o]}return a},n.unzip=function(e){for(var t=e.length,n=(0,s.min)(e.map((function(e){return e.length}))),i=Array(n),r=0;r<n;r++)i[r]=new Array(t);for(var a=0;a<t;a++)for(var o=0;o<n;o++)i[o][a]=e[a][o];return i},n.range=_,n.linspace=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,i=(t-e)/(n-1),r=new Array(n),a=0;a<n;a++)r[a]=e+i*a;return r},n.transpose=function(e){for(var t=e.length,n=e[0].length,i=[],r=0;r<n;r++){i[r]=[];for(var a=0;a<t;a++)i[r][a]=e[a][r]}return i},n.argmin=function(e){return(0,s.min_by)(_(e.length),(function(t){return e[t]}))},n.argmax=function(e){return(0,s.max_by)(_(e.length),(function(t){return e[t]}))},n.sort_by=function(e,t){var n=e.map((function(e,n){return{value:e,index:n,key:t(e)}}));return n.sort((function(e,t){var n=e.key,i=t.key;if(n!==i){if(n>i||void 0===n)return 1;if(n<i||void 0===i)return-1}return e.index-t.index})),n.map((function(e){return e.value}))},n.uniq=function(e){var t,n=new Set,i=(0,w.Z)(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;n.add(r)}}catch(a){i.e(a)}finally{i.f()}return(0,y.Z)(n)},n.uniq_by=function(e,t){var n,i=[],r=[],a=(0,w.Z)(e);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=t(o);h(r,s)||(r.push(s),i.push(o))}}catch(l){a.e(l)}finally{a.f()}return i},n.union=function(){for(var e=new Set,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var r=0,a=n;r<a.length;r++){var o,s=a[r],l=(0,w.Z)(s);try{for(l.s();!(o=l.n()).done;){var u=o.value;e.add(u)}}catch(c){l.e(c)}finally{l.f()}}return(0,y.Z)(e)},n.intersection=function(e){for(var t=[],n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var a,o=(0,w.Z)(e);try{e:for(o.s();!(a=o.n()).done;){var s=a.value;if(!h(t,s)){var l,u=(0,w.Z)(i);try{for(u.s();!(l=u.n()).done;){if(!h(l.value,s))continue e}}catch(c){u.e(c)}finally{u.f()}t.push(s)}}}catch(c){o.e(c)}finally{o.f()}return t},n.difference=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=c(n);return e.filter((function(e){return!h(r,e)}))},n.remove_at=function(e,t){var n=u(e);return n.splice(t,1),n},n.remove_by=function(e,t){for(var n=0;n<e.length;)t(e[n])?e.splice(n,1):n++},n.shuffle=function(e){for(var t=e.length,n=new Array(t),i=0;i<t;i++){var r=(0,a.randomIn)(0,i);r!==i&&(n[i]=n[r]),n[r]=e[i]}return n},n.pairwise=function(e,t){for(var n=e.length,i=new Array(n-1),r=0;r<n-1;r++)i[r]=t(e[r],e[r+1]);return i},n.reversed=function(e){for(var t=e.length,n=new Array(t),i=0;i<t;i++)n[t-i-1]=e[i];return n},n.repeat=function(e,t){for(var n=new Array(t),i=0;i<t;i++)n[i]=e;return n}},function(e,t,n,i,r){i();var a=Math.PI;function o(e){if(0==e)return 0;for(;e<=0;)e+=2*a;for(;e>2*a;)e-=2*a;return e}function s(e,t){return o(e-t)}function l(){return Math.random()}function u(e){switch(e){case"deg":return a/180;case"rad":return 1;case"grad":return a/200;case"turn":return 2*a}}n.angle_norm=o,n.angle_dist=s,n.angle_between=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=s(t,n);if(0==r)return!1;if(r==2*a)return!0;var l=o(e),u=s(t,l)<=r&&s(l,n)<=r;return i?!u:u},n.random=l,n.randomIn=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},n.atan2=function(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])},n.radians=function(e){return e*(a/180)},n.degrees=function(e){return e/(a/180)},n.resolve_angle=function(e,t){return-u(t)*e},n.to_radians_coeff=u,n.rnorm=function(e,t){for(var n,i;n=l(),i=(2*(i=l())-1)*Math.sqrt(1/Math.E*2),!(-4*n*n*Math.log(n)>=i*i););var r=i/n;return r=e+t*r},n.clamp=function(e,t,n){return e<t?t:e>n?n:e},n.log=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.E;return Math.log(e)/Math.log(t)},n.float32_epsilon=1.1920928955078125e-7},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}((0,m.Z)(Error));n.AssertionError=a,a.__name__="AssertionError",n.assert=function(e,t){if(!(!0===e||!1!==e&&e()))throw new a(null!=t?t:"Assertion failed")},n.unreachable=function(){throw new Error("unreachable code")}},function(e,t,n,i,r){i();var a=e(10);function o(e,t,n){var i=e.length;t<0&&(t+=i),t<0?t=0:t>i&&(t=i),null==n||n>i-t?n=i-t:n<0&&(n=0);for(var r=arguments.length,a=new Array(r>3?r-3:0),o=3;o<r;o++)a[o-3]=arguments[o];for(var s=i-n+a.length,l=new e.constructor(s),u=0;u<t;u++)l[u]=e[u];for(var c=0,h=a;c<h.length;c++){var _=h[c];l[u++]=_}for(var d=t+n;d<i;d++)l[u++]=e[d];return l}function s(e,t){return o(e,t,e.length-t)}function l(e,t){for(var n=e.length,i=new e.constructor(n),r=0;r<n;r++)i[r]=t(e[r],r,e);return i}function u(e,t,n){var i,r,a=e.length;if(void 0===n&&0==a)throw new Error("can't reduce an empty array without an initial value");for(void 0===n?(i=e[0],r=1):(i=n,r=0);r<a;r++)i=t(i,e[r],r,e);return i}function c(e){return function(t,n){for(var i=t.length,r=e>0?0:i-1;r>=0&&r<i;r+=e)if(n(t[r]))return r;return-1}}function h(e,t){for(var n=0,i=e.length;n<i;){var r=Math.floor((n+i)/2);e[r]<t?n=r+1:i=r}return n}function _(e,t,n,i,r){var a=(r-n)/(i-t),o=a*(e-t)+n;
2return isFinite(o)||(o=a*(e-i)+r,isFinite(o)||n!=r||(o=n)),o}function d(e,t){if(e<t[0])return-1;if(e>t[t.length-1])return t.length;for(var n=0,i=t.length-1;i-n!=1;){var r=n+Math.floor((i-n)/2);e>=t[r]?n=r:i=r}return n}n.is_empty=function(e){return 0==e.length},n.copy=function(e){return Array.isArray(e)?e.slice():new e.constructor(e)},n.splice=o,n.head=s,n.insert=function(e,t,n){return o(e,n,0,t)},n.append=function(e,t){return o(e,e.length,0,t)},n.prepend=function(e,t){return o(e,0,0,t)},n.indexOf=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},n.subselect=function(e,t){for(var n=t.length,i=new e.constructor(n),r=0;r<n;r++)i[r]=e[t[r]];return i},n.mul=function(e,t,n){for(var i=e.length,r=null!=n?n:new e.constructor(i),a=0;a<i;a++)r[a]=e[a]*t;return r},n.map=l,n.inplace_map=function(e,t,n){for(var i=e.length,r=null!=n?n:e,a=0;a<i;a++)r[a]=t(e[a],a)},n.filter=function(e,t){for(var n=e.length,i=new e.constructor(n),r=0,a=0;a<n;a++){var o=e[a];t(o,a,e)&&(i[r++]=o)}return s(i,r)},n.reduce=u,n.min=function(e){for(var t,n=1/0,i=0,r=e.length;i<r;i++)t=e[i],!isNaN(t)&&t<n&&(n=t);return n},n.max=function(e){for(var t,n=-1/0,i=0,r=e.length;i<r;i++)t=e[i],!isNaN(t)&&t>n&&(n=t);return n},n.minmax=function(e){for(var t,n=1/0,i=-1/0,r=0,a=e.length;r<a;r++)t=e[r],isNaN(t)||(t<n&&(n=t),t>i&&(i=t));return[n,i]},n.minmax2=function(e,t){for(var n,i,r=1/0,a=-1/0,o=1/0,s=-1/0,l=Math.min(e.length,t.length),u=0;u<l;u++)n=e[u],i=t[u],isNaN(n)||isNaN(i)||(n<r&&(r=n),n>a&&(a=n),i<o&&(o=i),i>s&&(s=i));return[r,a,o,s]},n.min_by=function(e,t){if(0==e.length)throw new Error("min_by() called with an empty array");for(var n=e[0],i=t(n),r=1,a=e.length;r<a;r++){var o=e[r],s=t(o);s<i&&(n=o,i=s)}return n},n.max_by=function(e,t){if(0==e.length)throw new Error("max_by() called with an empty array");for(var n=e[0],i=t(n),r=1,a=e.length;r<a;r++){var o=e[r],s=t(o);s>i&&(n=o,i=s)}return n},n.sum=function(e){for(var t=0,n=0,i=e.length;n<i;n++)t+=e[n];return t},n.cumsum=function(e){var t=new e.constructor(e.length);return u(e,(function(e,n,i){return t[i]=e+n}),0),t},n.every=function(e,t){for(var n=0,i=e.length;n<i;n++)if(!t(e[n]))return!1;return!0},n.some=function(e,t){for(var n=0,i=e.length;n<i;n++)if(t(e[n]))return!0;return!1},n.index_of=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},n.find_index=c(1),n.find_last_index=c(-1),n.find=function(e,t){var i=(0,n.find_index)(e,t);return-1==i?void 0:e[i]},n.find_last=function(e,t){var i=(0,n.find_last_index)(e,t);return-1==i?void 0:e[i]},n.sorted_index=h,n.bin_counts=function(e,t){for(var n=t.length-1,i=Array(n).fill(0),r=0;r<e.length;r++){var o=h(t,e[r]);i[(0,a.clamp)(o-1,0,n-1)]+=1}return i},n.interpolate=function(e,t,n){for(var i=e.length,r=new Array(i),a=0;a<i;a++){var o=e[a];if(isNaN(o))r[a]=o;else{var s=d(o,t);if(-1==s)r[a]=n[0];else if(s==t.length)r[a]=n[n.length-1];else if(s==t.length-1||t[s]==o)r[a]=n[s];else{var l=t[s],u=n[s],c=t[s+1],h=n[s+1];r[a]=_(o,l,u,c,h)}}}return r},n.left_edge_index=d,n.norm=function(e,t,n){var i=n-t;return l(e,(function(e){return(e-t)/i}))}},function(e,t,n,i,r){i();var a=e(9),o=Object.prototype.hasOwnProperty;function s(e){return Object.keys(e).length}function l(e){return 0==s(e)}n.keys=Object.keys,n.values=Object.values,n.entries=Object.entries,n.extend=Object.assign,n.clone=function(e){return Object.assign({},e)},n.merge=function(e,t){var n,i=Object.create(Object.prototype),r=(0,a.concat)([Object.keys(e),Object.keys(t)]),s=(0,w.Z)(r);try{for(s.s();!(n=s.n()).done;){var l=n.value,u=o.call(e,l)?e[l]:[],c=o.call(t,l)?t[l]:[];i[l]=(0,a.union)(u,c)}}catch(h){s.e(h)}finally{s.f()}return i},n.size=s,n.is_empty=l,n.isEmpty=l,n.to_object=function(e){var t,n={},i=(0,w.Z)(e);try{for(i.s();!(t=i.n()).done;){var r=(0,k.Z)(t.value,2),a=r[0],o=r[1];n[a]=o}}catch(s){i.e(s)}finally{i.f()}return n}},function(e,t,n,i,r){i();var a,o=e(1),s=e(15),l=e(17),c=(0,o.__importStar)(e(18)),h=(0,o.__importStar)(e(21)),_=e(34),d=e(13),m=e(8),Z=e(26),A=e(30),S=e(35),T=e(26),M=e(36),C=e(37),z=(0,o.__importStar)(e(21)),E=function(e,t,n,i,r,a,o){(0,v.Z)(T,e);var A=(0,p.Z)(T);function T(){var e,t,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,g.Z)(this,T),(e=A.call(this))._subtype=void 0,e.document=null,e.destroyed=new s.Signal0((0,f.Z)(e),"destroyed"),e.change=new s.Signal0((0,f.Z)(e),"change"),e.transformchange=new s.Signal0((0,f.Z)(e),"transformchange"),e.exprchange=new s.Signal0((0,f.Z)(e),"exprchange"),e.properties={},e._watchers=new WeakMap,e._pending=!1,e._changing=!1;var r=i instanceof Map?i.get.bind(i):function(e){return i[e]};e.id=null!==(t=r("id"))&&void 0!==t?t:(0,_.uniqueId)();var a,o=(0,w.Z)((0,d.entries)(e._props));try{var l=function(){var t,n=(0,k.Z)(a.value,2),i=n[0],o=n[1],s=o.type,l=o.default_value,u=o.options;s instanceof c.PropertyAlias?Object.defineProperty(e.properties,i,{get:function(){return e.properties[s.attr]},configurable:!1,enumerable:!1}):(t=s instanceof h.Kind?new c.PrimitiveProperty((0,f.Z)(e),i,s,l,r(i),u):new s((0,f.Z)(e),i,h.Any,l,r(i),u),e.properties[i]=t)};for(o.s();!(a=o.n()).done;)l()}catch(u){o.e(u)}finally{o.f()}return null!==(n=r("__deferred__"))&&void 0!==n&&n||(e.finalize(),e.connect_signals()),e}return(0,b.Z)(T,[{key:"is_syncable",get:function(){return!0}},{key:"type",get:function(){return this.constructor.__qualified__},set:function(e){console.warn("prototype.type = 'ModelName' is deprecated, use static __name__ instead"),this.constructor.__name__=e}}
2,{key:"toString",value:function(){return"".concat(this.type,"(").concat(this.id,")")}},{key:"property",value:function(e){var t=this.properties[e];if(null!=t)return t;throw new Error("unknown property ".concat(this.type,".").concat(e))}},{key:"attributes",get:function(){var e,t={},n=(0,w.Z)(this);try{for(n.s();!(e=n.n()).done;){var i=e.value;t[i.attr]=i.get_value()}}catch(r){n.e(r)}finally{n.f()}return t}},{key:n,value:function(e){var t,n=new Map,i=(0,w.Z)(this);try{for(i.s();!(t=i.n()).done;){var r=t.value;r.dirty&&n.set(r.attr,e.clone(r.get_value()))}}catch(a){i.e(a)}finally{i.f()}return new this.constructor(n)}},{key:i,value:function(e,t){var n,i=(0,w.Z)(this);try{for(i.s();!(n=i.n()).done;){var r=n.value,a=e.property(r.attr);if(!t.eq(r.get_value(),a.get_value()))return!1}}catch(o){i.e(o)}finally{i.f()}return!0}},{key:r,value:function(e){var t,n=e.token,i=[],r=(0,w.Z)(this);try{for(r.s();!(t=r.n()).done;){var a=t.value;if(a.dirty){var o=a.get_value();i.push("".concat(a.attr).concat(n(":")," ").concat(e.to_string(o)))}}}catch(s){r.e(s)}finally{r.f()}return"".concat(this.constructor.__qualified__).concat(n("(")).concat(n("{")).concat(i.join("".concat(n(",")," "))).concat(n("}")).concat(n(")"))}},{key:a,value:function(e){var t=this.ref();e.add_ref(this,t);var n,i=this.struct(),r=(0,w.Z)(this);try{for(r.s();!(n=r.n()).done;){var a=n.value;a.syncable&&(e.include_defaults||a.dirty)&&(i.attributes[a.attr]=e.to_serializable(a.get_value()))}}catch(o){r.e(o)}finally{r.f()}return e.add_def(this,i),t}},{key:"finalize",value:function(){var e,t=this,n=(0,w.Z)(this);try{for(n.s();!(e=n.n()).done;){var i=e.value;if(i instanceof c.VectorSpec||i instanceof c.ScalarSpec){var r=i.get_value();if(null!=r){var a=r.transform,o=r.expr;null!=a&&this.connect(a.change,(function(){return t.transformchange.emit()})),null!=o&&this.connect(o.change,(function(){return t.exprchange.emit()}))}}}}catch(s){n.e(s)}finally{n.f()}this.initialize()}},{key:"initialize",value:function(){}},{key:"connect_signals",value:function(){}},{key:"disconnect_signals",value:function(){s.Signal.disconnectReceiver(this)}},{key:"destroy",value:function(){this.disconnect_signals(),this.destroyed.emit()}},{key:"clone",value:function(){return(new C.Cloner).clone(this)}},{key:"changed_for",value:function(e){var t=this._watchers.get(e);return this._watchers.set(e,!1),null==t||t}},{key:"_setv",value:function(e,t){var n=t.check_eq,i=[],r=this._changing;this._changing=!0;var a,o=(0,w.Z)(e);try{for(o.s();!(a=o.n()).done;){var s=(0,k.Z)(a.value,2),l=s[0],u=s[1];!1!==n&&(0,Z.is_equal)(l.get_value(),u)||(l.set_value(u),i.push(l))}}catch(_){o.e(_)}finally{o.f()}i.length>0&&(this._watchers=new WeakMap,this._pending=!0);for(var c=0,h=i;c<h.length;c++){h[c].change.emit()}if(!r){if(!t.no_change)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}}},{key:"setv",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,d.entries)(e);if(0!=n.length)if(!0!==t.silent){var i,r=new Map,a=new Map,o=(0,w.Z)(n);try{for(o.s();!(i=o.n()).done;){var s=(0,k.Z)(i.value,2),l=s[0],u=s[1],c=this.properties[l];r.set(c,u),a.set(c,c.get_value())}}catch(E){o.e(E)}finally{o.f()}this._setv(r,t);var h=this.document;if(null!=h){var _,f=[],v=(0,w.Z)(a);try{for(v.s();!(_=v.n()).done;){var p=(0,k.Z)(_.value,2),m=p[0],y=p[1];f.push([m,y,m.get_value()])}}catch(E){v.e(E)}finally{v.f()}for(var g=0,b=f;g<b.length;g++){var x=(0,k.Z)(b[g],3),Z=x[1],A=x[2];if(this._needs_invalidate(Z,A)){h._invalidate_all_models();break}}this._push_changes(f,t)}}else{this._watchers=new WeakMap;var S,T=(0,w.Z)(n);try{for(T.s();!(S=T.n()).done;){var M=(0,k.Z)(S.value,2),C=M[0],z=M[1];this.properties[C].set_value(z)}}catch(E){T.e(E)}finally{T.f()}}}},{key:"getv",value:function(e){return this.property(e).get_value()}},{key:"ref",value:function(){return{id:this.id}}},{key:"struct",value:function(){var e={type:this.type,id:this.id,attributes:{}};return null!=this._subtype&&(e.subtype=this._subtype),e}},{key:"set_subtype",value:function(e){this._subtype=e}},{key:o,value:(0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield((0,d.values)(this.properties),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"syncable_properties",value:(0,x.Z)().mark((function e(){var t,n,i;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=(0,w.Z)(this),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}if(i=n.value,e.t0=i.syncable,!e.t0){e.next=9;break}return e.next=9,i;case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t1=e.catch(1),t.e(e.t1);case 16:return e.prev=16,t.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))},{key:"serializable_attributes",value:function(){var e,t={},n=(0,w.Z)(this.syncable_properties());try{for(n.s();!(e=n.n()).done;){var i=e.value;t[i.attr]=i.get_value()}}catch(r){n.e(r)}finally{n.f()}return t}},{key:"references",value:function(){var e=new Set;return T._value_record_references(this,e,{recursive:!0}),e}},{key:"_doc_attached",value:function(){}},{key:"_doc_detached",value:function(){}},{key:"attach_document",value:function(e){if(null!=this.document&&this.document!=e)throw new Error("models must be owned by only a single document");this.document=e,this._doc_attached()}},{key:"detach_document",value:function(){this._doc_detached(),this.document=null}}
2,{key:"_needs_invalidate",value:function(e,t){var n=new Set;T._value_record_references(t,n,{recursive:!1});var i=new Set;T._value_record_references(e,i,{recursive:!1});var r,a=(0,w.Z)(n);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(!i.has(o))return!0}}catch(c){a.e(c)}finally{a.f()}var s,l=(0,w.Z)(i);try{for(l.s();!(s=l.n()).done;){var u=s.value;if(!n.has(u))return!0}}catch(c){l.e(c)}finally{l.f()}return!1}},{key:"_push_changes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.is_syncable){var n=this.document;if(null!=n){var i,r,a,o=t.setter_id,s=[],l=(0,w.Z)(e);try{for(l.s();!(i=l.n()).done;){var u=(0,k.Z)(i.value,3),c=u[0],h=u[1],_=u[2];c.syncable&&s.push(new S.ModelChangedEvent(n,this,c.attr,h,_,o))}}catch(d){l.e(d)}finally{l.f()}if(0!=s.length)1==s.length?(r=s,a=(0,k.Z)(r,1)[0]):a=new S.DocumentEventBatch(n,s,o),n._trigger_on_change(a)}}}},{key:"on_change",value:function(e,t){var n,i=(0,w.Z)((0,m.isArray)(e)?e:[e]);try{for(i.s();!(n=i.n()).done;){var r=n.value;this.connect(r.change,t)}}catch(a){i.e(a)}finally{i.f()}}}],[{key:"__qualified__",get:function(){var e=this.__module__,t=this.__name__;return null!=e?"".concat(e,".").concat(t):t}},{key:t,get:function(){return this.__name__}},{key:"_fix_default",value:function(e,t){if(void 0===e||(0,m.isFunction)(e))return e;if((0,m.isPrimitive)(e))return function(){return e};var n=new C.Cloner;return function(){return n.clone(e)}}},{key:"define",value:function(e){var t,n=this,i=(0,w.Z)((0,d.entries)((0,m.isFunction)(e)?e(z):e));try{var r=function(){var e=(0,k.Z)(t.value,2),i=e[0],r=e[1];if(null!=n.prototype._props[i])throw new Error("attempted to redefine property '".concat(n.prototype.type,".").concat(i,"'"));if(null!=n.prototype[i])throw new Error("attempted to redefine attribute '".concat(n.prototype.type,".").concat(i,"'"));Object.defineProperty(n.prototype,i,{get:function(){return this.properties[i].get_value()},set:function(e){return this.setv((0,u.Z)({},i,e)),this},configurable:!1,enumerable:!0});var a=(0,k.Z)(r,3),o=a[0],s=a[1],l=a[2],c=void 0===l?{}:l,h={type:o,default_value:n._fix_default(s,i),options:c},_=Object.assign({},n.prototype._props);_[i]=h,n.prototype._props=_};for(i.s();!(t=i.n()).done;)r()}catch(a){i.e(a)}finally{i.f()}}},{key:"internal",value:function(e){var t,n={},i=(0,w.Z)((0,d.entries)((0,m.isFunction)(e)?e(z):e));try{for(i.s();!(t=i.n()).done;){var r=(0,k.Z)(t.value,2),a=r[0],o=r[1],s=(0,k.Z)(o,3),l=s[0],u=s[1],c=s[2],h=void 0===c?{}:c;n[a]=[l,u,Object.assign(Object.assign({},h),{internal:!0})]}}catch(_){i.e(_)}finally{i.f()}this.define(n)}},{key:"mixins",value:function(e){function t(e,t){var n,i={},r=(0,w.Z)((0,d.entries)(t));try{for(r.s();!(n=r.n()).done;){var a=(0,k.Z)(n.value,2),o=a[0],s=a[1];i[e+o]=s}}catch(l){r.e(l)}finally{r.f()}return i}var n,i={},r=[],a=(0,w.Z)((0,m.isArray)(e)?e:[e]);try{for(a.s();!(n=a.n()).done;){var o=n.value;if((0,m.isArray)(o)){var s=(0,k.Z)(o,2),l=s[0],u=s[1];(0,d.extend)(i,t(l,u)),r.push([l,u])}else{var c=o;(0,d.extend)(i,c),r.push(["",c])}}}catch(h){a.e(h)}finally{a.f()}this.define(i),this.prototype._mixins=[].concat((0,y.Z)(this.prototype._mixins),r)}},{key:"override",value:function(e){var t,n=(0,w.Z)((0,d.entries)(e));try{for(n.s();!(t=n.n()).done;){var i=(0,k.Z)(t.value,2),r=i[0],a=i[1],o=this._fix_default(a,r),s=this.prototype._props[r];if(null==s)throw new Error("attempted to override nonexistent '".concat(this.prototype.type,".").concat(r,"'"));var l=Object.assign({},this.prototype._props);l[r]=Object.assign(Object.assign({},s),{default_value:o}),this.prototype._props=l}}catch(u){n.e(u)}finally{n.f()}}},{key:"_json_record_references",value:function(e,t,n,i){var r=i.recursive;if((0,l.is_ref)(t)){var a=e.get_model_by_id(t.id);null==a||n.has(a)||T._value_record_references(a,n,{recursive:r})}else if((0,m.isArray)(t)){var o,s=(0,w.Z)(t);try{for(s.s();!(o=s.n()).done;){var u=o.value;T._json_record_references(e,u,n,{recursive:r})}}catch(f){s.e(f)}finally{s.f()}}else if((0,m.isPlainObject)(t)){var c,h=(0,w.Z)((0,d.values)(t));try{for(h.s();!(c=h.n()).done;){var _=c.value;T._json_record_references(e,_,n,{recursive:r})}}catch(f){h.e(f)}finally{h.f()}}}},{key:"_value_record_references",value:function(e,t,n){var i=n.recursive;if(e instanceof T){if(!t.has(e)&&(t.add(e),i)){var r,a=(0,w.Z)(e.syncable_properties());try{for(a.s();!(r=a.n()).done;){var o=r.value.get_value();T._value_record_references(o,t,{recursive:i})}}catch(f){a.e(f)}finally{a.f()}}}else if((0,m.isArray)(e)){var s,l=(0,w.Z)(e);try{for(l.s();!(s=l.n()).done;){var u=s.value;T._value_record_references(u,t,{recursive:i})}}catch(f){l.e(f)}finally{l.f()}}else if((0,m.isPlainObject)(e)){var c,h=(0,w.Z)((0,d.values)(e));try{for(h.s();!(c=h.n()).done;){var _=c.value;T._value_record_references(_,t,{recursive:i})}}catch(f){h.e(f)}finally{h.f()}}}}]),T}((0,s.Signalable)(),Symbol.toStringTag,C.clone,T.equals,M.pretty,A.serialize,Symbol.iterator);n.HasProps=E,(a=E).prototype._props={},a.prototype._mixins=[]},function(e,t,n,i,r){i();var a=e(16),o=e(9),s=function(){function e(t,n){(0,g.Z)(this,e),this.sender=t,this.name=n}
2return(0,b.Z)(e,[{key:"connect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;u.has(this.sender)||u.set(this.sender,[]);var n=u.get(this.sender);if(null!=h(n,this,e,t))return!1;var i=null!=t?t:e;c.has(i)||c.set(i,[]);var r=c.get(i),a={signal:this,slot:e,context:t};return n.push(a),r.push(a),!0}},{key:"disconnect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=u.get(this.sender);if(null==n||0===n.length)return!1;var i=h(n,this,e,t);if(null==i)return!1;var r=null!=t?t:e,a=c.get(r);return i.signal=null,m(n),m(a),!0}},{key:"emit",value:function(e){var t,n,i=null!==(t=u.get(this.sender))&&void 0!==t?t:[],r=(0,w.Z)(i);try{for(r.s();!(n=r.n()).done;){var a=n.value,o=a.signal,s=a.slot,l=a.context;o===this&&s.call(l,e,this.sender)}}catch(c){r.e(c)}finally{r.f()}}}]),e}();n.Signal=s,s.__name__="Signal";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"emit",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"emit",this).call(this,void 0)}}]),n}(s);n.Signal0=l,l.__name__="Signal0",function(e){function t(e,t){var n=u.get(e);if(null!=n&&0!==n.length){var i=c.get(t);if(null!=i&&0!==i.length){var r,a=(0,w.Z)(i);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(null==o.signal)return;o.signal.sender===e&&(o.signal=null)}}catch(s){a.e(s)}finally{a.f()}m(n),m(i)}}}function n(e){var t,n=u.get(e);if(null!=n&&0!==n.length){var i,r=(0,w.Z)(n);try{for(r.s();!(i=r.n()).done;){var a=i.value;if(null==a.signal)return;var o=null!==(t=a.context)&&void 0!==t?t:a.slot;a.signal=null,m(c.get(o))}}catch(s){r.e(s)}finally{r.f()}m(n)}}function i(e,t,n){var i=c.get(e);if(null!=i&&0!==i.length){var r,a=(0,w.Z)(i);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(null==o.signal)return;if(null==t||o.slot==t){var s=o.signal.sender;null!=n&&n.has(s)||(o.signal=null,m(u.get(s)))}}}catch(l){a.e(l)}finally{a.f()}m(i)}}function r(e){var t=u.get(e);if(null!=t&&0!==t.length){var n,i=(0,w.Z)(t);try{for(i.s();!(n=i.n()).done;){n.value.signal=null}}catch(s){i.e(s)}finally{i.f()}m(t)}var r=c.get(e);if(null!=r&&0!==r.length){var a,o=(0,w.Z)(r);try{for(o.s();!(a=o.n()).done;){a.value.signal=null}}catch(s){o.e(s)}finally{o.f()}m(r)}}e.disconnect_between=t,e.disconnect_sender=n,e.disconnect_receiver=i,e.disconnect_all=r,e.disconnectBetween=t,e.disconnectSender=n,e.disconnectReceiver=i,e.disconnectAll=r}(s||(n.Signal=s={})),n.Signalable=function(){return function(){function e(){(0,g.Z)(this,e)}return(0,b.Z)(e,[{key:"connect",value:function(e,t){return e.connect(t,this)}},{key:"disconnect",value:function(e,t){return e.disconnect(t,this)}}]),e}()};var u=new WeakMap,c=new WeakMap;function h(e,t,n,i){return(0,o.find)(e,(function(e){return e.signal===t&&e.slot===n&&e.context===i}))}var f=new Set;function m(e){0===f.size&&(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,a.defer)();case 2:!function(){var e,t=(0,w.Z)(f);try{for(t.s();!(e=t.n()).done;){var n=e.value;(0,o.remove_by)(n,(function(e){return null==e.signal}))}}catch(i){t.e(i)}finally{t.f()}f.clear()}();case 3:case"end":return e.stop()}}),e)})))(),f.add(e)}},function(e,t,n,i,r){i();var a=new MessageChannel,o=new Map;a.port1.onmessage=function(e){var t=e.data,n=o.get(t);if(null!=n)try{n()}finally{o.delete(t)}};var s=1;n.defer=function(){return new Promise((function(e){var t=s++;o.set(t,e),a.port2.postMessage(t)}))},n.wait=function(e){return new Promise((function(t){return setTimeout(t,e)}))}},function(e,t,n,i,r){i();var a=e(8),o=e(13);n.is_ref=function(e){if((0,a.isPlainObject)(e)){var t=(0,o.keys)(e);return 1==t.length&&"id"==t[0]}return!1}},function(e,t,n,i,r){i(),n.YCoordinateSeqSeqSeqSpec=n.XCoordinateSeqSeqSeqSpec=n.YCoordinateSeqSpec=n.XCoordinateSeqSpec=n.YCoordinateSpec=n.XCoordinateSpec=n.CoordinateSeqSeqSeqSpec=n.CoordinateSeqSpec=n.CoordinateSpec=n.BaseCoordinateSpec=n.NumberUnitsSpec=n.UnitsSpec=n.DataSpec=n.VectorSpec=n.TextBaselineScalar=n.TextAlignScalar=n.FontStyleScalar=n.FontSizeScalar=n.FontScalar=n.LineDashScalar=n.LineCapScalar=n.LineJoinScalar=n.ArrayScalar=n.NullStringScalar=n.StringScalar=n.NumberScalar=n.C
2olorScalar=n.AnyScalar=n.ScalarSpec=n.VerticalAlign=n.UpdateMode=n.TooltipAttachment=n.TickLabelOrientation=n.TextureRepetition=n.TextBaseline=n.TextAlign=n.TapBehavior=n.StepMode=n.StartEnd=n.SpatialUnits=n.Sort=n.SizingMode=n.Side=n.RoundingFunction=n.ResetPolicy=n.RenderMode=n.RenderLevel=n.RadiusDimension=n.PointPolicy=n.Place=void 0,n.TextBaselineSpec=n.TextAlignSpec=n.FontStyleSpec=n.FontSizeSpec=n.FontSpec=n.LineDashSpec=n.LineCapSpec=n.LineJoinSpec=n.MarkerSpec=n.ArraySpec=n.NullStringSpec=n.StringSpec=n.AnySpec=n.NDArraySpec=n.ColorSpec=n.ScreenSizeSpec=n.NumberSpec=n.IntSpec=n.BooleanSpec=n.NullDistanceSpec=n.DistanceSpec=n.AngleSpec=void 0;var a=e(1),o=e(15),s=e(19),l=(0,a.__importStar)(e(20)),u=e(24),c=e(9),h=e(12),f=e(10),m=e(22),x=e(27),Z=e(8),A=e(28),S=e(29),T=e(33);function M(e){try{return JSON.stringify(e)}catch(t){return e.toString()}}function C(e){return(0,Z.isPlainObject)(e)&&(void 0===e.value?0:1)+(void 0===e.field?0:1)+(void 0===e.expr?0:1)==1}r("Uniform",T.Uniform),r("UniformScalar",T.UniformScalar),r("UniformVector",T.UniformVector),n.isSpec=C;var z=function(){function e(t,n,i,r,a){var s,l,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if((0,g.Z)(this,e),this.obj=t,this.attr=n,this.kind=i,this.default_value=r,this._dirty=!1,this.change=new o.Signal0(this.obj,"change"),this.internal=null!==(s=u.internal)&&void 0!==s&&s,this.convert=u.convert,this.on_update=u.on_update,void 0!==a)l=a,this._dirty=!0;else{var c=this._default_override();if(void 0!==c)l=c;else{if(void 0===r)return void(this.spec={value:null});l=r(t)}}this._update(l)}return(0,b.Z)(e,[{key:"is_value",get:function(){return void 0!==this.spec.value}},{key:"syncable",get:function(){return!this.internal}},{key:"get_value",value:function(){return this.spec.value}},{key:"set_value",value:function(e){this._update(e),this._dirty=!0}},{key:"_default_override",value:function(){}},{key:"dirty",get:function(){return this._dirty}},{key:"_update",value:function(e){var t;if(this.validate(e),null!=this.convert){var n=this.convert(e);void 0!==n&&(e=n)}this.spec={value:e},null===(t=this.on_update)||void 0===t||t.call(this,e,this.obj)}},{key:"toString",value:function(){return"Prop(".concat(this.obj,".").concat(this.attr,", spec: ").concat(M(this.spec),")")}},{key:"normalize",value:function(e){return e}},{key:"validate",value:function(e){if(!this.valid(e))throw new Error("".concat(this.obj,".").concat(this.attr," given invalid value: ").concat(M(e)))}},{key:"valid",value:function(e){return this.kind.valid(e)}},{key:"_value",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.is_value)throw new Error("attempted to retrieve property value for property without value specification");var t=this.normalize([this.spec.value])[0];return null!=this.spec.transform&&e&&(t=this.spec.transform.compute(t)),t}}]),e}();n.Property=z,z.__name__="Property";var E=(0,b.Z)((function e(t){(0,g.Z)(this,e),this.attr=t}));n.PropertyAlias=E,E.__name__="PropertyAlias",n.Alias=function(e){return new E(e)};var R=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(z);n.PrimitiveProperty=R,R.__name__="PrimitiveProperty";var B=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(z);n.Any=B,B.__name__="Any";var N=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return(0,Z.isArray)(e)||(0,Z.isTypedArray)(e)}}]),n}(z);n.Array=N,N.__name__="Array";var O=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return(0,Z.isBoolean)(e)}}]),n}(z);n.Boolean=O,O.__name__="Boolean";var D=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return(0,m.is_Color)(e)}}]),n}(z);n.Color=D,D.__name__="Color";var I=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(z);n.Instance=I,I.__name__="Instance";var P=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return(0,Z.isNumber)(e)}}]),n}(z);n.Number=P,P.__name__="Number";var V=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return(0,Z.isNumber)(e)&&(0|e)==e}}]),n}(P);n.Int=V,V.__name__="Int";var L=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(P);n.Angle=L,L.__name__="Angle";var j=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return(0,Z.isNumber)(e)&&0<=e&&e<=1}}]),n}(P);n.Percent=j,j.__name__="Percent";var U=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return(0,Z.isString)(e)}}]),n}(z);
2n.String=U,U.__name__="String";var F=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return null===e||(0,Z.isString)(e)}}]),n}(z);n.NullString=F,F.__name__="NullString";var G=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(U);n.FontSize=G,G.__name__="FontSize";var H=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_default_override",value:function(){return A.settings.dev?"Bokeh":void 0}}]),n}(U);n.Font=H,H.__name__="Font";var Y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return(0,Z.isString)(e)&&(0,c.includes)(this.enum_values,e)}}]),n}(z);function J(e){return function(t){(0,v.Z)(i,t);var n=(0,p.Z)(i);function i(){return(0,g.Z)(this,i),n.apply(this,arguments)}return(0,b.Z)(i,[{key:"enum_values",get:function(){return(0,y.Z)(e)}}]),i}(Y)}n.EnumProperty=Y,Y.__name__="EnumProperty",n.Enum=J;var W=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"enum_values",get:function(){return(0,y.Z)(l.Direction)}},{key:"normalize",value:function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)switch(e[n]){case"clock":t[n]=0;break;case"anticlock":t[n]=1}return t}}]),n}(Y);n.Direction=W,W.__name__="Direction",n.Anchor=J(l.Anchor),n.AngleUnits=J(l.AngleUnits),n.BoxOrigin=J(l.BoxOrigin),n.ButtonType=J(l.ButtonType),n.CalendarPosition=J(l.CalendarPosition),n.Dimension=J(l.Dimension),n.Dimensions=J(l.Dimensions),n.Distribution=J(l.Distribution),n.FontStyle=J(l.FontStyle),n.HatchPatternType=J(l.HatchPatternType),n.HTTPMethod=J(l.HTTPMethod),n.HexTileOrientation=J(l.HexTileOrientation),n.HoverMode=J(l.HoverMode),n.LatLon=J(l.LatLon),n.LegendClickPolicy=J(l.LegendClickPolicy),n.LegendLocation=J(l.LegendLocation),n.LineCap=J(l.LineCap),n.LineJoin=J(l.LineJoin),n.LinePolicy=J(l.LinePolicy),n.Location=J(l.Location),n.Logo=J(l.Logo),n.MarkerType=J(l.MarkerType),n.MutedPolicy=J(l.MutedPolicy),n.Orientation=J(l.Orientation),n.OutputBackend=J(l.OutputBackend),n.PaddingUnits=J(l.PaddingUnits),n.Place=J(l.Place),n.PointPolicy=J(l.PointPolicy),n.RadiusDimension=J(l.RadiusDimension),n.RenderLevel=J(l.RenderLevel),n.RenderMode=J(l.RenderMode),n.ResetPolicy=J(l.ResetPolicy),n.RoundingFunction=J(l.RoundingFunction),n.Side=J(l.Side),n.SizingMode=J(l.SizingMode),n.Sort=J(l.Sort),n.SpatialUnits=J(l.SpatialUnits),n.StartEnd=J(l.StartEnd),n.StepMode=J(l.StepMode),n.TapBehavior=J(l.TapBehavior),n.TextAlign=J(l.TextAlign),n.TextBaseline=J(l.TextBaseline),n.TextureRepetition=J(l.TextureRepetition),n.TickLabelOrientation=J(l.TickLabelOrientation),n.TooltipAttachment=J(l.TooltipAttachment),n.UpdateMode=J(l.UpdateMode),n.VerticalAlign=J(l.VerticalAlign);var q=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"get_value",value:function(){var e=this.spec,t=e.value,n=e.expr,i=e.transform;return null!=n||null!=i?this.spec:t}},{key:"_update",value:function(e){C(e)?this.spec=e:this.spec={value:e},null!=this.spec.value&&this.validate(this.spec.value)}},{key:"materialize",value:function(e){return e}},{key:"scalar",value:function(e,t){return new T.UniformScalar(e,t)}},{key:"uniform",value:function(e){var t,n=this.spec,i=n.expr,r=n.value,a=n.transform,o=null!==(t=e.get_length())&&void 0!==t?t:1;if(null!=i){var s=i.compute(e);return null!=a&&(s=a.compute(s)),s=this.materialize(s),this.scalar(s,o)}var l=r;return null!=a&&(l=a.compute(l)),l=this.materialize(l),this.scalar(l,o)}}]),n}(z);n.ScalarSpec=q,q.__name__="ScalarSpec";var X=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);n.AnyScalar=X,X.__name__="AnyScalar";var K=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);n.ColorScalar=K,K.__name__="ColorScalar";var Q=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);n.NumberScalar=Q,Q.__name__="NumberScalar";var $=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);
2n.StringScalar=$,$.__name__="StringScalar";var ee=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);n.NullStringScalar=ee,ee.__name__="NullStringScalar";var te=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);n.ArrayScalar=te,te.__name__="ArrayScalar";var ne=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);n.LineJoinScalar=ne,ne.__name__="LineJoinScalar";var ie=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);n.LineCapScalar=ie,ie.__name__="LineCapScalar";var re=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);n.LineDashScalar=re,re.__name__="LineDashScalar";var ae=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_default_override",value:function(){return A.settings.dev?"Bokeh":void 0}}]),n}(q);n.FontScalar=ae,ae.__name__="FontScalar";var oe=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);n.FontSizeScalar=oe,oe.__name__="FontSizeScalar";var se=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);n.FontStyleScalar=se,se.__name__="FontStyleScalar";var le=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);n.TextAlignScalar=le,le.__name__="TextAlignScalar";var ue=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(q);n.TextBaselineScalar=ue,ue.__name__="TextBaselineScalar";var ce=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"get_value",value:function(){return null===this.spec.value?null:this.spec}},{key:"_update",value:function(e){C(e)?this.spec=e:this.spec={value:e},null!=this.spec.value&&this.validate(this.spec.value)}},{key:"materialize",value:function(e){return e}},{key:"v_materialize",value:function(e){return e}},{key:"scalar",value:function(e,t){return new T.UniformScalar(e,t)}},{key:"vector",value:function(e){return new T.UniformVector(e)}},{key:"uniform",value:function(e){var t,n=this.spec,i=n.field,r=n.expr,a=n.value,o=n.transform,l=null!==(t=e.get_length())&&void 0!==t?t:1;if(null!=i){var u=e.get_column(i);return null!=u?(null!=o&&(u=o.v_compute(u)),u=this.v_materialize(u),this.vector(u)):(s.logger.warn("attempted to retrieve property array for nonexistent field '".concat(i,"'")),this.scalar(null,l))}if(null!=r){var c=r.v_compute(e);return null!=o&&(c=o.v_compute(c)),c=this.v_materialize(c),this.vector(c)}var h=a;return null!=o&&(h=o.compute(h)),h=this.materialize(h),this.scalar(h,l)}},{key:"array",value:function(e){var t,n,i=null!==(t=e.get_length())&&void 0!==t?t:1;if(null!=this.spec.field){var r=e.get_column(this.spec.field);if(null!=r)n=this.normalize(r);else{s.logger.warn("attempted to retrieve property array for nonexistent field '".concat(this.spec.field,"'"));var a=new Float64Array(i);a.fill(NaN),n=a}}else if(null!=this.spec.expr)n=this.normalize(this.spec.expr.v_compute(e));else{var o=this._value(!1);if((0,Z.isNumber)(o)){var l=new Float64Array(i);l.fill(o),n=l}else n=(0,c.repeat)(o,i)}return null!=this.spec.transform&&(n=this.spec.transform.v_compute(n)),n}}]),n}(z);n.VectorSpec=ce,ce.__name__="VectorSpec";var he=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(ce);n.DataSpec=he,he.__name__="DataSpec";var _e=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_update",value:function(e){(0,_.Z)((0,d.Z)(n.prototype),"_update",this).call(this,e);var t=this.spec.units;if(null!=t&&!(0,c.includes)(this.valid_units,t))throw new Error("units must be one of ".concat(this.valid_units.join(", "),"; got: ").concat(t))}},{key:"units",get:function(){var e;return null!==(e=this.spec.units)&&void 0!==e?e:this.default_units},set:function(e){e!=this.default_units?this.spec.units=e:delete this.spec.units}}]),n}(ce);n.UnitsSpec=_e,_e.__name__="UnitsSpec";var de=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"array",value:function(e){return new Float64Array((0,_.Z)((0,d.Z)(n.prototype),"array",this).call(this,e))}}]),n}(_e);n.NumberUnitsSpec=de,de.__name__="NumberUnitsSpec";var fe=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.BaseCoordinateSpec=fe,fe.__name__="BaseCoordinateSpec";var ve=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(fe);n.CoordinateSpec=ve,ve.__name__="CoordinateSpec";var pe=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(fe);n.CoordinateSeqSpec=pe,pe.__name__="CoordinateSeqSpec";var me=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(fe);n.CoordinateSeqSeqSeqSpec=me,me.__name__="CoordinateSeqSeqSeqSpec";var ye=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments)).dimension="x",e}return(0,b.Z)(n)}(ve);n.XCoordinateSpec=ye,ye.__name__="XCoordinateSpec";var ge=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments)).dimension="y",e}return(0,b.Z)(n)}(ve);
2n.YCoordinateSpec=ge,ge.__name__="YCoordinateSpec";var be=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments)).dimension="x",e}return(0,b.Z)(n)}(pe);n.XCoordinateSeqSpec=be,be.__name__="XCoordinateSeqSpec";var we=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments)).dimension="y",e}return(0,b.Z)(n)}(pe);n.YCoordinateSeqSpec=we,we.__name__="YCoordinateSeqSpec";var xe=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments)).dimension="x",e}return(0,b.Z)(n)}(me);n.XCoordinateSeqSeqSeqSpec=xe,xe.__name__="XCoordinateSeqSeqSeqSpec";var ke=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments)).dimension="y",e}return(0,b.Z)(n)}(me);n.YCoordinateSeqSeqSeqSpec=ke,ke.__name__="YCoordinateSeqSeqSeqSpec";var Ze=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"default_units",get:function(){return"rad"}},{key:"valid_units",get:function(){return(0,y.Z)(l.AngleUnits)}},{key:"materialize",value:function(e){return e*-(0,f.to_radians_coeff)(this.units)}},{key:"v_materialize",value:function(e){var t=-(0,f.to_radians_coeff)(this.units),n=new Float32Array(e.length);return(0,h.mul)(e,t,n),n}},{key:"array",value:function(e){throw new Error("not supported")}}]),n}(de);n.AngleSpec=Ze,Ze.__name__="AngleSpec";var Ae=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"default_units",get:function(){return"data"}},{key:"valid_units",get:function(){return(0,y.Z)(l.SpatialUnits)}}]),n}(de);n.DistanceSpec=Ae,Ae.__name__="DistanceSpec";var Se=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"materialize",value:function(e){return null!=e?e:NaN}}]),n}(Ae);n.NullDistanceSpec=Se,Se.__name__="NullDistanceSpec";var Te=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"v_materialize",value:function(e){return new Uint8Array(e)}},{key:"array",value:function(e){return new Uint8Array((0,_.Z)((0,d.Z)(n.prototype),"array",this).call(this,e))}}]),n}(he);n.BooleanSpec=Te,Te.__name__="BooleanSpec";var Me=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"v_materialize",value:function(e){return(0,Z.isTypedArray)(e)?e:new Int32Array(e)}},{key:"array",value:function(e){return new Int32Array((0,_.Z)((0,d.Z)(n.prototype),"array",this).call(this,e))}}]),n}(he);n.IntSpec=Me,Me.__name__="IntSpec";var Ce=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"v_materialize",value:function(e){return(0,Z.isTypedArray)(e)?e:new Float64Array(e)}},{key:"array",value:function(e){return new Float64Array((0,_.Z)((0,d.Z)(n.prototype),"array",this).call(this,e))}}]),n}(he);n.NumberSpec=Ce,Ce.__name__="NumberSpec";var ze=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return(0,Z.isNumber)(e)&&e>=0}}]),n}(Ce);n.ScreenSizeSpec=ze,ze.__name__="ScreenSizeSpec";var Ee=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"materialize",value:function(e){return(0,m.encode_rgba)((0,m.color2rgba)(e))}},{key:"v_materialize",value:function(e){if(!(0,S.is_NDArray)(e)){var t,n=e.length,i=new u.RGBAArray(4*n),r=0,a=(0,w.Z)(e);try{for(a.s();!(t=a.n()).done;){var o=t.value,s=(0,m.color2rgba)(o),l=(0,k.Z)(s,4),c=l[0],h=l[1],_=l[2],d=l[3];i[r++]=c,i[r++]=h,i[r++]=_,i[r++]=d}}catch(I){a.e(I)}finally{a.f()}return new u.ColorArray(i.buffer)}if("uint32"==e.dtype&&1==e.dimension)return(0,x.to_big_endian)(e);if("uint8"==e.dtype&&1==e.dimension){var f,v=(0,k.Z)(e.shape,1)[0],p=new u.RGBAArray(4*v),y=0,g=(0,w.Z)(e);try{for(g.s();!(f=g.n()).done;){var b=f.value;p[y++]=b,p[y++]=b,p[y++]=b,p[y++]=255}}catch(I){g.e(I)}finally{g.f()}return new u.ColorArray(p.buffer)}if("uint8"==e.dtype&&2==e.dimension){var Z=(0,k.Z)(e.shape,2),A=Z[0],T=Z[1];if(4==T)return new u.ColorArray(e.buffer);if(3==T){for(var M=new u.RGBAArray(4*A),C=0,z=0;C<T*A;)M[z++]=e[C++],M[z++]=e[C++],M[z++]=e[C++],M[z++]=255;return new u.ColorArray(M.buffer)}}else if(("float32"==e.dtype||"float64"==e.dtype)&&2==e.dimension){var E=(0,k.Z)(e.shape,2),R=E[0],B=E[1];if(3==B||4==B){for(var N=new u.RGBAArray(4*R),O=0,D=0;O<B*R;)N[D++]=255*e[O++],N[D++]=255*e[O++],N[D++]=255*e[O++],N[D++]=255*(3==B?1:e[O++]);return new u.ColorArray(N.buffer)}}throw new Error("invalid color array")}},{key:"vector",value:function(e){return new T.ColorUniformVector(e)}}]),n}(he);n.ColorSpec=Ee,Ee.__name__="ColorSpec";var Re=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.NDArraySpec=Re,Re.__name__="NDArraySpec";var Be=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.AnySpec=Be,Be.__name__="AnySpec";var Ne=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);
2n.StringSpec=Ne,Ne.__name__="StringSpec";var Oe=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.NullStringSpec=Oe,Oe.__name__="NullStringSpec";var De=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.ArraySpec=De,De.__name__="ArraySpec";var Ie=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.MarkerSpec=Ie,Ie.__name__="MarkerSpec";var Pe=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.LineJoinSpec=Pe,Pe.__name__="LineJoinSpec";var Ve=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.LineCapSpec=Ve,Ve.__name__="LineCapSpec";var Le=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.LineDashSpec=Le,Le.__name__="LineDashSpec";var je=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_default_override",value:function(){return A.settings.dev?"Bokeh":void 0}}]),n}(he);n.FontSpec=je,je.__name__="FontSpec";var Ue=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.FontSizeSpec=Ue,Ue.__name__="FontSizeSpec";var Fe=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.FontStyleSpec=Fe,Fe.__name__="FontStyleSpec";var Ge=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.TextAlignSpec=Ge,Ge.__name__="TextAlignSpec";var He=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(he);n.TextBaselineSpec=He,He.__name__="TextBaselineSpec"},function(e,t,n,i,r){i();var a=e(8),o=e(13),s={},l=(0,b.Z)((function e(t,n){(0,g.Z)(this,e),this.name=t,this.level=n}));n.LogLevel=l,l.__name__="LogLevel";var u=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.INFO;(0,g.Z)(this,e),this._name=t,this.set_level(n)}return(0,b.Z)(e,[{key:"level",get:function(){return this.get_level()}},{key:"get_level",value:function(){return this._log_level}},{key:"set_level",value:function(t){if(t instanceof l)this._log_level=t;else{if(!(0,a.isString)(t)||null==e.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=e.log_levels[t]}var n,i="[".concat(this._name,"]"),r=(0,w.Z)((0,o.entries)(e.log_levels));try{for(r.s();!(n=r.n()).done;){var s=(0,k.Z)(n.value,2),u=s[0];s[1].level<this._log_level.level||this._log_level.level===e.OFF.level?this[u]=function(){}:this[u]=c(u,i)}}catch(h){r.e(h)}finally{r.f()}}},{key:"trace",value:function(){}},{key:"debug",value:function(){}},{key:"info",value:function(){}},{key:"warn",value:function(){}},{key:"error",value:function(){}}],[{key:"levels",get:function(){return Object.keys(e.log_levels)}},{key:"get",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.INFO;if(t.length>0){var i=s[t];return null==i&&(s[t]=i=new e(t,n)),i}throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")}}]),e}();function c(e,t){return null!=console[e]?console[e].bind(console,t):null!=console.log?console.log.bind(console,t):function(){}}function h(e){var t=n.logger.level;return(0,a.isString)(e)&&null==u.log_levels[e]?(console.log("[bokeh] unrecognized logging level '".concat(e,"' passed to Bokeh.set_log_level(), ignoring")),console.log("[bokeh] valid log levels are: ".concat(u.levels.join(", ")))):(console.log("[bokeh] setting log level to: '".concat((0,a.isString)(e)?e:e.level,"'")),n.logger.set_level(e)),t}n.Logger=u,u.__name__="Logger",u.TRACE=new l("trace",0),u.DEBUG=new l("debug",1),u.INFO=new l("info",2),u.WARN=new l("warn",6),u.ERROR=new l("error",7),u.FATAL=new l("fatal",8),u.OF
2F=new l("off",9),u.log_levels={trace:u.TRACE,debug:u.DEBUG,info:u.INFO,warn:u.WARN,error:u.ERROR,fatal:u.FATAL,off:u.OFF},n.logger=u.get("bokeh"),n.set_log_level=h,n.with_log_level=function(e,t){var n=h(e);try{t()}finally{h(n)}}},function(e,t,n,i,r){i(),n.VerticalAlign=void 0;var a=e(21);n.Align=(0,a.Enum)("start","center","end"),n.Anchor=(0,a.Enum)("top_left","top_center","top_right","center_left","center_center","center_right","bottom_left","bottom_center","bottom_right","top","left","center","right","bottom"),n.AngleUnits=(0,a.Enum)("deg","rad","grad","turn"),n.BoxOrigin=(0,a.Enum)("corner","center"),n.ButtonType=(0,a.Enum)("default","primary","success","warning","danger","light"),n.CalendarPosition=(0,a.Enum)("auto","above","below"),n.Dimension=(0,a.Enum)("width","height"),n.Dimensions=(0,a.Enum)("width","height","both"),n.Direction=(0,a.Enum)("clock","anticlock"),n.Distribution=(0,a.Enum)("uniform","normal"),n.FontStyle=(0,a.Enum)("normal","italic","bold","bold italic"),n.HatchPatternType=(0,a.Enum)("blank","dot","ring","horizontal_line","vertical_line","cross","horizontal_dash","vertical_dash","spiral","right_diagonal_line","left_diagonal_line","diagonal_cross","right_diagonal_dash","left_diagonal_dash","horizontal_wave","vertical_wave","criss_cross"," ",".","o","-","|","+",'"',":","@","/","\\","x",",","`","v",">","*"),n.HTTPMethod=(0,a.Enum)("POST","GET"),n.HexTileOrientation=(0,a.Enum)("pointytop","flattop"),n.HoverMode=(0,a.Enum)("mouse","hline","vline"),n.LatLon=(0,a.Enum)("lat","lon"),n.LegendClickPolicy=(0,a.Enum)("none","hide","mute"),n.LegendLocation=n.Anchor,n.LineCap=(0,a.Enum)("butt","round","square"),n.LineJoin=(0,a.Enum)("miter","round","bevel"),n.LineDash=(0,a.Enum)("solid","dashed","dotted","dotdash","dashdot"),n.LinePolicy=(0,a.Enum)("prev","next","nearest","interp","none"),n.Location=(0,a.Enum)("above","below","left","right"),n.Logo=(0,a.Enum)("normal","grey"),n.MarkerType=(0,a.Enum)("asterisk","circle","circle_cross","circle_dot","circle_x","circle_y","cross","dash","diamond","diamond_cross","diamond_dot","dot","hex","hex_dot","inverted_triangle","plus","square","square_cross","square_dot","square_pin","square_x","star","star_dot","triangle","triangle_dot","triangle_pin","x","y"),n.MutedPolicy=(0,a.Enum)("show","ignore"),n.Orientation=(0,a.Enum)("vertical","horizontal"),n.OutputBackend=(0,a.Enum)("canvas","svg","webgl"),n.PaddingUnits=(0,a.Enum)("percent","absolute"),n.Place=(0,a.Enum)("above","below","left","right","center"),n.PointPolicy=(0,a.Enum)("snap_to_data","follow_mouse","none"),n.RadiusDimension=(0,a.Enum)("x","y","max","min"),n.RenderLevel=(0,a.Enum)("image","underlay","glyph","guide","annotation","overlay"),n.RenderMode=(0,a.Enum)("canvas","css"),n.ResetPolicy=(0,a.Enum)("standard","event_only"),n.RoundingFunction=(0,a.Enum)("round","nearest","floor","rounddown","ceil","roundup"),n.SelectionMode=(0,a.Enum)("replace","append","intersect","subtract"),n.Side=(0,a.Enum)("above","below","left","right"),n.SizingMode=(0,a.Enum)("stretch_width","stretch_height","stretch_both","scale_width","scale_height","scale_both","fixed"),n.Sort=(0,a.Enum)("ascending","descending"),n.SpatialUnits=(0,a.Enum)("screen","data"),n.StartEnd=(0,a.Enum)("start","end"),n.StepMode=(0,a.Enum)("after","before","center"),n.TapBehavior=(0,a.Enum)("select","inspect"),n.TextAlign=(0,a.Enum)("left","right","center"),n.TextBaseline=(0,a.Enum)("top","middle","bottom","alphabetic","hanging","ideographic"),n.TextureRepetition=(0,a.Enum)("repeat","repeat_x","repeat_y","no_repeat"),n.TickLabelOrientation=(0,a.Enum)("vertical","horizontal","parallel","normal"),n.TooltipAttachment=(0,a.Enum)("horizontal","vertical","left","right","above","below"),n.UpdateMode=(0,a.Enum)("replace","append"),n.VerticalAlign=(0,a.Enum)("top","middle","bottom")},function(e,t,n,i,r){i();var a=(0,e(1).__importStar)(e(8)),o=e(22),s=e(13),l=window.Map,u=Object.prototype.hasOwnProperty,c=(0,b.Z)((function e(){(0,g.Z)(this,e)}));n.Kind=c,c.__name__="Kind",function(e){var t=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return!0}}]),n}(c);t.__name__="Any",e.Any=t;var n=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return!0}}]),n}(c);n.__name__="Unknown",e.Unknown=n;var i=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return a.isBoolean(e)}}]),n}(c);i.__name__="Boolean",e.Boolean=i;var r=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).obj_type=e,i}return(0,b.Z)(n,[{key:"valid",value:function(e){return!0}}]),n}(c);r.__name__="Ref",e.Ref=r;var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return!0}}]),n}(c);h.__name__="AnyRef",e.AnyRef=h;var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return a.isNumber(e)}}]),n}(c);f.__name__="Number",e.Number=f;var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return(0,_.Z)((0,d.Z)(n.prototype),"valid",this).call(this,e)&&a.isInteger(e)}}]),n}(f);m.__name__="Int",e.Int=m;var y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return(0,_.Z)((0,d.Z)(n.prototype),"valid",this).call(this,e)&&0<=e&&e<=1}}]),n}(f);y.__name__="Percent",e.Percent=y;var Z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).types=e,i.types=e,i}return(0,b.Z)(n,[{key:"valid",value:function(e){return this.types.some((function(t){return t.valid(e)}))}}]),n}(c);Z.__name__="Or",e.Or=Z;var A=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).types=e,i.types=e,i}return(0,b.Z)(n,[{key:"valid",value:function(e){if(!a.isArray(e))return!1;for(var t=0;t<this.types.length;t++){var n=this.types[t],i=e[t];if(!n.valid(i))return!1}return!0}}]),n}(c);A.__name__="Tuple",e.Tuple=A;var S=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).struct_type=e,i}return(0,b.Z)(n,[{key:"valid",value:function(e){if(!a.isPlainObject(e))return!1;var t=this.struct_type;if((0,s.size)(t)!=(0,s.size)(e))return!1;for(var n in t)if(u.call(t,n)){if(!u.call(e,n))return!1;var i=t[n],r=e[n];if(!i.valid(r))return!1}return!0}}]),n}(c);S.__name__="Struct",e.Struct=S;var T=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return a.isArray(e)||a.isTypedArray(e)}}]),n}(c);T.__name__="Arrayable",e.Arrayable=T;var M=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).item_type=e,i}return(0,b.Z)(n,[{key:"valid",value:function(e){var t=this;return a.isArray(e)&&e.every((function(e){return t.item_type.valid(e)}))}}]),n}(c);M.__name__="Array",e.Array=M;var C=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return null===e}}]),n}(c);C.__name__="Null",e.Null=C;var z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).base_type=e,i}return(0,b.Z)(n,[{key:"valid",value:function(e){return null===e||this.base_type.valid(e)}}]),n}(c);z.__name__="Nullable",e.Nullable=z;var E=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).base_type=e,i}return(0,b.Z)(n,[{key:"valid",value:function(e){return void 0===e||this.base_type.valid(e)}}]),n}(c);E.__name__="Opt",e.Opt=E;var R=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return a.isString(e)}}]),n}(c);
2R.__name__="String",e.String=R;var B=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(e){var t;return(0,g.Z)(this,i),(t=n.call(this)).values=new Set(e),t}return(0,b.Z)(i,[{key:"valid",value:function(e){return this.values.has(e)}},{key:t,value:(0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.values,"t0",1);case 1:case"end":return e.stop()}}),e,this)}))}]),i}(c,Symbol.iterator);B.__name__="Enum",e.Enum=B;var N=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).item_type=e,i}return(0,b.Z)(n,[{key:"valid",value:function(e){if(!a.isPlainObject(e))return!1;for(var t in e)if(u.call(e,t)){var n=e[t];if(!this.item_type.valid(n))return!1}return!0}}]),n}(c);N.__name__="Dict",e.Dict=N;var O=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e,i){var r;return(0,g.Z)(this,n),(r=t.call(this)).key_type=e,r.item_type=i,r}return(0,b.Z)(n,[{key:"valid",value:function(e){if(!(e instanceof l))return!1;var t,n=(0,w.Z)(e.entries());try{for(n.s();!(t=n.n()).done;){var i=(0,k.Z)(t.value,2),r=i[0],a=i[1];if(!this.key_type.valid(r)||!this.item_type.valid(a))return!1}}catch(o){n.e(o)}finally{n.f()}return!0}}]),n}(c);O.__name__="Map",e.Map=O;var D=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return(0,o.is_Color)(e)}}]),n}(c);D.__name__="Color",e.Color=D;var I=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"valid",value:function(e){return a.isFunction(e)}}]),n}(c);I.__name__="Function",e.Function=I}(n.Kinds||(n.Kinds={})),n.Any=new n.Kinds.Any,n.Unknown=new n.Kinds.Unknown,n.Boolean=new n.Kinds.Boolean,n.Number=new n.Kinds.Number,n.Int=new n.Kinds.Int,n.String=new n.Kinds.String,n.Null=new n.Kinds.Null,n.Nullable=function(e){return new n.Kinds.Nullable(e)},n.Opt=function(e){return new n.Kinds.Opt(e)},n.Or=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return new n.Kinds.Or(t)},n.Tuple=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return new n.Kinds.Tuple(t)},n.Struct=function(e){return new n.Kinds.Struct(e)},n.Arrayable=new n.Kinds.Arrayable,n.Array=function(e){return new n.Kinds.Array(e)},n.Dict=function(e){return new n.Kinds.Dict(e)},n.Map=function(e,t){return new n.Kinds.Map(e,t)},n.Enum=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return new n.Kinds.Enum(t)},n.Ref=function(e){return new n.Kinds.Ref(e)},n.AnyRef=function(){return new n.Kinds.AnyRef},n.Function=function(){return new n.Kinds.Function},n.Percent=new n.Kinds.Percent,n.Alpha=n.Percent,n.Color=new n.Kinds.Color,n.Auto=(0,n.Enum)("auto"),n.FontSize=n.String,n.Font=n.String,n.Angle=n.Number},function(e,t,n,i,r){i();var a=e(23),o=e(10),s=e(8),l=Math.round;function u(e){return(0,o.clamp)(l(e),0,255)}function c(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]}function h(e,t){var n,i,r,a,o,l,h,_,d,f,v,p;return null==e?(d=(n=[0,0,0,0])[0],f=n[1],v=n[2],p=n[3]):(0,s.isInteger)(e)?(i=c(e),d=(r=(0,k.Z)(i,4))[0],f=r[1],v=r[2],p=r[3]):(0,s.isString)(e)?(a=null!==(_=m(e))&&void 0!==_?_:[0,0,0,0],d=(o=(0,k.Z)(a,4))[0],f=o[1],v=o[2],p=o[3]):(d=(l=(0,k.Z)(e,4))[0],f=l[1],v=l[2],p=u(255*(p=void 0===(h=l[3])?1:h))),255==p&&null!=t&&(p=u(255*t)),[d,f,v,p]}n.transparent=function(){return[0,0,0,0]},n.encode_rgba=function(e){var t=(0,k.Z)(e,4);return t[0]<<24|t[1]<<16|t[2]<<8|t[3]},n.decode_rgba=c,n.compose_alpha=function(e,t){return 255==(255&e)?4294967040&e|u(255*t):e},n.color2rgba=h;var _={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"a",11:"b",12:"c",13:"d",14:"e",15:"f"};function d(e){return _[e>>4]+_[15&e]}n.color2css=function(e,t){var n=h(e,t),i=(0,k.Z)(n,4),r=i[0],a=i[1],o=i[2],s=i[3];return"rgba(".concat(r,", ").concat(a,", ").concat(o,", ").concat(s/255,")")},n.color2hex=function(e,t){var n=h(e,t),i=(0,k.Z)(n,4),r=i[0],a=i[1],o=i[2],s=i[3],l="#".concat(d(r)).concat(d(a)).concat(d(o));return 255==s?l:"".concat(l).concat(d(s))},n.color2hexrgb=function(e){var t=h(e),n=(0,k.Z)(t,3),i=n[0],r=n[1],a=n[2];
2return"#".concat(d(i)).concat(d(r)).concat(d(a))};var f=/^rgba?\(\s*([^\s,]+?)\s+([^\s,]+?)\s+([^\s,]+?)(?:\s*\/\s*([^\s,]+?))?\s*\)$/,v=/^rgba?\(\s*([^\s,]+?)\s*,\s*([^\s,]+?)\s*,\s*([^\s,]+?)(?:\s*,\s*([^\s,]+?))?\s*\)$/,p=function(){var e=document.createElement("canvas");e.width=1,e.height=1;var t=e.getContext("2d"),n=t.createLinearGradient(0,0,1,1);return function(e){t.fillStyle=n,t.fillStyle=e;var i=t.fillStyle;return i!=n?i:null}}();function m(e){var t;if(!(e=e.trim().toLowerCase()))return null;if("transparent"==e)return[0,0,0,0];if((0,a.is_named_color)(e))return c(a.named_colors[e]);if("#"==e[0]){var n=Number("0x".concat(e.substr(1)));if(isNaN(n))return null;switch(e.length-1){case 3:var i=n>>8&15,r=n>>4&15,o=n>>0&15;return[i<<4|i,r<<4|r,o<<4|o,255];case 4:var s=n>>12&15,l=n>>8&15,h=n>>4&15,_=n>>0&15;return[s<<4|s,l<<4|l,h<<4|h,_<<4|_];case 6:return[n>>16&255,n>>8&255,n>>0&255,255];case 8:return[n>>24&255,n>>16&255,n>>8&255,n>>0&255]}}else if(e.startsWith("rgb")){var d=null!==(t=e.match(f))&&void 0!==t?t:e.match(v);if(null!=d){var y=(0,k.Z)(d,5),g=y[1],b=y[2],w=y[3],x=y[4],Z=void 0===x?"1":x,A=g.endsWith("%"),S=b.endsWith("%"),T=w.endsWith("%"),M=Z.endsWith("%");if(!(A&&S&&T)&&(A||S||T))return null;A&&(g=g.slice(0,-1)),S&&(b=b.slice(0,-1)),T&&(w=w.slice(0,-1)),M&&(Z=Z.slice(0,-1));var C=Number(g),z=Number(b),E=Number(w),R=Number(Z);return isNaN(C+z+E+R)?null:(A&&(C=C/100*255),S&&(z=z/100*255),T&&(E=E/100*255),R=255*(M?R/100:R),[C=u(C),z=u(z),E=u(E),R=u(R)])}}else{var B=p(e);if(null!=B)return m(B)}return null}n.css4_parse=m,n.is_Color=function(e){return!!(0,s.isInteger)(e)||!(!(0,s.isString)(e)||null==m(e))||!(!(0,s.isArray)(e)||3!=e.length&&4!=e.length)},n.is_dark=function(e){var t=(0,k.Z)(e,3);return 1-(.299*t[0]+.587*t[1]+.114*t[2])/255>=.6}},function(e,t,n,i,r){i(),n.named_colors={aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},n.is_named_color=function(e){return e in n.named_colors}},function(e,t,n,i,r){i(),n.GeneratorFunction=Object.getPrototypeOf((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))).constructor,n.ColorArray=Uint32Array,n.RGBAArray=Uint8ClampedArray,n.infer_type=function(e,t){return e instanceof Float64Array||e instanceof Array||t instanceof Float64Array||t instanceof Array?Float64Array:Float32Array},n.ScreenArray=Float32Array,n.to_screen=function(e){return e instanceof Float32Array?e:Float32Array.from(e)},r("Indices",e(25).BitSet)},function(e,t,n,i,r){var a;i();var o=e(26),s=e(11),l=function(e,t){function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,g.Z)(this,n),this.size=e,this[a]="BitSet",this._count=null,this._nwords=Math.ceil(e/32),0==t||1==t?(this._array=new Uint32Array(this._nwords),1==t&&this._array.fill(4294967295)):((0,s.assert)(t.length==this._nwords,"Initializer size mismatch"),this._array=t)}return(0,b.Z)(n,[{key:"clone",value:function(){return new n(this.size,new Uint32Array(this._array))}},{key:e,value:function(e,t){if(!t.eq(this.size,e.size))return!1;for(var n=this._nwords,i=this.size%n,r=0==i?n:n-1,a=0;a<r;a++)if(this._array[a]!=e._array[a])return!1;if(0==i)return!0;var o=1<<i-1,s=o-1^o;return(this._array[r]&s)==(e._array[r]&s)}},{key:"_check_bounds",value:function(e){(0,s.assert)(0<=e&&e<this.size,"Out of bounds: 0 <= ".concat(e," < ").concat(this.size))}},{key:"get",value:function(e){this._check_bounds(e);var t=e>>>5,n=31&e;return!!(this._array[t]>>n&1)}},{key:"set",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._check_bounds(e),this._count=null;var n=e>>>5,i=31&e;t?this._array[n]|=1<<i:this._array[n]&=~(1<<i)}},{key:"unset",value:function(e){this.set(e,!1)}},{key:t,value:(0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.ones(),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"count",get:function(){var e=this._count;return null==e&&(this._count=e=this._get_count()),e}},{key:"_get_count",value:function(){for(var e=this._array,t=this._nwords,n=this.size,i=0,r=0,a=0;a<t;a++){var o=e[a];if(0==o)r+=32;else for(var s=0;s<32&&r<n;s++,r++)o>>>s&1&&(i+=1)}return i}},{key:"ones",value:(0,x.Z)().mark((function e(){var t,n,i,r,a,o,s;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this._array,n=this._nwords,i=this.size,r=0,a=0;case 2:if(!(a<n)){e.next=20;break}if(0==(o=t[a])){e.next=16;break}s=0;case 6:if(!(s<32&&r<i)){e.next=14;break}if(e.t0=o>>>s&1,!e.t0){e.next=11;break}return e.next=11,r;case 11:s++,r++,e.next=6;break;case 14:e.next=17;break;case 16:r+=32;case 17:a++,e.next=2;break;case 20:case"end":return e.stop()}}),e,this)}))},{key:"zeros",value:(0,x.Z)().mark((function e(){var t,n,i,r,a,o,s;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this._array,n=this._nwords,i=this.size,r=0,a=0;case 2:if(!(a<n)){e.next=20;break}if(4294967295==(o=t[a])){e.next=16;break}s=0;case 6:if(!(s<32&&r<i)){e.next=14;break}if(e.t0=o>>>s&1,e.t0){e.next=11;break}return e.next=11,r;case 11:s++,r++,e.next=6;break;case 14:e.next=17;break;case 16:r+=32;case 17:a++,e.next=2;break;case 20:case"end":return e.stop()}}),e,this)}))},{key:"_check_size",value:function(e){(0,s.assert)(this.size==e.size,"Size mismatch")}},{key:"add",value:function(e){this._check_size(e);for(var t=0;t<this._nwords;t++)this._array[t]|=e._array[t]}},{key:"intersect",value:function(e){this._check_size(e);for(var t=0;t<this._nwords;t++)this._array[t]&=e._array[t]}},{key:"subtract",value:function(e){this._check_size(e);for(var t=0;t<this._nwords;t++){var n=this._array[t],i=e._array[t];this._array[t]=(n^i)&n}}},{key:"union",value:function(e){this._check_size(e);for(var t=this.clone(),n=0;n<this._nwords;n++)t._array[n]|=e._array[n];return t}},{key:"intersection",value:function(e){this._check_size(e);for(var t=this.clone(),n=0;n<this._nwords;n++)t._array[n]&=e._array[n];return t}},{key:"difference",value:function(e){this._check_size(e);for(var t=this.clone(),n=0;n<this._nwords;n++){var i=this._array[n],r=e._array[n];
2t._array[n]=(i^r)&i}return t}},{key:"select",value:function(e){(0,s.assert)(this.size<=e.length,"Size mismatch");var t,n=this.count,i=new e.constructor(n),r=0,a=(0,w.Z)(this);try{for(a.s();!(t=a.n()).done;){var o=t.value;i[r++]=e[o]}}catch(l){a.e(l)}finally{a.f()}return i}}],[{key:"all_set",value:function(e){return new n(e,1)}},{key:"all_unset",value:function(e){return new n(e,0)}},{key:"from_indices",value:function(e,t){var i,r=new n(e),a=(0,w.Z)(t);try{for(a.s();!(i=a.n()).done;){var o=i.value;r.set(o)}}catch(s){a.e(s)}finally{a.f()}return r}},{key:"from_booleans",value:function(e,t){for(var i=new n(e),r=Math.min(e,t.length),a=0;a<r;a++)t[a]&&i.set(a);return i}}]),n}((a=Symbol.toStringTag,o.equals),Symbol.iterator);n.BitSet=l,l.__name__="BitSet"},function(e,t,n,i,r){i();var a=e(8),o=Object.prototype.hasOwnProperty;function s(e){return(0,a.isObject)(e)&&void 0!==e[n.equals]}n.equals=Symbol("equals"),n.wildcard=Symbol("wildcard");var l=Object.prototype.toString,u=function(){function e(){(0,g.Z)(this,e),this.a_stack=[],this.b_stack=[]}return(0,b.Z)(e,[{key:"eq",value:function(e,t){var i=this;if(Object.is(e,t))return!0;if(e===n.wildcard||t===n.wildcard)return!0;if(null==e||null==t)return e===t;var r=l.call(e);if(r!=l.call(t))return!1;switch(r){case"[object Number]":return this.numbers(e,t);case"[object RegExp]":case"[object String]":return"".concat(e)=="".concat(t);case"[object Date]":case"[object Boolean]":return+e==+t}for(var a=this.a_stack,o=this.b_stack,u=a.length;u--;)if(a[u]===e)return o[u]===t;a.push(e),o.push(t);var c=function(){if(s(e)&&s(t))return e[n.equals](t,i);switch(r){case"[object Array]":case"[object Uint8Array]":case"[object Int8Array]":case"[object Uint16Array]":case"[object Int16Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":return i.arrays(e,t);case"[object Map]":return i.maps(e,t);case"[object Set]":return i.sets(e,t);case"[object Object]":if(e.constructor==t.constructor&&(null==e.constructor||e.constructor===Object))return i.objects(e,t);case"[object Function]":if(e.constructor==t.constructor&&e.constructor===Function)return i.eq("".concat(e),"".concat(t))}if(e instanceof Node)return i.nodes(e,t);throw Error("can't compare objects of type ".concat(r))}();return a.pop(),o.pop(),c}},{key:"numbers",value:function(e,t){return Object.is(e,t)}},{key:"arrays",value:function(e,t){var n=e.length;if(n!=t.length)return!1;for(var i=0;i<n;i++)if(!this.eq(e[i],t[i]))return!1;return!0}},{key:"iterables",value:function(e,t){for(var n=e[Symbol.iterator](),i=t[Symbol.iterator]();;){var r=n.next(),a=i.next();if(r.done&&a.done)return!0;if(r.done||a.done)return!1;if(!this.eq(r.value,a.value))return!1}}},{key:"maps",value:function(e,t){if(e.size!=t.size)return!1;var n,i=(0,w.Z)(e);try{for(i.s();!(n=i.n()).done;){var r=(0,k.Z)(n.value,2),a=r[0],o=r[1];if(!t.has(a)||!this.eq(o,t.get(a)))return!1}}catch(s){i.e(s)}finally{i.f()}return!0}},{key:"sets",value:function(e,t){if(e.size!=t.size)return!1;var n,i=(0,w.Z)(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(!t.has(r))return!1}}catch(a){i.e(a)}finally{i.f()}return!0}},{key:"objects",value:function(e,t){var n=Object.keys(e);if(n.length!=Object.keys(t).length)return!1;for(var i=0,r=n;i<r.length;i++){var a=r[i];if(!o.call(t,a)||!this.eq(e[a],t[a]))return!1}return!0}},{key:"nodes",value:function(e,t){return e.nodeType==t.nodeType&&e.textContent==t.textContent&&!!this.iterables(e.childNodes,t.childNodes)}}]),e}();n.Comparator=u,u.__name__="Comparator";var c=Math.abs,h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e-4;return(0,g.Z)(this,n),(e=t.call(this)).tolerance=i,e}return(0,b.Z)(n,[{key:"numbers",value:function(e,t){return(0,_.Z)((0,d.Z)(n.prototype),"numbers",this).call(this,e,t)||c(e-t)<this.tolerance}}]),n}(u);function f(e,t){return(new u).eq(e,t)}n.SimilarComparator=h,h.__name__="SimilarComparator",n.is_equal=f,n.is_similar=function(e,t,n){return new h(n).eq(e,t)},n.isEqual=f},function(e,t,n,i,r){i(),n.is_windows=navigator.appVersion.includes("Windows"),n.is_ie=function(){var e=navigator.userAgent;return e.includes("MSIE")||e.includes("Trident")||e.includes("Edge")}(),n.is_mobile="undefined"!=typeof window&&("ontouchstart"in window||navigator.maxTouchPoints>0),n.is_little_endian=function(){var e=new ArrayBuffer(4),t=new Uint8Array(e);new Uint32Array(e)[1]=168496141;var n=!0;return 10==t[4]&&11==t[5]&&12==t[6]&&13==t[7]&&(n=!1),n}(),n.BYTE_ORDER=n.is_little_endian?"little":"big",n.to_big_endian=function(e){if(n.is_little_endian){var t,i=new Uint32Array(e.length),r=new DataView(i.buffer),a=0,o=(0,w.Z)(e);try{for(o.s();!(t=o.n()).done;){var s=t.value;r.setUint32(a,s),a+=4}}catch(l){o.e(l)}finally{o.f()}return i}return e}},function(e,t,n,i,r){i();var a=function(){function e(){(0,g.Z)(this,e),this._dev=!1,this._wireframe=!1,this._force_webgl=!1}return(0,b.Z)(e,[{key:"dev",get:function(){return this._dev},set:function(e){this._dev=e}},{key:"wireframe",get:function(){return this._wireframe},set:function(e){this._wireframe=e}},{key:"force_webgl",get:function(){return this._force_webgl},set:function(e){this._force_webgl=e}}]),e}();n.Settings=a,a.__name__="Settings",n.settings=new a},function(e,t,n,i,r){var a,o,s,l,u,c,h,_;i();var d=e(8),y=e(11),w=e(26),x=e(30),k=e(31),Z=Symbol("__ndarray__"),A=function(e,t,n){(0,v.Z)(r,e);var i=(0,p.Z)(r);function r(e,t){var n;return(0,g.Z)(this,r),(n=i.call(this,e))[a]=!0,n.dtype="uint8",n.shape=null!=t?t:B(e)?e.shape:[n.length],n.dimension=n.shape.length,null==n[w.equals]&&(n[w.equals]=function(e,t){return r.prototype[w.equals].call((0,f.Z)(n),e,t)}
2),null==n[x.serialize]&&(n[x.serialize]=function(e){return r.prototype[x.serialize].call((0,f.Z)(n),e)}),n}return(0,b.Z)(r,[{key:t,value:function(e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}},{key:n,value:function(e){return(0,k.encode_NDArray)(this)}}]),r}((0,m.Z)(Uint8Array),(a=Z,w.equals),x.serialize);n.Uint8NDArray=A,A.__name__="Uint8NDArray";var S=function(e,t,n){(0,v.Z)(r,e);var i=(0,p.Z)(r);function r(e,t){var n;return(0,g.Z)(this,r),(n=i.call(this,e))[o]=!0,n.dtype="int8",n.shape=null!=t?t:B(e)?e.shape:[n.length],n.dimension=n.shape.length,null==n[w.equals]&&(n[w.equals]=function(e,t){return r.prototype[w.equals].call((0,f.Z)(n),e,t)}),null==n[x.serialize]&&(n[x.serialize]=function(e){return r.prototype[x.serialize].call((0,f.Z)(n),e)}),n}return(0,b.Z)(r,[{key:t,value:function(e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}},{key:n,value:function(e){return(0,k.encode_NDArray)(this)}}]),r}((0,m.Z)(Int8Array),(o=Z,w.equals),x.serialize);n.Int8NDArray=S,S.__name__="Int8NDArray";var T=function(e,t,n){(0,v.Z)(r,e);var i=(0,p.Z)(r);function r(e,t){var n;return(0,g.Z)(this,r),(n=i.call(this,e))[s]=!0,n.dtype="uint16",n.shape=null!=t?t:B(e)?e.shape:[n.length],n.dimension=n.shape.length,null==n[w.equals]&&(n[w.equals]=function(e,t){return r.prototype[w.equals].call((0,f.Z)(n),e,t)}
2),null==n[x.serialize]&&(n[x.serialize]=function(e){return r.prototype[x.serialize].call((0,f.Z)(n),e)}),n}return(0,b.Z)(r,[{key:t,value:function(e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}},{key:n,value:function(e){return(0,k.encode_NDArray)(this)}}]),r}((0,m.Z)(Uint16Array),(s=Z,w.equals),x.serialize);n.Uint16NDArray=T,T.__name__="Uint16NDArray";var M=function(e,t,n){(0,v.Z)(r,e);var i=(0,p.Z)(r);function r(e,t){var n;return(0,g.Z)(this,r),(n=i.call(this,e))[l]=!0,n.dtype="int16",n.shape=null!=t?t:B(e)?e.shape:[n.length],n.dimension=n.shape.length,null==n[w.equals]&&(n[w.equals]=function(e,t){return r.prototype[w.equals].call((0,f.Z)(n),e,t)}),null==n[x.serialize]&&(n[x.serialize]=function(e){return r.prototype[x.serialize].call((0,f.Z)(n),e)}),n}return(0,b.Z)(r,[{key:t,value:function(e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}},{key:n,value:function(e){return(0,k.encode_NDArray)(this)}}]),r}((0,m.Z)(Int16Array),(l=Z,w.equals),x.serialize);n.Int16NDArray=M,M.__name__="Int16NDArray";var C=function(e,t,n){(0,v.Z)(r,e);var i=(0,p.Z)(r);function r(e,t){var n;return(0,g.Z)(this,r),(n=i.call(this,e))[u]=!0,n.dtype="uint32",n.shape=null!=t?t:B(e)?e.shape:[n.length],n.dimension=n.shape.length,null==n[w.equals]&&(n[w.equals]=function(e,t){return r.prototype[w.equals].call((0,f.Z)(n),e,t)}
2),null==n[x.serialize]&&(n[x.serialize]=function(e){return r.prototype[x.serialize].call((0,f.Z)(n),e)}),n}return(0,b.Z)(r,[{key:t,value:function(e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}},{key:n,value:function(e){return(0,k.encode_NDArray)(this)}}]),r}((0,m.Z)(Uint32Array),(u=Z,w.equals),x.serialize);n.Uint32NDArray=C,C.__name__="Uint32NDArray";var z=function(e,t,n){(0,v.Z)(r,e);var i=(0,p.Z)(r);function r(e,t){var n;return(0,g.Z)(this,r),(n=i.call(this,e))[c]=!0,n.dtype="int32",n.shape=null!=t?t:B(e)?e.shape:[n.length],n.dimension=n.shape.length,null==n[w.equals]&&(n[w.equals]=function(e,t){return r.prototype[w.equals].call((0,f.Z)(n),e,t)}),null==n[x.serialize]&&(n[x.serialize]=function(e){return r.prototype[x.serialize].call((0,f.Z)(n),e)}),n}return(0,b.Z)(r,[{key:t,value:function(e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}},{key:n,value:function(e){return(0,k.encode_NDArray)(this)}}]),r}((0,m.Z)(Int32Array),(c=Z,w.equals),x.serialize);n.Int32NDArray=z,z.__name__="Int32NDArray";var E=function(e,t,n){(0,v.Z)(r,e);var i=(0,p.Z)(r);function r(e,t){var n;return(0,g.Z)(this,r),(n=i.call(this,e))[h]=!0,n.dtype="float32",n.shape=null!=t?t:B(e)?e.shape:[n.length],n.dimension=n.shape.length,null==n[w.equals]&&(n[w.equals]=function(e,t){return r.prototype[w.equals].call((0,f.Z)(n),e,t)}
2),null==n[x.serialize]&&(n[x.serialize]=function(e){return r.prototype[x.serialize].call((0,f.Z)(n),e)}),n}return(0,b.Z)(r,[{key:t,value:function(e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}},{key:n,value:function(e){return(0,k.encode_NDArray)(this)}}]),r}((0,m.Z)(Float32Array),(h=Z,w.equals),x.serialize);n.Float32NDArray=E,E.__name__="Float32NDArray";var R=function(e,t,n){(0,v.Z)(r,e);var i=(0,p.Z)(r);function r(e,t){var n;return(0,g.Z)(this,r),(n=i.call(this,e))[_]=!0,n.dtype="float64",n.shape=null!=t?t:B(e)?e.shape:[n.length],n.dimension=n.shape.length,null==n[w.equals]&&(n[w.equals]=function(e,t){return r.prototype[w.equals].call((0,f.Z)(n),e,t)}),null==n[x.serialize]&&(n[x.serialize]=function(e){return r.prototype[x.serialize].call((0,f.Z)(n),e)}),n}return(0,b.Z)(r,[{key:t,value:function(e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}},{key:n,value:function(e){return(0,k.encode_NDArray)(this)}}]),r}((0,m.Z)(Float64Array),(_=Z,w.equals),x.serialize);function B(e){return(0,d.isObject)(e)&&void 0!==e[Z]}n.Float64NDArray=R,R.__name__="Float64NDArray",n.is_NDArray=B,n.ndarray=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.dtype;null==n&&(n=e instanceof ArrayBuffer||(0,d.isArray)(e)?"float64":function(){switch(!0){case e instanceof Uint8Array:return"uint8";case e instanceof Int8Array:return"int8";case e instanceof Uint16Array:return"uint16";case e instanceof Int16Array:return"int16";case e instanceof Uint32Array:return"uint32";case e instanceof Int32Array:return"int32";case e instanceof Float32Array:return"float32";case e instanceof Float64Array:return"float64";default:(0,y.unreachable)()}}());var i=t.shape;switch(n){case"uint8":return new A(e,i);case"int8":return new S(e,i);case"uint16":return new T(e,i);case"int16":return new M(e,i);case"uint32":return new C(e,i);case"int32":return new z(e,i);case"float32":return new E(e,i);case"float64":return new R(e,i)}}},function(e,t,n,i,r){i();var a=e(11),o=e(13),s=e(8);n.serialize=Symbol("serialize");var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}((0,m.Z)(Error));n.SerializationError=l,l.__name__="SerializationError";var u=function(){function e(t){var n;(0,g.Z)(this,e),this._references=new Map,this._definitions=new Map,this._refmap=new Map,this.include_defaults=null===(n=null==t?void 0:t.include_defaults)||void 0===n||n}return(0,b.Z)(e,[{key:"get_ref",value:function(e){return this._references.get(e)}},{key:"add_ref",value:function(e,t){(0,a.assert)(!this._references.has(e)),this._references.set(e,t)}},{key:"add_def",value:function(e,t){var n=this.get_ref(e);(0,a.assert)(null!=n),this._definitions.set(e,t),this._refmap.set(n,t)}},{key:"objects",get:function(){return new Set(this._references.keys())}},{key:"references",get:function(){return new Set(this._references.values())}},{key:"definitions",get:function(){return new Set(this._definitions.values())}},{key:"resolve_ref",value:function(e){return this._refmap.get(e)}},{key:"remove_ref",value:function(e){return this._references.delete(e)}},{key:"remove_def",value:function(e){return this._definitions.delete(e)}},{key:"to_serializable",value:function(e){var t=this.get_ref(e);if(null!=t)return t;if(function(e){return(0,s.isObject)(e)&&void 0!==e[n.serialize]}(e))return e[n.serialize](this);if((0,s.isArray)(e)||(0,s.isTypedArray)(e)){for(var i=e.length,r=new Array(i),a=0;a<i;a++){var u=e[a];r[a]=this.to_serializable(u)}return r}if((0,s.isPlainObject)(e)){var c,h={},_=(0,w.Z)((0,o.entries)(e));try{for(_.s();!(c=_.n()).done;){var d=(0,k.Z)(c.value,2),f=d[0],v=d[1];h[f]=this.to_serializable(v)}}catch(p){_.e(p)}finally{_.f()}return h}if(null===e||(0,s.isBoolean)(e)||(0,s.isNumber)(e)||(0,s.isString)(e))return e;throw new l("".concat(Object.prototype.toString.call(e)," is not serializable"))}}]),e}();n.Serializer=u,u.__name__="Serializer"},function(e,t,n,i,r){i();var a=e(8),o=e(27),s=e(32);n.is_NDArray_ref=function(e){return(0,a.isPlainObject)(e)&&("__buffer__"in e||"__ndarray__"in e)},n.decode_NDArray=function(e,t){var n,i=e.shape,r=e.dtype,a=e.order;if("__buffer__"in e){var l=t.get(e.__buffer__);if(null==l)throw new Error("buffer for ".concat(e.__buffer__," not found"));n=l}else n=(0,s.base64_to_buffer)(e.__ndarray__);return a!==o.BYTE_ORDER&&(0,s.swap)(n,r),{buffer:n,dtype:r,shape:i}},n.encode_NDArray=function(e,t){var n={order:o.BYTE_ORDER,dtype:e.dtype,shape:e.shape};if(null!=t){var i="".concat(t.size);return t.set(i,e.buffer),Object.assign({__buffer__:i},n)}var r={toJSON:function(){return(0,s.buffer_to_base64)(e.buffer)}};return Object.assign({__ndarray__:r},n)}},function(e,t,n,i,r){i(),n.buffer_to_base64=function(e){var t=new Uint8Array(e),n=Array.from(t).map((function(e){return String.fromCharCode(e)}));return btoa(n.join(""))},n.base64_to_buffer=function(e){for(var t=atob(e),n=t.length,i=new Uint8Array(n),r=0,a=n;r<a;r++)i[r]=t.charCodeAt(r);return i.buffer},n.swap=function(e,t){switch(t){case"uint16":case"int16":!function(e){for(var t=new Uint8Array(e),n=0,i=t.length;n<i;n+=2){var r=t[n];t[n]=t[n+1],t[n+1]=r}}(e);break;case"uint32":case"int32":case"float32":!function(e){for(var t=new Uint8Array(e),n=0,i=t.length;n<i;n+=4){var r=t[n];t[n]=t[n+3],t[n+3]=r,r=t[n+1],t[n+1]=t[n+2],t[n+2]=r}}(e);break;case"float64":!function(e){for(var t=new Uint8Array(e),n=0,i=t.length;n<i;n+=8){var r=t[n];
2t[n]=t[n+7],t[n+7]=r,r=t[n+1],t[n+1]=t[n+6],t[n+6]=r,r=t[n+2],t[n+2]=t[n+5],t[n+5]=r,r=t[n+3],t[n+3]=t[n+4],t[n+4]=r}}(e)}}},function(e,t,n,i,r){i();var a=e(26),o=function(){function e(){(0,g.Z)(this,e)}return(0,b.Z)(e,[{key:"is_Scalar",value:function(){return this.is_scalar}},{key:"is_Vector",value:function(){return!this.is_scalar}}]),e}();n.Uniform=o,o.__name__="Uniform";var s=function(e,t,n){(0,v.Z)(r,e);var i=(0,p.Z)(r);function r(e,t){var n;return(0,g.Z)(this,r),(n=i.call(this)).value=e,n.length=t,n.is_scalar=!0,n}return(0,b.Z)(r,[{key:"get",value:function(e){return this.value}},{key:t,value:(0,x.Z)().mark((function e(){var t,n,i;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.length,n=this.value,i=0;case 2:if(!(i<t)){e.next=8;break}return e.next=5,n;case 5:i++,e.next=2;break;case 8:case"end":return e.stop()}}),e,this)}))},{key:"select",value:function(e){return new r(this.value,e.count)}},{key:n,value:function(e,t){return t.eq(this.length,e.length)&&t.eq(this.value,e.value)}}]),r}(o,Symbol.iterator,a.equals);n.UniformScalar=s,s.__name__="UniformScalar";var l=function(e,t,n){(0,v.Z)(r,e);var i=(0,p.Z)(r);function r(e){var t;return(0,g.Z)(this,r),(t=i.call(this)).array=e,t.is_scalar=!1,t.length=t.array.length,t}return(0,b.Z)(r,[{key:"get",value:function(e){return this.array[e]}},{key:t,value:(0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.array,"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"select",value:function(e){var t=e.select(this.array);return new this.constructor(t)}},{key:n,value:function(e,t){return t.eq(this.length,e.length)&&t.eq(this.array,e.array)}}]),r}(o,Symbol.iterator,a.equals);n.UniformVector=l,l.__name__="UniformVector";var u=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(e){var t;return(0,g.Z)(this,i),(t=n.call(this,e)).array=e,t._view=new DataView(e.buffer),t}return(0,b.Z)(i,[{key:"get",value:function(e){return this._view.getUint32(4*e)}},{key:t,value:(0,x.Z)().mark((function e(){var t,n;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.length,n=0;case 2:if(!(n<t)){e.next=8;break}return e.next=5,this.get(n);case 5:n++,e.next=2;break;case 8:case"end":return e.stop()}}),e,this)}))}]),i}(l,Symbol.iterator);n.ColorUniformVector=u,u.__name__="ColorUniformVector"},function(e,t,n,i,r){i();var a=e(28);function o(){for(var e=new Array(32),t="0123456789ABCDEF",n=0;n<32;n++)e[n]=t.substr(Math.floor(16*Math.random()),1);return e[12]="4",e[16]=t.substr(3&e[16].charCodeAt(0)|8,1),e.join("")}n.startsWith=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e.substr(n,t.length)==t},n.uuid4=o;var s=1e3;n.uniqueId=function(e){var t=a.settings.dev?"j"+s++:o();return null!=e?"".concat(e,"-").concat(t):t},n.escape=function(e){return e.replace(/(?:[&<>"'`])/g,(function(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&#x27;";case"`":return"&#x60;";default:return e}}))},n.unescape=function(e){return e.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,(function(e,t){switch(t){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"#x27":return"'";case"#x60":return"`";default:return t}}))},n.use_strict=function(e){return"'use strict';\n".concat(e)},n.to_fixed=function(e,t){return e.toFixed(t).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"")}},function(e,t,n,i,r){i();var a=e(30),o=(0,b.Z)((function e(t){(0,g.Z)(this,e),this.document=t}));n.DocumentEvent=o,o.__name__="DocumentEvent";var s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e,i,r){var a;return(0,g.Z)(this,n),(a=t.call(this,e)).events=i,a.setter_id=r,a}return(0,b.Z)(n)}(o);n.DocumentEventBatch=s,s.__name__="DocumentEventBatch";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(o);n.DocumentChangedEvent=l,l.__name__="DocumentChangedEvent";var u=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(e,t,r){var a;return(0,g.Z)(this,i),(a=n.call(this,e)).msg_type=t,a.msg_data=r,a}return(0,b.Z)(i,[{key:t,value:function(e){var t=this.msg_data,n=e.to_serializable(t);return{kind:"MessageSent",msg_type:this.msg_type,msg_data:n}}}]),i}(l,a.serialize);n.MessageSentEvent=u,u.__name__="MessageSentEvent";var c=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(e,t,r,a,o,s,l){var u;return(0,g.Z)(this,i),(u=n.call(this,e)).model=t,u.attr=r,u.old=a,u.new_=o,u.setter_id=s,u.hint=l,u}return(0,b.Z)(i,[{key:t,value:function(e){if(null!=this.hint)return e.to_serializable(this.hint);var t=this.new_,n=e.to_serializable(t);return this.model!=t&&e.remove_def(this.model),{kind:"ModelChanged",model:this.model.ref(),attr:this.attr,new:n}}}]),i}(l,a.serialize);n.ModelChangedEvent=c,c.__name__="ModelChangedEvent";var h=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(e,t,r){var a;return(0,g.Z)(this,i),(a=n.call(this,e)).column_source=t,a.patches=r,a}return(0,b.Z)(i,[{key:t,value:function(e){return{kind:"ColumnsPatched",column_source:this.column_source,patches:this.patches}}}]),i}(l,a.serialize);n.ColumnsPatchedEvent=h,h.__name__="ColumnsPatchedEvent";var _=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(e,t,r,a){var o;return(0,g.Z)(this,i),(o=n.call(this,e)).column_source=t,o.data=r,o.rollover=a,o}return(0,b.Z)(i,[{key:t,value:function(e){return{kind:"ColumnsStreamed",column_source:this.column_source,data:this.data,rollover:this.rollover}}}]),i}(l,a.serialize);n.ColumnsStreamedEvent=_,_.__name__="ColumnsStreamedEvent";var d=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(e,t,r){var a;return(0,g.Z)(this,i),(a=n.call(this,e)).title=t,a.setter_id=r,a}return(0,b.Z)(i,[{key:t,value:function(e){return{kind:"TitleChanged",title:this.title}}}]),i}(l,a.serialize);n.TitleChangedEvent=d,d.__name__="TitleChangedEvent";var f=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(e,t,r){var a;return(0,g.Z)(this,i),(a=n.call(this,e)).model=t,a.setter_id=r,a}return(0,b.Z)(i,[{key:t,value:function(e){return{kind:"RootAdded",model:e.to_serializable(this.model)}}}]),i}(l,a.serialize);n.RootAddedEvent=f,f.__name__="RootAddedEvent";var m=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(e,t,r){var a;return(0,g.Z)(this,i),(a=n.call(this,e)).model=t,a.setter_id=r,a}return(0,b.Z)(i,[{key:t,value:function(e){return{kind:"RootRemoved",model:this.model.ref()}}}]),i}(l,a.serialize);n.RootRemovedEvent=m,m.__name__="RootRemovedEvent"},function(e,t,n,i,r){i();var a=e(8),o=e(13);n.pretty=Symbol("pretty");var s=function(){function e(t){(0,g.Z)(this,e),this.visited=new Set,this.precision=null==t?void 0:t.precision}return(0,b.Z)(e,[{key:"to_string",value:function(e){if((0,a.isObject)(e)){if(this.visited.has(e))return"<circular>";this.visited.add(e)}return function(e){return(0,a.isObject)(e)&&void 0!==e[n.pretty]}(e)?e[n.pretty](this):(0,a.isBoolean)(e)?this.boolean(e):(0,a.isNumber)(e)?this.number(e):(0,a.isString)(e)?this.string(e):(0,a.isArray)(e)?this.array(e):(0,a.isIterable)(e)?this.iterable(e):(0,a.isPlainObject)(e)?this.object(e):(0,a.isSymbol)(e)?this.symbol(e):"".concat(e)}},{key:"token",value:function(e){return e}},{key:"boolean",value:function(e){return"".concat(e)}},{key:"number",value:function(e){return null!=this.precision?e.toFixed(this.precision):"".concat(e)}},{key:"string",value:function(e){return'"'.concat(e.replace(/'/g,"\\'"),'"')}},{key:"symbol",value:function(e){return e.toString()}},{key:"array",value:function(e){var t,n=this.token,i=[],r=(0,w.Z)(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;i.push(this.to_string(a))}}catch(o){r.e(o)}finally{r.f()}return"".concat(n("[")).concat(i.join("".concat(n(",")," "))).concat(n("]"))}},{key:"iterable",value:function(e){var t,n=this.token,i=null!==(t=Object(e)[Symbol.toStringTag])&&void 0!==t?t:"Object",r=this.array(e);
2return"".concat(i).concat(n("(")).concat(r).concat(n(")"))}},{key:"object",value:function(e){var t,n=this.token,i=[],r=(0,w.Z)((0,o.entries)(e));try{for(r.s();!(t=r.n()).done;){var a=(0,k.Z)(t.value,2),s=a[0],l=a[1];i.push("".concat(s).concat(n(":")," ").concat(this.to_string(l)))}}catch(u){r.e(u)}finally{r.f()}return"".concat(n("{")).concat(i.join("".concat(n(",")," "))).concat(n("}"))}}]),e}();n.Printer=s,s.__name__="Printer",n.to_string=function(e,t){return new s(t).to_string(e)}},function(e,t,n,i,r){i();var a=e(13),o=e(8);function s(e){return(0,o.isObject)(e)&&void 0!==e[n.clone]}n.clone=Symbol("clone"),n.is_Cloneable=s;var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}((0,m.Z)(Error));n.CloningError=l,l.__name__="CloningError";var u=function(){function e(){(0,g.Z)(this,e)}return(0,b.Z)(e,[{key:"clone",value:function(e){if(s(e))return e[n.clone](this);if((0,o.isArray)(e)){for(var t=e.length,i=new Array(t),r=0;r<t;r++){var u=e[r];i[r]=this.clone(u)}return i}if((0,o.isPlainObject)(e)){var c,h={},_=(0,w.Z)((0,a.entries)(e));try{for(_.s();!(c=_.n()).done;){var d=(0,k.Z)(c.value,2),f=d[0],v=d[1];h[f]=this.clone(v)}}catch(p){_.e(p)}finally{_.f()}return h}if(null===e||(0,o.isBoolean)(e)||(0,o.isNumber)(e)||(0,o.isString)(e))return e;throw new l("".concat(Object.prototype.toString.call(e)," is not cloneable"))}}]),e}();n.Cloner=u,u.__name__="Cloner"},function(e,t,n,i,r){i();var a=e(1);(0,a.__exportStar)(e(39),n),(0,a.__exportStar)(e(127),n),(0,a.__exportStar)(e(244),n),(0,a.__exportStar)(e(248),n),(0,a.__exportStar)(e(253),n),(0,a.__exportStar)(e(262),n),(0,a.__exportStar)(e(192),n),(0,a.__exportStar)(e(267),n),(0,a.__exportStar)(e(301),n),(0,a.__exportStar)(e(305),n),(0,a.__exportStar)(e(307),n),(0,a.__exportStar)(e(196),n),(0,a.__exportStar)(e(320),n),(0,a.__exportStar)(e(321),n),(0,a.__exportStar)(e(329),n),(0,a.__exportStar)(e(337),n),(0,a.__exportStar)(e(206),n),(0,a.__exportStar)(e(338),n),(0,a.__exportStar)(e(204),n),(0,a.__exportStar)(e(340),n),(0,a.__exportStar)(e(341),n),(0,a.__exportStar)(e(168),n),(0,a.__exportStar)(e(346),n),(0,a.__exportStar)(e(356),n),(0,a.__exportStar)(e(360),n)},function(e,t,n,i,r){i(),r("Annotation",e(40).Annotation),r("Arrow",e(68).Arrow),r("ArrowHead",e(112).ArrowHead),r("OpenHead",e(112).OpenHead),r("NormalHead",e(112).NormalHead),r("TeeHead",e(112).TeeHead),r("VeeHead",e(112).VeeHead),r("Band",e(114).Band),r("BoxAnnotation",e(116).BoxAnnotation),r("ColorBar",e(117).ColorBar),r("Label",e(212).Label),r("LabelSet",e(213).LabelSet),r("Legend",e(214).Legend),r("LegendItem",e(215).LegendItem),r("PolyAnnotation",e(217).PolyAnnotation),r("Slope",e(218).Slope),r("Span",e(219).Span),r("TextAnnotation",e(119).TextAnnotation),r("Title",e(118).Title),r("ToolbarPanel",e(220).ToolbarPanel),r("Tooltip",e(241).Tooltip),r("Whisker",e(243).Whisker)},function(e,t,n,i,r){var a;i();var o=e(41),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"get_size",value:function(){if(this.model.visible){var e=this._get_size(),t=e.width,n=e.height;return{width:Math.round(t),height:Math.round(n)}}return{width:0,height:0}}},{key:"_get_size",value:function(){throw new Error("not implemented")}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this);var t=this.model.properties;this.on_change(t.visible,(function(){null!=e.layout&&(e.layout.visible=e.model.visible,e.plot_view.request_layout())}))}},{key:"needs_clip",get:function(){return null==this.layout}},{key:"serializable_state",value:function(){var e=(0,_.Z)((0,d.Z)(n.prototype),"serializable_state",this).call(this);return null==this.layout?e:Object.assign(Object.assign({},e),{bbox:this.layout.bbox.box})}}]),n}(o.RendererView);n.AnnotationView=s,s.__name__="AnnotationView";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Renderer);n.Annotation=l,a=l,l.__name__="Annotation",a.override({level:"annotation"})},function(e,t,n,i,r){i();var a,o,s=e(1),l=e(42),u=(0,s.__importStar)(e(45)),c=e(20),h=e(53),f=e(54),m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(h.Model);n.RendererGroup=m,a=m,m.__name__="RendererGroup",a.define((function(e){return{visible:[e.Boolean,!0]}}));var y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}
2return(0,b.Z)(n,[{key:"coordinates",get:function(){var e=this._coordinates;return null!=e?e:this._coordinates=this._initialize_coordinates()}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.visuals=new u.Visuals(this),this.needs_webgl_blit=!1}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this);var t=this.model.properties,i=t.x_range_name,r=t.y_range_name;this.on_change([i,r],(function(){return e._initialize_coordinates()}));var a=this.model.group;null!=a&&this.on_change(a.properties.visible,(function(){e.model.visible=a.visible}))}},{key:"_initialize_coordinates",value:function(){var e=this.model.coordinates,t=this.plot_view.frame;if(null!=e)return e.get_transform(t);var n=this.model,i=n.x_range_name,r=n.y_range_name,a=t.x_scales.get(i),o=t.y_scales.get(r);return new f.CoordinateTransform(a,o)}},{key:"plot_view",get:function(){return this.parent}},{key:"plot_model",get:function(){return this.parent.model}},{key:"layer",get:function(){var e=this.canvas,t=e.overlays,n=e.primary;return"overlay"==this.model.level?t:n}},{key:"canvas",get:function(){return this.plot_view.canvas_view}},{key:"request_render",value:function(){this.request_paint()}},{key:"request_paint",value:function(){this.plot_view.request_paint(this)}},{key:"request_layout",value:function(){this.plot_view.request_layout()}},{key:"notify_finished",value:function(){this.plot_view.notify_finished()}},{key:"notify_finished_after_paint",value:function(){this.plot_view.notify_finished_after_paint()}},{key:"needs_clip",get:function(){return!1}},{key:"has_webgl",get:function(){return!1}},{key:"render",value:function(){this.model.visible&&this._render(),this._has_finished=!0}},{key:"renderer_view",value:function(e){}}]),n}(l.View);n.RendererView=y,y.__name__="RendererView";var w=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(h.Model);n.Renderer=w,o=w,w.__name__="Renderer",o.define((function(e){var t=e.Boolean,n=e.String,i=e.Ref,r=e.Nullable;return{group:[r(i(m)),null],level:[c.RenderLevel,"image"],visible:[t,!0],x_range_name:[n,"default"],y_range_name:[n,"default"],coordinates:[r(i(f.CoordinateMapping)),null]}}))},function(e,t,n,i,r){i();var a=e(1),o=e(15),s=e(43),l=e(8),u=(0,a.__importDefault)(e(44)),c=function(){function e(t){(0,g.Z)(this,e),this.removed=new o.Signal0(this,"removed"),this._ready=Promise.resolve(void 0),this._slots=new WeakMap,this._idle_notified=!1;var n=t.model,i=t.parent;this.model=n,this.parent=i,this.root=null==i?this:i.root,this.removed.emit()}return(0,b.Z)(e,[{key:"ready",get:function(){return this._ready}},{key:"connect",value:function(e,t){var n=this,i=this._slots.get(t);return null==i&&(i=function(e,i){var r=Promise.resolve(t.call(n,e,i));n._ready=n._ready.then((function(){return r}))},this._slots.set(t,i)),e.connect(i,this)}},{key:"disconnect",value:function(e,t){return e.disconnect(t,this)}},{key:"initialize",value:function(){this._has_finished=!1,this.is_root&&(this._stylesheet=s.stylesheet);var e,t=(0,w.Z)(this.styles());try{for(t.s();!(e=t.n()).done;){var n=e.value;this.stylesheet.append(n)}}catch(i){t.e(i)}finally{t.f()}}},{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"remove",value:function(){this.disconnect_signals(),this.removed.emit()}},{key:"toString",value:function(){return"".concat(this.model.type,"View(").concat(this.model.id,")")}},{key:"serializable_state",value:function(){return{type:this.model.type}}},{key:"is_root",get:function(){return null==this.parent}},{key:"has_finished",value:function(){return this._has_finished}},{key:"is_idle",get:function(){return this.has_finished()}},{key:"connect_signals",value:function(){}},{key:"disconnect_signals",value:function(){o.Signal.disconnect_receiver(this)}},{key:"on_change",value:function(e,t){var n,i=(0,w.Z)((0,l.isArray)(e)?e:[e]);try{for(i.s();!(n=i.n()).done;){var r=n.value;this.connect(r.change,t)}}catch(a){i.e(a)}finally{i.f()}}},{key:"cursor",value:function(e,t){return null}},{key:"stylesheet",get:function(){return this.is_root?this._stylesheet:this.root.stylesheet}},{key:"styles",value:function(){return[u.default]}},{key:"notify_finished",value: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)):this.root.notify_finished()}}]),e}();n.View=c,c.__name__="View"},function(e,t,n,i,r){i();var a=e(8),o=e(13),s=function(e){return function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var s=document.createElement(e);s.classList.add("bk"),(0,a.isPlainObject)(t)||(i=[t].concat((0,y.Z)(i)),t={});var l,u=(0,w.Z)((0,o.entries)(t));try{for(u.s();!(l=u.n()).done;){var c=(0,k.Z)(l.value,2),h=c[0],_=c[1];
2if(null!=_&&(!(0,a.isBoolean)(_)||_))if("class"===h&&((0,a.isString)(_)&&(_=_.split(/\s+/)),(0,a.isArray)(_))){var d,f=(0,w.Z)(_);try{for(f.s();!(d=f.n()).done;){var v=d.value;null!=v&&s.classList.add(v)}}catch(O){f.e(O)}finally{f.f()}}else if("style"===h&&(0,a.isPlainObject)(_)){var p,m=(0,w.Z)((0,o.entries)(_));try{for(m.s();!(p=m.n()).done;){var g=(0,k.Z)(p.value,2),b=g[0],x=g[1];s.style[b]=x}}catch(O){m.e(O)}finally{m.f()}}else if("data"===h&&(0,a.isPlainObject)(_)){var Z,A=(0,w.Z)((0,o.entries)(_));try{for(A.s();!(Z=A.n()).done;){var S=(0,k.Z)(Z.value,2),T=S[0],M=S[1];s.dataset[T]=M}}catch(O){A.e(O)}finally{A.f()}}else s.setAttribute(h,_)}}catch(O){u.e(O)}finally{u.f()}function C(e){if((0,a.isString)(e))s.appendChild(document.createTextNode(e));else if(e instanceof Node)s.appendChild(e);else if(e instanceof NodeList||e instanceof HTMLCollection){var t,n=(0,w.Z)(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;s.appendChild(i)}}catch(O){n.e(O)}finally{n.f()}}else if(null!=e&&!1!==e)throw new Error("expected a DOM element, string, false or null, got ".concat(JSON.stringify(e)))}var z,E=(0,w.Z)(i);try{for(E.s();!(z=E.n()).done;){var R=z.value;if((0,a.isArray)(R)){var B,N=(0,w.Z)(R);try{for(N.s();!(B=N.n()).done;){C(B.value)}}catch(O){N.e(O)}finally{N.f()}}else C(R)}}catch(O){E.e(O)}finally{E.f()}return s}};function l(e){var t=e.parentNode;null!=t&&t.removeChild(e)}function u(e){for(var t=e.firstChild,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];for(var a=0,o=i;a<o.length;a++){var s=o[a];e.insertBefore(s,t)}}function c(e,t){var n,i,r,a=Element.prototype;return(null!==(r=null!==(i=null!==(n=a.matches)&&void 0!==n?n:a.webkitMatchesSelector)&&void 0!==i?i:a.mozMatchesSelector)&&void 0!==r?r:a.msMatchesSelector).call(e,t)}function h(e){return parseFloat(e)||0}function _(e){var t=getComputedStyle(e);return{border:{top:h(t.borderTopWidth),bottom:h(t.borderBottomWidth),left:h(t.borderLeftWidth),right:h(t.borderRightWidth)},margin:{top:h(t.marginTop),bottom:h(t.marginBottom),left:h(t.marginLeft),right:h(t.marginRight)},padding:{top:h(t.paddingTop),bottom:h(t.paddingBottom),left:h(t.paddingLeft),right:h(t.paddingRight)}}}function d(e){var t=e.getBoundingClientRect();return{width:Math.ceil(t.width),height:Math.ceil(t.height)}}n.createElement=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return s(e).apply(void 0,[t].concat(i))},n.div=s("div"),n.span=s("span"),n.canvas=s("canvas"),n.link=s("link"),n.style=s("style"),n.a=s("a"),n.p=s("p"),n.i=s("i"),n.pre=s("pre"),n.button=s("button"),n.label=s("label"),n.input=s("input"),n.select=s("select"),n.option=s("option"),n.optgroup=s("optgroup"),n.textarea=s("textarea"),n.createSVGElement=function(e,t){var n,i=document.createElementNS("http://www.w3.org/2000/svg",e),r=(0,w.Z)((0,o.entries)(null!=t?t:{}));try{for(r.s();!(n=r.n()).done;){var s=(0,k.Z)(n.value,2),l=s[0],u=s[1];null==u||(0,a.isBoolean)(u)&&!u||i.setAttribute(l,u)}}catch(g){r.e(g)}finally{r.f()}function c(e){if((0,a.isString)(e))i.appendChild(document.createTextNode(e));else if(e instanceof Node)i.appendChild(e);else if(e instanceof NodeList||e instanceof HTMLCollection){var t,n=(0,w.Z)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;i.appendChild(r)}}catch(g){n.e(g)}finally{n.f()}}else if(null!=e&&!1!==e)throw new Error("expected a DOM element, string, false or null, got ".concat(JSON.stringify(e)))}for(var h=arguments.length,_=new Array(h>2?h-2:0),d=2;d<h;d++)_[d-2]=arguments[d];for(var f=0,v=_;f<v.length;f++){var p=v[f];if((0,a.isArray)(p)){var m,y=(0,w.Z)(p);try{for(y.s();!(m=y.n()).done;){c(m.value)}}catch(g){y.e(g)}finally{y.f()}}else c(p)}return i},n.nbsp=function(){return document.createTextNode("\xa0")},n.append=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];for(var r=0,a=n;r<a.length;r++){var o=a[r];e.appendChild(o)}},n.remove=l,n.removeElement=l,n.replaceWith=function(e,t){var n=e.parentNode;null!=n&&n.replaceChild(t,e)},n.prepend=u,n.empty=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=e.firstChild;)e.removeChild(t);if(n&&e instanceof Element){var i,r=(0,w.Z)(e.attributes);try{for(r.s();!(i=r.n()).done;){var a=i.value;e.removeAttributeNode(a)}}catch(o){r.e(o)}finally{r.f()}}},n.display=function(e){e.style.display=""},n.undisplay=function(e){e.style.display="none"},n.show=function(e){e.style.visibility=""},n.hide=function(e){e.style.visibility="hidden"},n.offset=function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}},n.matches=c,n.parent=function(e,t){for(var n=e;n=n.parentElement;)if(c(n,t))return n;return null},n.extents=_,n.size=d,n.scroll_size=function(e){return{width:Math.ceil(e.scrollWidth),height:Math.ceil(e.scrollHeight)}},n.outer_size=function(e){var t=_(e).margin,n=t.left,i=t.right,r=t.top,a=t.bottom,o=d(e),s=o.width,l=o.height;return{width:Math.ceil(s+n+i),height:Math.ceil(l+r+a)}},n.content_size=function(e){var t,n=e.getBoundingClientRect(),i=n.left,r=n.top,a=_(e).padding,o=0,s=0,l=(0,w.Z)(e.children);try{for(l.s();!(t=l.n()).done;){var u=t.value.getBoundingClientRect();o=Math.max(o,Math.ceil(u.left-i-a.left+u.width)),s=Math.max(s,Math.ceil(u.top-r-a.top+u.height))}}catch(c){l.e(c)}finally{l.f()}return{width:o,height:s}},n.position=function(e,t,n){var i=e.style;
2if(i.left="".concat(t.x,"px"),i.top="".concat(t.y,"px"),i.width="".concat(t.width,"px"),i.height="".concat(t.height,"px"),null==n)i.margin="";else{var r=n.top,a=n.right,o=n.bottom,s=n.left;i.margin="".concat(r,"px ").concat(a,"px ").concat(o,"px ").concat(s,"px")}},n.children=function(e){return Array.from(e.children)};var f,v=function(){function e(t){(0,g.Z)(this,e),this.el=t,this.classList=t.classList}return(0,b.Z)(e,[{key:"values",get:function(){for(var e=[],t=0;t<this.classList.length;t++){var n=this.classList.item(t);null!=n&&e.push(n)}return e}},{key:"has",value:function(e){return this.classList.contains(e)}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i=0,r=t;i<r.length;i++){var a=r[i];this.classList.add(a)}return this}},{key:"remove",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i=0,r=t;i<r.length;i++){var a=r[i];this.classList.remove(a)}return this}},{key:"clear",value:function(){var e,t=(0,w.Z)(this.values);try{for(t.s();!(e=t.n()).done;){var n=e.value;"bk"!=n&&this.classList.remove(n)}}catch(i){t.e(i)}finally{t.f()}return this}},{key:"toggle",value:function(e,t){return(null!=t?t:!this.has(e))?this.add(e):this.remove(e),this}}]),e}();function p(e,t,n){var i=e.style,r=i.width,a=i.height,o=i.position,s=i.display;e.style.position="absolute",e.style.display="",e.style.width=null!=t.width&&t.width!=1/0?"".concat(t.width,"px"):"auto",e.style.height=null!=t.height&&t.height!=1/0?"".concat(t.height,"px"):"auto";try{return n()}finally{e.style.position=o,e.style.display=s,e.style.width=r,e.style.height=a}}n.ClassList=v,v.__name__="ClassList",n.classes=function(e){return new v(e)},n.toggle_attribute=function(e,t,n){null==n&&(n=!e.hasAttribute(t)),n?e.setAttribute(t,"true"):e.removeAttribute(t)},(f=n.Keys||(n.Keys={}))[f.Backspace=8]="Backspace",f[f.Tab=9]="Tab",f[f.Enter=13]="Enter",f[f.Esc=27]="Esc",f[f.PageUp=33]="PageUp",f[f.PageDown=34]="PageDown",f[f.Left=37]="Left",f[f.Up=38]="Up",f[f.Right=39]="Right",f[f.Down=40]="Down",f[f.Delete=46]="Delete",n.undisplayed=function(e,t){var n=e.style.display;e.style.display="none";try{return t()}finally{e.style.display=n}},n.unsized=function(e,t){return p(e,{},t)},n.sized=p;var m=function(){function e(t){(0,g.Z)(this,e),this.root=t,this.known=new Set,this.style=(0,n.style)({type:"text/css"}),u(t,this.style)}return(0,b.Z)(e,[{key:"append",value:function(e){this.known.has(e)||(this.style.appendChild(document.createTextNode(e)),this.known.add(e))}}]),e}();n.StyleSheet=m,m.__name__="StyleSheet",n.stylesheet=new m(document.head),n.dom_ready=(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("loading"!=document.readyState){e.next=2;break}return e.abrupt("return",new Promise((function(e,t){document.addEventListener("DOMContentLoaded",(function(){return e()}),{once:!0})})));case 2:case"end":return e.stop()}}),e)})))},function(e,t,n,i,r){i(),n.root="bk-root",n.default=".bk-root{position:relative;width:auto;height:auto;box-sizing:border-box;font-family:Helvetica, Arial, sans-serif;font-size:13px;}.bk-root .bk,.bk-root .bk:before,.bk-root .bk:after{box-sizing:inherit;margin:0;border:0;padding:0;background-image:none;font-family:inherit;font-size:100%;line-height:1.42857143;}.bk-root pre.bk{font-family:Courier, monospace;}"},function(e,t,n,i,r){i();var a=e(1),o=e(46);r("Line",o.Line),r("LineScalar",o.LineScalar),r("LineVector",o.LineVector);var s=e(49);r("Fill",s.Fill),r("FillScalar",s.FillScalar),r("FillVector",s.FillVector);var l=e(50);r("Text",l.Text),r("TextScalar",l.TextScalar),r("TextVector",l.TextVector);var u=e(51);r("Hatch",u.Hatch),r("HatchScalar",u.HatchScalar),r("HatchVector",u.HatchVector);var c=(0,a.__importStar)(e(48)),h=e(47);r("VisualProperties",h.VisualProperties),r("VisualUniforms",h.VisualUniforms);var _=function(e){function t(e){var n=this;(0,g.Z)(this,t),this._visuals=[];var i,r=(0,w.Z)(e.model._mixins);try{var a=function(){var t=(0,k.Z)(i.value,2),r=t[0],a=t[1],_=function(){switch(a){case c.Line:return new o.Line(e,r);case c.LineScalar:return new o.LineScalar(e,r);case c.LineVector:return new o.LineVector(e,r);case c.Fill:return new s.Fill(e,r);case c.FillScalar:return new s.FillScalar(e,r);case c.FillVector:return new s.FillVector(e,r);case c.Text:return new l.Text(e,r);case c.TextScalar:return new l.TextScalar(e,r);case c.TextVector:return new l.TextVector(e,r);case c.Hatch:return new u.Hatch(e,r);
2case c.HatchScalar:return new u.HatchScalar(e,r);case c.HatchVector:return new u.HatchVector(e,r);default:throw new Error("unknown visual")}}();_ instanceof h.VisualProperties&&_.update(),n._visuals.push(_),Object.defineProperty(n,r+_.type,{get:function(){return _},configurable:!1,enumerable:!0})};for(r.s();!(i=r.n()).done;)a()}catch(_){r.e(_)}finally{r.f()}}return(0,b.Z)(t,[{key:e,value:(0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this._visuals,"t0",1);case 1:case"end":return e.stop()}}),e,this)}))}]),t}(Symbol.iterator);n.Visuals=_,_.__name__="Visuals"},function(e,t,n,i,r){i();var a=e(1),o=e(47),s=(0,a.__importStar)(e(48)),l=e(22),u=e(8);function c(e){if((0,u.isArray)(e))return e;switch(e){case"solid":return[];case"dashed":return[6];case"dotted":return[2,4];case"dotdash":return[2,4,6,4];case"dashdot":return[6,4,2,4];default:return e.split(" ").map(Number).filter(u.isInteger)}}n.resolve_line_dash=c;var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"doit",get:function(){var e=this.line_color.get_value(),t=this.line_alpha.get_value(),n=this.line_width.get_value();return!(null==e||0==t||0==n)}},{key:"apply",value:function(e){var t=this.doit;return t&&(this.set_value(e),e.stroke()),t}},{key:"values",value:function(){return{color:this.line_color.get_value(),alpha:this.line_alpha.get_value(),width:this.line_width.get_value(),join:this.line_join.get_value(),cap:this.line_cap.get_value(),dash:this.line_dash.get_value(),offset:this.line_dash_offset.get_value()}}},{key:"set_value",value:function(e){var t=this.line_color.get_value(),n=this.line_alpha.get_value();e.strokeStyle=(0,l.color2css)(t,n),e.lineWidth=this.line_width.get_value(),e.lineJoin=this.line_join.get_value(),e.lineCap=this.line_cap.get_value(),e.lineDash=c(this.line_dash.get_value()),e.lineDashOffset=this.line_dash_offset.get_value()}}]),n}(o.VisualProperties);n.Line=h,h.__name__="Line";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"doit",get:function(){var e=this.line_color.value,t=this.line_alpha.value,n=this.line_width.value;return!(0==e||0==t||0==n)}},{key:"apply",value:function(e){var t=this.doit;return t&&(this.set_value(e),e.stroke()),t}},{key:"values",value:function(){return{color:this.line_color.value,alpha:this.line_alpha.value,width:this.line_width.value,join:this.line_join.value,cap:this.line_cap.value,dash:this.line_dash.value,offset:this.line_dash_offset.value}}},{key:"set_value",value:function(e){var t=this.line_color.value,n=this.line_alpha.value;e.strokeStyle=(0,l.color2css)(t,n),e.lineWidth=this.line_width.value,e.lineJoin=this.line_join.value,e.lineCap=this.line_cap.value,e.lineDash=c(this.line_dash.value),e.lineDashOffset=this.line_dash_offset.value}}]),n}(o.VisualUniforms);n.LineScalar=_,_.__name__="LineScalar";var d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"doit",get:function(){var e=this.line_color;if(e.is_Scalar()&&0==e.value)return!1;var t=this.line_alpha;if(t.is_Scalar()&&0==t.value)return!1;var n=this.line_width;return!n.is_Scalar()||0!=n.value}},{key:"apply",value:function(e,t){var n=this.doit;return n&&(this.set_vectorize(e,t),e.stroke()),n}},{key:"values",value:function(e){return{color:this.line_color.get(e),alpha:this.line_alpha.get(e),width:this.line_width.get(e),join:this.line_join.get(e),cap:this.line_cap.get(e),dash:this.line_dash.get(e),offset:this.line_dash_offset.get(e)}}},{key:"set_vectorize",value:function(e,t){var n=this.line_color.get(t),i=this.line_alpha.get(t),r=this.line_width.get(t),a=this.line_join.get(t),o=this.line_cap.get(t),s=this.line_dash.get(t),u=this.line_dash_offset.get(t);e.strokeStyle=(0,l.color2css)(n,i),e.lineWidth=r,e.lineJoin=a,e.lineCap=o,e.lineDash=c(s),e.lineDashOffset=u}}]),n}(o.VisualUniforms);n.LineVector=d,d.__name__="LineVector",h.prototype.type="line",h.prototype.attrs=Object.keys(s.Line),_.prototype.type="line",_.prototype.attrs=Object.keys(s.LineScalar),d.prototype.type="line",d.prototype.attrs=Object.keys(s.LineVector)},function(e,t,n,i,r){i();var a=function(e){function t(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";(0,g.Z)(this,t),this.obj=e,this.prefix=i;this._props=[];var r,a=(0,w.Z)(this.attrs);try{for(a.s();!(r=a.n()).done;){var o=r.value,s=e.model.properties[i+o];s.change.connect((function(){return n.update()})),this[o]=s,this._props.push(s)}}catch(l){a.e(l)}finally{a.f()}}return(0,b.Z)(t,[{key:e,value:(0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this._props,"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"update",value:function(){}}]),t}(Symbol.iterator);n.VisualProperties=a,a.__name__="VisualProperties";var o=function(e){function t(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";(0,g.Z)(this,t),this.obj=e,this.prefix=i;var r,a=(0,w.Z)(this.attrs);try{var o=function(){var t=r.value;Object.defineProperty(n,t,{get:function(){return e[i+t]}})};for(a.s();!(r=a.n()).done;)o()}catch(s){a.e(s)}finally{a.f()}}return(0,b.Z)(t,[{key:e,value:(0,x.Z)().mark((function e(){var t,n,i;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=(0,w.Z)(this.attrs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return i=n.value,e.next=7,this.obj.model.properties[this.prefix+i];case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:"update",value:function(){}}]),t}(Symbol.iterator);n.VisualUniforms=o,o.__name__="VisualUniforms"},function(e,t,n,i,r){i();var a=e(1),o=(0,a.__importStar)(e(18)),s=e(20),l=(0,a.__importStar)(e(21)),u=e(13);n.Line={line_color:[l.Nullable(l.Color),"black"],line_alpha:[l.Alpha,1],line_width:[l.Number,1],line_join:[s.LineJoin,"bevel"],line_cap:[s.LineCap,"butt"],line_dash:[l.Or(s.LineDash,l.Array(l.Number)),[]],line_dash_offset:[l.Number,0]},n.Fill={fill_color:[l.Nullable(l.Color),"gray"],fill_alpha:[l.Alpha,1]},n.Hatch={hatch_color:[l.Nullable(l.Color),"black"],hatch_alpha:[l.Alpha,1],hatch_scale:[l.Number,12],hatch_pattern:[l.Nullable(l.Or(s.HatchPatternType,l.String)),null],hatch_weight:[l.Number,1],hatch_extra:[l.Dict(l.AnyRef()),{}]},n.Text={text_color:[l.Nullable(l.Color),"#444444"],text_alpha:[l.Alpha,1],text_font:[o.Font,"helvetica"],text_font_size:[l.FontSize,"16px"],text_font_style:[s.FontStyle,"normal"],text_align:[s.TextAlign,"left"],text_baseline:[s.TextBaseline,"bottom"],text_line_height:[l.Number,1.2]},n.LineScalar={line_color:[o.ColorScalar,"black"],line_alpha:[o.NumberScalar,1],line_width:[o.NumberScalar,1],line_join:[o.LineJoinScalar,"bevel"],line_cap:[o.LineCapScalar,"butt"],line_dash:[o.LineDashScalar,[]],line_dash_offset:[o.NumberScalar,0]},n.FillScalar={fill_color:[o.ColorScalar,"gray"],fill_alpha:[o.NumberScalar,1]},n.HatchScalar={hatch_color:[o.ColorScalar,"black"],hatch_alpha:[o.NumberScalar,1],hatch_scale:[o.NumberScalar,12],hatch_pattern:[o.NullStringScalar,null],hatch_weight:[o.NumberScalar,1],hatch_extra:[o.AnyScalar,{}]},n.TextScalar={text_color:[o.ColorScalar,"#444444"],text_alpha:[o.NumberScalar,1],text_font:[o.FontScalar,"helvetica"],text_font_size:[o.FontSizeScalar,"16px"],text_font_style:[o.FontStyleScalar,"normal"],text_align:[o.TextAlignScalar,"left"],text_baseline:[o.TextBaselineScalar,"bottom"],text_line_height:[o.NumberScalar,1.2]},n.LineVector={line_color:[o.ColorSpec,"black"],line_alpha:[o.NumberSpec,1],line_width:[o.NumberSpec,1],line_join:[o.LineJoinSpec,"bevel"],line_cap:[o.LineCapSpec,"butt"],line_dash:[o.LineDashSpec,[]],line_dash_offset:[o.NumberSpec,0]},n.FillVector={fill_color:[o.ColorSpec,"gray"],fill_alpha:[o.NumberSpec,1]},n.HatchVector={hatch_color:[o.ColorSpec,"black"],hatch_alpha:[o.NumberSpec,1],hatch_scale:[o.NumberSpec,12],hatch_pattern:[o.NullStringSpec,null],hatch_weight:[o.NumberSpec,1],hatch_extra:[o.AnyScalar,{}]},n.TextVector={text_color:[o.ColorSpec,"#444444"],text_alpha:[o.NumberSpec,1],text_font:[o.FontSpec,"helvetica"],text_font_size:[o.FontSizeSpec,"16px"],text_font_style:[o.FontStyleSpec,"n
2ormal"],text_align:[o.TextAlignSpec,"left"],text_baseline:[o.TextBaselineSpec,"bottom"],text_line_height:[o.NumberSpec,1.2]},n.attrs_of=function(e,t,n){var i,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a={},o=(0,w.Z)((0,u.keys)(n));try{for(o.s();!(i=o.n()).done;){var s=i.value,l="".concat(t).concat(s),c=e[l];a[r?l:s]=c}}catch(h){o.e(h)}finally{o.f()}return a}},function(e,t,n,i,r){i();var a=e(1),o=e(47),s=(0,a.__importStar)(e(48)),l=e(22),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"doit",get:function(){var e=this.fill_color.get_value(),t=this.fill_alpha.get_value();return!(null==e||0==t)}},{key:"apply",value:function(e,t){var n=this.doit;return n&&(this.set_value(e),e.fill(t)),n}},{key:"values",value:function(){return{color:this.fill_color.get_value(),alpha:this.fill_alpha.get_value()}}},{key:"set_value",value:function(e){var t=this.fill_color.get_value(),n=this.fill_alpha.get_value();e.fillStyle=(0,l.color2css)(t,n)}}]),n}(o.VisualProperties);n.Fill=u,u.__name__="Fill";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"doit",get:function(){var e=this.fill_color.value,t=this.fill_alpha.value;return!(0==e||0==t)}},{key:"apply",value:function(e,t){var n=this.doit;return n&&(this.set_value(e),e.fill(t)),n}},{key:"values",value:function(){return{color:this.fill_color.value,alpha:this.fill_alpha.value}}},{key:"set_value",value:function(e){var t=this.fill_color.value,n=this.fill_alpha.value;e.fillStyle=(0,l.color2css)(t,n)}}]),n}(o.VisualUniforms);n.FillScalar=c,c.__name__="FillScalar";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"doit",get:function(){var e=this.fill_color;if(e.is_Scalar()&&0==e.value)return!1;var t=this.fill_alpha;return!t.is_Scalar()||0!=t.value}},{key:"apply",value:function(e,t,n){var i=this.doit;return i&&(this.set_vectorize(e,t),e.fill(n)),i}},{key:"values",value:function(e){return{color:this.fill_color.get(e),alpha:this.fill_alpha.get(e)}}},{key:"set_vectorize",value:function(e,t){var n=this.fill_color.get(t),i=this.fill_alpha.get(t);e.fillStyle=(0,l.color2css)(n,i)}}]),n}(o.VisualUniforms);n.FillVector=h,h.__name__="FillVector",u.prototype.type="fill",u.prototype.attrs=Object.keys(s.Fill),c.prototype.type="fill",c.prototype.attrs=Object.keys(s.FillScalar),h.prototype.type="fill",h.prototype.attrs=Object.keys(s.FillVector)},function(e,t,n,i,r){i();var a=e(1),o=e(47),s=(0,a.__importStar)(e(48)),l=e(22),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"doit",get:function(){var e=this.text_color.get_value(),t=this.text_alpha.get_value();return!(null==e||0==t)}},{key:"values",value:function(){return{color:this.text_color.get_value(),alpha:this.text_alpha.get_value(),font:this.text_font.get_value(),font_size:this.text_font_size.get_value(),font_style:this.text_font_style.get_value(),align:this.text_align.get_value(),baseline:this.text_baseline.get_value(),line_height:this.text_line_height.get_value()}}},{key:"set_value",value:function(e){var t=this.text_color.get_value(),n=this.text_alpha.get_value();e.fillStyle=(0,l.color2css)(t,n),e.font=this.font_value(),e.textAlign=this.text_align.get_value(),e.textBaseline=this.text_baseline.get_value()}},{key:"font_value",value:function(){return"".concat(this.text_font_style.get_value()," ").concat(this.text_font_size.get_value()," ").concat(this.text_font.get_value())}}]),n}(o.VisualProperties);n.Text=u,u.__name__="Text";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"doit",get:function(){var e=this.text_color.value,t=this.text_alpha.value;return!(0==e||0==t)}},{key:"values",value:function(){return{color:this.text_color.value,alpha:this.text_alpha.value,font:this.text_font.value,font_size:this.text_font_size.value,font_style:this.text_font_style.value,align:this.text_align.value,baseline:this.text_baseline.value,line_height:this.text_line_height.value}}},{key:"set_value",value:function(e){var t=this.text_color.value,n=this.text_alpha.value,i=this.font_value(
2),r=this.text_align.value,a=this.text_baseline.value;e.fillStyle=(0,l.color2css)(t,n),e.font=i,e.textAlign=r,e.textBaseline=a}},{key:"font_value",value:function(){return"".concat(this.text_font_style.value," ").concat(this.text_font_size.value," ").concat(this.text_font.value)}}]),n}(o.VisualUniforms);n.TextScalar=c,c.__name__="TextScalar";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"values",value:function(e){return{color:this.text_color.get(e),alpha:this.text_alpha.get(e),font:this.text_font.get(e),font_size:this.text_font_size.get(e),font_style:this.text_font_style.get(e),align:this.text_align.get(e),baseline:this.text_baseline.get(e),line_height:this.text_line_height.get(e)}}},{key:"doit",get:function(){var e=this.text_color;if(e.is_Scalar()&&0==e.value)return!1;var t=this.text_alpha;return!t.is_Scalar()||0!=t.value}},{key:"set_vectorize",value:function(e,t){var n=this.text_color.get(t),i=this.text_alpha.get(t),r=this.font_value(t),a=this.text_align.get(t),o=this.text_baseline.get(t);e.fillStyle=(0,l.color2css)(n,i),e.font=r,e.textAlign=a,e.textBaseline=o}},{key:"font_value",value:function(e){return"".concat(this.text_font_style.get(e)," ").concat(this.text_font_size.get(e)," ").concat(this.text_font.get(e))}}]),n}(o.VisualUniforms);n.TextVector=h,h.__name__="TextVector",u.prototype.type="text",u.prototype.attrs=Object.keys(s.Text),c.prototype.type="text",c.prototype.attrs=Object.keys(s.TextScalar),h.prototype.type="text",h.prototype.attrs=Object.keys(s.TextVector)},function(e,t,n,i,r){i();var a=e(1),o=e(47),s=e(52),l=(0,a.__importStar)(e(18)),u=(0,a.__importStar)(e(48)),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._update_iteration=0,e}return(0,b.Z)(n,[{key:"update",value:function(){var e=this;if(this._update_iteration++,this._hatch_image=null,this.doit){var t=this.hatch_color.get_value(),n=this.hatch_alpha.get_value(),i=this.hatch_scale.get_value(),r=this.hatch_pattern.get_value(),a=this.hatch_weight.get_value(),o=function(t){e._hatch_image=t},l=this.hatch_extra.get_value()[r];if(null!=l){var u=l.get_pattern(t,n,i,a);if(u instanceof Promise){var c=this._update_iteration;u.then((function(t){e._update_iteration==c&&(o(t),e.obj.request_render())}))}else o(u)}else{var h=this.obj.canvas.create_layer(),_=(0,s.get_pattern)(h,r,t,n,i,a);o(_)}}}},{key:"doit",get:function(){var e=this.hatch_color.get_value(),t=this.hatch_alpha.get_value(),n=this.hatch_pattern.get_value();return!(null==e||0==t||" "==n||"blank"==n||null==n)}},{key:"apply",value:function(e,t){var n=this.doit;return n&&(this.set_value(e),e.layer.undo_transform((function(){return e.fill(t)}))),n}},{key:"set_value",value:function(e){var t=this.pattern(e);e.fillStyle=null!=t?t:"transparent"}},{key:"pattern",value:function(e){var t=this._hatch_image;return null==t?null:e.createPattern(t,this.repetition())}},{key:"repetition",value:function(){var e=this.hatch_pattern.get_value(),t=this.hatch_extra.get_value()[e];if(null==t)return"repeat";switch(t.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}]),n}(o.VisualProperties);n.Hatch=c,c.__name__="Hatch";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._static_doit=!1,e._update_iteration=0,e}return(0,b.Z)(n,[{key:"_compute_static_doit",value:function(){var e=this.hatch_color.value,t=this.hatch_alpha.value,n=this.hatch_pattern.value;return!(null==e||0==t||" "==n||"blank"==n||null==n)}},{key:"update",value:function(){var e=this;this._update_iteration++;var t=this.hatch_color.length;if(this._hatch_image=new l.UniformScalar(null,t),this._static_doit=this._compute_static_doit(),this._static_doit){var n=this.hatch_color.value,i=this.hatch_alpha.value,r=this.hatch_scale.value,a=this.hatch_pattern.value,o=this.hatch_weight.value,u=function(n){e._hatch_image=new l.UniformScalar(n,t)},c=this.hatch_extra.value[a];if(null!=c){var h=c.get_pattern(n,i,r,o);if(h instanceof Promise){var _=this._update_iteration;h.then((function(t){e._update_iteration==_&&(u(t),e.obj.request_render())}))}else u(h)}else{var d=this.obj.canvas.create_layer(),f=(0,s.get_pattern)(d,a,n,i,r,o);u(f)}}}},{key:"doit",get:function(){return this._static_doit}},{key:"apply",value:function(e,t){var n=this.doit;return n&&(this.set_value(e),e.layer.undo_transform((function(){return e.fill(t)}))),n}},{key:"set_value",value:function(e){var t;e.fillStyle=null!==(t=this.pattern(e))&&void 0!==t?t:"transparent"}},{key:"pattern",value:function(e){var t=this._hatch_image.value;return null==t?null:e.createPattern(t,this.repetition())}},{key:"repetition",value:function(){var e=this.hatch_pattern.value,t=this.hatch_extra.value[e];if(null==t)return"repeat";switch(t.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}]),n}(o.VisualUniforms);n.HatchScalar=h,h.__name__="HatchScalar";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._static_doit=!1,e._update_iteration=0,e}return(0,b.Z)(n,[{key:"_compute_static_doit",value:function(){var e=this.hatch_color;if(e.is_Scalar()&&0==e.value)return!1;var t=this.hatch_alpha;if(t.is_Scalar()&&0==t.value)return!1;var n=this.hatch_pattern;if(n.is_Scalar()){var i=n.value;if(" "==i||"blank"==i||null==i)return!1}return!0}},{key:"update",value:function(){var e=this;this._update_iteration++;var t=this.hatch_color.length;if(this._hatch_image=new l.UniformScalar(null,t),this._static_doit=this._compute_static_doit(),this._static_doit){var n=function(t,n,i,r,a,o){var l=e.hatch_extra.value[t];if(null!=l){var u=l.get_pattern(n,i,r,a);if(u instanceof Promise){var c=e._update_iteration;u.then((function(t){e._update_iteration==c&&(o(t),e.obj.request_render())}))}else o(u)}else{var h=e.obj.canvas.create_layer(),_=(0,s.get_pattern)(h,t,n,i,r,a);o(_)}};if(this.hatch_color.is_Scalar()&&this.hatch_alpha.is_Scalar()&&this.hatch_scale.is_Scalar()&&this.hatch_pattern.is_Scalar()&&this.hatch_weight.is_Scalar()){var i=this.hatch_color.value,r=this.hatch_alpha.value,a=this.hatch_scale.value;n(this.hatch_pattern.value,i,r,a,this.hatch_weight.value,(function(n){e._hatch_image=new l.UniformScalar(n,t)}))}else{var o=new Array(t);o.fill(null),this._hatch_image=new l.UniformVector(o);for(var u=function(t){var i=e.hatch_color.get(t),r=e.hatch_alpha.get(t),a=e.hatch_scale.get(t);n(e.hatch_pattern.get(t),i,r,a,e.hatch_weight.get(t),(function(e){o[t]=e}))},c=0;c<t;c++)u(c)}}}},{key:"doit",get:function(){return this._static_doit}},{key:"apply",value:function(e,t,n){var i=this.doit;return i&&(this.set_vectorize(e,t),e.layer.undo_transform((function(){return e.fill(n)}))),i}},{key:"set_vectorize",value:function(e,t){var n;e.fillStyle=null!==(n=this.pattern(e,t))&&void 0!==n?n:"transparent"}},{key:"pattern",value:function(e,t){var n=this._hatch_image.get(t);return null==n?null:e.createPattern(n,this.repetition(t))}},{key:"repetition",value:function(e){var t=this.hatch_pattern.get(e),n=this.hatch_extra.value[t];if(null==n)return"repeat";switch(n.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}]),n}(o.VisualUniforms);n.HatchVector=_,_.__name__="HatchVector",c.prototype.type="hatch",c.prototype.attrs=Object.keys(u.Hatch),h.prototype.type="hatch",h.prototype.attrs=Object.keys(u.HatchScalar),_.prototype.type="hatch",_.prototype.attrs=Object.keys(u.HatchVector)},function(e,t,n,i,r){i();var a=e(22);function o(e,t,n){e.moveTo(0,n+.5),e.lineTo(t,n+.5),e.stroke()}function s(e,t,n){e.moveTo(n+.5,0),e.lineTo(n+.5,t),e.stroke()}function l(e,t){e.moveTo(0,t),e.lineTo(t,0),e.stroke(),e.moveTo(0,0),e.lineTo(t,t),e.stroke()}n.hatch_aliases={" ":"blank",".":"dot",o:"ring","-":"horizontal_line","|":"vertical_line","+":"cross",'"':"horizontal_dash",":":"vertical_dash","@"
2:"spiral","/":"right_diagonal_line","\\":"left_diagonal_line",x:"diagonal_cross",",":"right_diagonal_dash","`":"left_diagonal_dash",v:"horizontal_wave",">":"vertical_wave","*":"criss_cross"},n.get_pattern=function(e,t,i,r,u,c){return e.resize(u,u),e.prepare(),function(e,t,i,r,u,c){var h,_=u,d=_/2,f=d/2,v=(0,a.color2css)(i,r);switch(e.strokeStyle=v,e.fillStyle=v,e.lineCap="square",e.lineWidth=c,null!==(h=n.hatch_aliases[t])&&void 0!==h?h:t){case"blank":break;case"dot":e.arc(d,d,d/2,0,2*Math.PI,!0),e.fill();break;case"ring":e.arc(d,d,d/2,0,2*Math.PI,!0),e.stroke();break;case"horizontal_line":o(e,_,d);break;case"vertical_line":s(e,_,d);break;case"cross":o(e,_,d),s(e,_,d);break;case"horizontal_dash":o(e,d,d);break;case"vertical_dash":s(e,d,d);break;case"spiral":var p=_/30;e.moveTo(d,d);for(var m=0;m<360;m++){var y=.1*m,g=d+p*y*Math.cos(y),b=d+p*y*Math.sin(y);e.lineTo(g,b)}e.stroke();break;case"right_diagonal_line":e.moveTo(.5-f,_),e.lineTo(f+.5,0),e.stroke(),e.moveTo(f+.5,_),e.lineTo(3*f+.5,0),e.stroke(),e.moveTo(3*f+.5,_),e.lineTo(5*f+.5,0),e.stroke(),e.stroke();break;case"left_diagonal_line":e.moveTo(f+.5,_),e.lineTo(.5-f,0),e.stroke(),e.moveTo(3*f+.5,_),e.lineTo(f+.5,0),e.stroke(),e.moveTo(5*f+.5,_),e.lineTo(3*f+.5,0),e.stroke(),e.stroke();break;case"diagonal_cross":l(e,_);break;case"right_diagonal_dash":e.moveTo(f+.5,3*f+.5),e.lineTo(3*f+.5,f+.5),e.stroke();break;case"left_diagonal_dash":e.moveTo(f+.5,f+.5),e.lineTo(3*f+.5,3*f+.5),e.stroke();break;case"horizontal_wave":e.moveTo(0,f),e.lineTo(d,3*f),e.lineTo(_,f),e.stroke();break;case"vertical_wave":e.moveTo(f,0),e.lineTo(3*f,d),e.lineTo(f,_),e.stroke();break;case"criss_cross":l(e,_),o(e,_,d),s(e,_,d)}}(e.ctx,t,i,r,u,c),e.canvas}},function(e,t,n,i,r){var a;i();var o=e(14),s=e(8),l=e(13),u=e(26),c=e(19),h=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(e){return(0,g.Z)(this,i),n.call(this,e)}return(0,b.Z)(i,[{key:"is_syncable",get:function(){return this.syncable}},{key:t,value:function(e,t){return t.eq(this.id,e.id)&&(0,_.Z)((0,d.Z)(i.prototype),u.equals,this).call(this,e,t)}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(i.prototype),"initialize",this).call(this),this._js_callbacks=new Map}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(i.prototype),"connect_signals",this).call(this),this._update_property_callbacks(),this.connect(this.properties.js_property_callbacks.change,(function(){return e._update_property_callbacks()})),this.connect(this.properties.js_event_callbacks.change,(function(){return e._update_event_callbacks()})),this.connect(this.properties.subscribed_events.change,(function(){return e._update_event_callbacks()}))}},{key:"_process_event",value:function(e){var t,n,i=(0,w.Z)(null!==(t=this.js_event_callbacks[e.event_name])&&void 0!==t?t:[]);try{for(i.s();!(n=i.n()).done;){n.value.execute(e)}}catch(r){i.e(r)}finally{i.f()}null!=this.document&&this.subscribed_events.some((function(t){return t==e.event_name}))&&this.document.event_manager.send_event(e)}},{key:"trigger_event",value:function(e){null!=this.document&&(e.origin=this,this.document.event_manager.trigger(e))}},{key:"_update_event_callbacks",value:function(){null!=this.document?this.document.event_manager.subscribed_models.add(this):c.logger.warn("WARNING: Document not defined for updating event callbacks")}},{key:"_update_property_callbacks",value:function(){var e,t=this,n=function(e){var n=e.split(":"),i=(0,k.Z)(n,2),r=i[0],a=i[1],o=void 0===a?null:a;return null!=o?t.properties[o][r]:t[r]},i=(0,w.Z)(this._js_callbacks);try{for(i.s();!(e=i.n()).done;){var r,a=(0,k.Z)(e.value,2),o=a[0],s=a[1],u=n(o),c=(0,w.Z)(s);try{for(c.s();!(r=c.n()).done;){var h=r.value;this.disconnect(u,h)}}catch(x){c.e(x)}finally{c.f()}}}catch(x){i.e(x)}finally{i.f()}this._js_callbacks.clear();var _,d=(0,w.Z)((0,l.entries)(this.js_property_callbacks));try{for(d.s();!(_=d.n()).done;){var f=(0,k.Z)(_.value,2),v=f[0],p=f[1].map((function(e){return function(){return e.execute(t)}}));this._js_callbacks.set(v,p);var m,y=n(v),g=(0,w.Z)(p);try{for(g.s();!(m=g.n()).done;){var b=m.value;this.connect(y,b)}}catch(x){g.e(x)}finally{g.f()}}}catch(x){d.e(x)}finally{d.f()}}},{key:"_doc_attached",value:function(){(0,l.isEmpty)(this.js_event_callbacks)&&0==this.subscribed_events.length||this._update_event_callbacks()}},{key:"_doc_detached",value:function(){this.document.event_manager.subscribed_models.delete(this)}},{key:"select",value:function(e){if((0,s.isString)(e))return(0,y.Z)(this.references()).filter((function(t){return t instanceof i&&t.name===e}));if(e.prototype instanceof o.HasProps)return(0,y.Z)(this.references()).filter((function(t){return t instanceof e}));throw new Error("invalid selector")}},{key:"select_one",value:function(e){var t=this.select(e);switch(t.length){case 0:return null;case 1:return t[0];default:throw new Error("found more than one object matching given selector")}}}]),i}(o.HasProps,u.equals);n.Model=h,a=h,h.__name__="Model",a.define((function(e){var t=e.Any,n=e.Unknown,i=e.Boolean,r=e.String,a=e.Array,o=e.Dict,s=e.Nullable;return{tags:[a(n),[]],name:[s(r),null],js_property_callbacks:[o(a(t)),{}],js_event_callbacks:[o(a(t)),{}],subscribed_events:[a(r),[]],syncable:[i,!0]}}))},function(e,t,n,i,r){var a,o;i();var s=e(12),l=e(53),u=e(55),c=e(59),h=e(61),_=e(62),d=e(57),f=e(63),m=e(67),y=function(){function e(t,n){(0,g.Z)(this,e),this.x_scale=t,this.y_scale=n,this.x_source=this.x_scale.source_range,this.y_source=this.y_scale.source_range,this.ranges=[this.x_source,this.y_source],this.scales=[this.x_scale,this.y_scale]}return(0,b.Z)(e,[{key:"map_to_screen",value:function(e,t){return[this.x_scale.v_c
2ompute(e),this.y_scale.v_compute(t)]}},{key:"map_from_screen",value:function(e,t){return[this.x_scale.v_invert(e),this.y_scale.v_invert(t)]}}]),e}();n.CoordinateTransform=y,y.__name__="CoordinateTransform";var w=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"x_ranges",get:function(){return new Map([["default",this.x_source]])}},{key:"y_ranges",get:function(){return new Map([["default",this.y_source]])}},{key:"_get_scale",value:function(e,t,n){if(e instanceof m.FactorRange!=t instanceof _.CategoricalScale)throw new Error("Range ".concat(e.type," is incompatible is Scale ").concat(t.type));t instanceof h.LogScale&&e instanceof f.DataRange1d&&(e.scale_hint="log");var i=t.clone();return i.setv({source_range:e,target_range:n}),i}},{key:"get_transform",value:function(e){var t=this.x_source,n=this.x_scale,i=this.x_target,r=this._get_scale(t,n,i),a=this.y_source,o=this.y_scale,s=this.y_target,l=this._get_scale(a,o,s),u=new x({source_scale:r,source_range:r.source_range,target_scale:e.x_scale,target_range:e.x_target}),c=new x({source_scale:l,source_range:l.source_range,target_scale:e.y_scale,target_range:e.y_target});return new y(u,c)}}]),n}(l.Model);n.CoordinateMapping=w,a=w,w.__name__="CoordinateMapping",a.define((function(e){var t=e.Ref;return{x_source:[t(d.Range),function(){return new f.DataRange1d}],y_source:[t(d.Range),function(){return new f.DataRange1d}],x_scale:[t(u.Scale),function(){return new c.LinearScale}],y_scale:[t(u.Scale),function(){return new c.LinearScale}],x_target:[t(d.Range)],y_target:[t(d.Range)]}}));var x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"s_compute",get:function(){var e=this.source_scale.s_compute,t=this.target_scale.s_compute;return function(n){return t(e(n))}}},{key:"s_invert",get:function(){var e=this.source_scale.s_invert,t=this.target_scale.s_invert;return function(n){return e(t(n))}}},{key:"compute",value:function(e){return this.s_compute(e)}},{key:"v_compute",value:function(e){var t=this.s_compute;return(0,s.map)(e,t)}},{key:"invert",value:function(e){return this.s_invert(e)}},{key:"v_invert",value:function(e){var t=this.s_invert;return(0,s.map)(e,t)}}]),n}(u.Scale);n.CompositeScale=x,o=x,x.__name__="CompositeScale",o.internal((function(e){var t=e.Ref;return{source_scale:[t(u.Scale)],target_scale:[t(u.Scale)]}}))},function(e,t,n,i,r){var a;i();var o=e(56),s=e(57),l=e(58),u=e(24),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"compute",value:function(e){return this.s_compute(e)}},{key:"v_compute",value:function(e){for(var t=new u.ScreenArray(e.length),n=this.s_compute,i=0;i<e.length;i++)t[i]=n(e[i]);return t}},{key:"invert",value:function(e){return this.s_invert(e)}},{key:"v_invert",value:function(e){for(var t=new Float64Array(e.length),n=this.s_invert,i=0;i<e.length;i++)t[i]=n(e[i]);return t}},{key:"r_compute",value:function(e,t){var n=this.s_compute;return this.target_range.is_reversed?[n(t),n(e)]:[n(e),n(t)]}},{key:"r_invert",value:function(e,t){var n=this.s_invert;return this.target_range.is_reversed?[n(t),n(e)]:[n(e),n(t)]}}]),n}(o.Transform);n.Scale=c,a=c,c.__name__="Scale",a.internal((function(e){var t=e.Ref;return{source_range:[t(s.Range)],target_range:[t(l.Range1d)]}}))},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(e(53).Model);n.Transform=a,a.__name__="Transform"},function(e,t,n,i,r){var a;i();var o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).have_updated_interactively=!1,i}return(0,b.Z)(n,[{key:"is_reversed",get:function(){return this.start>this.end}},{key:"is_valid",get:function(){return isFinite(this.min)&&isFinite(this.max)}},{key:"span",get:function(){return Math.abs(this.end-this.start)}}]),n}(e(53).Model);n.Range=o,a=o,o.__name__="Range",a.define((function(e){var t=e.Number,n=e.Tuple,i=e.Or,r=e.Auto,a=e.Nullable;return{bounds:[a(i(n(a(t),a(t)),r)),null],min_interval:[a(t),null],max_interval:[a(t),null]}})),a.internal((function(e){return{plots:[(0,e.Array)((0,e.AnyRef)()),[]]}}))},function(e,t,n,i,r){var a;i();var o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_set_auto_bounds",value:function(){if("auto"==this.bounds){var e=Math.min(this._reset_start,this._reset_end),t=Math.max(this._reset_start,this._reset_end);this.setv({bounds:[e,t]},{silent:!0})}}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._set_auto_bounds()}},{key:"min",get:function(){return Math.min(this.start,this.end)}},{key:"max",get:function(){return Math.max(this.start,this.end)}},{key:"reset",value:function(){this._set_auto_bounds();var e=this._reset_start,t=this._reset_end;this.start!=e||this.end!=t?this.setv({start:e,end:t}):this.change.emit()}},{key:"map",value:function(e){return new n({start:e(this.start),end:e(this.end)})}},{key:"widen",value:function(e){var t=this.start,i=this.end;return this.is_reversed?(t+=e,i-=e):(t-=e,i+=e),new n({start:t,end:i})}}]),n}(e(57).Range);n.Range1d=o,a=o,o.__name__="Range1d",a.define((function(e){var t=e.Number,n=e.Nullable;return{start:[t,0],end:[t,1],reset_start:[n(t),null,{on_update:function(e,t){t._reset_start=null!=e?e:t.start}}],reset_end:[n(t),null,{on_update:function(e,t){t._reset_end=null!=e?e:t.end}}]}}))},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"s_compute",get:function(){var e=this._linear_compute_state(),t=(0,k.Z)(e,2),n=t[0],i=t[1];return function(e){return n*e+i}}},{key:"s_invert",get:function(){var e=this._linear_compute_state(),t=(0,k.Z)(e,2),n=t[0],i=t[1];return function(e){return(e-i)/n}}},{key:"_linear_compute_state",value:function(){var e=this.source_range.start,t=this.source_range.end,n=this.target_range.start,i=(this.target_range.end-n)/(t-e);return[i,-i*e+n]}}]),n}(e(60).ContinuousScale);n.LinearScale=a,a.__name__="LinearScale"},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(e(55).Scale);n.ContinuousScale=a,a.__name__="ContinuousScale"},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"s_compute",get:function(){var e=this._compute_state(),t=(0,k.Z)(e,4),n=t[0],i=t[1],r=t[2],a=t[3];return function(e){if(0==r)return 0;var t=(Math.log(e)-a)/r;return isFinite(t)?t*n+i:NaN}}},{key:"s_invert",get:function(){var e=this._compute_state(),t=(0,k.Z)(e,4),n=t[0],i=t[1],r=t[2],a=t[3];return function(e){var t=(e-i)/n;return Math.exp(r*t+a)}}},{key:"_get_safe_factor",value:function(e,t){var n=e<0?0:e,i=t<0?0:t;if(n==i)if(0==n)n=1,i=10;else{var r=Math.log(n)/Math.log(10);n=Math.pow(10,Math.floor(r)),i=Math.ceil(r)!=Math.floor(r)?Math.pow(10,Math.ceil(r)):Math.pow(10,Math.ceil(r)+1)}return[n,i]}},{key:"_compute_state",value:function(){var e,t,n=this.source_range.start,i=this.source_range.end,r=this.target_range.start,a=this.target_range.end-r,o=this._get_safe_factor(n,i),s=(0,k.Z)(o,2),l=s[0],u=s[1];return 0==l?(e=Math.log(u),t=0):(e=Math.log(u)-Math.log(l),t=Math.log(l)),[a,r,e,t]}}]),n}(e(60).ContinuousScale);n.LogScale=a,a.__name__="LogScale"},function(e,t,n,i,r){i();var a=e(55),o=e(59).LinearScale.prototype._linear_compute_state,s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"s_compute",get:function(){var e=o.call(this),t=(0,k.Z)(e,2),n=t[0],i=t[1],r=this.source_range;return function(e){return n*r.synthetic(e)+i}}},{key:"s_invert",get:function(){var e=o.call(this),t=(0,k.Z)(e,2),n=t[0],i=t[1];return function(e){return(e-i)/n}}}]),n}(a.Scale);
2n.CategoricalScale=s,s.__name__="CategoricalScale"},function(e,t,n,i,r){i();var a,o=e(1),s=e(64),l=e(20),u=e(9),c=e(19),h=(0,o.__importStar)(e(65)),f=e(66),m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).have_updated_interactively=!1,i}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).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,this._plot_bounds=new Map}},{key:"min",get:function(){return Math.min(this.start,this.end)}},{key:"max",get:function(){return Math.max(this.start,this.end)}},{key:"computed_renderers",value:function(){var e=this.renderers,t=this.names,n=(0,u.concat)(this.plots.map((function(e){return e.data_renderers})));return(0,f.compute_renderers)(0==e.length?"auto":e,n,t)}},{key:"_compute_plot_bounds",value:function(e,t){var n,i=h.empty(),r=(0,w.Z)(e);try{for(r.s();!(n=r.n()).done;){var a=n.value,o=t.get(a);null==o||!a.visible&&this.only_visible||(i=h.union(i,o))}}catch(s){r.e(s)}finally{r.f()}return i}},{key:"adjust_bounds_for_aspect",value:function(e,t){var n=h.empty(),i=e.x1-e.x0;i<=0&&(i=1);var r=e.y1-e.y0;r<=0&&(r=1);var a=.5*(e.x1+e.x0),o=.5*(e.y1+e.y0);return i<t*r?i=t*r:r=i/t,n.x1=a+.5*i,n.x0=a-.5*i,n.y1=o+.5*r,n.y0=o-.5*r,n}},{key:"_compute_min_max",value:function(e,t){var n,i,r,a=h.empty(),o=(0,w.Z)(e);try{for(o.s();!(r=o.n()).done;){var s=(0,k.Z)(r.value,2),l=s[0],u=s[1];l.visible&&(a=h.union(a,u))}}catch(c){o.e(c)}finally{o.f()}return n=0==t?[a.x0,a.x1]:[a.y0,a.y1],[(i=(0,k.Z)(n,2))[0],i[1]]}},{key:"_compute_range",value:function(e,t){var n,i,r,a=this.range_padding;if(null!=this._initial_start&&(e=this._initial_start),null!=this._initial_end&&(t=this._initial_end),"log"==this.scale_hint){var o,s,l,u;if((isNaN(e)||!isFinite(e)||e<=0)&&(e=isNaN(t)||!isFinite(t)||t<=0?.1:t/100,c.logger.warn("could not determine minimum data value for log axis, DataRange1d using value ".concat(e))),(isNaN(t)||!isFinite(t)||t<=0)&&(t=isNaN(e)||!isFinite(e)||e<=0?10:100*e,c.logger.warn("could not determine maximum data value for log axis, DataRange1d using value ".concat(t))),t==e)s=this.default_span+.001,o=Math.log(e)/Math.log(10);else"percent"==this.range_padding_units?(l=Math.log(e)/Math.log(10),s=((u=Math.log(t)/Math.log(10))-l)*(1+a)):(l=Math.log(e-a)/Math.log(10),s=(u=Math.log(t+a)/M
2ath.log(10))-l),o=(l+u)/2;i=Math.pow(10,o-s/2),r=Math.pow(10,o+s/2)}else{var h,_=(t+e)/2;i=_-(h=t==e?this.default_span:"percent"==this.range_padding_units?(t-e)*(1+a):t-e+2*a)/2,r=_+h/2}var d=1;this.flipped&&(i=(n=[r,i])[0],r=n[1],d=-1);var f=this.follow_interval;return null!=f&&Math.abs(i-r)>f&&("start"==this.follow?r=i+d*f:"end"==this.follow&&(i=r-d*f)),[i,r]}},{key:"update",value:function(e,t,n,i){if(!this.have_updated_interactively){var r=this.computed_renderers(),a=this._compute_plot_bounds(r,e);null!=i&&(a=this.adjust_bounds_for_aspect(a,i)),this._plot_bounds.set(n,a);var o=this._compute_min_max(this._plot_bounds.entries(),t),s=(0,k.Z)(o,2),l=s[0],u=s[1],c=this._compute_range(l,u),h=(0,k.Z)(c,2),_=h[0],d=h[1];null!=this._initial_start&&("log"==this.scale_hint?this._initial_start>0&&(_=this._initial_start):_=this._initial_start),null!=this._initial_end&&("log"==this.scale_hint?this._initial_end>0&&(d=this._initial_end):d=this._initial_end);var f=!1;"auto"==this.bounds&&(this.setv({bounds:[_,d]},{silent:!0}),f=!0);var v=[this.start,this.end],p=v[0],m=v[1];if(_!=p||d!=m){var y={};_!=p&&(y.start=_),d!=m&&(y.end=d),this.setv(y),f=!1}f&&this.change.emit()}}},{key:"reset",value: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()}}]),n}(s.DataRange);n.DataRange1d=m,a=m,m.__name__="DataRange1d",a.define((function(e){var t=e.Boolean,n=e.Number,i=e.Nullable;return{start:[n],end:[n],range_padding:[n,.1],range_padding_units:[l.PaddingUnits,"percent"],flipped:[t,!1],follow:[i(l.StartEnd),null],follow_interval:[i(n),null],default_span:[n,2],only_visible:[t,!1]}})),a.internal((function(e){return{scale_hint:[(0,e.Enum)("log","auto"),"auto"]}}))},function(e,t,n,i,r){var a;i();var o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(e(57).Range);n.DataRange=o,a=o,o.__name__="DataRange",a.define((function(e){var t=e.String,n=e.Array,i=e.AnyRef;return{names:[n(t),[]],renderers:[n(i()),[]]}}))},function(e,t,n,i,r){i();var a=e(24),o=e(26),s=Math.min,l=Math.max;n.empty=function(){return{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}},n.positive_x=function(){return{x0:Number.MIN_VALUE,y0:-1/0,x1:1/0,y1:1/0}},n.positive_y=function(){return{x0:-1/0,y0:Number.MIN_VALUE,x1:1/0,y1:1/0}},n.union=function(e,t){return{x0:s(e.x0,t.x0),x1:l(e.x1,t.x1),y0:s(e.y0,t.y0),y1:l(e.y1,t.y1)}};var u=function(e){function t(e){if((0,g.Z)(this,t),null==e)this.x0=0,this.y0=0,this.x1=0,this.y1=0;else if("x0"in e){var n=e.x0,i=e.y0,r=e.x1,a=e.y1;if(!(n<=r&&i<=a))throw new Error("invalid bbox {x0: ".concat(n,", y0: ").concat(i,", x1: ").concat(r,", y1: ").concat(a,"}"));this.x0=n,this.y0=i,this.x1=r,this.y1=a}else if("x"in e){var o=e.x,s=e.y,l=e.width,u=e.height;if(!(l>=0&&u>=0))throw new Error("invalid bbox {x: ".concat(o,", y: ").concat(s,", width: ").concat(l,", height: ").concat(u,"}"));this.x0=o,this.y0=s,this.x1=o+l,this.y1=s+u}else{var c,h,_,d;if("width"in e)if("left"in e)h=(c=e.left)+e.width;else if("right"in e)c=(h=e.right)-e.width;else{var f=e.width/2;c=e.hcenter-f,h=e.hcenter+f}else c=e.left,h=e.right;if("height"in e)if("top"in e)d=(_=e.top)+e.height;else if("bottom"in e)_=(d=e.bottom)-e.height;else{var v=e.height/2;_=e.vcenter-v,d=e.vcenter+v}else _=e.top,d=e.bottom;if(!(c<=h&&_<=d))throw new Error("invalid bbox {left: ".concat(c,", top: ").concat(_,", right: ").concat(h,", bottom: ").concat(d,"}"));this.x0=c,this.y0=_,this.x1=h,this.y1=d}}return(0,b.Z)(t,[{key:"equals",value:function(e){return this.x0==e.x0&&this.y0==e.y0&&this.x1==e.x1&&this.y1==e.y1}},{key:e,value:function(e,t){return t.eq(this.x0,e.x0)&&t.eq(this.y0,e.y0)&&t.eq(this.x1,e.x1)&&t.eq(this.y1,e.y1)}},{key:"toString",value:function(){return"BBox({left: ".concat(this.left,", top: ").concat(this.top,", width: ").concat(this.width,", height: ").concat(this.height,"})")}},{key:"left",get:function(){return this.x0}},{key:"top",get:function(){return this.y0}},{key:"right",get:function(){return this.x1}},{key:"bottom",get:function(){return this.y1}},{key:"p0",get:function(){return[this.x0,this.y0]}},{key:"p1",get:function(){return[this.x1,this.y1]}},{key:"x",get:function(){return this.x0}},{key:"y",get:function(){return this.y0}},{key:"width",get:function(){return this.x1-this.x0}},{key:"height",get:function(){return this.y1-this.y0}},{key:"size",get:function(){return{width:this.width,height:this.height}}},{key:"rect",get:function(){var e=this.x0,t=this.y0,n=this.x1,i=this.y1;return{p0:{x:e,y:t},p1:{x:n,y:t},p2:{x:n,y:i},p3:{x:e,y:i}}}},{key:"box",get:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},{key:"h_range",get:function(){return{start:this.x0,end:this.x1}}},{key:"v_range",get:function(){return{start:this.y0,end:this.y1}}},{key:"ranges",get:function(){return[this.h_range,this.v_range]}},{key:"aspect",get:function(){return this.width/this.height}},{key:"hcenter",get:function(){return(this.left+this.right)/2}},{key:"vcenter",get:function(){return(this.top+this.bottom)/2}},{key:"area",get:function(){return this.width*this.height}},{key:"relative",value:function(){return new t({x:0,y:0,width:this.width,height:this.height})}},{key:"translate",value:function(e,n){return new t({x:e+this.x,y:n+this.y,width:this.width,height:this.height})}},{key:"relativize",value:function(e,t){return[e-this.x,t-this.y]}},{key:"contains",value:function(e,t){return this.x0<=e&&e<=this.x1&&this.y0<=t&&t<=this.y1}},{key:"clip",value:function(e,t){return e<this.x0?e=this.x0:e>this.x1&&(e=this.x1),t<this.y0?t=this.y0:t>this.y1&&(t=this.y1),[e,t]}},{key:"grow_by",value:function(e){return new t({left:this.left-e,right:this.right+e,top:this.top-e,bottom:this.bottom+e})}},{key:"shrink_by",value:function(e){return new t({left:this.left+e,right:this.right-e,top:this.top+e,bottom:this.bottom-e})}},{key:"union",value:function(e){return new t({x0:s(this.x0,e.x0),y0:s(this.y0,e.y0),x1:l(this.x1,e.x1),y1:l(this.y1,e.y1)})}},{key:"intersection",value:function(e){return this.intersects(e)?
2new t({x0:l(this.x0,e.x0),y0:l(this.y0,e.y0),x1:s(this.x1,e.x1),y1:s(this.y1,e.y1)}):null}},{key:"intersects",value:function(e){return!(e.x1<this.x0||e.x0>this.x1||e.y1<this.y0||e.y0>this.y1)}},{key:"xview",get:function(){var e=this;return{compute:function(t){return e.left+t},v_compute:function(t){for(var n=new a.ScreenArray(t.length),i=e.left,r=0;r<t.length;r++)n[r]=i+t[r];return n}}}},{key:"yview",get:function(){var e=this;return{compute:function(t){return e.bottom-t},v_compute:function(t){for(var n=new a.ScreenArray(t.length),i=e.bottom,r=0;r<t.length;r++)n[r]=i-t[r];return n}}}}],[{key:"from_rect",value:function(e){var n=e.left,i=e.right,r=e.top,a=e.bottom;return new t({x0:Math.min(n,i),y0:Math.min(r,a),x1:Math.max(n,i),y1:Math.max(r,a)})}}]),t}(o.equals);n.BBox=u,u.__name__="BBox"},function(e,t,n,i,r){i();var a=e(9);n.compute_renderers=function(e,t,n){if(null==e)return[];var i="auto"==e?t:e;return n.length>0&&(i=i.filter((function(e){return(0,a.includes)(n,e.name)}))),i}},function(e,t,n,i,r){var a;i();var o=e(57),s=e(20),l=e(21),u=e(24),c=e(9),h=e(8),f=e(11);function m(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=new Map,r=0;r<e.length;r++){var a=e[r];if(i.has(a))throw new Error("duplicate factor or subfactor: ".concat(a));i.set(a,{value:.5+r*(1+t)+n})}return[i,(e.length-1)*t]}function x(e,t,n){var i,r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=new Map,s=new Map,l=(0,w.Z)(e);try{for(l.s();!(r=l.n()).done;){var u=(0,k.Z)(r.value,2),h=u[0],_=u[1],d=null!==(i=s.get(h))&&void 0!==i?i:[];s.set(h,[].concat((0,y.Z)(d),[_]))}}catch(x){l.e(x)}finally{l.f()}var f,v=a,p=0,g=(0,w.Z)(s);try{var b=function(){var e=(0,k.Z)(f.value,2),i=e[0],r=e[1],a=r.length,s=m(r,n,v),l=(0,k.Z)(s,2),u=l[0],h=l[1];p+=h;var _=(0,c.sum)(r.map((function(e){return u.get(e).value})));o.set(i,{value:_/a,mapping:u}),v+=a+t+h};for(g.s();!(f=g.n()).done;)b()}catch(x){g.e(x)}finally{g.f()}return[o,(s.size-1)*t+p]}function Z(e,t,n,i){var r,a,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=new Map,l=new Map,u=(0,w.Z)(e);try{for(u.s();!(a=u.n()).done;){var h=(0,k.Z)(a.value,3),_=h[0],d=h[1],f=h[2],v=null!==(r=l.get(_))&&void 0!==r?r:[];l.set(_,[].concat((0,y.Z)(v),[[d,f]]))}}catch(A){u.e(A)}finally{u.f()}var p,m=o,g=0,b=(0,w.Z)(l);try{var Z=function(){var e=(0,k.Z)(p.value,2),r=e[0],a=e[1],o=a.length,l=x(a,n,i,m),u=(0,k.Z)(l,2),h=u[0],_=u[1];g+=_;var d=(0,c.sum)(a.map((function(e){var t=(0,k.Z)(e,1)[0];return h.get(t).value})));s.set(r,{value:d/o,mapping:h}),m+=o+t+_};for(b.s();!(p=b.n()).done;)Z()}catch(A){b.e(A)}finally{b.f()}return[s,(l.size-1)*t+g]}n.Factor=(0,l.Or)(l.String,(0,l.Tuple)(l.String,l.String),(0,l.Tuple)(l.String,l.String,l.String)),n.FactorSeq=(0,l.Or)((0,l.Array)(l.String),(0,l.Array)((0,l.Tuple)(l.String,l.String)),(0,l.Array)((0,l.Tuple)(l.String,l.String,l.String))),n.map_one_level=m,n.map_two_levels=x,n.map_three_levels=Z;var A=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"min",get:function(){return this.start}},{key:"max",get:function(){return this.end}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._init(!0)}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.properties.factors.change,(function(){return e.reset()})),this.connect(this.properties.factor_padding.change,(function(){return e.reset()})),this.connect(this.properties.group_padding.change,(function(){return e.reset()})),this.connect(this.properties.subgroup_padding.change,(function(){return e.reset()})),this.connect(this.properties.range_padding.change,(function(){return e.reset()})),this.connect(this.properties.range_padding_units.change,(function(){return e.reset()}))}},{key:"reset",value:function(){this._init(!1),this.change.emit()}},{key:"_lookup",value:function(e){switch(e.length){case 1:var t=(0,k.Z)(e,1)[0],n=this._mapping.get(t);return null!=n?n.value:NaN;case 2:var i=(0,k.Z)(e,2),r=i[0],a=i[1],o=this._mapping.get(r);if(null!=o){var s=o.mapping.get(a);if(null!=s)return s.value}return NaN;case 3:var l=(0,k.Z)(e,3),u=l[0],c=l[1],h=l[2],_=this._mapping.get(u);if(null!=_){var d=_.mapping.get(c);if(null!=d){var v=d.mapping.get(h);if(null!=v)return v.value}}return NaN;default:(0,f.unreachable)()}}},{key:"synthetic",value:function(e){if((0,h.isNumber)(e))return e;if((0,h.isString)(e))return this._lookup([e]);var t=0,n=e[e.length-1];return(0,h.isNumber)(n)&&(t=n,e=e.slice(0,-1)),this._lookup(e)+t}},{key:"v_synthetic",value:function(e){for(var t=e.length,n=new u.ScreenArray(t),i=0;i<t;i++)n[i]=this.synthetic(e[i]);return n}},{key:"_init",value:function(e){var t=this,n=function(){if((0,c.every
2)(t.factors,h.isString)){var e=m(t.factors,t.factor_padding),n=(0,k.Z)(e,2);return{levels:1,mapping:n[0],tops:null,mids:null,inside_padding:n[1]}}if((0,c.every)(t.factors,(function(e){return(0,h.isArray)(e)&&2==e.length&&(0,h.isString)(e[0])&&(0,h.isString)(e[1])}))){var i=x(t.factors,t.group_padding,t.factor_padding),r=(0,k.Z)(i,2),a=r[0],o=r[1],s=(0,y.Z)(a.keys());return{levels:2,mapping:a,tops:s,mids:null,inside_padding:o}}if((0,c.every)(t.factors,(function(e){return(0,h.isArray)(e)&&3==e.length&&(0,h.isString)(e[0])&&(0,h.isString)(e[1])&&(0,h.isString)(e[2])}))){var l,u=t.factors,_=Z(u,t.group_padding,t.subgroup_padding,t.factor_padding),d=(0,k.Z)(_,2),v=d[0],p=d[1],g=(0,y.Z)(v.keys()),b=[],A=(0,w.Z)(v);try{for(A.s();!(l=A.n()).done;){var S,T=(0,k.Z)(l.value,2),M=T[0],C=T[1],z=(0,w.Z)(C.mapping.keys());try{for(z.s();!(S=z.n()).done;){var E=S.value;b.push([M,E])}}catch(R){z.e(R)}finally{z.f()}}}catch(R){A.e(R)}finally{A.f()}return{levels:3,mapping:v,tops:g,mids:b,inside_padding:p}}(0,f.unreachable)()}(),i=n.levels,r=n.mapping,a=n.tops,o=n.mids,s=n.inside_padding;this._mapping=r,this.tops=a,this.mids=o;var l=0,u=this.factors.length+s;if("percent"==this.range_padding_units){var _=(u-l)*this.range_padding/2;l-=_,u+=_}else l-=this.range_padding,u+=this.range_padding;this.setv({start:l,end:u,levels:i},{silent:e}),"auto"==this.bounds&&this.setv({bounds:[l,u]},{silent:!0})}}]),n}(o.Range);n.FactorRange=A,a=A,A.__name__="FactorRange",a.define((function(e){var t=e.Number;return{factors:[n.FactorSeq,[]],factor_padding:[t,0],subgroup_padding:[t,.8],group_padding:[t,1.4],range_padding:[t,0],range_padding_units:[s.PaddingUnits,"percent"],start:[t],end:[t]}})),a.internal((function(e){var t=e.Number,n=e.String,i=e.Array,r=e.Tuple,a=e.Nullable;return{levels:[t],mids:[a(i(r(n,n))),null],tops:[a(i(n)),null]}}))},function(e,t,n,i,r){i();var a,o=e(1),s=e(69),l=e(112),u=e(48),c=e(20),h=e(24),f=e(113),m=(0,o.__importStar)(e(18)),y=e(10),w=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,i,r;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:if(t=this.model,i=t.start,r=t.end,e.t0=null!=i,!e.t0){e.next=8;break}return e.next=7,(0,f.build_view)(i,{parent:this});case 7:this.start=e.sent;case 8:if(e.t1=null!=r,!e.t1){e.next=13;break}return e.next=12,(0,f.build_view)(r,{parent:this});case 12:this.end=e.sent;case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"set_data",value:function(e){var t,i;(0,_.Z)((0,d.Z)(n.prototype),"set_data",this).call(this,e),null===(t=this.start)||void 0===t||t.set_data(e),null===(i=this.end)||void 0===i||i.set_data(e)}},{key:"remove",value:function(){var e,t;null===(e=this.start)||void 0===e||e.remove(),null===(t=this.end)||void 0===t||t.remove(),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"map_data",value:function(){var e=this.plot_view.frame;"data"==this.model.start_units?(this._sx_start=this.coordinates.x_scale.v_compute(this._x_start),this._sy_start=this.coordinates.y_scale.v_compute(this._y_start)):(this._sx_start=e.bbox.xview.v_compute(this._x_start),this._sy_start=e.bbox.yview.v_compute(this._y_start)),"data"==this.model.end_units?(this._sx_end=this.coordinates.x_scale.v_compute(this._x_end),this._sy_end=this.coordinates.y_scale.v_compute(this._y_end)):(this._sx_end=e.bbox.xview.v_compute(this._x_end),this._sy_end=e.bbox.yview.v_compute(this._y_end));for(var t=this._sx_start,n=this._sy_start,i=this._sx_end,r=this._sy_end,a=t.length,o=this._angles=new h.ScreenArray(a),s=0;s<a;s++)o[s]=Math.PI/2+(0,y.atan2)([t[s],n[s]],[i[s],r[s]])}},{key:"paint",value:function(e){for(var t=this.start,n=this.end,i=this._sx_start,r=this._sy_start,a=this._sx_end,o=this._sy_end,s=this._angles,l=this.plot_view.frame.bbox,u=l.x,c=l.y,h=l.width,_=l.height,d=0,f=i.length;d<f;d++)null!=n&&(e.save(),e.translate(a[d],o[d]),e.rotate(s[d]),n.render(e,d),e.restore(
2)),null!=t&&(e.save(),e.translate(i[d],r[d]),e.rotate(s[d]+Math.PI),t.render(e,d),e.restore()),this.visuals.line.doit&&(e.save(),null==t&&null==n||(e.beginPath(),e.rect(u,c,h,_),null!=n&&(e.save(),e.translate(a[d],o[d]),e.rotate(s[d]),n.clip(e,d),e.restore()),null!=t&&(e.save(),e.translate(i[d],r[d]),e.rotate(s[d]+Math.PI),t.clip(e,d),e.restore()),e.closePath(),e.clip()),this.visuals.line.set_vectorize(e,d),e.beginPath(),e.moveTo(i[d],r[d]),e.lineTo(a[d],o[d]),e.stroke(),e.restore())}}]),n}(s.DataAnnotationView);n.ArrowView=w,w.__name__="ArrowView";var k=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.DataAnnotation);n.Arrow=k,a=k,k.__name__="Arrow",a.prototype.default_view=w,a.mixins(u.LineVector),a.define((function(e){var t=e.Ref,n=e.Nullable;return{x_start:[m.XCoordinateSpec,{field:"x_start"}],y_start:[m.YCoordinateSpec,{field:"y_start"}],start_units:[c.SpatialUnits,"data"],start:[n(t(l.ArrowHead)),null],x_end:[m.XCoordinateSpec,{field:"x_end"}],y_end:[m.YCoordinateSpec,{field:"y_end"}],end_units:[c.SpatialUnits,"data"],end:[n(t(l.ArrowHead)),function(){return new l.OpenHead}]}}))},function(e,t,n,i,r){i();var a,o=e(1),s=e(40),l=e(70),u=e(75),c=e(78),h=(0,o.__importStar)(e(18)),f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._initial_set_data=!1,e}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this);var t=function(){e.set_data(e.model.source),e._rerender()};this.connect(this.model.change,t),this.connect(this.model.source.streaming,t),this.connect(this.model.source.patching,t),this.connect(this.model.source.change,t)}},{key:"_rerender",value:function(){this.request_render()}},{key:"set_data",value:function(e){var t,n=this,i=(0,w.Z)(this.model);try{for(i.s();!(t=i.n()).done;){var r=t.value;if(r instanceof h.VectorSpec||r instanceof h.ScalarSpec)if(r instanceof h.BaseCoordinateSpec){var a=r.array(e);n["_".concat(r.attr)]=a}else{var o=r.uniform(e);n["".concat(r.attr)]=o}}}catch(u){i.e(u)}finally{i.f()}this.plot_model.use_map&&(null!=n._x&&c.inplace.project_xy(n._x,n._y),null!=n._xs&&c.inplace.project_xsys(n._xs,n._ys));var s,l=(0,w.Z)(this.visuals);try{for(l.s();!(s=l.n()).done;){s.value.update()}}catch(u){l.e(u)}finally{l.f()}}},{key:"_render",value:function(){this._initial_set_data||(this.set_data(this.model.source),this._initial_set_data=!0),this.map_data(),this.paint(this.layer.ctx)}}]),n}(s.AnnotationView);n.DataAnnotationView=f,f.__name__="DataAnnotationView";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.Annotation);n.DataAnnotation=m,a=m,m.__name__="DataAnnotation",a.define((function(e){return{source:[(0,e.Ref)(l.ColumnarDataSource),function(){return new u.ColumnDataSource}]}}))},function(e,t,n,i,r){var a;i();var o=e(71),s=e(15),l=e(19),u=e(73),c=e(8),h=e(9),m=e(13),y=e(72),x=e(74),k=e(29),Z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).selection_manager=new u.SelectionManager((0,f.Z)(i)),i}return(0,b.Z)(n,[{key:"get_array",value:function(e){var t=this.data[e];return null==t?this.data[e]=t=[]:(0,c.isArray)(t)||(this.data[e]=t=Array.from(t)),t}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._select=new s.Signal0(this,"select"),this.inspect=new s.Signal(this,"inspect"),this.streaming=new s.Signal0(this,"streaming"),this.patching=new s.Signal(this,"patching")}},{key:"get_column",value:function(e){var t=this.data[e];return null!=t?t:null}},{key:"columns",value:function(){return(0,m.keys)(this.data)}},{key:"get_length",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=(0,h.uniq)((0,m.values)(this.data).map((function(e){return(0,k.is_NDArray)(e)?e.shape[0]:e.length})));switch(t.length){case 0:return null;case 1:return t[0];default:var n="data source has columns of inconsistent lengths";if(e)return l.logger.warn(n),t.sort()[0];throw new Error(n)}}},{key:"length",get:function(){var e;return null!==(e=this.get_length())&&void 0!==e?e:0}},{key:"clear",value:function(){var e,t={},n=(0,w.Z)(this.columns());try{for(n.s();!(e=n.n()).done;){var i=e.value;t[i]=new this.data[i].constructor(0)}}catch(r){n.e(r)}finally{n.f()}this.data=t}}]),n}(o.DataSource);n.ColumnarDataSource=Z,a=Z,Z.__name__="ColumnarDataSource",a.define((function(e){return{selection_policy:[(0,e.Ref)(x.SelectionPolicy),function(){return new x.UnionRenderers}]}})),a.internal((function(e){return{inspected:[(0,e.AnyRef)(),function(){return new y.Selection}]}}))},function(e,t,n,i,r){var a;i();var o=e(53),s=e(72),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Model);n.DataSource=l,a=l,l.__name__="DataSource",a.define((function(e){return{selected:[(0,e.Ref)(s.Selection),function(){return new s.Selection}]}}))},function(e,t,n,i,r){var a;i();var o=e(53),s=e(9),l=e(13),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_view",value:function(){return this.view}},{key:"selected_glyph",get:function(){return this.selected_glyphs.length>0?this.selected_glyphs[0]:null}},{key:"add_to_selected_glyphs",value:function(e){this.selected_glyphs.push(e)}},{key:"update",value:function(e){switch(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"replace"){case"replace":this.indices=e.indices,this.line_indices=e.line_indices,this.multiline_indices=e.multiline_indices,this.image_indices=e.image_indices,this.view=e.view,this.selected_glyphs=e.selected_glyphs;break;case"append":this.update_through_union(e);break;case"intersect":this.update_through_intersection(e);break;case"subtract":this.update_through_subtraction(e)}}},{key:"clear",value:function(){this.indices=[],this.line_indices=[],this.multiline_indices={},this.image_indices=[],this.view=null,this.selected_glyphs=[]}},{key:"map",value:function(e){return new n(Object.assign(Object.assign({},this.attributes),{indices:this.indices.map(e),multiline_indices:(0,l.to_object)((0,l.entries)(this.multiline_indices).map((function(t){var n=(0,k.Z)(t,2),i=n[0],r=n[1];return[e(Number(i)),r]}))),image_indices:this.image_indices.map((function(t){return Object.assign(Object.assign({},t),{index:e(t.index)})}))}))}},{key:"is_empty",value:function(){return 0==this.indices.length&&0==this.line_indices.length&&0==this.image_indices.length}},{key:"update_through_union",value:function(e){this.indices=(0,s.union)(this.indices,e.indices),this.selected_glyphs=(0,s.union)(e.selected_glyphs,this.selected_glyphs),this.line_indices=(0,s.union)(e.line_indices,this.line_indices),this.view=e.view,this.multiline_indices=(0,l.merge)(e.multiline_indices,this.multiline_indices)}},{key:"update_through_intersection",value:function(e){this.indices=(0,s.intersection)(this.indices,e.indices),this.selected_glyphs=(0,s.union)(e.selected_glyphs,this.selected_glyphs),this.line_indices=(0,s.union)(e.line_indices,this.line_indices),this.view=e.view,this.multiline_indices=(0,l.merge)(e.multiline_indices,this.multiline_indices)}},{key:"update_through_subtraction",value:function(e){this.indices=(0,s.difference)(this.indices,e.indices),this.selected_glyphs=(0,s.union)(e.selected_glyphs,this.selected_glyphs),this.line_indices=(0,s.union)(e.line_indices,this.line_indices),this.view=e.view,this.multiline_indices=(0,l.merge)(e.multiline_indices,this.multiline_indices)}}]),n}(o.Model);n.Selection=u,a=u,u.__name__="Selection",a.define((function(e){var t=e.Int,n=e.Array,i=e.Dict;return{indices:[n(t),[]],line_indices:[n(t),[]],multiline_indices:[i(n(t)),{}]}})),a.internal((function(e){var t=e.Int,n=e.Array,i=e.AnyRef,r=e.Struct,a=e.Nullable;return{selected_glyphs:[n(i()),[]],view:[a(i()),null],image_indices:[n(r({index:t,dim1:t,dim2:t,flat_index:t})),[]]}}))},function(e,t,n,i,r){i();var a=e(72);function o(e){return"GlyphRenderer"==e.model.type}function s(e){return"GraphRenderer"==e.model.type}var l=function(){function e(t){(0,g.Z)(this,e),this.source=t,this.inspectors=new Map}return(0,b.Z)(e,[{key:"select",value:function(e,t,n){var i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"replace",a=[],l=[],u=(0,w.Z)(e);try{for(u.s();!(i=u.n()).done;){var c=i.value;o(c)?a.push(c):s(c)&&l.push(c)}}catch(m){u.e(m)}finally{u.f()}for(var h=!1,_=0,d=l;_<d.length;_++){var f=d[_],v=f.model.selection_policy.hit_test(t,f);h=h||f.model.selection_policy.do_selection(v,f.model,n,r)}if(a.length>0){var p=this.source.selection_policy.hit_test(t,a);h=h||this.source.selection_policy.do_selection(p,this.source,n,r)}return h}},{key:"inspect",value:function(e,t){var n=!1;if(o(e)){var i=e.hit_test(t);if(null!=i){n=!i.is_empty();var r=this.get_or_create_inspector(e.model);r.update(i,!0,"replace"),this.source.setv({inspected:r},{silent:!0}),this.source.inspect.emit([e.model,{geometry:t}])}}else if(s(e)){var a=e.model.inspection_policy.hit_test(t,e);n=n||e.model.inspection_policy.do_inspection(a,t,e,!1,"replace")}return n}},{key:"clear",value:function(e){this.source.selected.clear(),null!=e&&this.get_or_create_inspector(e.model).clear()}},{key:"get_or_create_inspector",value:function(e){var t=this.inspectors.get(e);return null==t&&(t=new a.Selection,this.inspectors.set(e,t)),t}}]),e}();n.SelectionManager=l,l.__name__="SelectionManager"},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"do_selection",value:function(e,t,n,i){return null!=e&&(t.selected.update(e,n,i),t._select.emit(),!t.selected.is_empty())}}]),n}(e(53).Model);n.SelectionPolicy=a,a.__name__="SelectionPolicy";var o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"hit_test",value:function(e,t){var n,i=[],r=(0,w.Z)(t);try{for(r.s();!(n=r.n()).done;){var a=n.value.hit_test(e);null!=a&&i.push(a)}}catch(c){r.e(c)}finally{r.f()}if(i.length>0){var o,s=i[0],l=(0,w.Z)(i);try{for(l.s();!(o=l.n()).done;){var u=o.value;s.update_through_intersection(u)}}catch(c){l.e(c)}finally{l.f()}return s}return null}}]),n}(a);n.IntersectRenderers=o,o.__name__="IntersectRenderers";var s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"hit_test",value:function(e,t){var n,i=[],r=(0,w.Z)(t);try{for(r.s();!(n=r.n()).done;){var a=n.value.hit_test(e);null!=a&&i.push(a)}}catch(c){r.e(c)}finally{r.f()}if(i.length>0){var o,s=i[0],l=(0,w.Z)(i);try{for(l.s();!(o=l.n()).done;){var u=o.value;s.update_through_union(u)}}catch(c){l.e(c)}finally{l.f()}return s}return null}}]),n}(a);n.UnionRenderers=s,s.__name__="UnionRenderers"},function(e,t,n,i,r){i();var a,o=e(1),s=e(70),l=e(8),u=e(13),c=(0,o.__importStar)(e(76)),h=e(77),_=e(35);function d(e,t,n){if((0,l.isArray)(e)){var i=e.concat(t);return null!=n&&i.length>n?i.slice(-n):i}if((0,l.isTypedArray)(e)){var r=e.length+t.length;if(null!=n&&r>n){var a,o=r-n,s=e.length;e.length<n?(a=new e.constructor(n)).set(e,0):a=e;for(var u=o,h=s;u<h;u++)a[u-o]=a[u];for(var _=0,d=t.length;_<d;_++)a[_+(s-o)]=t[_];return a}var f=new e.constructor(t);return c.concat(e,f)}throw new Error("unsupported array types")}function f(e,t){var n,i,r;return(0,l.isNumber)(e)?(n=e,r=e+1,i=1):(n=null!=e.start?e.start:0,r=null!=e.stop?e.stop:t,i=null!=e.step?e.step:1),[n,r,i]}function m(e,t){var n,i=new Set,r=!1,a=(0,w.Z)(t);try{for(a.s();!(n=a.n()).done;){var o=(0,k.Z)(n.value,2),s=o[0],u=o[1],c=void 0,h=void 0,_=void 0,d=void 0;if((0,l.isArray)(s)){var v=(0,k.Z)(s,1)[0];i.add(v),c=e[v].shape,h=e[v],d=u,2===s.length?(c=[1,c[0]],_=[s[0],0,s[1]]):_=s}else(0,l.isNumber)(s)?(d=[u],i.add(s)):(d=u,r=!0),_=[0,0,s],c=[1,e.length],h=e;for(var p=0,m=f(_[1],c[0]),y=(0,k.Z)(m,3),g=y[0],b=y[1],x=y[2],Z=f(_[2],c[1]),A=(0,k.Z)(Z,3),S=A[0],T=A[1],M=A[2],C=g;C<b;C+=x)for(var z=S;z<T;z+=M)r&&i.add(z),h[C*c[1]+z]=d[p],p++}}catch(E){a.e(E)}finally{a.f()}return i}n.stream_to_column=d,n.slice=f,n.patch_to_column=m;var x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"stream",value:function(e,t,n){var i,r=this.data,a=(0,w.Z)((0,u.entries)(e));try{for(a.s();!(i=a.n()).done;){var o=(0,k.Z)(i.value,2),s=o[0],l=o[1];r[s]=d(r[s],l,t)}}catch(h){a.e(h)}finally{a.f()}if(this.setv({data:r},{silent:!0}),this.streaming.emit(),null!=this.document){var c=new _.ColumnsStreamedEvent(this.document,this.ref(),e,t);this.document._notify_change(this,"data",null,null,{setter_id:n,hint:c})}}},{key:"patch",value:function(e,t){var n,i=this.data,r=new Set,a=(0,w.Z)((0,u.entries)(e));try{for(a.s();!(n=a.n()).done;){var o=(0,k.Z)(n.value,2),s=o[0],l=o[1];r=(0,h.union)(r,m(i[s],l))}}catch(d){a.e(d)}finally{a.f()}if(this.setv({data:i},{silent:!0}),this.patching.emit((0,y.Z)(r)),null!=this.document){var c=new _.ColumnsPatchedEvent(this.document,this.ref(),e);this.document._notify_change(this,"data",null,null,{setter_id:t,hint:c})}}}]),n}(s.ColumnarDataSource);n.ColumnDataSource=x,a=x,x.__name__="ColumnDataSource",a.define((function(e){return{data:[(0,e.Dict)(e.Any),{}]}}))},function(e,t,n,i,r){i(),n.concat=function(e){for(var t=e.length,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];for(var a=0,o=i;a<o.length;a++){t+=o[a].length}var s=new e.constructor(t);s.set(e,0);for(var l=e.length,u=0,c=i;u<c.length;u++){var h=c[u];s.set(h,l),l+=h.length}return s}},function(e,t,n,i,r){function a(){for(var e=new Set,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var r=0,a=n;r<a.length;r++){var o,s=a[r],l=(0,w.Z)(s);try{for(l.s();!(o=l.n()).done;){var u=o.value;e.add(u)}}catch(c){l.e(c)}finally{l.f()}}return e}i(),n.union=a,n.intersection=function(e){for(var t=new Set,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var a,o=(0,w.Z)(e);try{e:for(o.s();!(a=o.n()).done;){var s,l=a.value,u=(0,w.Z)(i);try{for(u.s();!(s=u.n()).done;){if(!s.value.has(l))continue e}}catch(c){u.e(c)}finally{u.f()}t.add(l)}}catch(c){o.e(c)}finally{o.f()}return t},n.difference=function(e){for(var t=new Set(e),n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o,s=(0,w.Z)(a.apply(void 0,i));try{for(s.s();!(o=s.n()).done;){var l=o.value;t.delete(l)}}catch(u){s.e(u)}finally{s.f()}return t}},function(e,t,n,i,r){i();var a=e(1),o=(0,a.__importDefault)(e(79)),s=(0,a.__importDefault)(e(80)),l=e(24),u=new s.default("GOOGLE"),c=new s.default("WGS84"),h=(0,o.default)(c,u);n.wgs84_mercator={compute:function(e,t){return isFinite(e)&&isFinite(t)?h.forward([e,t]):[NaN,NaN]},invert:function(e,t){return isFinite(e)&&isFinite(t)?h.inverse([e,t]):[NaN,NaN]}};var _={lon:[-20026376.39,20026376.39],lat:[-20048966.1,20048966.1]},d={lon:[-180,180],lat:[-85.06,85.06]},f=Math.min,v=Math.max;function p(e,t){var i=f(e.length,t.length),r=(0,l.infer_type)(e,t),a=new r(i),o=new r(i);return n.inplace.project_xy(e,t,a,o),[a,o]}n.clip_mercator=function(e,t,n){var i=(0,k.Z)(_[n],2),r=i[0],a=i[1];return[v(e,r),f(t,a)]},n.in_bounds=function(e,t){var n=(0,k.Z)(d[t],2),i=n[0],r=n[1];return i<e&&e<r},function(e){function t(e,t,i,r){var a=f(e.length,t.length);i=null!=i?i:e,r=null!=r?r:t;for(var o=0;o<a;o++){var s=e[o],l=t[o],u=n.wgs84_mercator.compute(s,l),c=(0,k.Z)(u,2),h=c[0],_=c[1];i[o]=h,r[o]=_}}e.project_xy=t,e.project_xsys=function(e,n,i,r){var a=f(e.length,n.length);i=null!=i?i:e,r=null!=r?r:n;for(var o=0;o<a;o++)t(e[o],n[o],i[o],r[o])}}(n.inplace||(n.inplace={})),n.project_xy=p,n.project_xsys=function(e,t){for(var n=f(e.length,t.length),i=new Array(n),r=new Array(n),a=0;a<n;a++){var o=p(e[a],t[a]),s=(0,k.Z)(o,2),l=s[0],u=s[1];i[a]=l,r[a]=u}return[i,r]}},function(e,t,n,i,r){i();var a=e(1),o=(0,a.__importDefault)(e(80)),s=(0,a.__importDefault)(e(106)),l=(0,o.default)("WGS84");function u(e,t,n,i){var r,a,o;return Array.isArray(n)?(r=(0,s.default)(e,t,n,i)||{x:NaN,y:NaN},n.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof r.z?[r.x,r.y,r.z].concat(n.splice(3)):[r.x,r.y,n[2]].concat(n.splice(3)):[r.x,r.y].c
2oncat(n.splice(2)):[r.x,r.y]):(a=(0,s.default)(e,t,n,i),2===(o=Object.keys(n)).length||o.forEach((function(i){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;a[i]=n[i]})),a)}function c(e){return e instanceof o.default?e:e.oProj?e.oProj:(0,o.default)(e)}n.default=function(e,t,n){e=c(e);var i,r=!1;return void 0===t?(t=e,e=l,r=!0):(void 0!==t.x||Array.isArray(t))&&(n=t,t=e,e=l,r=!0),t=c(t),n?u(e,t,n):(i={forward:function(n,i){return u(e,t,n,i)},inverse:function(n,i){return u(t,e,n,i)}},r&&(i.oProj=t),i)}},function(e,t,n,i,r){i();var a=e(1),o=(0,a.__importDefault)(e(81)),s=(0,a.__importDefault)(e(92)),l=(0,a.__importDefault)(e(93)),u=e(101),c=(0,a.__importDefault)(e(103)),h=(0,a.__importDefault)(e(104)),_=(0,a.__importDefault)(e(88)),d=e(105);function f(e,t){if(!(this instanceof f))return new f(e);t=t||function(e){if(e)throw e};var n=(0,o.default)(e);if("object"==typeof n){var i=f.projections.get(n.projName);if(i){if(n.datumCode&&"none"!==n.datumCode){var r=(0,_.default)(c.default,n.datumCode);r&&(n.datum_params=n.datum_params||(r.towgs84?r.towgs84.split(","):null),n.ellps=r.ellipse,n.datumName=r.datumName?r.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var a=(0,u.sphere)(n.a,n.b,n.rf,n.ellps,n.sphere),l=(0,u.eccentricity)(a.a,a.b,a.rf,n.R_A),v=(0,d.getNadgrids)(n.nadgrids),p=n.datum||(0,h.default)(n.datumCode,n.datum_params,a.a,a.b,l.es,l.ep2,v);(0,s.default)(this,n),(0,s.default)(this,i),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=l.es,this.e=l.e,this.ep2=l.ep2,this.datum=p,this.init(),t(null,this)}else t(e)}else t(e)}f.projections=l.default,f.projections.start(),n.default=f},function(e,t,n,i,r){i();var a=e(1),o=(0,a.__importDefault)(e(82)),s=(0,a.__importDefault)(e(89)),l=(0,a.__importDefault)(e(84)),u=(0,a.__importDefault)(e(88)),c=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],h=["3857","900913","3785","102113"];n.default=function(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in o.default}(e))return o.default[e];if(function(e){return c.some((function(t){return e.indexOf(t)>-1}))}(e)){var t=(0,s.default)(e);if(function(e){var t=(0,u.default)(e,"authority");if(t){var n=(0,u.default)(t,"epsg");return n&&h.indexOf(n)>-1}}(t))return o.default["EPSG:3857"];var n=function(e){var t=(0,u.default)(e,"extension");if(t)return(0,u.default)(t,"proj4")}(t);return n?(0,l.default)(n):t}return function(e){return"+"===e[0]}(e)?(0,l.default)(e):void 0}},function(e,t,n,i,r){i();var a=e(1),o=(0,a.__importDefault)(e(83)),s=(0,a.__importDefault)(e(84)),l=(0,a.__importDefault)(e(89));function u(e){var t=this;if(2===arguments.length){var n=arguments[1];"string"==typeof n?"+"===n.charAt(0)?u[e]=(0,s.default)(arguments[1]):u[e]=(0,l.default)(arguments[1]):u[e]=n}else if(1===arguments.length){if(Array.isArray(e))return e.map((function(e){Array.isArray(e)?u.apply(t,e):u(e)}));if("string"==typeof e){if(e in u)return u[e]}else"EPSG"in e?u["EPSG:"+e.EPSG]=e:"ESRI"in e?u["ESRI:"+e.ESRI]=e:"IAU2000"in e?u["IAU2000:"+e.IAU2000]=e:console.log(e);return}}(0,o.default)(u),n.default=u},function(e,t,n,i,r){i(),n.default=function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("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"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}},function(e,t,n,i,r){i();var a=e(1),o=e(85),s=(0,a.__importDefault)(e(86)),l=(0,a.__importDefault)(e(87)),u=(0,a.__importDefault)(e(88));n.default=function(e){var t,n,i,r={},a=e.split("+").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var n=t.split("=");return n.push(!0),e[n[0].toLowerCase()]=n[1],e}),{}),c={proj:"projName",datum:"datumCode",rf:function(e){r.rf=parseFloat(e)},lat_0:function(e){r.lat0=e*o.D2R},lat_1:function(e){r.lat1=e*o.D2R},lat_2:function(e){r.lat2=e*o.D2R},lat_ts:function(e){r.lat_ts=e*o.D2R},lon_0:function(e){r.long0=e*o.D2R},lon_1:function(e){r.long1=e*o.D2R},lon_2:function(e){r.long2=e*o.D2R},alpha:function(e){r.alpha=parseFloat(e)*o.D2R},gamma:function(e){r.rectified_grid_angle=parseFloat(e)},lonc:function(e){r.longc=e*o.D2R},x_0:function(e){r.x0=parseFloat(e)},y_0:function(e){r.y0=parseFloat(e)},k_0:function(e){r.k0=parseFloat(e)},k:function(e){r.k0=parseFloat(e)},a:function(e){r.a=parseFloat(e)},b:function(e){r.b=parseFloat(e)},r_a:function(){r.R_A=!0}
2,zone:function(e){r.zone=parseInt(e,10)},south:function(){r.utmSouth=!0},towgs84:function(e){r.datum_params=e.split(",").map((function(e){return parseFloat(e)}))},to_meter:function(e){r.to_meter=parseFloat(e)},units:function(e){r.units=e;var t=(0,u.default)(l.default,e);t&&(r.to_meter=t.to_meter)},from_greenwich:function(e){r.from_greenwich=e*o.D2R},pm:function(e){var t=(0,u.default)(s.default,e);r.from_greenwich=(t||parseFloat(e))*o.D2R},nadgrids:function(e){"@null"===e?r.datumCode="none":r.nadgrids=e},axis:function(e){var t="ewnsud";3===e.length&&-1!==t.indexOf(e.substr(0,1))&&-1!==t.indexOf(e.substr(1,1))&&-1!==t.indexOf(e.substr(2,1))&&(r.axis=e)},approx:function(){r.approx=!0}};for(t in a)n=a[t],t in c?"function"==typeof(i=c[t])?i(n):r[i]=n:r[t]=n;return"string"==typeof r.datumCode&&"WGS84"!==r.datumCode&&(r.datumCode=r.datumCode.toLowerCase()),r}},function(e,t,n,i,r){i(),n.PJD_3PARAM=1,n.PJD_7PARAM=2,n.PJD_GRIDSHIFT=3,n.PJD_WGS84=4,n.PJD_NODATUM=5,n.SRS_WGS84_SEMIMAJOR=6378137,n.SRS_WGS84_SEMIMINOR=6356752.314,n.SRS_WGS84_ESQUARED=.0066943799901413165,n.SEC_TO_RAD=484813681109536e-20,n.HALF_PI=Math.PI/2,n.SIXTH=.16666666666666666,n.RA4=.04722222222222222,n.RA6=.022156084656084655,n.EPSLN=1e-10,n.D2R=.017453292519943295,n.R2D=57.29577951308232,n.FORTPI=Math.PI/4,n.TWO_PI=2*Math.PI,n.SPI=3.14159265359},function(e,t,n,i,r){i();var a={};n.default=a,a.greenwich=0,a.lisbon=-9.131906111111,a.paris=2.337229166667,a.bogota=-74.080916666667,a.madrid=-3.687938888889,a.rome=12.452333333333,a.bern=7.439583333333,a.jakarta=106.807719444444,a.ferro=-17.666666666667,a.brussels=4.367975,a.stockholm=18.058277777778,a.athens=23.7163375,a.oslo=10.722916666667},function(e,t,n,i,r){i(),n.default={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}}},function(e,t,n,i,r){i();var a=/[\s_\-\/\(\)]/g;n.default=function(e,t){if(e[t])return e[t];for(var n,i=Object.keys(e),r=t.toLowerCase().replace(a,""),o=-1;++o<i.length;)if((n=i[o]).toLowerCase().replace(a,"")===r)return e[n]}},function(e,t,n,i,r){i();var a=(0,e(1).__importDefault)(e(90)),o=e(91);function s(e){return.017453292519943295*e}n.default=function(e){var t=(0,a.default)(e),n=t.shift(),i=t.shift();t.unshift(["name",i]),t.unshift(["type",n]);var r={};return(0,o.sExpr)(t,r),function(e){if("GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"==typeof e.PROJECTION?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var t="",n=0,i=e.AXIS.length;n<i;++n){var r=[e.AXIS[n][0].toLowerCase(),e.AXIS[n][1].toLowerCase()];-1!==r[0].indexOf("north")||("y"===r[0]||"lat"===r[0])&&"north"===r[1]?t+="n":-1!==r[0].indexOf("south")||("y"===r[0]||"lat"===r[0])&&"south"===r[1]?t+="s":-1!==r[0].indexOf("east")||("x"===r[0]||"lon"===r[0])&&"east"===r[1]?t+="e":-1===r[0].indexOf("west")&&("x"!==r[0]&&"lon"!==r[0]||"west"!==r[1])||(t+="w")}2===t.length&&(t+="u"),3===t.length&&(e.axis=t)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var a=e.GEOGCS;function o(t){return t*(e.to_meter||1)}"GEOGCS"===e.type&&(a=e),a&&(a.DATUM?e.datumCode=a.DATUM.name.toLowerCase():e.datumCode=a.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==e.datumCode&&"new_zealand_1949"!==e.datumCode||(e.datumCode="nzgd49"),"wgs_1984"!==e.datumCode&&"world_geodetic_system_1984"!==e.datumCode||("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"_ferro"===e.datumCode.slice(-6)&&(e.datumCode=e.datumCode.slice(0,-6)),"_jakarta"===e.datumCode.slice(-8)&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),a.DATUM&&a.DATUM.SPHEROID&&(e.ellps=a.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=a.DATUM.SPHEROID.a,e.rf=parseFloat(a.DATUM.SPHEROID.rf,10)),a.DATUM&&a.DATUM.TOWGS84&&(e.datum_params=a.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm
265")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",s],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",s],["x0","false_easting",o],["y0","false_northing",o],["long0","central_meridian",s],["lat0","latitude_of_origin",s],["lat0","standard_parallel_1",s],["lat1","standard_parallel_1",s],["lat2","standard_parallel_2",s],["azimuth","Azimuth"],["alpha","azimuth",s],["srsCode","name"]].forEach((function(t){return n=e,r=(i=t)[0],a=i[1],void(!(r in n)&&a in n&&(n[r]=n[a],3===i.length&&(n[r]=i[2](n[r]))));var n,i,r,a})),e.long0||!e.longc||"Albers_Conic_Equal_Area"!==e.projName&&"Lambert_Azimuthal_Equal_Area"!==e.projName||(e.long0=e.longc),e.lat_ts||!e.lat1||"Stereographic_South_Pole"!==e.projName&&"Polar Stereographic (variant B)"!==e.projName||(e.lat0=s(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(r),r}},function(e,t,n,i,r){i(),n.default=function(e){return new c(e).output()};var a=/\s/,o=/[A-Za-z]/,s=/[A-Za-z84]/,l=/[,\]]/,u=/[\d\.E\-\+]/;function c(e){if("string"!=typeof e)throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}c.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;a.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case 1:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},c.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(l.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},c.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},c.prototype.number=function(e){if(!u.test(e)){if(l.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},c.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},c.prototype.keyword=function(e){if(s.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=1)}if(!l.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},c.prototype.neutral=function(e){if(o.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(u.test(e))return this.word=e,void(this.state=3);if(!l.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},c.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)}},function(e,t,n,i,r){function a(e,t,n){Array.isArray(t)&&(n.unshift(t),t=null);var i=t?{}:e,r=n.reduce((function(e,t){return o(t,e),e}),i);t&&(e[t]=r)}function o(e,t){if(Array.isArray(e)){var n=e.shift();if("PARAMETER"===n&&(n=e.shift()),1===e.length)return Array.isArray(e[0])?(t[n]={},void o(e[0],t[n])):void(t[n]=e[0]);if(e.length)if("TOWGS84"!==n){if("AXIS"===n)return n in t||(t[n]=[]),void t[n].push(e);var i;switch(Array.isArray(n)||(t[n]={}),n){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[n]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&o(e[2],t[n]));case"SPHEROID":case"ELLIPSOID":return t[n]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&o(e[3],t[n]));
2case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return e[0]=["name",e[0]],void a(t,n,e);default:for(i=-1;++i<e.length;)if(!Array.isArray(e[i]))return o(e,t[n]);return a(t,n,e)}}else t[n]=e;else t[n]=!0}else t[e]=!0}i(),n.sExpr=o},function(e,t,n,i,r){i(),n.default=function(e,t){var n,i;if(e=e||{},!t)return e;for(i in t)void 0!==(n=t[i])&&(e[i]=n);return e}},function(e,t,n,i,r){i();var a=e(1),o=(0,a.__importDefault)(e(94)),s=(0,a.__importDefault)(e(100)),l=[o.default,s.default],u={},c=[];function h(e,t){var n=c.length;return e.names?(c[n]=e,e.names.forEach((function(e){u[e.toLowerCase()]=n})),this):(console.log(t),!0)}function _(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==u[t]&&c[u[t]]?c[u[t]]:void 0}function d(){l.forEach(h)}n.add=h,n.get=_,n.start=d,n.default={start:d,add:h,get:_}},function(e,t,n,i,r){i();var a=e(1),o=(0,a.__importDefault)(e(95)),s=(0,a.__importDefault)(e(96)),l=(0,a.__importDefault)(e(98)),u=(0,a.__importDefault)(e(99)),c=e(85);function h(){var e=this.b/this.a;this.es=1-e*e,"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=(0,o.default)(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function _(e){var t,n,i=e.x,r=e.y;if(r*c.R2D>90&&r*c.R2D<-90&&i*c.R2D>180&&i*c.R2D<-180)return null;if(Math.abs(Math.abs(r)-c.HALF_PI)<=c.EPSLN)return null;if(this.sphere)t=this.x0+this.a*this.k0*(0,s.default)(i-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(c.FORTPI+.5*r));else{var a=Math.sin(r),o=(0,l.default)(this.e,r,a);t=this.x0+this.a*this.k0*(0,s.default)(i-this.long0),n=this.y0-this.a*this.k0*Math.log(o)}return e.x=t,e.y=n,e}function d(e){var t,n,i=e.x-this.x0,r=e.y-this.y0;if(this.sphere)n=c.HALF_PI-2*Math.atan(Math.exp(-r/(this.a*this.k0)));else{var a=Math.exp(-r/(this.a*this.k0));if(-9999===(n=(0,u.default)(this.e,a)))return null}return t=(0,s.default)(this.long0+i/(this.a*this.k0)),e.x=t,e.y=n,e}n.init=h,n.forward=_,n.inverse=d,n.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],n.default={init:h,forward:_,inverse:d,names:n.names}},function(e,t,n,i,r){i(),n.default=function(e,t,n){var i=e*t;return n/Math.sqrt(1-i*i)}},function(e,t,n,i,r){i();var a=e(1),o=e(85),s=(0,a.__importDefault)(e(97));n.default=function(e){return Math.abs(e)<=o.SPI?e:e-(0,s.default)(e)*o.TWO_PI}},function(e,t,n,i,r){i(),n.default=function(e){return e<0?-1:1}},function(e,t,n,i,r){i();var a=e(85);n.default=function(e,t,n){var i=e*n,r=.5*e;return i=Math.pow((1-i)/(1+i),r),Math.tan(.5*(a.HALF_PI-t))/i}},function(e,t,n,i,r){i();var a=e(85);n.default=function(e,t){for(var n,i,r=.5*e,o=a.HALF_PI-2*Math.atan(t),s=0;s<=15;s++)if(n=e*Math.sin(o),o+=i=a.HALF_PI-2*Math.atan(t*Math.pow((1-n)/(1+n),r))-o,Math.abs(i)<=1e-10)return o;return-9999}},function(e,t,n,i,r){function a(){}function o(e){return e}i(),n.init=a,n.forward=o,n.inverse=o,n.names=["longlat","identity"],n.default={init:a,forward:o,inverse:o,names:n.names}},function(e,t,n,i,r){i();var a=e(1),o=e(85),s=(0,a.__importStar)(e(102)),l=(0,a.__importDefault)(e(88));n.eccentricity=function(e,t,n,i){var r=e*e,a=t*t,s=(r-a)/r,l=0;return i?(r=(e*=1-s*(o.SIXTH+s*(o.RA4+s*o.RA6)))*e,s=0):l=Math.sqrt(s),{es:s,e:l,ep2:(r-a)/a}},n.sphere=function(e,t,n,i,r){if(!e){var a=(0,l.default)(s.default,i);a||(a=s.WGS84),e=a.a,t=a.b,n=a.rf}return n&&!t&&(t=(1-1/n)*e),(0===n||Math.abs(e-t)<o.EPSLN)&&(r=!0,t=e),{a:e,b:t,rf:n,sphere:r}}},function(e,t,n,i,r){i();var a={};n.default=a,a.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},a.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},a.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},a.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},a.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},a.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},a.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},a.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},a.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},a.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},a.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"}
2,a.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},a.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},a.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},a.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},a.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},a.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},a.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},a.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},a.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},a.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},a.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},a.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},a.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},a.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},a.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},a.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},a.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},a.hough={a:6378270,rf:297,ellipseName:"Hough"},a.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},a.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},a.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},a.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},a.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},a.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},a.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},a.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},a.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},a.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},a.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},a.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"},n.WGS84=a.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"},a.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},function(e,t,n,i,r){i();var a={};n.default=a,a.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},a.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},a.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},a.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},a.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},a.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},a.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},a.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},a.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},a.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},a.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},a.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},a.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},a.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},a.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},a.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},a.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},function(e,t,n,i,r){i();var a=e(85);n.default=function(e,t,n,i,r,o,s){var l={};return l.datum_type=void 0===e||"none"===e?a.PJD_NODATUM:a.PJD_WGS84,t&&(l.datum_params=t.map(parseFloat),0===l.datum_params[0]&&0===l.datum_params[1]&&0===l.datum_params[2]||(l.datum_type=a.PJD_3PARAM),l.datum_params.length>3&&(0===l.datum_params[3]&&0===l.datum_params[4]&&0===l.datum_params[5]&&0===l.datum_params[6]||(l.datum_type=a.PJD_7PARAM,l.datum_params[3]*=a.SEC_TO_RAD,l.datum_params[4]*=a.SEC_TO_RAD,l.datum_params[5]*=a.SEC_TO_RAD,l.datum_params[6]=l.datum_params[6]/1e6+1))),s&&(l.datum_type=a.PJD_GRIDSHIFT,l.grids=s),l.a=n,l.b=i,l.es=r,l.ep2=o,l}},function(e,t,n,i,r){i();var a={};function o(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:a[e]||null,isNull:!1}}
2function s(e){return e/3600*Math.PI/180}function l(e,t,n){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,n)))}function u(e){return e.map((function(e){return[s(e.longitudeShift),s(e.latitudeShift)]}))}function c(e,t,n){return{name:l(e,t+8,t+16).trim(),parent:l(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,n),upperLatitude:e.getFloat64(t+88,n),lowerLongitude:e.getFloat64(t+104,n),upperLongitude:e.getFloat64(t+120,n),latitudeInterval:e.getFloat64(t+136,n),longitudeInterval:e.getFloat64(t+152,n),gridNodeCount:e.getInt32(t+168,n)}}function h(e,t,n,i){for(var r=t+176,a=[],o=0;o<n.gridNodeCount;o++){var s={latitudeShift:e.getFloat32(r+16*o,i),longitudeShift:e.getFloat32(r+16*o+4,i),latitudeAccuracy:e.getFloat32(r+16*o+8,i),longitudeAccuracy:e.getFloat32(r+16*o+12,i)};a.push(s)}return a}n.default=function(e,t){var n=new DataView(t),i=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(n),r=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:l(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(n,i);r.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var o=function(e,t,n){for(var i=[],r=0;r<t.nSubgrids;r++){var a=c(e,176,n),o=h(e,176,a,n),l=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),_=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);i.push({ll:[s(a.lowerLongitude),s(a.lowerLatitude)],del:[s(a.longitudeInterval),s(a.latitudeInterval)],lim:[l,_],count:a.gridNodeCount,cvs:u(o)})}return i}(n,r,i),_={header:r,subgrids:o};return a[e]=_,_},n.getNadgrids=function(e){return void 0===e?null:e.split(",").map(o)}},function(e,t,n,i,r){i();var a=e(1),o=e(85),s=(0,a.__importDefault)(e(107)),l=(0,a.__importDefault)(e(109)),u=(0,a.__importDefault)(e(80)),c=(0,a.__importDefault)(e(110)),h=(0,a.__importDefault)(e(111));n.default=function e(t,n,i,r){var a;if(Array.isArray(i)&&(i=(0,c.default)(i)),(0,h.default)(i),t.datum&&n.datum&&function(e,t){return(e.datum.datum_type===o.PJD_3PARAM||e.datum.datum_type===o.PJD_7PARAM)&&"WGS84"!==t.datumCode||(t.datum.datum_type===o.PJD_3PARAM||t.datum.datum_type===o.PJD_7PARAM)&&"WGS84"!==e.datumCode}(t,n)&&(i=e(t,a=new u.default("WGS84"),i,r),t=a),r&&"enu"!==t.axis&&(i=(0,l.default)(t,!1,i)),"longlat"===t.projName)i={x:i.x*o.D2R,y:i.y*o.D2R,z:i.z||0};else if(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),!(i=t.inverse(i)))return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=(0,s.default)(t.datum,n.datum,i))return n.from_greenwich&&(i={x:i.x-n.from_greenwich,y:i.y,z:i.z||0}),"longlat"===n.projName?i={x:i.x*o.R2D,y:i.y*o.R2D,z:i.z||0}:(i=n.forward(i),n.to_meter&&(i={x:i.x/n.to_meter,y:i.y/n.to_meter,z:i.z||0})),r&&"enu"!==n.axis?(0,l.default)(n,!0,i):i}},function(e,t,n,i,r){i();var a=e(1),o=e(85),s=e(108),l=(0,a.__importDefault)(e(96));function u(e){return e===o.PJD_3PARAM||e===o.PJD_7PARAM}function c(e,t,n){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;for(var i={x:-n.x,y:n.y},r={x:Number.NaN,y:Number.NaN},a=[],s=0;s<e.grids.length;s++){var l=e.grids[s];if(a.push(l.name),l.isNull){r=i;break}if(l.mandatory,null!==l.grid){var u=l.grid.subgrids[0],c=(Math.abs(u.del[1])+Math.abs(u.del[0]))/1e4,_=u.ll[0]-c,d=u.ll[1]-c,f=u.ll[0]+(u.lim[0]-1)*u.del[0]+c,v=u.ll[1]+(u.lim[1]-1)*u.del[1]+c;if(!(d>i.y||_>i.x||v<i.y||f<i.x||(r=h(i,t,u),isNaN(r.x))))break}else if(l.mandatory)return console.log("Unable to find mandatory grid '"+l.name+"'"),-1}return isNaN(r.x)?(console.log("Failed to find a grid shift table for location '"+-i.x*o.R2D+" "+i.y*o.R2D+" tried: '"+a+"'"),-1):(n.x=-r.x,n.y=r.y,0)}function h(e,t,n){var i={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return i;var r={x:e.x,y:e.y};r.x-=n.ll[0],r.y-=n.ll[1],r.x=(0,l.default)(r.x-Math.PI)+Math.PI;var a=_(r,n);if(t){if(isNaN(a.x))return i;a.x=r.x-a.x,a.y=r.y-a.y;var o,s,u=9;do{if(s=_(a,n),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge.  Using first approximation.");break}o={x:r.x-(s.x+a.x),y:r.y-(s.y+a.y)},a.x+=o.x,a.y+=o.y}while(u--&&Math.abs(o.x)>1e-12&&Math.abs(o.y)>1e-12);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=(0,l.default)(a.x+n.ll[0]),i.y=a.y+n.ll[1]}else isNaN(a.x)||(i.x=e.x+a.x,i.y=e.y+a.y);return i}function _(e,t){var n,i={x:e.x/t.del[0],y:e.y/t.del[1]},r=Math.floor(i.x),a=Math.floor(i.y),o=i.x-1*r,s=i.y-1*a,l={x:Number.NaN,y:Number.NaN};if(r<0||r>=t.lim[0])return l;if(a<0||a>=t.lim[1])return l;n=a*t.lim[0]+r;var u=t.cvs[n][0],c=t.cvs[n][1];n++;var h=t.cvs[n][0],_=t.cvs[n][1];n+=t.lim[0];var d=t.cvs[n][0],f=t.cvs[n][1];n--;var v=t.cvs[n][0],p=t.cvs[n][1],m=o*s,y=o*(1-s),g=(1-o)*(1-s),b=(1-o)*s;return l.x=g*u+y*h+b*v+m*d,l.y=g*c+y*_+b*p+m*f,l}n.default=function(e,t,n){if((0,s.compareDatums)(e,t))return n;
2if(e.datum_type===o.PJD_NODATUM||t.datum_type===o.PJD_NODATUM)return n;var i=e.a,r=e.es;if(e.datum_type===o.PJD_GRIDSHIFT){if(0!==c(e,!1,n))return;i=o.SRS_WGS84_SEMIMAJOR,r=o.SRS_WGS84_ESQUARED}var a=t.a,l=t.b,h=t.es;return t.datum_type===o.PJD_GRIDSHIFT&&(a=o.SRS_WGS84_SEMIMAJOR,l=o.SRS_WGS84_SEMIMINOR,h=o.SRS_WGS84_ESQUARED),r!==h||i!==a||u(e.datum_type)||u(t.datum_type)?(n=(0,s.geodeticToGeocentric)(n,r,i),u(e.datum_type)&&(n=(0,s.geocentricToWgs84)(n,e.datum_type,e.datum_params)),u(t.datum_type)&&(n=(0,s.geocentricFromWgs84)(n,t.datum_type,t.datum_params)),n=(0,s.geocentricToGeodetic)(n,h,a,l),t.datum_type!==o.PJD_GRIDSHIFT||0===c(t,!0,n)?n:void 0):n},n.applyGridShift=c},function(e,t,n,i,r){i();var a=e(85);n.compareDatums=function(e,t){return e.datum_type===t.datum_type&&!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(e.datum_type===a.PJD_3PARAM?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type!==a.PJD_7PARAM||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])},n.geodeticToGeocentric=function(e,t,n){var i,r,o,s,l=e.x,u=e.y,c=e.z?e.z:0;if(u<-a.HALF_PI&&u>-1.001*a.HALF_PI)u=-a.HALF_PI;else if(u>a.HALF_PI&&u<1.001*a.HALF_PI)u=a.HALF_PI;else{if(u<-a.HALF_PI)return{x:-1/0,y:-1/0,z:e.z};if(u>a.HALF_PI)return{x:1/0,y:1/0,z:e.z}}return l>Math.PI&&(l-=2*Math.PI),r=Math.sin(u),s=Math.cos(u),o=r*r,{x:((i=n/Math.sqrt(1-t*o))+c)*s*Math.cos(l),y:(i+c)*s*Math.sin(l),z:(i*(1-t)+c)*r}},n.geocentricToGeodetic=function(e,t,n,i){var r,o,s,l,u,c,h,_,d,f,v,p,m,y,g,b=e.x,w=e.y,x=e.z?e.z:0;if(r=Math.sqrt(b*b+w*w),o=Math.sqrt(b*b+w*w+x*x),r/n<1e-12){if(y=0,o/n<1e-12)return a.HALF_PI,g=-i,{x:e.x,y:e.y,z:e.z}}else y=Math.atan2(w,b);s=x/o,_=(l=r/o)*(1-t)*(u=1/Math.sqrt(1-t*(2-t)*l*l)),d=s*u,m=0;do{m++,c=t*(h=n/Math.sqrt(1-t*d*d))/(h+(g=r*_+x*d-h*(1-t*d*d))),p=(v=s*(u=1/Math.sqrt(1-c*(2-c)*l*l)))*_-(f=l*(1-c)*u)*d,_=f,d=v}while(p*p>1e-24&&m<30);return{x:y,y:Math.atan(v/Math.abs(f)),z:g}},n.geocentricToWgs84=function(e,t,n){if(t===a.PJD_3PARAM)return{x:e.x+n[0],y:e.y+n[1],z:e.z+n[2]};if(t===a.PJD_7PARAM){var i=n[0],r=n[1],o=n[2],s=n[3],l=n[4],u=n[5],c=n[6];return{x:c*(e.x-u*e.y+l*e.z)+i,y:c*(u*e.x+e.y-s*e.z)+r,z:c*(-l*e.x+s*e.y+e.z)+o}}},n.geocentricFromWgs84=function(e,t,n){if(t===a.PJD_3PARAM)return{x:e.x-n[0],y:e.y-n[1],z:e.z-n[2]};if(t===a.PJD_7PARAM){var i=n[0],r=n[1],o=n[2],s=n[3],l=n[4],u=n[5],c=n[6],h=(e.x-i)/c,_=(e.y-r)/c,d=(e.z-o)/c;return{x:h+u*_-l*d,y:-u*h+_+s*d,z:l*h-s*_+d}}}},function(e,t,n,i,r){i(),n.default=function(e,t,n){var i,r,a,o=n.x,s=n.y,l=n.z||0,u={};for(a=0;a<3;a++)if(!t||2!==a||void 0!==n.z)switch(0===a?(i=o,r=-1!=="ew".indexOf(e.axis[a])?"x":"y"):1===a?(i=s,r=-1!=="ns".indexOf(e.axis[a])?"y":"x"):(i=l,r="z"),e.axis[a]){case"e":case"n":u[r]=i;break;case"w":case"s":u[r]=-i;break;case"u":void 0!==n[r]&&(u.z=i);break;case"d":void 0!==n[r]&&(u.z=-i);break;default:return null}return u}},function(e,t,n,i,r){i(),n.default=function(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}},function(e,t,n,i,r){function a(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}i(),n.default=function(e){a(e.x),a(e.y)}},function(e,t,n,i,r){i();var a,o,s,l,u,c=e(1),h=e(53),f=e(42),m=(0,c.__importStar)(e(45)),y=e(48),x=(0,c.__importStar)(e(18)),k=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.visual
2s=new m.Visuals(this)}},{key:"request_render",value:function(){this.parent.request_render()}},{key:"canvas",get:function(){return this.parent.canvas}},{key:"set_data",value:function(e){var t,n=(0,w.Z)(this.model);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i instanceof x.VectorSpec||i instanceof x.ScalarSpec){var r=i.uniform(e);this["".concat(i.attr)]=r}}}catch(a){n.e(a)}finally{n.f()}}}]),n}(f.View);n.ArrowHeadView=k,k.__name__="ArrowHeadView";var Z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(h.Model);n.ArrowHead=Z,a=Z,Z.__name__="ArrowHead",a.define((function(){return{size:[x.NumberSpec,25]}}));var A=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"clip",value:function(e,t){this.visuals.line.set_vectorize(e,t);var n=this.size.get(t);e.moveTo(.5*n,n),e.lineTo(.5*n,-2),e.lineTo(-.5*n,-2),e.lineTo(-.5*n,n),e.lineTo(0,0),e.lineTo(.5*n,n)}},{key:"render",value:function(e,t){if(this.visuals.line.doit){this.visuals.line.set_vectorize(e,t);var n=this.size.get(t);e.beginPath(),e.moveTo(.5*n,n),e.lineTo(0,0),e.lineTo(-.5*n,n),e.stroke()}}}]),n}(k);n.OpenHeadView=A,A.__name__="OpenHeadView";var S=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(Z);n.OpenHead=S,o=S,S.__name__="OpenHead",o.prototype.default_view=A,o.mixins(y.LineVector);var T=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"clip",value:function(e,t){this.visuals.line.set_vectorize(e,t);var n=this.size.get(t);e.moveTo(.5*n,n),e.lineTo(.5*n,-2),e.lineTo(-.5*n,-2),e.lineTo(-.5*n,n),e.lineTo(.5*n,n)}},{key:"render",value:function(e,t){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(e,t),this._normal(e,t),e.fill()),this.visual
2s.line.doit&&(this.visuals.line.set_vectorize(e,t),this._normal(e,t),e.stroke())}},{key:"_normal",value:function(e,t){var n=this.size.get(t);e.beginPath(),e.moveTo(.5*n,n),e.lineTo(0,0),e.lineTo(-.5*n,n),e.closePath()}}]),n}(k);n.NormalHeadView=T,T.__name__="NormalHeadView";var M=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(Z);n.NormalHead=M,s=M,M.__name__="NormalHead",s.prototype.default_view=T,s.mixins([y.LineVector,y.FillVector]),s.override({fill_color:"black"});var C=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"clip",value:function(e,t){this.visuals.line.set_vectorize(e,t);var n=this.size.get(t);e.moveTo(.5*n,n),e.lineTo(.5*n,-2),e.lineTo(-.5*n,-2),e.lineTo(-.5*n,n),e.lineTo(0,.5*n),e.lineTo(.5*n,n)}},{key:"render",value:function(e,t){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(e,t),this._vee(e,t),e.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(e,t),this._vee(e,t),e.stroke())}},{key:"_vee",value:function(e,t){var n=this.size.get(t);e.beginPath(),e.moveTo(.5*n,n),e.lineTo(0,0),e.lineTo(-.5*n,n),e.lineTo(0,.5*n),e.closePath()}}]),n}(k);n.VeeHeadView=C,C.__name__="VeeHeadView";var z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(Z);n.VeeHead=z,l=z,z.__name__="VeeHead",l.prototype.default_view=C,l.mixins([y.LineVector,y.FillVector]),l.override({fill_color:"black"});var E=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"render",value:function(e,t){if(this.visuals.line.doit){this.visuals.line.set_vectorize(e,t);var n=this.size.get(t);e.beginPath(),e.moveTo(.5*n,0),e.lineTo(-.5*n,0),e.stroke()}}},{key:"clip",value:function(e,t){}}]),n}(k);n.TeeHeadView=E,E.__name__="TeeHeadView";var R=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(Z);n.TeeHead=R,u=R,R.__name__="TeeHead",u.prototype.default_view=E,u.mixins(y.LineVector)},function(e,t,n,i,r){i();var a=e(9);function o(e,t,n){return s.apply(this,arguments)}function s(){return s=(0,Z.Z)((0,x.Z)().mark((function e(t,n,i){var r;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new t(Object.assign(Object.assign({},i),{model:n}))).initialize(),e.next=4,r.lazy_initialize();case 4:return e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)}))),s.apply(this,arguments)}n.build_view=function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(t){var n,i,r,a=arguments;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{parent:null},i=a.length>2&&void 0!==a[2]?a[2]:function(e){return e.default_view},e.next=4,o(i(t),t,n);case 4:return r=e.sent,e.abrupt("return",(r.connect_signals(),r));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n.build_views=function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(t,n){var i,r,s,l,u,c,h,_,d,f,v,p,m,g,b=arguments;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=b.length>2&&void 0!==b[2]?b[2]:{parent:null},r=b.length>3&&void 0!==b[3]?b[3]:function(e){return e.default_view},s=(0,a.difference)((0,y.Z)(t.keys()),n),l=(0,w.Z)(s);try{for(l.s();!(u=l.n()).done;)c=u.value,t.get(c).remove(),t.delete(c)}catch(x){l.e(x)}finally{l.f()}h=[],_=n.filter((function(e){return!t.has(e)})),d=(0,w.Z)(_),e.prev=7,d.s();case 9:if((f=d.n()).done){e.next=17;break}return v=f.value,e.next=13,o(r(v),v,i);case 13:p=e.sent,t.set(v,p),h.push(p);case 15:e.next=9;break;case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(7),d.e(e.t0);case 22:return e.prev=22,d.f(),e.finish(22);case 25:for(m=0,g=h;m<g.length;m++)g[m].connect_signals();return e.abrupt("return",h);case 27:case"end":return e.stop()}}),e,null,[[7,19,22,25]])})));return function(t,n){return e.apply(this,arguments)}}(),n.remove_views=function(e){var t,n=(0,w.Z)(e);try{for(n.s();!(t=n.n()).done;){var i=(0,k.Z)(t.value,2),r=i[0];i[1].remove(),e.delete(r)}}catch(a){n.e(a)}finally{n.f()}}},function(e,t,n,i,r){i();var a,o=e(1),s=e(115),l=(0,o.__importStar)(e(48)),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"paint",value:function(e){e.beginPath(),e.moveTo(this._lower_sx[0],this._lower_sy[0]);for(var t=0,n=this._lower_sx.length;t<n;t++)e.lineTo(this._lower_sx[t],this._lower_sy[t]);for(var i=this._upper_sx.length-1;i>=0;i--)e.lineTo(this._upper_sx[i],this._upper_sy[i]);
2e.closePath(),this.visuals.fill.apply(e),e.beginPath(),e.moveTo(this._lower_sx[0],this._lower_sy[0]);for(var r=0,a=this._lower_sx.length;r<a;r++)e.lineTo(this._lower_sx[r],this._lower_sy[r]);this.visuals.line.apply(e),e.beginPath(),e.moveTo(this._upper_sx[0],this._upper_sy[0]);for(var o=0,s=this._upper_sx.length;o<s;o++)e.lineTo(this._upper_sx[o],this._upper_sy[o]);this.visuals.line.apply(e)}}]),n}(s.UpperLowerView);n.BandView=u,u.__name__="BandView";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.UpperLower);n.Band=c,a=c,c.__name__="Band",a.prototype.default_view=u,a.mixins([l.Line,l.Fill]),a.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(e,t,n,i,r){i();var a,o=e(1),s=e(69),l=e(20),u=(0,o.__importStar)(e(18)),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"map_data",value:function(){var e,t,n,i=this.plot_view.frame,r=this.model.dimension,a=this.coordinates.x_scale,o=this.coordinates.y_scale,s="height"==r?o:a,l="height"==r?a:o,u="height"==r?i.bbox.yview:i.bbox.xview,c="height"==r?i.bbox.xview:i.bbox.yview;e="data"==this.model.properties.lower.units?s.v_compute(this._lower):u.v_compute(this._lower),t="data"==this.model.properties.upper.units?s.v_compute(this._upper):u.v_compute(this._upper),n="data"==this.model.properties.base.units?l.v_compute(this._base):c.v_compute(this._base);var h="height"==r?[1,0]:[0,1],_=(0,k.Z)(h,2),d=_[0],f=_[1],v=[e,n],p=[t,n];this._lower_sx=v[d],this._lower_sy=v[f],this._upper_sx=p[d],this._upper_sy=p[f]}}]),n}(s.DataAnnotationView);n.UpperLowerView=c,c.__name__="UpperLowerView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"dimension",get:function(){return"width"==this.obj.dimension?"x":"y"}},{key:"units",get:function(){var e;return null!==(e=this.spec.units)&&void 0!==e?e:"data"}}]),n}(u.CoordinateSpec);n.XOrYCoordinateSpec=h,h.__name__="XOrYCoordinateSpec";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.DataAnnotation);n.UpperLower=_,a=_,_.__name__="UpperLower",a.define((function(){return{dimension:[l.Dimension,"height"],lower:[h,{field:"lower"}],upper:[h,{field:"upper"}],base:[h,{field:"base"}]}}))},function(e,t,n,i,r){i();var a,o=e(1),s=e(40),l=(0,o.__importStar)(e(48)),u=e(20),c=e(65);n.EDGE_TOLERANCE=2.5;var h=function(e){(0,v.Z)(i,e);var t=(0,p.Z)(i);function i(){var e;return(0,g.Z)(this,i),(e=t.apply(this,arguments)).bbox=new c.BBox,e}return(0,b.Z)(i,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(i.prototype),"connect_signals",this).call(this),this.connect(this.model.change,(function(){return e.request_render()}))}},{key:"_render",value:function(){var e=this,t=this.model,n=t.left,i=t.right,r=t.top,a=t.bottom;if(null!=n||null!=i||null!=r||null!=a){var o=this.plot_view.frame,s=this.coordinates.x_scale,l=this.coordinates.y_scale,u=function(t,n,i,r,a){return null!=t?e.model.screen?t:"data"==n?i.compute(t):r.compute(t):a};this.bbox=c.BBox.from_rect({left:u(n,this.model.left_units,s,o.bbox.xview,o.bbox.left),right:u(i,this.model.right_units,s,o.bbox.xview,o.bbox.right),top:u(r,this.model.top_units,l,o.bbox.yview,o.bbox.top),bottom:u(a,this.model.bottom_units,l,o.bbox.yview,o.bbox.bottom)}),this._paint_box()}}},{key:"_paint_box",value:function(){var e=this.layer.ctx;e.save();var t=this.bbox,n=t.left,i=t.top,r=t.width,a=t.height;
2e.beginPath(),e.rect(n,i,r,a),this.visuals.fill.apply(e),this.visuals.hatch.apply(e),this.visuals.line.apply(e),e.restore()}},{key:"interactive_bbox",value:function(){var e=this.model.line_width+n.EDGE_TOLERANCE;return this.bbox.grow_by(e)}},{key:"interactive_hit",value:function(e,t){return null!=this.model.in_cursor&&this.interactive_bbox().contains(e,t)}},{key:"cursor",value:function(e,t){var n=this.bbox,i=n.left,r=n.right,a=n.bottom,o=n.top;return Math.abs(e-i)<3||Math.abs(e-r)<3?this.model.ew_cursor:Math.abs(t-a)<3||Math.abs(t-o)<3?this.model.ns_cursor:this.bbox.contains(e,t)?this.model.in_cursor:null}}]),i}(s.AnnotationView);n.BoxAnnotationView=h,h.__name__="BoxAnnotationView";var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"update",value:function(e){var t=e.left,n=e.right,i=e.top,r=e.bottom;this.setv({left:t,right:n,top:i,bottom:r,screen:!0})}}]),n}(s.Annotation);n.BoxAnnotation=f,a=f,f.__name__="BoxAnnotation",a.prototype.default_view=h,a.mixins([l.Line,l.Fill,l.Hatch]),a.define((function(e){var t=e.Number,n=e.Nullable;return{top:[n(t),null],top_units:[u.SpatialUnits,"data"],bottom:[n(t),null],bottom_units:[u.SpatialUnits,"data"],left:[n(t),null],left_units:[u.SpatialUnits,"data"],right:[n(t),null],right_units:[u.SpatialUnits,"data"],render_mode:[u.RenderMode,"canvas"]}})),a.internal((function(e){var t=e.Boolean,n=e.String,i=e.Nullable;return{screen:[t,!1],ew_cursor:[i(n),null],ns_cursor:[i(n),null],in_cursor:[i(n),null]}})),a.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(e,t,n,i,r){i();var a,o=e(1),s=e(40),l=e(118),u=e(126),c=e(127),h=e(130),f=e(168),m=e(131),y=e(192),w=e(132),A=e(173),S=e(172),T=e(196),M=e(204),C=e(206),z=e(133),E=e(20),R=(0,o.__importStar)(e(48)),B=e(9),N=e(207),O=e(208),D=e(211),I=e(123),P=e(11),V=e(113),L=e(65),j=e(8),U=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"orientation",get:function(){return this._orientation}},{key:"initialize",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this);var t=this.model,i=t.ticker,r=t.formatter,a=t.color_mapper;this._ticker="auto"!=i?i:function(){switch(!0){case a instanceof T.LogColorMapper:return new f.LogTicker;case a instanceof T.ScanningColorMapper:return new f.BinnedTicker({mapper:a});case a instanceof T.CategoricalColorMapper:return new f.CategoricalTicker;default:return new f.BasicTicker}}(),this._formatter="auto"!=r?r:function(){switch(!0){case e._ticker instanceof f.LogTicker:return new y.LogTickFormatter;case a instanceof T.CategoricalColorMapper:return new y.CategoricalTickFormatter;default:return new y.BasicTickFormatter}}(),this._major_range=function(){if(a instanceof T.CategoricalColorMapper){var e=a.factors;return new C.FactorRange({factors:e})}if(a instanceof S.ContinuousColorMapper){var t=a.metrics,n=t.min,i=t.max;return new C.Range1d({start:n,end:i})}(0,P.unreachable)()}(),this._major_scale=function(){if(a instanceof T.LinearColorMapper)return new M.LinearScale;if(a instanceof T.LogColorMapper)return new M.LogScale;if(a instanceof T.ScanningColorMapper){var e=a.metrics.binning;return new M.LinearInterpolationScale({binning:e})}if(a instanceof T.CategoricalColorMapper)return new M.CategoricalScale;(0,P.unreachable)()}(),this._minor_range=new C.Range1d({start:0,end:1}),this._minor_scale=new M.LinearScale;var o=R.attrs_of(this.model,"major_label_",R.Text,!0),s=R.attrs_of(this.model,"major_tick_",R.Line,!0),u=R.attrs_of(this.model,"minor_tick_",R.Line,!0),h=R.attrs_of(this.model,"title_",R.Text),v=a instanceof T.CategoricalColorMapper?c.CategoricalAxis:a instanceof T.LogColorMapper?c.LogAxis:c.LinearAxis;this._axis=new v(Object.assign(Object.assign(Object.assign({ticker:this._ticker,formatter:this._formatter,major_tick_in:this.model.major_tick_in,major_tick_out:this.model.major_tick_out,minor_tick_in:this.model.minor_tick_in,minor_tick_out:this.model.minor_tick_out,major_label_standoff:this.model.label_standoff,major_label_overrides:this.model.major_label_overrides,major_label_policy:this.model.major_label_policy,axis_line_color:null},o),s),u));var p=this.model.title;p&&(this._title=new l.Title(Object.assign({text:p,standoff:this.model.title_standoff},h)))}},{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,i;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:return t=this,e.t0=function(){t.parent.request_layout()},i={get parent(){return t.parent},get root(){return t.root},get frame(){return t._frame},get canvas_view(){return t.parent.canvas_view},request_layout:e.t0},e.next=7,(0,V.build_view)(this._axis,{parent:i});case 7:if(this._axis_view=e.sent,e.t1=null!=this._title,!e.t1){e.next=13;break}return e.next=12,(0,V.build_view)(this._title,{parent:i});case 12:this._title_view=e.sent;case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"remove",value:function(){var e;null===(e=this._title_view)||void 0===e||e.remove(),this._axis_view.remove(),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this._ticker.change,(function(){return e.request_render()})),this.connect(this._formatter.change,(function(){return e.request_render()})),this.connect(this.model.color_mapper.metrics_change,(function(){var t=e._major_range,n=e._major_scale,i=e.model.color_mapper;if(i instanceof S.ContinuousColorMapper&&t instanceof C.Range1d){var r=i.metrics,a=r.min,o=r.max;t.setv({start:a,end:o})}if(i instanceof T.ScanningColorMapper&&n instanceof M.LinearInterpolationScale){var s=i.metrics.binning;n.binning=s}e._set_canvas_image(),e.plot_view.request_layout()}))}},{key:"_set_canvas_image",value:function(){var e=this,t=this.orientation,n=function(){var n=e.model.color_mapper.palette;return"vertical"==t?(0,B.reversed)(n):n}(),i="vertical"==t?[1,n.length]:[n.length,1],r=(0,k.Z)(i,2),a=r[0],o=r[1],s=this._image=document.createElement("canvas");s.width=a,s.height=o;var l=s.getContext("2d"),u=l.getImageData(0,0,a,o),c=new T.LinearColorMapper({palette:n}).rgba_mapper.v_compute((0,B.range)(0,n.length));u.data.set(c),l.putImageData(u,0,0)}},{key:"update_layout",value:function(){var e=this,t=this.model,n=t.location,i=t.width,r=t.height,a=t.padding,o=t.margin,s=function(){if(!(0,j.isString)(n))return["end","start"];
2switch(n){case"top_left":return["start","start"];case"top":case"top_center":return["start","center"];case"top_right":return["start","end"];case"bottom_left":return["end","start"];case"bottom":case"bottom_center":return["end","center"];case"bottom_right":return["end","end"];case"left":case"center_left":return["center","start"];case"center":case"center_center":return["center","center"];case"right":case"center_right":return["center","end"]}}(),l=(0,k.Z)(s,2),c=l[0],h=l[1],_=this._orientation=function(){var t=e.model.orientation;return"auto"==t?null!=e.panel?e.panel.is_horizontal?"horizontal":"vertical":"start"==h||"end"==h||"center"==h&&"center"==c?"vertical":"horizontal":t}(),d=new O.NodeLayout,f=new O.VStack,v=new O.VStack,p=new O.HStack,m=new O.HStack;d.absolute=!0,f.absolute=!0,v.absolute=!0,p.absolute=!0,m.absolute=!0;var y="horizontal"==_?[e._major_scale,e._minor_scale,e._major_range,e._minor_range]:[e._minor_scale,e._major_scale,e._minor_range,e._major_range],g=(0,k.Z)(y,4),b=g[0],w=g[1],x=g[2],Z=g[3];this._frame=new u.CartesianFrame(b,w,x,Z),d.on_resize((function(t){return e._frame.set_geometry(t)}));var A=new D.BorderLayout;this._inner_layout=A,A.absolute=!0,A.center_panel=d,A.top_panel=f,A.bottom_panel=v,A.left_panel=p,A.right_panel=m;var S,T,M,C,z={left:a,right:a,top:a,bottom:a},E=function(){if(null==e.panel){if((0,j.isString)(n))return{left:o,right:o,top:o,bottom:o};var t=(0,k.Z)(n,2),i=t[0],r=t[1];return{left:i,right:o,top:o,bottom:r}}if(!(0,j.isString)(n)){var a=(0,k.Z)(n,2),s=a[0],l=a[1];return A.fixup_geometry=function(t,n){var i=t,r=e.layout.bbox,a=t,o=a.width,u=a.height;if(t=new L.BBox({left:r.left+s,bottom:r.bottom-l,width:o,height:u}),null!=n){var c=t.left-i.left,h=t.top-i.top,_=n,d=_.left,f=_.top,v=_.width,p=_.height;n=new L.BBox({left:d+c,top:f+h,width:v,height:p})}return[t,n]},{left:s,right:0,top:0,bottom:l}}A.fixup_geometry=function(t,n){var i=t;if("horizontal"==_){var r=t,a=r.top,o=r.width,s=r.height;if("end"==h){var l=e.layout.bbox.right;t=new L.BBox({right:l,top:a,width:o,height:s})}else if("center"==h){var u=e.layout.bbox.hcenter;t=new L.BBox({hcenter:Math.round(u),top:a,width:o,height:s})}}else{var d=t,f=d.left,v=d.width,p=d.height;if("end"==c){var m=e.layout.bbox.bottom;t=new L.BBox({left:f,bottom:m,width:v,height:p})}else if("center"==c){var y=e.layout.bbox.vcenter;t=new L.BBox({left:f,vcenter:Math.round(y),width:v,height:p})}}if(null!=n){var g=t.left-i.left,b=t.top-i.top,w=n,x=w.left,k=w.top,Z=w.width,A=w.height;n=new L.BBox({left:x+g,top:k+b,width:Z,height:A})}return[t,n]}}();if(A.padding=z,null!=this.panel?(S="max",T=void 0,M=void 0,C=void 0):"auto"==("horizontal"==_?i:r)?(S="fixed",T=25*this.model.color_mapper.palette.length,M={percent:.3},C={percent:.8}):(S="fit",T=void 0),"horizontal"==_){var R="auto"==i?void 0:i,B="auto"==r?25:r;A.set_sizing({width_policy:S,height_policy:"min",width:T,min_width:M,max_width:C,halign:h,valign:c,margin:E}),A.center_panel.set_sizing({width_policy:"auto"==i?"fit":"fixed",height_policy:"fixed",width:R,height:B})}else{var P="auto"==i?25:i,V="auto"==r?void 0:r;A.set_sizing({width_policy:"min",height_policy:S,height:T,min_height:M,max_height:C,halign:h,valign:c,margin:E}),A.center_panel.set_sizing({width_policy:"fixed",height_policy:"auto"==r?"fit":"fixed",width:P,height:V})}f.set_sizing({width_policy:"fit",height_policy:"min"}),v.set_sizing({width_policy:"fit",height_policy:"min"}),p.set_sizing({width_policy:"min",height_policy:"fit"}),m.set_sizing({width_policy:"min",height_policy:"fit"});var U=this._title_view;null!=U&&("horizontal"==_?(U.panel=new I.Panel("above"),U.update_layout(),f.children.push(U.layout)):(U.panel=new I.Panel("left"),U.update_layout(),p.children.push(U.layout)));var F=this.panel,G=null!=F&&_==F.orientation?F.side:"horizontal"==_?"below":"right",H=function(){switch(G){case"above":return f;case"below":return v;case"left":return p;case"right":return m}}(),Y=this._axis_view;if(Y.panel=new I.Panel(G),Y.update_layout(),H.children.push(Y.layout),null!=this.panel){var J=new N.Grid([{layout:A,row:0,col:0}]);J.absolute=!0,"horizontal"==_?J.set_sizing({width_policy:"max",height_policy:"min"}):J.set_sizing({width_policy:"min",height_policy:"max"}),this.layout=J}else this.layout=this._inner_layout;var W=this.model.visible;this.layout.sizing.visible=W,this._set_canvas_image()}},{key:"_render",value:function(){var e,t=this.layer.ctx;t.save(),this._paint_bbox(t,this._inner_layout.bbox),this._paint_image(t,this._inner_layout.center_panel.bbox),null===(e=this._title_view)||void 0===e||e.render(),this._axis_view.render(),t.restore(
2)}},{key:"_paint_bbox",value:function(e,t){var n=t.x,i=t.y,r=t.width,a=t.height;n+r>=this.parent.canvas_view.bbox.width&&(r-=1),i+a>=this.parent.canvas_view.bbox.height&&(a-=1),e.save(),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(e),e.fillRect(n,i,r,a)),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(e),e.strokeRect(n,i,r,a)),e.restore()}},{key:"_paint_image",value:function(e,t){var n=t.x,i=t.y,r=t.width,a=t.height;e.save(),e.setImageSmoothingEnabled(!1),e.globalAlpha=this.model.scale_alpha,e.drawImage(this._image,n,i,r,a),this.visuals.bar_line.doit&&(this.visuals.bar_line.set_value(e),e.strokeRect(n,i,r,a)),e.restore()}},{key:"serializable_state",value:function(){var e=(0,_.Z)((0,d.Z)(n.prototype),"serializable_state",this).call(this),t=e.children,i=void 0===t?[]:t,r=(0,o.__rest)(e,["children"]);return null!=this._title_view&&i.push(this._title_view.serializable_state()),i.push(this._axis_view.serializable_state()),Object.assign(Object.assign({},r),{children:i})}}]),n}(s.AnnotationView);n.ColorBarView=U,U.__name__="ColorBarView";var F=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.Annotation);n.ColorBar=F,a=F,F.__name__="ColorBar",a.prototype.default_view=U,a.mixins([["major_label_",R.Text],["title_",R.Text],["major_tick_",R.Line],["minor_tick_",R.Line],["border_",R.Line],["bar_",R.Line],["background_",R.Fill]]),a.define((function(e){var t=e.Alpha,n=e.Number,i=e.String,r=e.Tuple,a=e.Dict,o=e.Or,s=e.Ref,l=e.Auto,u=e.Nullable;return{location:[o(E.Anchor,r(n,n)),"top_right"],orientation:[o(E.Orientation,l),"auto"],title:[u(i),null],title_standoff:[n,2],width:[o(n,l),"auto"],height:[o(n,l),"auto"],scale_alpha:[t,1],ticker:[o(s(h.Ticker),l),"auto"],formatter:[o(s(m.TickFormatter),l),"auto"],major_label_overrides:[a(o(i,s(z.BaseText))),{}],major_label_policy:[s(w.LabelingPolicy),function(){return new w.NoOverlap}],color_mapper:[s(A.ColorMapper)],label_standoff:[n,5],margin:[n,30],padding:[n,10],major_tick_in:[n,5],major_tick_out:[n,0],minor_tick_in:[n,0],minor_tick_out:[n,0]}})),a.override({background_fill_color:"#ffffff",background_fill_alpha:.95,bar_line_color:null,border_line_color:null,major_label_text_font_size:"11px",major_tick_line_color:"#ffffff",minor_tick_line_color:null,title_text_font_size:"13px",title_text_font_style:"italic"})},function(e,t,n,i,r){i();var a,o=e(1),s=e(119),l=e(20),u=e(120),c=(0,o.__importStar)(e(48)),h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_get_location",value:function(){var e,t,n=this.model.offset,i=this.model.standoff/2,r=this.layout.bbox;switch(this.panel.side){case"above":case"below":switch(this.model.vertical_align){case"top":t=r.top+i;break;case"middle":t=r.vcenter;break;case"bottom":t=r.bottom-i}switch(this.model.align){case"left":e=r.left+n;break;case"center":e=r.hcenter;break;case"right":e=r.right-n}break;case"left":switch(this.model.vertical_align){case"top":e=r.left+i;break;case"middle":e=r.hcenter;break;case"bottom":e=r.right-i}switch(this.model.align){case"left":t=r.bottom-n;break;case"center":t=r.vcenter;break;case"right":t=r.top+n}break;case"right":switch(this.model.vertical_align){case"top":e=r.right-i;break;case"middle":e=r.hcenter;break;case"bottom":e=r.left+i}switch(this.model.align){case"left":t=r.top+n;break;case"center":t=r.vcenter;break;case"right":t=r.bottom-n}}return[e,t]}},{key:"_render",value:function(){var e=this.model.text;if(null!=e&&0!=e.length){this.model.text_baseline=this.model.vertical_align,this.model.text_align=this.model.align;var t=this._get_location(),n=(0,k.Z)(t,2),i=n[0],r=n[1],a=this.panel.get_label_angle_heuristic("parallel");("canvas"==this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this))(this.layer.ctx,e,i,r,a)}}},{key:"_get_size",value:function(){var e=this.model.text,t=new u.TextBox({text:e});t.visuals=this.visuals.text.values();var n=t.size(),i=n.width,r=n.height;return{width:i,height:0==r?0:2+r+this.model.standoff}}}]),n}(s.TextAnnotationView);n.TitleView=h,h.__name__="TitleView";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.TextAnnotation);n.Title=_,a=_,_.__name__="Title",a.prototype.default_view=h,a.mixins([c.Text,["border_",c.Line],["background_",c.Fill]]),a.define((function(e){var t=e.Number;return{text:[e.String,""],vertical_align:[l.VerticalAlign,"bottom"],align:[l.TextAlign,"left"],offset:[t,0],standoff:[t,10]}})),a.prototype._props.text_align.options.internal=!0,a.prototype._props.text_baseline.options.internal=!0,a.override({text_font_size:"13px",text_font_style:"bold",text_line_height:1,background_fill_color:null,border_line_color:null})},function(e,t,n,i,r){var a;i();var o=e(40),s=e(43),l=e(20),u=e(120),c=e(123),h=e(11),f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"update_layout",value:function(){var e=this,t=this.panel;this.layout=null!=t?new c.SideLayout(t,(function(){return e.get_size()}),!0):void 0}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),"css"==this.model.render_mode&&(this.el=(0,s.div)(),this.plot_view.canvas_view.add_overlay(this.el))}},{key:"remove",value:function(){null!=this.el&&(0,s.remove)(this.el),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),"css"==this.model.render_mode?this.connect(this.model.change,(function(){return e.render()})):this.connect(this.model.change,(function(){return e.request_render()}))}},{key:"render",value:function(){this.model.visible||"css"!=this.model.render_mode||(0,s.undisplay)(this.el),(0,_.Z)((0,d.Z)(n.prototype),"render",this).call(this)}},{key:"_canvas_text",value:function(e,t,n,i,r){var a=new u.TextBox({text:t});a.angle=r,a.position={sx:n,sy:i}
2,a.visuals=this.visuals.text.values();var o=this.visuals,s=o.background_fill,l=o.border_line;if(s.doit||l.doit){var c=a.rect(),h=c.p0,_=c.p1,d=c.p2,f=c.p3;e.beginPath(),e.moveTo(h.x,h.y),e.lineTo(_.x,_.y),e.lineTo(d.x,d.y),e.lineTo(f.x,f.y),e.closePath(),this.visuals.background_fill.apply(e),this.visuals.border_line.apply(e)}this.visuals.text.doit&&a.paint(e)}},{key:"_css_text",value:function(e,t,n,i,r){var a=this,o=this.el;(0,h.assert)(null!=o),(0,s.undisplay)(o),o.textContent=t,this.visuals.text.set_value(e),o.style.position="absolute",o.style.left="".concat(n,"px"),o.style.top="".concat(i,"px"),o.style.color=e.fillStyle,o.style.font=e.font,o.style.lineHeight="normal",o.style.whiteSpace="pre";var l=function(){switch(a.visuals.text.text_align.get_value()){case"left":return["left","0%"];case"center":return["center","-50%"];case"right":return["right","-100%"]}}(),u=(0,k.Z)(l,2),c=u[0],_=u[1],d=function(){switch(a.visuals.text.text_baseline.get_value()){case"top":return["top","0%"];case"middle":default:return["center","-50%"];case"bottom":return["bottom","-100%"]}}(),f=(0,k.Z)(d,2),v=f[0],p=f[1],m="translate(".concat(_,", ").concat(p,")");r&&(m+="rotate(".concat(r,"rad)")),o.style.transformOrigin="".concat(c," ").concat(v),o.style.transform=m,this.layout,this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(e),o.style.backgroundColor=e.fillStyle),this.visual
2s.border_line.doit&&(this.visuals.border_line.set_value(e),o.style.borderStyle=e.lineDash.length<2?"solid":"dashed",o.style.borderWidth="".concat(e.lineWidth,"px"),o.style.borderColor=e.strokeStyle),(0,s.display)(o)}}]),n}(o.AnnotationView);n.TextAnnotationView=f,f.__name__="TextAnnotationView";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Annotation);n.TextAnnotation=m,a=m,m.__name__="TextAnnotation",a.define((function(){return{render_mode:[l.RenderMode,"canvas"]}}))},function(e,t,n,i,r){i();var a=e(65),o=e(121),s=e(9),l=e(8),u=e(122),c=e(22);n.text_width=function(){var e=document.createElement("canvas").getContext("2d"),t="";return function(n,i){return i!=t&&(t=i,e.font=i),e.measureText(n).width}}();var f=function(){function e(){(0,g.Z)(this,e),this._position={sx:0,sy:0},this.font_size_scale=1,this.align="left",this._base_font_size=13,this._x_anchor="left",this._y_anchor="center"}return(0,b.Z)(e,[{key:"base_font_size",get:function(){return this._base_font_size},set:function(e){null!=e&&(this._base_font_size=e)}},{key:"position",get:function(){return this._position},set:function(e){this._position=e}},{key:"infer_text_height",value:function(){return"ascent_descent"}},{key:"bbox",value:function(){var e=this.rect(),t=e.p0,n=e.p1,i=e.p2,r=e.p3,o=Math.min(t.x,n.x,i.x,r.x),s=Math.min(t.y,n.y,i.y,r.y),l=Math.max(t.x,n.x,i.x,r.x),u=Math.max(t.y,n.y,i.y,r.y);return new a.BBox({left:o,right:l,top:s,bottom:u})}},{key:"size",value:function(){var e=this._size(),t=e.width,n=e.height,i=this.angle;if(i){var r=Math.cos(Math.abs(i)),a=Math.sin(Math.abs(i));return{width:Math.abs(t*r+n*a),height:Math.abs(t*a+n*r)}}return{width:t,height:n}}},{key:"rect",value:function(){var e=this._rect(),t=this.angle;if(t){var n=this.position,i=n.sx,r=n.sy,a=new u.AffineTransform;return a.translate(i,r),a.rotate(t),a.translate(-i,-r),a.apply_rect(e)}return e}},{key:"paint_rect",value:function(e){var t=this.rect(),n=t.p0,i=t.p1,r=t.p2,a=t.p3;e.save(),e.strokeStyle="red",e.lineWidth=1,e.beginPath();var o=Math.round;e.moveTo(o(n.x),o(n.y)),e.lineTo(o(i.x),o(i.y)),e.lineTo(o(r.x),o(r.y)),e.lineTo(o(a.x),o(a.y)),e.closePath(),e.stroke(),e.restore()}},{key:"paint_bbox",value:function(e){var t=this.bbox(),n=t.x,i=t.y,r=t.width,a=t.height;e.save(),e.strokeStyle="blue",e.lineWidth=1,e.beginPath();var o=Math.round;e.moveTo(o(n),o(i)),e.lineTo(o(n),o(i+a)),e.lineTo(o(n+r),o(i+a)),e.lineTo(o(n+r),o(i)),e.closePath(),e.stroke(),e.restore()}}]),e}();n.GraphicsBox=f,f.__name__="GraphicsBox";var m=function(e){(0,v.Z)(i,e);var t=(0,p.Z)(i);function i(e){var n,r=e.text;return(0,g.Z)(this,i),(n=t.call(this)).text=r,n}return(0,b.Z)(i,[{key:"visuals",set:function(e){var t=e.color,n=e.alpha,i=e.font_style,r=e.font_size,a=e.font,s=this.font_size_scale,l=this.base_font_size,u=(0,o.parse_css_font_size)(r);if(null!=u){var h=u.value,_=u.unit;h*=s,"em"==_&&l&&(h*=l,_="px"),r="".concat(h).concat(_)}var d="".concat(i," ").concat(r," ").concat(a);this.font=d,this.color=(0,c.color2css)(t,n),this.line_height=e.line_height;var f=e.align;this._x_anchor=f;var v=e.baseline;this._y_anchor=function(){switch(v){case"top":return"top";case"middle":return"center";case"bottom":return"bottom";default:return"baseline"}}()}},{key:"infer_text_height",value:function(){if(this.text.includes("\n"))return"ascent_descent";return function(e){var t,n=(0,w.Z)(new Set(e));try{for(n.s();!(t=n.n()).done;){var i=t.value;if(!("0"<=i&&i<="9"))switch(i){case",":case".":case"+":case"-":case"\u2212":case"e":continue;default:return!1}}}catch(r){n.e(r)}finally{n.f()}return!0}(this.text)?"cap":"ascent_descent"}},{key:"_text_line",value:function(e){var t,n=null!==(t=this.text_height_metric)&&void 0!==t?t:this.infer_text_height(),i=function(){switch(n){case"x":case"x_descent":return e.x_height;case"cap":case"cap_descent":return e.cap_height;case"ascent":case"ascent_descent":return e.ascent}}(),r=function(){switch(n){case"x":case"cap":case"ascent":return 0;case"x_descent":case"cap_descent":case"ascent_descent":return e.descent}}();return{height:i+r,ascent:i,descent:r}}},{key:"nlines",get:function(){return this.text.split("\n").length}},{key:"_size",value:function(){var e,t,i=this.font,r=(0,o.font_metrics)(i),a=(this.line_height-1)*r.height,l=""==this.text,u=this.text.split("\n"),c=u.length,h=u.map((function(e){return(0,n.text_width)(e,i)})),_=this._text_line(r).height*c,d="%"==(null===(e=this.width)||void 0===e?void 0:e.unit)?this.width.value:1,f="%"==(null===(t=this.height)||void 0===t?void 0:t.unit)?this.height.value:1;return{width:(0,s.max)(h)*d,height:l?0:(_+a*(c-1))*f,metrics:r}}},{key:"_computed_position",value:function(e,t,n){var i=this,r=e.width,a=e.height,o=this.position,s=o.sx,u=o.sy,c=o.x_anchor,h=void 0===c?this._x_anchor:c,_=o.y_anchor,d=void 0===_?this._y_anchor:_;return{x:s-function(){if((0,l.isNumber)(h))return h*r;switch(h){case"left":return 0;case"center":return.5*r;case"right":return r}}(),y:u-function(){var e;if((0,l.isNumber)(d))return d*a;switch(d){case"top":return 0;case"center":return.5*a;case"bottom":return a;case"baseline":if(1!=n)return.5*a;switch(null!==(e=i.text_height_metric)&&void 0!==e?e:i.infer_text_height()){case"x":case"x_descent":return t.x_height;
2case"cap":case"cap_descent":return t.cap_height;case"ascent":case"ascent_descent":return t.ascent}}}()}}},{key:"_rect",value:function(){var e=this._size(),t=e.width,n=e.height,i=e.metrics,r=this.text.split("\n").length,o=this._computed_position({width:t,height:n},i,r),s=o.x,l=o.y;return new a.BBox({x:s,y:l,width:t,height:n}).rect}},{key:"paint",value:function(e){var t,i,r=this,a=this.font,l=(0,o.font_metrics)(a),u=(this.line_height-1)*l.height,c=this.text.split("\n"),h=c.length,_=c.map((function(e){return(0,n.text_width)(e,a)})),d=this._text_line(l),f=d.height*h,v="%"==(null===(t=this.width)||void 0===t?void 0:t.unit)?this.width.value:1,p="%"==(null===(i=this.height)||void 0===i?void 0:i.unit)?this.height.value:1,m=(0,s.max)(_)*v,y=(f+u*(h-1))*p;e.save(),e.fillStyle=this.color,e.font=this.font,e.textAlign="left",e.textBaseline="alphabetic";var g=this.position,b=g.sx,w=g.sy,x=this.align,k=this.angle;k&&(e.translate(b,w),e.rotate(k),e.translate(-b,-w));var Z=this._computed_position({width:m,height:y},l,h),A=Z.x,S=Z.y;if("justify"==x)for(var T=0;T<h;T++){for(var M=A,C=c[T].split(" "),z=C.length,E=C.map((function(e){return(0,n.text_width)(e,a)})),R=(m-(0,s.sum)(E))/(z-1),B=0;B<z;B++)e.fillText(C[B],M,S),M+=E[B]+R;S+=d.height+u}else for(var N=function(t){var n=A+function(){switch(x){case"left":return 0;case"center":return.5*(m-_[t]);case"right":return m-_[t]}}();e.fillStyle=r.color,e.fillText(c[t],n,S+d.ascent),S+=d.height+u},O=0;O<h;O++)N(O);e.restore()}}]),i}(f);n.TextBox=m,m.__name__="TextBox";var y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e,i){var r;return(0,g.Z)(this,n),(r=t.call(this)).base=e,r.expo=i,r}return(0,b.Z)(n,[{key:"children",get:function(){return[this.base,this.expo]}},{key:"base_font_size",set:function(e){h((0,d.Z)(n.prototype),"base_font_size",e,this,!0),this.base.base_font_size=e,this.expo.base_font_size=e}},{key:"position",get:function(){return this._position},set:function(e){this._position=e;var t=this.base.size(),n=this.expo.size(),i=this._shift_scale()*t.height,r=Math.max(t.height,i+n.height);this.base.position={sx:0,x_anchor:"left",sy:r,y_anchor:"bottom"},this.expo.position={sx:t.width,x_anchor:"left",sy:i,y_anchor:"bottom"}}},{key:"visuals",set:function(e){this.expo.font_size_scale=.7,this.base.visuals=e,this.expo.visuals=e}},{key:"_shift_scale",value:function(){if(this.base instanceof m&&1==this.base.nlines){var e=(0,o.font_metrics)(this.base.font);return e.x_height/e.cap_height}return 2/3}},{key:"infer_text_height",value:function(){return this.base.infer_text_height()}},{key:"_rect",value:function(){var e=this.base.bbox(),t=this.expo.bbox(),n=e.union(t),i=this._computed_position(),r=i.x,a=i.y;return n.translate(r,a).rect}},{key:"_size",value:function(){var e=this.base.size(),t=this.expo.size();return{width:e.width+t.width,height:Math.max(e.height,this._shift_scale()*e.height+t.height)}}},{key:"paint",value:function(e){e.save();var t=this.angle;if(t){var n=this.position,i=n.sx,r=n.sy;e.translate(i,r),e.rotate(t),e.translate(-i,-r)}var a=this._computed_position(),o=a.x,s=a.y;e.translate(o,s),this.base.paint(e),this.expo.paint(e),e.restore()}},{key:"paint_bbox",value:function(e){(0,_.Z)((0,d.Z)(n.prototype),"paint_bbox",this).call(this,e);var t=this._computed_position(),i=t.x,r=t.y;e.save(),e.translate(i,r);var a,o=(0,w.Z)(this.children);try{for(o.s();!(a=o.n()).done;){a.value.paint_bbox(e)}}catch(s){o.e(s)}finally{o.f()}e.restore()}},{key:"_computed_position",value:function(){var e=this._size(),t=e.width,n=e.height,i=this.position,r=i.sx,a=i.sy,o=i.x_anchor,s=void 0===o?this._x_anchor:o,u=i.y_anchor,c=void 0===u?this._y_anchor:u;return{x:r-function(){if((0,l.isNumber)(s))return s*t;switch(s){case"left":return 0;case"center":return.5*t;case"right":return t}}(),y:a-function(){if((0,l.isNumber)(c))return c*n;switch(c){case"top":return 0;case"center":case"baseline":return.5*n;case"bottom":return n}}()}}}]),n}(f);n.BaseExpo=y,y.__name__="BaseExpo";var x=function(){function e(t){(0,g.Z)(this,e),this.items=t}return(0,b.Z)(e,[{key:"base_font_size",set:function(e){var t,n=(0,w.Z)(this.items);try{for(n.s();!(t=n.n()).done;){t.value.base_font_size=e}}catch(i){n.e(i)}finally{n.f()}}},{key:"length",get:function(){return this.items.length}},{key:"visuals",set:function(e){var t,n=(0,w.Z)(this.items);try{for(n.s();!(t=n.n()).done;){t.value.visuals=e}}catch(l){n.e(l)}finally{n.f()}
2var i,r={x:0,cap:1,ascent:2,x_descent:3,cap_descent:4,ascent_descent:5},a=(0,s.max_by)(this.items.map((function(e){return e.infer_text_height()})),(function(e){return r[e]})),o=(0,w.Z)(this.items);try{for(o.s();!(i=o.n()).done;){i.value.text_height_metric=a}}catch(l){o.e(l)}finally{o.f()}}},{key:"angle",set:function(e){var t,n=(0,w.Z)(this.items);try{for(n.s();!(t=n.n()).done;){t.value.angle=e}}catch(i){n.e(i)}finally{n.f()}}},{key:"max_size",value:function(){var e,t=0,n=0,i=(0,w.Z)(this.items);try{for(i.s();!(e=i.n()).done;){var r=e.value.size();t=Math.max(t,r.width),n=Math.max(n,r.height)}}catch(a){i.e(a)}finally{i.f()}return{width:t,height:n}}}]),e}();n.GraphicsBoxes=x,x.__name__="GraphicsBoxes"},function(e,t,n,i,r){i();var a=e(11),o=function(){try{return"undefined"!=typeof OffscreenCanvas&&null!=new OffscreenCanvas(0,0).getContext("2d")}catch(e){return!1}}()?function(e,t){return new OffscreenCanvas(e,t)}:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},s=function(){var e=o(0,0).getContext("2d");return function(t){e.font=t;var n=e.measureText("M"),i=e.measureText("x"),r=e.measureText("\xc5\u015ag|"),o=r.fontBoundingBoxAscent,s=r.fontBoundingBoxDescent;if(null!=o&&null!=s)return{height:o+s,ascent:o,descent:s,cap_height:n.actualBoundingBoxAscent,x_height:i.actualBoundingBoxAscent};var l=r.actualBoundingBoxAscent,u=r.actualBoundingBoxDescent;if(null!=l&&null!=u)return{height:l+u,ascent:l,descent:u,cap_height:n.actualBoundingBoxAscent,x_height:i.actualBoundingBoxAscent};(0,a.unreachable)()}}(),l=function(){var e=o(0,0).getContext("2d");return function(t,n){e.font=n;var i=e.measureText(t),r=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;if(null!=r&&null!=o)return{width:i.width,height:r+o,ascent:r,descent:o};(0,a.unreachable)()}}(),u=function(){var e=document.createElement("canvas"),t=e.getContext("2d"),n=-1,i=-1;return function(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.font=r;var o=t.measureText("M").width*a,s=Math.ceil(o),l=Math.ceil(2*o),u=Math.ceil(1.5*o);n<s&&(n=s,e.width=s),i<l&&(i=l,e.height=l),t.save(),t.scale(a,a),t.fillStyle="#f00",t.fillRect(0,0,s,l);var c=function(e){for(var t=0,n=0;n<=u;n++)for(var i=0;i<s;i++,t+=4)if(255!=e[t])return u-n;return 0};t.font=r,t.fillStyle="#000";var h,_=(0,w.Z)("xa");try{for(_.s();!(h=_.n()).done;){var d=h.value;t.fillText(d,0,u/a)}}catch(S){_.e(S)}finally{_.f()}var f,v=c(t.getImageData(0,0,s,l).data)/a,p=(0,w.Z)("ASQ");try{for(p.s();!(f=p.n()).done;){var m=f.value;t.fillText(m,0,u/a)}}catch(S){p.e(S)}finally{p.f()}var y,g=c(t.getImageData(0,0,s,l).data)/a,b=(0,w.Z)("\xc5\u015agy");try{for(b.s();!(y=b.n()).done;){var x=y.value;t.fillText(x,0,u/a)}}catch(S){b.e(S)}finally{b.f()}var k=t.getImageData(0,0,s,l).data,Z=c(k)/a,A=function(e){for(var t=e.length-4,n=l;n>=u;n--)for(var i=0;i<s;i++,t-=4)if(255!=e[t])return n-u;return 0}(k)/a;return t.restore(),{height:Z+A,ascent:Z,cap_height:g,x_height:v,descent:A}}}(),c=function(){var e=document.createElement("canvas"),t=e.getContext("2d"),n=-1,i=-1;return function(r,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.font=a;var s=t.measureText("M").width*o,l=Math.ceil(s),u=Math.ceil(2*s),c=Math.ceil(1.5*s);(n<l||i<u)&&(n=l,e.width=l,i=u,e.height=u),t.save(),t.scale(o,o),t.fillStyle="#f00",t.fillRect(0,0,l,u),t.font=a,t.fillStyle="#000",t.fillText(r,0,c/o);var h=t.measureText(r),_=t.getImageData(0,0,l,u).data,d=function(e){for(var t=0,n=0;n<=c;n++)for(var i=0;i<l;i++,t+=4)if(255!=e[t])return c-n;return 0}(_)/o,f=function(e){for(var t=e.length-4,n=u;n>=c;n--)for(var i=0;i<l;i++,t-=4)if(255!=e[t])return n-c;return 0}(_)/o;return t.restore(),{width:h.width,height:d+f,ascent:d,descent:f}}}(),h=function(){try{return s("normal 10px sans-serif"),s}catch(e){return u}}(),_=function(){try{return l("A","normal 10px sans-serif"),l}catch(e){return c}}(),d=new Map;function f(e){var t=d.get(e);return null==t&&(t={font:h(e),glyphs:new Map},d.set(e,t)),t.font}n.font_metrics=f,n.glyph_metrics=function(e,t){var n=d.get(t);null==n&&(f(t),n=d.get(t));var i=n.glyphs.get(e);return null==i&&(i=_(e,t),n.glyphs.set(e,i)),i},n.parse_css_font_size=function(e){var t=e.match(/^\s*(\d+(\.\d+)?)(\w+)\s*$/);if(null!=t){var n=(0,k.Z)(t,4),i=n[1],r=n[3],a=Number(i);if(isFinite(a))return{value:a,unit:r}}return null}},function(e,t,n,i,r){i();var a=Math.sin,o=Math.cos,s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;(0,g.Z)(this,e),this.a=t,this.b=n,this.c=i,this.d=r,this.e=a,this.f=o}return(0,b.Z)(e,[{key:"toString",value:function(){var e=this.a,t=this.b,n=this.c,i=this.d,r=this.e,a=this.f;return"matrix(".concat(e,", ").concat(t,", ").concat(n,", ").concat(i,", ").concat(r,", ").concat(a,")")}},{key:"to_DOMMatrix",value:function(){var e=this.a,t=this.b,n=this.c,i=this.d,r=this.e,a=this.f;return new DOMMatrix([e,t,n,i,r,a])}},{key:"clone",value:function(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)}},{key:"is_identity",get:function(){var e=this.a,t=this.b,n=this.c,i=this.d,r=this.e,a=this.f;return 1==e&&0==t&&0==n&&1==i&&0==r&&0==a}},{key:"apply_point",value:function(e){var t=this.apply(e.x,e.y),n=(0,k.Z)(t,2);return{x:n[0],y:n[1]}}},{key:"apply_rect",value:function(e){return{p0:this.apply_point(e.p0),p1:this.apply_point(e.p1),p2:this.apply_point(e.p2),p3:this.apply_point(e.p3)}}},{key:"apply",value:function(e,t){var n=this.a,i=this.b,r=this.c,a=this.d;return[n*e+r*t+this.e,i*e+a*t+this.f]}},{key:"iv_apply",value:function(e,t){for(var n=this.a,i=this.b,r=this.c,a=this.d,o=this.e,s=this.f,l=e.length,u=0;u<l;u++){var c=e[u],h=t[u];e[u]=n*c+r*h+o,t[u]=i*c+a*h+s}}},{key:"transform",value:function(e,t,n,i,r,a){var o=this.a,s=this.b,l=this.c,u=this.d,c=this.e,h=this.f;return this.a=o*e+l*t,this.c=o*n+l*i,this.e=o*r+l*a+c,this.b=s*e+u*t,this.d=s*n+u*i,this.f=s*r+u*a+h,this}},{key:"translate",value:function(e,t){return this.transform(1,0,0,1,e,t)}},{key:"scale",value:function(e,t){return this.transform(e,0,0,t,0,0)}},{key:"skew",value:function(e,t){return this.transform(1,t,e,1,0,0)}},{key:"rotate",value:function(e){var t=a(e),n=o(e);return this.transform(n,t,-t,n,0,0)}},{key:"rotate_ccw",value:function(e){return this.rotate(-e)}},{key:"translate_x",value:function(e){return this.translate(e,0)}},{key:"translate_y",value:function(e){return this.translate(0,e)}},{key:"flip",value:function(){return this.scale(-1,-1)}},{key:"flip_x",value:function(){return this.scale(1,-1)}},{key:"flip_y",value:function(){return this.scale(-1,1)}}],[{key:"from_DOMMatrix",value:function(t){return new e(t.a,t.b,t.c,t.d,t.e,t.f)}}]),e}();n.AffineTransform=s,s.__name__="AffineTransform"},function(e,t,n,i,r){i();var a=e(124),o=e(125),s=e(8),l=Math.PI/2,u={above:{parallel:0,normal:-l,horizontal:0,vertical:-l},below:{parallel:0,normal:l,horizontal:0,vertical:l},left:{parallel:-l,normal:0,horizontal:0,vertical:-l},right:{parallel:l,normal:0,horizontal:0,vertical:l}},c={above:{parallel:"bottom",normal:"center",horizontal:"bottom",vertical:"center"},below:{parallel:"top",normal:"center",horizontal:"top",vertical:"center"},left:{parallel:"bottom",normal:"center",horizontal:"center",vertical:"bottom"},right:{parallel:"bottom",normal:"center",horizontal:"center",vertical:"bottom"}},h={above:{parallel:"center",normal:"left",horizontal:"center",vertical:"left"},below:{parallel:"center",normal:"left",horizontal:"center",vertical:"left"},left:{parallel:"center",normal:"right",horizontal:"right",vertical:"center"},right:{parallel:"center",normal:"left",horizontal:"left",vertical:"center"}}
2,_={above:"right",below:"left",left:"right",right:"left"},d={above:"left",below:"right",left:"right",right:"left"},f=function(){function e(t){(0,g.Z)(this,e),this.side=t}return(0,b.Z)(e,[{key:"dimension",get:function(){return"above"==this.side||"below"==this.side?0:1}},{key:"normals",get:function(){switch(this.side){case"above":return[0,-1];case"below":return[0,1];case"left":return[-1,0];case"right":return[1,0]}}},{key:"orientation",get:function(){return this.is_horizontal?"horizontal":"vertical"}},{key:"is_horizontal",get:function(){return 0==this.dimension}},{key:"is_vertical",get:function(){return 1==this.dimension}},{key:"get_label_text_heuristics",value:function(e){var t=this.side;return(0,s.isString)(e)?{vertical_align:c[t][e],align:h[t][e]}:{vertical_align:"center",align:(e<0?_:d)[t]}}},{key:"get_label_angle_heuristic",value:function(e){return(0,s.isString)(e)?u[this.side][e]:-e}}]),e}();n.Panel=f,f.__name__="Panel";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e,i){var r,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,g.Z)(this,n),(r=t.call(this)).panel=e,r.get_size=i,r.rotate=a,r.panel.is_horizontal?r.set_sizing({width_policy:"max",height_policy:"fixed"}):r.set_sizing({width_policy:"fixed",height_policy:"max"}),r}return(0,b.Z)(n,[{key:"_content_size",value:function(){var e=this.get_size(),t=e.width,n=e.height;return!this.rotate||this.panel.is_horizontal?new a.Sizeable({width:t,height:n}):new a.Sizeable({width:n,height:t})}},{key:"has_size_changed",value:function(){var e=this._content_size(),t=e.width,n=e.height;return this.panel.is_horizontal?this.bbox.height!=n:this.bbox.width!=t}}]),n}(o.ContentLayoutable);n.SideLayout=m,m.__name__="SideLayout"},function(e,t,n,i,r){i();var a=e(21),o=Math.min,s=Math.max,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,g.Z)(this,e),this.width=null!=t.width?t.width:0,this.height=null!=t.height?t.height:0}return(0,b.Z)(e,[{key:"bounded_to",value:function(t){var n=t.width,i=t.height;return new e({width:this.width==1/0&&null!=n?n:this.width,height:this.height==1/0&&null!=i?i:this.height})}},{key:"expanded_to",value:function(t){var n=t.width,i=t.height;return new e({width:n!=1/0?s(this.width,n):this.width,height:i!=1/0?s(this.height,i):this.height})}},{key:"expand_to",value:function(e){var t=e.width,n=e.height;this.width=s(this.width,t),this.height=s(this.height,n)}},{key:"narrowed_to",value:function(t){var n=t.width,i=t.height;return new e({width:o(this.width,n),height:o(this.height,i)})}},{key:"narrow_to",value:function(e){var t=e.width,n=e.height;this.width=o(this.width,t),this.height=o(this.height,n)}},{key:"grow_by",value:function(t){var n=t.left,i=t.right,r=t.top,a=t.bottom;return new e({width:this.width+n+i,height:this.height+r+a})}},{key:"shrink_by",value:function(t){var n=t.left,i=t.right,r=t.top,a=t.bottom;return new e({width:s(this.width-n-i,0),height:s(this.height-r-a,0)})}},{key:"map",value:function(t,n){return new e({width:t(this.width),height:(null!=n?n:t)(this.height)})}}]),e}();n.Sizeable=l,l.__name__="Sizeable",n.SizingPolicy=(0,a.Enum)("fixed","fit","min","max")},function(e,t,n,i,r){i();var a=e(124),o=e(65),s=e(8),l=Math.min,u=Math.max,c=Math.round,h=function(e){function t(){(0,g.Z)(this,t),this.absolute=!1,this._bbox=new o.BBox,this._inner_bbox=new o.BBox,this._dirty=!1,this._handlers=[]}return(0,b.Z)(t,[{key:e,value:(0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))},{key:"bbox",get:function(){return this._bbox}},{key:"inner_bbox",get:function(){return this._inner_bbox}},{key:"sizing",get:function(){return this._sizing}},{key:"visible",set:function(e){this._sizing.visible=e,this._dirty=!0}},{key:"set_sizing",value:function(e){var t,n,i,r,a,o=null!==(t=e.width_policy)&&void 0!==t?t:"fit",s=e.width,l=e.min_width,u=e.max_width,c=null!==(n=e.height_policy)&&void 0!==n?n:"fit",h=e.height,_=e.min_height,d=e.max_height,f=e.aspect,v=null!==(i=e.margin)&&void 0!==i?i:{top:0,right:0,bottom:0,left:0},p=!1!==e.visible,m=null!==(r=e.halign)&&void 0!==r?r:"start",y=null!==(a=e.valign)&&void 0!==a?a:"start";this._sizing={width_policy:o,min_width:l,width:s,max_width:u,height_policy:c,min_height:_,height:h,max_height:d,aspect:f,margin:v,visible:p,halign:m,valign:y,size:{width:s,height:h}},this._init()}},{key:"_init",value:function(){}},{key:"_set_geometry",value:function(e,t){this._bbox=e,this._inner_bbox=t}},{key:"set_geometry",value:function(e,t){var n,i,r=this.fixup_geometry;null!=r&&(n=r(e,t),e=(i=(0,k.Z)(n,2))[0],t=i[1]),this._set_geometry(e,null!=t?t:e);var a,o=(0,w.Z)(this._handlers);try{for(o.s();!(a=o.n()).done;){(0,a.value)(this._bbox,this._inner_bbox)}}catch(s){o.e(s)}finally{o.f()}}},{key:"on_resize",value:function(e){this._handlers.push(e)}},{key:"is_width_expanding",value:function(){return"max"==this.sizing.width_policy}},{key:"is_height_expanding",value:function(){return"max"==this.sizing.height_policy}}
2,{key:"apply_aspect",value:function(e,t){var n=t.width,i=t.height,r=this.sizing.aspect;if(null!=r){var a=this.sizing,o=a.width_policy,s=a.height_policy;if("fixed"!=o&&"fixed"!=s)if(o==s){var l=n,u=c(n/r),h=c(i*r),_=i;Math.abs(e.width-l)+Math.abs(e.height-u)<=Math.abs(e.width-h)+Math.abs(e.height-_)?(n=l,i=u):(n=h,i=_)}else!function(e,t){var n={max:4,fit:3,min:2,fixed:1};return n[e]>n[t]}(o,s)?n=c(i*r):i=c(n/r);else"fixed"==o?i=c(n/r):"fixed"==s&&(n=c(i*r))}return{width:n,height:i}}},{key:"measure",value:function(e){var t=this;if(!this.sizing.visible)return{width:0,height:0};var n=function(e){return"fixed"==t.sizing.width_policy&&null!=t.sizing.width?t.sizing.width:e},i=function(e){return"fixed"==t.sizing.height_policy&&null!=t.sizing.height?t.sizing.height:e},r=new a.Sizeable(e).shrink_by(this.sizing.margin).map(n,i),o=this._measure(r),s=this.clip_size(o,r),l=n(s.width),u=i(s.height),c=this.apply_aspect(r,{width:l,height:u});return Object.assign(Object.assign({},o),c)}},{key:"compute",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.measure({width:null!=t.width&&this.is_width_expanding()?t.width:1/0,height:null!=t.height&&this.is_height_expanding()?t.height:1/0}),i=n.width,r=n.height,a=new o.BBox({left:0,top:0,width:i,height:r});if(null!=n.inner){var s=n.inner,l=s.left,u=s.top,c=s.right,h=s.bottom;e=new o.BBox({left:l,top:u,right:i-c,bottom:r-h})}this.set_geometry(a,e)}},{key:"xview",get:function(){return this.bbox.xview}},{key:"yview",get:function(){return this.bbox.yview}},{key:"clip_size",value:function(e,t){function n(e,t,n,i){return null==n?n=0:(0,s.isNumber)(n)||(n=Math.round(n.percent*t)),null==i?i=1/0:(0,s.isNumber)(i)||(i=Math.round(i.percent*t)),u(n,l(e,i))}return{width:n(e.width,t.width,this.sizing.min_width,this.sizing.max_width),height:n(e.height,t.height,this.sizing.min_height,this.sizing.max_height)}}},{key:"has_size_changed",value:function(){var e=this._dirty;return this._dirty=!1,e}}]),t}(Symbol.iterator);n.Layoutable=h,h.__name__="Layoutable";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_measure",value:function(e){var t=this,n=this.sizing,i=n.width_policy,r=n.height_policy;return{width:function(){var n=t.sizing.width;if(e.width==1/0)return null!=n?n:0;switch(i){case"fixed":return null!=n?n:0;case"min":return null!=n?l(e.width,n):0;case"fit":return null!=n?l(e.width,n):e.width;case"max":return null!=n?u(e.width,n):e.width}}(),height:function(){var n=t.sizing.height;if(e.height==1/0)return null!=n?n:0;switch(r){case"fixed":return null!=n?n:0;case"min":return null!=n?l(e.height,n):0;case"fit":return null!=n?l(e.height,n):e.height;case"max":return null!=n?u(e.height,n):e.height}}()}}}]),n}(h);n.LayoutItem=_,_.__name__="LayoutItem";var d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_measure",value:function(e){var t=this,n=this._content_size(),i=e.bounded_to(this.sizing.size).bounded_to(n);return{width:function(){switch(t.sizing.width_policy){case"fixed":return null!=t.sizing.width?t.sizing.width:n.width;case"min":return n.width;case"fit":return i.width;case"max":return Math.max(n.width,i.width)}}(),height:function(){switch(t.sizing.height_policy){case"fixed":return null!=t.sizing.height?t.sizing.height:n.height;case"min":return n.height;case"fit":return i.height;case"max":return Math.max(n.height,i.height)}}()}}}]),n}(h);n.ContentLayoutable=d,d.__name__="ContentLayoutable"},function(e,t,n,i,r){i();var a=e(62),o=e(61),s=e(58),l=e(63),u=e(67),c=e(65),h=e(13),_=e(11),d=function(){function e(t,n,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};(0,g.Z)(this,e),this.in_x_scale=t,this.in_y_scale=n,this.x_range=i,this.y_range=r,this.extra_x_ranges=a,this.extra_y_ranges=o,this.extra_x_scales=s,this.extra_y_scales=l,this._bbox=new c.BBox,(0,_.assert)(null==t.source_range&&null==t.target_range),(0,_.assert)(null==n.source_range&&null==n.target_range),this._configure_scales()}return(0,b.Z)(e,[{key:"bbox",get:function(){return this._bbox}},{key:"_get_ranges",value:function(e,t){return new Map((0,h.entries)(Object.assign(Object.assign({},t),{default:e})))}},{key:"_get_scales",value:function(e,t,n,i){var r,s,c=new Map((0,h.entries)(Object.assign(Object.assign({},t),{default:e}))),_=new Map,d=(0,w.Z)(n);try{for(d.s();!(s=d.n()).done;){var f=(0,k.Z)(s.value,2),v=f[0],p=f[1];
2if(p instanceof u.FactorRange!=e instanceof a.CategoricalScale)throw new Error("Range ".concat(p.type," is incompatible is Scale ").concat(e.type));e instanceof o.LogScale&&p instanceof l.DataRange1d&&(p.scale_hint="log");var m=(null!==(r=c.get(v))&&void 0!==r?r:e).clone();m.setv({source_range:p,target_range:i}),_.set(v,m)}}catch(y){d.e(y)}finally{d.f()}return _}},{key:"_configure_frame_ranges",value:function(){var e=this.bbox;this._x_target=new s.Range1d({start:e.left,end:e.right}),this._y_target=new s.Range1d({start:e.bottom,end:e.top})}},{key:"_configure_scales",value: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._x_scales=this._get_scales(this.in_x_scale,this.extra_x_scales,this._x_ranges,this._x_target),this._y_scales=this._get_scales(this.in_y_scale,this.extra_y_scales,this._y_ranges,this._y_target)}},{key:"_update_scales",value:function(){this._configure_frame_ranges();var e,t=(0,w.Z)(this._x_scales);try{for(t.s();!(e=t.n()).done;){(0,k.Z)(e.value,2)[1].target_range=this._x_target}}catch(r){t.e(r)}finally{t.f()}var n,i=(0,w.Z)(this._y_scales);try{for(i.s();!(n=i.n()).done;){(0,k.Z)(n.value,2)[1].target_range=this._y_target}}catch(r){i.e(r)}finally{i.f()}}},{key:"set_geometry",value:function(e){this._bbox=e,this._update_scales()}},{key:"x_target",get:function(){return this._x_target}},{key:"y_target",get:function(){return this._y_target}},{key:"x_ranges",get:function(){return this._x_ranges}},{key:"y_ranges",get:function(){return this._y_ranges}},{key:"x_scales",get:function(){return this._x_scales}},{key:"y_scales",get:function(){return this._y_scales}},{key:"x_scale",get:function(){return this._x_scales.get("default")}},{key:"y_scale",get:function(){return this._y_scales.get("default")}},{key:"xscales",get:function(){return(0,h.to_object)(this.x_scales)}},{key:"yscales",get:function(){return(0,h.to_object)(this.y_scales)}}]),e}();n.CartesianFrame=d,d.__name__="CartesianFrame"},function(e,t,n,i,r){i(),r("Axis",e(128).Axis),r("CategoricalAxis",e(140).CategoricalAxis),r("ContinuousAxis",e(143).ContinuousAxis),r("DatetimeAxis",e(144).DatetimeAxis),r("LinearAxis",e(145).LinearAxis),r("LogAxis",e(162).LogAxis),r("MercatorAxis",e(165).MercatorAxis)},function(e,t,n,i,r){i();var a,o=e(1),s=e(129),l=e(130),u=e(131),c=e(132),h=(0,o.__importStar)(e(48)),f=e(20),m=e(24),A=e(123),S=e(9),T=e(13),M=e(8),C=e(120),z=e(67),E=e(133),R=e(113),B=e(11),N=e(8),O=e(134),D=Math.abs,I=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._axis_label_view=null,e._major_label_views=new Map,e}return(0,b.Z)(n,[{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:return e.next=4,this._init_axis_label();case 4:return e.next=6,this._init_major_labels();case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_init_axis_label",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,n;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==(t=this.model.axis_label)){e.next=8;break}return n=(0,N.isString)(t)?(0,O.parse_delimited_string)(t):t,e.next=5,(0,R.build_view)(n,{parent:this});case 5:this._axis_label_view=e.sent,e.next=9;break;case 8:this._axis_label_view=null;case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_init_major_labels",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,n,i,r,a,o,s;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.model.major_label_overrides,n=(0,w.Z)((0,T.entries)(t)),e.prev=2,n.s();case 4:if((i=n.n()).done){e.next=15;break}return r=(0,k.Z)(i.value,2),a=r[0],o=r[1],s=(0,N.isString)(o)?(0,O.parse_delimited_string)(o):o,e.t0=this._major_label_views,e.t1=a,e.next=11,(0,R.build_view)(s,{parent:this});case 11:e.t2=e.sent,e.t0.set.call(e.t0,e.t1,e.t2);case 13:e.next=4;break;case 15:e.next=20;break;case 17:e.prev=17,e.t3=e.catch(2),n.e(e.t3);case 20:return e.prev=20,n.f(),e.finish(20);case 23:case"end":return e.stop()}}),e,this,[[2,17,20,23]])})));return function(){return e.apply(this,arguments)}}()},{key:"update_layout",value:function(){var e=this;this.layout=new A.SideLayout(this.panel,(function(){return e.get_size()}),!0),this.layout.on_resize((function(){return e._coordinates=void 0}))}},{key:"get_size",value:function(){var e=this.model,t=e.visible,n=e.fixed_location;if(t&&null==n&&this.is_renderable){var i=this.extents;return{width:0,height:Math.round(i.tick+i.tick_label+i.axis_label)}}return{width:0,height:0}}},{key:"is_renderable",get:function(){var e=(0,k.Z)(this.ranges,2),t=e[0],n=e[1];return t.is_valid&&n.is_valid}},{key:"_render",value:function(){var e;if(this.is_renderable){var t=this.tick_coords,n=this.extents,i=this.layer.ctx;i.save(),this._draw_rule(i,n),this._draw_major_ticks(i,n,t),this._draw_minor_ticks(i,n,t),this._draw_major_labels(i,n,t),this._draw_axis_label(i,n,t),null===(e=this._paint)||void 0===e||e.call(this,i,n,t),i.restore(
2)}}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this);var t=this.model.properties,i=t.axis_label,r=t.major_label_overrides;this.on_change(i,(0,Z.Z)((0,x.Z)().mark((function t(){var n;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return null===(n=e._axis_label_view)||void 0===n||n.remove(),t.next=3,e._init_axis_label();case 3:case"end":return t.stop()}}),t)})))),this.on_change(r,(0,Z.Z)((0,x.Z)().mark((function t(){var n,i;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=(0,w.Z)(e._major_label_views.values());try{for(n.s();!(i=n.n()).done;)i.value.remove()}catch(r){n.e(r)}finally{n.f()}return t.next=4,e._init_major_labels();case 4:case"end":return t.stop()}}),t)})))),this.connect(this.model.change,(function(){return e.plot_view.request_layout()}))}},{key:"needs_clip",get:function(){return null!=this.model.fixed_location}},{key:"_draw_rule",value:function(e,t){if(this.visuals.axis_line.doit){var n=(0,k.Z)(this.rule_coords,2),i=n[0],r=n[1],a=this.coordinates.map_to_screen(i,r),o=(0,k.Z)(a,2),s=o[0],l=o[1],u=(0,k.Z)(this.normals,2),c=u[0],h=u[1],_=(0,k.Z)(this.offsets,2),d=_[0],f=_[1];this.visuals.axis_line.set_value(e),e.beginPath();for(var v=0;v<s.length;v++){var p=Math.round(s[v]+c*d),m=Math.round(l[v]+h*f);e.lineTo(p,m)}e.stroke()}}},{key:"_draw_major_ticks",value:function(e,t,n){var i=this.model.major_tick_in,r=this.model.major_tick_out,a=this.visuals.major_tick_line;this._draw_ticks(e,n.major,i,r,a)}},{key:"_draw_minor_ticks",value:function(e,t,n){var i=this.model.minor_tick_in,r=this.model.minor_tick_out,a=this.visuals.minor_tick_line;this._draw_ticks(e,n.minor,i,r,a)}},{key:"_draw_major_labels",value:function(e,t,n){var i=n.major,r=this.compute_labels(i[this.dimension]),a=this.model.major_label_orientation,o=t.tick+this.model.major_label_standoff,s=this.visuals.major_label_text;this._draw_oriented_labels(e,r,i,a,this.panel.side,o,s)}},{key:"_axis_label_extent",value:function(){if(null==this._axis_label_view)return 0;var e=this._axis_label_view.graphics();e.visuals=this.visuals.axis_label_text.values(),e.angle=this.panel.get_label_angle_heuristic("parallel"),(0,M.isNumber)(this.plot_view.base_font_size)&&(e.base_font_size=this.plot_view.base_font_size);var t=e.size(),n=0==this.dimension?t.height:t.width,i=this.model.axis_label_standoff;return n>0?i+n+3:0}},{key:"_draw_axis_label",value:function(e,t,n){var i=this;if(null!=this._axis_label_view&&null==this.model.fixed_location){var r=function(){var e=i.layout.bbox;switch(i.panel.side){case"above":return[e.hcenter,e.bottom];case"below":return[e.hcenter,e.top];case"left":return[e.right,e.vcenter];case"right":return[e.left,e.vcenter]}}(),a=(0,k.Z)(r,2),o=a[0],s=a[1],l=(0,k.Z)(this.normals,2),u=l[0],c=l[1],h=t.tick+t.tick_label+this.model.axis_label_standoff,_=this.panel.get_label_text_heuristics("parallel"),d=_.vertical_align,f=_.align,v={sx:o+u*h,sy:s+c*h,x_anchor:f,y_anchor:d},p=this._axis_label_view.graphics();p.visuals=this.visuals.axis_label_text.values(),p.angle=this.panel.get_label_angle_heuristic("parallel"),this.plot_view.base_font_size&&(p.base_font_size=this.plot_view.base_font_size),p.position=v,p.align=f,p.paint(e)}}},{key:"_draw_ticks",value:function(e,t,n,i,r){if(r.doit){var a=(0,k.Z)(t,2),o=a[0],s=a[1],l=this.coordinates.map_to_screen(o,s),u=(0,k.Z)(l,2),c=u[0],h=u[1],_=(0,k.Z)(this.normals,2),d=_[0],f=_[1],v=(0,k.Z)(this.offsets,2),p=v[0],m=v[1],y=d*(p-n),g=f*(m-n),b=d*(p+i),w=f*(m+i);r.set_value(e),e.beginPath();for(var x=0;x<c.length;x++){var Z=Math.round(c[x]+b),A=Math.round(h[x]+w),S=Math.round(c[x]+y),T=Math.round(h[x]+g);e.moveTo(Z,A),e.lineTo(S,T)}e.stroke()}}},{key:"_draw_oriented_labels",value:function(e,t,n,i,r,a,o){var s=this;if(o.doit&&0!=t.length){var l=(0,k.Z)(n,2),u=l[0],c=l[1],h=this.coordinates.map_to_screen(u,c),_=(0,k.Z)(h,2),d=_[0],f=_[1],v=(0,k.Z)(this.offsets,2),p=v[0],g=v[1],b=(0,k.Z)(this.normals,2),x=b[0]*(p+a),Z=b[1]*(g+a),A=this.panel.get_label_text_heuristics(i),S=A.vertical_align,T=A.align,M=this.panel.get_label_angle_heuristic(i);t.visuals=o.values(),t.angle=M,t.base_font_size=this.plot_view.base_font_size;
2for(var z=0;z<t.length;z++){var E=t.items[z];E.position={sx:d[z]+x,sy:f[z]+Z,x_anchor:T,y_anchor:S},E instanceof C.TextBox&&(E.align=T)}var R=t.length,B=m.Indices.all_set(R),N=t.items,O=N.map((function(e){return e.bbox()})),D=(0,k.Z)(s.ranges,1)[0].is_reversed?0==s.dimension?function(e,t){return O[e].left-O[t].right}:function(e,t){return O[t].top-O[e].bottom}:0==s.dimension?function(e,t){return O[t].left-O[e].right}:function(e,t){return O[e].top-O[t].bottom},I=this.model.major_label_policy.filter(B,O,D),P=(0,y.Z)(I.ones());if(0!=P.length){var V=this.parent.canvas_view.bbox,L=function(e){var t=O[e];if(t.left<0){var n=-t.left,i=N[e].position;N[e].position=Object.assign(Object.assign({},i),{sx:i.sx+n})}else if(t.right>V.width){var r=t.right-V.width,a=N[e].position;N[e].position=Object.assign(Object.assign({},a),{sx:a.sx-r})}},j=function(e){var t=O[e];if(t.top<0){var n=-t.top,i=N[e].position;N[e].position=Object.assign(Object.assign({},i),{sy:i.sy+n})}else if(t.bottom>V.height){var r=t.bottom-V.height,a=N[e].position;N[e].position=Object.assign(Object.assign({},a),{sy:a.sy-r})}},U=P[0],F=P[P.length-1];0==this.dimension?(L(U),L(F)):(j(U),j(F))}var G,H=(0,w.Z)(I);try{for(H.s();!(G=H.n()).done;){var Y=G.value;N[Y].paint(e)}}catch(J){H.e(J)}finally{H.f()}}}},{key:"_tick_extent",value:function(){return this.model.major_tick_out}},{key:"_tick_label_extents",value:function(){var e=this.tick_coords.major,t=this.compute_labels(e[this.dimension]),n=this.model.major_label_orientation,i=this.model.major_label_standoff,r=this.visuals.major_label_text;return[this._oriented_labels_extent(t,n,i,r)]}},{key:"extents",get:function(){var e=this._tick_label_extents();return{tick:this._tick_extent(),tick_labels:e,tick_label:(0,S.sum)(e),axis_label:this._axis_label_extent()}}},{key:"_oriented_labels_extent",value:function(e,t,n,i){if(0==e.length||!i.doit)return 0;var r=this.panel.get_label_angle_heuristic(t);e.visuals=i.values(),e.angle=r,e.base_font_size=this.plot_view.base_font_size;var a=e.max_size(),o=0==this.dimension?a.height:a.width;return o>0?n+o+3:0}},{key:"normals",get:function(){return this.panel.normals}},{key:"dimension",get:function(){return this.panel.dimension}},{key:"compute_labels",value:function(e){for(var t=this.model.formatter.format_graphics(e,this),n=this._major_label_views,i=new Set,r=0;r<e.length;r++){var a=n.get(e[r].toString());null!=a&&(i.add(a),t[r]=a.graphics())}var o,s=(0,w.Z)(this._major_label_views.values());try{for(s.s();!(o=s.n()).done;){var l=o.value;i.has(l)||(l._has_finished=!0)}}catch(u){s.e(u)}finally{s.f()}return new C.GraphicsBoxes(t)}},{key:"offsets",get:function(){if(null!=this.model.fixed_location)return[0,0];var e=this.plot_view.frame,t=0,n=0;switch(this.panel.side){case"below":n=D(this.layout.bbox.top-e.bbox.bottom);break;case"above":n=D(this.layout.bbox.bottom-e.bbox.top);break;case"right":t=D(this.layout.bbox.left-e.bbox.right);break;case"left":t=D(this.layout.bbox.right-e.bbox.left)}return[t,n]}},{key:"ranges",get:function(){var e=this.dimension,t=(e+1)%2,n=this.coordinates.ranges;return[n[e],n[t]]}},{key:"computed_bounds",get:function(){var e=(0,k.Z)(this.ranges,1)[0],t=this.model.bounds,n=[e.min,e.max];if("auto"==t)return[e.min,e.max];var i,r,a=(0,k.Z)(t,2),o=a[0],s=a[1],l=n[0],u=n[1],c=Math.min,h=Math.max;return D(o-s)>D(l-u)?(i=h(c(o,s),l),r=c(h(o,s),u)):(i=c(o,s),r=h(o,s)),[i,r]}},{key:"rule_coords",get:function(){var e=this.dimension,t=(e+1)%2,n=(0,k.Z)(this.ranges,1)[0],i=(0,k.Z)(this.computed_bounds,2),r=i[0],a=i[1],o=[new Array(2),new Array(2)];return o[e][0]=Math.max(r,n.min),o[e][1]=Math.min(a,n.max),o[e][0]>o[e][1]&&(o[e][0]=o[e][1]=NaN),o[t][0]=this.loc,o[t][1]=this.loc,o}},{key:"tick_coords",get:function(){for(var e=this.dimension,t=(e+1)%2,n=(0,k.Z)(this.ranges,1)[0],i=(0,k.Z)(this.computed_bounds,2),r=i[0],a=i[1],o=this.model.ticker.get_ticks(r,a,n,this.loc),s=o.major,l=o.minor,u=[[],[]],c=[[],[]],h=[n.min,n.max],_=h[0],d=h[1],f=0;f<s.length;f++)s[f]<_||s[f]>d||(u[e].push(s[f]),u[t].push(this.loc));for(var v=0;v<l.length;v++)l[v]<_||l[v]>d||(c[e].push(l[v]),c[t].push(this.loc));return{major:u,minor:c}}},{key:"loc",get:function(){var e=this.model.fixed_location;if(null!=e){if((0,M.isNumber)(e))return e;var t=(0,k.Z)(this.ranges,2)[1];if(t instanceof z.FactorRange)return t.synthetic(e);(0,B.unreachable)()}var n=(0,k.Z)(this.ranges,2)[1];switch(this.panel.side){case"left":case"below":return n.start;case"right":case"above":return n.end}}},{key:"serializable_state",value:function(){return Object.assign(Object.assign({},(0,_.Z)((0,d.Z)(n.prototype),"serializable_state",this).call(this)),{bbox:this.layout.bbox.box})}},{key:"remove",value:function(){var e;null===(e=this._axis_label_view)||void 0===e||e.remove();var t,i=(0,w.Z)(this._major_label_views.values());try{for(i.s();!(t=i.n()).done;){t.value.remove()}}catch(r){i.e(r)}finally{i.f()}(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"has_finished",value:function(){if(!(0,_.Z)((0,d.Z)(n.prototype),"has_finished",this).call(this))return!1;if(null!=this._axis_label_view&&!this._axis_label_view.has_finished())return!1;var e,t=(0,w.Z)(this._major_label_views.values());try{for(t.s();!(e=t.n()).done;){if(!e.value.has_finished())return!1}}catch(i){t.e(i)}finally{t.f()}return!0}}]),n}(s.GuideRendererView);n.AxisView=I,I.__name__="AxisView";var P=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.GuideRenderer);n.Axis=P,a=P,P.__name__="Axis",a.prototype.default_view=I,a.mixins([["axis_",h.Line],["major_tick_",h.Line],["minor_tick_",h.Line],["major_label_",h.Text],["axis_label_",h.Text]]),a.define((function(e){var t=e.Any,n=e.Int,i=e.Number,r=e.String,a=e.Ref,o=e.Dict,s=e.Tuple,h=e.Or,_=e.Nullable,d=e.Auto;return{bounds:[h(s(i,i),d),"auto"],ticker:[a(l.Ticker)],formatter:[a(u.TickFormatter)],axis_label:[_(h(r,a(E.BaseText))),null],axis_label_standoff:[n,5],major_label_standoff:[n,5],major_label_orientation:[h(f.TickLabelOrientation,i),"horizontal"],major_label_overrides:[o(h(r,a(E.BaseText))),{}],major_label_policy:[a(c.LabelingPolicy),function(){return new c.AllLabels}],major_tick_in:[i,2],major_tick_out:[i,6],minor_tick_in:[i,0],minor_tick_out:[i,4],fixed_location:[_(h(i,t)),null]}})),a.override({axis_line_color:"black",major_tick_line_color:"black",minor_tick_line_color:"black",major_label_text_font_size:"11px",major_label_text_align:"center",major_label_text_baseline:"alphabetic",axis_label_text_font_size:"13px",axis_label_text_font_style:"italic"})},function(e,t,n,i,r){var a;i();var o=e(41),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(o.RendererView);n.GuideRendererView=s,s.__name__="GuideRendererView";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Renderer);n.GuideRenderer=l,a=l,l.__name__="GuideRenderer",a.override({level:"guide"})},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(e(53).Model);n.Ticker=a,a.__name__="Ticker"},function(e,t,n,i,r){i();var a=e(53),o=e(120),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"format_graphics",value:function(e,t){return this.doFormat(e,t).map((function(e){return new o.TextBox({text:e})}))}},{key:"compute",value:function(e,t){return this.doFormat([e],null!=t?t:{loc:0})[0]}},{key:"v_compute",value:function(e,t){return this.doFormat(e,null!=t?t:{loc:0})}}]),n}(a.Model);n.TickFormatter=s,s.__name__="TickFormatter"},function(e,t,n,i,r){var a,o;i();var l=e(53),u=e(13),c=e(34),h=e(8),_=e(24),d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.Model);n.LabelingPolicy=d,d.__name__="LabelingPolicy";var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"filter",value:function(e,t,n){return e}}]),n}(d);n.AllLabels=f,f.__name__="AllLabels";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"filter",value:function(e,t,n){var i,r=this.min_distance,a=null,o=(0,w.Z)(e);try{for(o.s();!(i=o.n()).done;){var s=i.value;null!=a&&n(a,s)<r?e.unset(s):a=s}}catch(l){o.e(l)}finally{o.f()}return e}}]),n}(d);n.NoOverlap=m,a=m,m.__name__="NoOverlap",a.define((function(e){return{min_distance:[e.Number,5]}}));var x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"names",get:function(){return(0,u.keys)(this.args)}},{key:"values",get:function(){return(0,u.values)(this.args)}},{key:"func",get:function(){var e=(0,c.use_strict)(this.code);return(0,s.Z)(_.GeneratorFunction,["indices","bboxes","distance"].concat((0,y.Z)(this.names),[e]))}},{key:"filter",value:function(e,t,n){var i,r=Object.create(null),a=(i=this.func).call.apply(i,[r,e,t,n].concat((0,y.Z)(this.values))),o=a.next();if(o.done&&void 0!==o.value){var s=o.value;return s instanceof _.Indices?s:void 0===s?e:(0,h.isIterable)(s)?_.Indices.from_indices(e.size,s):_.Indices.all_unset(e.size)}var l=[];do{l.push(o.value),o=a.next()}while(!o.done);return _.Indices.from_indices(e.size,l)}}]),n}(d);n.CustomLabelingPolicy=x,o=x,x.__name__="CustomLabelingPolicy",o.define((function(e){var t=e.Unknown,n=e.String;return{args:[(0,e.Dict)(t),{}],code:[n,""]}}))},function(e,t,n,i,r){var a;i();var o=e(53),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(e(42).View);n.BaseTextView=s,s.__name__="BaseTextView";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Model);n.BaseText=l,a=l,l.__name__="BaseText",a.define((function(e){return{text:[e.String]}}))},function(e,t,n,i,r){i();var a=e(135),o=e(139),s=[{start:"$$",end:"$$",inline:!1},{start:"\\[",end:"\\]",inline:!1},{start:"\\(",end:"\\)",inline:!0}];n.parse_delimited_string=function(e){for(var t=0,n=s;t<n.length;t++){var i=n[t],r=e.indexOf(i.start),l=r+i.start.length;if(0==r){var u=e.indexOf(i.end,l),c=u;if(u==e.length-i.end.length)return new a.TeX({text:e.slice(l,c),inline:i.inline});break}}return new o.PlainText({text:e})}},function(e,t,n,i,r){var a,o,s;i();var l=e(8),u=e(136),c=e(22),h=e(120),f=e(121),m=e(122),y=e(65),w=e(133),k=e(137),A=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._position={sx:0,sy:0},e.align="left",e._x_anchor="left",e._y_anchor="center",e._base_font_size=13,e.font_size_scale=1,e.svg_image=null,e}return(0,b.Z)(n,[{key:"graphics",value:function(){return this}},{key:"infer_text_height",value:function(){return"ascent_descent"}},{key:"base_font_size",get:function(){return this._base_font_size},set:function(e){null!=e&&(this._base_font_size=e)}},{key:"has_image_loaded",get:function(){return null!=this.svg_image}},{key:"_rect",value:function(){var e=this._size(),t=e.width,n=e.he
2ight,i=this._computed_position(),r=i.x,a=i.y;return new y.BBox({x:r,y:a,width:t,height:n}).rect}},{key:"position",get:function(){return this._position},set:function(e){this._position=e}},{key:"text",get:function(){return this.model.text}},{key:"provider",get:function(){return k.default_provider}},{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t=this;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:if(e.t0="not_started"==this.provider.status,!e.t0){e.next=6;break}return e.next=6,this.provider.fetch();case 6:if("not_started"!=this.provider.status&&"loading"!=this.provider.status||this.provider.ready.connect((function(){return t.load_image()})),e.t1="loaded"==this.provider.status,!e.t1){e.next=11;break}return e.next=11,this.load_image();case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.on_change(this.model.properties.text,(function(){return e.load_image()}))}},{key:"visuals",set:function(e){var t=e.color,n=e.alpha,i=e.font_style,r=e.font_size,a=e.font,o=this.font_size_scale,s=this._base_font_size,l=(0,f.parse_css_font_size)(r);if(null!=l){var u=l.value,h=l.unit;u*=o,"em"==h&&s&&(u*=s,h="px"),r="".concat(u).concat(h)}var _="".concat(i," ").concat(r," ").concat(a);this.font=_,this.color=(0,c.color2css)(t,n)}},{key:"_computed_position",value:function(){var e=this._size(),t=e.width,n=e.height,i=this.position,r=i.sx,a=i.sy,o=i.x_anchor,s=void 0===o?this._x_anchor:o,u=i.y_anchor,c=void 0===u?this._y_anchor:u;return{x:r-function(){if((0,l.isNumber)(s))return s*t;switch(s){case"left":return 0;case"center":return.5*t;case"right":return t}}(),y:a-function(){if((0,l.isNumber)(c))return c*n;switch(c){case"top":return 0;case"center":case"baseline":return.5*n;case"bottom":return n}}()}}},{key:"size",value:function(){var e=this._size(),t=e.width,n=e.height,i=this.angle;if(i){var r=Math.cos(Math.abs(i)),a=Math.sin(Math.abs(i));return{width:Math.abs(t*r+n*a),height:Math.abs(t*a+n*r)}}return{width:t,height:n}}},{key:"get_text_dimensions",value:function(){return{width:(0,h.text_width)(this.model.text,this.font),height:(0,f.font_metrics)(this.font).height}}},{key:"get_image_dimensions",value:function(){var e,t,n,i,r=parseFloat(null!==(t=null===(e=this.svg_element.getAttribute("height"))||void 0===e?void 0:e.replace(/([A-z])/g,""))&&void 0!==t?t:"0"),a=parseFloat(null!==(i=null===(n=this.svg_element.getAttribute("width"))||void 0===n?void 0:n.replace(/([A-z])/g,""))&&void 0!==i?i:"0");return{width:(0,f.font_metrics)(this.font).x_height*a,height:(0,f.font_metrics)(this.font).x_height*r}}},{key:"_size",value:function(){return this.has_image_loaded?this.get_image_dimensions():this.get_text_dimensions()}},{key:"bbox",value:function(){var e=this.rect(),t=e.p0,n=e.p1,i=e.p2,r=e.p3,a=Math.min(t.x,n.x,i.x,r.x),o=Math.min(t.y,n.y,i.y,r.y),s=Math.max(t.x,n.x,i.x,r.x),l=Math.max(t.y,n.y,i.y,r.y);return new y.BBox({left:a,right:s,top:o,bottom:l})}},{key:"rect",value:function(){var e=this._rect(),t=this.angle;if(t){var n=this.position,i=n.sx,r=n.sy,a=new m.AffineTransform;return a.translate(i,r),a.rotate(t),a.translate(-i,-r),a.apply_rect(e)}return e}},{key:"paint_rect",value:function(e){var t=this.rect(),n=t.p0,i=t.p1,r=t.p2,a=t.p3;e.save(),e.strokeStyle="red",e.lineWidth=1,e.beginPath();var o=Math.round;e.moveTo(o(n.x),o(n.y)),e.lineTo(o(i.x),o(i.y)),e.lineTo(o(r.x),o(r.y)),e.lineTo(o(a.x),o(a.y)),e.closePath(),e.stroke(),e.restore()}},{key:"paint_bbox",value:function(e){var t=this.bbox(),n=t.x,i=t.y,r=t.width,a=t.height;e.save(),e.strokeStyle="blue",e.lineWidth=1,e.beginPath();var o=Math.round;e.moveTo(o(n),o(i)),e.lineTo(o(n),o(i+a)),e.lineTo(o(n+r),o(i+a)),e.lineTo(o(n+r),o(i)),e.closePath(),e.stroke(),e.restore()}},{key:"load_image",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,n,i,r,a;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this.provider.MathJax){e.next=2;break}return e.abrupt("return",null);case 2:if(null!=(t=this._process_text(this.model.text))){e.next=5;break}return e.abrupt("return",(this._has_finished=!0,null));case 5:return n=t.children[0],this.svg_element=n,n.setAttribute("font",this.font),n.setAttribute("stroke",this.color),i=n.outerHTML,r=new Blob([i],{type:"image/svg+xml"}),a=URL.createObjectURL(r),e.prev=8,e.next=11,(0,u.load_image)(a);case 11:this.svg_image=e.sent;case 12:return e.prev=12,URL.revokeObjectURL(a),e.finish(12);case 15:return e.abrupt("return",(this.parent.request_layout(),this.svg_image));case 16:case"end":return e.stop()}}),e,this,[[8,,12,15]])})));return function(){return e.apply(this,arguments)}}()},{key:"paint",value:function(e){e.save();var t=this.position,n=t.sx,i=t.sy;this.angle&&(e.translate(n,i),e.rotate(this.angle),e.translate(-n,-i));var r=this._computed_position(),a=r.x,o=r.y;if(null!=this.svg_image){var s=this.get_image_dimensions(),l=s.width,u=s.height;e.drawImage(this.svg_image,a,o,l,u)}else e.fillStyle=this.color,e.font=this.font,e.textAlign="left",e.textBaseline="alphabetic",e.fillText(this.model.text,a,o+(0,f.font_metrics)(this.font).ascent);
2e.restore(),this._has_finished||"failed"!=this.provider.status&&!this.has_image_loaded||(this._has_finished=!0,this.parent.notify_finished_after_paint())}}]),n}(w.BaseTextView);n.MathTextView=A,A.__name__="MathTextView";var S=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(w.BaseText);n.MathText=S,S.__name__="MathText";var T=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_process_text",value:function(e){}}]),n}(A);n.AsciiView=T,T.__name__="AsciiView";var M=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(S);n.Ascii=M,a=M,M.__name__="Ascii",a.prototype.default_view=T;var C=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_process_text",value:function(e){var t;return null===(t=this.provider.MathJax)||void 0===t?void 0:t.mathml2svg(e.trim())}}]),n}(A);n.MathMLView=C,C.__name__="MathMLView";var z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(S);n.MathML=z,o=z,z.__name__="MathML",o.prototype.default_view=C;var E=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_process_text",value:function(e){var t;return null===(t=this.provider.MathJax)||void 0===t?void 0:t.tex2svg(e,void 0,this.model.macros)}}]),n}(A);n.TeXView=E,E.__name__="TeXView";var R=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(S);n.TeX=R,s=R,R.__name__="TeX",s.prototype.default_view=E,s.define((function(e){var t=e.Boolean,n=e.Number,i=e.String,r=e.Dict,a=e.Tuple;return{macros:[r((0,e.Or)(i,a(i,n))),{}],inline:[t,!1]}}))},function(e,t,n,i,r){i();var a=e(19);n.load_image=function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(t,n){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new o(t,n).promise);case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();var o=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,g.Z)(this,e),this._image=new Image,this._finished=!1;var r=i.attempts,o=void 0===r?1:r,s=i.timeout,l=void 0===s?1:s;this.promise=new Promise((function(e,r){n._image.crossOrigin="anonymous";var s=0;n._image.onerror=function(){if(++s==o){var e="unable to load ".concat(t," image after ").concat(o," attempts");if(a.logger.warn(e),null==n._image.crossOrigin)return void(null!=i.failed&&i.failed());a.logger.warn("attempting to load ".concat(t," without a cross origin policy")),n._image.crossOrigin=null,s=0}setTimeout((function(){return n._image.src=t}),l)},n._image.onload=function(){n._finished=!0,null!=i.loaded&&i.loaded(n._image),e(n._image)},n._image.src=t}))}return(0,b.Z)(e,[{key:"finished",get:function(){return this._finished}},{key:"image",get:function(){if(this._finished)return this._image;throw new Error("not loaded yet")}}]),e}();n.ImageLoader=o,o.__name__="ImageLoader"},function(e,t,n,i,r){var a=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return o(t,e),t};i();var l=e(15),u=e(138),c=(0,b.Z)((function e(){(0,g.Z)(this,e),this.ready=new l.Signal0(this,"ready"),this.status="not_started"}));n.MathJaxProvider=c,c.__name__="MathJaxProvider";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"MathJax",get:function(){return null}},{key:"fetch",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.status="failed";case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(c);n.NoProvider=h,h.__name__="NoProvider";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"MathJax",get:function(){return"undefined"!=typeof MathJax?MathJax:null}},{key:"fetch",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,n=this;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(t=document.createElement("script")).src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js",t.onload=function(){n.status="loaded",n.ready.emit()},t.onerror=function(){n.status="failed"},this.status="loading",document.head.appendChild(t);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(c);n.CDNProvider=_,_.__name__="CDNProvider";var d=function(t){(0,v.Z)(i,t);var n=(0,p.Z)(i);function i(){return(0,g.Z)(this,i),n.apply(this,arguments)}return(0,b.Z)(i,[{key:"MathJax",get:function(){return this._mathjax}},{key:"fetch",value:function(){var t=(0,Z.Z)((0,x.Z)().mark((function t(){var n;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.status="loading",t.prev=1,t.next=4,(0,u.load_module)(Promise.resolve().then((function(){return s(e(519))})));case 4:n=t.sent,this._mathjax=n,this.status="loaded",this.ready.emit(),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(1),this.status="failed";case 11:case"end":return t.stop()}}),t,this,[[1,8]])})));return function(){return t.apply(this,arguments)}}()}]),i}(c);n.BundleProvider=d,d.__name__="BundleProvider",n.default_provider=new d},function(e,t,n,i,r){i(),n.load_module=function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(t){var n;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t;case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),!((n=e.t0)instanceof Error&&"code"in n&&"MODULE_NOT_FOUND"===e.t0.code)){e.next=10;break}return e.abrupt("return",null);case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}()},function(e,t,n,i,r){var a;i();var o=e(133),s=e(120),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._has_finished=!0}},{key:"graphics",value:function(){return new s.TextBox({text:this.model.text})}}]),n}(o.BaseTextView);n.PlainTextView=l,l.__name__="PlainTextView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.BaseText);n.PlainText=u,a=u,u.__name__="PlainText",a.prototype.default_view=l},function(e,t,n,i,r){i();var a,o=e(1),s=e(128),l=e(141),u=e(142),c=(0,o.__importStar)(e(48)),h=e(20),_=e(120),d=e(8),f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_paint",value:function(e,t,n){this._draw_group_separators(e,t,n
2)}},{key:"_draw_group_separators",value:function(e,t,n){var i=(0,k.Z)(this.ranges,1)[0],r=(0,k.Z)(this.computed_bounds,2),a=r[0],o=r[1];if(i.tops&&!(i.tops.length<2)&&this.visuals.separator_line.doit){for(var s=this.dimension,l=(s+1)%2,u=[[],[]],c=0,h=0;h<i.tops.length-1;h++){for(var _=void 0,d=void 0,f=c;f<i.factors.length;f++)if(i.factors[f][0]==i.tops[h+1]){var v;_=(v=[i.factors[f-1],i.factors[f]])[0],d=v[1],c=f;break}var p=(i.synthetic(_)+i.synthetic(d))/2;p>a&&p<o&&(u[s].push(p),u[l].push(this.loc))}var m=this.extents.tick_label;this._draw_ticks(e,u,-3,m-6,this.visuals.separator_line)}}},{key:"_draw_major_labels",value:function(e,t,n){for(var i=this._get_factor_info(),r=t.tick+this.model.major_label_standoff,a=0;a<i.length;a++){var o=(0,k.Z)(i[a],4),s=o[0],l=o[1],u=o[2],c=o[3];this._draw_oriented_labels(e,s,l,u,this.panel.side,r,c),r+=t.tick_labels[a]}}},{key:"_tick_label_extents",value:function(){var e,t=this._get_factor_info(),n=[],i=(0,w.Z)(t);try{for(i.s();!(e=i.n()).done;){var r=(0,k.Z)(e.value,4),a=r[0],o=r[2],s=r[3],l=this._oriented_labels_extent(a,o,this.model.major_label_standoff,s);n.push(l)}}catch(u){i.e(u)}finally{i.f()}return n}},{key:"_get_factor_info",value:function(){var e=this,t=(0,k.Z)(this.ranges,1)[0],n=(0,k.Z)(this.computed_bounds,2),i=n[0],r=n[1],a=this.loc,o=this.model.ticker.get_ticks(i,r,t,a),s=this.tick_coords,l=[],u=function(e){return new _.GraphicsBoxes(e.map((function(e){return(0,d.isString)(e)?new _.TextBox({text:e}):e})))},c=function(t){return u(e.model.formatter.doFormat(t,e))};if(1==t.levels){var h=c(o.major);l.push([h,s.major,this.model.major_label_orientation,this.visual
2s.major_label_text])}else if(2==t.levels){var f=c(o.major.map((function(e){return e[1]})));l.push([f,s.major,this.model.major_label_orientation,this.visuals.major_label_text]),l.push([u(o.tops),s.tops,this.model.group_label_orientation,this.visuals.group_text])}else if(3==t.levels){var v=c(o.major.map((function(e){return e[2]}))),p=o.mids.map((function(e){return e[1]}));l.push([v,s.major,this.model.major_label_orientation,this.visuals.major_label_text]),l.push([u(p),s.mids,this.model.subgroup_label_orientation,this.visuals.subgroup_text]),l.push([u(o.tops),s.tops,this.model.group_label_orientation,this.visuals.group_text])}return l}},{key:"tick_coords",get:function(){var e=this,t=this.dimension,n=(t+1)%2,i=(0,k.Z)(this.ranges,1)[0],r=(0,k.Z)(this.computed_bounds,2),a=r[0],o=r[1],s=this.model.ticker.get_ticks(a,o,i,this.loc),l={major:[[],[]],mids:[[],[]],tops:[[],[]],minor:[[],[]]};return l.major[t]=s.major,l.major[n]=s.major.map((function(){return e.loc})),3==i.levels&&(l.mids[t]=s.mids,l.mids[n]=s.mids.map((function(){return e.loc}))),i.levels>1&&(l.tops[t]=s.tops,l.tops[n]=s.tops.map((function(){return e.loc}))),l}}]),n}(s.AxisView);n.CategoricalAxisView=f,f.__name__="CategoricalAxisView";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.Axis);n.CategoricalAxis=m,a=m,m.__name__="CategoricalAxis",a.prototype.default_view=f,a.mixins([["separator_",c.Line],["group_",c.Text],["subgroup_",c.Text]]),a.define((function(e){var t=e.Number,n=e.Or;return{group_label_orientation:[n(h.TickLabelOrientation,t),"parallel"],subgroup_label_orientation:[n(h.TickLabelOrientation,t),"parallel"]}})),a.override({ticker:function(){return new l.CategoricalTicker},formatter:function(){return new u.CategoricalTickFormatter},separator_line_color:"lightgrey",separator_line_width:2,group_text_font_style:"bold",group_text_font_size:"11px",group_text_color:"grey",subgroup_text_font_style:"bold",subgroup_text_font_size:"11px"})},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_ticks",value:function(e,t,n,i){var r,a;return{major:this._collect(n.factors,n,e,t),minor:[],tops:this._collect(null!==(r=n.tops)&&void 0!==r?r:[],n,e,t),mids:this._collect(null!==(a=n.mids)&&void 0!==a?a:[],n,e,t)}}},{key:"_collect",value:function(e,t,n,i){var r,a=[],o=(0,w.Z)(e);try{for(o.s();!(r=o.n()).done;){var s=r.value,l=t.synthetic(s);l>n&&l<i&&a.push(s)}}catch(u){o.e(u)}finally{o.f()}return a}}]),n}(e(130).Ticker);n.CategoricalTicker=a,a.__name__="CategoricalTicker"},function(e,t,n,i,r){i();var a=e(131),o=e(9),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"doFormat",value:function(e,t){return(0,o.copy)(e)}}]),n}(a.TickFormatter);n.CategoricalTickFormatter=s,s.__name__="CategoricalTickFormatter"},function(e,t,n,i,r){i();var a=e(128),o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(a.AxisView);n.ContinuousAxisView=o,o.__name__="ContinuousAxisView";var s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(a.Axis);n.ContinuousAxis=s,s.__name__="ContinuousAxis"},function(e,t,n,i,r){var a;i();var o=e(145),s=e(150),l=e(155),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(o.LinearAxisView);n.DatetimeAxisView=u,u.__name__="DatetimeAxisView";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.LinearAxis);n.DatetimeAxis=c,a=c,c.__name__="DatetimeAxis",a.prototype.default_view=u,a.override({ticker:function(){return new l.DatetimeTicker},formatter:function(){return new s.DatetimeTickFormatter}})},function(e,t,n,i,r){var a;i();var o=e(143),s=e(146),l=e(147),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(o.ContinuousAxisView);n.LinearAxisView=u,u.__name__="LinearAxisView";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.ContinuousAxis);n.LinearAxis=c,a=c,c.__name__="LinearAxis",a.prototype.default_view=u,a.override({ticker:function(){return new l.BasicTicker},formatter:function(){return new s.BasicTickFormatter}})},function(e,t,n,i,r){var a;i();var o=e(131),s=e(34);function l(e){var t,n="",i=(0,w.Z)(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;n+="-"==r?"\u2212":r}}catch(a){i.e(a)}finally{i.f()}return n}n.unicode_replace=l;var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).last_precision=3,i}return(0,b.Z)(n,[{key:"scientific_limit_low",get:function(){return Math.pow(10,this.power_limit_low)}},{key:"scientific_limit_high",get:function(){return Math.pow(10,this.power_limit_high)}},{key:"_need_sci",value:function(e){if(!this.use_scientific)return!1;var t,n=this.scientific_limit_high,i=this.scientific_limit_low,r=e.length<2?0:Math.abs(e[1]-e[0])/1e4,a=(0,w.Z)(e);try{for(a.s();!(t=a.n()).done;){var o=t.value,s=Math.abs(o);if(!(s<=r)&&(s>=n||s<=i))return!0}}catch(l){a.e(l)}finally{a.f()}return!1}},{key:"_format_with_precision",value:function(e,t,n){return t?e.map((function(e){return l(e.toExponential(n))})):e.map((function(e){return l((0,s.to_fixed)(e,n))}))}},{key:"_auto_precision",value:function(e,t){var n=new Array(e.length),i=this.last_precision<=15;e:for(var r=this.last_precision;i?r<=15:r>=1;
2i?r++:r--){if(t){n[0]=e[0].toExponential(r);for(var a=1;a<e.length;a++)if(n[a]==n[a-1])continue e;this.last_precision=r;break}n[0]=(0,s.to_fixed)(e[0],r);for(var o=1;o<e.length;o++)if(n[o]=(0,s.to_fixed)(e[o],r),n[o]==n[o-1])continue e;this.last_precision=r;break}return this.last_precision}},{key:"doFormat",value:function(e,t){if(0==e.length)return[];var n=this._need_sci(e),i="auto"==this.precision?this._auto_precision(e,n):this.precision;return this._format_with_precision(e,n,i)}}]),n}(o.TickFormatter);n.BasicTickFormatter=u,a=u,u.__name__="BasicTickFormatter",a.define((function(e){var t=e.Boolean,n=e.Int,i=e.Auto;return{precision:[(0,e.Or)(n,i),"auto"],use_scientific:[t,!0],power_limit_high:[n,5],power_limit_low:[n,-3]}}))},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(e(148).AdaptiveTicker);n.BasicTicker=a,a.__name__="BasicTicker"},function(e,t,n,i,r){var a;i();var o=e(149),s=e(9),l=e(10),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_min_interval",value:function(){return this.min_interval}},{key:"get_max_interval",value:function(){var e;return null!==(e=this.max_interval)&&void 0!==e?e:1/0}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this);var e=(0,s.nth)(this.mantissas,-1)/this.base,t=(0,s.nth)(this.mantissas,0)*this.base;this.extended_mantissas=[e].concat((0,y.Z)(this.mantissas),[t]),this.base_factor=0===this.get_min_interval()?1:this.get_min_interval()}},{key:"get_interval",value:function(e,t,n){var i=t-e,r=this.get_ideal_interval(e,t,n),a=Math.floor((0,l.log)(r/this.base_factor,this.base)),o=Math.pow(this.base,a)*this.base_factor,u=this.extended_mantissas,c=u.map((function(e){return Math.abs(n-i/(e*o))})),h=u[(0,s.argmin)(c)]*o;return(0,l.clamp)(h,this.get_min_interval(),this.get_max_interval())}}]),n}(o.ContinuousTicker);n.AdaptiveTicker=u,a=u,u.__name__="AdaptiveTicker",a.define((function(e){var t=e.Number,n=e.Array,i=e.Nullable;return{base:[t,10],mantissas:[n(t),[1,2,5]],min_interval:[t,0],max_interval:[i(t),null]}}))},function(e,t,n,i,r){var a;i();var o=e(130),s=e(9),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_ticks",value:function(e,t,n,i){return this.get_ticks_no_defaults(e,t,i,this.desired_num_ticks)}},{key:"get_ticks_no_defaults",value:function(e,t,n,i){var r=this.get_interval(e,t,i),a=Math.floor(e/r),o=Math.ceil(t/r),l=(isFinite(a)&&isFinite(o)?(0,s.range)(a,o+1):[]).map((function(e){return e*r})).filter((function(n){return e<=n&&n<=t})),u=this.num_minor_ticks,c=[];if(u>0&&l.length>0){var h,_=r/u,d=(0,s.range)(0,u).map((function(e){return e*_})),f=(0,w.Z)(d.slice(1));try{for(f.s();!(h=f.n()).done;){var v=h.value,p=l[0]-v;e<=p&&p<=t&&c.push(p)}}catch(Z){f.e(Z)}finally{f.f()}var m,y=(0,w.Z)(l);try{for(y.s();!(m=y.n()).done;){var g,b=m.value,x=(0,w.Z)(d);try{for(x.s();!(g=x.n()).done;){var k=b+g.value;e<=k&&k<=t&&c.push(k)}}catch(Z){x.e(Z)}finally{x.f()}}}catch(Z){y.e(Z)}finally{y.f()}}return{major:l,minor:c}}},{key:"get_ideal_interval",value:function(e,t,n){return(t-e)/n}}]),n}(o.Ticker);n.ContinuousTicker=l,a=l,l.__name__="ContinuousTicker",a.define((function(e){var t=e.Int;return{num_minor_ticks:[t,5],desired_num_ticks:[t,6]}}))},function(e,t,n,i,r){var a;i();var o=(0,e(1).__importDefault)(e(151)),s=e(131),l=e(19),u=e(152),c=e(9),h=e(8);function f(e){return(0,o.default)(e,"%Y %m %d %H %M %S").split(/\s+/).map((function(e){return parseInt(e,10)}))}function m(e,t){if((0,h.isFunction)(t))return t(e);var n=(0,u.sprintf)("$1%06d",function(e){return Math.round(e/1e3%1*1e6)}(e));return-1==(t=t.replace(/((^|[^%])(%%)*)%f/,n)).indexOf("%")?t:(0,o.default)(e,t)}var y=["microseconds","milliseconds","seconds","minsec","minutes","hourmin","hours","days","months","years"],x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).strip_leading_zeros=!0,i}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._update_width_formats()}},{key:"_update_width_formats",value:function(){var e=+(0,o.default)(new Date),t=function(t){var n=t.map((function(t){return m(e,t).length})),i=(0,c.sort_by)((0,c.zip)(n,t),(function(e){return(0,k.Z)(e,1)[0]}));return(0,c.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)}}},{key:"_get_resolution_str",value:function(e,t){var n=1.1*e;switch(!1){case!(n<.001):return"microseconds";case!(n<1):return"milliseconds";case!(n<60):return t>=60?"minsec":"seconds";case!(n<3600):return t>=3600?"hourmin":"minutes";case!(n<86400):return"hours";case!(n<2678400):return"days";
2case!(n<31536e3):return"months";default:return"years"}}},{key:"doFormat",value:function(e,t){if(0==e.length)return[];for(var n=Math.abs(e[e.length-1]-e[0])/1e3,i=n/(e.length-1),r=this._get_resolution_str(i,n),a=(0,k.Z)(this._width_formats[r],2),o=(0,k.Z)(a[1],1)[0],s=[],u=y.indexOf(r),c={},h=0,_=y;h<_.length;h++){c[_[h]]=0}c.seconds=5,c.minsec=4,c.minutes=4,c.hourmin=3,c.hours=3;var d,v=(0,w.Z)(e);try{for(v.s();!(d=v.n()).done;){var p=d.value,g=void 0,b=void 0;try{b=f(p),g=m(p,o)}catch(e){l.logger.warn("unable to format tick for timestamp value ".concat(p)),l.logger.warn(" - ".concat(e)),s.push("ERR");continue}for(var x=!1,Z=u;0==b[c[y[Z]]];){if((Z+=1)==y.length)break;if(("minsec"==r||"hourmin"==r)&&!x){if("minsec"==r&&0==b[4]&&0!=b[5]||"hourmin"==r&&0==b[3]&&0!=b[4]){g=m(p,this._width_formats[y[u-1]][1][0]);break}x=!0}g=m(p,this._width_formats[y[Z]][1][0])}if(this.strip_leading_zeros){var A=g.replace(/^0+/g,"");A!=g&&isNaN(parseInt(A))&&(A="0".concat(A)),s.push(A)}else s.push(g)}}catch(S){v.e(S)}finally{v.f()}return s}}]),n}(s.TickFormatter);n.DatetimeTickFormatter=x,a=x,x.__name__="DatetimeTickFormatter",a.define((function(e){var t=e.String,n=e.Array;return{microseconds:[n(t),["%fus"]],milliseconds:[n(t),["%3Nms","%S.%3Ns"]],seconds:[n(t),["%Ss"]],minsec:[n(t),[":%M:%S"]],minutes:[n(t),[":%M","%Mm"]],hourmin:[n(t),["%H:%M"]],hours:[n(t),["%Hh","%H:%M"]],days:[n(t),["%m/%d","%a%d"]],months:[n(t),["%m/%Y","%b %Y"]],years:[n(t),["%Y"]]}}))},function(e,t,n,i,r){!function(e){"object"==typeof t&&t.exports?t.exports=e():"function"==typeof define?define(e):this.tz=e()}((function(){function e(e,t,n){var i,r=t.day[1];do{i=new Date(Date.UTC(n,t.month,Math.abs(r++)))}while(t.day[0]<7&&i.getUTCDay()!=t.day[0]);return(i={clock:t.clock,sort:i.getTime(),rule:t,save:6e4*t.save,offset:e.offset})[i.clock]=i.sort+6e4*t.time,i.posix?i.wallclock=i[i.clock]+(e.offset+t.saved):i.posix=i[i.clock]-(e.offset+t.saved),i}function t(t,n,i){var r,a,o,s,l,u,c,h=t[t.zone],_=[],d=new Date(i).getUTCFullYear(),f=1;for(r=1,a=h.length;r<a&&!(h[r][n]<=i);r++);if((o=h[r]).rules){for(u=t[o.rules],c=d+1;c>=d-f;--c)for(r=0,a=u.length;r<a;r++)u[r].from<=c&&c<=u[r].to?_.push(e(o,u[r],c)):u[r].to<c&&1==f&&(f=c-u[r].to);for(_.sort((function(e,t){return e.sort-t.sort})),r=0,a=_.length;r<a;r++)i>=_[r][n]&&_[r][_[r].clock]>o[_[r].clock]&&(s=_[r])}return s&&((l=/^(.*)\/(.*)$/.exec(o.format))?s.abbrev=l[s.save?2:1]:s.abbrev=o.format.replace(/%s/,s.rule.letter)),s||o}function n(e,n){return"UTC"==e.zone?n:(e.entry=t(e,"posix",n),n+e.entry.offset+e.entry.save)}function i(e,n){return"UTC"==e.zone?n:(e.entry=i=t(e,"wallclock",n),0<(r=n-i.wallclock)&&r<i.save?null:n-i.offset-i.save);var i,r}function r(e,t,r){var a,s=+(r[1]+1),u=r[2]*s,c=o.indexOf(r[3].toLowerCase());if(c>9)t+=u*l[c-10];else{if(a=new Date(n(e,t)),c<7)for(;u;)a.setUTCDate(a.getUTCDate()+s),a.getUTCDay()==c&&(u-=s);else 7==c?a.setUTCFullYear(a.getUTCFullYear()+u):8==c?a.setUTCMonth(a.getUTCMonth()+u):a.setUTCDate(a.getUTCDate()+u);null==(t=i(e,a.getTime()))&&(t=i(e,a.getTime()+864e5*s)-864e5*s)}return t}var a={clock:function(){return+new Date},zone:"UTC",entry:{abbrev:"UTC",offset:0,save:0},UTC:1,z:function(e,t,n,i){var r,a,o=this.entry.offset+this.entry.save,s=Math.abs(o/1e3),l=[],u=3600;for(r=0;r<3;r++)l.push(("0"+Math.floor(s/u)).slice(-2)),s%=u,u/=60;return"^"!=n||o?("^"==n&&(i=3),3==i?(a=(a=l.join(":")).replace(/:00$/,""),"^"!=n&&(a=a.replace(/:00$/,""))):i?(a=l.slice(0,i+1).join(":"),"^"==n&&(a=a.replace(/:00$/,""))):a=l.slice(0,2).join(""),a=(a=(o<0?"-":"+")+a).replace(/([-+])(0)/,{_:" $1","-":"$1"}[n]||"$1$2")):"Z"},"%":function(e){return"%"},n:function(e){return"\n"},t:function(e){return"\t"},U:function(e){return u(e,0)},W:function(e){return u(e,1)},V:function(e){return c(e)[0]},G:function(e){return c(e)[1]},g:function(e){return c(e)[1]%100},j:function(e){return Math.floor((e.getTime()-Date.UTC(e.getUTCFullYear(),0))/864e5)+1},s:function(e){return Math.floor(e.getTime()/1e3)},C:function(e){return Math.floor(e.getUTCFullYear()/100)},N:function(e){return e.getTime()%1e3*1e6},m:function(e){return e.getUTCMonth()+1},Y:function(e){return e.getUTCFullYear()},y:function(e){return e.getUTCFullYear()%100},H:function(e){return e.getUTCHours()},M:function(e){return e.getUTCMinutes()},S:function(e){return e.getUTCSeconds()},e:function(e){return e.getUTCDate()},d:function(e){return e.getUTCDate()},u:function(e){return e.getUTCDay()||7},w:function(e){return e.getUTCDay()},l:function(e){return e.getUTCHours()%12||12},I:function(e){return e.getUTCHours()%12||12},k:function(e){return e.getUTCHours()},Z:function(e){return this.entry.abbrev},a:function(e){return this[this.locale].day.abbrev[e.getUTCDay()]},A:function(e){return this[this.locale].day.full[e.getUTCDay()]},h:function(e){return this[this.locale].month.abbrev[e.getUTCMonth()]},b:function(e){return this[this.locale].month.abbrev[e.getUTCMonth()]},B:function(e){return this[this.locale].month.full[e.getUTCMonth()]},P:function(e){return this[this.locale].meridiem[Math.floor(e.getUTCHours()/12)].toLowerCase()},p:function(e){return this[this.locale].meridiem[Math.floor(e.getUTCHours()/12)]},R:function(e,t){return this.convert([t,"%H:%M"])},T:function(e,t){return this.convert([t,"%H:%M:%S"])},D:function(e,t){return this.convert([t,"%m/%d/%y"])},F:function(e,t){return this.convert([t,"%Y-%m-%d"])},x:function(e,t){return this.convert([t,this[this.locale].date])},r:function(e,t){return this.convert([t,this[this.locale].time12||"%I:%M:%S"])},X:function(e,t){return this.convert([t,this[this.locale].time24])},c:function(e,t){return this.convert([t,this[this.locale].dateTime])},convert:function(e){if(!e.length)return"1.0.23";var t,a,o,l,u,c=Object.create(this),h=[];for(t=0;t<e.length;t++)if(l=e[t],Array.isArray(l))t||isNaN(l[1])?l.splice.apply(e,[t--,1].concat(l)):u=l;
2else if(isNaN(l)){if("string"==(o=typeof l))~l.indexOf("%")?c.format=l:t||"*"!=l?!t&&(o=/^(\d{4})-(\d{2})-(\d{2})(?:[T\s](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|(([+-])(\d{2}(:\d{2}){0,2})))?)?$/.exec(l))?((u=[]).push.apply(u,o.slice(1,8)),o[9]?(u.push(o[10]+1),u.push.apply(u,o[11].split(/:/))):o[8]&&u.push(1)):/^\w{2,3}_\w{2}$/.test(l)?c.locale=l:(o=s.exec(l))?h.push(o):c.zone=l:u=l;else if("function"==o){if(o=l.call(c))return o}else if(/^\w{2,3}_\w{2}$/.test(l.name))c[l.name]=l;else if(l.zones){for(o in l.zones)c[o]=l.zones[o];for(o in l.rules)c[o]=l.rules[o]}}else t||(u=l);if(c[c.locale]||delete c.locale,c[c.zone]||delete c.zone,null!=u){if("*"==u)u=c.clock();else if(Array.isArray(u)){for(o=[],a=!u[7],t=0;t<11;t++)o[t]=+(u[t]||0);--o[1],u=Date.UTC.apply(Date.UTC,o)+-o[7]*(36e5*o[8]+6e4*o[9]+1e3*o[10])}else u=Math.floor(u);if(!isNaN(u)){if(a&&(u=i(c,u)),null==u)return u;for(t=0,a=h.length;t<a;t++)u=r(c,u,h[t]);return c.format?(o=new Date(n(c,u)),c.format.replace(/%([-0_^]?)(:{0,3})(\d*)(.)/g,(function(e,t,n,i,r){var a,s,l="0";if(a=c[r]){for(e=String(a.call(c,o,u,t,n.length)),"_"==(t||a.style)&&(l=" "),s="-"==t?0:a.pad||0;e.length<s;)e=l+e;for(s="-"==t?0:i||a.pad;e.length<s;)e=l+e;"N"==r&&s<e.length&&(e=e.slice(0,s)),"^"==t&&(e=e.toUpperCase())}return e}))):u}}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("|")}}},o="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|year|month|day|hour|minute|second|millisecond",s=new RegExp("^\\s*([+-])(\\d+)\\s+("+o+")s?\\s*$","i"),l=[36e5,6e4,1e3,1];function u(e,t){var n,i,r;return i=new Date(Date.UTC(e.getUTCFullYear(),0)),n=Math.floor((e.getTime()-i.getTime())/864e5),i.getUTCDay()==t?r=0:8==(r=7-i.getUTCDay()+t)&&(r=1),n>=r?Math.floor((n-r)/7)+1:0}function c(e){var t,n,i;return n=e.getUTCFullYear(),t=new Date(Date.UTC(n,0)).getUTCDay(),(i=u(e,1)+(t>1&&t<=4?1:0))?53!=i||4==t||3==t&&29==new Date(n,1,29).getDate()?[i,e.getUTCFullYear()]:[1,e.getUTCFullYear()+1]:(n=e.getUTCFullYear()-1,[i=4==(t=new Date(Date.UTC(n,0)).getUTCDay())||3==t&&29==new Date(n,1,29).getDate()?53:52,e.getUTCFullYear()-1])}return o=o.toLowerCase().split("|"),"delmHMSUWVgCIky".replace(/./g,(function(e){a[e].pad=2})),a.N.pad=9,a.j.pad=3,a.k.style="_",a.l.style="_",a.e.style="_",function(){return a.convert(arguments)}}))},function(e,t,n,i,r){i();var a=e(1),o=(0,a.__importStar)(e(153)),s=e(154),l=(0,a.__importDefault)(e(151)),u=e(21),c=e(8);function h(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return s.sprintf.apply(void 0,[e].concat(n))}function _(e,t,n){return(0,c.isNumber)(e)?h(function(){switch(!1){case Math.floor(e)!=e:return"%d";case!(Math.abs(e)>.1&&Math.abs(e)<1e3):return"%0.3f";default:return"%0.3e"}}(),e):"".concat(e)}function d(e,t,i){if(null==t)return _;if(null!=i&&e in i){var r=i[e];if((0,c.isString)(r)){if(r in n.DEFAULT_FORMATTERS)return n.DEFAULT_FORMATTERS[r];throw new Error("Unknown tooltip field formatter type '".concat(r,"'"))}return function(e,t,n){return r.format(e,t,n)}}return n.DEFAULT_FORMATTERS.numeral}function f(e,t,n){var i=t.get_column(e);if(null==i)return null;if((0,c.isNumber)(n))return i[n];var r=i[n.index];return(0,c.isTypedArray)(r)||(0,c.isArray)(r)?(0,c.isArray)(r[0])?r[n.dim2][n.dim1]:r[n.flat_index]:r}function v(e,t,n,i){return"$"==e[0]?function(e,t){if(e in t)return t[e];throw new Error("Unknown special variable '$".concat(e,"'"))}(e.substring(1),i):f(e.substring(1).replace(/[{}]/g,""),t,n)}n.FormatterType=(0,u.Enum)("numeral","printf","datetime"),n.DEFAULT_FORMATTERS={numeral:function(e,t,n){return o.format(e,t)},datetime:function(e,t,n){return(0,l.default)(e,t)},printf:function(e,t,n){return h(t,e)}},n.sprintf=h,n.basic_formatter=_,n.get_formatter=d,n._get_column_value=f,n.get_value=v,n.replace_placeholders=function(e,t,n,i){var r,a,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=arguments.length>5?arguments[5]:void 0;return(0,c.isString)(e)?(r=e,a=!1):(r=e.html,a=!0),r=(r=r.replace(/@\$name/g,(function(e){return"@{".concat(o.name,"}")}
2))).replace(/((?:\$\w+)|(?:@\w+)|(?:@{(?:[^{}]+)}))(?:{([^{}]+)})?/g,(function(e,r,l){var u=v(r,t,n,o);if(null==u)return s?s("???"):"???";if("safe"==l)return a=!0,"".concat(u);var c="".concat(d(r,l,i)(u,l,o));return s?s(c):c})),a?(0,y.Z)((new DOMParser).parseFromString(r,"text/html").body.childNodes):r}},function(e,t,n,i,r){var a,o={},s=o,l="en-US",u=null,c="0,0";function h(e){this._value=e}function _(e){var t,n="";for(t=0;t<e;t++)n+="0";return n}function d(e,t,n,i){var r,a,o=Math.pow(10,t);return a=e.toFixed(0).search("e")>-1?function(e,t){var n,i,r,a;return n=(a=e.toString()).split("e")[0],r=a.split("e")[1],a=n.split(".")[0]+(i=n.split(".")[1]||"")+_(r-i.length),t>0&&(a+="."+_(t)),a}(e,t):(n(e*o)/o).toFixed(t),i&&(r=new RegExp("0{1,"+i+"}$"),a=a.replace(r,"")),a}function f(e,t,n,i){var r,a,s,c,h,_,f,v,p,m,y,g,b,w,x,k,Z,A=!1,S=!1,T=!1,M="",C=!1,z=!1,E=!1,R=!1,B=!1,N="",O="",D=Math.abs(e),I=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],P=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],V="",L=!1,j=!1;if(0===e&&null!==u)return u;if(!isFinite(e))return""+e;if(0===t.indexOf("{")){var U=t.indexOf("}");if(-1===U)throw Error('Format should also contain a "}"');g=t.slice(1,U),t=t.slice(U+1)}else g="";if(t.indexOf("}")===t.length-1){var F=t.indexOf("{");if(-1===F)throw Error('Format should also contain a "{"');b=t.slice(F+1,-1),t=t.slice(0,F+1)}else b="";if(k=null===(Z=-1===t.indexOf(".")?t.match(/([0-9]+).*/):t.match(/([0-9]+)\..*/))?-1:Z[1].length,-1!==t.indexOf("-")&&(L=!0),t.indexOf("(")>-1?(A=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(S=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1){if(m=t.split(".")[0].match(/[0-9]+/g)||["0"],m=parseInt(m[0],10),C=t.indexOf("aK")>=0,z=t.indexOf("aM")>=0,E=t.indexOf("aB")>=0,R=t.indexOf("aT")>=0,B=C||z||E||R,t.indexOf(" a")>-1?(M=" ",t=t.replace(" a","")):t=t.replace("a",""),f=0===(f=(h=Math.floor(Math.log(D)/Math.LN10)+1)%3)?3:f,m&&0!==D&&(_=Math.floor(Math.log(D)/Math.LN10)+1-m,v=3*~~((Math.min(m,h)-f)/3),D/=Math.pow(10,v),-1===t.indexOf(".")&&m>3))for(t+="[.]",x=(x=0===_?0:3*~~(_/3)-_)<0?x+3:x,r=0;r<x;r++)t+="0";Math.floor(Math.log(Math.abs(e))/Math.LN10)+1!==m&&(D>=Math.pow(10,12)&&!B||R?(M+=o[l].abbreviations.trillion,e/=Math.pow(10,12)):D<Math.pow(10,12)&&D>=Math.pow(10,9)&&!B||E?(M+=o[l].abbreviations.billion,e/=Math.pow(10,9)):D<Math.pow(10,9)&&D>=Math.pow(10,6)&&!B||z?(M+=o[l].abbreviations.million,e/=Math.pow(10,6)):(D<Math.pow(10,6)&&D>=Math.pow(10,3)&&!B||C)&&(M+=o[l].abbreviations.thousand,e/=Math.pow(10,3)))}if(t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(N=" ",t=t.replace(" b","")):t=t.replace("b",""),c=0;c<=I.length;c++)if(a=Math.pow(1024,c),s=Math.pow(1024,c+1),e>=a&&e<s){N+=I[c],a>0&&(e/=a);break}if(t.indexOf("d")>-1)for(t.indexOf(" d")>-1?(N=" ",t=t.replace(" d","")):t=t.replace("d",""),c=0;c<=P.length;c++)if(a=Math.pow(1e3,c),s=Math.pow(1e3,c+1),e>=a&&e<s){N+=P[c],a>0&&(e/=a);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(O=" ",t=t.replace(" o","")):t=t.replace("o",""),o[l].ordinal&&(O+=o[l].ordinal(e))),t.indexOf("[.]")>-1&&(T=!0,t=t.replace("[.]",".")),p=e.toString().split(".")[0],y=t.split(".")[1],w=t.indexOf(","),y?(p=(V=-1!==y.indexOf("*")?d(e,e.toString().split(".")[1].length,n):y.indexOf("[")>-1?d(e,(y=(y=y.replace("]","")).split("["))[0].length+y[1].length,n,y[1].length):d(e,y.length,n)).split(".")[0],V=V.split(".")[1].length?(i?M+i:o[l].delimiters.decimal)+V.split(".")[1]:"",T&&0===Number(V.slice(1))&&(V="")):p=d(e,null,n),p.indexOf("-")>-1&&(p=p.slice(1),j=!0),p.length<k&&(p=new Array(k-p.length+1).join("0")+p),w>-1&&(p=p.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+o[l].delimiters.thousands)),0===t.indexOf(".")&&(p=""),g+(t.indexOf("(")<t.indexOf("-")?(A&&j?"(":"")+(L&&j||!A&&j?"-":""):(L&&j||!A&&j?"-":"")+(A&&j?"(":""))+(!j&&S&&0!==e?"+":"")+p+V+(O||"")+(M&&!i?M:"")+(N||"")+(A&&j?")":"")+b}function v(e,t){o[e]=t}function p(e){l=e;var t=o[e].defaults;t&&t.format&&a.defaultFormat(t.format),t&&t.currencyFormat&&a.defaultCurrencyFormat(t.currencyFormat)}void 0!==t&&t.exports,(a=function(e){return a.isNumbro(e)?e=e.value():0===e||void 0===e?e=0:Number(e)||(e=a.fn.unformat(e)),new h(Number(e))}).version="1.6.2",a.isNumbro=function(e){return e instanceof h}
2,a.setLanguage=function(e,t){console.warn("`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead");var n=e,i=e.split("-")[0],r=null;s[n]||(Object.keys(s).forEach((function(e){r||e.split("-")[0]!==i||(r=e)})),n=r||t||"en-US"),p(n)},a.setCulture=function(e,t){var n=e,i=e.split("-")[1],r=null;o[n]||(i&&Object.keys(o).forEach((function(e){r||e.split("-")[1]!==i||(r=e)})),n=r||t||"en-US"),p(n)},a.language=function(e,t){if(console.warn("`language` is deprecated since version 1.6.0. Use `culture` instead"),!e)return l;if(e&&!t){if(!s[e])throw new Error("Unknown language : "+e);p(e)}return!t&&s[e]||v(e,t),a},a.culture=function(e,t){if(!e)return l;if(e&&!t){if(!o[e])throw new Error("Unknown culture : "+e);p(e)}return!t&&o[e]||v(e,t),a},a.languageData=function(e){if(console.warn("`languageData` is deprecated since version 1.6.0. Use `cultureData` instead"),!e)return s[l];if(!s[e])throw new Error("Unknown language : "+e);return s[e]},a.cultureData=function(e){if(!e)return o[l];if(!o[e])throw new Error("Unknown culture : "+e);return o[e]},a.culture("en-US",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$",position:"prefix"},defaults:{currencyFormat:",0000 a"},formats:{fourDigits:"0000 a",fullWithTwoDecimals:"$ ,0.00",fullWithTwoDecimalsNoCurrency:",0.00"}}),a.languages=function(){return console.warn("`languages` is deprecated since version 1.6.0. Use `cultures` instead"),s},a.cultures=function(){return o},a.zeroFormat=function(e){u="string"==typeof e?e:null},a.defaultFormat=function(e){c="string"==typeof e?e:"0.0"},a.defaultCurrencyFormat=function(e){},a.validate=function(e,t){var n,i,r,o,s,l,u,c;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numbro.js: Value is not string. It has been co-erced to: ",e)),(e=e.trim()).match(/^\d+$/))return!0;if(""===e)return!1;try{u=a.cultureData(t)}catch(e){u=a.cultureData(a.culture())}return r=u.currency.symbol,s=u.abbreviations,n=u.delimiters.decimal,i="."===u.delimiters.thousands?"\\.":u.delimiters.thousands,(null===(c=e.match(/^[^\d]+/))||(e=e.substr(1),c[0]===r))&&(null===(c=e.match(/[^\d]+$/))||(e=e.slice(0,-1),c[0]===s.thousand||c[0]===s.million||c[0]===s.billion||c[0]===s.trillion))&&(l=new RegExp(i+"{2}"),!e.match(/[^\d.,]/g)&&!((o=e.split(n)).length>2)&&(o.length<2?!!o[0].match(/^\d+.*\d$/)&&!o[0].match(l):1===o[0].length?!!o[0].match(/^\d+$/)&&!o[0].match(l)&&!!o[1].match(/^\d+$/):!!o[0].match(/^\d+.*\d$/)&&!o[0].match(l)&&!!o[1].match(/^\d+$/)))},t.exports={format:function(e,t,n,i){return null!=n&&n!==a.culture()&&a.setCulture(n),function(e,t,n){var i;return i=t.indexOf("$")>-1?function(e,t,n){var i,r,a=t,s=a.indexOf("$"),u=a.indexOf("("),c=a.indexOf("+"),h=a.indexOf("-"),_="",d="";if(-1===a.indexOf("$")?"infix"===o[l].currency.position?(d=o[l].currency.symbol,o[l].currency.spaceSeparated&&(d=" "+d+" ")):o[l].currency.spaceSeparated&&(_=" "):a.indexOf(" $")>-1?(_=" ",a=a.replace(" $","")):a.indexOf("$ ")>-1?(_=" ",a=a.replace("$ ","")):a=a.replace("$",""),r=f(e,a,n,d),-1===t.indexOf("$"))switch(o[l].currency.position){case"postfix":r.indexOf(")")>-1?((r=r.split("")).splice(-1,0,_+o[l].currency.symbol),r=r.join("")):r=r+_+o[l].currency.symbol;break;case"infix":break;case"prefix":r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),i=Math.max(u,h)+1,r.splice(i,0,o[l].currency.symbol+_),r=r.join("")):r=o[l].currency.symbol+_+r;break;default:throw Error('Currency position should be among ["prefix", "infix", "postfix"]')}else s<=1?r.indexOf("(")>-1||r.indexOf("+")>-1||r.indexOf("-")>-1?(i=1,(s<u||s<c||s<h)&&(i=0),(r=r.split("")).splice(i,0,o[l].currency.symbol+_),r=r.join("")):r=o[l].currency.symbol+_+r:r.indexOf(")")>-1?((r=r.split("")).splice(-1,0,_+o[l].currency.symbol),r=r.join("")):r=r+_+o[l].currency.symbol;return r}(e,t,n):t.indexOf("%")>-1?function(e,t,n){var i,r="";return e*=100,t.indexOf(" %")>-1?(r=" ",t=t.replace(" %","")):t=t.replace("%",""),(i=f(e,t,n)).indexOf(")")>-1?((i=i.split("")).splice(-1,0,r+"%"),i=i.join("")):i=i+r+"%",i}
2(e,t,n):t.indexOf(":")>-1?function(e){var t=Math.floor(e/60/60),n=Math.floor((e-60*t*60)/60),i=Math.round(e-60*t*60-60*n);return t+":"+(n<10?"0"+n:n)+":"+(i<10?"0"+i:i)}(e):f(e,t,n),i}(Number(e),null!=t?t:c,null==i?Math.round:i)}}},function(e,t,i,r,a){!function(){var e={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 t(e){return a(s(e),arguments)}function r(e,n){return t.apply(null,[e].concat(n||[]))}function a(n,i){var r,a,o,s,l,u,c,h,_,d=1,f=n.length,v="";for(a=0;a<f;a++)if("string"==typeof n[a])v+=n[a];else if("object"==typeof n[a]){if((s=n[a]).keys)for(r=i[d],o=0;o<s.keys.length;o++){if(null==r)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));r=r[s.keys[o]]}else r=s.param_no?i[s.param_no]:i[d++];if(e.not_type.test(s.type)&&e.not_primitive.test(s.type)&&r instanceof Function&&(r=r()),e.numeric_arg.test(s.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(t("[sprintf] expecting number but found %T",r));switch(e.number.test(s.type)&&(h=r>=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}e.json.test(s.type)?v+=r:(!e.number.test(s.type)||h&&!s.sign?_="":(_=h?"+":"-",r=r.toString().replace(e.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(_+r).length,l=s.width&&c>0?u.repeat(c):"",v+=s.align?_+r+l:"0"===u?_+l+r:l+_+r)}return v}var o=Object.create(null);function s(t){if(o[t])return o[t];for(var n,i=t,r=[],a=0;i;){if(null!==(n=e.text.exec(i)))r.push(n[0]);else if(null!==(n=e.modulo.exec(i)))r.push("%");else{if(null===(n=e.placeholder.exec(i)))throw new SyntaxError("[sprintf] unexpected placeholder");if(n[2]){a|=1;var s=[],l=n[2],u=[];if(null===(u=e.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=e.key_access.exec(l)))s.push(u[1]);else{if(null===(u=e.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}n[2]=s}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:n[0],param_no:n[1],keys:n[2],sign:n[3],pad_char:n[4],align:n[5],width:n[6],precision:n[7],type:n[8]})}i=i.substring(n[0].length)}return o[t]=r}void 0!==i&&(i.sprintf=t,i.vsprintf=r),"undefined"!=typeof window&&(window.sprintf=t,window.vsprintf=r,"function"==typeof define&&n.amdO&&define((function(){return{sprintf:t,vsprintf:r}})))}()},function(e,t,n,i,r){var a;i();var o=e(9),s=e(148),l=e(156),u=e(157),c=e(160),h=e(161),_=e(159),d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.CompositeTicker);n.DatetimeTicker=d,a=d,d.__name__="DatetimeTicker",a.override({num_minor_ticks:0,tickers:function(){return[new s.AdaptiveTicker({mantissas:[1,2,5],base:10,min_interval:0,max_interval:500*_.ONE_MILLI,num_minor_ticks:0}),new s.AdaptiveTicker({mantissas:[1,2,5,10,15,20,30],base:60,min_interval:_.ONE_SECOND,max_interval:30*_.ONE_MINUTE,num_minor_ticks:0}),new s.AdaptiveTicker({mantissas:[1,2,4,6,8,12],base:24,min_interval:_.ONE_HOUR,max_interval:12*_.ONE_HOUR,num_minor_ticks:0}),new u.DaysTicker({days:(0,o.range)(1,32)}),new u.DaysTicker({days:(0,o.range)(1,31,3)}),new u.DaysTicker({days:[1,8,15,22]}),new u.DaysTicker({days:[1,15]}),new c.MonthsTicker({months:(0,o.range)(0,12,1)}),new c.MonthsTicker({months:(0,o.range)(0,12,2)}),new c.MonthsTicker({months:(0,o.range)(0,12,4)}),new c.MonthsTicker({months:(0,o.range)(0,12,6)}),new h.YearsTicker({})]}})},function(e,t,n,i,r){var a;i();var o=e(149),s=e(9),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"min_intervals",get:function(){return this.tickers.map((function(e){return e.get_min_interval()}))}},{key:"max_intervals",get:function(){return this.tickers.map((function(e){return e.get_max_interval()}))}},{key:"get_min_interval",value:function(){return this.min_intervals[0]}},{key:"get_max_interval",value:function(){return this.max_intervals[0]}},{key:"get_best_ticker",value:function(e,t,n){var i,r=t-e,a=this.get_ideal_interval(e,t,n),o=[(0,s.sorted_index)(this.min_intervals,a)-1,(0,s.sorted_index)(this.max_intervals,a)],l=[this.min_intervals[o[0]],this.max_intervals[o[1]]].map((function(e){return Math.abs(n-r/e)}));if((0,s.is_empty)(l.filter((function(e){return!isNaN(e)}))))i=this.tickers[0];else{var u=o[(0,s.argmin)(l)];i=this.tickers[u]}return i}},{key:"get_interval",value:function(e,t,n){return this.get_best_ticker(e,t,n).get_interval(e,t,n)}},{key:"get_ticks_no_defaults",value:function(e,t,n,i){return this.get_best_ticker(e,t,i).get_ticks_no_defaults(e,t,n,i)}}]),n}(o.ContinuousTicker);n.CompositeTicker=l,a=l,l.__name__="CompositeTicker",a.define((function(e){return{tickers:[(0,e.Array)((0,e.Ref)(o.ContinuousTicker)),[]]}}))},function(e,t,n,i,r){var a;i();var o=e(158),s=e(159),l=e(9),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this);var e=this.days;e.length>1?this.interval=(e[1]-e[0])*s.ONE_DAY:this.interval=31*s.ONE_DAY}},{key:"get_ticks_no_defaults",value:function(e,t,n,i){var r=function(e,t){var n=(0,s.last_month_no_later_than)(new Date(e)),i=(0,s.last_month_no_later_than)(new Date(t));i.setUTCMonth(i.getUTCMonth()+1);for(var r=[],a=n;r.push((0,s.copy_date)(a)),a.setUTCMonth(a.getUTCMonth()+1),!(a>i););return r}(e,t),a=this.days,o=this.interval,u=(0,l.concat)(r.map((function(e){return function(e,t){var n,i=e.getUTCMonth(),r=[],o=(0,w.Z)(a);try{for(o.s();!(n=o.n()).done;
2){var l=n.value,u=(0,s.copy_date)(e);u.setUTCDate(l),new Date(u.getTime()+t/2).getUTCMonth()==i&&r.push(u)}}catch(c){o.e(c)}finally{o.f()}return r}(e,o)})));return{major:u.map((function(e){return e.getTime()})).filter((function(n){return e<=n&&n<=t})),minor:[]}}}]),n}(o.SingleIntervalTicker);n.DaysTicker=u,a=u,u.__name__="DaysTicker",a.define((function(e){var t=e.Int;return{days:[(0,e.Array)(t),[]]}})),a.override({num_minor_ticks:0})},function(e,t,n,i,r){var a;i();var o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_interval",value:function(e,t,n){return this.interval}},{key:"get_min_interval",value:function(){return this.interval}},{key:"get_max_interval",value:function(){return this.interval}}]),n}(e(149).ContinuousTicker);n.SingleIntervalTicker=o,a=o,o.__name__="SingleIntervalTicker",a.define((function(e){return{interval:[e.Number]}}))},function(e,t,n,i,r){function a(e){return new Date(e.getTime())}function o(e){var t=a(e);return t.setUTCDate(1),t.setUTCHours(0),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),t}i(),n.ONE_MILLI=1,n.ONE_SECOND=1e3,n.ONE_MINUTE=60*n.ONE_SECOND,n.ONE_HOUR=60*n.ONE_MINUTE,n.ONE_DAY=24*n.ONE_HOUR,n.ONE_MONTH=30*n.ONE_DAY,n.ONE_YEAR=365*n.ONE_DAY,n.copy_date=a,n.last_month_no_later_than=o,n.last_year_no_later_than=function(e){var t=o(e);return t.setUTCMonth(0),t}},function(e,t,n,i,r){var a;i();var o=e(158),s=e(159),l=e(9),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this);var e=this.months;e.length>1?this.interval=(e[1]-e[0])*s.ONE_MONTH:this.interval=12*s.ONE_MONTH}},{key:"get_ticks_no_defaults",value:function(e,t,n,i){var r=function(e,t){var n=(0,s.last_year_no_later_than)(new Date(e)),i=(0,s.last_year_no_later_than)(new Date(t));i.setUTCFullYear(i.getUTCFullYear()+1);for(var r=[],a=n;r.push((0,s.copy_date)(a)),a.setUTCFullYear(a.getUTCFullYear()+1),!(a>i););return r}(e,t),a=this.months;return{major:(0,l.concat)(r.map((function(e){return a.map((function(t){var n=(0,s.copy_date)(e);return n.setUTCMonth(t),n}))}))).map((function(e){return e.getTime()})).filter((function(n){return e<=n&&n<=t})),minor:[]}}}]),n}(o.SingleIntervalTicker);n.MonthsTicker=u,a=u,u.__name__="MonthsTicker",a.define((function(e){var t=e.Int;return{months:[(0,e.Array)(t),[]]}}))},function(e,t,n,i,r){i();var a=e(147),o=e(158),s=e(159),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.interval=s.ONE_YEAR,this.basic_ticker=new a.BasicTicker({num_minor_ticks:0})}},{key:"get_ticks_no_defaults",value:function(e,t,n,i){var r=(0,s.last_year_no_later_than)(new Date(e)).getUTCFullYear(),a=(0,s.last_year_no_later_than)(new Date(t)).getUTCFullYear();return{major:this.basic_ticker.get_ticks_no_defaults(r,a,n,i).major.map((function(e){return Date.UTC(e,0,1)})).filter((function(n){return e<=n&&n<=t})),minor:[]}}}]),n}(o.SingleIntervalTicker);n.YearsTicker=l,l.__name__="YearsTicker"},function(e,t,n,i,r){var a;i();var o=e(143),s=e(163),l=e(164),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(o.ContinuousAxisView);n.LogAxisView=u,u.__name__="LogAxisView";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.ContinuousAxis);n.LogAxis=c,a=c,c.__name__="LogAxis",a.prototype.default_view=u,a.override({ticker:function(){return new l.LogTicker},formatter:function(){return new s.LogTickFormatter}})},function(e,t,n,i,r){var a;i();var o=e(131),s=e(146),l=e(164),u=e(120),c=Math.abs,h=Math.log,f=Math.round,m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.basic_formatter=new s.BasicTickFormatter}},{key:"format_graphics",value:function(e,t){var n,i,r=this;if(0==e.length)return[];var a=null!==(i=null===(n=this.ticker)||void 0===n?void 0:n.base)&&void 0!==i?i:10,o=this._exponents(e,a);return null==o?this.basic_formatter.format_graphics(e,t):o.map((function(e){if(c(e)<r.min_exponent){var t=new u.TextBox({text:(0,s.unicode_replace)("".concat(Math.pow(a,e)))}),n=new u.TextBox({text:""});return new u.BaseExpo(t,n)}var i=new u.TextBox({text:(0,s.unicode_replace)("".concat(a))}),o=new u.TextBox({text:(0,s.unicode_replace)("".concat(e))});return new u.BaseExpo(i,o)}))}},{key:"_exponents",value:function(e,t){var n,i=null,r=[],a=(0,w.Z)(e);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=f(h(o)/h(t));if(i==s)return null;i=s,r.push(s)}}catch(l){a.e(l)}finally{a.f()}return r}},{key:"doFormat",value:function(e,t){var n,i,r=this;if(0==e.length)return[];var a=null!==(i=null===(n=this.ticker)||void 0===n?void 0:n.base)&&void 0!==i?i:10,o=this._exponents(e,a);return null==o?this.basic_formatter.doFormat(e,t):o.map((function(e){return c(e)<r.min_exponent?(0,s.unicode_replace)("".concat(Math.pow(a,e))):(0,s.unicode_replace)("".concat(a,"^").
2concat(e))}))}}]),n}(o.TickFormatter);n.LogTickFormatter=m,a=m,m.__name__="LogTickFormatter",a.define((function(e){var t=e.Int,n=e.Ref;return{ticker:[(0,e.Nullable)(n(l.LogTicker)),null],min_exponent:[t,0]}}))},function(e,t,n,i,r){var a;i();var o=e(148),s=e(9),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_ticks_no_defaults",value:function(e,t,n,i){var r,a=this.num_minor_ticks,o=[],l=this.base,u=Math.log(e)/Math.log(l),c=Math.log(t)/Math.log(l),h=c-u;if(isFinite(h))if(h<2){var _=this.get_interval(e,t,i),d=Math.floor(e/_),f=Math.ceil(t/_);if(r=(0,s.range)(d,f+1).filter((function(e){return 0!=e})).map((function(e){return e*_})).filter((function(n){return e<=n&&n<=t})),a>0&&r.length>0){var v,p=_/a,m=(0,s.range)(0,a).map((function(e){return e*p})),y=(0,w.Z)(m.slice(1));try{for(y.s();!(v=y.n()).done;){var g=v.value;o.push(r[0]-g)}}catch(j){y.e(j)}finally{y.f()}var b,x=(0,w.Z)(r);try{for(x.s();!(b=x.n()).done;){var k,Z=b.value,A=(0,w.Z)(m);try{for(A.s();!(k=A.n()).done;){var S=k.value;o.push(Z+S)}}catch(j){A.e(j)}finally{A.f()}}}catch(j){x.e(j)}finally{x.f()}}}else{var T=Math.ceil(.999999*u),M=Math.floor(1.000001*c),C=Math.ceil((M-T)/9);if(r=(0,s.range)(T-1,M+1,C).map((function(e){return Math.pow(l,e)})),a>0&&r.length>0){var z,E=Math.pow(l,C)/a,R=(0,s.range)(1,a+1).map((function(e){return e*E})),B=(0,w.Z)(R);try{for(B.s();!(z=B.n()).done;){var N=z.value;o.push(r[0]/N)}}catch(j){B.e(j)}finally{B.f()}o.push(r[0]);var O,D=(0,w.Z)(r);try{for(D.s();!(O=D.n()).done;){var I,P=O.value,V=(0,w.Z)(R);try{for(V.s();!(I=V.n()).done;){var L=I.value;o.push(P*L)}}catch(j){V.e(j)}finally{V.f()}}}catch(j){D.e(j)}finally{D.f()}}}else r=[];return{major:r.filter((function(n){return e<=n&&n<=t})),minor:o.filter((function(n){return e<=n&&n<=t}))}}}]),n}(o.AdaptiveTicker);n.LogTicker=l,a=l,l.__name__="LogTicker",a.override({mantissas:[1,5]})},function(e,t,n,i,r){var a;i();var o=e(128),s=e(145),l=e(166),u=e(167),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(o.AxisView);n.MercatorAxisView=c,c.__name__="MercatorAxisView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.LinearAxis);n.MercatorAxis=h,a=h,h.__name__="MercatorAxis",a.prototype.default_view=c,a.override({ticker:function(){return new u.MercatorTicker({dimension:"lat"})},formatter:function(){return new l.MercatorTickFormatter({dimension:"lat"})}})},function(e,t,n,i,r){var a;i();var o=e(146),s=e(20),l=e(78),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"doFormat",value:function(e,t){if(null==this.dimension)throw new Error("MercatorTickFormatter.dimension not configured");if(0==e.length)return[];var i=e.length,r=new Array(i);if("lon"==this.dimension)for(var a=0;a<i;a++){var o=l.wgs84_mercator.invert(e[a],t.loc),s=(0,k.Z)(o,1)[0];r[a]=s}else for(var u=0;u<i;u++){var c=l.wgs84_mercator.invert(t.loc,e[u]),h=(0,k.Z)(c,2)[1];r[u]=h}return(0,_.Z)((0,d.Z)(n.prototype),"doFormat",this).call(this,r,t)}}]),n}(o.BasicTickFormatter);n.MercatorTickFormatter=u,a=u,u.__name__="MercatorTickFormatter",a.define((function(e){return{dimension:[(0,e.Nullable)(s.LatLon),null]}}))},function(e,t,n,i,r){var a;i();var o=e(147),s=e(20),l=e(78),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_ticks_no_defaults",value:function(e,t,n,i){var r,a;if(null==this.dimension)throw new Error("".concat(this,".dimension wasn't configured"));return r=(0,l.clip_mercator)(e,t,this.dimension),e=(a=(0,k.Z)(r,2))[0],t=a[1],"lon"==this.dimension?this._get_ticks_lon(e,t,n,i):this._get_ticks_lat(e,t,n,i)}},{key:"_get_ticks_lon",value:function(e,t,i,r){var a,o=l.wgs84_mercator.invert(e,i),s=(0,k.Z)(o,1)[0],u=l.wgs84_mercator.invert(t,i),c=(0,k.Z)(u,2),h=c[0],f=c[1],v=(0,_.Z)((0,d.Z)(n.prototype),"get_ticks_no_defaults",this).call(this,s,h,i,r),p=[],m=(0,w.Z)(v.major);try{for(m.s();!(a=m.n()).done;){var y=a.value;if((0,l.in_bounds)(y,"lon")){var g=l.wgs84_mercator.compute(y,f),b=(0,k.Z)(g,1)[0];p.push(b)}}}catch(C){m.e(C)}finally{m.f()}var x,Z=[],A=(0,w.Z)(v.minor);try{for(A.s();!(x=A.n()).done;){var S=x.value;if((0,l.in_bounds)(S,"lon")){var T=l.wgs84_mercator.compute(S,f),M=(0,k.Z)(T,1)[0];Z.push(M)}}}catch(C){A.e(C)}finally{A.f()}return{major:p,minor:Z}}},{key:"_get_ticks_lat",value:function(e,t,i,r){var a,o=l.wgs84_mercator.invert(i,e),s=(0,k.Z)(o,2)[1],u=l.wgs84_mercator.invert(i,t),c=(0,k.Z)(u,2),h=c[0],f=c[1],v=(0,_.Z)((0,d.Z)(n.prototype),"get_ticks_no_defaults",this).call(this,s,f,i,r),p=[],m=(0,w.Z)(v.major);try{for(m.s();!(a=m.n()).done;){var y=a.value;if((0,l.in_bounds)(y,"lat")){var g=l.wgs84_mercator.compute(h,y),b=(0,k.Z)(g,2)[1];p.push(b)}}}catch(C){m.e(C)}finally{m.f()}var x,Z=[],A=(0,w.Z)(v.minor);try{for(A.s();!(x=A.n()).done;){var S=x.value;if((0,l.in_bounds)(S,"lat")){var T=l.wgs84_mercator.compute(h,S),M=(0,k.Z)(T,2)[1];Z.push(M)}}}catch(C){A.e(C)}finally{A.f()}return{major:p,minor:Z}}}]),n}(o.BasicTicker);n.MercatorTicker=u,a=u,u.__name__="MercatorTicker",a.define((function(e){return{dimension:[(0,e.Nullable)(s.LatLon),null]}}))},function(e,t,n,i,r){i(),r("AdaptiveTicker",e(148).AdaptiveTicker),r("BasicTicker",e(147).BasicTicker),r("CategoricalTicker",e(141).CategoricalTicker),r("CompositeTicker",e(156).CompositeTicker),r("ContinuousTicker",e(149).ContinuousTicker),r("DatetimeTicker",e(155).DatetimeTicker),r("DaysTicker",e(157).DaysTicker),r("FixedTicker",e(169).FixedTicker),r("LogTicker",e(164).LogTicker),r("MercatorTicker",e(167).MercatorTicker),r("MonthsTicker",e(160).MonthsTicker),r("SingleIntervalTicker",e(158).SingleIntervalTicker),r("Ticker",e(130).Ticker),r("YearsTicker",e(161).YearsTicker),r("BinnedTicker",e(170).BinnedTicker)},function(e,t,n,i,r){var a;i();var o=e(149),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_ticks_no_defaults",value:function(e,t,n,i){return{major:this.ticks,minor:this.minor_ticks}}},{key:"get_interval",value:function(e,t,n){return 0}},{key:"get_min_interval",value:function(){return 0}},{key:"get_max_interval",value:function(){return 0}}]),n}(o.ContinuousTicker);n.FixedTicker=s,a=s,s.__name__="FixedTicker",a.define((function(e){var t=e.Number,n=e.Array;return{ticks:[n(t),[]],minor_ticks:[n(t),[]]}}))},function(e,t,n,i,r){var a;i();var o=e(130),s=e(171),l=e(12),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_ticks",value:function(e,t,n,i){for(var r=this.mapper.metrics.binning,a=Math.max(0,(0,l.left_edge_index)(e,r)),o=Math.min((0,l.left_edge_index)(t,r)+1,r.length-1),s=[],u=a;u<=o;u++)s.push(r[u]);for(var c=this.num_major_ticks,h=[],_="auto"==c?s.length:c,d=Math.max(1,Math.floor(s.length/_)),f=0;f<s.length;f+=d)h.push(s[f]);return{major:h,minor:[]}}}]),n}(o.Ticker);n.BinnedTicker=u,a=u,u.__name__="BinnedTicker",a.define((function(e){var t=e.Number,n=e.Ref,i=e.Or,r=e.Auto;return{mapper:[n(s.ScanningColorMapper)],num_major_ticks:[i(t,r),8]}}))},function(e,t,n,i,r){i();var a=e(172),o=e(12),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"cmap",value:function(e,t,n,i,r){return e<r.binning[0]?n:e>r.binning[r.binning.length-1]?i:t[(0,o.left_edge_index)(e,r.binning)]}}]),n}(a.ContinuousColorMapper);n.ScanningColorMapper=s,s.__name__="ScanningColorMapper"},function(e,t,n,i,r){var a;i();var o=e(173),s=e(175),l=e(9),u=e(8),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e))._scan_data=null,i}
2return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this);var t=function(){var t,n=(0,w.Z)(e.domain);try{for(n.s();!(t=n.n()).done;){var i=(0,k.Z)(t.value,1)[0];e.connect(i.view.change,(function(){return e.update_data()})),e.connect(i.data_source.selected.change,(function(){return e.update_data()}))}}catch(r){n.e(r)}finally{n.f()}};this.connect(this.properties.domain.change,(function(){return t()})),t()}},{key:"update_data",value:function(){var e=this.domain,t=this.palette,n=(0,y.Z)(this._collect(e));this._scan_data=this.scan(n,t.length),this.metrics_change.emit(),this.change.emit()}},{key:"metrics",get:function(){return null==this._scan_data&&this.update_data(),this._scan_data}},{key:"_collect",value:(0,x.Z)().mark((function e(t){var n,i,r,a,o,s,c,h;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=(0,w.Z)(t),e.prev=1,n.s();case 3:if((i=n.n()).done){e.next=23;break}r=(0,k.Z)(i.value,2),a=r[0],o=r[1],s=(0,w.Z)((0,u.isArray)(o)?o:[o]),e.prev=6,h=(0,x.Z)().mark((function e(){var t,n,i,r,o,s,h,_;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.value,n=a.data_source.get_column(t),n=a.view.indices.select(n),i=a.view.masked,r=a.data_source.selected.indices,null!=i&&r.length>0?o=(0,l.intersection)((0,y.Z)(i),r):null!=i?o=(0,y.Z)(i):r.length>0&&(o=r),null!=o&&(n=(0,l.map)(o,(function(e){return n[e]}))),!(n.length>0)||(0,u.isNumber)(n[0])){e.next=23;break}s=(0,w.Z)(n),e.prev=6,s.s();case 8:if((h=s.n()).done){e.next=13;break}return _=h.value,e.delegateYield(_,"t0",11);case 11:e.next=8;break;case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(6),s.e(e.t1);case 18:return e.prev=18,s.f(),e.finish(18);case 21:e.next=24;break;case 23:return e.delegateYield(n,"t2",24);case 24:case"end":return e.stop()}}),e,null,[[6,15,18,21]])})),s.s();case 9:if((c=s.n()).done){e.next=13;break}return e.delegateYield(h(),"t0",11);case 11:e.next=9;break;case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(6),s.e(e.t1);case 18:return e.prev=18,s.f(),e.finish(18);case 21:e.next=3;break;case 23:e.next=28;break;case 25:e.prev=25,e.t2=e.catch(1),n.e(e.t2);case 28:return e.prev=28,n.f(),e.finish(28);case 31:case"end":return e.stop()}}),e,null,[[1,25,28,31],[6,15,18,21]])}))},{key:"_v_compute",value:function(e,t,n,i){var r=i.nan_color,a=i.low_color,o=i.high_color;null==a&&(a=n[0]),null==o&&(o=n[n.length-1]);var s=this.domain,u=(0,l.is_empty)(s)?e:(0,y.Z)(this._collect(s));this._scan_data=this.scan(u,n.length),this.metrics_change.emit();for(var c=0,h=e.length;c<h;c++){var _=e[c];isNaN(_)?t[c]=r:t[c]=this.cmap(_,n,a,o,this._scan_data)}}},{key:"_colors",value:function(e){return Object.assign(Object.assign({},(0,_.Z)((0,d.Z)(n.prototype),"_colors",this).call(this,e)),{low_color:null!=this.low_color?e(this.low_color):void 0,high_color:null!=this.high_color?e(this.high_color):void 0})}}]),n}(o.ColorMapper);n.ContinuousColorMapper=c,a=c,c.__name__="ContinuousColorMapper",a.define((function(e){var t=e.Number,n=e.String,i=e.Ref,r=e.Color,a=e.Or,o=e.Tuple,l=e.Array,u=e.Nullable;return{high:[u(t),null],low:[u(t),null],high_color:[u(r),null],low_color:[u(r),null],domain:[l(o(i(s.GlyphRenderer),a(n,l(n)))),[]]}}))},function(e,t,n,i,r){var a;i();var o=e(174),s=e(15),l=e(24),u=e(22),c=e(27);function h(e){return(0,u.encode_rgba)((0,u.color2rgba)(e))}function f(e){for(var t=new Uint32Array(e.length),n=0,i=e.length;n<i;n++)t[n]=h(e[n]);return t}n._convert_color=h,n._convert_palette=f;var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.metrics_change=new s.Signal0(this,"metrics_change")}},{key:"v_compute",value:function(e){var t=new Array(e.length);return this._v_compute(e,t,this.palette,this._colors((function(e){return e}))),t}},{key:"rgba_mapper",get:function(){var e=this,t=f(this.palette),n=this._colors(h);return{v_compute:function(i){var r=new l.ColorArray(i.length);return e._v_compute(i,r,t,n),new Uint8ClampedArray((0,c.to_big_endian)(r).buffer)}}}},{key:"_colors",value:function(e){return{nan_color:e(this.nan_color)}}}]),n}(o.Mapper);n.ColorMapper=m,a=m,m.__name__="ColorMapper",a.define((function(e){var t=e.Color;return{palette:[(0,e.Array)(t)],nan_color:[t,"gray"]}}))},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}
2return(0,b.Z)(n,[{key:"compute",value:function(e){throw new Error("mapping single values is not supported")}}]),n}(e(56).Transform);n.Mapper=a,a.__name__="Mapper"},function(e,t,n,i,r){var a;i();var o=e(176),s=e(177),l=e(186),u=e(187),c=e(189),h=e(179),f=e(70),m=e(190),A=e(24),S=e(12),T=e(13),M=e(113),C=e(67),z={fill:{},line:{}},E={fill:{fill_alpha:.3,fill_color:"grey"},line:{line_alpha:.3,line_color:"grey"}},R={fill:{fill_alpha:.2},line:{}},B={fill:{fill_alpha:.2},line:{}},N=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"glyph_view",get:function(){return this.glyph}},{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,i,r,a,o,s,l,u,c,f,v,p,m;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=function(e,t){return t instanceof h.Glyph?t:s("auto"==t?e:{fill:{},line:{}})},s=function(e){var t=(0,T.clone)(o);return r&&(0,T.extend)(t,e.fill),a&&(0,T.extend)(t,e.line),new i.constructor(t)},e.next=4,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 4:return i=this.model.glyph,e.next=7,this.build_glyph_view(i);case 7:return this.glyph=e.sent,r="fill"in this.glyph.visuals,a="line"in this.glyph.visuals,delete(o=Object.assign({},i.attributes)).id,u=this.model,c=u.selection_glyph,f=u.nonselection_glyph,v=u.hover_glyph,p=u.muted_glyph,c=l(z,c),e.next=14,this.build_glyph_view(c);case 14:return this.selection_glyph=e.sent,f=l(R,f),e.next=18,this.build_glyph_view(f);case 18:if(this.nonselection_glyph=e.sent,e.t0=null!=v,!e.t0){e.next=24;break}return e.next=23,this.build_glyph_view(v);case 23:this.hover_glyph=e.sent;case 24:return p=l(B,p),e.next=27,this.build_glyph_view(p);case 27:return this.muted_glyph=e.sent,m=l(E,"auto"),e.next=31,this.build_glyph_view(m);case 31:this.decimated_glyph=e.sent,this.selection_glyph.set_base(this.glyph),this.nonselection_glyph.set_base(this.glyph),null===(t=this.hover_glyph)||void 0===t||t.set_base(this.glyph),this.muted_glyph.set_base(this.glyph),this.decimated_glyph.set_base(this.glyph),this.set_data();case 38:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"build_glyph_view",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(t){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,M.build_view)(t,{parent:this}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"remove",value:function(){var e;this.glyph.remove(),this.selection_glyph.remove(),this.nonselection_glyph.remove(),null===(e=this.hover_glyph)||void 0===e||e.remove(),this.muted_glyph.remove(),this.decimated_glyph.remove(),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this);var t=function(){return e.request_render()},i=function(){return e.update_data()};this.connect(this.model.change,t),this.connect(this.glyph.model.change,i),this.connect(this.selection_glyph.model.change,i),this.connect(this.nonselection_glyph.model.change,i),null!=this.hover_glyph&&this.connect(this.hover_glyph.model.change,i),this.connect(this.muted_glyph.model.change,i),this.connect(this.decimated_glyph.model.change,i),this.connect(this.model.data_source.change,i),this.connect(this.model.data_source.streaming,i),this.connect(this.model.data_source.patching,(function(t){return e.update_data(t)})),this.connect(this.model.data_source.selected.change,t),this.connect(this.model.data_source._select,t),null!=this.hover_glyph&&this.connect(this.model.data_source.inspect,t),this.connect(this.model.properties.view.change,i),this.connect(this.model.view.properties.indices.change,i),this.connect(this.model.view.properties.masked.change,(function(){return e.set_visuals()})),this.connect(this.model.properties.visible.change,(function(){return e.plot_view.invalidate_dataranges=!0}));var r,a=this.plot_view.frame,o=a.x_ranges,s=a.y_ranges,l=(0,w.Z)(o);try{for(l.s();!(r=l.n()).done;){var u=(0,k.Z)(r.value,2)[1];u instanceof C.FactorRange&&this.connect(u.change,i)}}catch(y){l.e(y)}finally{l.f()}var c,h=(0,w.Z)(s);try{for(h.s();!(c=h.n()).done;){var f=(0,k.Z)(c.value,2)[1];f instanceof C.FactorRange&&this.connect(f.change,i)}}catch(y){h.e(y)}finally{h.f()}var v=this.model.glyph,p=v.transformchange,m=v.exprchange;
2this.connect(p,i),this.connect(m,i)}},{key:"_update_masked_indices",value:function(){var e=this.glyph.mask_data();return this.model.view.masked=e,e}},{key:"update_data",value:function(e){this.set_data(e),this.request_render()}},{key:"set_data",value:function(e){var t=this.model.data_source;this.all_indices=this.model.view.indices;var n=this.all_indices;this.glyph.set_data(t,n,e),this.set_visuals(),this._update_masked_indices();var i=this.plot_model.lod_factor,r=this.all_indices.count;this.decimated=new A.Indices(r);for(var a=0;a<r;a+=i)this.decimated.set(a);this.plot_view.invalidate_dataranges=!0}},{key:"set_visuals",value:function(){var e,t=this.model.data_source,n=this.all_indices;this.glyph.set_visuals(t,n),this.decimated_glyph.set_visuals(t,n),this.selection_glyph.set_visuals(t,n),this.nonselection_glyph.set_visuals(t,n),null===(e=this.hover_glyph)||void 0===e||e.set_visuals(t,n),this.muted_glyph.set_visuals(t,n)}},{key:"has_webgl",get:function(){return this.glyph.has_webgl}},{key:"_render",value:function(){var e=this,t=this.has_webgl;this.glyph.map_data();var n=(0,y.Z)(this.all_indices),i=(0,y.Z)(this._update_masked_indices()),r=this.layer.ctx;r.save();var a,o=this.model.data_source.selected;a=!o||o.is_empty()?[]:this.glyph instanceof s.LineView&&o.selected_glyph===this.glyph.model?this.model.view.convert_indices_from_subset(i):o.indices;var h,_,d,f=this.model.data_source.inspected,v=new Set(!f||f.is_empty()?[]:f.selected_glyph?e.model.view.convert_indices_from_subset(i):f.indices.length>0?f.indices:Object.keys(f.multiline_indices).map((function(e){return parseInt(e)}))),p=(0,S.filter)(i,(function(e){return v.has(n[e])})),m=this.plot_model.lod_threshold;if(null!=this.model.document&&this.model.document.interactive_duration()>0&&!t&&null!=m&&n.length>m?(i=(0,y.Z)(this.decimated),h=this.decimated_glyph,_=this.decimated_glyph,d=this.selection_glyph):(h=this.model.muted?this.muted_glyph:this.glyph,_=this.nonselection_glyph,d=this.selection_glyph),null!=this.hover_glyph&&p.length){var g,b=new Set(i),x=(0,w.Z)(p);try{for(x.s();!(g=x.n()).done;){var k=g.value;b.delete(k)}}catch(P){x.e(P)}finally{x.f()}i=(0,y.Z)(b)}if(a.length){var Z,A={},T=(0,w.Z)(a);try{for(T.s();!(Z=T.n()).done;){A[Z.value]=!0}}catch(P){T.e(P)}finally{T.f()}var M=new Array,C=new Array;if(this.glyph instanceof s.LineView){var z,E=(0,w.Z)(n);try{for(E.s();!(z=E.n()).done;){var R=z.value;null!=A[R]?M.push(R):C.push(R)}}catch(P){E.e(P)}finally{E.f()}}else{var B,N=(0,w.Z)(i);try{for(N.s();!(B=N.n()).done;){var O=B.value;null!=A[n[O]]?M.push(O):C.push(O)}}catch(P){N.e(P)}finally{N.f()}}_.render(r,C),d.render(r,M),null!=this.hover_glyph&&(this.glyph instanceof s.LineView?this.hover_glyph.render(r,this.model.view.convert_indices_from_subset(p)):this.hover_glyph.render(r,p))}else if(this.glyph instanceof s.LineView)this.hover_glyph&&p.length?this.hover_glyph.render(r,this.model.view.convert_indices_from_subset(p)):h.render(r,n);else if(this.glyph instanceof l.PatchView||this.glyph instanceof u.HAreaView||this.glyph instanceof c.VAreaView)if(0==f.selected_glyphs.length||null==this.hover_glyph)h.render(r,n);else{var D,I=(0,w.Z)(f.selected_glyphs);try{for(I.s();!(D=I.n()).done;){D.value==this.glyph.model&&this.hover_glyph.render(r,n)}}catch(P){I.e(P)}finally{I.f()}}else h.render(r,i),this.hover_glyph&&p.length&&this.hover_glyph.render(r,p);r.restore()}},{key:"draw_legend",value:function(e,t,n,i,r,a,o,s){0!=this.glyph.data_size&&(null==s&&(s=this.model.get_reference_point(a,o)),this.glyph.draw_legend_for_index(e,{x0:t,x1:n,y0:i,y1:r},s))}},{key:"hit_test",value:function(e){if(!this.model.visible)return null;var t=this.glyph.hit_test(e);return null==t?null:this.model.view.convert_selection_from_subset(t)}}]),n}(o.DataRendererView);n.GlyphRendererView=N,N.__name__="GlyphRendererView";var O=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.view.source!=this.data_source&&(this.view.source=this.data_source,this.view.compute_indices())}},{key:"get_reference_point",value:function(e,t){if(null!=e){var n=this.data_source.get_column(e);if(null!=n)for(var i=0,r=Object.entries(this.view.indices_map);i<r.length;i++){var a=(0,k.Z)(r[i],2),o=a[0],s=a[1];if(n[parseInt(o)]==t)return s}}return 0}},{key:"get_selection_manager",value:function(){return this.data_source.selection_manager}}]),n}(o.DataRenderer);n.GlyphRenderer=O,a=O,O.__name__="GlyphRenderer",a.prototype.default_view=N,a.define((function(e){var t=e.Boolean,n=e.Auto,i=e.Or,r=e.Ref,a=e.Null,o=e.Nullable;return{data_source:[r(f.ColumnarDataSource)],view:[r(m.CDSView),function(e){return new m.CDSView({source:e.data_source})}],glyph:[r(h.Glyph)],hover_glyph:[o(r(h.Glyph)),null],nonselection_glyph:[i(r(h.Glyph),n,a),"auto"],selection_glyph:[i(r(h.Glyph),n,a),"auto"],muted_glyph:[i(r(h.Glyph),n,a),"auto"],muted:[t,!1]}}))},function(e,t,n,i,r){var a;i();var o=e(41),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"xscale",get:function(){return this.coordinates.x_scale}},{key:"yscale",get:function(){return this.coordinates.y_scale}}]),n}(o.RendererView);n.DataRendererView=s,s.__name__="DataRendererView";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"selection_manager",get:function(){return this.get_selection_manager()}}]),n}(o.Renderer);n.DataRenderer=l,a=l,l.__name__="DataRenderer",a.override({level:"glyph"})},function(e,t,n,i,r){i();var a,o=e(1),s=e(178),l=e(184),u=(0,o.__importStar)(e(48)),c=(0,o.__importStar)(e(185)),h=e(72),f=function(t){(0,v.Z)(i,t);var n=(0,p.Z)(i);function i(){return(0,g.Z)(this,i),n.apply(this,arguments)}return(0,b.Z)(i,[{key:"lazy_initialize",value:function(){var t=(0,Z.Z)((0,x.Z)().mark((function t(){var n,r,a;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_.Z)((0,d.Z)(i.prototype),"lazy_initialize",this).call(this);case 2:if(!(null==(n=this.renderer.plot_view.canvas_view.webgl)?void 0:n.regl_wrapper.has_webgl)){t.next=9;break}return t.next=6,Promise.resolve().then((function(){return(0,o.__importStar)(e(426))}));case 6:r=t.sent,a=r.LineGL,this.glglyph=new a(n.regl_wrapper,this);case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_render",value:function(e,t,n){var i=null!=n?n:this,r=i.sx,a=i.sy,o=null,s=function(e){return null!=o&&e-o!=1},l=!0;e.beginPath();var u,c=(0,w.Z)(t);try{for(c.s();!(u=c.n()).done;){var h=u.value,_=r[h],d=a[h];isFinite(_+d)?l||s(h)?(e.moveTo(_,d),l=!1):e.lineTo(_,d):l=!0,o=h}}catch(f){c.e(f)}finally{c.f()}
2this.visuals.line.set_value(e),e.stroke()}},{key:"_hit_point",value:function(e){for(var t=new h.Selection,n={x:e.sx,y:e.sy},i=9999,r=Math.max(2,this.line_width.value/2),a=0,o=this.sx.length-1;a<o;a++){var s={x:this.sx[a],y:this.sy[a]},l={x:this.sx[a+1],y:this.sy[a+1]},u=c.dist_to_segment(n,s,l);u<r&&u<i&&(i=u,t.add_to_selected_glyphs(this.model),t.view=this,t.line_indices=[a])}return t}},{key:"_hit_span",value:function(e){var t,n,i=e.sx,r=e.sy,a=new h.Selection;"v"==e.direction?(t=this.renderer.yscale.invert(r),n=this._y):(t=this.renderer.xscale.invert(i),n=this._x);for(var o=0,s=n.length-1;o<s;o++)(n[o]<=t&&t<=n[o+1]||n[o+1]<=t&&t<=n[o])&&(a.add_to_selected_glyphs(this.model),a.view=this,a.line_indices.push(o));return a}},{key:"get_interpolation_hit",value:function(e,t){var n=[this._x[e],this._y[e],this._x[e+1],this._y[e+1]],i=n[0],r=n[1],a=n[2],o=n[3];return(0,l.line_interpolation)(this.renderer,t,i,r,a,o)}},{key:"draw_legend_for_index",value:function(e,t,n){(0,l.generic_line_scalar_legend)(this.visuals,e,t)}}]),i}(s.XYGlyphView);n.LineView=f,f.__name__="LineView";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.XYGlyph);n.Line=m,a=m,m.__name__="Line",a.prototype.default_view=f,a.mixins(u.LineScalar)},function(e,t,n,i,r){i();var a,s=e(1),l=e(78),u=(0,s.__importStar)(e(18)),c=e(179),h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_project_data",value:function(){l.inplace.project_xy(this._x,this._y)}},{key:"_index_data",value:function(e){for(var t=this._x,n=this._y,i=this.data_size,r=0;r<i;r++){var a=t[r],o=n[r];e.add_point(a,o)}}},{key:"scenterxy",value:function(e){return[this.sx[e],this.sy[e]]}}]),n}(c.GlyphView);n.XYGlyphView=h,h.__name__="XYGlyphView";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(c.Glyph);n.XYGlyph=_,a=_,_.__name__="XYGlyph",a.define((function(e){return o(e),{x:[u.XCoordinateSpec,{field:"x"}],y:[u.YCoordinateSpec,{field:"y"}]}}))},function(e,t,n,i,r){i();var a=e(1),o=(0,a.__importStar)(e(18)),s=(0,a.__importStar)(e(65)),l=(0,a.__importStar)(e(45)),u=e(42),c=e(53),h=e(19),f=e(24),m=e(8),Z=e(180),A=e(12),S=e(26),T=e(181),M=e(67),C=e(72),z=Math.abs,E=Math.ceil,R=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._index=null,e._data_size=null,e._nohit_warned=new Set,e}return(0,b.Z)(n,[{key:"renderer",get:function(){return this.parent}},{key:"has_webgl",get:function(){return null!=this.glglyph}},{key:"index",get:function(){var e=this._index;if(null!=e)return e;throw new Error("".concat(this,".index_data() wasn't called"))}},{key:"data_size",get:function(){var e=this._data_size;if(null!=e)return e;throw new Error("".concat(this,".set_data() wasn't called"))}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.visual
2s=new l.Visuals(this)}},{key:"request_render",value:function(){this.parent.request_render()}},{key:"canvas",get:function(){return this.renderer.parent.canvas_view}},{key:"render",value:function(e,t,n){var i;null!=this.glglyph&&(this.renderer.needs_webgl_blit=this.glglyph.render(e,t,null!==(i=this.base)&&void 0!==i?i:this),this.renderer.needs_webgl_blit)||this._render(e,t,null!=n?n:this.base)}},{key:"has_finished",value:function(){return!0}},{key:"notify_finished",value:function(){this.renderer.notify_finished()}},{key:"_bounds",value:function(e){return e}},{key:"bounds",value:function(){return this._bounds(this.index.bbox)}},{key:"log_bounds",value:function(){var e=this.index.bounds(s.positive_x()),t=e.x0,n=e.x1,i=this.index.bounds(s.positive_y()),r=i.y0,a=i.y1;return this._bounds({x0:t,y0:r,x1:n,y1:a})}},{key:"get_anchor_point",value:function(e,t,n){var i=(0,k.Z)(n,2),r=i[0],a=i[1];switch(e){case"center":case"center_center":var o=this.scenterxy(t,r,a),s=(0,k.Z)(o,2);return{x:s[0],y:s[1]};default:return null}}},{key:"scenterx",value:function(e,t,n){return this.scenterxy(e,t,n)[0]}},{key:"scentery",value:function(e,t,n){return this.scenterxy(e,t,n)[1]}},{key:"sdist",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"edge",r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=t.length,o=new f.ScreenArray(a),s=e.s_compute;if("center"==i)for(var l=0;l<a;l++){var u=t[l],c=n.get(l)/2,h=s(u-c),_=s(u+c);o[l]=z(_-h)}else for(var d=0;d<a;d++){var v=t[d],p=s(v),m=s(v+n.get(d));o[d]=z(m-p)}return r&&(0,A.inplace_map)(o,(function(e){return E(e)})),o}},{key:"draw_legend_for_index",value:function(e,t,n){}},{key:"hit_test",value:function(e){switch(e.type){case"point":if(null!=this._hit_point)return this._hit_point(e);break;case"span":if(null!=this._hit_span)return this._hit_span(e);break;case"rect":if(null!=this._hit_rect)return this._hit_rect(e);break;case"poly":if(null!=this._hit_poly)return this._hit_poly(e)}return this._nohit_warned.has(e.type)||(h.logger.debug("'".concat(e.type,"' selection not available for ").concat(this.model.type)),this._nohit_warned.add(e.type)),null}},{key:"_hit_rect_against_index",value:function(e){var t=e.sx0,n=e.sx1,i=e.sy0,r=e.sy1,a=this.renderer.coordinates.x_scale.r_invert(t,n),o=(0,k.Z)(a,2),s=o[0],l=o[1],u=this.renderer.coordinates.y_scale.r_invert(i,r),c=(0,k.Z)(u,2),h=c[0],_=c[1],d=(0,y.Z)(this.index.indices({x0:s,x1:l,y0:h,y1:_}));return new C.Selection({indices:d})}},{key:"_project_data",value:function(){}},{key:"_iter_visuals",value:(0,x.Z)().mark((function e(){var t,n,i,r,a,s;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=(0,w.Z)(this.visuals),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=26;break}i=n.value,r=(0,w.Z)(i),e.prev=6,r.s();case 8:if((a=r.n()).done){e.next=16;break}if(s=a.value,e.t0=s instanceof o.VectorSpec||s instanceof o.ScalarSpec,!e.t0){e.next=14;break}return e.next=14,s;case 14:e.next=8;break;case 16:e.next=21;break;case 18:e.prev=18,e.t1=e.catch(6),r.e(e.t1);case 21:return e.prev=21,r.f(),e.finish(21);case 24:e.next=3;break;case 26:e.next=31;break;case 28:e.prev=28,e.t2=e.catch(1),t.e(e.t2);case 31:return e.prev=31,t.f(),e.finish(31);case 34:case"end":return e.stop()}}),e,this,[[1,28,31,34],[6,18,21,24]])}))},{key:"set_base",value:function(e){e!=this&&e instanceof this.constructor&&(this.base=e)}},{key:"_configure",value:function(e,t){Object.defineProperty(this,(0,m.isString)(e)?e:e.attr,Object.assign({configurable:!0,enumerable:!0},t))}},{key:"set_visuals",value:function(e,t){var n,i,r=this,a=(0,w.Z)(this._iter_visuals());try{var o=function(){var n=i.value,a=r.base;if(null!=a){var o=a.model.properties[n.attr];if(null!=o&&(0,S.is_equal)(n.get_value(),o.get_value()))return r._configure(n,{get:function(){return a["".concat(n.attr)]}}),"continue"}var s=n.uniform(e).select(t);r._configure(n,{value:s})};for(a.s();!(i=a.n()).done;)o()}catch(u){a.e(u)}finally{a.f()}var s,l=(0,w.Z)(this.visuals);try{for(l.s();!(s=l.n()).done;){s.value.update()}}catch(u){l.e(u)}finally{l.f()}
2null===(n=this.glglyph)||void 0===n||n.set_visuals_changed()}},{key:"set_data",value:function(e,t,n){var i,r=this.renderer.coordinates,a=r.x_source,s=r.y_source,l=new Set(this._iter_visuals());this._data_size=t.count;var u,c=(0,w.Z)(this.model);try{for(c.s();!(u=c.n()).done;){var h=u.value;if((h instanceof o.VectorSpec||h instanceof o.ScalarSpec)&&!l.has(h))if(h instanceof o.BaseCoordinateSpec){var _=h.array(e),d=t.select(_),f="x"==h.dimension?a:s;if(f instanceof M.FactorRange)if(h instanceof o.CoordinateSpec)d=f.v_synthetic(d);else if(h instanceof o.CoordinateSeqSpec)for(var v=0;v<d.length;v++)d[v]=f.v_synthetic(d[v]);var p;p=h instanceof o.CoordinateSeqSpec?Z.RaggedArray.from(d,Float64Array):d,this._configure("_".concat(h.attr),{value:p})}else{var m=h.uniform(e).select(t);if(this._configure(h,{value:m}),h instanceof o.DistanceSpec){var y=m.is_Scalar()?m.value:(0,A.max)(m.array);this._configure("max_".concat(h.attr),{value:y})}}}}catch(g){c.e(g)}finally{c.f()}this.renderer.plot_view.model.use_map&&this._project_data(),this._set_data(null!=n?n:null),null===(i=this.glglyph)||void 0===i||i.set_data_changed(),this.index_data()}},{key:"_set_data",value:function(e){}},{key:"_index_size",get:function(){return this.data_size}},{key:"index_data",value:function(){var e=new T.SpatialIndex(this._index_size);this._index_data(e),e.finish(),this._index=e}},{key:"mask_data",value:function(){return null==this._mask_data?f.Indices.all_set(this.data_size):this._mask_data()}},{key:"map_data",value:function(){var e,t,n=this.renderer.coordinates,i=n.x_scale,r=n.y_scale,a=(0,w.Z)(this.model);try{for(a.s();!(t=a.n()).done;){var s=t.value;if(s instanceof o.BaseCoordinateSpec){var l="x"==s.dimension?i:r,u=this["_".concat(s.attr)];if(u instanceof Z.RaggedArray){var c=l.v_compute(u.array);u=new Z.RaggedArray(u.offsets,c)}else u=l.v_compute(u);this["s".concat(s.attr)]=u}}}catch(h){a.e(h)}finally{a.f()}this._map_data(),null===(e=this.glglyph)||void 0===e||e.set_data_changed()}},{key:"_map_data",value:function(){}}]),n}(u.View);n.GlyphView=R,R.__name__="GlyphView";var B=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(c.Model);n.Glyph=B,B.__name__="Glyph"},function(e,t,n,i,r){var a;i();var o=e(26),s=e(11),l=function(e,t){function n(e,t){(0,g.Z)(this,n),this.offsets=e,this.array=t}return(0,b.Z)(n,[{key:e,value:function(e,t){return t.arrays(this.offsets,e.offsets)&&t.arrays(this.array,e.array)}},{key:"length",get:function(){return this.offsets.length}},{key:"clone",value:function(){return new n(this.offsets.slice(),this.array.slice())}},{key:t,value:(0,x.Z)().mark((function e(){var t,n,i;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.offsets,n=this.length,i=0;case 2:if(!(i<n)){e.next=8;break}return e.next=5,this.array.subarray(t[i],t[i+1]);case 5:i++,e.next=2;break;case 8:case"end":return e.stop()}}),e,this)}))},{key:"_check_bounds",value:function(e){(0,s.assert)(0<=e&&e<this.length,"Out of bounds: 0 <= ".concat(e," < ").concat(this.length))}},{key:"get",value:function(e){this._check_bounds(e);var t=this.offsets;return this.array.subarray(t[e],t[e+1])}},{key:"set",value:function(e,t){this._check_bounds(e),this.array.set(t,this.offsets[e])}}],[{key:"from",value:function(e,t){for(var i=e.length,r=0,a=function(){for(var t=new Uint32Array(i),n=0;n<i;n++){var a=e[n].length;t[n]=r,r+=a}return r<256?new Uint8Array(t):r<65536?new Uint16Array(t):t}(),o=new t(r),s=0;s<i;s++)o.set(e[s],a[s]);return new n(a,o)}}]),n}((a=Symbol.toStringTag,o.equals),Symbol.iterator);n.RaggedArray=l,l.__name__="RaggedArray",l[a]="RaggedArray"},function(e,t,n,i,r){i();var a=(0,e(1).__importDefault)(e(182)),o=e(24),s=e(65);function l(e,t){for(var n=0,i=t.length-1;n<i;){var r=n+i>>1;t[r]>e?i=r:n=r+1}return t[n]}var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"boxes",get:function(){return this._boxes}},{key:"search_indices",value:function(e,t,n,i){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");for(var r=this._boxes.length-4,a=[],s=new o.Indices(this.numItems);void 0!==r;
2){for(var u=Math.min(r+4*this.nodeSize,l(r,this._levelBounds)),c=r;c<u;c+=4){var h=0|this._indices[c>>2],_=this._boxes[c+0],d=this._boxes[c+1],f=this._boxes[c+2],v=this._boxes[c+3];n<_||i<d||e>f||t>v||(r<4*this.numItems?s.set(h):a.push(h))}r=a.pop()}return s}}]),n}(a.default);u.__name__="_FlatBush";var c=function(){function e(t){(0,g.Z)(this,e),this.index=null,t>0&&(this.index=new u(t))}return(0,b.Z)(e,[{key:"add_rect",value:function(e,t,n,i){var r;isFinite(e+t+n+i)?null===(r=this.index)||void 0===r||r.add(e,t,n,i):this.add_empty()}},{key:"add_point",value:function(e,t){var n;isFinite(e+t)?null===(n=this.index)||void 0===n||n.add(e,t,e,t):this.add_empty()}},{key:"add_empty",value:function(){var e;null===(e=this.index)||void 0===e||e.add(1/0,1/0,-1/0,-1/0)}},{key:"finish",value:function(){var e;null===(e=this.index)||void 0===e||e.finish()}},{key:"_normalize",value:function(e){var t,n,i=e.x0,r=e.y0,a=e.x1,o=e.y1;return i>a&&(i=(t=[a,i])[0],a=t[1]),r>o&&(r=(n=[o,r])[0],o=n[1]),{x0:i,y0:r,x1:a,y1:o}}},{key:"bbox",get:function(){if(null==this.index)return(0,s.empty)();var e=this.index;return{x0:e.minX,y0:e.minY,x1:e.maxX,y1:e.maxY}}},{key:"indices",value:function(e){if(null==this.index)return new o.Indices(0);var t=this._normalize(e),n=t.x0,i=t.y0,r=t.x1,a=t.y1;return this.index.search_indices(n,i,r,a)}},{key:"bounds",value:function(e){var t=(0,s.empty)();if(null==this.index)return t;var n,i=this.index.boxes,r=(0,w.Z)(this.indices(e));try{for(r.s();!(n=r.n()).done;){var a=n.value,o=i[4*a+0],l=i[4*a+1],u=i[4*a+2],c=i[4*a+3];o>=e.x0&&o<t.x0&&(t.x0=o),u<=e.x1&&u>t.x1&&(t.x1=u),l>=e.y0&&l<t.y0&&(t.y0=l),c<=e.y1&&c>t.y1&&(t.y1=c)}}catch(h){r.e(h)}finally{r.f()}return t}}]),e}();n.SpatialIndex=c,c.__name__="SpatialIndex"},function(e,t,n,i,r){i();var a=(0,e(1).__importDefault)(e(183)),o=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float64Array,r=arguments.length>3?arguments[3]:void 0;if((0,g.Z)(this,e),void 0===t)throw new Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw new Error("Unpexpected numItems value: ".concat(t,"."));this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535);var s=t,l=s;this._levelBounds=[4*s];do{l+=s=Math.ceil(s/this.nodeSize),this._levelBounds.push(4*l)}while(1!==s);this.ArrayType=i||Float64Array,this.IndexArrayType=l<16384?Uint16Array:Uint32Array;var u=o.indexOf(this.ArrayType),c=4*l*this.ArrayType.BYTES_PER_ELEMENT;if(u<0)throw new Error("Unexpected typed array class: ".concat(i,"."));r&&r instanceof ArrayBuffer?(this.data=r,this._boxes=new this.ArrayType(this.data,8,4*l),this._indices=new this.IndexArrayType(this.data,8+c,l),this._pos=4*l,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+c+l*this.IndexArrayType.BYTES_PER_ELEMENT),this._boxes=new this.ArrayType(this.data,8,4*l),this._indices=new this.IndexArrayType(this.data,8+c,l),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+u]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t),this._queue=new a.default}return(0,b.Z)(e,[{key:"add",value:function(e,t,n,i){var r=this._pos>>2;return this._indices[r]=r,this._boxes[this._pos++]=e,this._boxes[this._pos++]=t,this._boxes[this._pos++]=n,this._boxes[this._pos++]=i,e<this.minX&&(this.minX=e),t<this.minY&&(this.minY=t),n>this.maxX&&(this.maxX=n),i>this.maxY&&(this.maxY=i),r}},{key:"finish",value:function(){if(this._pos>>2!==this.numItems)throw new Error("Added ".concat(this._pos>>2," items when expected ").concat(this.numItems,"."));if(this.numItems<=this.nodeSize)return this._boxes[this._pos++]=this.minX,this._boxes[this._pos++]=this.minY,this._boxes[this._pos++]=this.maxX,void(this._boxes[this._pos++]=this.maxY);for(var e=this.maxX-this.minX,t=this.maxY-this.minY,n=new Uint32Array(this.numItems),i=0;i<this.numItems;i++){var r=4*i,a=this._boxes[r++],o=this._boxes[r++],s=this._boxes[r++],l=this._boxes[r++],u=Math.floor(65535*((a+s)/2-this.minX)/e),h=Math.floor(65535*((o+l)/2-this.minY)/t);n[i]=_(u,h)}c(n,this._boxes,this._indices,0,this.numItems-1,this.nodeSize);for(var d=0,f=0;d<this._levelBounds.length-1;d++)for(var v=this._levelBounds[d];f<v;){for(var p=f,m=1/0,y=1/0,g=-1/0,b=-1/0,w=0;w<this.nodeSize&&f<v;w++)m=Math.min(m,this._boxes[f++]),y=Math.min(y,this._boxes[f++]),g=Math.max(g,this._boxes[f++]),b=Math.max(b,this._boxes[f++]);this._indices[this._pos>>2]=p,this._boxes[this._pos++]=m,this._boxes[this._pos++]=y,this._boxes[this._pos++]=g,this._boxes[this._pos++]=b}}},{key:"search",value:function(e,t,n,i,r){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");for(var a=this._boxes.length-4,o=[],s=[];void 0!==a;){for(var l=Math.min(a+4*this.nodeSize,u(a,this._levelBounds)),c=a;c<l;c+=4){var h=0|this._indices[c>>2];n<this._boxes[c]||i<this._boxes[c+1]||e>this._boxes[c+2]||t>this._boxes[c+3]||(a<4*this.numItems?(void 0===r||r(h))&&s.push(h):o.push(h))}a=o.pop()}return s}},{key:"neighbors",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,r=arguments.length>4?arguments[4]:void 0;if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");for(var a=this._boxes.length-4,o=this._queue,s=[],c=i*i;void 0!==a;){for(var h=Math.min(a+4*this.nodeSize,u(a,this._levelBounds)),_=a;_<h;_+=4){var d=0|this._indices[_>>2],f=l(e,this._boxes[_],this._boxes[_+2]),v=l(t,this._boxes[_+1],this._boxes[_+3]),p=f*f+v*v;a<4*this.numItems?(void 0===r||r(d))&&o.push(-d-1,p):o.push(d,p)}for(;o.length&&o.peek()<0;){if(o.peekValue()>c)return o.clear(),s;if(s.push(-o.pop()-1),s.length===n)return o.clear(),s}a=o.pop()}return o.clear(),s}}],[{key:"from",value:function(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");var n=new Uint8Array(t,0,2),i=(0,k.Z)(n,2),r=i[0],a=i[1];if(251!==r)throw new Error("Data does not appear to be in a Flatbush format.");if(a>>4!=3)throw new Error("Got v".concat(a>>4," data when expected v3."));var s=new Uint16Array(t,2,1),l=(0,k.Z)(s,1)[0],u=new Uint32Array(t,4,1);return new e((0,k.Z)(u,1)[0],l,o[15&a],t)}}]),e}();function l(e,t,n){return e<t?t-e:e<=n?0:e-n}function u(e,t){for(var n=0,i=t.length-1;n<i;){var r=n+i>>1;t[r]>e?i=r:n=r+1}return t[n]}function c(e,t,n,i,r,a){if(!(Math.floor(i/a)>=Math.floor(r/a))){for(var o=e[i+r>>1],s=i-1,l=r+1;;){do{s++}while(e[s]<o);do{l--}while(e[l]>o);if(s>=l)break;h(e,t,n,s,l)}c(e,t,n,i,l,a),c(e,t,n,l+1,r,a)}}function h(e,t,n,i,r){var a=e[i];e[i]=e[r],e[r]=a;var o=4*i,s=4*r,l=t[o],u=t[o+1],c=t[o+2],h=t[o+3];t[o]=t[s],t[o+1]=t[s+1],t[o+2]=t[s+2],t[o+3]=t[s+3],t[s]=l,t[s+1]=u,t[s+2]=c,t[s+3]=h;var _=n[i];n[i]=n[r],n[r]=_}function _(e,t){var n=e^t,i=65535^n,r=65535^(e|t),a=e&(65535^t),o=n|i>>1,s=n>>1^n,l=r>>1^i&a>>1^r,u=n&r>>1^a>>1^a;s=(n=o)&(i=s)>>2^i&(n^i)>>2,l^=n&(r=l)>>2^i&(a=u)>>2,u^=i&r>>2^(n^i)&a>>2,s=(n=o=n&n>>2^i&i>>2)&(i=s)>>4^i&(n^i)>>4,l^=n&(r=l)>>4^i&(a=u)>>4,u^=i&r>>4^(n^i)&a>>4,l^=(n=o=n&n>>4^i&i>>4)&(r=l)>>8^(i=s)&(a=u)>>8;var c=e^t,h=(i=(u^=i&r>>8^(n^i)&a>>8)^u>>1)|65535^(c|(n=l^l>>1));return((h=1431655765&((h=858993459&((h=252645135&((h=16711935&(h|h<<8))|h<<4))|h<<2))|h<<1))<<1|(c=1431655765&((c=858993459&((c=252645135&((c=16711935&(c|c<<8))|c<<4))|c<<2))|c<<1)))>>>0}n.default=s},function(e,t,n,i,r){i(),n.default=function(){function e(){(0,g.Z)(this,e),this.ids=[],this.values=[],this.length=0}return(0,b.Z)(e,[{key:"clear",value:function(){this.length=0}},{key:"push",value:function(e,t){var n=this.length++;for(this.ids[n]=e,this.values[n]=t;n>0;){var i=n-1>>1,r=this.values[i];if(t>=r)break;this.ids[n]=this.ids[i],this.values[n]=r,n=i}this.ids[n]=e,this.values[n]=t}},{key:"pop",value:function(){if(0!==this.length){var e=this.ids[0];if(this.length--,this.length>0){for(var t=this.ids[0]=this.ids[this.length],n=this.values[0]=this.values[this.length],i=this.length>>1,r=0;r<i;){var a=1+(r<<1),o=a+1,s=this.ids[a],l=this.values[a],u=this.values[o];if(o<this.length&&u<l&&(a=o,s=this.ids[o],l=u),l>=n)break;this.ids[r]=s,this.values[r]=l,r=a}this.ids[r]=t,this.values[r]=n}return e}}},{key:"peek",value:function(){if(0!==this.length)return this.ids[0]}},{key:"peekValue",value:function(){if(0!==this.length)return this.values[0]}}]),e}()},function(e,t,n,i,r){i();var a=(0,e(1).__importStar)(e(185));function o(e,t,n,i){var r=n.x0,a=n.x1,o=n.y0,s=n.y1;
2t.save(),t.beginPath(),t.moveTo(r,(o+s)/2),t.lineTo(a,(o+s)/2),e.line.apply(t,i),t.restore()}function s(e,t,n,i){var r,a,o=n.x0,s=n.x1,l=n.y0,u=n.y1,c=.1*Math.abs(s-o),h=.1*Math.abs(u-l),_=o+c,d=s-c,f=l+h,v=u-h;t.beginPath(),t.rect(_,f,d-_,v-f),e.fill.apply(t,i),null===(r=e.hatch)||void 0===r||r.apply(t,i),null===(a=e.line)||void 0===a||a.apply(t,i)}n.generic_line_scalar_legend=function(e,t,n){var i=n.x0,r=n.x1,a=n.y0,o=n.y1;t.save(),t.beginPath(),t.moveTo(i,(a+o)/2),t.lineTo(r,(a+o)/2),e.line.apply(t),t.restore()},n.generic_line_vector_legend=o,n.generic_line_legend=o,n.generic_area_scalar_legend=function(e,t,n){var i,r,a=n.x0,o=n.x1,s=n.y0,l=n.y1,u=.1*Math.abs(o-a),c=.1*Math.abs(l-s),h=a+u,_=o-u,d=s+c,f=l-c;t.beginPath(),t.rect(h,d,_-h,f-d),e.fill.apply(t),null===(i=e.hatch)||void 0===i||i.apply(t),null===(r=e.line)||void 0===r||r.apply(t)},n.generic_area_vector_legend=s,n.generic_area_legend=s,n.line_interpolation=function(e,t,n,i,r,o){var s,l,u,c,h,_,d,f,v,p,m,y,g,b,w=t.sx,x=t.sy;"point"==t.type?(s=e.yscale.r_invert(x-1,x+1),g=(l=(0,k.Z)(s,2))[0],b=l[1],u=e.xscale.r_invert(w-1,w+1),m=(c=(0,k.Z)(u,2))[0],y=c[1]):"v"==t.direction?(h=e.yscale.r_invert(x,x),g=(_=(0,k.Z)(h,2))[0],b=_[1],m=(d=[Math.min(n-1,r-1),Math.max(n+1,r+1)])[0],y=d[1]):(f=e.xscale.r_invert(w,w),m=(v=(0,k.Z)(f,2))[0],y=v[1],g=(p=[Math.min(i-1,o-1),Math.max(i+1,o+1)])[0],b=p[1]);var Z=a.check_2_segments_intersect(m,g,y,b,n,i,r,o);return[Z.x,Z.y]}},function(e,t,n,i,r){function a(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function o(e,t,n){var i=a(t,n);if(0==i)return a(e,t);var r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/i;return a(e,r<0?t:r>1?n:{x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)})}i(),n.point_in_poly=function(e,t,n,i){for(var r=!1,a=n[n.length-1],o=i[i.length-1],s=0;s<n.length;s++){var l=n[s],u=i[s];o<t!=u<t&&a+(t-o)/(u-o)*(l-a)<e&&(r=!r),a=l,o=u}return r},n.point_in_ellipse=function(e,t,n,i,r,a,o){return(Math.pow(Math.cos(n)/r,2)+Math.pow(Math.sin(n)/i,2))*Math.pow(e-a,2)+2*Math.cos(n)*Math.sin(n)*(Math.pow(1/r,2)-Math.pow(1/i,2))*(e-a)*(t-o)+(Math.pow(Math.cos(n)/i,2)+Math.pow(Math.sin(n)/r,2))*Math.pow(t-o,2)<=1},n.dist_2_pts=a,n.dist_to_segment_squared=o,n.dist_to_segment=function(e,t,n){return Math.sqrt(o(e,t,n))},n.check_2_segments_intersect=function(e,t,n,i,r,a,o,s){var l=(s-a)*(n-e)-(o-r)*(i-t);if(0==l)return{hit:!1,x:null,y:null};var u=t-a,c=e-r,h=(n-e)*u-(i-t)*c;return u=((o-r)*u-(s-a)*c)/l,c=h/l,{hit:u>0&&u<1&&c>0&&c<1,x:e+u*(n-e),y:t+u*(i-t)}}},function(e,t,n,i,r){i();var a,o=e(1),s=e(178),l=e(184),u=(0,o.__importStar)(e(185)),c=(0,o.__importStar)(e(48)),h=e(72),_=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_render",value:function(e,t,n){var i=null!=n?n:this,r=i.sx,a=i.sy,o=!0;e.beginPath();var s,l=(0,w.Z)(t);try{for(l.s();!(s=l.n()).done;){var u=s.value,c=r[u],h=a[u];isFinite(c+h)?o?(e.moveTo(c,h),o=!1):e.lineTo(c,h):(e.closePath(),o=!0)}}catch(_){l.e(_)}finally{l.f()}
2e.closePath(),this.visuals.fill.apply(e),this.visuals.hatch.apply(e),this.visuals.line.apply(e)}},{key:"draw_legend_for_index",value:function(e,t,n){(0,l.generic_area_scalar_legend)(this.visuals,e,t)}},{key:"_hit_point",value:function(e){var t=new h.Selection;return u.point_in_poly(e.sx,e.sy,this.sx,this.sy)&&(t.add_to_selected_glyphs(this.model),t.view=this),t}}]),n}(s.XYGlyphView);n.PatchView=_,_.__name__="PatchView";var d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.XYGlyph);n.Patch=d,a=d,d.__name__="Patch",a.prototype.default_view=_,a.mixins([c.LineScalar,c.FillScalar,c.HatchScalar])},function(e,t,n,i,r){i();var a,s=e(1),l=e(188),u=(0,s.__importStar)(e(185)),c=(0,s.__importStar)(e(18)),h=e(72),_=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_index_data",value:function(e){for(var t=Math.min,n=Math.max,i=this.data_size,r=0;r<i;r++){var a=this._x1[r],o=this._x2[r],s=this._y[r];e.add_rect(t(a,o),s,n(a,o),s)}}},{key:"_render",value:function(e,t,n){var i=null!=n?n:this,r=i.sx1,a=i.sx2,o=i.sy;e.beginPath();for(var s=0,l=r.length;s<l;s++)e.lineTo(r[s],o[s]);for(var u=a.length-1;u>=0;u--)e.lineTo(a[u],o[u]);
2e.closePath(),this.visuals.fill.apply(e),this.visuals.hatch.apply(e)}},{key:"_hit_point",value:function(e){for(var t=this.sy.length,n=new h.Selection,i=0,r=t-1;i<r;i++){var a=[this.sx1[i],this.sx1[i+1],this.sx2[i+1],this.sx2[i]],o=[this.sy[i],this.sy[i+1],this.sy[i+1],this.sy[i]];if(u.point_in_poly(e.sx,e.sy,a,o)){n.add_to_selected_glyphs(this.model),n.view=this,n.line_indices=[i];break}}return n}},{key:"scenterxy",value:function(e){return[(this.sx1[e]+this.sx2[e])/2,this.sy[e]]}},{key:"_map_data",value:function(){this.sx1=this.renderer.xscale.v_compute(this._x1),this.sx2=this.renderer.xscale.v_compute(this._x2),this.sy=this.renderer.yscale.v_compute(this._y)}}]),n}(l.AreaView);n.HAreaView=_,_.__name__="HAreaView";var d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.Area);n.HArea=d,a=d,d.__name__="HArea",a.prototype.default_view=_,a.define((function(e){return o(e),{x1:[c.XCoordinateSpec,{field:"x1"}],x2:[c.XCoordinateSpec,{field:"x2"}],y:[c.YCoordinateSpec,{field:"y"}]}}))},function(e,t,n,i,r){i();var a,o=e(1),s=e(179),l=e(184),u=(0,o.__importStar)(e(48)),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"draw_legend_for_index",value:function(e,t,n){(0,l.generic_area_scalar_legend)(this.visuals,e,t)}}]),n}(s.GlyphView);n.AreaView=c,c.__name__="AreaView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.Glyph);n.Area=h,a=h,h.__name__="Area",a.mixins([u.FillScalar,u.HatchScalar])},function(e,t,n,i,r){i();var a,s=e(1),l=e(188),u=(0,s.__importStar)(e(185)),c=(0,s.__importStar)(e(18)),h=e(72),_=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_index_data",value:function(e){for(var t=Math.min,n=Math.max,i=this.data_size,r=0;r<i;r++){var a=this._x[r],o=this._y1[r],s=this._y2[r];e.add_rect(a,t(o,s),a,n(o,s))}}},{key:"_render",value:function(e,t,n){var i=null!=n?n:this,r=i.sx,a=i.sy1,o=i.sy2;e.beginPath();for(var s=0,l=a.length;s<l;s++)e.lineTo(r[s],a[s]);for(var u=o.length-1;u>=0;u--)e.lineTo(r[u],o[u]);
2e.closePath(),this.visuals.fill.apply(e),this.visuals.hatch.apply(e)}},{key:"scenterxy",value:function(e){return[this.sx[e],(this.sy1[e]+this.sy2[e])/2]}},{key:"_hit_point",value:function(e){for(var t=this.sx.length,n=new h.Selection,i=0,r=t-1;i<r;i++){var a=[this.sx[i],this.sx[i+1],this.sx[i+1],this.sx[i]],o=[this.sy1[i],this.sy1[i+1],this.sy2[i+1],this.sy2[i]];if(u.point_in_poly(e.sx,e.sy,a,o)){n.add_to_selected_glyphs(this.model),n.view=this,n.line_indices=[i];break}}return n}},{key:"_map_data",value:function(){this.sx=this.renderer.xscale.v_compute(this._x),this.sy1=this.renderer.yscale.v_compute(this._y1),this.sy2=this.renderer.yscale.v_compute(this._y2)}}]),n}(l.AreaView);n.VAreaView=_,_.__name__="VAreaView";var d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.Area);n.VArea=d,a=d,d.__name__="VArea",a.prototype.default_view=_,a.define((function(e){return o(e),{x:[c.XCoordinateSpec,{field:"x"}],y1:[c.YCoordinateSpec,{field:"y1"}],y2:[c.YCoordinateSpec,{field:"y2"}]}}))},function(e,t,n,i,r){var a;i();var o=e(53),s=e(24),l=e(191),u=e(70),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.compute_indices()}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.properties.filters.change,(function(){return e.compute_indices()}));var t=function(){var t=function(){return e.compute_indices()};null!=e.source&&(e.connect(e.source.change,t),e.source instanceof u.ColumnarDataSource&&(e.connect(e.source.streaming,t),e.connect(e.source.patching,t)))},i=null!=this.source;i?t():this.connect(this.properties.source.change,(function(){i||(t(),i=!0)}))}},{key:"compute_indices",value:function(){var e,t=this.source;if(null!=t){var n,i=null!==(e=t.get_length())&&void 0!==e?e:1,r=s.Indices.all_set(i),a=(0,w.Z)(this.filters);try{for(a.s();!(n=a.n()).done;){var o=n.value;r.intersect(o.compute_indices(t))}}catch(l){a.e(l)}finally{a.f()}this.indices=r,this._indices=(0,y.Z)(r),this.indices_map_to_subset()}}},{key:"indices_map_to_subset",value:function(){this.indices_map={};for(var e=0;e<this._indices.length;e++)this.indices_map[this._indices[e]]=e}},{key:"convert_selection_from_subset",value:function(e){var t=this;return e.map((function(e){return t._indices[e]}))}},{key:"convert_selection_to_subset",value:function(e){var t=this;return e.map((function(e){return t.indices_map[e]}))}},{key:"convert_indices_from_subset",value:function(e){var t=this;return e.map((function(e){return t._indices[e]}))}}]),n}(o.Model);n.CDSView=c,a=c,c.__name__="CDSView",a.define((function(e){var t=e.Array,n=e.Ref;return{filters:[t(n(l.Filter)),[]],source:[n(u.ColumnarDataSource)]}})),a.internal((function(e){var t=e.Int,n=e.Dict,i=e.Ref,r=e.Nullable;return{indices:[i(s.Indices)],indices_map:[n(t),{}],masked:[r(i(s.Indices)),null]}}))},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(e(53).Model);n.Filter=a,a.__name__="Filter"},function(e,t,n,i,r){i(),r("BasicTickFormatter",e(146).BasicTickFormatter),r("CategoricalTickFormatter",e(142).CategoricalTickFormatter),r("DatetimeTickFormatter",e(150).DatetimeTickFormatter),r("FuncTickFormatter",e(193).FuncTickFormatter),r("LogTickFormatter",e(163).LogTickFormatter),r("MercatorTickFormatter",e(166).MercatorTickFormatter),r("NumeralTickFormatter",e(194).NumeralTickFormatter),r("PrintfTickFormatter",e(195).PrintfTickFormatter),r("TickFormatter",e(131).TickFormatter)},function(e,t,n,i,r){var a;i();var o=e(131),l=e(13),u=e(34),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"names",get:function(){return(0,l.keys)(this.args)}},{key:"values",get:function(){return(0,l.values)(this.args)}},{key:"_make_func",value:function(){var e=(0,u.use_strict)(this.code);
2return(0,s.Z)(Function,["tick","index","ticks"].concat((0,y.Z)(this.names),[e]))}},{key:"doFormat",value:function(e,t){var n=this,i=this._make_func().bind({});return e.map((function(e,t,r){return"".concat(i.apply(void 0,[e,t,r].concat((0,y.Z)(n.values))))}))}}]),n}(o.TickFormatter);n.FuncTickFormatter=c,a=c,c.__name__="FuncTickFormatter",a.define((function(e){var t=e.Unknown,n=e.String;return{args:[(0,e.Dict)(t),{}],code:[n,""]}}))},function(e,t,n,i,r){var a;i();var o=(0,e(1).__importStar)(e(153)),s=e(131),l=e(20),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_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}}},{key:"doFormat",value:function(e,t){var n=this.format,i=this.language,r=this._rounding_fn;return e.map((function(e){return o.format(e,n,i,r)}))}}]),n}(s.TickFormatter);n.NumeralTickFormatter=u,a=u,u.__name__="NumeralTickFormatter",a.define((function(e){var t=e.String;return{format:[t,"0,0"],language:[t,"en"],rounding:[l.RoundingFunction,"round"]}}))},function(e,t,n,i,r){var a;i();var o=e(131),s=e(152),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"doFormat",value:function(e,t){var n=this;return e.map((function(e){return(0,s.sprintf)(n.format,e)}))}}]),n}(o.TickFormatter);n.PrintfTickFormatter=l,a=l,l.__name__="PrintfTickFormatter",a.define((function(e){return{format:[e.String,"%s"]}}))},function(e,t,n,i,r){i(),r("CategoricalColorMapper",e(197).CategoricalColorMapper),r("CategoricalMarkerMapper",e(199).CategoricalMarkerMapper),r("CategoricalPatternMapper",e(200).CategoricalPatternMapper),r("ContinuousColorMapper",e(172).ContinuousColorMapper),r("ColorMapper",e(173).ColorMapper),r("LinearColorMapper",e(201).LinearColorMapper),r("LogColorMapper",e(202).LogColorMapper),r("ScanningColorMapper",e(171).ScanningColorMapper),r("EqHistColorMapper",e(203).EqHistColorMapper)},function(e,t,n,i,r){var a;i();var o=e(198),s=e(173),l=e(67),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_v_compute",value:function(e,t,n,i){var r=i.nan_color;(0,o.cat_v_compute)(e,this.factors,n,t,this.start,this.end,r)}}]),n}(s.ColorMapper);n.CategoricalColorMapper=u,a=u,u.__name__="CategoricalColorMapper",a.define((function(e){var t=e.Number,n=e.Nullable;return{factors:[l.FactorSeq],start:[t,0],end:[n(t),null]}}))},function(e,t,n,i,r){i();var a=e(12),o=e(8);function s(e,t){if(e.length!=t.length)return!1;for(var n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}n._cat_equals=s,n.cat_v_compute=function(e,t,n,i,r,l,u){for(var c=e.length,h=function(){var c,h,d=e[_];(0,o.isString)(d)?c=(0,a.index_of)(t,d):(null!=r?d=null!=l?d.slice(r,l):d.slice(r):null!=l&&(d=d.slice(0,l)),c=1==d.length?(0,a.index_of)(t,d[0]):(0,a.find_index)(t,(function(e){return s(e,d)}))),h=c<0||c>=n.length?u:n[c],i[_]=h},_=0;_<c;_++)h()}},function(e,t,n,i,r){var a;i();var o=e(198),s=e(67),l=e(174),u=e(20),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"v_compute",value:function(e){var t=new Array(e.length);return(0,o.cat_v_compute)(e,this.factors,this.markers,t,this.start,this.end,this.default_value),t}}]),n}(l.Mapper);n.CategoricalMarkerMapper=c,a=c,c.__name__="CategoricalMarkerMapper",a.define((function(e){var t=e.Number,n=e.Array,i=e.Nullable;return{factors:[s.FactorSeq],markers:[n(u.MarkerType)],start:[t,0],end:[i(t),null],default_value:[u.MarkerType,"circle"]}}))},function(e,t,n,i,r){var a;i();var o=e(198),s=e(67),l=e(174),u=e(20),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"v_compute",value:function(e){var t=new Array(e.length);return(0,o.cat_v_compute)(e,this.factors,this.patterns,t,this.start,this.end,this.default_value),t}}]),n}(l.Mapper);n.CategoricalPatternMapper=c,a=c,c.__name__="CategoricalPatternMapper",a.define((function(e){var t=e.Number,n=e.Array,i=e.Nullable;return{factors:[s.FactorSeq],patterns:[n(u.HatchPatternType)],start:[t,0],end:[i(t),null],default_value:[u.HatchPatternType," "]}}))},function(e,t,n,i,r){i();var a=e(172),o=e(12),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"scan",value:function(e,t){var n=null!=this.low?this.low:(0,o.min)(e),i=null!=this.high?this.high:(0,o.max)(e);return{max:i,min:n,norm_factor:1/(i-n),normed_interval:1/t}}},{key:"cmap",value:function(e,t,n,i,r){var a=t.length-1;if(e==r.max)return t[a];
2var o=(e-r.min)*r.norm_factor,s=Math.floor(o/r.normed_interval);return s<0?n:s>a?i:t[s]}}]),n}(a.ContinuousColorMapper);n.LinearColorMapper=s,s.__name__="LinearColorMapper"},function(e,t,n,i,r){i();var a=e(172),o=e(12),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"scan",value:function(e,t){var n=null!=this.low?this.low:(0,o.min)(e),i=null!=this.high?this.high:(0,o.max)(e);return{max:i,min:n,scale:t/(Math.log(i)-Math.log(n))}}},{key:"cmap",value:function(e,t,n,i,r){var a=t.length-1;if(e>r.max)return i;if(e==r.max)return t[a];if(e<r.min)return n;var o=Math.log(e)-Math.log(r.min),s=Math.floor(o*r.scale);return s>a&&(s=a),t[s]}}]),n}(a.ContinuousColorMapper);n.LogColorMapper=s,s.__name__="LogColorMapper"},function(e,t,n,i,r){var a;i();var o=e(171),s=e(12),l=e(9),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"scan",value:function(e,t){for(var n=null!=this.low?this.low:(0,s.min)(e),i=null!=this.high?this.high:(0,s.max)(e),r=this.bins,a=(0,l.linspace)(n,i,r+1),o=(0,s.bin_counts)(e,a),u=0,c=0;c<r;c++)0!=o[c]&&u++;for(var h=new Array(u+1),_=new Array(u+1),d=0,f=1;d<r;d++)0!=o[d]&&(h[f]=o[d],_[f]=(a[d]+a[d+1])/2,f++);h[0]=0,_[0]=2*_[1]-_[u];for(var v=(0,l.cumsum)(h),p=v[1],m=v[u]-p,y=1;y<=u;y++)v[y]=(v[y]-p)/m;v[0]=-1;var g=0;if(this.rescale_discrete_levels){var b=-.5/98,w=b*u+(1.5-2*b);w>1&&(g=1-w)}var x=(0,l.linspace)(g,1,t+1),k=(0,s.interpolate)(x,v,_);return this.rescale_discrete_levels?n=k[0]:k[0]=n,k[k.length-1]=i,{min:n,max:i,binning:k}}}]),n}(o.ScanningColorMapper);n.EqHistColorMapper=u,a=u,u.__name__="EqHistColorMapper",a.define((function(e){var t=e.Boolean;return{bins:[e.Int,65536],rescale_discrete_levels:[t,!1]}}))},function(e,t,n,i,r){i(),r("CategoricalScale",e(62).CategoricalScale),r("ContinuousScale",e(60).ContinuousScale),r("LinearScale",e(59).LinearScale),r("LinearInterpolationScale",e(205).LinearInterpolationScale),r("LogScale",e(61).LogScale),r("Scale",e(55).Scale)},function(e,t,n,i,r){var a;i();var o=e(55),s=e(59),l=e(12),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this);var t=this.properties,i=t.source_range,r=t.target_range;this.on_change([i,r],(function(){e.linear_scale=new s.LinearScale({source_range:e.source_range,target_range:e.target_range})}))}},{key:"s_compute",get:function(){throw new Error("not implemented")}},{key:"s_invert",get:function(){throw new Error("not implemented")}},{key:"compute",value:function(e){return e}},{key:"v_compute",value:function(e){for(var t=this.binning,n=this.source_range,i=n.start,r=n.end,a=i,o=r,s=t.length,u=(r-i)/(s-1),c=new Float64Array(s),h=0;h<s;h++)c[h]=i+h*u;var _=(0,l.map)(e,(function(e){if(e<a)return a;if(e>o)return o;var n=(0,l.left_edge_index)(e,t);if(-1==n)return a;if(n>=s-1)return o;var i=t[n],r=(e-i)/(t[n+1]-i),u=c[n];return u+r*(c[n+1]-u)}));return this.linear_scale.v_compute(_)}},{key:"invert",value:function(e){return e}},{key:"v_invert",value:function(e){return new Float64Array(e)}}]),n}(o.Scale);n.LinearInterpolationScale=u,a=u,u.__name__="LinearInterpolationScale",a.internal((function(e){return{binning:[e.Arrayable],linear_scale:[(0,e.Ref)(s.LinearScale),function(e){return new s.LinearScale({source_range:e.source_range,target_range:e.target_range})}]}}))},function(e,t,n,i,r){i(),r("DataRange",e(64).DataRange),r("DataRange1d",e(63).DataRange1d),r("FactorRange",e(67).FactorRange),r("Range",e(57).Range),r("Range1d",e(58).Range1d)},function(e,t,n,i,r){i();var a=e(124);r("Sizeable",a.Sizeable),r("SizingPolicy",a.SizingPolicy);var o=e(125);r("Layoutable",o.Layoutable),r("LayoutItem",o.LayoutItem);var s=e(208);r("HStack",s.HStack),r("VStack",s.VStack);var l=e(209);r("Grid",l.Grid),r("Row",l.Row),r("Column",l.Column);var u=e(210);r("ContentBox",u.ContentBox),r("VariadicBox",u.VariadicBox)},function(e,t,n,i,r){i();var a=e(125),o=e(65),s=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(){var e;return(0,g.Z)(this,i),(e=n.apply(this,arguments)).children=[],e}return(0,b.Z)(i,[{key:t,value:(0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.children,"t0",1);case 1:case"end":return e.stop()}}),e,this)}))}]),i}(a.Layoutable,Symbol.iterator);n.Stack=s,s.__name__="Stack";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_measure",value:function(e){var t,n=0,i=0,r=(0,w.Z)(this.children);try{for(r.s();!(t=r.n()).done;){var a=t.value.measure({width:0,height:0});n+=a.width,i=Math.max(i,a.height)}}catch(o){r.e(o)}finally{r.f()}return{width:n,height:i}}},{key:"_set_geometry",value:function(e,t){(0,_.Z)((0,d.Z)(n.prototype),"_set_geometry",this).call(this,e,t);
2var i,r=this.absolute?e.top:0,a=this.absolute?e.left:0,s=e.height,l=(0,w.Z)(this.children);try{for(l.s();!(i=l.n()).done;){var u=i.value,c=u.measure({width:0,height:0}).width;u.set_geometry(new o.BBox({left:a,width:c,top:r,height:s})),a+=c}}catch(h){l.e(h)}finally{l.f()}}}]),n}(s);n.HStack=l,l.__name__="HStack";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_measure",value:function(e){var t,n=0,i=0,r=(0,w.Z)(this.children);try{for(r.s();!(t=r.n()).done;){var a=t.value.measure({width:0,height:0});n=Math.max(n,a.width),i+=a.height}}catch(o){r.e(o)}finally{r.f()}return{width:n,height:i}}},{key:"_set_geometry",value:function(e,t){(0,_.Z)((0,d.Z)(n.prototype),"_set_geometry",this).call(this,e,t);var i,r=this.absolute?e.left:0,a=this.absolute?e.top:0,s=e.width,l=(0,w.Z)(this.children);try{for(l.s();!(i=l.n()).done;){var u=i.value,c=u.measure({width:0,height:0}).height;u.set_geometry(new o.BBox({top:a,height:c,left:r,width:s})),a+=c}}catch(h){l.e(h)}finally{l.f()}}}]),n}(s);n.VStack=u,u.__name__="VStack";var c=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(){var e;return(0,g.Z)(this,i),(e=n.apply(this,arguments)).children=[],e}return(0,b.Z)(i,[{key:t,value:(0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.children,"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"_measure",value:function(e){var t,n=this,i=this.sizing,r=i.width_policy,a=i.height_policy,o=Math.min,s=Math.max,l=0,u=0,c=(0,w.Z)(this.children);try{for(c.s();!(t=c.n()).done;){var h=t.value.measure(e),_=h.width,d=h.height;l=s(l,_),u=s(u,d)}}catch(f){c.e(f)}finally{c.f()}return{width:function(){var t=n.sizing.width;if(e.width==1/0)return"fixed"==r&&null!=t?t:l;switch(r){case"fixed":return null!=t?t:l;case"min":return l;case"fit":return null!=t?o(e.width,t):e.width;case"max":return null!=t?s(e.width,t):e.width}}(),height:function(){var t=n.sizing.height;if(e.height==1/0)return"fixed"==a&&null!=t?t:u;switch(a){case"fixed":return null!=t?t:u;case"min":return u;case"fit":return null!=t?o(e.height,t):e.height;case"max":return null!=t?s(e.height,t):e.height}}()}}},{key:"_set_geometry",value:function(e,t){(0,_.Z)((0,d.Z)(i.prototype),"_set_geometry",this).call(this,e,t);var n,r=this.absolute?e:e.relative(),a=r.left,s=r.right,l=r.top,u=r.bottom,c=Math.round(r.vcenter),h=Math.round(r.hcenter),f=(0,w.Z)(this.children);try{var v=function(){var t=n.value,i=t.sizing,r=i.margin,_=i.halign,d=i.valign,f=t.measure(e),v=f.width,p=f.height,m=f.inner,y=function(){switch("".concat(d,"_").concat(_)){case"start_start":return new o.BBox({left:a+r.left,top:l+r.top,width:v,height:p});case"start_center":return new o.BBox({hcenter:h,top:l+r.top,width:v,height:p});case"start_end":return new o.BBox({right:s-r.right,top:l+r.top,width:v,height:p});case"center_start":return new o.BBox({left:a+r.left,vcenter:c,width:v,height:p});case"center_center":return new o.BBox({hcenter:h,vcenter:c,width:v,height:p});case"center_end":return new o.BBox({right:s-r.right,vcenter:c,width:v,height:p});case"end_start":return new o.BBox({left:a+r.left,bottom:u-r.bottom,width:v,height:p});case"end_center":return new o.BBox({hcenter:h,bottom:u-r.bottom,width:v,height:p});case"end_end":return new o.BBox({right:s-r.right,bottom:u-r.bottom,width:v,height:p})}}(),g=null==m?y:new o.BBox({left:y.left+m.left,top:y.top+m.top,right:y.right-m.right,bottom:y.bottom-m.bottom});t.set_geometry(y,g)};for(f.s();!(n=f.n()).done;)v()}catch(p){f.e(p)}finally{f.f()}}}]),i}(a.Layoutable,Symbol.iterator);n.NodeLayout=c,c.__name__="NodeLayout"},function(e,t,n,i,r){i();var a=e(124),o=e(125),s=e(8),l=e(65),u=e(9),c=Math.max,h=Math.round,f=function(){function e(t){(0,g.Z)(this,e),this.def=t,this._map=new Map}return(0,b.Z)(e,[{key:"get",value:function(e){var t=this._map.get(e);return void 0===t&&(t=this.def(),this._map.set(e,t)),t}},{key:"apply",value:function(e,t){var n=this.get(e);this._map.set(e,t(n))}}]),e}();f.__name__="DefaultMap";var m=function(){function e(){(0,g.Z)(this,e),this._items=[],this._nrows=0,this._ncols=0}return(0,b.Z)(e,[{key:"nrows",get:function(){return this._nrows}},{key:"ncols",get:function(){return this._ncols}},{key:"add",value:function(e,t){var n=e.r1,i=e.c1;this._nrows=c(this._nrows,n+1),this._ncols=c(this._ncols,i+1),this._items.push({span:e,data:t})}},{key:"at",value:function(e,t){return this._items.filter((function(n){var i=n.span;return i.r0<=e&&e<=i.r1&&i.c0<=t&&t<=i.c1})).map((function(e){return e.data}))}},{key:"row",value:function(e){return this._items.filter((function(t){var n=t.span;return n.r0<=e&&e<=n.r1})).map((function(e){return e.data}))}},{key:"col",value:function(e){return this._items.filter((function(t){var n=t.span;return n.c0<=e&&e<=n.c1})).map((function(e){return e.data}))}},{key:"foreach",value:function(e){var t,n=(0,w.Z)(this._items);try{for(n.s();!(t=n.n()).done;){var i=t.value;e(i.span,i.data)}}catch(r){n.e(r)}finally{n.f()}}},{key:"map",value:function(t){var n,i=new e,r=(0,w.Z)(this._items);try{for(r.s();!(n=r.n()).done;){var a=n.value,o=a.span,s=a.data;i.add(o,t(o,s))}}catch(l){r.e(l)}finally{r.f()}return i}}]),e}();m.__name__="Container";var y=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,g.Z)(this,i),(e=n.call(this)).items=t,e.rows="auto",e.cols="auto",e.spacing=0,e}return(0,b.Z)(i,[{key:t,value:(0,x.Z)().mark((function e(){var t,n,i;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=(0,w.Z)(this.items),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return i=n.value.layout,e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:"is_width_expanding",value:function(){if((0,_.Z)((0,d.Z)(i.prototype),"is_width_expanding",this).call(this))return!0;
2if("fixed"==this.sizing.width_policy)return!1;var e=this._state.cols;return(0,u.some)(e,(function(e){return"max"==e.policy}))}},{key:"is_height_expanding",value:function(){if((0,_.Z)((0,d.Z)(i.prototype),"is_height_expanding",this).call(this))return!0;if("fixed"==this.sizing.height_policy)return!1;var e=this._state.rows;return(0,u.some)(e,(function(e){return"max"==e.policy}))}},{key:"_init",value:function(){var e,t,n,r,a=this;(0,_.Z)((0,d.Z)(i.prototype),"_init",this).call(this);var o,l=new m,c=(0,w.Z)(this.items);try{for(c.s();!(o=c.n()).done;){var h=o.value,f=h.layout,v=h.row,p=h.col,y=h.row_span,g=h.col_span;if(f.sizing.visible){var b=v,x=p,Z=v+(null!=y?y:1)-1,A=p+(null!=g?g:1)-1;l.add({r0:b,c0:x,r1:Z,c1:A},f)}}}catch(P){c.e(P)}finally{c.f()}for(var S=l.nrows,T=l.ncols,M=new Array(S),C=function(n){var i=function(){var e,t=(0,s.isPlainObject)(a.rows)?null!==(e=a.rows[n])&&void 0!==e?e:a.rows["*"]:a.rows;return null==t?{policy:"auto"}:(0,s.isNumber)(t)?{policy:"fixed",height:t}:(0,s.isString)(t)?{policy:t}:t}(),r=null!==(e=i.align)&&void 0!==e?e:"auto";if("fixed"==i.policy)M[n]={policy:"fixed",height:i.height,align:r};else if("min"==i.policy)M[n]={policy:"min",align:r};else if("fit"==i.policy||"max"==i.policy)M[n]={policy:i.policy,flex:null!==(t=i.flex)&&void 0!==t?t:1,align:r};else{if("auto"!=i.policy)throw new Error("unrechable");(0,u.some)(l.row(n),(function(e){return e.is_height_expanding()}))?M[n]={policy:"max",flex:1,align:r}:M[n]={policy:"min",align:r}}},z=0;z<S;z++)C(z);for(var E=new Array(T),R=function(e){var t=function(){var t,n=(0,s.isPlainObject)(a.cols)?null!==(t=a.cols[e])&&void 0!==t?t:a.cols["*"]:a.cols;return null==n?{policy:"auto"}:(0,s.isNumber)(n)?{policy:"fixed",width:n}:(0,s.isString)(n)?{policy:n}:n}(),i=null!==(n=t.align)&&void 0!==n?n:"auto";if("fixed"==t.policy)E[e]={policy:"fixed",width:t.width,align:i};else if("min"==t.policy)E[e]={policy:"min",align:i};else if("fit"==t.policy||"max"==t.policy)E[e]={policy:t.policy,flex:null!==(r=t.flex)&&void 0!==r?r:1,align:i};else{if("auto"!=t.policy)throw new Error("unrechable");(0,u.some)(l.col(e),(function(e){return e.is_width_expanding()}))?E[e]={policy:"max",flex:1,align:i}:E[e]={policy:"min",align:i}}},B=0;B<T;B++)R(B);var N=(0,s.isNumber)(this.spacing)?[this.spacing,this.spacing]:this.spacing,O=(0,k.Z)(N,2),D=O[0],I=O[1];this._state={items:l,nrows:S,ncols:T,rows:M,cols:E,rspacing:D,cspacing:I}}},{key:"_measure_totals",value:function(e,t){var n=this._state,i=n.nrows,r=n.ncols,a=n.rspacing,o=n.cspacing;return{height:(0,u.sum)(e)+(i-1)*a,width:(0,u.sum)(t)+(r-1)*o}}},{key:"_measure_cells",value:function(e){for(var t=this._state,n=t.items,i=t.nrows,r=t.ncols,o=t.rows,s=t.cols,l=t.rspacing,u=t.cspacing,_=new Array(i),d=0;d<i;d++){var f=o[d];_[d]="fixed"==f.policy?f.height:0}for(var v=new Array(r),p=0;p<r;p++){var y=s[p];v[p]="fixed"==y.policy?y.width:0}var g=new m;return n.foreach((function(t,n){for(var i=t.r0,r=t.c0,d=t.r1,f=t.c1,p=(d-i)*l,m=(f-r)*u,y=0,b=i;b<=d;b++)y+=e(b,r).height;y+=p;for(var x=0,k=r;k<=f;k++)x+=e(i,k).width;x+=m;var Z=n.measure({width:x,height:y});g.add(t,{layout:n,size_hint:Z});var A=new a.Sizeable(Z).grow_by(n.sizing.margin);A.height-=p,A.width-=m;for(var S=[],T=i;T<=d;T++){var M=o[T];"fixed"==M.policy?A.height-=M.height:S.push(T)}if(A.height>0){var C,z=h(A.height/S.length),E=(0,w.Z)(S);try{for(E.s();!(C=E.n()).done;){var R=C.value;_[R]=c(_[R],z)}}catch(L){E.e(L)}finally{E.f()}}for(var B=[],N=r;N<=f;N++){var O=s[N];"fixed"==O.policy?A.width-=O.width:B.push(N)}if(A.width>0){var D,I=h(A.width/B.length),P=(0,w.Z)(B);try{for(P.s();!(D=P.n()).done;){var V=D.value;v[V]=c(v[V],I)}}catch(L){P.e(L)}finally{P.f()}}})),{size:this._measure_totals(_,v),row_heights:_,col_widths:v,size_hints:g}}},{key:"_measure_grid",value:function(e){var t,n=this._state,i=n.nrows,r=n.ncols,a=n.rows,o=n.cols,s=n.rspacing,l=n.cspacing,u=this._measure_cells((function(e,t){var n=a[e],i=o[t];return{width:"fixed"==i.policy?i.width:1/0,height:"fixed"==n.policy?n.height:1/0}}));t="fixed"==this.sizing.height_policy&&null!=this.sizing.height?this.sizing.height:e.height!=1/0&&this.is_height_expanding()?e.height:u.size.height;for(var _,d=0,f=0;f<i;f++){var v=a[f];"fit"==v.policy||"max"==v.policy?d+=v.flex:t-=u.row_heights[f]}if(t-=(i-1)*s,0!=d&&t>0)for(var p=0;p<i;p++){var m=a[p];if("fit"==m.policy||"max"==m.policy){var y=h(t*(m.flex/d));t-=y,u.row_heights[p]=y,d-=m.flex}}else if(t<0){for(var g=0,b=0;b<i;b++)"fixed"!=a[b].policy&&g++;for(var w=-t,x=0;x<i;x++)if("fixed"!=a[x].policy){var k=u.row_heights[x],Z=h(w/g);u.row_heights[x]=c(k-Z,0),w-=Z>k?k:Z,g--}}_="fixed"==this.sizing.width_policy&&null!=this.sizing.width?this.sizing.width:e.width!=1/0&&this.is_width_expanding()?e.width:u.size.width;for(var A=0,S=0;S<r;S++){var T=o[S];"fit"==T.policy||"max"==T.policy?A+=T.flex:_-=u.col_widths[S]}if(_-=(r-1)*l,0!=A&&_>0)for(var M=0;M<r;M++){var C=o[M];if("fit"==C.policy||"max"==C.policy){var z=h(_*(C.flex/A));_-=z,u.col_widths[M]=z,A-=C.flex}}else if(_<0){for(var E=0,R=0;R<r;R++)"fixed"!=o[R].policy&&E++;for(var B=-_,N=0;N<r;N++)if("fixed"!=o[N].policy){var O=u.col_widths[N],D=h(B/E);u.col_widths[N]=c(O-D,0),B-=D>O?O:D,E--}}var I=this._measure_cells((function(e,t){return{width:u.col_widths[t],height:u.row_heights[e]}})),P=I.row_heights,V=I.col_widths,L=I.size_hints;return{size:this._measure_totals(P,V),row_heights:P,col_widths:V,size_hints:L}}},{key:"_measure",value:function(e){return this._measure_grid(e).size}},{key:"_set_geometry",value:function(e,t){var n=this;(0,_.Z)((0,d.Z)(i.prototype),"_set_geometry",this).call(this,e,t);for(var r=this._state,a=r.nrows,o=r.ncols,s=r.rspacing,u=r.cspacing,v=this._measure_grid(e),p=v.row_heights,m=v.col_widths,y=v.size_hints,g=this._state.rows.map((function(e,t){return Object.assign(Object.assign({},e),{top:0,height:p[t],get bottom(){return this.top+this.height}})})),b=this._state.cols.map((function(e,t){return Object.assign(Object.assign({},e),{left:0,width:m[t],get right(){return this.left+this.width}})})),w=y.map((function(e,t){return Object.assign(Object.assign({},t),{outer:new l.BBox,inner:new l.BBox})})),x=0,k=this.absolute?e.top:0;x<a;x++){var Z=g[x];Z.top=k,k+=Z.height+s}for(var A=0,S=this.absolute?e.left:0;A<o;A++){var T=b[A];T.left=S,S+=T.width+u}w.foreach((function(e,t){var n=e.r0,i=e.c0,r=e.r1,a=e.c1,o=t.layout,c=t.size_hint,_=o.sizing,d=c.width,f=c.height,v=function(e,t){for(var n=(t-e)*u,i=e;i<=t;i++)n+=b[i].width;return n}(i,a),p=function(e,t){for(var n=(t-e)*s,i=e;i<=t;i++)n+=g[i].height;return n}(n,r),m=i==a&&"auto"!=b[i].align?b[i].align:_.halign,y=n==r&&"auto"!=g[n].align?g[n].align:_.valign,w=b[i].left;
2"start"==m?w+=_.margin.left:"center"==m?w+=h((v-d)/2):"end"==m&&(w+=v-_.margin.right-d);var x=g[n].top;"start"==y?x+=_.margin.top:"center"==y?x+=h((p-f)/2):"end"==y&&(x+=p-_.margin.bottom-f),t.outer=new l.BBox({left:w,top:x,width:d,height:f})}));var M=g.map((function(){return{start:new f((function(){return 0})),end:new f((function(){return 0}))}})),C=b.map((function(){return{start:new f((function(){return 0})),end:new f((function(){return 0}))}}));w.foreach((function(e,t){var n=e.r0,i=e.c0,r=e.r1,a=e.c1,o=t.size_hint,s=t.outer,l=o.inner;null!=l&&(M[n].start.apply(s.top,(function(e){return c(e,l.top)})),M[r].end.apply(g[r].bottom-s.bottom,(function(e){return c(e,l.bottom)})),C[i].start.apply(s.left,(function(e){return c(e,l.left)})),C[a].end.apply(b[a].right-s.right,(function(e){return c(e,l.right)})))})),w.foreach((function(e,t){var i=e.r0,r=e.c0,a=e.r1,o=e.c1,s=t.size_hint,u=t.outer,c=function(e){var t=n.absolute?u:u.relative(),i=t.left+e.left,r=t.top+e.top,a=t.right-e.right,o=t.bottom-e.bottom;return new l.BBox({left:i,top:r,right:a,bottom:o})};if(null!=s.inner){var h=c(s.inner);if(!1!==s.align){var _=M[i].start.get(u.top),d=M[a].end.get(g[a].bottom-u.bottom),f=C[r].start.get(u.left),v=C[o].end.get(b[o].right-u.right);try{h=c({top:_,bottom:d,left:f,right:v})}catch(i){}}t.inner=h}else t.inner=u})),w.foreach((function(e,t){var n=t.layout,i=t.outer,r=t.inner;n.set_geometry(i,r)}))}}]),i}(o.Layoutable,Symbol.iterator);n.Grid=y,y.__name__="Grid";var Z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).items=e.map((function(e,t){return{layout:e,row:0,col:t}})),i.rows="fit",i}return(0,b.Z)(n)}(y);n.Row=Z,Z.__name__="Row";var A=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).items=e.map((function(e,t){return{layout:e,row:t,col:0}})),i.cols="fit",i}return(0,b.Z)(n)}(y);n.Column=A,A.__name__="Column"},function(e,t,n,i,r){i();var a=e(125),o=e(124),s=e(43),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).content_size=(0,s.unsized)(e,(function(){return new o.Sizeable((0,s.size)(e))})),i}return(0,b.Z)(n,[{key:"_content_size",value:function(){return this.content_size}}]),n}(a.ContentLayoutable);n.ContentBox=l,l.__name__="ContentBox";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).el=e,i}return(0,b.Z)(n,[{key:"_measure",value:function(e){var t=this,n=new o.Sizeable(e).bounded_to(this.sizing.size);return(0,s.sized)(this.el,n,(function(){var e=new o.Sizeable((0,s.content_size)(t.el)),n=(0,s.extents)(t.el),i=n.border,r=n.padding;return e.grow_by(i).grow_by(r).map(Math.ceil)}))}}]),n}(a.Layoutable);n.VariadicBox=u,u.__name__="VariadicBox";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e))._cache=new Map,i}return(0,b.Z)(n,[{key:"_measure",value:function(e){var t=e.width,i=e.height,r="".concat(t,",").concat(i),a=this._cache.get(r);return null==a&&(a=(0,_.Z)((0,d.Z)(n.prototype),"_measure",this).call(this,e),this._cache.set(r,a)),a}},{key:"invalidate_cache",value:function(){this._cache.clear()}}]),n}(u);n.CachedVariadicBox=c,c.__name__="CachedVariadicBox"},function(e,t,n,i,r){i();var a=e(124),o=e(125),s=e(65),l=function(e,t){(0,v.Z)(i,e);var n=(0,p.Z)(i);function i(){var e;return(0,g.Z)(this,i),(e=n.apply(this,arguments)).min_border={left:0,top:0,right:0,bottom:0},e.padding={left:0,top:0,right:0,bottom:0},e}return(0,b.Z)(i,[{key:t,value:(0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.top_panel;case 2:return e.next=4,this.bottom_panel;case 4:return e.next=6,this.left_panel;case 6:return e.next=8,this.right_panel;case 8:return e.next=10,this.center_panel;case 10:case"end":return e.stop()}}),e,this)}))},{key:"_measure",value:function(e){var t=this;e=new a.Sizeable({width:"fixed"==this.sizing.width_policy||e.width==1/0?this.sizing.width:e.width,height:"fixed"==this.sizing.height_policy||e.height==1/0?this.sizing.height:e.height});var n=this.left_panel.measure({width:0,height:e.height}),i=Math.max(n.width,this.min_border.left)+this.padding.left,r=this.right_panel.measure({width:0,height:e.height}),o=Math.max(r.width,this.min_border.right)+this.padding.right,s=this.top_panel.measure({width:e.width,height:0}),l=Math.max(s.height,this.min_border.top)+this.padding.top,u=this.bottom_panel.measure({width:e.width,height:0}
2),c=Math.max(u.height,this.min_border.bottom)+this.padding.bottom,h=new a.Sizeable(e).shrink_by({left:i,right:o,top:l,bottom:c}),_=this.center_panel.measure(h);return{width:i+_.width+o,height:l+_.height+c,inner:{left:i,right:o,top:l,bottom:c},align:function(){var e=t.center_panel.sizing,n=e.width_policy,i=e.height_policy;return"fixed"!=n&&"fixed"!=i}()}}},{key:"_set_geometry",value:function(e,t){(0,_.Z)((0,d.Z)(i.prototype),"_set_geometry",this).call(this,e,t),this.center_panel.set_geometry(t);var n=this.left_panel.measure({width:0,height:e.height}),r=this.right_panel.measure({width:0,height:e.height}),a=this.top_panel.measure({width:e.width,height:0}),o=this.bottom_panel.measure({width:e.width,height:0}),l=t.left,u=t.top,c=t.right,h=t.bottom;this.top_panel.set_geometry(new s.BBox({left:l,right:c,bottom:u,height:a.height})),this.bottom_panel.set_geometry(new s.BBox({left:l,right:c,top:h,height:o.height})),this.left_panel.set_geometry(new s.BBox({top:u,bottom:h,right:l,width:n.width})),this.right_panel.set_geometry(new s.BBox({top:u,bottom:h,left:c,width:r.width}))}}]),i}(o.Layoutable,Symbol.iterator);n.BorderLayout=l,l.__name__="BorderLayout"},function(e,t,n,i,r){i();var a,o=e(1),s=e(119),l=e(10),u=e(20),c=e(120),h=e(123),_=(0,o.__importStar)(e(48)),d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"update_layout",value:function(){var e=this,t=this.panel;this.layout=null!=t?new h.SideLayout(t,(function(){return e.get_size()}),!1):void 0}},{key:"_get_size",value:function(){var e=this.model.text,t=new c.TextBox({text:e}),n=this.model,i=n.angle,r=n.angle_units;t.angle=(0,l.resolve_angle)(i,r),t.visuals=this.visuals.text.values();var a=t.size();return{width:a.width,height:a.height}}},{key:"_render",value:function(){var e=this.model,t=e.angle,n=e.angle_units,i=(0,l.resolve_angle)(t,n),r=null!=this.layout?this.layout:this.plot_view.frame,a=this.coordinates.x_scale,o=this.coordinates.y_scale,s="data"==this.model.x_units?a.compute(this.model.x):r.bbox.xview.compute(this.model.x),u="data"==this.model.y_units?o.compute(this.model.y):r.bbox.yview.compute(this.model.y);s+=this.model.x_offset,u-=this.model.y_offset,("canvas"==this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this))(this.layer.ctx,this.model.text,s,u,i)}}]),n}(s.TextAnnotationView);n.LabelView=d,d.__name__="LabelView";var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.TextAnnotation);n.Label=f,a=f,f.__name__="Label",a.prototype.default_view=d,a.mixins([_.Text,["border_",_.Line],["background_",_.Fill]]),a.define((function(e){var t=e.Number,n=e.String,i=e.Angle;return{x:[t],x_units:[u.SpatialUnits,"data"],y:[t],y_units:[u.SpatialUnits,"data"],text:[n,""],angle:[i,0],angle_units:[u.AngleUnits,"rad"],x_offset:[t,0],y_offset:[t,0]}})),a.override({background_fill_color:null,border_line_color:null})},function(e,t,n,i,r){i();var a,o=e(1),s=e(69),l=(0,o.__importStar)(e(48)),u=e(20),c=e(43),h=e(120),f=(0,o.__importStar)(e(18)),m=e(11),x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"set_data",value:function(e){var t;if((0,_.Z)((0,d.Z)(n.prototype),"set_data",this).call(this,e),null===(t=this.els)||void 0===t||t.forEach((function(e){return(0,c.remove)(e)})),"css"==this.model.render_mode){var i,r=this.els=(0,y.Z)(this.text).map((function(){return(0,c.div)({style:{display:"none"}})})),a=(0,w.Z)(r);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.plot_view.canvas_view.add_overlay(o)}}catch(s){a.e(s)}finally{a.f()}}else delete this.els}},{key:"remove",value:function(){var e;null===(e=this.els)||void 0===e||e.forEach((function(e){return(0,c.remove)(e)})),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"_rerender",value:function(){"css"==this.model.render_mode?this.render():this.request_render()}},{key:"map_data",value:function(){var e=this.coordinates,t=e.x_scale,n=e.y_scale,i=null!=this.layout?this.layout:this.plot_view.frame;this.sx="data"==this.model.x_units?t.v_compute(this._x):i.bbox.xview.v_compute(this._x),this.sy="data"==this.model.y_units?n.v_compute(this._y):i.bbox.yview.v_compute(this._y)}},{key:"paint",value:function(){for(var e="canvas"==this.model.render_mode?this._v_canvas_text.bind(this):this._v_css_text.bind(this),t=this.layer.ctx,n=0,i=this.text.length;n<i;n++){var r=this.x_offset.get(n),a=this.y_offset.get(n),o=this.sx[n]+r,s=this.sy[n]-a,l=this.angle.get(n);e(t,n,this.text.get(n),o,s,l)}}},{key:"_v_canvas_text",value:function(e,t,n,i,r,a){var o=new h.TextBox({text:n});o.angle=a,o.position={sx:i,sy:r}
2,o.visuals=this.visuals.text.values(t);var s=this.visuals,l=s.background_fill,u=s.border_line;if(l.doit||u.doit){var c=o.rect(),_=c.p0,d=c.p1,f=c.p2,v=c.p3;e.beginPath(),e.moveTo(_.x,_.y),e.lineTo(d.x,d.y),e.lineTo(f.x,f.y),e.lineTo(v.x,v.y),e.closePath(),this.visuals.background_fill.apply(e,t),this.visuals.border_line.apply(e,t)}this.visuals.text.doit&&o.paint(e)}},{key:"_v_css_text",value:function(e,t,n,i,r,a){var o=this;(0,m.assert)(null!=this.els);var s=this.els[t];s.textContent=n,this.visuals.text.set_vectorize(e,t),s.style.position="absolute",s.style.left="".concat(i,"px"),s.style.top="".concat(r,"px"),s.style.color=e.fillStyle,s.style.font=e.font,s.style.lineHeight="normal",s.style.whiteSpace="pre";var l=function(){switch(o.visuals.text.text_align.get(t)){case"left":return["left","0%"];case"center":return["center","-50%"];case"right":return["right","-100%"]}}(),u=(0,k.Z)(l,2),h=u[0],_=u[1],d=function(){switch(o.visuals.text.text_baseline.get(t)){case"top":return["top","0%"];case"middle":default:return["center","-50%"];case"bottom":return["bottom","-100%"]}}(),f=(0,k.Z)(d,2),v=f[0],p=f[1],y="translate(".concat(_,", ").concat(p,")");a&&(y+="rotate(".concat(a,"rad)")),s.style.transformOrigin="".concat(h," ").concat(v),s.style.transform=y,this.layout,this.visuals.background_fill.doit&&(this.visuals.background_fill.set_vectorize(e,t),s.style.backgroundColor=e.fillStyle),this.visual
2s.border_line.doit&&(this.visuals.border_line.set_vectorize(e,t),s.style.borderStyle=e.lineDash.length<2?"solid":"dashed",s.style.borderWidth="".concat(e.lineWidth,"px"),s.style.borderColor=e.strokeStyle),(0,c.display)(s)}}]),n}(s.DataAnnotationView);n.LabelSetView=x,x.__name__="LabelSetView";var Z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.DataAnnotation);n.LabelSet=Z,a=Z,Z.__name__="LabelSet",a.prototype.default_view=x,a.mixins([l.TextVector,["border_",l.LineVector],["background_",l.FillVector]]),a.define((function(){return{x:[f.XCoordinateSpec,{field:"x"}],y:[f.YCoordinateSpec,{field:"y"}],x_units:[u.SpatialUnits,"data"],y_units:[u.SpatialUnits,"data"],text:[f.StringSpec,{field:"text"}],angle:[f.AngleSpec,0],x_offset:[f.NumberSpec,{value:0}],y_offset:[f.NumberSpec,{value:0}],render_mode:[u.RenderMode,"canvas"]}})),a.override({background_fill_color:null,border_line_color:null})},function(e,t,n,i,r){i();var a,o=e(1),s=e(40),l=e(215),u=e(20),c=(0,o.__importStar)(e(48)),h=e(15),f=e(123),m=e(121),x=e(65),Z=e(9),A=e(8),S=e(11),T=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"update_layout",value:function(){var e=this,t=this.panel;this.layout=null!=t?new f.SideLayout(t,(function(){return e.get_size()})):void 0}},{key:"cursor",value:function(e,t){return"none"==this.model.click_policy?null:"pointer"}},{key:"legend_padding",get:function(){return null!=this.model.border_line_color?this.model.padding:0}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.change,(function(){return e.request_render()})),this.connect(this.model.item_change,(function(){return e.request_render()}))}},{key:"compute_legend_bbox",value:function(){var e=this.model.get_legend_names(),t=this.model,n=t.glyph_height,i=t.glyph_width,r=this.model,a=r.label_height,o=r.label_width;this.max_label_height=(0,Z.max)([(0,m.font_metrics)(this.visuals.label_text.font_value(
2)).height,a,n]);var s=this.layer.ctx;s.save(),this.visuals.label_text.set_value(s),this.text_widths=new Map;var l,u=(0,w.Z)(e);try{for(u.s();!(l=u.n()).done;){var c=l.value;this.text_widths.set(c,(0,Z.max)([s.measureText(c).width,o]))}}catch(L){u.e(L)}finally{u.f()}this.visuals.title_text.set_value(s),this.title_height=this.model.title?(0,m.font_metrics)(this.visuals.title_text.font_value()).height+this.model.title_standoff:0,this.title_width=this.model.title?s.measureText(this.model.title).width:0,s.restore();var h,_,d=Math.max((0,Z.max)((0,y.Z)(this.text_widths.values())),0),f=this.model.margin,v=this.legend_padding,p=this.model.spacing,g=this.model.label_standoff;if("vertical"==this.model.orientation)h=e.length*this.max_label_height+Math.max(e.length-1,0)*p+2*v+this.title_height,_=(0,Z.max)([d+i+g+2*v,this.title_width+2*v]);else{var b,T=2*v+Math.max(e.length-1,0)*p,M=(0,w.Z)(this.text_widths);try{for(M.s();!(b=M.n()).done;){var C=(0,k.Z)(b.value,2)[1];T+=(0,Z.max)([C,o])+i+g}}catch(L){M.e(L)}finally{M.f()}_=(0,Z.max)([this.title_width+2*v,T]),h=this.max_label_height+this.title_height+2*v}var z,E,R=null!=this.layout?this.layout:this.plot_view.frame,B=(0,k.Z)(R.bbox.ranges,2),N=B[0],O=B[1],D=this.model.location;if((0,A.isString)(D))switch(D){case"top_left":z=N.start+f,E=O.start+f;break;case"top":case"top_center":z=(N.end+N.start)/2-_/2,E=O.start+f;break;case"top_right":z=N.end-f-_,E=O.start+f;break;case"bottom_right":z=N.end-f-_,E=O.end-f-h;break;case"bottom":case"bottom_center":z=(N.end+N.start)/2-_/2,E=O.end-f-h;break;case"bottom_left":z=N.start+f,E=O.end-f-h;break;case"left":case"center_left":z=N.start+f,E=(O.end+O.start)/2-h/2;break;case"center":case"center_center":z=(N.end+N.start)/2-_/2,E=(O.end+O.start)/2-h/2;break;case"right":case"center_right":z=N.end-f-_,E=(O.end+O.start)/2-h/2}else if((0,A.isArray)(D)&&2==D.length){var I=(0,k.Z)(D,2),P=I[0],V=I[1];z=R.bbox.xview.compute(P),E=R.bbox.yview.compute(V)-h}else(0,S.unreachable)();return new x.BBox({left:z,top:E,width:_,height:h})}},{key:"interactive_bbox",value:function(){return this.compute_legend_bbox()}},{key:"interactive_hit",value:function(e,t){return this.interactive_bbox().contains(e,t)}},{key:"on_hit",value:function(e,t){var n,i,r=this.model.glyph_width,a=this.legend_padding,o=this.model.spacing,s=this.model.label_standoff,l=n=a,u=this.compute_legend_bbox(),c="vertical"==this.model.orientation,h=(0,w.Z)(this.model.items);try{for(h.s();!(i=h.n()).done;){var _,d=i.value,f=d.get_labels_list_from_label_prop(),v=(0,w.Z)(f);try{for(v.s();!(_=v.n()).done;){var p,m,y=_.value,g=u.x+l,b=u.y+n+this.title_height,Z=c?[u.width-2*a,this.max_label_height]:[this.text_widths.get(y)+r+s,this.max_label_height],A=(0,k.Z)(Z,2);if(p=A[0],m=A[1],new x.BBox({left:g,top:b,width:p,height:m}).contains(e,t)){switch(this.model.click_policy){case"hide":var S,T=(0,w.Z)(d.renderers);try{for(T.s();!(S=T.n()).done;){var M=S.value;M.visible=!M.visible}}catch(R){T.e(R)}finally{T.f()}break;case"mute":var C,z=(0,w.Z)(d.renderers);try{for(z.s();!(C=z.n()).done;){var E=C.value;E.muted=!E.muted}}catch(R){z.e(R)}finally{z.f()}}return!0}c?n+=this.max_label_height+o:l+=this.text_widths.get(y)+r+s+o}}catch(R){v.e(R)}finally{v.f()}}}catch(R){h.e(R)}finally{h.f()}return!1}},{key:"_render",value:function(){if(0!=this.model.items.length&&(0,Z.some)(this.model.items,(function(e){return e.visible}))){var e,t=(0,w.Z)(this.model.items);try{for(t.s();!(e=t.n()).done;){e.value.legend=this.model}}catch(r){t.e(r)}finally{t.f()}var n=this.layer.ctx,i=this.compute_legend_bbox();n.save(),this._draw_legend_box(n,i),this._draw_legend_items(n,i),this._draw_title(n,i),n.restore()}}},{key:"_draw_legend_box",value:function(e,t){e.beginPath(),e.rect(t.x,t.y,t.width,t.height),this.visual
2s.background_fill.apply(e),this.visuals.border_line.apply(e)}},{key:"_draw_legend_items",value:function(e,t){var n,i=this,r=this.model,a=r.glyph_width,o=r.glyph_height,s=this.legend_padding,l=this.model.spacing,u=this.model.label_standoff,c=s,h=s,_="vertical"==this.model.orientation,d=(0,w.Z)(this.model.items);try{var f=function(){var r=n.value;if(!r.visible)return"continue";var d=r.get_labels_list_from_label_prop(),f=r.get_field_from_label_prop();if(0==d.length)return"continue";var v,p=function(){switch(i.model.click_policy){case"none":return!0;case"hide":return(0,Z.every)(r.renderers,(function(e){return e.visible}));case"mute":return(0,Z.every)(r.renderers,(function(e){return!e.muted}))}}(),m=(0,w.Z)(d);try{for(m.s();!(v=m.n()).done;){var y=v.value,g=t.x+c,b=t.y+h+i.title_height,x=g+a,A=b+o;_?h+=i.max_label_height+l:c+=i.text_widths.get(y)+a+u+l,i.visuals.label_text.set_value(e),e.fillText(y,x+u,b+i.max_label_height/2);var S,T=(0,w.Z)(r.renderers);try{for(T.s();!(S=T.n()).done;){var M=S.value,C=i.plot_view.renderer_view(M);null==C||C.draw_legend(e,g,x,b,A,f,y,r.index)}}catch(N){T.e(N)}finally{T.f()}if(!p){var z,E,R,B;z=_?[t.width-2*s,i.max_label_height]:[i.text_widths.get(y)+a+u,i.max_label_height],R=(E=(0,k.Z)(z,2))[0],B=E[1],e.beginPath(),e.rect(g,b,R,B),i.visuals.inactive_fill.set_value(e),e.fill()}}}catch(N){m.e(N)}finally{m.f()}};for(d.s();!(n=d.n()).done;)f()}catch(v){d.e(v)}finally{d.f()}}},{key:"_draw_title",value:function(e,t){var n=this.model.title;
2n&&this.visuals.title_text.doit&&(e.save(),e.translate(t.x0,t.y0+this.title_height),this.visuals.title_text.set_value(e),e.fillText(n,this.legend_padding,this.legend_padding-this.model.title_standoff),e.restore())}},{key:"_get_size",value:function(){var e=this.compute_legend_bbox(),t=e.width,n=e.height;return{width:t+2*this.model.margin,height:n+2*this.model.margin}}}]),n}(s.AnnotationView);n.LegendView=T,T.__name__="LegendView";var M=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.item_change=new h.Signal0(this,"item_change")}},{key:"get_legend_names",value:function(){var e,t=[],n=(0,w.Z)(this.items);try{for(n.s();!(e=n.n()).done;){var i=e.value.get_labels_list_from_label_prop();t.push.apply(t,(0,y.Z)(i))}}catch(r){n.e(r)}finally{n.f()}return t}}]),n}(s.Annotation);n.Legend=M,a=M,M.__name__="Legend",a.prototype.default_view=T,a.mixins([["label_",c.Text],["title_",c.Text],["inactive_",c.Fill],["border_",c.Line],["background_",c.Fill]]),a.define((function(e){var t=e.Number,n=e.String,i=e.Array,r=e.Tuple,a=e.Or,o=e.Ref,s=e.Nullable;return{orientation:[u.Orientation,"vertical"],location:[a(u.LegendLocation,r(t,t)),"top_right"],title:[s(n),null],title_standoff:[t,5],label_standoff:[t,5],glyph_height:[t,20],glyph_width:[t,20],label_height:[t,20],label_width:[t,20],margin:[t,10],padding:[t,10],spacing:[t,3],items:[i(o(l.LegendItem)),[]],click_policy:[u.LegendClickPolicy,"none"]}})),a.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:"13px",label_text_baseline:"middle",title_text_font_size:"13px",title_text_font_style:"italic"})},function(e,t,n,i,r){i();var a,o=e(1),s=e(53),l=e(175),u=e(70),c=e(216),h=(0,o.__importStar)(e(18)),f=e(19),m=e(9),y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_check_data_sources_on_renderers",value:function(){if(null!=this.get_field_from_label_prop()){if(this.renderers.length<1)return!1;var e=this.renderers[0].data_source;if(null!=e){var t,n=(0,w.Z)(this.renderers);try{for(n.s();!(t=n.n()).done;){if(t.value.data_source!=e)return!1}}catch(i){n.e(i)}finally{n.f()}}}return!0}},{key:"_check_field_label_on_data_source",value:function(){var e=this.get_field_from_label_prop();if(null!=e){if(this.renderers.length<1)return!1;var t=this.renderers[0].data_source;if(null!=t&&!(0,m.includes)(t.columns(),e))return!1}return!0}},{key:"initialize",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.legend=null,this.connect(this.change,(function(){var t;return null===(t=e.legend)||void 0===t?void 0:t.item_change.emit()})),this._check_data_sources_on_renderers()||f.logger.error("Non matching data sources on legend item renderers"),this._check_field_label_on_data_source()||f.logger.error("Bad column name on label: ".concat(this.label))}},{key:"get_field_from_label_prop",value:function(){var e=this.label;return(0,c.isField)(e)?e.field:null}},{key:"get_labels_list_from_label_prop",value:function(){if(!this.visible)return[];if((0,c.isValue)(this.label)){var e=this.label.value;return null!=e?[e]:[]}var t=this.get_field_from_label_prop();if(null!=t){var n;if(!this.renderers[0]||null==this.renderers[0].data_source)return["No source found"];if((n=this.renderers[0].data_source)instanceof u.ColumnarDataSource){var i=n.get_column(t);return null!=i?(0,m.uniq)(Array.from(i)):["Invalid field"]}}return[]}}]),n}(s.Model);n.LegendItem=y,a=y,y.__name__="LegendItem",a.define((function(e){var t=e.Boolean,n=e.Int,i=e.Array,r=e.Ref,a=e.Nullable;return{label:[h.NullStringSpec,null],renderers:[i(r(l.GlyphRenderer)),[]],index:[a(n),null],visible:[t,!0]}}))},function(e,t,n,i,r){i();var a=e(8);n.isValue=function(e){return(0,a.isPlainObject)(e)&&"value"in e},n.isField=function(e){return(0,a.isPlainObject)(e)&&"field"in e},n.isExpr=function(e){return(0,a.isPlainObject)(e)&&"expr"in e}},function(e,t,n,i,r){i();var a,o=e(1),s=e(40),l=(0,o.__importStar)(e(48)),u=e(20),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}
2return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.change,(function(){return e.request_render()}))}},{key:"_render",value:function(){var e=this.model,t=e.xs,n=e.ys;if(t.length==n.length){var i=t.length;if(!(i<3)){var r=this.plot_view.frame,a=this.layer.ctx,o=this.coordinates.x_scale,s=this.coordinates.y_scale,l=this.model.screen,u=_(t,this.model.xs_units,o,r.bbox.xview),c=_(n,this.model.ys_units,s,r.bbox.yview);a.beginPath();for(var h=0;h<i;h++)a.lineTo(u[h],c[h]);a.closePath(),this.visuals.fill.apply(a),this.visuals.hatch.apply(a),this.visuals.line.apply(a)}}function _(e,t,n,i){return l?e:"data"==t?n.v_compute(e):i.v_compute(e)}}}]),n}(s.AnnotationView);n.PolyAnnotationView=c,c.__name__="PolyAnnotationView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"update",value:function(e){var t=e.xs,n=e.ys;this.setv({xs:t,ys:n,screen:!0},{check_eq:!1})}}]),n}(s.Annotation);n.PolyAnnotation=h,a=h,h.__name__="PolyAnnotation",a.prototype.default_view=c,a.mixins([l.Line,l.Fill,l.Hatch]),a.define((function(e){var t=e.Number,n=e.Array;return{xs:[n(t),[]],xs_units:[u.SpatialUnits,"data"],ys:[n(t),[]],ys_units:[u.SpatialUnits,"data"]}})),a.internal((function(e){return{screen:[e.Boolean,!1]}})),a.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(e,t,n,i,r){i();var a,o=e(1),s=e(40),l=(0,o.__importStar)(e(48)),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.change,(function(){return e.request_render()}))}},{key:"_render",value:function(){var e=this.model,t=e.gradient,n=e.y_intercept;if(null!=t&&null!=n){var i,r,a,o,s=this.plot_view.frame,l=this.coordinates.x_scale,u=this.coordinates.y_scale;if(0==t)r=i=u.compute(n),o=(a=s.bbox.left)+s.bbox.width;else{r=(i=s.bbox.top)+s.bbox.height;var c=(u.invert(i)-n)/t,h=(u.invert(r)-n)/t;a=l.compute(c),o=l.compute(h)}var _=this.layer.ctx;
2_.save(),_.beginPath(),this.visuals.line.set_value(_),_.moveTo(a,i),_.lineTo(o,r),_.stroke(),_.restore()}}}]),n}(s.AnnotationView);n.SlopeView=u,u.__name__="SlopeView";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.Annotation);n.Slope=c,a=c,c.__name__="Slope",a.prototype.default_view=u,a.mixins(l.Line),a.define((function(e){var t=e.Number,n=e.Nullable;return{gradient:[n(t),null],y_intercept:[n(t),null]}})),a.override({line_color:"black"})},function(e,t,n,i,r){i();var a,o=e(1),s=e(40),l=(0,o.__importStar)(e(48)),u=e(20),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.change,(function(){return e.plot_view.request_paint(e)}))}},{key:"_render",value:function(){var e=this,t=this.model.location;if(null!=t){var n,i,r,a,o=this.plot_view.frame,s=this.coordinates.x_scale,l=this.coordinates.y_scale,u=function(n,i){return"data"==e.model.location_units?n.compute(t):e.model.for_hover?t:i.compute(t)};"width"==this.model.dimension?(r=u(l,o.bbox.yview),i=o.bbox.left,a=o.bbox.width,n=this.model.line_width):(r=o.bbox.top,i=u(s,o.bbox.xview),a=this.model.line_width,n=o.bbox.height);var c=this.layer.ctx;
2c.save(),c.beginPath(),this.visuals.line.set_value(c),c.moveTo(i,r),"width"==this.model.dimension?c.lineTo(i+a,r):c.lineTo(i,r+n),c.stroke(),c.restore()}}}]),n}(s.AnnotationView);n.SpanView=c,c.__name__="SpanView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.Annotation);n.Span=h,a=h,h.__name__="Span",a.prototype.default_view=c,a.mixins(l.Line),a.define((function(e){var t=e.Number,n=e.Nullable;return{render_mode:[u.RenderMode,"canvas"],location:[n(t),null],location_units:[u.SpatialUnits,"data"],dimension:[u.Dimension,"width"]}})),a.internal((function(e){return{for_hover:[e.Boolean,!1]}})),a.override({line_color:"black"})},function(e,t,n,i,r){var a;i();var o=e(40),s=e(221),l=e(113),u=e(43),c=e(123),h=e(65),f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._invalidate_toolbar=!0,e._previous_bbox=new h.BBox,e}return(0,b.Z)(n,[{key:"update_layout",value:function(){var e=this;this.layout=new c.SideLayout(this.panel,(function(){return e.get_size()}),!0)}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.el=(0,u.div)(),this.plot_view.canvas_view.add_event(this.el)}},{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t=this;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:return e.next=4,(0,l.build_view)(this.model.toolbar,{parent:this});case 4:this._toolbar_view=e.sent,this.plot_view.visibility_callbacks.push((function(e){return t._toolbar_view.set_visibility(e)}));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"remove",value:function(){this._toolbar_view.remove(),(0,u.remove)(this.el),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"render",value:function(){this.model.visible||(0,u.undisplay)(this.el),(0,_.Z)((0,d.Z)(n.prototype),"render",this).call(this)}},{key:"_render",value:function(){var e=this.layout.bbox;this._previous_bbox.equals(e)||((0,u.position)(this.el,e),this._previous_bbox=e,this._invalidate_toolbar=!0),this._invalidate_toolbar&&(this.el.style.position="absolute",this.el.style.overflow="hidden",(0,u.empty)(this.el),this.el.appendChild(this._toolbar_view.el),this._toolbar_view.layout.bbox=e,this._toolbar_view.render(),this._invalidate_toolbar=!1),(0,u.display)(this.el)}},{key:"_get_size",value:function(){var e=this.model.toolbar,t=e.tools,n=e.logo;return{width:30*t.length+(null!=n?25:0)+15,height:30}}}]),n}(o.AnnotationView);n.ToolbarPanelView=f,f.__name__="ToolbarPanelView";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Annotation);n.ToolbarPanel=m,a=m,m.__name__="ToolbarPanel",a.prototype.default_view=f,a.define((function(e){return{toolbar:[(0,e.Ref)(s.Toolbar)]}}))},function(e,t,n,i,r){var a;i();var o=e(8),s=e(9),l=e(13),u=e(222),c=e(223),h=e(232),f=e(233);function m(e){switch(e){case"tap":return"active_tap";case"pan":return"active_drag";case"pinch":case"scroll":return"active_scroll";case"multi":return"active_multi"}return null}function y(e){return"tap"==e||"pan"==e}n.Drag=u.Tool,n.Inspection=u.Tool,n.Scroll=u.Tool,n.Tap=u.Tool;var x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this);var t=this.properties,i=t.tools,r=t.active_drag,a=t.active_inspect,o=t.active_scroll,s=t.active_tap,l=t.active_multi;this.on_change([i,r,a,o,s,l],(function(){return e._init_tools()}))}},{key:"_init_tools",value:function(){var e=this;if((0,_.Z)((0,d.Z)(n.prototype),"_init_tools",this).call(this),"auto"==this.active_inspect);else if(this.active_inspect instanceof h.InspectTool){var t,i=!1,r=(0,w.Z)(this.inspectors);try{for(r.s();!(t=r.n()).done;){var a=t.value;a!=this.active_inspect?a.active=!1:i=!0}}catch(D){r.e(D)}finally{r.f()}i||(this.active_inspect=null)}else if((0,o.isArray)(this.active_inspect)){var u=(0,s.intersection)(this.active_inspect,this.inspectors);u.length!=this.active_inspect.length&&(this.active_inspect=u);var c,f=(0,w.Z)(this.inspectors);try{for(f.s();!(c=f.n()).done;){var v=c.value;(0,s.includes)(this.active_inspect,v)||(v.active=!1)}}catch(D){f.e(D)}finally{f.f()}}else if(null==this.active_inspect){var p,g=(0,w.Z)(this.inspectors);try{for(g.s();!(p=g.n()).done;){p.value.active=!1}}catch(D){g.e(D)}finally{g.f()}}var b,x=function(t){t.active?e._active_change(t):t.active=!0},Z=(0,w.Z)((0,l.values)(this.gestures));try{for(Z.s();!(b=Z.n()).done;){var A=b.value;A.tools=(0,s.sort_by)(A.tools,(function(e){return e.default_order}));var S,T=(0,w.Z)(A.tools);try{var M=function(){var t=S.value;e.connect(t.properties.active.change,(function(){return e._active_change(t)}
2))};for(T.s();!(S=T.n()).done;)M()}catch(D){T.e(D)}finally{T.f()}}}catch(D){Z.e(D)}finally{Z.f()}var C,z=(0,w.Z)((0,l.entries)(this.gestures));try{for(z.s();!(C=z.n()).done;){var E=(0,k.Z)(C.value,2),R=E[0],B=E[1],N=m(R);if(N){var O=this[N];"auto"==O?0!=B.tools.length&&y(R)&&x(B.tools[0]):null!=O&&((0,s.includes)(this.tools,O)?x(O):this[N]=null)}}}catch(D){z.e(D)}finally{z.f()}}}]),n}(f.ToolbarBase);n.Toolbar=x,a=x,x.__name__="Toolbar",a.prototype.default_view=f.ToolbarBaseView,a.define((function(e){var t=e.Or,i=e.Ref,r=e.Auto,a=e.Null;return{active_drag:[t(i(n.Drag),r,a),"auto"],active_inspect:[t(i(n.Inspection),r,a),"auto"],active_scroll:[t(i(n.Scroll),r,a),"auto"],active_tap:[t(i(n.Tap),r,a),"auto"],active_multi:[t(i(c.GestureTool),r,a),"auto"]}}))},function(e,t,n,i,r){var a;i();var o=e(42),s=e(9),l=e(53),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"plot_view",get:function(){return this.parent}},{key:"plot_model",get:function(){return this.parent.model}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.properties.active.change,(function(){e.model.active?e.activate():e.deactivate()}))}},{key:"activate",value:function(){}},{key:"deactivate",value:function(){}}]),n}(o.View);n.ToolView=u,u.__name__="ToolView";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"synthetic_renderers",get:function(){return[]}},{key:"_get_dim_limits",value:function(e,t,n,i){var r,a=(0,k.Z)(e,2),o=a[0],l=a[1],u=(0,k.Z)(t,2),c=u[0],h=u[1],_=n.bbox.h_range;"width"==i||"both"==i?(r=[(0,s.min)([o,c]),(0,s.max)([o,c])],r=[(0,s.max)([r[0],_.start]),(0,s.min)([r[1],_.end])]):r=[_.start,_.end];var d,f=n.bbox.v_range;return"height"==i||"both"==i?(d=[(0,s.min)([l,h]),(0,s.max)([l,h])],d=[(0,s.max)([d[0],f.start]),(0,s.min)([d[1],f.end])]):d=[f.start,f.end],[r,d
2]}}],[{key:"register_alias",value:function(e,t){this.prototype._known_aliases.set(e,t)}},{key:"from_string",value:function(e){var t=this.prototype._known_aliases.get(e);if(null!=t)return t();var n=(0,y.Z)(this.prototype._known_aliases.keys());throw new Error("unexpected tool name '".concat(e,"', possible tools are ").concat(n.join(", ")))}}]),n}(l.Model);n.Tool=c,a=c,c.__name__="Tool",a.prototype._known_aliases=new Map,a.define((function(e){var t=e.String;return{description:[(0,e.Nullable)(t),null]}})),a.internal((function(e){return{active:[e.Boolean,!1]}}))},function(e,t,n,i,r){i();var a=e(224),o=e(231),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(a.ButtonToolView);n.GestureToolView=s,s.__name__="GestureToolView";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).button_view=o.OnOffButtonView,i}return(0,b.Z)(n)}(a.ButtonTool);n.GestureTool=l,l.__name__="GestureTool"},function(e,t,n,i,r){i();var a,o=e(1),s=(0,o.__importDefault)(e(225)),l=e(226),u=e(222),c=e(43),h=e(34),f=e(8),m=e(9),w=(0,o.__importStar)(e(227)),x=w,k=(0,o.__importDefault)(e(228)),Z=(0,o.__importDefault)(e(229)),A=e(230),S=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"initialize",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this);var t=this.model.menu;if(null!=t){var i=this.parent.model.toolbar_location,r="left"==i||"above"==i,a=this.parent.model.horizontal?"vertical":"horizontal";this._menu=new A.ContextMenu(r?(0,m.reversed)(t):t,{orientation:a,prevent_hide:function(t){return t.target==e.el}})}this._hammer=new s.default(this.el,{touchAction:"auto",inputClass:s.default.TouchMouseInput}),this.connect(this.model.change,(function(){return e.render()})),this._hammer.on("tap",(function(t){var n;(null===(n=e._menu)||void 0===n?void 0:n.is_open)?e._menu.hide():t.target==e.el&&e._clicked()})),this._hammer.on("press",(function(){return e._pressed()})),this.el.addEventListener("keydown",(function(t){t.keyCode==c.Keys.Enter&&e._clicked()}))}},{key:"remove",value:function(){var e;this._hammer.destroy(),null===(e=this._menu)||void 0===e||e.remove(),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"styles",value:function(){return[].concat((0,y.Z)((0,_.Z)((0,d.Z)(n.prototype),"styles",this).call(this)),[w.default,k.default,Z.default])}},{key:"css_classes",value:function(){return(0,_.Z)((0,d.Z)(n.prototype),"css_classes",this).call(this).concat(x.toolbar_button)}},{key:"render",value:function(){(0,c.empty)(this.el);var e=this.model.computed_icon;(0,f.isString)(e)&&((0,h.startsWith)(e,"data:image")?this.el.style.backgroundImage='url("'.concat(e,'")'):this.el.classList.add(e)),this.el.title=this.model.tooltip,this.el.tabIndex=0,null!=this._menu&&this.root.el.appendChild(this._menu.el)}},{key:"_pressed",value:function(){var e,t=this,n=function(){switch(t.parent.model.toolbar_location){case"right":return{left_of:t.el};case"left":return{right_of:t.el};case"above":return{below:t.el};case"below":return{above:t.el}}}();null===(e=this._menu)||void 0===e||e.toggle(n)}}]),n}(l.DOMView);n.ButtonToolButtonView=S,S.__name__="ButtonToolButtonView";var T=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(u.ToolView);n.ButtonToolView=T,T.__name__="ButtonToolView";var M=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_get_dim_tooltip",value:function(e){var t=this.description,n=this.tool_name;return null!=t?t:"both"==e?n:"".concat(n," (").concat("width"==e?"x":"y","-axis)")}},{key:"tooltip",get:function(){var e;return null!==(e=this.description)&&void 0!==e?e:this.tool_name}},{key:"computed_icon",get:function(){return this.icon}},{key:"menu",get:function(){return null}}]),n}(u.Tool);n.ButtonTool=M,a=M,M.__name__="ButtonTool",a.internal((function(e){return{disabled:[e.Boolean,!1]}}))},function(e,t,i,r,a){!function(e,i,r,a){var o,s=["","webkit","Moz","MS","ms","o"],l=i.createElement("div"),u=Math.round,c=Math.abs,h=Date.now;function _(e,t,n){return setTimeout(g(e,n),t)}function d(e,t,n){return!!Array.isArray(e)&&(f(e,n[t],n),!0)}function f(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==a)for(i=0;i<e.length;)t.call(n,e[i],i,e),i++;else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function v(t,n,i){var r="DEPRECATED METHOD: "+n+"\n"+i+" AT \n";return function(){var n=new Error("get-stack-trace"),i=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=e.console&&(e.console.warn||e.console.log);return a&&a.call(e.console,r,i),t.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===a||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==a&&null!==i)for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}return t}:Object.assign;var p=v((function(e,t,n){for(var i=Object.keys(t),r=0;r<i.length;)(!n||n&&e[i[r]]===a)&&(e[i[r]]=t[i[r]]),r++;return e}),"extend","Use `assign`."),m=v((function(e,t){return p(e,t,!0)}),"merge","Use `assign`.");function y(e,t,n){var i,r=t.prototype;(i=e.prototype=Object.create(r)).constructor=e,i._super=r,n&&o(i,n)}function g(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||a,t):e}function w(e,t){return e===a?t:e}function x(e,t,n){f(S(t),(function(t){e.addEventListener(t,n,!1)}))}
vendor: 19,566 bytes, line 2
2function k(e,t,n){f(S(t),(function(t){e.removeEventListener(t,n,!1)}))}function Z(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function A(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function T(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;i<e.length;){if(n&&e[i][n]==t||!n&&e[i]===t)return i;i++}return-1}function M(e){return Array.prototype.slice.call(e,0)}function C(e,t,n){for(var i=[],r=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];T(r,o)<0&&i.push(e[a]),r[a]=o,a++}return n&&(i=t?i.sort((function(e,n){return e[t]>n[t]})):i.sort()),i}function z(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),o=0;o<s.length;){if((i=(n=s[o])?n+r:t)in e)return i;o++}return a}var E=1;function R(t){var n=t.ownerDocument||t;return n.defaultView||n.parentWindow||e}var B="ontouchstart"in e,N=z(e,"PointerEvent")!==a,O=B&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),D="touch",I="mouse",P=["x","y"],V=["clientX","clientY"];function L(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}function j(e,t,n){var i=n.pointers.length,r=n.changedPointers.length,o=1&t&&i-r==0,s=12&t&&i-r==0;n.isFirst=!!o,n.isFinal=!!s,o&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,i=t.pointers,r=i.length;n.firstInput||(n.firstInput=U(t)),r>1&&!n.firstMultiple?n.firstMultiple=U(t):1===r&&(n.firstMultiple=!1);var o=n.firstInput,s=n.firstMultiple,l=s?s.center:o.center,u=t.center=F(i);t.timeStamp=h(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=J(l,u),t.distance=Y(l,u),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},a=e.prevInput||{};1!==t.eventType&&4!==a.eventType||(r=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=H(t.deltaX,t.deltaY);var _,d,f=G(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=c(f.x)>c(f.y)?f.x:f.y,t.scale=s?(_=s.pointers,Y((d=i)[0],d[1],V)/Y(_[0],_[1],V)):1,t.rotation=s?function(e,t){return J(t[1],t[0],V)+J(e[1],e[0],V)}(s.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,o,s=e.lastInterval||t,l=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(l>25||s.velocity===a)){var u=t.deltaX-s.deltaX,h=t.deltaY-s.deltaY,_=G(l,u,h);i=_.x,r=_.y,n=c(_.x)>c(_.y)?_.x:_.y,o=H(u,h),e.lastInterval=t}else n=s.velocity,i=s.velocityX,r=s.velocityY,o=s.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=o}(n,t);var v=e.element;Z(t.srcEvent.target,v)&&(v=t.srcEvent.target),t.target=v}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function U(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:u(e.pointers[n].clientX),clientY:u(e.pointers[n].clientY)},n++;return{timeStamp:h(),pointers:t,center:F(t),deltaX:e.deltaX,deltaY:e.deltaY}}function F(e){var t=e.length;if(1===t)return{x:u(e[0].clientX),y:u(e[0].clientY)};for(var n=0,i=0,r=0;r<t;)n+=e[r].clientX,i+=e[r].clientY,r++;return{x:u(n/t),y:u(i/t)}}function G(e,t,n){return{x:t/e||0,y:n/e||0}}function H(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function Y(e,t,n){n||(n=P);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function J(e,t,n){n||(n=P);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}L.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(R(this.element),this.evWin,this.domHandler)}};var W={mousedown:1,mousemove:2,mouseup:4},q="mousedown",X="mousemove mouseup";function K(){this.evEl=q,this.evWin=X,this.pressed=!1,L.apply(this,arguments)}y(K,L,{handler:function(e){var t=W[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:I,srcEvent:e}))}});var Q={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},$={2:D,3:"pen",4:I,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,L.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,L,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=Q[i],a=$[e.pointerType]||e.pointerType,o=a==D,s=T(t,e.pointerId,"pointerId");1&r&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):12&r&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var ie={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function re(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,L.apply(this,arguments)}function ae(e,t){var n=M(e.touches),i=M(e.changedTouches);return 12&t&&(n=C(n.concat(i),"identifier",!0)),[n,i]}y(re,L,{handler:function(e){var t=ie[e.type];if(1===t&&(this.started=!0),this.started){var n=ae.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:D,srcEvent:e})}}});var oe={touchstart:1,touchmove:2,touchend:4,touchcancel:8},se="touchstart touchmove touchend touchcancel";function le(){this.evTarget=se,this.targetIds={},L.apply(this,arguments)}function ue(e,t){var n=M(e.touches),i=this.targetIds;if(3&t&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,a,o=M(e.changedTouches),s=[],l=this.target;if(a=n.filter((function(e){return Z(e.target,l)})),1===t)for(r=0;r<a.length;)i[a[r].identifier]=!0,r++;for(r=0;r<o.length;)i[o[r].identifier]&&s.push(o[r]),12&t&&delete i[o[r].identifier],r++;return s.length?[C(a.concat(s),"identifier",!0),s]:void 0}function ce(){L.apply(this,arguments);var e=g(this.handler,this);this.touch=new le(this.manager,e),this.mouse=new K(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function he(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,_e.call(this,t)):12&e&&_e.call(this,t)}function _e(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var i=this.lastTouches;setTimeout((function(){var e=i.indexOf(n);e>-1&&i.splice(e,1)}),2500)}}function de(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],a=Math.abs(t-r.x),o=Math.abs(n-r.y);if(a<=25&&o<=25)return!0}return!1}y(le,L,{handler:function(e){var t=oe[e.type],n=ue.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:D,srcEvent:e})}}),y(ce,L,{handler:function(e,t,n){var i=n.pointerType==D,r=n.pointerType==I;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)he.call(this,t,n);else if(r&&de.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var fe=z(l.style,"touchAction"),ve=fe!==a,pe="compute",me="auto",ye="manipulation",ge="none",be="pan-x",we="pan-y",xe=function(){if(!ve)return!1;var t={},n=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){t[i]=!n||e.CSS.supports("touch-action",i)})),t}();function ke(e,t){this.manager=e,this.set(t)}ke.prototype={set:function(e){e==pe&&(e=this.compute()),ve&&this.manager.element.style&&xe[e]&&(this.manager.element.style[fe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return f(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(A(e,ge))return ge;var t=A(e,be),n=A(e,we);return t&&n?ge:t||n?t?be:we:A(e,ye)?ye:me}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var i=this.actions,r=A(i,ge)&&!xe.none,a=A(i,we)&&!xe["pan-y"],o=A(i,be)&&!xe["pan-x"];if(r){var s=1===e.pointers.length,l=e.distance<2,u=e.deltaTime<250;if(s&&l&&u)return}if(!o||!a)return r||a&&6&n||o&&24&n?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Ze=32;function Ae(e){this.options=o({},this.defaults,e||{}),this.id=E++,this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Se(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Te(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Me(e,t){var n=t.manager;return n?n.get(e):e}function Ce(){Ae.apply(this,arguments)}function ze(){Ce.apply(this,arguments),this.pX=null,this.pY=null}function Ee(){Ce.apply(this,arguments)}function Re(){Ae.apply(this,arguments),this._timer=null,this._input=null}function Be(){Ce.apply(this,arguments)}function Ne(){Ce.apply(this,arguments)}function Oe(){Ae.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function De(e,t){return(t=t||{}).recognizers=w(t.recognizers,De.defaults.preset),new Ie(e,t)}function Ie(e,t){this.options=o({},De.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new(this.options.inputClass||(N?ne:O?le:B?ce:K))(this,j),this.touchAction=new ke(this,this.options.touchAction),Pe(this,!0),f(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Pe(e,t){var n,i=e.element;i.style&&(f(e.options.cssProps,(function(r,a){n=z(i.style,a),t?(e.oldCssProps[n]=i.style[n],i.style[n]=r):i.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Ae.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Me(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Me(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===T(t,e=Me(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Me(e,this);var t=T(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n<8&&i(t.options.event+Se(n)),i(t.options.event),e.additionalEvent&&i(e.additionalEvent),n>=8&&i(t.options.event+Se(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Ze},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=Ze);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Ce,Ae,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,i=6&t,r=this.attrTest(e);return i&&(8&n||!r)?16|t:i||r?4&n?8|t:2&t?4|t:2:Ze}}),y(ze,Ce,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(we),24&e&&t.push(be),t},directionTest:function(e){var t=this.options,n=!0,i=e.distance,r=e.direction,a=e.deltaX,o=e.deltaY;return r&t.direction||(6&t.direction?(r=0===a?1:a<0?2:4,n=a!=this.pX,i=Math.abs(e.deltaX)):(r=0===o?1:o<0?8:16,n=o!=this.pY,i=Math.abs(e.deltaY))),e.direction=r,n&&i>t.threshold&&r&t.direction},attrTest:function(e){return Ce.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Te(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Ee,Ce,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ge]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(Re,Ae,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[me]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!i||!n||12&e.eventType&&!r)this.reset();else if(1&e.eventType)this.reset(),this._timer=_((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Ze},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),y(Be,Ce,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ge]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Ne,Ce,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return ze.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:24&n&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Te(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Oe,Ae,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(i&&r&&n){if(4!=e.eventType)return this.failTimeout();var a=!this.pTime||e.timeStamp-this.pTime<t.interval,o=!this.pCenter||Y(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,o&&a?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=_((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Ze},failTimeout:function(){return this._timer=_((function(){this.state=Ze}),this.options.interval,this),Ze},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),De.VERSION="2.0.7",De.defaults={domEvents:!1,touchAction:pe,enable:!0,inputTarget:null,inputClass:null,preset:[[Be,{enable:!1}],[Ee,{enable:!1},["rotate"]],[Ne,{direction:6}],[ze,{direction:6},["swipe"]],[Oe],[Oe,{event:"doubletap",taps:2},["tap"]],[Re]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Ie.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var i=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var a=0;a<i.length;)n=i[a],2===t.stopped||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(e),!r&&14&n.state&&(r=t.curRecognizer=n),a++}},get:function(e){if(e instanceof Ae)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(d(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=T(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==a&&t!==a){var n=this.handlers;return f(S(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==a){var n=this.handlers;return f(S(e),(function(e){t?n[e]&&n[e].splice(T(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var n=i.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&Pe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(De,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Ze,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Ie,Input:L,TouchAction:ke,TouchInput:le,MouseInput:K,PointerEventInput:ne,TouchMouseInput:ce,SingleTouchInput:re,Recognizer:Ae,AttrRecognizer:Ce,Tap:Oe,Pan:ze,Swipe:Ne,Pinch:Ee,Rotate:Be,Press:Re,on:x,off:k,each:f,merge:m,extend:p,assign:o,inherit:y,bindFn:g,prefixed:z}),(void 0!==e?e:"undefined"!=typeof self?self:{}).Hammer=De,"function"==typeof define&&n.amdO?define((function(){return De})):void 0!==t&&t.exports?t.exports=De:e.Hammer=De}(window,document)},function(e,t,n,i,r){i();var a=e(42),o=e(43),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.el=this._createElement()}},{key:"remove",value:function(){(0,o.remove)(this.el),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"css_classes",value:function(){return[]}},{key:"render",value:function(){}},{key:"renderTo",value:function(e){e.appendChild(this.el),this.render(),this._has_finished=!0,this.notify_finished()}},{key:"_createElement",value:function(){return(0,o.createElement)(this.constructor.tag_name,{class:this.css_classes()})}}]),n}(a.View);n.DOMView=s,s.__name__="DOMView",s.tag_name="div"},function(e,t,n,i,r){i(),n.root="bk-root",n.toolbar_hidden="bk-toolbar-hidden",n.toolbar="bk-toolbar",n.logo="bk-logo",n.above="bk-above",n.below="bk-below",n.left="bk-left",n.right="bk-right",n.toolbar_button="bk-toolbar-button",n.tool_overflow="bk-tool-overflow",n.active="bk-active",n.divider="bk-divider",n.horizontal="bk-horizontal",n.vertical="bk-vert
2ical",n.default='.bk-root .bk-toolbar-hidden{visibility:hidden;opacity:0;transition:visibility 0.3s linear, opacity 0.3s linear;}.bk-root .bk-toolbar{display:flex;flex-wrap:nowrap;align-items:center;user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;}.bk-root .bk-toolbar .bk-logo{flex-shrink:0;}.bk-root .bk-toolbar.bk-above,.bk-root .bk-toolbar.bk-below{flex-direction:row;justify-content:flex-end;}.bk-root .bk-toolbar.bk-above .bk-logo,.bk-root .bk-toolbar.bk-below .bk-logo{order:1;margin-left:5px;margin-right:0px;}.bk-root .bk-toolbar.bk-left,.bk-root .bk-toolbar.bk-right{flex-direction:column;justify-content:flex-start;}.bk-root .bk-toolbar.bk-left .bk-logo,.bk-root .bk-toolbar.bk-right .bk-logo{order:0;margin-bottom:5px;margin-top:0px;}.bk-root .bk-toolbar-button{width:30px;height:30px;cursor:pointer;background-size:60% 60%;background-origin:border-box;background-color:transparent;background-repeat:no-repeat;background-position:center center;}.bk-root .bk-toolbar-button:hover,.bk-root .bk-tool-overflow:hover{background-color:rgba(192, 192, 192, 0.15);}.bk-root .bk-toolbar-button:focus,.bk-root .bk-tool-overflow:focus,.bk-root .bk-toolbar-button:focus-visible,.bk-root .bk-tool-overflow:focus-visible{outline:1px dotted #26aae1;outline-offset:-1px;}.bk-root .bk-toolbar-button::-moz-focus-inner,.bk-root .bk-tool-overflow::-moz-focus-inner{border:0;}.bk-root .bk-above .bk-toolbar-button{border-bottom:2px solid transparent;}.bk-root .bk-above .bk-toolbar-button.bk-active{border-bottom-color:#26aae1;}.bk-root .bk-below .bk-toolbar-button{border-top:2px solid transparent;}.bk-root .bk-below .bk-toolbar-button.bk-active{border-top-color:#26aae1;}.bk-root .bk-right .bk-toolbar-button{border-left:2px solid transparent;}.bk-root .bk-right .bk-toolbar-button.bk-active{border-left-color:#26aae1;}.bk-root .bk-left .bk-toolbar-button{border-right:2px solid transparent;}.bk-root .bk-left .bk-toolbar-button.bk-active{border-right-color:#26aae1;}.bk-root .bk-divider{content:" ";display:inline-block;background-color:lightgray;}.bk-root .bk-above .bk-divider,.bk-root .bk-below .bk-divider{height:10px;width:1px;}.bk-root .bk-left .bk-divider,.bk-root .bk-right .bk-divider{height:1px;width:10px;}.bk-root .bk-tool-overflow{color:gray;display:flex;align-items:center;}.bk-root .bk-above .bk-tool-overflow,.bk-root .bk-below .bk-tool-overflow,.bk-root .bk-horizontal .bk-tool-overflow{width:15px;height:30px;flex-direction:row;}.bk-root .bk-left .bk-tool-overflow,.bk-root .bk-right .bk-tool-overflow,.bk-root .bk-vertical .bk-tool-overflow{width:30px;height:15px;flex-direction:column;}'},function(e,t,n,i,r){i
vendor: 43,832 bytes, line 2
2(),n.root="bk-root",n.tool_icon_copy_to_clipboard="bk-tool-icon-copy-to-clipboard",n.tool_icon_replace_mode="bk-tool-icon-replace-mode",n.tool_icon_append_mode="bk-tool-icon-append-mode",n.tool_icon_intersect_mode="bk-tool-icon-intersect-mode",n.tool_icon_subtract_mode="bk-tool-icon-subtract-mode",n.tool_icon_clear_selection="bk-tool-icon-clear-selection",n.tool_icon_box_select="bk-tool-icon-box-select",n.tool_icon_box_zoom="bk-tool-icon-box-zoom",n.tool_icon_zoom_in="bk-tool-icon-zoom-in",n.tool_icon_zoom_out="bk-tool-icon-zoom-out",n.tool_icon_help="bk-tool-icon-help",n.tool_icon_hover="bk-tool-icon-hover",n.tool_icon_crosshair="bk-tool-icon-crosshair",n.tool_icon_lasso_select="bk-tool-icon-lasso-select",n.tool_icon_pan="bk-tool-icon-pan",n.tool_icon_xpan="bk-tool-icon-xpan",n.tool_icon_ypan="bk-tool-icon-ypan",n.tool_icon_range="bk-tool-icon-range",n.tool_icon_polygon_select="bk-tool-icon-polygon-select",n.tool_icon_redo="bk-tool-icon-redo",n.tool_icon_reset="bk-tool-icon-reset",n.tool_icon_save="bk-tool-icon-save",n.tool_icon_tap_select="bk-tool-icon-tap-select",n.tool_icon_undo="bk-tool-icon-undo",n.tool_icon_wheel_pan="bk-tool-icon-wheel-pan",n.tool_icon_wheel_zoom="bk-tool-icon-wheel-zoom",n.tool_icon_box_edit="bk-tool-icon-box-edit",n.tool_icon_freehand_draw="bk-tool-icon-freehand-draw",n.tool_icon_poly_draw="bk-tool-icon-poly-draw",n.tool_icon_point_draw="bk-tool-icon-point-draw",n.tool_icon_poly_edit="bk-tool-icon-poly-edit",n.tool_icon_line_edit="bk-tool-icon-line-edit",n.default='.bk-root .bk-tool-icon-copy-to-clipboard{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUSDBoBvcHQeQAAAG9JREFUWMNjXLhsJcNAAiaGAQYwB/xHwh/Q+ITEkfHQCwEWND4jmeb8H/JpgBwfI6cNBhLSEkqaGXRpgFRAcZoZsmlg1AGjDhh1wKgDRh0w6gCaVcf/R2wIkNqw+D9s0wADvUNiyIYA47BJAwPuAAAj/Cjd0TCN6wAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-replace-mode{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUFFxokK3gniQAAAHpJREFUWMNjXLhsJcNAAiaGAQajDhhwB7DgEP+PxmeksvjgDwFcLmYkUh2hkBj8IcBIZXsYh1w2/I8v3sgAOM0bLYhGc8GgrwuICgldfQO88pcvXvg/aOuCUQeM5oLRuoCFCJcTbOMh5XOiW0JDNhdQS3y0IBp1ABwAAF8KGrhC1Eg6AAAAAElFTkSuQmCC");}.bk-root .bk-tool-icon-append-mode{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUFFxkZWD04WwAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAAoUlEQVRYw+1WQQ6AIAwrhO8Y/bIXEz9jIMSDr8ETCUEPQzA4pMeFLKNbu4l5WR0CDOMEALBGIzMuQIBEZQjPgP9JLjwTfBjY9sO9lZsFA9IafZng3BlIyVefgd8XQFZBAWe8jfNxwsDhir6rzoCiPiy1K+J8/FRQemv2XfAdFcQ9znU4Viqg9ta1qYJ+D1BnAIBrkgGVOrXNqUA9rbyZm/AEzFh4jEeY/soAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-intersect-mode{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUFFxkrkOpp2wAAAPhJREFUWMPtV1EKwjAMTUavI3oawR/vtn5srJdREfzwMvHHQlcT2mpdMzFfWxiP5r2+JMN+mAiCOB72CABgR1cln4oOGocJnuMTSxWk8jMm7OggYkYXA9gPE3uyd8NXHONJ+eYMdE/NqCJmEZ5ZqlJJ4sUksKN7cYSaPoCZFWR1QI+Xm1fBACU63Cw22x0AAJxudwrffVwvZ+JmQdAHZkw0d4EpAMCw8k87pMdbnwtizQumJYv3nwV6XOA1qbUT/oQLUJgFRbsiNwFVucBIlyR3p0tdMp+XmFjfLKi1LatyAXtCRjPWBdL3Ke3VuACJKFfDr/xFN2fgAR/Go0qaLlmEAAAAAElFTkSuQmCC");}.bk-root .bk-tool-icon-subtract-mode{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUFFxgsF5XNOQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAABFUlEQVRYw9VWUQqDMAxNpWfxQxD1MoP97G7zQ5mH2RTZYLtM9lWoMbXtxLXNX4OG9r28l4hrd0PQoqxqAACYpxH25C/nkwCHyCBwSPoS09k1T5Fo+4EiExcC4v584xGFmyIXHBLRISAVZyZufUPVa4rcrwmPDgr93ylo+2GliLRUYHK6th/o/6r7nfLpqaCsagEA8Hh9FmcNKeRmgeYDC+SCq0B6FFi8/BcV6BdR9cL3gCv3ijPKOacsn3rBEcjmaVxpfGcg4wHxzgJJnc6241Hn23DERFRAu1bNcWa3Q0uXi62XR6sCaWoSejbtdLYmU3kTEunNgj0bUbQqYG/IcMaqwPS9jftoVCAQ0ZVDJwf0zQdH4AsyW6fpQu4YegAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-clear-selection{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUGEhcuan3d3wAAAoRJREFUWMPtlzFP3EAQhd+b3TNSzg0N5TWXLkJQUUaKhIQ4fgP/g5ArrriE/I3opEgRrZtIVJR0FJQ010SioUmEZHtnUpwN9gWHGA5BJCy58MraffvmfZ41v3z9hqe8BE98vQh4cgG+Ydzmnrng8efvQJNi/uN7dznx/B3ggtfhf4ehNdUttRzBDIm/2VTiiWCG1HK0nc+3UWtq8BQIiEEakEQOADBIA4QCQmBqoHBhFNR27ikQSmGdYCdTqCpEHMDZmEKRWUBEv1gBDg5SzRJnpopILWICgWuRYflLamuzxB2BmtYqSRIka5VWU8QduXO+1hRc5YZu5GAwmP2ZJzND0IBu5HCV2+NQcAhAVRsnC2IbPzPdSjzd6to6VtfWkXi6YLaVWr7xoAwkfpb8MnC3SH7rKSMBe4M0jA/OTicFIbtCGRIyNbURhcf3ErCd6YwA1m0HgAxhw1NGQnlXBHG4kylVlSJuH0RfIP2CkL2I/qS1gIAAQiBl1QwFggIHtyxgrxK5PgyfC0JWKoT0HLh8LwoietB4TYKaIl7yeNURxB05UtMxDOcVQlZIrlRKdK6m47gjR/fuBRQihyLArtNeJD50Izcx2Eczu7iFkIug4VM3cpOr3MKDekFED0fWUHv9Zq0kpLnridjhY3XDg7NTN0jDrhO3X7O9Wg7wwyANu4mnayNg3gmbu0tCNoUyBNGv2l4rB9EXynA7082FOxAQLhU6rQVO9T2AvWowFToNCJcPORGxIRcnpjZSKATSU9NxvOQnAPArDSaQoUKnNI4iufkGtD4P3EHIcWZhz4HLceSOyrR3Izf5memPAL2cX3yhAkonysZVaWLBkd9dw1Ivv2a/AYPkK+ty1U1DAAAAAElFTkSuQmCC");}.bk-root .bk-tool-icon-box-select{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg0kduFrowAAAIdJREFUWMPtVtEKwCAI9KL//4e9DPZ3+wP3KgOjNZouFYI4C8q7s7DtB1lGIeMoRMRinCLXg/ML3EcFqpjjloOyZxRntxpwQ8HsgHYARKFAtSFrCg3TCdMFCE1BuuALEXJLjC4qENsFVXCESZw38/kWLOkC/K4PcOc/Hj03WkoDT3EaWW9egQul6CUbq90JTwAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-box-zoom{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg82t254aQAAAkBJREFUWMPN11+E1FEUB/DPTFn2qaeIpcSwr5NlUyJiKWVXWUqvlUh/iE3RY9mUekkPPURtLKNRrFJEeuphGfUUaVliiX1aVjGs6aG7+XX9ZnZ+d2fTl2vmnHvPPfeee/79Sk+may2/UQq/q7Qu+bAJoxjHIKqB/wlfUMcMVqI9bLZ+DGIKwzlzQ2GcxCx2xwvKOUKlaHTiX8bHNspjDONHkOmJBW5jIof/FvPh/06MZOb6cRc7cGn1AKUE5cdzlM/gAr5F/O24H3xkFRfxAbVygvK+cIsspjGWo1zgjeFpxL+BvnLw7laBA4xjIFJwrgu52DoVjKdY4HBEX8dSF3JLYe1fe6UcYCii3xWQjdfuSTnAtoheKCC7GNED5Zx4L4qt61jbTLHA94geKSC7P7ZeShQ0Inoi1IJuEOeORooFXkV0FZNdZs5qvFfKAeqYy7nZ6yg//HG0MBfffh71lFrQDCW2EvEP4mt4okZUDftz9rmGZkotmMxJRtlisy+MTniAWrty3AlXw0hFM2TD89l+oNsoOJXjbIs4EpqNtTCLXbiZ0g+M4mFObj8U3vsNjoZCVcmk60ZwthpepLZkB/AsivWfOJZxtpUQHfWib7KWDwzjeegBZJSdKFiE2qJTFFTwElsi/unQ/awXrU4WGMD7nOJxBY/1EO2iYConq93CHT1GOwucjdqnRyFz+VcHmMNefMY9nNkA3SWUOoXhQviSWQ4huLIRFlirFixnQq/XaKXUgg2xQNGv4V7x/RcW+AXPB3h7H1PaiQAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-zoom-in{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEgsUBmL8iQAAA2JJREFUWMO9l12IlFUYx3//MzPrLpSjkm5oN4FFIWVEl66IQlFYwtLOzozsjHdGRSCRF0sfBEXRVV0FQuQiLm5CZNBFgRRaRLVFhbJ2EdiN5gbK7toObTPn6eYdPTvNzPvOBz5Xh/ec5/n/n89zXtEHmZqeSXSuXBz/3zfdKvBWJHQrwZuRcP0El+QkbQXeBX6WZEgm6TtJk5lM5o4Lc+cV6qpf4Ga20Tm338zeATItVK9Ker6yvPzp4NDQ3+XieGsCU9MzTYumGbhz7m4ze9/MHgvBgItACrgfGAj2jgAvAYs3wlEujjc13kii8YyZrXXOfWhmo9GnFUlvOOemarVapVqtkslksmb2KjARqL62ecuWN9NxbRInzrldAXhV0uFSIfdew7G/gNLU9MwS8CwSmE3Oz88fcXG5blfpqVRq0Ix8VIAAX0XgrVL7HDCHGcCaWrV60LUBN8Dae58aQIxEqcA592I9M610JL0cpG/U9TIHJNKY3RV5z0R+7Nd4HZ0P1g/2RMBuegLAsRMnb4vT8d5vqKfMzOgtAlADrkmqGywmiMBTwfr3dC9j1Xv/r6Tvg/5/5ejxE6cO7M9faVbQZrYNOFSPmqQvVo9FKexvi5uWX58943aM7DwAfBDY+FbSCxP5sdkGx55GeguzrUEXPaSo2pFkAbiSZQCAzZJOmdkjwd6SpB/M7KykQTPbA2wDhoIzRzcNDx9MJwGNIXdJ0mEzmwbujL7dbma7gd03A7lKfnTOvf74nl0r6bonTUbujRSUCrm2d4L3/kvn3JPe+8+BDW2i9o+kT7z3kxP5sYsA6W47oE64TsR7P9tQL4vA2mh9WdIscKxUyJ0M7aR7acOGzikD65EQLEjaa2ZXzMwDFeB6qZBbbLTRE4EGeSaozNOZgYFf8qP7lmIvs354n0qlHpB0T7B9Ogl4IgJJrmjv/SiQjbrkD+BMUkfSbYATPdckrTOzkciWAXOlQu5cYgLdPEIapud9wMOR9zVJH3ViKx333mtHMJvNuoWFhZ3A+ojMcja77njXBEKwJJfTcqUyCIQ34Mf7nnh0paMnXacFuGoC1mr3AtuDfLzd8Zuyl+rfuGn4HLAD+Az4qZQf+61TAj0Noj8vX6oC35SL43u7teG6rf5+iXppwW7/JUL5D03qaFRvvUe+AAAAAElFTkSuQmCC");}.bk-root .bk-tool-icon-zoom-out{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEgsHgty9VwAAA0FJREFUWMO9l09oXFUUxn/fmXlpItppi22k7UJBRSlVkCytSAuKUloIdjKT0El3FXVXdVFKRVAQV7qQohsNwdA0UFvBhYtqUVyIVlRaogtFQVq7qSTVjA3z3nHzBq/jvPmTN/Ss7rv3nvN99/y794kByMzcfE/7picn/jenmwWeRUI3E7wdCRskuCSTdDfwBvCtJEdySV9KOhpF0e0/LF5SqKtBgbv7ZjObcvfXgShD9Zqk5+orKx8Oj4z8NT05kU1gZm6+bdK0Azezu9z9hLs/HoIBvwAF4H5gKFh7B3gBWFY3460kWve4+3oze9fdx9OpVUmvmNlMHMf1RqNBFEUldz8OHAxUX9q6bduryut+Sfvc/Wz62ZD0fK1afjND9y3gGSRwv1GMojstTxUUCoVhdyopEYDzKXjWwZ4FFnEHWBc3Goet00m7lZlZYQixKw0FZnakGZksHUnHgvCN5/KARBH37enpOVg58H13HV0Kxg/kIuD/ngSA2ZMLt3bTSZJkUzNk7k4+D0AM/CGpaXCyBw/sC8Y/qZd2GpZiuL9YLN4Sx/HpoP5/c/exQ1OVq+1yyt13SLoArEsJnMjlgfOffvK3u58Kprab2QezJxfG2iTzUzI70wRPG9jbmpmb95SNB9mpzp7/j2yVdNbdx4K565K+cvfPJQ27+x5gBzAS7Hlvy+jo4WIvoC3kWpcvS3rR3eeAO9K529x9N7C7zX6AC2b28hN7Hl1Vt44niVq13LUjmtlYkiQfA5s6eO+GpDNJkhw9NFX5ueNt2ARodyF1IHIN2JiOl4H16fiKpK+B2Vq1vBAqFAf4IJkGNiIhWJK0192vunsC1IE/a9XycquNXARa5OnApeeioaHvKuP7r3dTGsiLqFAo7JR0T7B8rhfwXARa2us4UEqr5Ffgs151i/08oTNKdIO770ptObBYq5Yv5ibQq/sl3Qc8lJ4+lnSqH1vFfp9koZRKJVtaWnqkWXqSVkqlDe+vmUDWpZMlK/X6MBDegKf3P/nYaj8ErN9fqZBYEsf3Ag8G8Xit33BaniTcvGX0IvAw8BHwTa1y4Md+CeRqRL9fudwAvpienNi7Vhu21uwflOT+L+i1X2TJP57iUvUFtHWsAAAAAElFTkSuQmCC");}.bk-root .bk-tool-icon-help{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAABltpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPHRpZmY6Q29tcHJlc3Npb24+NTwvdGlmZjpDb21wcmVzc2lvbj4KICAgICAgICAgPHRpZmY6WFJlc29sdXRpb24+NzI8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyPC90aWZmOllSZXNvbHV0aW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MzI8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MzI8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpDb2xvclNwYWNlPjE8L2V4aWY6Q29sb3JTcGFjZT4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDpBODVDNDBDMzIwQjMxMUU0ODREQUYzNzM5QTM2MjBCRTwveG1wTU06SW5zdGFuY2VJRD4KICAgICAgICAgPHhtcE1NOkRvY3VtZW50SUQ+eG1wLmRpZDpBODVDNDBDNDIwQjMxMUU0ODREQUYzNzM5QTM2MjBCRTwveG1wTU06RG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkRlcml2ZWRGcm9tIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgPHN0UmVmOmluc3RhbmNlSUQ+eG1wLmlpZDpBODVDNDBDMTIwQjMxMUU0ODREQUYzNzM5QTM2MjBCRTwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpBODVDNDBDMjIwQjMxMUU0ODREQUYzNzM5QTM2MjBCRTwvc3RSZWY6ZG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPGRjOnN1YmplY3Q+CiAgICAgICAgICAgIDxyZGY6U2VxLz4KICAgICAgICAgPC9kYzpzdWJqZWN0PgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxNjoxMToyOCAxMToxMTo4MjwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+UGl4ZWxtYXRvciAzLjY8L3htcDpDcmVhdG9yVG9vbD4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+Cphjt2AAAAT7SURBVFgJxRdbaFxFdGb2bhui227BWrsVKYgf2kJUbP9EUPuzEB803WTXJjH61Q/7Ya1+CMYKEVTsh4J/EpvY7BoabUiNiA8s1p+4KIhpoUUEselHqyS76TbZ3HuP58ydc3d2u4+IkQxczpz3mZkzZ86VYpXjvenpjZsLhUcliE4AuUuASAgptmt1EFdwPiclzIIUUwubNn17OJlcXo1p2UpodHRiux9xB1Eug1+slbzhFxGOKc851tu7/0oznYYBDA8Pt0U2tL8KQryIq2tvZqQhD0QJHRz3yqWhgYGBpXpydQMwqz6NCnurleCSADkJEfgKfOePqL80R/wV1ZaQyr1LenKfkPCkEPKeaj0xg7vxVL3duCmA0Vyuw/fl52hgBxsBED+h4Cv9z3R/zbRm8MTJTx7HQN7GQB6w5C4L4SX7M5lfLBpurjXMyvNIShiyi0l1pL8n9b7EDGPR8fHxzSsQ6XDB3618/xqo6Pk25V5MpVJllgHM1BO58RdQ612kOYZ+GXdij70TYQB05mpj+1kU5G2fB+l3PZtOf8NGx6ambnMXb3yAxg8wjSEG6OKKR9oicBQD+ZvpH2Wzj0lQpxCPG9qMv1x6hHNCsSAlHM7ZOa682vlI9tRDbvHGbD3nZAPpDoD/3JIrLpAs26UFkC3EMUA99hpfGtEBfJjNJnS2Gwnadnvl+Xw+iuc3DAJuNyIaSCHpilVldyDjjUxj3WDZIAhxhHHyRcdNuA7AAfUaXzVKODpzFiZ4/uLvh5G+m2no+C/pyIf7MqlEJB7bpqR6nXkEUfbeawuLaZsW2ISfNQ2vtaktQlGFQyIVGT0o2+2EC4iQNGwjBIN9qdQ5Qg4mk4X4rW3vCClLtowE2FOFUxKDfNmiZci3ovKKRFPh4FK9q4Zbdr+lKKJiA13TcHR2dmLBgdmQ0GAS2MZaEowY+XbAk09IvgtYZGp16SyvFhaHcIUh645t8T9DBCcnz5zZ4hZLu3DzK2QlL1QQa0Y+pHiJKPSuOGj3PmZTheM5w2TwqBxnvBZOTk7G5gvXJ5Aelms8wnJURL+olSWcfEhf6gDoUXPMq6ZlqbzWU2pE+3hi4s6F68tfIj9cBMlikr7Z0/P0b/X0yIcUXsDCF1WhtL4OROHaXk+xlkbV0Cu732Nmhc4peaWSg73pA8dq5RkvO37ldUTfXCKZv2q45MkhvG87WQEzpCCUSvV1d9GONBy3lMvgKSwrZig8gjAietWY0QriylO2jIo4yVbOSb7KB/qmI9BPKjHpSSXYauRyn92Nq9/Kcrj13x3s3v8D481glQ/0raiNYgX9njPSBOImbrHZePl+tfFmc9sH+Xaoh8NjOKSVdDMhjjYzQLy+dFceH5+IJQf9VYXX4tROg4ZFU8m31M3mfPEqUoJqCGJfvWpo2xnNfdrhC28n06SCeSzNZxlvBINGRXCtKS7EY1uV6V7HWAm38y1cXaXsMcOCvr9ySPj+af7A1U2HJXHzVNvUXVLIGyPf+jV0pf8GHoN+TLAyPkidTCi2RpPApmnR0Bd1zGRaB/B8Oj2HSw7LLbVR1MmskW8RdEWVXSJf3JbpAMgRtc4IZoxTh9qotQjCasm46M0YX9pV1VmbpvRH5OwwgdRtSg2vKaAz/1dNKVtb17Y8DCL4HVufHxMOYl1/zTgIgiYvBnFKfaNp3YjTdPz3n9Na8//X7/k/O1tdwopcZlcAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4oVHp0SwAAAQJJREFUWMPtlsENgzAMRb8RQ5VJItFDOgaZAMaAA0iZpN3KPZSoEEHSQBCViI/G8pfNt/KAFFcPshPdoAGgZkYVVYjQAFCyFLN8tlAbXRwAxp61nc9XCkGERpZCxRDvBl0zoxp7K98GAACxxH29srNNmPsK2l7zHoHHXZDr+/9vwDfB3kgeSB5IHkgeOH0DmesJjSXi6pUvkYt5u9teVy6aWREDM0D0BRvmGRV5N6DsQkMzI64FidtI5t3AOKWaFhuioY8dlYf9TO1PREUh/9HVeAqzIThHgWZ6MuNmC1jiL1mK4pAzlKUojEmNsxcmL0J60tazWjLZFpClPbd9BMJfL95145YajN5RHQAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-crosshair{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADEUlEQVRYR81XXVIaQRCeHqug8CXmBNETaE4gniDwIgpVspxAbxC9ATkBkCpQ8gKeQDiB5AQxNyAvUlrldr7eHxyGXZi1rMJ5opbp7m++7un+htSGF204vsoMoNXrlzSpfWa1oxQfhAegCZGaEtPorHo8znIoJwCt6+td8uk7ApUQCIHTF4BNAWzImq8ap6cP68CsBdDp9i9ZqXM7ML79g/EnCWD+jgMKENKqWT+tXK0CkQqgNRjs0OxpQIqKhoMxaG6/6JeRnK7T6yO2UvVqhYSlLX+ryORfgKn9ORDFIy7ky41yGcwsr0QAQfDH5zucOswx819fs4egI9OFCcD8DjBF7VNbEX0JzdWEt3NHSSASAcCxBDqMgt/623kvyTgNgNjJIfTjk4D4FqaJR1715MjmYAmA5Bx3AwUXQL+t105KaTlcBSC26XRvhjEIoLiq1yqXpr8FAGG16/ug4IT27fxBWu7EiQuAiImJpEMKE6nYM30uAIDDttSUOPfJP7JzbjPhAiBIh9QE67vIvoOi9WJfCwDavf40ulpjbCqmUf+W753ezURuh7Dg1SqflwAEHU6pgfyBq9Y4qx0LG++2fnZ/eUzcstmdM2AWH+jfc+liWdBJfSENf8Lifi3GVwC9mybOfi5dzatWVrbbLIHNva8p5h/16gkaFiLGGxbufkoE6XguwePiXLF3XmMfCUCUAqtKXU7sumd1CowOuJEi3Pg1FBpjitIGhyvVSfvmjci6ZR+rFQfDiPVE2jFYeICQ+PoewwjC5h7CZld6DBdyu6nDSKgzOyIMhmhK5TTqXYbRorZYM46TmpKAAOrGWwSJJekSB1yqJNOzp1Gs7YJ0EDeySDIMtJbQHh6Kf/uFfNFZkolJICRmz0P8DKWZuIG2g1hpok+Mk0Qphs0h9lzMtWRoNvYLuVImUWrmPJDlBKeRBDfATGOpHkhw670QSHWGLLckmF1PTsMlYqMJpyUbiO0weiMMceqLVTcotnMCYAYJJbcuQrVgZFP0NOOJYpr62pf3AmrHfWUG4O7abefGAfwH7EXSMJafOlYAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-lasso-select{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEgwlGP1qdAAABMBJREFUWMO9V1uIVVUY/r61z57ZMx4DnbzgkbQXL5iCJphlWdpIGY4jpFBkEiU9ZNaDRRcITcIwMwgxoQtU2IMXdAZfMjFvpERXYiSbysyBEXFmyuHMnLP32uvrwT2xnY5nxvHQ93Jg7fWv71/r//7L4a59TRgqJk+Z6v3a+sv0OI5nk5wu6VaSVZImAThHsgjgrKTvM5nMUWvtmf5n8HodCIKgOgzDhc65pSTrJQWDsSNpJX1ljHnDOfdT37oZLLHv+8OMMasKhcIJ59xHAJYMlhwAJGUAzJfUTHLFuFzOG5QDU6dNMyQfs9Yedc5tBpAD4IYYNQGoBrDtQnt7/b0LFrJsCHzfn2itfQfAnZLiazytA3AaQAuAiwDaEgeNpGkkswAWSBqRONB38b88z5uTKePt6iiKXkk8jq+iJC5LOmiMaTLGHLPWhmWeHr7vV0dRtATAapAzIVmSo51zyzIlbm2stesFPA6pKk0r6Ryg93y/ek8YFvPOOTg3cDSiKCoC2OP7/rEoirYm4rUkF12lAWNM1lr7lqQn0+QA8gI2jBg5cj6Aj8OwmB+KAKIoukhyp6SRJAUgl0ndPLDWPi9pJQCbuviXvu+/GIZhW1dnJ24UJFuTjCCA2ADA8sYGWmsXS3qmL94kDYAtkh4Nw7ANlQJ5U6INT1KrAYC9zQdykl7nFSj5fXp5Y8NWVBhy7mUAjqShMYdMXV2dJ2klyRwAJ8lIeuGWCRMP7N7frEqSG2OmAFhKshNAp5wrmO7u7jEAngPQm1S2z2pqapr+OPt7XEly0oxwzq2RdFmSD2AMgKKJouhhAL4kA+Cs53l7e3t7uytJHgRBreTWkXwkKVJnJD0B4GAGwIJE9R6AFufc6UqSZ7PZbD6ff5dkA4CQZEHSqwAOISmXtwGIE+F1SeqqIP8d+Xz+C0mLJYWSAODteXffczjdDQNJ0BWMCoLg5gqIbRTJNwHsljQhUb0luWPM2LE7Thw/9m/5NCT/TByxAOYWi8X6/gdWV1dnfN8fNRBxJpMZTXKdc+6IpFVJWAEgkvSJpA0X2tvtVTaSjgOYBCAEEADYSHK87/sfhmEYA9gShuEDkgzJHyWtB/B1irQ2juP7ADxkrX0wOUOpzmdpzEY590HJ7Ni1r2kSyZOSiv2+hSRjSTXp/QAukzySNJOJkmalyNIl10hqMcasdc61XDNcQRD8BnITgNp+36r6kfcNFMMlLQGwTNLMEuQGQBfJl2bdPru+HDkAZAqFQux53jZHEsC6aw0eg2gylNRBcqcx5v04ji999+03AwsWAOI4Lsy9a94WkisAnE5a5WCJYwCfA1g7LJudI2lTHMeXBm1faiQzxkyRtF3S5CTupeAB+KG2tnZFT0/P30NO2VKLzrmfAbwGMipjG5Oc0dPTc0Md05SZ5U4Q2FxChErtEYD7jTGNQ3UgM8Asv90Yc9I5LSKRlXSI5CxJa0jWSALJjKRnAewfkniT+vwf7N7fXHK9rq7O7+jo+BTA/NRrdBpjnnLOnUrvXd7YMPQXSBunneno6IhIHgYwW1JtkgmBpBkATlVMAwOk3nFJ+VSoqgCMr6gIy2FcLtdKspAedyQN/98caDt/3kpyabUmf8WvG/8A1vODTBVE/0MAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-pan{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4lKssI9gAAAOtJREFUWMPVll0KwyAMgNPgoc0JzDX2Mtgp3csKErSamGabIEUo/T6bHz0ezxdsjPJ5kvUDaROem7VJAp3gufkbtwtI+JYEOsHNEugIN0mgM1wtsVoF1MnyKtZHZBW4DVxoMh6jaAW0MTfnBAbALyUwCD6UwEB4VyJN4FXx4aqUAACgFLjzrsRP9AECAP4Cm88QtJeJrGivdeNdPpko+j1H7XzUB+6WYHmo4eDk4wj41XFMEfBZGXpK0F/eB+QhVcXslVo7i6eANjF5NYSojCN7wi05MJNgbfKiMaPZA75TBVKCrWWbnGrb3DPePZ9Bcbe/QecAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-xpan{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4X4hxZdgAAAMpJREFUWMPtlsEKwjAMhr/pwOOedINJe/PobWXCfAIvgo/nA4heOiilZQqN2yE5lpD/I38SWt3uD9aMHSuHAiiAAmwaYCqoM/0KMABtQYDW11wEaHyiEei28bWb8LGOkk5C4iEEgE11YBQWDyHGuAMD0CeS30IQPfACbC3o+Vd2bOIOWMCtoO1mC+ap3CfmoCokFs/SZd6E0ILjnzrhvFbyEJ2FIZzXyB6iZ3AkjITn8WOdSbbAoaD4NSW+tIZdQYBOPyQKoAAKkIsPv0se4A/1UC0AAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-ypan{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4anK0lywAAAMVJREFUWMPtlzEKwzAMRX/S7rlpIMXeOnaLaME36FLo8XqCdNFghGljyc4kgQi2Q/SUj0F/eL7eMMTKz6j9wNlYPGRrFcSoLH4XxQPvdQeYuPOlcLbw2dRTgqvoXEaolWM0aP4LYm0NkHYWzyFSSwlmzjw2sR6OvAXNwgEcwAEcwAEcwAEcoGYk20SiMCHlmVoCzACoojEqjHBmCeJOCOo1lgPA7Q8E8TvdjMmHuzsV3NFD4w+1t+Ai/gTx3qHuOFqdMQB8ASMwJX0IEHOeAAAAAElFTkSuQmCC");}.bk-root .bk-tool-icon-range{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAABCJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyI+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25Vbml0PjI8L3RpZmY6UmVzb2x1dGlvblVuaXQ+CiAgICAgICAgIDx0aWZmOkNvbXByZXNzaW9uPjU8L3RpZmY6Q29tcHJlc3Npb24+CiAgICAgICAgIDx0aWZmOlhSZXNvbHV0aW9uPjcyPC90aWZmOlhSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpZUmVzb2x1dGlvbj43MjwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4zMjwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgICAgIDxkYzpzdWJqZWN0PgogICAgICAgICAgICA8cmRmOkJhZy8+CiAgICAgICAgIDwvZGM6c3ViamVjdD4KICAgICAgICAgPHhtcDpNb2RpZnlEYXRlPjIwMTgtMDQtMjhUMTQ6MDQ6NDk8L3htcDpNb2RpZnlEYXRlPgogICAgICAgICA8eG1wOkNyZWF0b3JUb29sPlBpeGVsbWF0b3IgMy43PC94bXA6Q3JlYXRvclRvb2w+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgrsrWBhAAAD60lEQVRYCcVWv2scRxSemZ097SHbSeWkcYwwclDhzr1Q5T6QE1LghP6BGNIYJGRWNlaZItiFK1mr+JAu4HQu0kjpU8sgF3ITAsaFg0hOvt2Zyfvmdsa7a610Unx44Zgf773vvfneezPHNzrbhn3CT3xC3wPXYOC8LDzqdi8YY/gwh4BeknS/2th6dr2kf94AOp3OFyWgMyziOPbMDxV9FTtJnl1ut795Xd0/YQ0/vtYQwMT1KXWCfr2IjOWwtNehwN4xL9ykTrm6Pzl58yLn3J+mKh9mXbT3uRjGEDph+O8/TjfP5dBp7Ha7AX7O3o5nZeD/0E/OGyXntDgzA0X6qmCnrVutVlrUWV9f/3xo+pwhGDhvEPHOjoxnZjJggXmMHzBQ7NGNp9vxk61fr0HR7e/u7pZzCGHlc7qwBYYTT7tJYSx1AQzppyFPft5apta9w7SKcn0b7P7+/jCsDQ5mbc0dCmIJGDN0ehdcjsmkm6A6KUeKFOTE11PLxrC7Ukqh3ylL2fT0NAP9q6ur6rRCJJYsbKB0JsbCKMuy+xREePDyxQPCz+Crlw062QcA5wBOOt1l6vIl2WiI9F1fN6Q+BBqit6hEC4Hk08GQJMn4myjSP7RavVxgdaVUh/3U6HCMsPr9pYnJKRziHtWQ+un58+hGs6nsjQSjpuTyKGN3CX+FBwHXSiEVgjP+O8X6N12kIePES+GzTKAkGbNp8yJsGUMVzz8jPKReiyAQRimy5/cjye5RpF8utFp/+nwmT7d/NMzcFkS7yjJNGDaPURQxIQThEQy0SyF4l5WJYYhBa816vZ6dU7A6CAhbZVow/pDe0O9hVOoCi13r4BgBAvJHqMSQL2vE/iH6IAXEwgrRVUmBoRRwnwJQT98xEeVeSUyB4dJ5nwJBKdCFFGRmUCcu7rwIYypCTblaChuNBhWODrman5ub+4v0rMNBt8z6Ezh7GksJQpCbm79cMQE7QBFm/X6f0rjWnv8WRYg/QdbUpwDAEBy8vPyA8rNGzg3a8MiElwiM7dAtRqNoNptjGPM1laVxP9umWEMGLOKhKUOJDtBwDmzsw9fC/CzHr9SGuCTi2LbbKvVtmqXpCjMihBFa79Wrt5fGx9PDzc3fmu32Lf8qFliwU9emKhBSp+kRKn/hu9k1COEDbFdt/BoKWOAkuEbdVYyoIXv8+I/QK9dMHEb1Knb7MHOv8LFFOsjzCVHWOD7Ltn+MXCRF4729vWMDK+p8rLkvwjLg4N4v741m5YuwCI9CvHp1Ha8gFdBoPnQAkGsYYGxxcfEI7QQlFCTGUXwjAz4tWF+EpymOWu7fglE7qsOvrYE6g4+9/x/vhRbMdLOCFgAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-polygon-select{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEjc1OfiVKAAAAe1JREFUWMPt1r9rU1EUB/DPK0XbqphFHETo4OCiFhwF0V1KHbRSROLqon+AUMVRRFBwEbRFMBiV+mMW/wIxi5OD1kERRVKRJHUwLvfBTZrU5OWBGXLgQu7Jfe98z/ec7z0vKa88b2q1BDtRHdAPBaylm1NzsxsOjPnPNt6WSWprbft+/c3I3zOAjhT1Y4+fvcjEQJIXnVECSa+AhqIHqlHH5lWCZoe+Gk4GRgDG86j9SAUdlDBSQaZhlOkuHyoVdJmsw98D1S5fM4NYM1LCpqM+Lwa240oLgmZzpVZvzKT75VLZcqksSZKWlQeAy/iORVwIvh31xvotvK7VG3Px4aWHj3Jl4C2uYSvq+Bn8v6LLbaVWb9zsBiKLCvbiNG7gLm7jAYqbPHMJMziZ9lsKoh8GtqCEVVzHftwJn+TFHp4/hg8BSCYVfMOZoPEv2NZGdy9WCGUr9toDR3E2/H4V6nwRe/BmgN65H1ZhvMuB3XiKIyFoGefwO6ysVkUlrNUNsyAK/jli533Q+Y8cJFvAeXyMS1CI/jiMr/gUtD2LQwMGr4R3p7bY3oQHQ5b38CT4D2AXXg6YcQXHpyYnlqKsi5iOAVSwL9zd7zJ09r+Cpwq72omFMazjT9Dnibym0dTkRDUKrrgwH7MwXVyYB38BstaGDfLUTsgAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-redo{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4itK+dVQAAAaFJREFUWMPt1L1rFFEUBfDfJDaBBSslIFjbaSFp1FJQFMVCHkzhKIqdUYOCoBgErVz8rCwiTDMwBCIKipDWyip/gxAIWAmBgBC0eYFh2Gx2l9lFcA5M8e59782Zc84dWrT435Hs1siLchqn43MS0zgW22vYxjesYjVLw3YjBPKinMUTBOwf8J5fKLGYpWFjJAJ5Uc7gIW6jM6Kim3iNZ1katgYmEL/6I+YasvY7Lg6iRpIX5VF8wuEe/XV8wGf8jN6LWTiAc7iEQ7ucPZ+lYW0vAtfwvlbfwCKW9gpXDOv1mJvZHiSO91MiyYsyiQSuxtpXXM7SsDmM5nlRdrCMMz3sOJWl4Xevc/vwBzdwAl+yNNwZxfRI+GxelK9ikHcwh8d4NNR/YFRES1ZwoTYdR7I0rNf3TzVNIGbmSvR/Bx08mIgCFSVu4l2ltIWD9WxNGR+W8KOynqnZ0rwCeVG+wa0hjrxtWoF5dAfc28V8Mib/n+Nev5dnabg/zgw87aNEN/bHOwVRiRe4Wym9zNKwMKkpgIWKEt24njxiJlq0aPFv4i9ZWXMSPPhE/QAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-reset{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4gWqH8eQAABLdJREFUWMPtlktsVGUUx3/nfvfOlLQaY2IiRRMQIRpI0PjamJhoVASDvNpCpYw1vJQYSVwZwIVQF6wwRHmkAUof9ElrI6VqDAXcID4TF0IiYQMkSlTokNCZ+b7jove2t+NMH7rQBWd3v+989/zP+Z8X3Jb/WGQySvUNTQBJESkNguAVYIWqzhaRhwBU9WcR+QXoymazn6jqzUQiMQSQzWZRVdal1vwzAI2tHQBPOuc2AbWTdOyQ53n7nHNfRwee51GzqoIQMCLDpr3x/tLQ0oZzrk5Vj0/BOEBt+KYuOlBVGlrahr0Wob27t3gEjnZ2AyQzmUwHsDgP6J/AYRE553neDwDOuUdU9QngNeCumK4TkRMhZUORcYC1qysLA6iuSQHIwkWLD6lqapQsuSmwTVV3h99I7EcAR462A2xR2Ilq6ehTaejvO1774kuLNALR33eclsaGsQDe3fYegHl43vyNwEeqGl1963mm2jl7YZRTQ82qlWP4HM6ZToC5ztkW4LHQoALru7s6Di5dvlIj/e6ujrEAWoZDn8hmMjXATMACGaAVuBjXTVVXFc/AxhaA+4zvn1DV+eHxVWPMAmvtb5GeMWZyZVhI2rt7qVy2pOh9U1snwIPW2vMi4oWJuBPYHkVAVScPoKmtkzVVK6cEMsyJraHhiCqJqJUwj/JRz7TW1iSSyR2rVyylqa0Ta+24Ic8vXaAEmDFc/l5Z2A/80OibuVyuz/f9ElUdHCmvw82t5HK5h6y1PYhsz2YyGw43t2KtBZHIGwB6+j4rCkBVUdV7gXrggnPuu8h4eP+xMeZS2D0rJYZ6AdAMzAt1b4nI26p6IFZOY8pugijcKSIHVLUK0LyST4vnrVfnWr3mjmP4QTATaERkXkypRFX3isjmuHdRJEK6Ckqquopp06bdKCkp2Sgi7XnGLcg7gzeutwNIiPYc8HixqIrIOlU9ONVIhHPEd851icgSVXUiskVV94gIqoonIt0i8gfQCfwae38e6BWRXuBZz5jZ8VbaOE4EIqlZVUEQBLlkMplS1QER2RwkEnsSyaREDUzyeNsvIhvCMqkH1kdIJ2o+k8iJB1LVVRfjZ6nqqlEAIbdVQGto8Lrv+/dbawcjAL7vc+6bs+zetetfLSHxniIFGofGGsU2oC7eOCbDfZ7nQawBOSAX74SF9oEPImOq+r7nmVmxb5raukZa8UReGmNmhbMkAwwBH467EYVZe49z7kdgenj8k7V2oTHm8kgdWcvrNdVFjR8cHkYzjDH9wLjDaEwEzpwa4MypgWvAjtjxfGNMj4jMiT+M+kFsZI/Q6Pv+HGNMT8w4wI7TAyevxXVPD5z8+zD64tRXAMHVK1eaVLUyVvuDqroV2BOnJF4ZIedviUidqt4Re9s+vbx8zZXLl7PR2+nl5Tz/zNOFp2FzxzGAklw22wUsLLaSKXwf8vhosZUM6PeDYEUum70VHfpBwKsVyyfeikOP6oBNwN1TrLbfgX3A1kKLzKeff8nLLzw38T5wZDgxn1LnNk5lLRfP26/OnR2hwfNYW2Atn9RCsrf+EECyrKysDFimqhXhyjY3VLkAXBKRDqA7nU6nS0tLhyIj6XSaN9bVclv+l/IXAmkwvZc+jNUAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-save{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4UexUIzAAAAIRJREFUWMNjXLhs5X+GAQRMDAMMWJDYjGhyf7CoIQf8x2H+f0KGM9M7BBio5FNcITo408CoA0YdQM1cwEhtB/ylgqMkCJmFLwrOQguj/xTg50hmkeyARAYGhlNUCIXjDAwM0eREwTUGBgbz0Ww46oBRB4w6YNQBow4YdcCIahP+H5EhAAAH2R8hH3Rg0QAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-tap-select{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo3NzIwRUFGMDYyMjE2ODExOTdBNUNBNjVEQTY5OTRDRSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpCOTJBQzE0RDQ0RDUxMUU0QTE0ODk2NTE1M0M0MkZENCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpCOTJBQzE0QzQ0RDUxMUU0QTE0ODk2NTE1M0M0MkZENCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1LjEgTWFjaW50b3NoIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OTQ0QzIwMUM1RjIxNjgxMUE3QkFFMzhGRjc2NTI3MjgiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NzcyMEVBRjA2MjIxNjgxMTk3QTVDQTY1REE2OTk0Q0UiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6eYZ88AAADLklEQVR42rSXf2TUYRzHv7tuGcfE6Vwb5zLSSjEj7Y9KWqfEmFZJP+yPMdKKmUrrn0iUfjhWlLFi6YfNrF+StBoTo39iYkTGco4xxxG59P7k/T2PT8/37nu3bx9ezvPj+zyf5/PreS78bGLS8SmrwE6yje3NHJsDBTALpknBz6JhH3NiYAB0gHqPOVv52wJ6QQ48BzdAttTioRJjdeA8mAHHS2xuk3p+M8M16ipVQE49Ds6CiFO9RLjGONf05QLx6wPQaBlbBlPgJVgkP0ETiIJ2sB/E1XfimjfgBOOlKDUqCGOcqBcQnw6BYW5YTo4wbvQhMmCfGRemC2rBiGXzWUb+kM/NRZ6CHWBM9ce5R61NgX6ayhSJ5EPlItlDRNkz4JbFHf06BkSzHjXxM+gDv1S/mPUo2AXWgt9UUHL/IVhS8yUV1/EbV3o4N+NaoE9Fu/i827K5pNYHnqAVJECShWmAaddpscYFFXwR7vnXBRGlnUN/L6kqKJlxnRUuDbaDBiL+vst5d4gpcpBrqk/2jIgCKVUolhntplzivHmwh4stGOPfwBWwl/2dpp8p7xjQZqFLiQJtauKkivYm+kzccpK57yXfOUe+P23JqAnVbhMFmlXntCWnxbT31am9ZJ4BJifsUmNTqt0cYhA5ypympPg7VkEKunPbVb8cIG+0kyHLJZNR7fUMooUKFHAPkfQo58VLK+RzwRDd4FdWG9mjpaAXzqkJa1R7kQttqEABWXMjOOxxVRfnhRm5URX1prk/0pQHwNcKlchZ+jdpC+hFdVqO0my9Hj5dkYgCn1Rfh/KdlNDHrJhPqlDih+IfBd6qwpOgEqYMsorJ2HtWxtagLJDn/W3KRfPOZhoeBJfZPgVeGKeKrkQBh5dLXl25Ny3pc4/1fkTdbvFqFQgbxWeYD0hXulhQ0pYiM1jG547fcbMQpVnHTZEn9W3ljsCzwHxCdVteNHIZvQa7/7cC7nV6zHIfyFP9EXjFa7YxKAVqPP4bxhhoLWW+z9JyCb6M/MREg59/RlmmXbmneIybB+YC/ay+yrffqEddDzwGvKxxDmzhc0tc80XVgblqFfgjwAAPubcGjAOl1wAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-undo{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4em8Dh0gAAAatJREFUWMPt1rFrFFEQBvDfGhACASshkL/ALpWVrSAKEQV5sIULWlgZNSgIFkGIVQ412gkBt1lYLERREFJqJRaW1oHAoZUQsDqwecWy7N3tbe6C4H2wxc682Zn3zTfvLXPM8b8j6RqYF+UCzsfnHBawGt3fMcAX7GEvS8NgKgXkRbmMxwg41TLsN0psZmnodyogL8pFPMIdLHUk7hA7eJKl4U/rAuKu3+HslFr/FZezNPSTFslX8QErDe4DvMVH/Iq9F7VwGpdwZUjsPtaSFjv/1vCBPjaxO0xcNbHejLpZrrlvJCMCT+JzA+2fcC1Lw+GE4l3CG1yIptfjCtiKoqtiJ0vD3aM0Py/K57iIMxgkQxat4EdN7e9xdRzlk+LEEPvDWvIDXJ928sYxjL36icWK+VaWhlezOIqbGFirJd/H7szugrwoX+D2BDEvszSsT5OBdfRaru/F9dPXQF6U27g/KnmWhgctxqyzBrZGMNGL/rHI0nDkKXiKexXTsywNGx0OnFbFNk3BRoWJXnw//j+ivCi32/S8CxPVNiWOAdUiJtXITIqYY45/Cn8B2D97FYW2H+IAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-wheel-pan{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEgswOmEYWAAABddJREFUWMO9l09oXNcVxn/n3vc0fzRjj2RHyIZ6ERuy6CarxJtS0pQSCsXNpqGFWK5tTHAwyqIGN7VdEts1LV04BEoxdlJnUbfNogtDCYWQRZOSxtAUCoFiJY0pWJVUjeTKM9LMe+9+Xcyb8ZMychuofeHCffeee7/vnXvOuefYlV/+mv932//tb91z/Y2rvxmMHQ+4FcEfOIGN4A+UwDDwoQScc7vM7AIwB8yZ2QXn3K77Ab6OgJnVgeOSbkqaBiaACUnTkm4Cx3OZzwf+qzcRQup1zNZ9RwDe+0YI4YKZTUn6zCGSMLOfAF/03r+QZdnyfwO+ePEiI6N1nPMgMDMkETLRbd2mXG8gCbd9YiIKIUxLKoLfBN7I+80+CUlTIYTp7RMT0b3Af37p8kh5y9gZcy4Fzt+5szqSaxkzUR7dwtrKMmaGW242d0t6vrD/He/90865o865o977p4F3Ctp4frnZ3L0Z+OryUrVSrZ0z8ZxhHjhcq1XPrS43q/0flDlK9XpPA2ma7gMeyvfPx3H8TJZlH4YQWiGEVpZlH8Zx/Awwn8s8lKbpvmq1ahvB641SXNk6dhLskNA2MIBtwKHK1vGTW8bKMRbAMgyPqWeETxUM8VSSJAv52JmZA0iSZMHMThWwnipXKp8hsLLcSaIR92oU8xjSayCQXotiHotG3Ku3m+0EOQwPQCDggMf7BzQajSs5eAk4B5zLx4O1vD2eJMmAQKliscgASJMw21pansFs1swQ/DNLmUmTMNuXX+taXHTDaj5OW612R1JZ0nFJJ/J+XFJ5aWmpA6S5bHV8fHsPHFU6q3pJCjtFxtrKMuXRLUUXXxdrRLazFOtUolZlsGhmACsgnHPTwJnCnjP5HMBKLotzxsTE9rgDL0t6LoriKsDIaB31ZEK+JxQJRHFUBR2NqLw8OTkZR0OC0ntm9k1JWU7OA4vD/mZ+YfElsANmNEKi75vztzB5M8uAr+bx48me88g757PQ1U5zNg52YH7hX8l6f+4Fi3c3BqHNmkI4YQOV2MGCNu9qHPYCewfzbrC+XSGcWEcgTRKA3wFfyzdDz5d+D3x9CIcfA4eBbQS9LscskgfLnHNPAnslvS/pbZDHLLPADpx9N9fqpSIBH8cxWZY9m6bpb4Ev5fN/iKLo2TRNgdx/eo8Wk5O7Ts/N/SOSdMjHdj4kmgkIEJLJzPZKetvMTkIvFLsR25Ml2gfuF5M7vnA66sdooJYkCSGERe/9VAjhzRxoKk3Tvg3U8nulVqvx8cyNpER2umM+SdOkbc5B8JhpqBdIgTRR24h+lpKen731aRIN7thscH9Zlv0d2F8YD2TIX7F2uw3A7ZWV1a0TYz9ca8cJZHRbuRuaDfUCw9/qJHamPOKToAwHtHN6lMvlSkH2o7wDMDo6WuGuQbbn5+YAKNcb3J5fSvrhtTY+vsOPuD1IOyRhMOkj9kSx29HfXB5RUnS964NT2+3vbGbxG9auO2cDNuV6A8NTb5TitBuOpQkfYD2vwOxgmvBB2g3Hto5X42EJyVsFlztbKpXGNgqVSqUxSWcLU2+tdToa9hasLjfPYlwGa+bTi8Dl1dvNsyvNtQQL9MO2w+HM7BqwlAtPdrvdq9773WAVsIr3fne3270KTOYyS2Z2bbXdHhogKmPj7YWF+VOSXs/v/9KdO+0fVBrjbRkgB/KIDBnYu9f/7D+ZmfmRxPd6qwB8YmZXcq1MAQ/nJhTM+OnDe/a8+PGNG9lm19V/D1Qw7HXZlcRa69+U6w38l5/4ipxzf5X0CPBILjcGPJH34pVcc8692FxcXLlXRnTwwH7+9P4f8aWe3fY59LIqo1NMyQBCCHNmdgx4BegUWefjDvCKmR0LIcz9L8nokSNH+PRvH4HC3YQ098pSbevg24qlmZmNmtmjkg4D3+j/tZldkvQXSa3PW5ptlpL3ZaIN99OS9F7+IgKUgSyEkNyv2nHT7DZX0dr9rpjua2l2r4rogRAYVqZvnPsPqVnpEXjEaB4AAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-wheel-zoom{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEgskILvMJQAABTtJREFUWMPdl1+MXVUVxn/fPvf2zrSFmUKnoBCUdjRoVaIxEpO2JhilMYBCtBQS2hejpg1Uo2NUrIFAoyGmtiE+GHwQGtvQJhqDmKYRBv+URFsFDNCSptH60DJTO3dKnX/33rM/H7rvsDu9M20fDMaVnGTvtb69z7fWXmvtc/TEzqd4OyXwNsv/FwFJQVI/sA14SZKRLOlPkr5TrVYXHz70quYkEEK4TtI2YAgYkrQthHDdhV5uuw+43/ZrwCbgRttgY/tjtrc0m83X3/f+D6ydnJhYcB4BSZcBA7aP2d4ELAGW2N5k+xgwkDB0IH19CGGH7R8B1aQeAf4KvAw0ku4K2zu7uru3ApdPEyiKohd4TNKjtjt5h6RHgccSNrddbvuHtm9Jqoak7xVF8WFgdavV+pSk5cCObNmXgK++85prCj3z28HKqZMnH7D9YAY4BvwujT8BvCuL1INX9vVt+dfwcCvNb7f9q2RuSfrGvWu/sL2Nf3LX7pzvj4ENSGBPVarVd4fRkZFltjdmoMGiKO4IIWwIIWwoiuIOYDDzeOPoyMiyFLkum7WJCMDztrcrTTrIRuAQZ6NcK1utL4dWq/VZoC8BhqvV6l1lWb4YYxyLMY6VZflitVq9CxhOmL60hhCKeYiV7WMKIXw9jT1HpXw3c+bOAKzOjJubzebJrKQCQLPZPClpc7bP6rMYKtjXth2OMf7tIkr11Wz8oQDc1Fb09vY+kQw1YAuwJY2nbUluAnCWpKkaFl6IQIzxivaR2SYA89sJVK/Xp2x32R6w/a30DNjuqtfrU0ArYecDCEqgLqm94T0dEm9mBG7PxkdDlkBnkhebgIezNQ8nHcCZPL9ijE1Jf/bZZoPtzbavmqNZLbf9tSxq+yoduuJ+SZ+zXSZyBXCqU+d8fvC5yRUrV+0G2j3g2hDCLyXd/+Su3QdnvP/zCuH72LWsgf2k0oHlH2c2odlkxcpVEdgr6aDtjyb8x20/J+mA7T9I6rL9SWA5dne2/GdXLl58qNJh398An85yTMA+4DOz8Dgu6Zu2dwJXJ91ltm8Gbp7Fgb+EEB4aHhpq5CEtACqVyr3AC0AlPS8k3TSmQ2YPhhBuS/1/LpmS9JTtNTHGfwBU2uUALARotVqniqJYH2Pck85pfavVaufAwnQvnHc0McaDKVptebN94QAnJB0EdtjekydyZXqjs/0ZgLIs/w6sy8bnYGYJ63pgERKC05JutT1kOwITwL9tvzlzUQUYB+Zjs2DBgu6xsbGJZHstByZbezregcBXeCsEz1bnzXt5anLyzLq71zDLxTRdVgemdx0fv2e2w5thO5DbiqL4oKT3ZKpnpyYnz+SY2ZpTAPZmJfdIrVZbNBNUq9UW2X4kU+2dcf53Aj1pj2PA7y/6m1DS00A9za9uNBq7iqJYBuoGdRdFsazRaOzKSqye1rTbaa/tlbYrqXQP2X4FIA9/J1l39xrC0v7+w5IeB8XkwS1lWe6TGJAYKMty31tfO4qSHl/a3384I3CDpI+kzC4lnRfrue6GytEjR8oQwlY73gC0L4qlth/q0M1/LYWtR48cKQF6enrC6dOnVwGLEpnxnp7en4+O1i/tszzGOCTpPmB7ahb57QUwBWyXdF+McWg6MScmuoA8OX8xOlpvXGz422XYTsB/SnpA0h7bX5R0WzI9HUL4qe2XbI+dk3xl+V7gxoztD5jRI+YK/zkEEokx2/uB/RdzIfUtueqVN04cXwF8G3iHY3z9Urw/j8ClyhsnjrcS2Vv/J/8NLxT+/zqBTkcxU/cfEkyEAu3kmjAAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-box-edit{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4QfHjM1QAAAGRJREFUWMNjXLhsJcNAAiaGAQYsDAwM/+lsJ+OgCwGsLqMB+D8o08CoA0YdMOqAUQewDFQdMBoFIyoN/B/U7YFRB7DQIc7xyo9GwbBMA4xDqhxgISH1klXbDYk0QOseEeOgDgEAIS0JQleje6IAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-freehand-draw{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADTElEQVRYCeWWTWwMYRjH/88721X1lZJIGxJxcEE4OOiBgzjXWh8TJKR76kWacOBGxdEJIdk4VChZI/phidRBHMRRIr7DSUiaSCRFRM3u88gz+o7Z6bBTdjmYZPf9eJ55fv/5zzvvDPC/H9QsA66Olo9Ga+/MdR+Ljm2/KQIULsz9FqItGdOfJKLhApLgVkiSCGODjWit7QpKWy+TNrFeXvzKVUT8NiTVaIgDcbiCFJ7GiT8WkARXAdYBK0Lbhi/CenArRNskuM7/tgNp4ArQ42dwjf3WY5gWTqC7O/NbNn2Xkfw/YwdSw/We14HP2IEZwX+y9cZ9SH0LmgFP7UCz4KkENBNeV0Cz4b8U8DfgKiDxMWwUXETqLvJpCQpXZfawbzS7t9v5pL19cHBwfja7YA0y/lyCM0+E5hv5+piZXwKYcF23as+37bTXsQVqgkL0p/34fHR7DcBtbetFsBmGDwMOJCggYG55yw7dMlk6DuC1Bdu2RsCU9TYWQq2IoGbsreZ5NzvEqfSBsIsIy8OTbcdgiRHeh4o8AFAEwDakbY2AaCCpH7V9aGhoUUUy3UyVbkPYFuYLDlUZH8XBpwxkK0Dbgxg5HcVi0ent7a0RULMIozaHBSMfF9b2SzdutFcFB2FkwMIJOG6qfteXOa1nHZ48tyefuwyfT9s6wtzZ3t7eZse2DR2I228TtHXzuWCx9g8MtK5cuHCZTH4tiHEOa4xFngvTyS8f35d6enomiCi4/foEXBkZaQuukChL4FYA2Whd7YcC4gEdW3CpdL3LtGAVCVYJywEyTpAuJKeMOKXZs/Bw947C50KhUFOG4cwz35cjWNBlHGeD53n3xsfHP/T19U1qciggar8Fa4I3PHobIotBWBtc2hSiChyZxVzM53Pv7FVH6Tp3uVy+g0r1ImD2GjIrQGYIxjnfuXTZGICS5k/bBwJoubwEFX4TLah9EXomJGMA3za+f9913Yl4TnzsDQ+vE6YTZOjHh4ngibstt1pzQwd04F0bPStEBpXqRoBeQ/AKghfBnOEKgS+Q7z91Xfdz/HGKg8Ox7z8iYD9z6wqTkZFgnvhMGP9VZ2or1XVkPM9z0mytSfVsHa1RLBZbLoyNzUnK+ydz3wC6I9x+lwbngwAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-poly-draw{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEjglo9eZgwAAAc5JREFUWMPt1zFrU1EUB/DfS4OmVTGDIChCP4BgnQXRxVHqIJUupp9AB8VBQcRBQUXIB9DWQoMRiXZzcnQSA34A7aAuHSJKkgo2LvfBrU3aJnlYkBy4vHcP557zP/9z3r33JdXa647N0kHSZd5Nn0rSxc8G3cXp85sMcnZZ8vge3osZ+l3vB8CWFA0iL14t79h210swAjACMAIwAjACkB90D/8/GchI9ve4nPwTBh5E9ws7OepzGWb9EddSn51Op9ZstadSg4VK1UKlKkmSDSMLALewiuNh/hVJq71Wxttmqz0dG88vPc+MgWP4grvYG3SLOBrZFFFrttqPe4HIDxh4GSei+98iSlusuYopXEAjBtEPA3tQwUpwluAbDm4TPJUz+BTW9l2Ce6G7L0X/Bw8D3T/7SKKIDzHg7QCcxjvcQAEtXAnrrg/RP0/DKPbqgcN4iVOR7gcO4dcQgRuoh7HSqwlP4n20m63jJu5n8MkWMYfP3UowhzdR8FU8w9iQwevBdyq3/27CMRzAE5yLuvsRLg+ZcR1nJ8YL81HWJUzGAPaFZwe/Q5MdyYDyNHgjzO90YyGHtVDncuiJchaHw8R4oREFV5qdiVmYLM3OgD9k5209/atmIAAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-point-draw{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEiERGWPELgAAA4RJREFUWMO1lr1uG1cQhb9ztdRSP7AF1QxgwKlcuZSqRC9gWUUUINWqTh5AnaFOnVPEteQmRuhCURqWsSqqc9IolREXdEvQBElxtdw7KURSFEVKu4w8wAKLxdw9Z+bMnRmZGXfZ29//II8th4WwGVNyIoQLYB5vxA9Caq04iUd9A+7ZlsNC2I7TdSd2hZXMJKlnTqp9jtl/GBaqoyQ0noFKpUIzBicYYc+DEFpxkglc4oVJa5gvDn8v1xV2irG3FM4NSVwjUKlUaMcpJhCGmSEJQ6QGD8M5WnHCd8+f3QCXpPLx8WNwv0j6Bm9FMK7FJ3WBE+R/2t7c/GBmFvSBrzRTCsyTDjXrxUgEMtpxynJYmJoBJ4VAybwVARgvL7Oik0okCodnKpVKX7P0leiVMb0VvbJT+upznK4vh0GIeQwwQStJkHQD3MwsCALTJRG7Qrdrj5m/djgYaIa0hlkRdJk26XEgC9txurccBtVW3IudBImmZuACUP+ZlIDBt9FKcubYNTcAH/X0RYM1E7utJPlqe+uZzPxUcEkiSS4sTT95n15Mud0xWC0o2PAWOCdK3KYZlFxfM+tHOcnMzNr1es18ug+cgsVjP4yBU/Ppfrter1m/+l0+zYygML1xRVHU7TSb1cSzBzoBzszsH+AMdJJ49jrNZjWKou6wBnwOzcyndBpNbuueURR1Dw8Pq35p9cc5p/Dy9Dypt7jXrtdGwQECS9NPhr6Gq6txUzNigE6zydLK6lTw12/KT4FGFEUfJX2YJNONq5tVs4ODA7sD/DnwJ/BoADZuE3tHFs12dna6d4C/BI6AlbyzI8ii2TTw12/KK33gb2cdXsNZoAntbZC2SeO4c9592k/5eNQbiwvFd1kJuFGwLJr1wSPg/SwpvyFBHufOeXcFeAlE97U/uCxOY+P3b+Bn4B3Q+L8EdJfD4a+/AbC4UBzPxiPg3wlHZquB28Cn2IuR9x3gr3uV4DbwfvSDOvi4uFA8BDZmIRHkjHpS9Ht9iRqd8+5G3g05mAGcQbsdiX5QJ428G7Kygo8XYdb1/K4NWVmjzkNge2sz84bs+ELmpDDLtqWsNZBXgvmw8CTtpWVMT7x5YWBjLARnwZfKQNYN2U2LPvrh+5nBt7c2M2/It9bArCTKR8eZN+SJ13AScPnoODeRdqNenH+wul5w2gUr2WUjMFAt8bZ/0axX/wNnv4H8vTFb1QAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-poly-edit{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gELFi46qJmxxAAABV9JREFUWMOdl19vFFUYxn9n9u9sCyylUIzWUoMQBAWCMdEEIt6xIRQSLIEKtvHe6AcA4yeQb7CAUNJy0daLeomJN8SEULAC2kBBapBKoLvbmdl/c14vdmY7u91tF95kknPOnHmf95znPc97Ro2OTeBbdjFDT3c32ZxVHUOE9kSMB0/m6ExuoJn1H+ur6Y+OTfD50SMN5168OgrAlyf7CfuD+z7+iDs3p8hkLUQ0iFQ/yFl5Nm/qonfHVva+s32Zw9GxCYILsZ08tpNfBhbs+1YN4OH9+7huGdECSBVfqUosbsllfmauBqiR+cCNwOr7AEo8pPHJnymXykhg5fUWjoQpl0vVvhZhbSzGoUOHqgBlt6B6uruj2Zy1E9jo0fhfeyL2x4Mnc8VErK0KUEOB64JSyptfG4RSytsJjUJVxw2lsFy3urL9nx1Qd25ObctkrVMi+jQivd7U2ZyV/3Hzpq7h3h1b/7p9Y0o8v8rwAbTWrGpSocN/FGDlbAI0Rl23PCBan0Ok158H9Ipwzi25A/Mzc9Gl/BYx/E4kYqC1NKRARNAaDCNUM27Z+Zr+ouXs0q4+LSLBHPYCFkTkC6uU39kwCdsS7WRKmaYUiAhdnZ3MPX2K4+QjQI+C94A93rMzm8ltMwyDeDzWjMZeEb2pYQDdW3vITU2jtUZ5QThOPgm8C7wP7J15OPsBsB3oWpGnVWisCeDS1VHj4vBI92+/3tgB7Ab2AruAXiDBK5oIOkhtkEYRNRuJhObrd8Dl9ewf4D5wG7hVLpen29vb5wzD+BrkbBMaL3d1dk5nsrnlFDTTFWAWmAZueWD3gCemGde2k2fw1Al1YXhEvjozoO49eczdqekrWmsc2zlrmvEKOGoW1GUjFLqSk2KpJrCLwyMCPAP+BO54QL8DM6YZX/ClsP9YnwKkXnIBP4jdIpJRpdJTCYdMwwi98KU0Hjc/dDILNyUcwTCWdOSMJ0TRmBktGRhLugu0xyLk7CIqVNm+0bGJptl1YXikD0grpY4Rjc4a8Fbgdab/6OGbAJeCUuyJnnHmZH9pbSyGuBXV8NUwlUpR1EWyixmSyTWEwqGlJ2Swbo2JXbAAfgDGgGQA9I1A9t1tlq0AxrXxn0ilUpw4fhQqYkH/sT41OTnJJwf2s6FjI5mshdYa7bqVR2uezr9MJmJt14FvGrh/O9D+e6UkM/xyCuCqEKCYnJyUTKFQrZDHjxzGshwWLQcRsOz8Hi85P23id0ug/XilAMLBmm4tPGdoaKjSH5+oAGrhwvBI9SjZTn4QSK9yenoD7dlrExPoJlXW8G8ytpNHxRKk02lGxsdRKFwXLNvx5yY94HQLGhGk4LFCYQSqaE0AwWM1eOoEbR0dKBSW7bC4mKuffxs4D/wCLKwQQPAUzIkslfp6cVomROWSolh0GjldAM4nzDi2k9/i5UAzC9aKfwNJ3zgJg9YEvN6+C7SHgKm69+sD7RfNnKTTaZRPQfAut4oFV//IS7gkcB34VlVo8kGzphlfB+DU+TfNGBpZtRastvrvARJmfMF28ge9sc2B9/PNnCilMIDwK6y8/ow/Ai4kvILTljAXvDvEvrqKSUs60KolzPjBxspavQD2tKqCAGF/Ba+xE/Wbilu54wZV8NEKF5fXzQHl/bh4hUsE0WAXSlDMYcQSrQXgCmsTseXHsJkNnjqBFGwKJaHsKlxtUHYVhbLCzr1kaOA4bcn1y1Swmb+iLpJKpVrfgdpfsiVVCYcgluwgnU7jEgJ4s5UkLFtWYyHyEg0/N1q1tmQH+YXnAMFr97Nmv3p+0QsHQRsF8qpBOE5+rb9Nkaj50tVQKjqh4OU3GNL/1/So3vuUgbAAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-line-edit{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAG/3pUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarVdpknSpDfzPKXwEJBDLccQW4Rv4+E4BtXR198znCdeLLijgQUoppWg3//Pv5f6FDwefXJRcUk3J4xNrrKzoFH8+pyUf9/f+8J3C7y/j7jnBGApow/mZ5l2vGJfXCzne8fZ13OV+9yl3ozvx2DDYyXbauCDvRoHPON3frl5Imt7MuX8hH0seiz9/xwxnDMFgYMczUPD7m89J4fwp/iK+OVRbiMf6gm8K4bv/3NN1Pzjw2fvwn+93PLzccTZ6mJU+/HTHSX723/bSOyLi58n8jmiqz/798+a/tUZZax7rNCKOakzXqIcpu4eFDe483kh4Mv4E/byfiqd49R2OHzC1Od/woxLD44siDVJaNHfbqQNi5MkZLXPnsMdKyFy5gwwCHXhocXahhhEK+OhgLmCYn1hon1vtPBxWcPIgrGTCZrR5fHvc58A/fb5stJaFOZEvT18BF1t8AYYxZ99YBUJoXZ/K9i+50/jPjxEbwKBsNxcYqL6dLZrQK7bC5jl4cVga/Ql5yuNuABfhbAEYCmDAJwpCiXxmzkTwYwE/CuQcIjcwQOKEB1ByDCGBnMJ2Nt7JtNey8BmGvIAICSlkUFODgqwYJSbkW0EIqZMgUUSSZClSRVNIMUlKKSfTKc0hxyw55ZxLrllLKLFISSWXUmrRyjVAxsTVVHMttVZVHKpRsZdivWKgcQstNmmp5VZabdoRPj126annXnrtOniEAQlwI408yqhDJ02E0oxTZpp5llmnLsTaCisuWWnlVVZd+mTtsvqVtU/m/po1uqzxJsrW5RdrGM75sQWZnIhxBsY4EhjPxgACmo0zXyhGNuaMM185uBCEgVKMnEHGGBiMk1gWPbl7Mfcrbw7e/V9545+Yc0bd/4M5Z9S9Mfedtx9YG7rlNmyCLAvhUyhkQPrNhvO5AJFnrZIR0plaLL5liQYdDi5TubaIokFDkmoFEB8CzxZVxemssDqthPhUblPgW1iQU5g6XwNwyVI7bUFRm035iNziMkgWvEso2SXnsJfveR0Y4SlVF8YWC1pVQhJiQa8JwDvlMNIxAfq3F7GDObHU1LlhzlZaWwNp6BvACxAgInGXlllMGZCpEnZHrGA6GM2718xuFcz7YdUQxzEEfjdWz4GlkcwaonT0pgA6mB25grPILtnSMhuCpsGhmMU6uJbixJs4lbKHqh+wos1jW2rchyGRCIvN9MXu+KAmMSfAlIKVvi/tybhCPJZCu2Ow9pLdyo427+X2ovMBmKNu8PA0zgl3fS0PB1DWWkVYB47bkyiJHhkFPzTzCjzn4Dq1mqoIWzCmcDGsHQmQAQdEHsixK1IXESd5rLU7THVJNV8obHS8sZeN0G5Jdt5pQTVKCCbgK1hItTS8o92iEZpuWJ/oC2r/0+zTmhvFXoaMVKRe27altDtid6OvG1hENVwBnC61KKugNoemOiPCCNb3GoHAZOFuDxxPsD+07nbSPcr/o1Zmc4jARhotrA5F5ZcjP9rPk90vR8A+k028A+8+5wKlHVID542sMzMCuXktkRzUCpE+xCBZywjNcJITx0II9x5948CekBl4XaC5OCX2nCyObdwN3HwQh5DWL/BBEkhDYHn/vpXNgZkVTZs8rj+HO8JFC6qvDVhgAEQSYCDyC86rMhG1WPzAVB9ZldDWG6EzDcFiqJBDvFS8mXDv3SK2LPoguVB2kwUx7UL5KqZWiEzocsbvSjNnaYDNtcYJuA5cDcsrvHd6yCxGjqvl9+wh3Qh8Kc9py8sNW8ncU8qwxdPj1qIGfrPqlXeoS4/JLa/LwRLTCtxuSoZUT+2Su6kXW3QNacYQbId6NUKVbROpviybFSPQQL9lhB2MamEnFyB9Y+hrG1+xBg+L0QG2TZdTdlcsBdq9oHdt9Bu5/IM9+Nfh1AwrSqlboTA6Bgq568A7UfbaMrZjoQZhQphofvNw93+bN+5X7FYKBgLmRid+tSdV6c02A4R0cHwKobmoMt5+6WI9XNISFIywpf6RMd5/a91vE78FzVHIFmxud4woyJx76OMTCa4yhgN3iJO2VfRPFMv9sYTxFzU+1eWeYS52pwOoSJldZY6koib4P1O427rbeUrNZfu44hWjz5ZSuu/vKPpimoXbLkfxWSPetvxDWG5jQSaZCxA3ad+p6rlttDhK+YwwK1LHVe0drDtorc5vnQ1247g58vewDtU7L3DRwrG4dhCUDRKKOtYr2dXHtpt+33d1WZmfkAHdl7Q8ENF+CNgB+nOw29n5F7SeNo/ckbu4laLTCdqJLHjmhJbKzmrCEX7zULrhefuHmu0V/1nbP1pnb6FaT7sOxn4pvWkfrYhYtCeJ4Xv+kOXrroIs1eHWXN1/AfzaY94ms5vaAAABg2lDQ1BJQ0MgcHJvZmlsZQAAeJx9kT1Iw0AcxV/TSkUqDnYQUchQnSyIijhqFYpQIdQKrTqYXPoFTRqSFBdHwbXg4Mdi1cHFWVcHV0EQ/ABxcnRSdJES/5cUWsR4cNyPd/ced+8AoVFhmhUaBzTdNtPJhJjNrYrhV4QwjAgGIMrMMuYkKQXf8XWPAF/v4jzL/9yfo1fNWwwIiMSzzDBt4g3i6U3b4LxPHGUlWSU+Jx4z6YLEj1xXPH7jXHRZ4JlRM5OeJ44Si8UOVjqYlUyNeIo4pmo65QtZj1XOW5y1So217slfGMnrK8tcpzmEJBaxBAkiFNRQRgU24rTqpFhI037Cxz/o+iVyKeQqg5FjAVVokF0/+B/87tYqTE54SZEE0PXiOB8jQHgXaNYd5/vYcZonQPAZuNLb/moDmPkkvd7WYkdA3zZwcd3WlD3gcgcYeDJkU3alIE2hUADez+ibckD/LdCz5vXW2sfpA5ChrlI3wMEhMFqk7HWfd3d39vbvmVZ/P2aecqIM1FFZAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AQdDBkQmV+argAABM5JREFUWMOtl9trHFUcxz9n9jYzm7Tb9JIWGtqUllLwVgRBQWl90S6lTaGmF6E2/4H+A4r+A0offdlWodL4kEZw9bG+iC9iKqLF0os0EBq02dtcdmdnfj7szGZ2M5vulv5g4JwzZ873+7ufUfMLi0RSa1TZNzVFrW511xBhzMxx79EyOwrbGSSzZ073zOcXFnlv5lTi3mvfzAPwwYVZ0tHiq6+/xu+/LlGtWYgEINL9oG657N41yfSRgxw9cHjDgfMLi8QVsR0X23E3gMXnkXQJ3L9zB99vI4EA0sVXqsPF93xW7y73ACVJBJwE1j8HUBIi3Sz/QNtrIzHN+yWdSdNue915IMKWXI4TJ050Adp+U+2bmkrV6tZeYAXwEJExMyf3Hi0rM5fvAvS4wPdBKRW6vZeEUiq0RIBCddddpymu0+rRbPvEzkPVmmWLBA1EdGAbYNctt7V712QwfeSgd/uXJQnPVVoEEAQBTxXpuEMELNtNNFW1WrsrQdBCRImQEeE/wBUh53v+7tW7y5n1+BZRIoJSioXvy3itdgclURSZTBrP87AdV57G1TT0d4GPgC+Bw8Ca7bifATsTgzBvjlH1qgNdICJM7tjB8soKw4jtuD+Gw3c229e1wF+P/uHPpT86rhBBRHActwAcAl4EjgIvAYcFJnlOoq5dv6EBU8AR4OUQ6AVgGjATwuC5YUdZ4A+z+1mBTUM/AKwqpZSIpPfu2VP7+/6DYEMMPE9N83lzq23ZWwxDd4GaQnmgUloqperSCpKC8HGCXz8G7NANU8CWUKPzsUDbyLPVyjYC39e0VMZx3Ccoha4b4lQqbUlnsBqNWCXpEMgKfA38DNSBcdPQr4zlMtTtFiqlulmQmJv9ks2idUZGZMjZmZMAfBUvxWHR0y5dmPV2FcbPG9ncFdPQS3nTuAJQLBZpBS1qjSqFwjipdGr9SWlsHTewm9ZmnngMKAaV9nBd+/bmdxSLRc6dnemm3+yZ06pcLvPGW2+yfWIn1ZpFEAQEvt95goCV1TXMXH4zAt4woaRF7RTAVylAUS6Xpdpsdjvk2VMnsSyHhuVEZTh+xgywBhwLfZIdKRfj7dWqPGFubq7T428ukslkaHttLNsZ9P3nwIfh+DhwS4EO9DA0zByBCE2n1fPxpQuznSCaX1js9nFp2pjbtqGhobQ0jUY9CbgALERah3IM+El1rNqTaqaph5W1uYGAFrfA5YvnyE9MoFBYtjMI/BXgQR/4pqVDZL3V9/cYrX+x7SnsXh/H5TLwW2iBQbVLNgn65CDsrSPOIJOXwmdQ4fRHrZilUqmXwNXrNzbbfxv4ArgFVBLeJ95oDEMHwHHcvvUcRqEwuBf0SSUEB9gfxsAgAkO1kcj/WvwKPaR8EhvPAUvRtdIMtR1FtBH37w8DEeChaehXw/xfAnzHcVOjEkhHrIe0Qlz7T8PuWLEd9+2w9KphgUUgQJ7JAgAPDT13NTrJyOYqIilrlEwQv/NPMTSByxfPIU37eCqtq2zWmPYDjbavaLYVdn2NuffPjqRJK2hRLBaHzoK+X7L1QE+nIFeYoFQqkTVMaTn2UOe1LWtwEJqGzqgRnS9M4Fb+3XBJGfSrFzW9dBw0icioJBzHzUXdMJM18APwWo6Kmy1O6X+V8UHDotBqogAAAABJRU5ErkJggg==");}'},function(
2e,t,n,i,r){i(),n.root="bk-root",n.menu_icon="bk-menu-icon",n.context_menu="bk-context-menu",n.horizontal="bk-horizontal",n.vertical="bk-vertical",n.divider="bk-divider",n.active="bk-active",n.menu="bk-menu",n.above="bk-above",n.below="bk-below",n.caret="bk-caret",n.down="bk-down",n.up="bk-up",n.left="bk-left",n.right="bk-right",n.default=".bk-root .bk-menu-icon{width:28px;height:28px;background-size:60%;background-color:transparent;background-repeat:no-repeat;background-position:center center;}.bk-root .bk-context-menu{position:absolute;display:inline-flex;flex-wrap:nowrap;user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;width:auto;height:auto;z-index:100;cursor:pointer;font-size:12px;background-color:#fff;border:1px solid #ccc;border-radius:4px;box-shadow:0 6px 12px rgba(0, 0, 0, 0.175);}.bk-root .bk-context-menu.bk-horizontal{flex-direction:row;}.bk-root .bk-context-menu.bk-vertical{flex-direction:column;}.bk-root .bk-context-menu > .bk-divider{cursor:default;overflow:hidden;background-color:#e5e5e5;}.bk-root .bk-context-menu.bk-horizontal > .bk-divider{width:1px;margin:5px 0;}.bk-root .bk-context-menu.bk-vertical > .bk-divider{height:1px;margin:0 5px;}.bk-root .bk-context-menu > :not(.bk-divider){border:1px solid transparent;}.bk-root .bk-context-menu > :not(.bk-divider).bk-active{border-color:#26aae1;}.bk-root .bk-context-menu > :not(.bk-divider):hover{background-color:#f9f9f9;}.bk-root .bk-context-menu > :not(.bk-divider):focus,.bk-root .bk-context-menu > :not(.bk-divider):focus-visible{outline:1px dotted #26aae1;outline-offset:-1px;}.bk-root .bk-context-menu > :not(.bk-divider)::-moz-focus-inner{border:0;}.bk-root .bk-context-menu.bk-horizontal > :not(.bk-divider):first-child{border-top-left-radius:4px;border-bottom-left-radius:4px;}.bk-root .bk-context-menu.bk-horizontal > :not(.bk-divider):last-child{border-top-right-radius:4px;border-bottom-right-radius:4px;}.bk-root .bk-context-menu.bk-vertical > :not(.bk-divider):first-child{border-top-left-radius:4px;border-top-right-radius:4px;}.bk-root .bk-context-menu.bk-vertical > :not(.bk-divider):last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;}.bk-root .bk-menu{position:absolute;left:0;width:100%;z-index:100;cursor:pointer;font-size:12px;background-color:#fff;border:1px solid #ccc;border-radius:4px;box-shadow:0 6px 12px rgba(0, 0, 0, 0.175);}.bk-root .bk-menu.bk-above{bottom:100%;}.bk-root .bk-menu.bk-below{top:100%;}.bk-root .bk-menu > .bk-divider{height:1px;margin:7.5px 0;overflow:hidden;background-color:#e5e5e5;}.bk-root .bk-menu > :not(.bk-divider){padding:6px 12px;}.bk-root .bk-menu > :not(.bk-divider):hover,.bk-root .bk-menu > :not(.bk-divider).bk-active{background-color:#e6e6e6;}.bk-root .bk-caret{display:inline-block;vertical-align:middle;width:0;height:0;margin:0 5px;}.bk-root .bk-caret.bk-down{border-top:4px solid;}.bk-root .bk-caret.bk-up{border-bottom:4px solid;}.bk-root .bk-caret.bk-down,.bk-root .bk-caret.bk-up{border-right:4px solid transparent;border-left:4px solid transparent;}.bk-root .bk-caret.bk-left{border-right:4px solid;}.bk-root .bk-caret.bk-right{border-left:4px solid;}.bk-root .bk-caret.bk-left,.bk-root .bk-caret.bk-right{border-top:4px solid transparent;border-bottom:4px solid transparent;}"},function(e,t,n,i,r){i();var a=e(1),o=e(43),s=e(9),l=(0,a.__importStar)(e(229)),u=function(){function e(t){var n,i,r=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,g.Z)(this,e),this.items=t,this.el=(0,o.div)(),this._open=!1,this._item_click=function(e){var t;null===(t=e.handler)||void 0===t||t.call(e),r.hide()},this._on_mousedown=function(e){var t,n=e.target;n instanceof Node&&r.el.contains(n)||(null===(t=r.prevent_hide)||void 0===t?void 0:t.call(r,e))||r.hide()},this._on_keydown=function(e){e.keyCode==o.Keys.Esc&&r.hide()},this._on_blur=function(){r.hide()},this.orientation=null!==(n=a.orientation)&&void 0!==n?n:"vertical",this.reversed=null!==(i=a.reversed)&&void 0!==i&&i,this.prevent_hide=a.prevent_hide,(0,o.undisplay)(this.el)}return(0,b.Z)(e,[{key:"is_open",get:function(){return this._open}},{key:"can_open",get:function(){return 0!=this.items.length}},{key:"remove",value:function(){(0,o.remove)(this.el),this._unlisten()}},{key:"_listen",value:function(){document.addEventListener("mousedown",this._on_mousedown),document.addEventListener("keydown",this._on_keydown),window.addEventListener("blur",this._on_blur)}},{key:"_unlisten",value:function(){document.removeEventListener("mousedown",this._on_mousedown),document.removeEventListener("keydown",this._on_keydown),window.removeEventListener("blur",this._on_blur)}},{key:"_position",value:function(e){var t=this.el.parentElement;if(null!=t){var n=function(){if("left_of"in e){var t=e.left_of.getBoundingClientRect();return{right:t.left,top:t.top}}if("right_of"in e){var n=e.right_of.getBoundingClientRect(),i=n.top;return{left:n.right,top:i}}if("below"in e){var r=e.below.getBoundingClientRect();return{left:r.left,top:r.bottom}}if("above"in e){var a=e.above.getBoundingClientRect();return{left:a.left,bottom:a.top}}return e}(),i=t.getBoundingClientRect();this.el.style.left=null!=n.left?n.left-i.left+"px":"",this.el.style.top=null!=n.top?n.top-i.top+"px":"",this.el.style.right=null!=n.right?i.right-n.right+"px":"",this.el.style.bottom=null!=n.bottom?i.bottom-n.bottom+"px":""}}},{key:"render",value:function(){var e,t=this;(0,o.empty)(this.el,!0),(0,o.classes)(this.el).add("bk-context-menu","bk-".concat(this.orientation));var n,i=this.reversed?(0,s.reversed)(this.items):this.items,r=(0,w.Z)(i);try{var a=function(){var i,r=n.value;
2if(null==r)i=(0,o.div)({class:l.divider});else{if(null!=r.if&&!r.if())return"continue";if(null!=r.content)i=r.content;else{var a=null!=r.icon?(0,o.div)({class:["bk-menu-icon",r.icon]}):null,s=[(null===(e=r.active)||void 0===e?void 0:e.call(r))?"bk-active":null,r.class];(i=(0,o.div)({class:s,title:r.tooltip,tabIndex:0},a,r.label,r.content)).addEventListener("click",(function(){t._item_click(r)})),i.addEventListener("keydown",(function(e){e.keyCode==o.Keys.Enter&&t._item_click(r)}))}}t.el.appendChild(i)};for(r.s();!(n=r.n()).done;)a()}catch(u){r.e(u)}finally{r.f()}}},{key:"show",value:function(e){if(0!=this.items.length&&!this._open){if(this.render(),0==this.el.children.length)return;this._position(null!=e?e:{left:0,top:0}),(0,o.display)(this.el),this._listen(),this._open=!0}}},{key:"hide",value:function(){this._open&&(this._open=!1,this._unlisten(),(0,o.undisplay)(this.el))}},{key:"toggle",value:function(e){this._open?this.hide():this.show(e)}}]),e}();n.ContextMenu=u,u.__name__="ContextMenu"},function(e,t,n,i,r){i();var a=e(1),o=e(224),s=(0,a.__importStar)(e(227)),l=e(43),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"render",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"render",this).call(this),(0,l.classes)(this.el).toggle(s.active,this.model.active)}},{key:"_clicked",value:function(){var e=this.model.active;this.model.active=!e}}]),n}(o.ButtonToolButtonView);n.OnOffButtonView=u,u.__name__="OnOffButtonView"},function(e,t,n,i,r){var a;i();var o=e(224),s=e(231),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(o.ButtonToolView);n.InspectToolView=l,l.__name__="InspectToolView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).event_type="move",i}return(0,b.Z)(n)}(o.ButtonTool);n.InspectTool=u,a=u,u.__name__="InspectTool",a.prototype.button_view=s.OnOffButtonView,a.define((function(e){return{toggleable:[e.Boolean,!0]}})),a.override({active:!0})},function(e,t,n,i,r){i();var a,o,s=e(1),l=e(19),u=e(43),c=e(113),h=e(226),f=e(20),m=e(9),A=e(234),S=e(13),T=e(8),M=e(235),C=e(65),z=e(53),E=e(222),R=e(223),B=e(238),N=e(239),O=e(232),D=e(230),I=(0,s.__importStar)(e(227)),P=I,V=(0,s.__importStar)(e(240)),L=V,j=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"visible",get:function(){var e;return!this.autohide||null!==(e=this._visible)&&void 0!==e&&e}}]),n}(z.Model);n.ToolbarViewModel=j,a=j,j.__name__="ToolbarViewModel",a.define((function(e){return{autohide:[e.Boolean,!1]}})),a.internal((function(e){var t=e.Boolean;return{_visible:[(0,e.Nullable)(t),null]}}));var U=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments)).layout={bbox:new C.BBox},e}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._tool_button_views=new Map,this._toolbar_view_model=new j({autohide:this.model.autohide});var e=this.model.toolbar_location,t="left"==e||"above"==e,i=this.model.horizontal?"vertical":"horizontal";this._overflow_menu=new D.ContextMenu([],{orientation:i,reversed:t})}},{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:return e.next=4,this._build_tool_button_views();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.properties.tools.change,(0,Z.Z)((0,x.Z)().mark((function t(){return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e._build_tool_button_views();case 2:e.render();case 3:case"end":return t.stop()}}),t)})))),this.connect(this.model.properties.autohide.change,(function(){e._toolbar_view_model.autohide=e.model.autohide,e._on_visible_change()})),this.connect(this._toolbar_view_model.properties._visible.change,(function(){return e._on_visible_change()}))}},{key:"styles",value:function(){return[].concat((0,y.Z)((0,_.Z)((0,d.Z)(n.prototype),"styles",this).call(this)),[I.default,V.default])}},{key:"remove",value:function(){(0,c.remove_views)(this._tool_button_views),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"_build_tool_button_views",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=null!=this.model._proxied_tools?this.model._proxied_tools:this.model.tools,e.next=3,(0,c.build_views)(this._tool_button_views,t,{parent:this},(function(e){return e.button_view}));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"set_visibility",value:function(e){e!=this._toolbar_view_model._visible&&(this._toolbar_view_model._visible=e)}},{key:"_on_visible_change",value:function(){var e=this._toolbar_view_model.visible;(0,u.classes)(this.el).toggle(P.toolbar_hidden,!e)}},{key:"render",value:function(){var e=this;(0,u.empty)(this.el),this.el.classList.add(P.toolbar),this.el.classList.add(P[this.model.toolbar_location]),this._toolbar_view_model.autohide=this.model.autohide,this._on_visible_change();var t=this.model.horizontal,n=0;if(null!=this.model.logo){var i="grey"===this.model.logo?L.grey:null,r=(0,u.a)({href:"https://bokeh.org/",target:"_blank",class:[L.logo,L.logo_small,i]});this.el.appendChild(r);var a=r.getBoundingClientRect(),o=a.width,s=a.height;n+=t?o:s}var l,c=(0,w.Z)(this._tool_button_views);try{for(c.s();!(l=c.n()).done;){(0,k.Z)(l.value,2)[1].render()}}catch(B){c.e(B)}finally{c.f()}var h,_=[],d=function(t){return e._tool_button_views.get(t).el},f=this.model.gestures,v=(0,w.Z)((0,S.values)(f));try{for(v.s();!(h=v.n()).done;){var p=h.value;_.push(p.tools.map(d))}}catch(B){v.e(B)}finally{v.f()}_.push(this.model.actions.map(d)),_.push(this.model.inspectors.filter((function(e){return e.toggleable})).map(d));var m=_.filter((function(e){return 0!=e.length})),y=this.layout.bbox,g=!1;this.root.el.appendChild(this._overflow_menu.el);var b=(0,u.div)({class:P.tool_overflow,tabIndex:0},t?"\u22ee":"\u22ef"),x=function(){var t=function(){switch(e.model.toolbar_location){case"right":return{left_of:b};case"left":return{right_of:b};case"above":return{below:b};case"below":return{above:b}}}();e._overflow_menu.toggle(t)};b.addEventListener("click",(function(){x()})),b.addEventListener("keydown",(function(e){e.keyCode==u.Keys.Enter&&x()}));var Z,T=(0,w.Z)((0,A.join)(m,(function(){return(0,u.div)({class:P.divider})})));try{for(T.s();!(Z=T.n()).done;){var M=Z.value;if(g)this._overflow_menu.items.push({content:M,class:t?P.right:P.above});else{this.el.appendChild(M);var C=M.getBoundingClientRect(),z=C.width,E=C.height;if(n+=t?z:E,g=t?n>y.width-15:n>y.height-15){this.el.removeChild(M),this.el.appendChild(b);var R=this._overflow_menu.items;R.splice(0,R.length),R.push({content:M})}}}}catch(B){T.e(B)}finally{T.f()}}},{key:"update_layout",value:function(){}},{key:"update_position",value:function(){}},{key:"after_layout",value:function(){this._has_finished=!0}},{key:"export",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="png"==e?"canvas":"svg",i=new M.CanvasLayer(n,t);return i.resize(0,0),i}}]),n}(h.DOMView);function F(){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},pressup:{tools:[],active:null},rotate:{tools:[],active:null},move:{tools:[],active:null},multi:{tools:[],active:null}}}n.ToolbarBaseView=U,U.__name__="ToolbarBaseView";var G=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._init_tools()}},{key:"_init_tools",value:function(){var e=this,t=function(e,t){if(e.length!=t.length)return!0;var n=new Set(t.map((function(e){return e.id})));return(0,m.some)(e,(function(e){return!n.has(e.id)}
2))},n=this.tools.filter((function(e){return e instanceof O.InspectTool}));t(this.inspectors,n)&&(this.inspectors=n);var i=this.tools.filter((function(e){return e instanceof N.HelpTool}));t(this.help,i)&&(this.help=i);var r=this.tools.filter((function(e){return e instanceof B.ActionTool}));t(this.actions,r)&&(this.actions=r);var a,o=function(t,n){t in e.gestures||l.logger.warn("Toolbar: unknown event type '".concat(t,"' for tool: ").concat(n))},s={pan:{tools:[],active:null},scroll:{tools:[],active:null},pinch:{tools:[],active:null},tap:{tools:[],active:null},doubletap:{tools:[],active:null},press:{tools:[],active:null},pressup:{tools:[],active:null},rotate:{tools:[],active:null},move:{tools:[],active:null},multi:{tools:[],active:null}},u=(0,w.Z)(this.tools);try{for(u.s();!(a=u.n()).done;){var c=a.value;if(c instanceof R.GestureTool&&c.event_type)if((0,T.isString)(c.event_type))s[c.event_type].tools.push(c),o(c.event_type,c);else{s.multi.tools.push(c);var h,_=(0,w.Z)(c.event_type);try{for(_.s();!(h=_.n()).done;){o(h.value,c)}}catch(p){_.e(p)}finally{_.f()}}}}catch(p){u.e(p)}finally{u.f()}for(var d=function(){var n=v[f],i=e.gestures[n];t(i.tools,s[n].tools)&&(i.tools=s[n].tools),i.active&&(0,m.every)(i.tools,(function(e){return e.id!=i.active.id}))&&(i.active=null)},f=0,v=Object.keys(s);f<v.length;f++)d()}},{key:"horizontal",get:function(){return"above"===this.toolbar_location||"below"===this.toolbar_location}},{key:"vertical",get:function(){return"left"===this.toolbar_location||"right"===this.toolbar_location}},{key:"_active_change",value:function(e){var t=e.event_type;if(null!=t){var n,i=(0,T.isString)(t)?[t]:t,r=(0,w.Z)(i);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(e.active){var o=this.gestures[a].active;null!=o&&e!=o&&(l.logger.debug("Toolbar: deactivating tool: ".concat(o," for event type '").concat(a,"'")),o.active=!1),this.gestures[a].active=e,l.logger.debug("Toolbar: activating tool: ".concat(e," for event type '").concat(a,"'"))}else this.gestures[a].active=null}}catch(s){r.e(s)}finally{r.f()}}}}]),n}(z.Model);n.ToolbarBase=G,o=G,G.__name__="ToolbarBase",o.prototype.default_view=U,o.define((function(e){var t=e.Boolean,n=e.Array,i=e.Ref,r=e.Nullable;return{tools:[n(i(E.Tool)),[]],logo:[r(f.Logo),"normal"],autohide:[t,!1]}})),o.internal((function(e){var t=e.Array,n=e.Struct,i=e.Ref,r=e.Nullable,a=n({tools:t(i(R.GestureTool)),active:r(i(E.Tool))});return{gestures:[n({pan:a,scroll:a,pinch:a,tap:a,doubletap:a,press:a,pressup:a,rotate:a,move:a,multi:a}),F],actions:[t(i(B.ActionTool)),[]],inspectors:[t(i(O.InspectTool)),[]],help:[t(i(N.HelpTool)),[]],toolbar_location:[f.Location,"right"]}}))},function(e,t,n,i,r){var a=(0,x.Z)().mark(s);i();var o=e(9);function s(e,t){var n,i,r,s,l,u,c,h,_;return(0,x.Z)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(n=e.length,!(t>n)){a.next=3;break}return a.abrupt("return");case 3:return i=(0,o.range)(t),a.next=6,i.map((function(t){return e[t]}));case 6:r=void 0,s=(0,w.Z)((0,o.reversed)((0,o.range)(t))),a.prev=8,s.s();case 10:if((l=s.n()).done){a.next=17;break}if(u=l.value,i[u]==u+n-t){a.next=15;break}return r=u,a.abrupt("break",17);case 15:a.next=10;break;case 17:a.next=22;break;case 19:a.prev=19,a.t0=a.catch(8),s.e(a.t0);case 22:return a.prev=22,s.f(),a.finish(22);case 25:if(null!=r){a.next=27;break}return a.abrupt("return");
2case 27:i[r]+=1,c=(0,w.Z)((0,o.range)(r+1,t));try{for(c.s();!(h=c.n()).done;)_=h.value,i[_]=i[_-1]+1}catch(d){c.e(d)}finally{c.f()}return a.next=32,i.map((function(t){return e[t]}));case 32:a.next=6;break;case 34:case"end":return a.stop()}}),a,null,[[8,19,22,25]])}n.enumerate=(0,x.Z)().mark((function e(t){var n,i,r,a;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0,i=(0,w.Z)(t),e.prev=2,i.s();case 4:if((r=i.n()).done){e.next=10;break}return a=r.value,e.next=8,[a,n++];case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),i.e(e.t0);case 15:return e.prev=15,i.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[2,12,15,18]])})),n.join=(0,x.Z)().mark((function e(t,n){var i,r,a,o;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=!0,r=(0,w.Z)(t),e.prev=2,r.s();case 4:if((a=r.n()).done){e.next=17;break}if(o=a.value,!i){e.next=10;break}i=!1,e.next=14;break;case 10:if(e.t0=null!=n,!e.t0){e.next=14;break}return e.next=14,n();case 14:return e.delegateYield(o,"t1",15);case 15:e.next=4;break;case 17:e.next=22;break;case 19:e.prev=19,e.t2=e.catch(2),r.e(e.t2);case 22:return e.prev=22,r.f(),e.finish(22);case 25:case"end":return e.stop()}}),e,null,[[2,19,22,25]])})),n.combinations=s,n.subsets=(0,x.Z)().mark((function e(t){var n,i,r;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=(0,w.Z)((0,o.range)(t.length+1)),e.prev=1,n.s();case 3:if((i=n.n()).done){e.next=8;break}return r=i.value,e.delegateYield(s(t,r),"t0",6);case 6:e.next=3;break;case 8:e.next=13;break;case 10:e.prev=10,e.t1=e.catch(1),n.e(e.t1);case 13:return e.prev=13,n.f(),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])}))},function(e,t,n,i,r){i();var a=e(236),o=e(65),s=e(43);var l={position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},u=function(){function e(t,n){switch((0,g.Z)(this,e),this.backend=t,this.hidpi=n,this.pixel_ratio=1,this.bbox=new o.BBox,t){case"webgl":case"canvas":this._el=this._canvas=(0,s.canvas)({style:l});var i=this.canvas.getContext("2d");if(null==i)throw new Error("unable to obtain 2D rendering context");this._ctx=i,n&&(this.pixel_ratio=devicePixelRatio);break;case"svg":var r=new a.SVGRenderingContext2D;this._ctx=r,this._canvas=r.get_svg(),this._el=(0,s.div)({style:l},this._canvas)}this._ctx.layer=this,function(e){!function(e){void 0===e.lineDash&&Object.defineProperty(e,"lineDash",{get:function(){return e.getLineDash()},set:function(t){return e.setLineDash(t)}})}(e),function(e){e.setImageSmoothingEnabled=function(t){e.imageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.oImageSmoothingEnabled=t,e.webkitImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t},e.getImageSmoothingEnabled=function(){var t=e.imageSmoothingEnabled;return null==t||t}}(e),function(e){e.ellipse||(e.ellipse=function(t,n,i,r,a,o,s){var l=arguments.length>7&&void 0!==arguments[7]&&arguments[7],u=.551784;e.translate(t,n),e.rotate(a);var c=i,h=r;l&&(c=-i,h=-r),e.moveTo(-c,0),e.bezierCurveTo(-c,h*u,-c*u,h,0,h),e.bezierCurveTo(c*u,h,c,h*u,c,0),e.bezierCurveTo(c,-h*u,c*u,-h,0,-h),e.bezierCurveTo(-c*u,-h,-c,-h*u,-c,0),e.rotate(-a),e.translate(-t,-n)})}(e)}(this._ctx)}return(0,b.Z)(e,[{key:"canvas",get:function(){return this._canvas}},{key:"ctx",get:function(){return this._ctx}},{key:"el",get:function(){return this._el}},{key:"resize",value:function(e,t){this.bbox=new o.BBox({left:0,top:0,width:e,height:t});var n=this._ctx instanceof a.SVGRenderingContext2D?this._ctx:this.canvas;n.width=e*this.pixel_ratio,n.height=t*this.pixel_ratio}},{key:"undo_transform",value:function(e){var t=this.ctx;if(void 0===t.getTransform)e(t);else{var n=t.getTransform();t.setTransform(this._base_transform);try{e(t)}finally{t.setTransform(n)}}}},{key:"prepare",value:function(){var e=this.ctx,t=this.hidpi,n=this.pixel_ratio;e.save(),t&&(e.scale(n,n),e.translate(.5,.5)),void 0!==e.getTransform&&(this._base_transform=e.getTransform()),this.clear()}},{key:"clear",value:function(){var e=this.bbox,t=e.x,n=e.y,i=e.width,r=e.height;this.ctx.clearRect(t,n,i,r)}}
2,{key:"finish",value:function(){this.ctx.restore()}},{key:"to_blob",value:function(){var e=this._canvas;if(e instanceof HTMLCanvasElement)return null!=e.msToBlob?Promise.resolve(e.msToBlob()):new Promise((function(t,n){e.toBlob((function(e){return null!=e?t(e):n()}),"image/png")}));var t=this._ctx.get_serialized_svg(!0),n=new Blob([t],{type:"image/svg+xml"});return Promise.resolve(n)}}]),e}();n.CanvasLayer=u,u.__name__="CanvasLayer"},function(e,t,n,i,r){i();var a=e(122),o=e(8),s=e(237),l=e(10),u=e(43);function c(e){var t,n={left:"start",right:"end",center:"middle",start:"start",end:"end"};return null!==(t=n[e])&&void 0!==t?t:n.start}function h(e){var t,n={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return null!==(t=n[e])&&void 0!==t?t:n.alphabetic}var _=function(e,t){var n=new Map,i="50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro".split(",");t=null!=t?t:10;for(var r=0;r<i.length;r+=2){var a="&".concat(i[r+1],";"),o=parseInt(i[r],t);n.set(a,"&#".concat(o,";"))}return n.set("\\xa0","&#160;"),n}(0,32),d={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"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}},f=function(){function e(t,n){(0,g.Z)(this,e),this.__root=t,this.__ctx=n}return(0,b.Z)(e,[{key:"addColorStop",value:function(e,t){if(("linearGradient"!==this.__root.nodeName||this.__root.getAttribute("x1")!==this.__root.getAttribute("x2")||this.__root.getAttribute("y1")!==this.__root.getAttribute("y2"))&&("radialGradient"!==this.__root.nodeName||this.__root.getAttribute("cx")!==this.__root.getAttribute("fx")||this.__root.getAttribute("cy")!==this.__root.getAttribute("fy")||this.__root.getAttribute("r")!==this.__root.getAttribute("r0"))){var n=this.__ctx.__createElement("stop");if(n.setAttribute("offset","".concat(e)),-1!==t.indexOf("rgba")){var i=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(t),r=(0,k.Z)(i,5),a=r[1],o=r[2],s=r[3],l=r[4];n.setAttribute("stop-color","rgb(".concat(a,",").concat(o,",").concat(s,")")),n.setAttribute("stop-opacity",l)}else n.setAttribute("stop-color",t);this.__root.appendChild(n)}}}]),e}();f.__name__="CanvasGradient";var v=function(){function e(t,n){(0,g.Z)(this,e),this.__root=t,this.__ctx=n}return(0,b.Z)(e,[{key:"setTransform",value:function(e){throw new Error("not implemented")}}]),e}();v.__name__="CanvasPattern";var p=function(){function e(t){var n,i,r;(0,g.Z)(this,e),this.__currentPosition=null,this._transform=new a.AffineTransform,this._clip_path=null,this.__document=null!==(n=null==t?void 0:t.document)&&void 0!==n?n:document,(null==t?void 0:t.ctx)?this.__ctx=t.ctx:(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.__setDefaultStyles(),this.__stack=[],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.width=null!==(i=null==t?void 0:t.width)&&void 0!==i?i:500,this.height=null!==(r=null==t?void 0:t.height)&&void 0!==r?r:500,this.__ids=new Set,this.__defs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__root.appendChild(this.__defs)}return(0,b.Z)(e,[{key:"canvas",get:function(){return this}},{key:"width",get:function(){return this._width}
2,set:function(e){this._width=e,this.__root.setAttribute("width","".concat(e))}},{key:"height",get:function(){return this._height},set:function(e){this._height=e,this.__root.setAttribute("height","".concat(e))}},{key:"_random_string",value:function(){var t;do{t=e.__random.choices(12,"ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz").join("")}while(this.__ids.has(t));return t}},{key:"__createElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.__document.createElementNS("http://www.w3.org/2000/svg",e);n&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(var r=0,a=Object.keys(t);r<a.length;r++){var o=a[r];i.setAttribute(o,"".concat(t[o]))}return i}},{key:"__setDefaultStyles",value:function(){for(var e=Object.keys(d),t=0;t<e.length;t++){var n=e[t];this[n]=d[n].canvas}}},{key:"__applyStyleState",value:function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var i=t[n];this[i]=e[i]}}},{key:"__getStyleState",value:function(){for(var e=Object.keys(d),t={},n=0;n<e.length;n++){var i=e[n];t[i]=this[i]}return t}},{key:"__applyStyleToCurrentElement",value:function(e){for(var t,n=this.__currentElement,i=Object.keys(d),r=0;r<i.length;r++){var a=d[i[r]],s=this[i[r]];if(null===(t=a.apply)||void 0===t?void 0:t.includes(e))if(s instanceof v){for(var l=0,u=(0,y.Z)(s.__ctx.__defs.childNodes);l<u.length;l++){var c=u[l];if(c instanceof Element){var h=c.getAttribute("id");this.__ids.add(h),this.__defs.appendChild(c)}}var _=s.__root.getAttribute("id");n.setAttribute(a.apply,"url(#".concat(_,")"))}else if(s instanceof f){var p=s.__root.getAttribute("id");n.setAttribute(a.apply,"url(#".concat(p,")"))}else if(a.svg!==s)if("stroke"!==a.svgAttr&&"fill"!==a.svgAttr||!(0,o.isString)(s)||-1===s.indexOf("rgba")){var m=a.svgAttr;if("globalAlpha"===i[r]&&(m="".concat(e,"-").concat(a.svgAttr),n.getAttribute(m)))continue;n.setAttribute(m,"".concat(s))}else{var g=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(s),b=(0,k.Z)(g,5),w=b[1],x=b[2],Z=b[3],A=b[4];n.setAttribute(a.svgAttr,"rgb(".concat(w,",").concat(x,",").concat(Z,")"));var S=parseFloat(A),T=this.globalAlpha;null!=T&&(S*=T),n.setAttribute("".concat(a.svgAttr,"-opacity"),"".concat(S))}}}},{key:"get_serialized_svg",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(new XMLSerializer).serializeToString(this.__root);if(e){var n,i=(0,w.Z)(_);try{for(i.s();!(n=i.n()).done;){var r=(0,k.Z)(n.value,2),a=r[0],o=r[1],s=new RegExp(a,"gi");s.test(t)&&(t=t.replace(s,o))}}catch(l){i.e(l)}finally{i.f()}}return t}},{key:"get_svg",value:function(){return this.__root}},{key:"save",value:function(){this.__stack.push({transform:this._transform,clip_path:this._clip_path,attributes:this.__getStyleState()}),this._transform=this._transform.clone()}},{key:"restore",value:function(){if(0!=this.__stack.length){var e=this.__stack.pop(),t=e.transform,n=e.clip_path,i=e.attributes;this._transform=t,this._clip_path=n,this.__applyStyleState(i)}}},{key:"_apply_transform",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._transform;t.is_identity||e.setAttribute("transform",t.toString())}},{key:"scale",value:function(e,t){isFinite(e)&&(null==t||isFinite(t))&&this._transform.scale(e,null!=t?t:e)}},{key:"rotate",value:function(e){isFinite(e)&&this._transform.rotate(e)}},{key:"translate",value:function(e,t){isFinite(e+t)&&this._transform.translate(e,t)}},{key:"transform",value:function(e,t,n,i,r,a){isFinite(e+t+n+i+r+a)&&this._transform.transform(e,t,n,i,r,a)}},{key:"beginPath",value:function(){this.__currentDefaultPath="",this.__currentPosition=null,this.__init_element
2()}},{key:"__init_element",value:function(){var e=this.__createElement("path",{},!0);this.__root.appendChild(e),this.__currentElement=e}},{key:"__applyCurrentDefaultPath",value:function(){var e=this.__currentElement;"path"===e.nodeName?e.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",e.nodeName)}},{key:"__addPathCommand",value:function(e,t,n){var i=this.__currentDefaultPath?" ":"";this.__currentDefaultPath+=i+n,this.__currentPosition={x:e,y:t}}},{key:"_hasCurrentDefaultPath",get:function(){return!!this.__currentDefaultPath}},{key:"moveTo",value:function(e,t){if(isFinite(e+t)){var n=this.__currentElement;n&&"path"===n.nodeName||this.beginPath();var i=this._transform.apply(e,t),r=(0,k.Z)(i,2),a=r[0],o=r[1];this.__addPathCommand(a,o,"M ".concat(a," ").concat(o))}}},{key:"closePath",value:function(){this._hasCurrentDefaultPath&&this.__addPathCommand(NaN,NaN,"Z")}},{key:"lineTo",value:function(e,t){if(isFinite(e+t))if(this._hasCurrentDefaultPath){var n=this._transform.apply(e,t),i=(0,k.Z)(n,2),r=i[0],a=i[1];this.__addPathCommand(r,a,"L ".concat(r," ").concat(a))}else this.moveTo(e,t)}},{key:"bezierCurveTo",value:function(e,t,n,i,r,a){if(isFinite(e+t+n+i+r+a)){var o=this._transform.apply(r,a),s=(0,k.Z)(o,2),l=s[0],u=s[1],c=this._transform.apply(e,t),h=(0,k.Z)(c,2),_=h[0],d=h[1],f=this._transform.apply(n,i),v=(0,k.Z)(f,2),p=v[0],m=v[1];this.__addPathCommand(l,u,"C ".concat(_," ").concat(d," ").concat(p," ").concat(m," ").concat(l," ").concat(u))}}},{key:"quadraticCurveTo",value:function(e,t,n,i){if(isFinite(e+t+n+i)){var r=this._transform.apply(n,i),a=(0,k.Z)(r,2),o=a[0],s=a[1],l=this._transform.apply(e,t),u=(0,k.Z)(l,2),c=u[0],h=u[1];this.__addPathCommand(o,s,"Q ".concat(c," ").concat(h," ").concat(o," ").concat(s))}}},{key:"arcTo",value:function(e,t,n,i,r){if(isFinite(e+t+n+i+r)&&null!=this.__currentPosition){var a=this.__currentPosition.x,o=this.__currentPosition.y;if(r<0)throw new Error("IndexSizeError: The radius provided (".concat(r,") is negative."));if(a===e&&o===t||e===n&&t===i||0===r)this.lineTo(e,t);else{var s=g([a-e,o-t]),l=g([n-e,i-t]);if(s[0]*l[1]!=s[1]*l[0]){var u=s[0]*l[0]+s[1]*l[1],c=Math.acos(Math.abs(u)),h=g([s[0]+l[0],s[1]+l[1]]),_=r/Math.sin(c/2),d=e+_*h[0],f=t+_*h[1],v=[-s[1],s[0]],p=[l[1],-l[0]],m=b(v),y=b(p);this.lineTo(d+v[0]*r,f+v[1]*r),this.arc(d,f,r,m,y)}else this.lineTo(e,t)}}function g(e){var t=(0,k.Z)(e,2),n=t[0],i=t[1],r=Math.sqrt(Math.pow(n,2)+Math.pow(i,2));return[n/r,i/r]}function b(e){var t=e[0];return e[1]>=0?Math.acos(t):-Math.acos(t)}}},{key:"stroke",value:function(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","fill"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke"),null!=this._clip_path&&this.__currentElement.setAttribute("clip-path",this._clip_path)}},{key:"fill",value:function(e,t){var n=null;if(e instanceof Path2D)n=e;else{if("evenodd"!=e&&"nonzero"!=e&&null!=e||null!=t)throw new Error("invalid arguments");t=e}if(null!=n)throw new Error("not implemented");"none"!=this.__currentElement.getAttribute("fill")&&this.__init_element
2(),"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","stroke"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill"),null!=t&&this.__currentElement.setAttribute("fill-rule",t),null!=this._clip_path&&this.__currentElement.setAttribute("clip-path",this._clip_path)}},{key:"rect",value:function(e,t,n,i){isFinite(e+t+n+i)&&(this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+i),this.lineTo(e,t+i),this.lineTo(e,t))}},{key:"fillRect",value:function(e,t,n,i){isFinite(e+t+n+i)&&(this.beginPath(),this.rect(e,t,n,i),this.fill())}},{key:"strokeRect",value:function(e,t,n,i){isFinite(e+t+n+i)&&(this.beginPath(),this.rect(e,t,n,i),this.stroke())}},{key:"__clearCanvas",value:function(){(0,u.empty)(this.__defs),(0,u.empty)(this.__root),this.__root.appendChild(this.__defs),this.__currentElement=this.__root}},{key:"clearRect",value:function(e,t,n,i){if(isFinite(e+t+n+i))if(0!==e||0!==t||n!==this.width||i!==this.height){var r=this.__createElement("rect",{x:e,y:t,width:n,height:i,fill:"#FFFFFF"},!0);this._apply_transform(r),this.__root.appendChild(r)}else this.__clearCanvas()}},{key:"createLinearGradient",value:function(e,t,n,i){if(!isFinite(e+t+n+i))throw new Error("The provided double value is non-finite");var r=this._transform.apply(e,t),a=(0,k.Z)(r,2),o=a[0],s=a[1],l=this._transform.apply(n,i),u=(0,k.Z)(l,2),c=u[0],h=u[1],_=this.__createElement("linearGradient",{id:this._random_string(),x1:"".concat(o,"px"),x2:"".concat(c,"px"),y1:"".concat(s,"px"),y2:"".concat(h,"px"),gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(_),new f(_,this)}},{key:"createRadialGradient",value:function(e,t,n,i,r,a){if(!isFinite(e+t+n+i+r+a))throw new Error("The provided double value is non-finite");var o=this._transform.apply(e,t),s=(0,k.Z)(o,2),l=s[0],u=s[1],c=this._transform.apply(i,r),h=(0,k.Z)(c,2),_=h[0],d=h[1],v=this.__createElement("radialGradient",{id:this._random_string(),cx:"".concat(_,"px"),cy:"".concat(d,"px"),r:"".concat(a,"px"),r0:"".concat(n,"px"),fx:"".concat(l,"px"),fy:"".concat(u,"px"),gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(v),new f(v,this)}},{key:"__parseFont",value:function(){var e,t,n,i,r,a=/^\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);return{style:null!==(e=a[1])&&void 0!==e?e:"normal",size:null!==(t=a[4])&&void 0!==t?t:"10px",family:null!==(n=a[6])&&void 0!==n?n:"sans-serif",weight:null!==(i=a[3])&&void 0!==i?i:"normal",decoration:null!==(r=a[2])&&void 0!==r?r:"normal"}}},{key:"__applyText",value:function(e,t,n,i){var r=this,a=this.__parseFont(),o=this.__createElement("text",{"font-family":a.family,"font-size":a.size,"font-style":a.style,"font-weight":a.weight,"text-decoration":a.decoration,x:t,y:n,"text-anchor":c(this.textAlign),"dominant-baseline":h(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(e)),this._apply_transform(o),this.__currentElement=o,this.__applyStyleToCurrentElement(i);var s=function(){if(null!=r._clip_path){var e=r.__createElement("g");return e.setAttribute("clip-path",r._clip_path),e.appendChild(o),e}return o}();this.__root.appendChild(s)}},{key:"fillText",value:function(e,t,n){null!=e&&isFinite(t+n)&&this.__applyText(e,t,n,"fill")}},{key:"strokeText",value:function(e,t,n){null!=e&&isFinite(t+n)&&this.__applyText(e,t,n,"stroke")}},{key:"measureText",value:function(e){return this.__ctx.font=this.font,this.__ctx.measureText(e)}},{key:"arc",value:function(e,t,n,i,r){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];this.ellipse(e,t,n,n,0,i,r,a)}},{key:"ellipse",value:function(e,t,n,i,r,a,o){var s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];if(isFinite(e+t+n+i+r+a+o)){if(n<0||i<0)throw new DOMException("IndexSizeError, radius can't be negative");var u=s?o-a:a-o;a%=2*Math.PI,o%=2*Math.PI;var c=e+n*Math.cos(a),h=t+i*Math.sin(a);this.lineTo(c,h);var _=180*r/Math.PI,d=s?0:1;if(Math.abs(a-o)<2*l.float32_epsilon&&!(Math.abs(u)<2*l.float32_epsilon&&u<0)){var f=e+n*
2Math.cos(a+Math.PI),v=t+i*Math.sin(a+Math.PI),p=this._transform.apply(c,h),m=(0,k.Z)(p,2),y=m[0],g=m[1],b=this._transform.apply(f,v),w=(0,k.Z)(b,2),x=w[0],Z=w[1];this.__addPathCommand(y,g,"A ".concat(n," ").concat(i," ").concat(_," 0 ").concat(d," ").concat(x," ").concat(Z," A ").concat(n," ").concat(i," ").concat(_," 0 ").concat(d," ").concat(y," ").concat(g))}else{var A=e+n*Math.cos(o),S=t+i*Math.sin(o),T=o-a;T<0&&(T+=2*Math.PI);var M=s!==T>Math.PI?1:0,C=this._transform.apply(A,S),z=(0,k.Z)(C,2),E=z[0],R=z[1];this.__addPathCommand(E,R,"A ".concat(n," ").concat(i," ").concat(_," ").concat(M," ").concat(d," ").concat(E," ").concat(R))}}}},{key:"clip",value:function(){var e=this.__createElement("clipPath"),t=this._random_string();this.__applyCurrentDefaultPath(),e.setAttribute("id",t),e.appendChild(this.__currentElement),this.__defs.appendChild(e),this._clip_path="url(#".concat(t,")")}},{key:"drawImage",value:function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var a,o,s,l,u,c,h,_;if(2==i.length){if(a=i[0],o=i[1],!isFinite(a+o))return;u=0,c=0,s=h=t.width,l=_=t.height}else if(4==i.length){if(a=i[0],o=i[1],s=i[2],l=i[3],!isFinite(a+o+s+l))return;u=0,c=0,h=t.width,_=t.height}else{if(8!==i.length)throw new Error("Inavlid number of arguments passed to drawImage: ".concat(arguments.length));if(u=i[0],c=i[1],h=i[2],_=i[3],a=i[4],o=i[5],s=i[6],l=i[7],!isFinite(u+c+h+_+a+o+s+l))return}var d=this.__root,f=this._transform.clone().translate(a,o);if(t instanceof e||t instanceof SVGSVGElement){var v,p=(t instanceof SVGSVGElement?t:t.get_svg()).cloneNode(!0);f.is_identity&&1==this.globalAlpha&&null==this._clip_path?v=d:(v=this.__createElement("g"),f.is_identity||this._apply_transform(v,f),1!=this.globalAlpha&&v.setAttribute("opacity","".concat(this.globalAlpha)),null!=this._clip_path&&v.setAttribute("clip-path",this._clip_path),d.appendChild(v));for(var m=0,g=(0,y.Z)(p.childNodes);m<g.length;m++){var b=g[m];if(b instanceof SVGDefsElement)for(var w=0,x=(0,y.Z)(b.childNodes);w<x.length;w++){var k=x[w];if(k instanceof Element){var Z=k.getAttribute("id");this.__ids.add(Z),this.__defs.appendChild(k.cloneNode(!0))}}else v.appendChild(b.cloneNode(!0))}}else if(t instanceof HTMLImageElement||t instanceof SVGImageElement){var A=this.__createElement("image");if(A.setAttribute("width","".concat(s)),A.setAttribute("height","".concat(l)),A.setAttribute("preserveAspectRatio","none"),1!=this.globalAlpha&&A.setAttribute("opacity","".concat(this.globalAlpha)),u||c||h!==t.width||_!==t.height){var S=this.__document.createElement("canvas");S.width=s,S.height=l,S.getContext("2d").drawImage(t,u,c,h,_,0,0,s,l),t=S}this._apply_transform(A,f);var T=t instanceof HTMLCanvasElement?t.toDataURL():t.getAttribute("src");if(A.setAttribute("href",T),null!=this._clip_path){var M=this.__createElement("g");M.setAttribute("clip-path",this._clip_path),M.appendChild(A),d.appendChild(M)}else d.appendChild(A)}else if(t instanceof HTMLCanvasElement){var C=this.__createElement("image");C.setAttribute("width","".concat(s)),C.setAttribute("height","".concat(l)),C.setAttribute("preserveAspectRatio","none"),1!=this.globalAlpha&&C.setAttribute("opacity","".concat(this.globalAlpha));var z=this.__document.createElement("canvas");z.width=s,z.height=l;var E=z.getContext("2d");if(E.imageSmoothingEnabled=!1,E.drawImage(t,u,c,h,_,0,0,s,l),t=z,this._apply_transform(C,f),C.setAttribute("href",t.toDataURL()),null!=this._clip_path){var R=this.__createElement("g");R.setAttribute("clip-path",this._clip_path),R.appendChild(C),d.appendChild(R)}else d.appendChild(C)}}},{key:"createPattern",value:function(t,n){var i=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),r=this._random_string();if(i.setAttribute("id",r),i.setAttribute("width","".concat(this._to_number(t.width))),i.setAttribute("height","".concat(this._to_number(t.height))),i.setAttribute("patternUnits","userSpaceOnUse"),t instanceof HTMLCanvasElement||t instanceof HTMLImageElement||t instanceof SVGImageElement){var a=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),o=t instanceof HTMLCanvasElement?t.toDataURL():t.getAttribute("src");a.setAttribute("href",o),i.appendChild(a),this.__defs.appendChild(i)}else if(t instanceof e){for(var s=0,l=(0,y.Z)(t.__root.childNodes);s<l.length;s++){var u=l[s];u instanceof SVGDefsElement||i.appendChild(u.cloneNode(!0))}this.__defs.appendChild(i)}else{if(!(t instanceof SVGSVGElement))throw new Error("unsupported");for(var c=0,h=(0,y.Z)(t.childNodes);c<h.length;c++){var _=h[c];_ instanceof SVGDefsElement||i.appendChild(_.cloneNode(!0))}this.__defs.appendChild(i)}return new v(i,this)}},{key:"getLineDash",value:function(){var e=this.lineDash;return(0,o.isString)(e)?e.split(",").map((function(e){return parseInt(e)})):null==e?[]:e}},{key:"setLineDash",value:function(e){e&&e.length>0?this.lineDash=e.join(","):this.lineDash=null}},{key:"_to_number",value:function(e){return(0,o.isNumber)(e)?e:e.baseVal.value}},{key:"getTransform",value:function(){return this._transform.to_DOMMatrix()}},{key:"setTransform",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e=(0,o.isNumber)(n[0])?new DOMMatrix(n):n[0]instanceof DOMMatrix?n[0]:new DOMMatrix(Object.values(!n[0])),this._transform=a.Aff
2ineTransform.from_DOMMatrix(e)}},{key:"resetTransform",value:function(){this._transform=new a.AffineTransform}},{key:"isPointInPath",value:function(){throw new Error("not implemented")}},{key:"isPointInStroke",value:function(){throw new Error("not implemented")}},{key:"createImageData",value:function(){throw new Error("not implemented")}},{key:"getImageData",value:function(e,t,n,i){throw new Error("not implemented")}},{key:"putImageData",value:function(){throw new Error("not implemented")}},{key:"drawFocusIfNeeded",value:function(){throw new Error("not implemented")}},{key:"scrollPathIntoView",value:function(){throw new Error("not implemented")}}]),e}();n.SVGRenderingContext2D=p,p.__name__="SVGRenderingContext2D",p.__random=s.random},function(e,t,n,i,r){i();var a=2147483647,o=function(){function e(t){(0,g.Z)(this,e),this.seed=t%a,this.seed<=0&&(this.seed+=2147483646)}return(0,b.Z)(e,[{key:"integer",value:function(){return this.seed=48271*this.seed%a,this.seed}},{key:"float",value:function(){return(this.integer()-1)/2147483646}},{key:"floats",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=new Array(e),r=0;r<e;r++)i[r]=t+this.float()*(n-t);return i}},{key:"choices",value:function(e,t){for(var n=t.length,i=new Array(e),r=0;r<e;r++)i[r]=t[this.integer()%n];return i}}]),e}();n.Random=o,o.__name__="Random",n.random=new o(Date.now())},function(e,t,n,i,r){i();var a=e(224),o=e(15),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_clicked",value:function(){this.model.do.emit(void 0)}}]),n}(a.ButtonToolButtonView);n.ActionToolButtonView=s,s.__name__="ActionToolButtonView";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.do,(function(t){return e.doit(t)}))}}]),n}(a.ButtonToolView);n.ActionToolView=l,l.__name__="ActionToolView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).button_view=s,i.do=new o.Signal((0,f.Z)(i),"do"),i}return(0,b.Z)(n)}(a.ButtonTool);n.ActionTool=u,u.__name__="ActionTool"},function(e,t,n,i,r){var a;i();var o=e(238),s=e(228),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"doit",value:function(){window.open(this.model.redirect)}}]),n}(o.ActionToolView);n.HelpToolView=l,l.__name__="HelpToolView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Help",i.icon=s.tool_icon_help,i}return(0,b.Z)(n)}(o.ActionTool);n.HelpTool=u,a=u,u.__name__="HelpTool",a.prototype.default_view=l,a.define((function(e){return{redirect:[e.String,"https://docs.bokeh.org/en/latest/docs/user_guide/tools.html"]}})),a.override({description:"Click the question mark to learn more about Bokeh plot tools."}),a.register_alias("help",(function(){return new u}))},function(e,t,n,i,r){i(),n.root="bk-root",n.logo="bk-logo",n.grey="bk-grey",n.logo_small="bk-logo-small",n.logo_notebook="bk-logo-notebook",n.default=".bk-root .bk-logo{margin:5px;position:relative;display:block;background-repeat:no-repeat;}.bk-root .bk-logo.bk-grey{filter:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='grayscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0'/></filter></svg>#grayscale\");filter:gray;-webkit-filter:grayscale(100%);}.bk-root .bk-logo-small{width:20px;height:20px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAOkSURBVDiNjZRtaJVlGMd/1/08zzln5zjP1LWcU9N0NkN8m2CYjpgQYQXqSs0I84OLIC0hkEKoPtiH3gmKoiJDU7QpLgoLjLIQCpEsNJ1vqUOdO7ppbuec5+V+rj4ctwzd8IIbbi6u+8f1539dt3A78eXC7QizUF7gyV1fD1Yqg4JWz84yffhm0qkFqBogB9rM8tZdtwVsPUhWhGcFJngGeWrPzHm5oaMmkfEg1usvLFyc8
2jLRqDOMru7AyC8saQr7GG7f5fvDeH7Ej8CM66nIF+8yngt6HWaKh7k49Soy9nXurCi1o3qUbS3zWfrYeQDTB/Qj6kX6Ybhw4B+bOYoLKCC9H3Nu/leUTZ1JdRWkkn2ldcCamzrcf47KKXdAJllSlxAOkRgyHsGC/zRday5Qld9DyoM4/q/rUoy/CXh3jzOu3bHUVZeU+DEn8FInkPBFlu3+nW3Nw0mk6vCDiWg8CeJaxEwuHS3+z5RgY+YBR6V1Z1nxSOfoaPa4LASWxxdNp+VWTk7+4vzaou8v8PN+xo+KY2xsw6une2frhw05CTYOmQvsEhjhWjn0bmXPjpE1+kplmmkP3suftwTubK9Vq22qKmrBhpY4jvd5afdRA3wGjFAgcnTK2s4hY0/GPNIb0nErGMCRxWOOX64Z8RAC4oCXdklmEvcL8o0BfkNK4lUg9HTl+oPlQxdNo3Mg4Nv175e/1LDGzZen30MEjRUtmXSfiTVu1kK8W4txyV6BMKlbgk3lMwYCiusNy9fVfvvwMxv8Ynl6vxoByANLTWplvuj/nF9m2+PDtt1eiHPBr1oIfhCChQMBw6Aw0UulqTKZdfVvfG7VcfIqLG9bcldL/+pdWTLxLUy8Qq38heUIjh4XlzZxzQm19lLFlr8vdQ97rjZVOLf8nclzckbcD4wxXMidpX30sFd37Fv/GtwwhzhxGVAprjbg0gCAEeIgwCZyTV2Z1REEW8O4py0wsjeloKoMr6iCY6dP92H6Vw/oTyICIthibxjm/DfN9lVz8IqtqKYLUXfoKVMVQVVJOElGjrnnUt9T9wbgp8AyYKaGlqingHZU/uG2NTZSVqwHQTWkx9hxjkpWDaCg6Ckj5qebgBVbT3V3NNXMSiWSDdGV3hrtzla7J+duwPOToIg42ChPQOQjspnSlp1V+Gjdged7+8UN5CRAV7a5EdFNwCjEaBR27b3W890TE7g24NAP/mMDXRWrGoFPQI9ls/MWO2dWFAar/xcOIImbbpA3zgAAAABJRU5ErkJggg==);}.bk-root .bk-logo-notebook{display:inline-block;vertical-align:middle;margin-right:5px;}"},function(e,t,n,i,r){i();var a,o=e(1),s=e(40),l=e(20),u=e(43),c=(0,o.__importStar)(e(242)),h=c,f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.el=(0,u.div)({class:h.tooltip}),(0,u.undisplay)(this.el),this.plot_view.canvas_view.add_overlay(this.el)}},{key:"remove",value:function(){(0,u.remove)(this.el),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.properties.content.change,(function(){return e.render()})),this.connect(this.model.properties.position.change,(function(){return e._reposition()}))}},{key:"styles",value:function(){return[].concat((0,y.Z)((0,_.Z)((0,d.Z)(n.prototype),"styles",this).call(this)),[c.default])}},{key:"render",value:function(){this.model.visible||(0,u.undisplay)(this.el),(0,_.Z)((0,d.Z)(n.prototype),"render",this).call(this)}},{key:"_render",value:function(){var e=this.model.content;null!=e?((0,u.empty)(this.el),(0,u.classes)(this.el).toggle("bk-tooltip-custom",this.model.custom),this.el.appendChild(e),this.model.show_arrow&&this.el.classList.add(h.tooltip_arrow)):(0,u.undisplay)(this.el)}},{key:"_reposition",value:function(){var e=this,t=this.model.position;if(null!=t){var n,i=(0,k.Z)(t,2),r=i[0],a=i[1],o=function(){var t=e.parent.layout.bbox.relative(),n=e.model.attachment;switch(n){case"horizontal":return r<t.hcenter?"right":"left";case"vertical":return a<t.vcenter?"below":"above";default:return n}}();this.el.classList.remove(h.right),this.el.classList.remove(h.left),this.el.classList.remove(h.above),this.el.classList.remove(h.below),(0,u.display)(this.el);var s=null,l=null;switch(o){case"right":this.el.classList.add(h.left),s=r+(this.el.offsetWidth-this.el.clientWidth)+10,n=a-this.el.offsetHeight/2;break;case"left":this.el.classList.add(h.right),l=this.plot_view.layout.bbox.width-r+10,n=a-this.el.offsetHeight/2;break;case"below":this.el.classList.add(h.above),n=a+(this.el.offsetHeight-this.el.clientHeight)+10,s=Math.round(r-this.el.offsetWidth/2);break;case"above":this.el.classList.add(h.below),n=a-this.el.offsetHeight-10,s=Math.round(r-this.el.offsetWidth/2)}this.el.style.top="".concat(n,"px"),this.el.style.left=null!=s?"".concat(s,"px"):"auto",this.el.style.right=null!=l?"".concat(l,"px"):"auto"}else(0,u.undisplay)(this.el)}}]),n}(s.AnnotationView);n.TooltipView=f,f.__name__="TooltipView";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"clear",value:function(){this.position=null}}]),n}(s.Annotation);n.Tooltip=m,a=m,m.__name__="Tooltip",a.prototype.default_view=f,a.define((function(e){var t=e.Boolean;return{attachment:[l.TooltipAttachment,"horizontal"],inner_only:[t,!0],show_arrow:[t,!0]}})),a.internal((function(e){var t=e.Boolean,n=e.Number,i=e.Tuple,r=e.Ref;return{position:[(0,e.Nullable)(i(n,n)),null],content:[r(HTMLElement),function(){return(0,u.div)()}],custom:[t]}})),a.override({level:"overlay"})},function(e,t,n,i,r){i(),n.root="bk-root",n.tooltip="bk-tooltip",n.left="bk-left",n.tooltip_arrow="bk-tooltip-arrow",n.right="bk-right",n.above="bk-above",n.below="bk-below",n.tooltip_row_label="bk-tooltip-row-label",n.tooltip_row_value="bk-tooltip-row-value",n.tooltip_color_block="bk-tooltip-color-block",n.default='.bk-root{}.bk-root .bk-tooltip{font-weight:300;font-size:12px;position:absolute;padding:5px;border:1px solid #e5e5e5;color:#2f2f2f;background-color:white;pointer-events:none;opacity:0.95;z-index:100;}.bk-root .bk-tooltip > div:not(:first-child){margin-top:5px;border-top:#e5e5e5 1px dashed;}.bk-root .bk-tooltip.bk-left.bk-tooltip-arrow::before{position:absolute;margin:-7px 0 0 0;top:50%;width:0;height:0;border-style:solid;border-width:7px 0 7px 0;border-color:transparent;content:" ";display:block;left:-10px;border-right-width:10px;border-right-color:#909599;}.bk-root .bk-tooltip.bk-left::before{left:-10px;border-right-width:10px;border-right-color:#909599;}.bk-root .bk-tooltip.bk-right.bk-tooltip-arrow::after{position:absolute;margin:-7px 0 0 0;top:50%;width:0;height:0;border-style:solid;border-width:7px 0 7px 0;border-color:transparent;content:" ";display:block;right:-10px;border-left-width:10px;border-left-color:#909599;}.bk-root .bk-tooltip.bk-right::after{right:-10px;border-left-width:10px;border-left-color:#909599;}.bk-root .bk-tooltip.bk-above::before{position:absolute;margin:0 0 0 -7px;left:50%;width:0;height:0;border-style:solid;border-width:0 7px 0 7px;border-color:transparent;content:" ";display:block;top:-10px;border-bottom-width:10px;border-bottom-color:#909599;}.bk-root .bk-tooltip.bk-below::after{position:absolute;margin:0 0 0 -7px;left:50%;width:0;height:0;border-style:solid;border-width:0 7px 0 7px;border-color:transparent;content:" ";display:block;bottom:-10px;border-top-width:10px;border-top-color:#909599;}.bk-root .bk-tooltip-row-label{text-align:right;color:#26aae1;}.bk-root .bk-tooltip-row-value{color:default;}.bk-root .bk-tooltip-color-block{width:12px;height:12px;margin-left:5px;margin-right:5px;outline:#dddddd solid 1px;display:inline-block;}'},function(e,t,n,i,r){var a;i();var o=e(115),s=e(112),l=e(113),u=e(48),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,i,r;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:if(t=this.model,i=t.lower_head,r=t.upper_head,e.t0=null!=i,!e.t0){e.next=8;break}return e.next=7,(0,l.build_view)(i,{parent:this});case 7:this.lower_head=e.sent;case 8:if(e.t1=null!=r,!e.t1){e.next=13;break}return e.next=12,(0,l.build_view)(r,{parent:this});case 12:this.upper_head=e.sent;case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"set_data",value:function(e){var t,i;(0,_.Z)((0,d.Z)(n.prototype),"set_data",this).call(this,e),null===(t=this.lower_head)||void 0===t||t.set_data(e),null===(i=this.upper_head)||void 0===i||i.set_data(e)}}
2,{key:"paint",value:function(e){if(this.visuals.line.doit)for(var t=0,n=this._lower_sx.length;t<n;t++)this.visuals.line.set_vectorize(e,t),e.beginPath(),e.moveTo(this._lower_sx[t],this._lower_sy[t]),e.lineTo(this._upper_sx[t],this._upper_sy[t]),e.stroke();var i="height"==this.model.dimension?0:Math.PI/2;if(null!=this.lower_head)for(var r=0,a=this._lower_sx.length;r<a;r++)e.save(),e.translate(this._lower_sx[r],this._lower_sy[r]),e.rotate(i+Math.PI),this.lower_head.render(e,r),e.restore();if(null!=this.upper_head)for(var o=0,s=this._upper_sx.length;o<s;o++)e.save(),e.translate(this._upper_sx[o],this._upper_sy[o]),e.rotate(i),this.upper_head.render(e,o),e.restore()}}]),n}(o.UpperLowerView);n.WhiskerView=c,c.__name__="WhiskerView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.UpperLower);n.Whisker=h,a=h,h.__name__="Whisker",a.prototype.default_view=c,a.mixins(u.LineVector),a.define((function(e){var t=e.Ref,n=e.Nullable;return{lower_head:[n(t(s.ArrowHead)),function(){return new s.TeeHead({size:10})}],upper_head:[n(t(s.ArrowHead)),function(){return new s.TeeHead({size:10})}]}})),a.override({level:"underlay"})},function(e,t,n,i,r){i(),r("CustomJS",e(245).CustomJS),r("OpenURL",e(247).OpenURL)},function(e,t,n,i,r){var a;i();var o=e(246),l=e(13),u=e(34),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"names",get:function(){return(0,l.keys)(this.args)}},{key:"values",get:function(){return(0,l.values)(this.args)}},{key:"func",get:function(){var e=(0,u.use_strict)(this.code);return(0,s.Z)(Function,(0,y.Z)(this.names).concat(["cb_obj","cb_data",e]))}},{key:"execute",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.func.apply(e,this.values.concat(e,t))}}]),n}(o.Callback);n.CustomJS=c,a=c,c.__name__="CustomJS",a.define((function(e){var t=e.Unknown,n=e.String;return{args:[(0,e.Dict)(t),{}],code:[n,""]}}))},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(e(53).Model);n.Callback=a,a.__name__="Callback"},function(e,t,n,i,r){var a;i();var o=e(246),s=e(152),l=e(8),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"navigate",value:function(e){this.same_tab?window.location.href=e:window.open(e)}},{key:"execute",value:function(e,t){var n,i=this,r=t.source,a=function(e){var t=(0,s.replace_placeholders)(i.url,r,e,void 0,void 0,encodeURI);if(!(0,l.isString)(t))throw new Error("HTML output is not supported in this context");i.navigate(t)},o=r.selected,u=(0,w.Z)(o.indices);try{for(u.s();!(n=u.n()).done;){a(n.value)}}catch(_){u.e(_)}finally{u.f()}var c,h=(0,w.Z)(o.line_indices);try{for(h.s();!(c=h.n()).done;){a(c.value)}}catch(_){h.e(_)}finally{h.f()}}}]),n}(o.Callback);n.OpenURL=u,a=u,u.__name__="OpenURL",a.define((function(e){var t=e.Boolean;return{url:[e.String,"http://"],same_tab:[t,!1]}}))},function(e,t,n,i,r){i(),r("Canvas",e(249).Canvas),r("CartesianFrame",e(126).CartesianFrame),r("CoordinateMapping",e(54).CoordinateMapping)},function(e,t,n,i,r){var a,o=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return s(t,e),t};i();var u=e(14),c=e(28),h=e(226),f=e(19),m=e(43),y=e(20),w=e(13),A=e(250),S=e(65),T=e(138),M=e(235),C=function(){var t;return(0,Z.Z)((0,x.Z)().mark((function n(){return(0,x.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0===t){n.next=4;break}n.t0=t,n.next=7;break;case 4:return n.next=6,(0,Z.Z)((0,x.Z)().mark((function t(){var n,i,r,a;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=document.createElement("canvas"),null==(i=n.getContext("webgl",{premultipliedAlpha:!0}))){t.next=15;break}return t.next=4,(0,T.load_module)(Promise.resolve().then((function(){return l(e(410))})));case 4:if(null==(r=t.sent)){t.next=12;break}if(!(a=r.get_regl(i)).has_webgl){t.next=9;break}return t.abrupt("return",{canvas:n,regl_wrapper:a});case 9:f.logger.trace("WebGL is supported, but not the required extensions"),t.next=13;break;case 12:f.logger.trace("WebGL is supported, but bokehjs(.min).js bundle is not available");case 13:t.next=16;break;case 15:f.logger.trace("WebGL is not supported");case 16:return t.abrupt("return",null);case 17:case"end":return t.stop()}}),t)})))();case 6:n.t0=t=n.sent;case 7:return n.abrupt("return",n.t0);case 8:case"end":return n.stop()}}),n)})))}(),z={position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},E=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments)).bbox=new S.BBox,e.webgl=null,e}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.underlays_el=(0,m.div)({style:z}),this.primary=this.create_layer(),this.overlays=this.create_layer(),this.overlays_el=(0,m.div)({style:z}),this.events_el=(0,m.div)({class:"bk-canvas-events",style:z});var e=[this.underlays_el,this.primary.el,this.overlays.el,this.overlays_el,this.events_el];(0,w.extend)(this.el.style,z),m.append.apply(void 0,[this.el].concat(e)),this.ui_event_bus=new A.UIEventBus(this)}},{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:if(e.t0="webgl"==this.model.output_backend,!e.t0){e.next=8;break}return e.next=6,C();case 6:this.webgl=e.sent,e.t0=c.settings.force_webgl&&null==this.webgl;case 8:if(!e.t0){e.next=10;break}throw new Error("webgl is not available");case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"remove",value:function(){this.ui_event_bus.destroy(),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"add_underlay",value:function(e){this.underlays_el.appendChild(e)}},{key:"add_overlay",value:function(e){this.overlays_el.appendChild(e)}},{key:"add_event",value:function(e){this.events_el.appendChild(e)}},{key:"pixel_ratio",get:function(){return this.primary.pixel_ratio}},{key:"resize",value:function(e,t){this.bbox=new S.BBox({left:0,top:0,width:e,height:t}),this.primary.resize(e,t),this.overlays.resize(e,t)}},{key:"prepare_webgl",value:function(e){var t=this.webgl;if(null!=t){var n=this.bbox,i=n.width,r=n.height;t.canvas.width=this.pixel_ratio*i,t.canvas.height=this.pixel_ratio*r;var a=(0,k.Z)(e,4),o=a[0],s=a[1],l=a[2],u=a[3],c=this.bbox,h=c.xview,_=c.yview,d=h.compute(o),f=_.compute(s+u),v=this.pixel_ratio;t.regl_wrapper.set_scissor(v*d,v*f,v*l,v*u),this._clear_webgl()}}},{key:"blit_webgl",value:function(e){var t=this.webgl;if(null!=t){if(f.logger.debug("Blitting WebGL canvas"),e.restore(
2),e.drawImage(t.canvas,0,0),e.save(),this.model.hidpi){var n=this.pixel_ratio;e.scale(n,n),e.translate(.5,.5)}this._clear_webgl()}}},{key:"_clear_webgl",value:function(){var e=this.webgl;if(null!=e){var t=e.regl_wrapper,n=e.canvas;t.clear(n.width,n.height)}}},{key:"compose",value:function(){var e=this.create_layer(),t=this.bbox,n=t.width,i=t.height;return e.resize(n,i),e.ctx.drawImage(this.primary.canvas,0,0),e.ctx.drawImage(this.overlays.canvas,0,0),e}},{key:"create_layer",value:function(){var e=this.model,t=e.output_backend,n=e.hidpi;return new M.CanvasLayer(t,n)}},{key:"to_blob",value:function(){return this.compose().to_blob()}}]),n}(h.DOMView);n.CanvasView=E,E.__name__="CanvasView";var R=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(u.HasProps);n.Canvas=R,a=R,R.__name__="Canvas",a.prototype.default_view=E,a.internal((function(e){return{hidpi:[e.Boolean,!0],output_backend:[y.OutputBackend,"canvas"]}}))},function(e,t,n,i,r){i();var a=e(1),o=(0,a.__importDefault)(e(225)),s=e(15),l=e(19),u=e(43),c=(0,a.__importStar)(e(251)),h=e(252),_=e(9),d=e(8),f=e(27),v=e(230),p=function(){function e(t){var n=this;(0,g.Z)(this,e),this.canvas_view=t,this.pan_start=new s.Signal(this,"pan:start"),this.pan=new s.Signal(this,"pan"),this.pan_end=new s.Signal(this,"pan:end"),this.pinch_start=new s.Signal(this,"pinch:start"),this.pinch=new s.Signal(this,"pinch"),this.pinch_end=new s.Signal(this,"pinch:end"),this.rotate_start=new s.Signal(this,"rotate:start"),this.rotate=new s.Signal(this,"rotate"),this.rotate_end=new s.Signal(this,"rotate:end"),this.tap=new s.Signal(this,"tap"),this.doubletap=new s.Signal(this,"doubletap"),this.press=new s.Signal(this,"press"),this.pressup=new s.Signal(this,"pressup"),this.move_enter=new s.Signal(this,"move:enter"),this.move=new s.Signal(this,"move"),this.move_exit=new s.Signal(this,"move:exit"),this.scroll=new s.Signal(this,"scroll"),this.keydown=new s.Signal(this,"keydown"),this.keyup=new s.Signal(this,"keyup"),this.hammer=new o.default(this.hit_area,{touchAction:"auto",inputClass:o.default.TouchMouseInput}),this._prev_move=null,this._curr_pan=null,this._curr_pinch=null,this._curr_rotate=null,this._configure_hammerjs(),this.hit_area.addEventListener("mousemove",(function(e){return n._mouse_move(e)})),this.hit_area.addEventListener("mouseenter",(function(e){return n._mouse_enter(e)})),this.hit_area.addEventListener("mouseleave",(function(e){return n._mouse_exit(e)})),this.hit_area.addEventListener("contextmenu",(function(e){return n._context_menu(e)})),this.hit_area.addEventListener("wheel",(function(e){return n._mouse_wheel(e)})),document.addEventListener("keydown",this),document.addEventListener("keyup",this),this.menu=new v.ContextMenu([],{prevent_hide:function(e){return 2==e.button&&e.target==n.hit_area}}),this.hit_area.appendChild(this.menu.el)}return(0,b.Z)(e,[{key:"hit_area",get:function(){return this.canvas_view.events_el}},{key:"destroy",value:function(){this.menu.remove(),this.hammer.destroy(),document.removeEventListener("keydown",this),document.removeEventListener("keyup",this)}},{key:"handleEvent",value:function(e){"keydown"==e.type?this._key_down(e):"keyup"==e.type&&this._key_up(e)}},{key:"_configure_hammerjs",value: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.on("pressup",(function(t){return e._pressup(t)})),this.hammer.get("pan").set({direction:o.default.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)}))}},{key:"register_tool",value:function(e){var t=this,n=e.model.event_type;null!=n&&((0,d.isString)(n)?this._register_tool(e,n):n.forEach((function(n,i){return t._register_tool(e,n,i<1)})))}},{key:"_register_tool",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=e,r=i.model.id,a=function(e){return function(t){t.id==r&&e(t.e)}},o=function(e){return function(t){e(t.e)}};switch(t){case"pan":null!=i._pan_start&&i.connect(this.pan_start,a(i._pan_start.bind(i))),null!=i._pan&&i.connect(this.pan,a(i._pan.bind(i))),null!=i._pan_end&&i.c
2onnect(this.pan_end,a(i._pan_end.bind(i)));break;case"pinch":null!=i._pinch_start&&i.connect(this.pinch_start,a(i._pinch_start.bind(i))),null!=i._pinch&&i.connect(this.pinch,a(i._pinch.bind(i))),null!=i._pinch_end&&i.connect(this.pinch_end,a(i._pinch_end.bind(i)));break;case"rotate":null!=i._rotate_start&&i.connect(this.rotate_start,a(i._rotate_start.bind(i))),null!=i._rotate&&i.connect(this.rotate,a(i._rotate.bind(i))),null!=i._rotate_end&&i.connect(this.rotate_end,a(i._rotate_end.bind(i)));break;case"move":null!=i._move_enter&&i.connect(this.move_enter,a(i._move_enter.bind(i))),null!=i._move&&i.connect(this.move,a(i._move.bind(i))),null!=i._move_exit&&i.connect(this.move_exit,a(i._move_exit.bind(i)));break;case"tap":null!=i._tap&&i.connect(this.tap,a(i._tap.bind(i))),null!=i._doubletap&&i.connect(this.doubletap,a(i._doubletap.bind(i)));break;case"press":null!=i._press&&i.connect(this.press,a(i._press.bind(i))),null!=i._pressup&&i.connect(this.pressup,a(i._pressup.bind(i)));break;case"scroll":null!=i._scroll&&i.connect(this.scroll,a(i._scroll.bind(i)));break;default:throw new Error("unsupported event_type: ".concat(t))}n&&(null!=i._keydown&&i.connect(this.keydown,o(i._keydown.bind(i))),null!=i._keyup&&i.connect(this.keyup,o(i._keyup.bind(i))),f.is_mobile&&null!=i._scroll&&"pinch"==t&&(l.logger.debug("Registering scroll on touch screen"),i.connect(this.scroll,a(i._scroll.bind(i)))))}},{key:"_hit_test_renderers",value:function(e,t,n){var i,r,a=e.get_renderer_views(),o=(0,w.Z)((0,_.reversed)(a));try{for(o.s();!(r=o.n()).done;){var s=r.value;if(null===(i=s.interactive_hit)||void 0===i?void 0:i.call(s,t,n))return s}}catch(l){o.e(l)}finally{o.f()}return null}},{key:"set_cursor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";this.hit_area.style.cursor=e}},{key:"_hit_test_frame",value:function(e,t,n){return e.frame.bbox.contains(t,n)}},{key:"_hit_test_canvas",value:function(e,t,n){return e.layout.bbox.contains(t,n)}},{key:"_hit_test_plot",value:function(e,t){var n,i=(0,w.Z)(this.canvas_view.plot_views);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.layout.bbox.relative().contains(e,t))return r}}catch(a){i.e(a)}finally{i.f()}return null}},{key:"_trigger",value:function(e,t,n){var i,r,a=t.sx,o=t.sy,s=this._hit_test_plot(a,o),l=function(e){var n=a,i=o;return Object.assign(Object.assign({},t),{sx:n,sy:i})};if("panstart"==t.type||"pan"==t.type||"panend"==t.type){if("panstart"==t.type&&null!=s?(this._curr_pan={plot_view:s},r=s):"pan"==t.type&&null!=this._curr_pan?r=this._curr_pan.plot_view:"panend"==t.type&&null!=this._curr_pan?(r=this._curr_pan.plot_view,this._curr_pan=null):r=null,null!=r){var u=l();this.__trigger(r,e,u,n)}}else if("pinchstart"==t.type||"pinch"==t.type||"pinchend"==t.type){var c;if("pinchstart"==t.type&&null!=s?(this._curr_pinch={plot_view:s},c=s):"pinch"==t.type&&null!=this._curr_pinch?c=this._curr_pinch.plot_view:"pinchend"==t.type&&null!=this._curr_pinch?(c=this._curr_pinch.plot_view,this._curr_pinch=null):c=null,null!=c){var h=l();this.__trigger(c,e,h,n)}}else if("rotatestart"==t.type||"rotate"==t.type||"rotateend"==t.type){var _;if("rotatestart"==t.type&&null!=s?(this._curr_rotate={plot_view:s},_=s):"rotate"==t.type&&null!=this._curr_rotate?_=this._curr_rotate.plot_view:"rotateend"==t.type&&null!=this._curr_rotate?(_=this._curr_rotate.plot_view,this._curr_rotate=null):_=null,null!=_){var d=l();this.__trigger(_,e,d,n)}}else if("mouseenter"==t.type||"mousemove"==t.type||"mouseleave"==t.type){var f=null===(i=this._prev_move)||void 0===i?void 0:i.plot_view;if(null!=f&&("mouseleave"==t.type||f!=s)){var v=l(),p=v.sx,m=v.sy;this.__trigger(f,this.move_exit,{type:"mouseleave",sx:p,sy:m,shiftKey:!1,ctrlKey:!1},n)}if(null!=s&&("mouseenter"==t.type||f!=s)){var y=l(),g=y.sx,b=y.sy;this.__trigger(s,this.move_enter,{type:"mouseenter",sx:g,sy:b,shiftKey:!1,ctrlKey:!1},n)}if(null!=s&&"mousemove"==t.type){var w=l();this.__trigger(s,e,w,n)}this._prev_move={sx:a,sy:o,plot_view:s}}else if(null!=s){var x=l();this.__trigger(s,e,x,n)}}},{key:"__trigger",value:function(e,t,n,i){var r,a,o,s=this,l=e.model.toolbar.gestures,u=t.name.split(":")[0],c=this._hit_test_renderers(e,n.sx,n.sy),h=this._hit_test_canvas(e,n.sx,n.sy);switch(u){case"move":var d=l.move.active;null!=d&&this.trigger(t,n,d.id);var v=e.model.toolbar.inspectors.filter((function(e){return e.active})),p="default";null!=c?(p=null!==(r=c.cursor(n.sx,n.sy))&&void 0!==r?r:p,(0,_.is_empty)(v)||(t=this.move_exit)):this._hit_test_frame(e,n.sx,n.sy)&&((0,_.is_empty)(v)||(p="crosshair")),this.set_cursor(p),e.set_toolbar_visibility(h),v.map((function(e){return s.trigger(t,n,e.id)}));break;case"tap":var m=i.target;if(null!=m&&m!=this.hit_area)return;if(null===(a=null==c?void 0:c.on_hit)||void 0===a||a.call(c,n.sx,n.sy),this._hit_test_frame(e,n.sx,n.sy)){var y=l.tap.active;null!=y&&this.trigger(t,n,y.id)}break;case"doubletap":if(this._hit_test_frame(e,n.sx,n.sy)){var g=null!==(o=l.doubletap.active)&&void 0!==o?o:l.tap.active;null!=g&&this.trigger(t,n,g.id)}break;case"scroll":var b=l[f.is_mobile?"pinch":"scroll"].active;null!=b&&(i.preventDefault(),i.stopPropagation(),this.trigger(t,n,b.id));break;case"pan":var w=l.pan.active;null!=w&&(i.preventDefault(),this.trigger(t,n,w.id));break;default:var x=l[u].active;null!=x&&this.trigger(t,n,x.id)}this._trigger_bokeh_event(e,n)}},{key:"trigger",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e.emit({id:n,e:t})}},{key:"_trigger_bokeh_event",value:function(e,t){var n=function(){var n=t.sx,i=t.sy,r=e.frame.x_scale.invert(n),a=e.frame.y_scale.invert(i);switch(t.type){case"wheel":return new c.MouseWheel(n,i,r,a,t.delta);case"mousemove":return new c.MouseMove(n,i,r,a);case"mouseenter":return new c.MouseEnter(n,i,r,a);case"mouseleave":return new c.MouseLeave(n,i,r,a);case"tap":return new c.Tap(n,i,r,a);case"doubletap":return new c.DoubleTap(n,i,r,a);case"press":return new c.Press(n,i,r,a);case"pressup":return new c.PressUp(n,i,r,a);case"pan":return new c.Pan(n,i,r,a,t.deltaX,t.deltaY);case"panstart":return new c.PanStart(n,i,r,a);case"panend":return new c.PanEnd(n,i,r,a);case"pinch":return new c.Pinch(n,i,r,a,t.scale);case"pinchstart":return new c.PinchStart(n,i,r,a);case"pinchend":return new c.PinchEnd(n,i,r,a);case"rotate":return new c.Rotate(n,i,r,a,t.rotation);case"rotatestart":return new c.RotateStart(n,i,r,a);case"rotateend":return new c.RotateEnd(n,i,r,a);default:return}}();null!=n&&e.model.trigger_event(n)}},{key:"_get_sxy",value:function(e){var t=function(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}(e)?(0!=e.touches.length?e.touches:e.changedTouches)[0]:e,n=t.pageX,i=t.pageY,r=(0,u.offset)(this.hit_area);return{sx:n-r.left,sy:i-r.top}}},{key:"_pan_event",value:function(e){return Object.assign(Object.assign({type:e.type},this._get_sxy(e.srcEvent)),{deltaX:e.deltaX,deltaY:e.deltaY,shiftKey:e.srcEvent.shiftKey,ctrlKey:e.srcEvent.ctrlKey})}},{key:"_pinch_event",value:function(e){return Object.assign(Object.assign({type:e.type},this._get_sxy(e.srcEvent)),{scale:e.scale,shiftKey:e.srcEvent.shiftKey,ctrlKey:e.srcEvent.ctrlKey})}},{key:"_rotate_event",value:function(e){return Object.assign(Object.assign({type:e.type},this._get_sxy(e.srcEvent)),{rotation:e.rotation,shiftKey:e.srcEvent.shiftKey,ctrlKey:e.srcEvent.ctrlKey})}},{key:"_tap_event",value:function(e){return Object.assign(Object.assign({type:e.type},this._get_sxy(e.srcEvent)),{shiftKey:e.srcEvent.shiftKey,ctrlKey:e.srcEvent.ctrlKey})}},{key:"_move_event",value:function(e){return Object.assign(Object.assign({type:e.type},this._get_sxy(e)),{shiftKey:e.shiftKey,ctrlKey:e.ctrlKey})}},{key:"_scroll_event",value:function(e){return Object.assign(Object.assign({type:e.type},this._get_sxy(e)),{delta:(0,h.getDeltaY)(e),shiftKey:e.shiftKey,ctrlKey:e.ctrlKey})}},{key:"_key_event",value:function(e){return{type:e.type,keyCode:e.keyCode}}},{key:"_pan_start",value:function(e){var t=this._pan_event(e);t.sx-=e.deltaX,t.sy-=e.deltaY,this._trigger(this.pan_start,t,e.srcEvent)}},{key:"_pan",value:function(e){this._trigger(this.pan,this._pan_event(e),e.srcEvent)}},{key:"_pan_end",value:function(e){this._trigger(this.pan_end,this._pan_event(e),e.srcEvent)}},{key:"_pinch_start",value:function(e){this._trigger(this.pinch_start,this._pinch_event(e),e.srcEvent)}},{key:"_pinch",value:function(e){this._trigger(this.pinch,this._pinch_event(e),e.srcEvent)}},{key:"_pinch_end",value:function(e){this._trigger(this.pinch_end,this._pinch_event(e),e.srcEvent)}},{key:"_rotate_start",value:function(e){this._trigger(this.rotate_start,this._rotate_event(e),e.srcEvent)}},{key:"_rotate",value:function(e){this._trigger(this.rotate,this._rotate_event(e),e.srcEvent)}},{key:"_rotate_end",value:function(e){this._trigger(this.rotate_end,this._rotate_event(e),e.srcEvent)}},{key:"_tap",value:function(e){this._trigger(this.tap,this._tap_event(e),e.srcEvent)}},{key:"_doubletap",value:function(e){this._trigger(this.doubletap,this._tap_event(e),e.srcEvent)}},{key:"_press",value:function(e){this._trigger(this.press,this._tap_event(e),e.srcEvent)}},{key:"_pressup",value:function(e){this._trigger(this.pressup,this._tap_event(e),e.srcEvent)}},{key:"_mouse_enter",value:function(e){this._trigger(this.move_enter,this._move_event(e),e)}},{key:"_mouse_move",value:function(e){this._trigger(this.move,this._move_event(e),e)}},{key:"_mouse_exit",value:function(e){this._trigger(this.move_exit,this._move_event(e),e)}},{key:"_mouse_wheel",value:function(e){this._trigger(this.scroll,this._scroll_event(e),e)}},{key:"_context_menu",value:function(e){!this.menu.is_open&&this.menu.can_open&&e.preventDefault();var t=this._get_sxy(e),n=t.sx,i=t.sy;this.menu.toggle({left:n,top:i})}},{key:"_key_down",value:function(e){this.trigger(this.keydown,this._key_event(e))}},{key:"_key_up",value:function(e){this.trigger(this.keyup,this._key_event(e))}}]),e}();n.UIEventBus=p,p.__name__="UIEventBus"},function(e,t,n,i,r){i();var a=this&&this.__decorate||function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};function o(e){return function(t){t.prototype.event_name=e}}var s=function(){function e(){(0,g.Z)(this,e)}return(0,b.Z)(e,[{key:"to_json",value:function(){return{event_name:this.event_name,event_values:this._to_json()}}}]),e}();n.BokehEvent=s,s.__name__="BokehEvent";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments)).origin=null,e}return(0,b.Z)(n,[{key:"_to_json",value:function(){return{model:this.origin}}}]),n}(s);n.ModelEvent=l,l.__name__="ModelEvent";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_to_json",value:function(){return{}}}]),n}(s);n.DocumentReady=u,u.__name__="DocumentReady",n.DocumentReady=u=a([o("document_ready")],u);var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(l);n.ButtonClick=c,c.__name__="ButtonClick",n.ButtonClick=c=a([o("button_click")],c);var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this)).item=e,i}return(0,b.Z)(n,[{key:"_to_json",value:function(){var e=this.item;return Object.assign(Object.assign({},(0,_.Z)((0,d.Z)(n.prototype),"_to_json",this).call(this)),{item:e})}}]),n}(l);n.MenuItemClick=h,h.__name__="MenuItemClick",n.MenuItemClick=h=a([o("menu_item_click")],h);var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(l);n.UIEvent=f,f.__name__="UIEvent";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(f);n.LODStart=m,m.__name__="LODStart",n.LODStart=m=a([o("lodstart")],m);var y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(f);n.LODEnd=y,y.__name__="LODEnd",n.LODEnd=y=a([o("lodend")],y);var w=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e,i,r,a){var o;return(0,g.Z)(this,n),(o=t.call(this)).x0=e,o.x1=i,o.y0=r,o.y1=a,o}return(0,b.Z)(n,[{key:"_to_json",value:function(){var e=this.x0,t=this.x1,i=this.y0,r=this.y1;return Object.assign(Object.assign({},(0,_.Z)((0,d.Z)(n.prototype),"_to_json",this).call(this)),{x0:e,x1:t,y0:i,y1:r})}}]),n}(f);n.RangesUpdate=w,w.__name__="RangesUpdate",n.RangesUpdate=w=a([o("rangesupdate")],w);var x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e,i){var r;return(0,g.Z)(this,n),(r=t.call(this)).geometry=e,r.final=i,r}return(0,b.Z)(n,[{key:"_to_json",value:function(){var e=this.geometry,t=this.final;return Object.assign(Object.assign({},(0,_.Z)((0,d.Z)(n.prototype),"_to_json",this).call(this)),{geometry:e,final:t})}}]),n}(f);n.SelectionGeometry=x,x.__name__="SelectionGeometry",n.SelectionGeometry=x=a([o("selectiongeometry")],x);var k=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(f);n.Reset=k,k.__name__="Reset",n.Reset=k=a([o("reset")],k);var Z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e,i,r,a){var o;return(0,g.Z)(this,n),(o=t.call(this)).sx=e,o.sy=i,o.x=r,o.y=a,o}return(0,b.Z)(n,[{key:"_to_json",value:function(){var e=this.sx,t=this.sy,i=this.x,r=this.y;return Object.assign(Object.assign({},(0,_.Z)((0,d.Z)(n.prototype),"_to_json",this).call(this)),{sx:e,sy:t,x:i,y:r})}}]),n}(f);n.PointEvent=Z,Z.__name__="PointEvent";var A=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e,i,r,a,o,s){var l;return(0,g.Z)(this,n),(l=t.call(this,e,i,r,a)).delta_x=o,l.delta_y=s,l}return(0,b.Z)(n,[{key:"_to_json",value:function(){var e=this.delta_x,t=this.delta_y;return Object.assign(Object.assign({},(0,_.Z)((0,d.Z)(n.prototype),"_to_json",this).call(this)),{delta_x:e,delta_y:t})}}]),n}(Z);n.Pan=A,A.__name__="Pan",n.Pan=A=a([o("pan")],A);var S=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e,i,r,a,o){var s;return(0,g.Z)(this,n),(s=t.call(this,e,i,r,a)).scale=o,s}return(0,b.Z)(n,[{key:"_to_json",value:function(){var e=this.scale;return Object.assign(Object.assign({},(0,_.Z)((0,d.Z)(n.prototype),"_to_json",this).call(this)),{scale:e})}}]),n}(Z);n.Pinch=S,S.__name__="Pinch",n.Pinch=S=a([o("pinch")],S);var T=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e,i,r,a,o){var s;return(0,g.Z)(this,n),(s=t.call(this,e,i,r,a)).rotation=o,s}return(0,b.Z)(n,[{key:"_to_json",value:function(){var e=this.rotation;return Object.assign(Object.assign({},(0,_.Z)((0,d.Z)(n.prototype),"_to_json",this).call(this)),{rotation:e})}}]),n}(Z);n.Rotate=T,T.__name__="Rotate",n.Rotate=T=a([o("rotate")],T);var M=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e,i,r,a,o){var s;return(0,g.Z)(this,n),(s=t.call(this,e,i,r,a)).delta=o,s}return(0,b.Z)(n,[{key:"_to_json",value:function(){var e=this.delta;return Object.assign(Object.assign({},(0,_.Z)((0,d.Z)(n.prototype),"_to_json",this).call(this)),{delta:e})}}]),n}(Z);n.MouseWheel=M,M.__name__="MouseWheel",n.MouseWheel=M=a([o("wheel")],M);var C=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(Z);n.MouseMove=C,C.__name__="MouseMove",n.MouseMove=C=a([o("mousemove")],C);var z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(Z);n.MouseEnter=z,z.__name__="MouseEnter",n.MouseEnter=z=a([o("mouseenter")],z);var E=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(Z);n.MouseLeave=E,E.__name__="MouseLeave",n.MouseLeave=E=a([o("mouseleave")],E);var R=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(Z);n.Tap=R,R.__name__="Tap",n.Tap=R=a([o("tap")],R);var B=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(Z);n.DoubleTap=B,B.__name__="DoubleTap",n.DoubleTap=B=a([o("doubletap")],B);var N=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(
20,b.Z)(n)}(Z);n.Press=N,N.__name__="Press",n.Press=N=a([o("press")],N);var O=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(Z);n.PressUp=O,O.__name__="PressUp",n.PressUp=O=a([o("pressup")],O);var D=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(Z);n.PanStart=D,D.__name__="PanStart",n.PanStart=D=a([o("panstart")],D);var I=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(Z);n.PanEnd=I,I.__name__="PanEnd",n.PanEnd=I=a([o("panend")],I);var P=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(Z);n.PinchStart=P,P.__name__="PinchStart",n.PinchStart=P=a([o("pinchstart")],P);var V=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(Z);n.PinchEnd=V,V.__name__="PinchEnd",n.PinchEnd=V=a([o("pinchend")],V);var L=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(Z);n.RotateStart=L,L.__name__="RotateStart",n.RotateStart=L=a([o("rotatestart")],L);var j=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(Z);n.RotateEnd=j,j.__name__="RotateEnd",n.RotateEnd=j=a([o("rotateend")],j)},function(e,t,n,i,r){function a(e){var t=getComputedStyle(e).fontSize;return null!=t?parseInt(t,10):null}i(),n.getDeltaY=function(e){var t,n,i,r,o=-e.deltaY;if(e.target instanceof HTMLElement)switch(e.deltaMode){case e.DOM_DELTA_LINE:o*=null!==(r=null!==(i=a(null!==(n=(t=e.target).offsetParent)&&void 0!==n?n:document.body))&&void 0!==i?i:a(t))&&void 0!==r?r:16;break;case e.DOM_DELTA_PAGE:o*=function(e){return e.clientHeight}(e.target)}return o}},function(e,t,n,i,r){i(),r("Expression",e(254).Expression),r("CustomJSExpr",e(255).CustomJSExpr),r("Stack",e(256).Stack),r("CumSum",e(257).CumSum),r("ScalarExpression",e(254).ScalarExpression),r("Minimum",e(258).Minimum),r("Maximum",e(259).Maximum);var a=e(260);r("XComponent",a.XComponent),r("YComponent",a.YComponent),r("PolarTransform",e(261).PolarTransform)},function(e,t,n,i,r){i();var a=e(53),o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._result=new Map}},{key:"v_compute",value:function(e){var t=this._result.get(e);return(void 0===t||e.changed_for(this))&&(t=this._v_compute(e),this._result.set(e,t)),t}}]),n}(a.Model);n.Expression=o,o.__name__="Expression";var s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._result=new Map}},{key:"compute",value:function(e){var t=this._result.get(e);return(void 0===t||e.changed_for(this))&&(t=this._compute(e),this._result.set(e,t)),t}}]),n}(a.Model);n.ScalarExpression=s,s.__name__="ScalarExpression"},function(e,t,n,i,r){var a;i();var o=e(14),l=e(254),u=e(24),c=e(9),h=e(13),f=e(34),m=e(8),x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this);var t,i=(0,w.Z)((0,h.values)(this.args));try{for(i.s();!(t=i.n()).done;){var r=t.value;r instanceof o.HasProps&&r.change.connect((function(){e._result.clear(),e.change.emit()}))}}catch(a){i.e(a)}finally{i.f()}}},{key:"names",get:function(){return(0,h.keys)(this.args)}},{key:"values",get:function(){return(0,h.values)(this.args)}},{key:"func",get:function(){var e=(0,f.use_strict)(this.code);return(0,s.Z)(u.GeneratorFunction,(0,y.Z)(this.names).concat([e]))}},{key:"_v_compute",value:function(e){var t=this.func.apply(e,this.values),n=t.next();if(n.done&&void 0!==n.value){var i=n.value;return(0,m.isArray)(i)||(0,m.isTypedArray)(i)?i:(0,m.isIterable)(i)?(0,y.Z)(i):(0,c.repeat)(i,e.length)}
2var r=[];do{r.push(n.value),n=t.next()}while(!n.done);return r}}]),n}(l.Expression);n.CustomJSExpr=x,a=x,x.__name__="CustomJSExpr",a.define((function(e){var t=e.Unknown,n=e.String;return{args:[(0,e.Dict)(t),{}],code:[n,""]}}))},function(e,t,n,i,r){var a;i();var o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_v_compute",value:function(e){var t,n,i=null!==(t=e.get_length())&&void 0!==t?t:0,r=new Float64Array(i),a=(0,w.Z)(this.fields);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=e.data[o];if(null!=s)for(var l=Math.min(i,s.length),u=0;u<l;u++)r[u]+=s[u]}}catch(c){a.e(c)}finally{a.f()}return r}}]),n}(e(254).Expression);n.Stack=o,a=o,o.__name__="Stack",a.define((function(e){var t=e.String;return{fields:[(0,e.Array)(t),[]]}}))},function(e,t,n,i,r){var a;i();var o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_v_compute",value:function(e){var t,n=new Float64Array(null!==(t=e.get_length())&&void 0!==t?t:0),i=e.data[this.field],r=this.include_zero?1:0;n[0]=this.include_zero?0:i[0];for(var a=1;a<n.length;a++)n[a]=n[a-1]+i[a-r];return n}}]),n}(e(254).Expression);n.CumSum=o,a=o,o.__name__="CumSum",a.define((function(e){var t=e.Boolean;return{field:[e.String],include_zero:[t,!1]}}))},function(e,t,n,i,r){var a;i();var o=e(254),s=e(9),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_compute",value:function(e){var t,n,i=null!==(t=e.data[this.field])&&void 0!==t?t:[];return Math.min(null!==(n=this.initial)&&void 0!==n?n:1/0,(0,s.min)(i))}}]),n}(o.ScalarExpression);n.Minimum=l,a=l,l.__name__="Minimum",a.define((function(e){var t=e.Number;return{field:[e.String],initial:[(0,e.Nullable)(t),null]}}))},function(e,t,n,i,r){var a;i();var o=e(254),s=e(9),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_compute",value:function(e){var t,n,i=null!==(t=e.data[this.field])&&void 0!==t?t:[];return Math.max(null!==(n=this.initial)&&void 0!==n?n:-1/0,(0,s.max)(i))}}]),n}(o.ScalarExpression);n.Maximum=l,a=l,l.__name__="Maximum",a.define((function(e){var t=e.Number;return{field:[e.String],initial:[(0,e.Nullable)(t),null]}}))},function(e,t,n,i,r){var a;i();var o=e(254),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"x",get:function(){return new u({transform:this})}},{key:"y",get:function(){return new c({transform:this})}}]),n}(o.Expression);n.CoordinateTransform=s,s.__name__="CoordinateTransform";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Expression);n.XYComponent=l,a=l,l.__name__="XYComponent",a.define((function(e){return{transform:[(0,e.Ref)(s)]}}));var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_v_compute",value:function(e){return this.transform.v_compute(e).x}}]),n}(l);n.XComponent=u,u.__name__="XComponent";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_v_compute",value:function(e){return this.transform.v_compute(e).y}}]),n}(l);n.YComponent=c,c.__name__="YComponent"},function(e,t,n,i,r){i();var a,s=e(1),l=e(260),u=e(20),c=(0,s.__importStar)(e(18)),h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_v_compute",value:function(e){for(var t=this.properties.radius.uniform(e),n=this.properties.angle.uniform(e),i="anticlock"==this.direction?-1:1,r=Math.min(t.length,n.length),a=new Float64Array(r),o=new Float64Array(r),s=0;s<r;s++){var l=t.get(s),u=n.get(s)*i;a[s]=l*Math.cos(u),o[s]=l*Math.sin(u)}return{x:a,y:o}}}]),n}(l.CoordinateTransform);n.PolarTransform=h,a=h,h.__name__="PolarTransform",a.define((function(e){return o(e),{radius:[c.DistanceSpec,{field:"radius"}],angle:[c.AngleSpec,{field:"angle"}],direction:[u.Direction,"anticlock"]}}))},function(e,t,n,i,r){i(),r("BooleanFilter",e(263).BooleanFilter),r("CustomJSFilter",e(264).CustomJSFilter),r("Filter",e(191).Filter),r("GroupFilter",e(265).GroupFilter),r("IndexFilter",e(266).IndexFilter)},function(e,t,n,i,r){var a;i();var o=e(191),s=e(24),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}
2return(0,b.Z)(n,[{key:"compute_indices",value:function(e){var t=e.length,n=this.booleans;return null==n?s.Indices.all_set(t):s.Indices.from_booleans(t,n)}}]),n}(o.Filter);n.BooleanFilter=l,a=l,l.__name__="BooleanFilter",a.define((function(e){var t=e.Boolean,n=e.Array;return{booleans:[(0,e.Nullable)(n(t)),null]}}))},function(e,t,n,i,r){var a;i();var o=e(191),l=e(24),u=e(13),c=e(8),h=e(34),_=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"names",get:function(){return(0,u.keys)(this.args)}},{key:"values",get:function(){return(0,u.values)(this.args)}},{key:"func",get:function(){var e=(0,h.use_strict)(this.code);return(0,s.Z)(Function,(0,y.Z)(this.names).concat(["source",e]))}},{key:"compute_indices",value:function(e){var t=e.length,n=this.func.apply(this,(0,y.Z)(this.values).concat([e]));if(null==n)return l.Indices.all_set(t);if((0,c.isArrayOf)(n,c.isInteger))return l.Indices.from_indices(t,n);if((0,c.isArrayOf)(n,c.isBoolean))return l.Indices.from_booleans(t,n);throw new Error("expect an array of integers or booleans, or null, got ".concat(n))}}]),n}(o.Filter);n.CustomJSFilter=_,a=_,_.__name__="CustomJSFilter",a.define((function(e){var t=e.Unknown,n=e.String;return{args:[(0,e.Dict)(t),{}],code:[n,""]}}))},function(e,t,n,i,r){var a;i();var o=e(191),s=e(24),l=e(19),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"compute_indices",value:function(e){var t=e.get_column(this.column_name);if(null==t)return l.logger.warn("".concat(this,": groupby column '").concat(this.column_name,"' not found in the data source")),new s.Indices(e.length,1);for(var n=new s.Indices(e.length),i=0;i<n.size;i++)t[i]===this.group&&n.set(i);return n}}]),n}(o.Filter);n.GroupFilter=u,a=u,u.__name__="GroupFilter",a.define((function(e){var t=e.String;return{column_name:[t],group:[t]}}))},function(e,t,n,i,r){var a;i();var o=e(191),s=e(24),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"compute_indices",value:function(e){var t=e.length,n=this.indices;return null==n?s.Indices.all_set(t):s.Indices.from_indices(t,n)}}]),n}(o.Filter);n.IndexFilter=l,a=l,l.__name__="IndexFilter",a.define((function(e){var t=e.Int,n=e.Array;return{indices:[(0,e.Nullable)(n(t)),null]}}))},function(e,t,n,i,r){i(),r("AnnularWedge",e(268).AnnularWedge),r("Annulus",e(269).Annulus),r("Arc",e(270).Arc),r("Bezier",e(271).Bezier),r("Circle",e(272).Circle),r("Ellipse",e(273).Ellipse),r("EllipseOval",e(274).EllipseOval),r("Glyph",e(179).Glyph),r("HArea",e(187).HArea),r("HBar",e(276).HBar),r("HexTile",e(278).HexTile),r("Image",e(279).Image),r("ImageRGBA",e(281).ImageRGBA),r("ImageURL",e(282).ImageURL),r("Line",e(177).Line),r("MultiLine",e(283).MultiLine),r("MultiPolygons",e(284).MultiPolygons),r("Oval",e(285).Oval),r("Patch",e(186).Patch),r("Patches",e(286).Patches),r("Quad",e(287).Quad),r("Quadratic",e(288).Quadratic),r("Ray",e(289).Ray),r("Rect",e(290).Rect),r("Scatter",e(291).Scatter),r("Segment",e(294).Segment),r("Spline",e(295).Spline),r("Step",e(297).Step),r("Text",e(298).Text),r("VArea",e(189).VArea),r("VBar",e(299).VBar),r("Wedge",e(300).Wedge)},function(e,t,n,i,r){i();var a,s=e(1),l=e(178),u=e(184),c=e(48),h=e(24),_=e(20),d=(0,s.__importStar)(e(18)),f=e(10),m=e(72),y=e(12),x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_map_data",value:function(){"data"==this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,this._x,this.inner_radius):this.sinner_radius=(0,h.to_screen)(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=(0,h.to_screen)(this.outer_radius),this.max_souter_radius=(0,y.max)(this.souter_radius)}},{key:"_render",value:function(e,t,n){var i,r=null!=n?n:this,a=r.sx,o=r.sy,s=r.start_angle,l=r.end_angle,u=r.sinner_radius,c=r.souter_radius,h="anticlock"==this.model.direction,_=(0,w.Z)(t);try{for(_.s();!(i=_.n()).done;){var d=i.value,f=a[d],v=o[d],p=u[d],m=c[d],y=s.get(d),g=l.get(d);if(isFinite(f+v+p+m+y+g)){var b=g-y;e.translate(f,v),e.rotate(y),e.beginPath(),e.moveTo(m,0),e.arc(0,0,m,0,b,h),e.rotate(b),e.lineTo(p,0),e.arc(0,0,p,0,-b,!h),e.closePath(),e.rotate(-b-y),e.translate(-f,-v),this.visual
2s.fill.apply(e,d),this.visuals.hatch.apply(e,d),this.visuals.line.apply(e,d)}}}catch(x){_.e(x)}finally{_.f()}}},{key:"_hit_point",value:function(e){var t,n=e.sx,i=e.sy,r=this.renderer.xscale.invert(n),a=this.renderer.yscale.invert(i),o=n-this.max_souter_radius,s=n+this.max_souter_radius,l=this.renderer.xscale.r_invert(o,s),u=(0,k.Z)(l,2),c=u[0],h=u[1],_=i-this.max_souter_radius,d=i+this.max_souter_radius,v=this.renderer.yscale.r_invert(_,d),p=(0,k.Z)(v,2),y=p[0],g=p[1],b=[],x=(0,w.Z)(this.index.indices({x0:c,x1:h,y0:y,y1:g}));try{for(x.s();!(t=x.n()).done;){var Z=t.value,A=Math.pow(this.souter_radius[Z],2),S=Math.pow(this.sinner_radius[Z],2),T=this.renderer.xscale.r_compute(r,this._x[Z]),M=(0,k.Z)(T,2),C=M[0],z=M[1],E=this.renderer.yscale.r_compute(a,this._y[Z]),R=(0,k.Z)(E,2),B=R[0],N=R[1],O=Math.pow(C-z,2)+Math.pow(B-N,2);O<=A&&O>=S&&b.push(Z)}}catch(U){x.e(U)}finally{x.f()}for(var D="anticlock"==this.model.direction,I=[],P=0,V=b;P<V.length;P++){var L=V[P],j=Math.atan2(i-this.sy[L],n-this.sx[L]);(0,f.angle_between)(-j,-this.start_angle.get(L),-this.end_angle.get(L),D)&&I.push(L)}return new m.Selection({indices:I})}},{key:"draw_legend_for_index",value:function(e,t,n){(0,u.generic_area_vector_legend)(this.visuals,e,t,n)}},{key:"scenterxy",value:function(e){var t=(this.sinner_radius[e]+this.souter_radius[e])/2,n=(this.start_angle.get(e)+this.end_angle.get(e))/2;return[this.sx[e]+t*Math.cos(n),this.sy[e]+t*Math.sin(n)]}}]),n}(l.XYGlyphView);n.AnnularWedgeView=x,x.__name__="AnnularWedgeView";var Z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.XYGlyph);n.AnnularWedge=Z,a=Z,Z.__name__="AnnularWedge",a.prototype.default_view=x,a.mixins([c.LineVector,c.FillVector,c.HatchVector]),a.define((function(e){return o(e),{direction:[_.Direction,"anticlock"],inner_radius:[d.DistanceSpec,{field:"inner_radius"}],outer_radius:[d.DistanceSpec,{field:"outer_radius"}],start_angle:[d.AngleSpec,{field:"start_angle"}],end_angle:[d.AngleSpec,{field:"end_angle"}]}}))},function(e,t,n,i,r){i();var a,s=e(1),l=e(178),u=e(24),c=e(48),h=(0,s.__importStar)(e(18)),_=e(27),d=e(72),f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_map_data",value:function(){"data"==this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,this._x,this.inner_radius):this.sinner_radius=(0,u.to_screen)(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=(0,u.to_screen)(this.outer_radius)}},{key:"_render",value:function(e,t,n){var i,r=null!=n?n:this,a=r.sx,o=r.sy,s=r.sinner_radius,l=r.souter_radius,u=(0,w.Z)(t);try{for(u.s();!(i=u.n()).done;){var c=i.value,h=a[c],d=o[c],f=s[c],v=l[c];if(isFinite(h+d+f+v)){if(e.beginPath(),_.is_ie)for(var p=0,m=[!1,!0];p<m.length;p++){var y=m[p];e.moveTo(h,d),e.arc(h,d,f,0,Math.PI,y),e.moveTo(h+v,d),e.arc(h,d,v,Math.PI,0,!y)}else e.arc(h,d,f,0,2*Math.PI,!0),e.moveTo(h+v,d),e.arc(h,d,v,2*Math.PI,0,!1);
2this.visuals.fill.apply(e,c),this.visuals.hatch.apply(e,c),this.visuals.line.apply(e,c)}}}catch(g){u.e(g)}finally{u.f()}}},{key:"_hit_point",value:function(e){var t,n,i,r,a=e.sx,o=e.sy,s=this.renderer.xscale.invert(a),l=this.renderer.yscale.invert(o);if("data"==this.model.properties.outer_radius.units)t=s-this.max_outer_radius,i=s+this.max_outer_radius,n=l-this.max_outer_radius,r=l+this.max_outer_radius;else{var u=a-this.max_outer_radius,c=a+this.max_outer_radius,h=this.renderer.xscale.r_invert(u,c),_=(0,k.Z)(h,2);t=_[0],i=_[1];var f=o-this.max_outer_radius,v=o+this.max_outer_radius,p=this.renderer.yscale.r_invert(f,v),m=(0,k.Z)(p,2);n=m[0],r=m[1]}var y,g=[],b=(0,w.Z)(this.index.indices({x0:t,x1:i,y0:n,y1:r}));try{for(b.s();!(y=b.n()).done;){var x=y.value,Z=Math.pow(this.souter_radius[x],2),A=Math.pow(this.sinner_radius[x],2),S=this.renderer.xscale.r_compute(s,this._x[x]),T=(0,k.Z)(S,2),M=T[0],C=T[1],z=this.renderer.yscale.r_compute(l,this._y[x]),E=(0,k.Z)(z,2),R=E[0],B=E[1],N=Math.pow(M-C,2)+Math.pow(R-B,2);N<=Z&&N>=A&&g.push(x)}}catch(O){b.e(O)}finally{b.f()}return new d.Selection({indices:g})}},{key:"draw_legend_for_index",value:function(e,t,n){var i=t.x0,r=t.y0,a=t.x1,o=t.y1,s=n+1,l=new Array(s);l[n]=(i+a)/2;var u=new Array(s);u[n]=(r+o)/2;var c=.5*Math.min(Math.abs(a-i),Math.abs(o-r)),h=new Array(s);h[n]=.4*c;var _=new Array(s);_[n]=.8*c,this._render(e,[n],{sx:l,sy:u,sinner_radius:h,souter_radius:_})}}]),n}(l.XYGlyphView);n.AnnulusView=f,f.__name__="AnnulusView";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.XYGlyph);n.Annulus=m,a=m,m.__name__="Annulus",a.prototype.default_view=f,a.mixins([c.LineVector,c.FillVector,c.HatchVector]),a.define((function(e){return o(e),{inner_radius:[h.DistanceSpec,{field:"inner_radius"}],outer_radius:[h.DistanceSpec,{field:"outer_radius"}]}}))},function(e,t,n,i,r){i();var a,s=e(1),l=e(178),u=e(184),c=e(48),h=e(24),_=e(20),d=(0,s.__importStar)(e(18)),f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_map_data",value:function(){"data"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this.radius):this.sradius=(0,h.to_screen)(this.radius)}},{key:"_render",value:function(e,t,n){if(this.visuals.line.doit){var i,r=null!=n?n:this,a=r.sx,o=r.sy,s=r.sradius,l=r.start_angle,u=r.end_angle,c="anticlock"==this.model.direction,h=(0,w.Z)(t);try{for(h.s();!(i=h.n()).done;){var _=i.value,d=a[_],f=o[_],v=s[_],p=l.get(_),m=u.get(_);isFinite(d+f+v+p+m)&&(e.beginPath(),e.arc(d,f,v,p,m,c),this.visual
2s.line.set_vectorize(e,_),e.stroke())}}catch(y){h.e(y)}finally{h.f()}}}},{key:"draw_legend_for_index",value:function(e,t,n){(0,u.generic_line_vector_legend)(this.visuals,e,t,n)}}]),n}(l.XYGlyphView);n.ArcView=f,f.__name__="ArcView";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.XYGlyph);n.Arc=m,a=m,m.__name__="Arc",a.prototype.default_view=f,a.mixins(c.LineVector),a.define((function(e){return o(e),{direction:[_.Direction,"anticlock"],radius:[d.DistanceSpec,{field:"radius"}],start_angle:[d.AngleSpec,{field:"start_angle"}],end_angle:[d.AngleSpec,{field:"end_angle"}]}}))},function(e,t,n,i,r){i();var a,s=e(1),l=e(48),u=e(179),c=e(184),h=e(78),_=(0,s.__importStar)(e(18));function d(e,t,n,i,r,a,o,s){for(var l=[],u=[[],[]],c=0;c<=2;c++){var h=void 0,_=void 0,d=void 0;if(0===c?(_=6*e-12*n+6*r,h=-3*e+9*n-9*r+3*o,d=3*n-3*e):(_=6*t-12*i+6*a,h=-3*t+9*i-9*a+3*s,d=3*i-3*t),Math.abs(h)<1e-12){if(Math.abs(_)<1e-12)continue;var f=-d/_;0<f&&f<1&&l.push(f)}else{var v=_*_-4*d*h,p=Math.sqrt(v);if(!(v<0)){var m=(-_+p)/(2*h);0<m&&m<1&&l.push(m);var g=(-_-p)/(2*h);0<g&&g<1&&l.push(g)}}}for(var b=l.length,w=b;b--;){var x=l[b],k=1-x,Z=k*k*k*e+3*k*k*x*n+3*k*x*x*r+x*x*x*o;u[0][b]=Z;var A=k*k*k*t+3*k*k*x*i+3*k*x*x*a+x*x*x*s;u[1][b]=A}return u[0][w]=e,u[1][w]=t,u[0][w+1]=o,u[1][w+1]=s,[Math.min.apply(Math,(0,y.Z)(u[0])),Math.max.apply(Math,(0,y.Z)(u[1])),Math.max.apply(Math,(0,y.Z)(u[0])),Math.min.apply(Math,(0,y.Z)(u[1]))]}var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_project_data",value:function(){h.inplace.project_xy(this._x0,this._y0),h.inplace.project_xy(this._x1,this._y1)}},{key:"_index_data",value:function(e){for(var t=this.data_size,n=this._x0,i=this._y0,r=this._x1,a=this._y1,o=this._cx0,s=this._cy0,l=this._cx1,u=this._cy1,c=0;c<t;c++){var h=n[c],_=i[c],f=r[c],v=a[c],p=o[c],m=s[c],y=l[c],g=u[c];if(isFinite(h+f+_+v+p+m+y+g)){var b=d(h,_,f,v,p,m,y,g),w=(0,k.Z)(b,4),x=w[0],Z=w[1],A=w[2],S=w[3];e.add_rect(x,Z,A,S)}else e.add_empty()}}},{key:"_render",value:function(e,t,n){if(this.visuals.line.doit){var i,r=null!=n?n:this,a=r.sx0,o=r.sy0,s=r.sx1,l=r.sy1,u=r.scx0,c=r.scy0,h=r.scx1,_=r.scy1,d=(0,w.Z)(t);try{for(d.s();!(i=d.n()).done;){var f=i.value,v=a[f],p=o[f],m=s[f],y=l[f],g=u[f],b=c[f],x=h[f],k=_[f];isFinite(v+p+m+y+g+b+x+k)&&(e.beginPath(),e.moveTo(v,p),e.bezierCurveTo(g,b,x,k,m,y),this.visual
2s.line.set_vectorize(e,f),e.stroke())}}catch(Z){d.e(Z)}finally{d.f()}}}},{key:"draw_legend_for_index",value:function(e,t,n){(0,c.generic_line_vector_legend)(this.visuals,e,t,n)}},{key:"scenterxy",value:function(){throw new Error("".concat(this,".scenterxy() is not implemented"))}}]),n}(u.GlyphView);n.BezierView=f,f.__name__="BezierView";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(u.Glyph);n.Bezier=m,a=m,m.__name__="Bezier",a.prototype.default_view=f,a.define((function(e){return o(e),{x0:[_.XCoordinateSpec,{field:"x0"}],y0:[_.YCoordinateSpec,{field:"y0"}],x1:[_.XCoordinateSpec,{field:"x1"}],y1:[_.YCoordinateSpec,{field:"y1"}],cx0:[_.XCoordinateSpec,{field:"cx0"}],cy0:[_.YCoordinateSpec,{field:"cy0"}],cx1:[_.XCoordinateSpec,{field:"cx1"}],cy1:[_.YCoordinateSpec,{field:"cy1"}]}})),a.mixins(l.LineVector)},function(e,t,n,i,r){i();var a,o=e(1),s=e(178),l=e(48),u=e(24),c=e(20),h=(0,o.__importStar)(e(185)),f=(0,o.__importStar)(e(18)),m=e(9),A=e(12),S=e(72),T=function(t){(0,v.Z)(i,t);var n=(0,p.Z)(i);function i(){return(0,g.Z)(this,i),n.apply(this,arguments)}return(0,b.Z)(i,[{key:"lazy_initialize",value:function(){var t=(0,Z.Z)((0,x.Z)().mark((function t(){var n,r,a;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_.Z)((0,d.Z)(i.prototype),"lazy_initialize",this).call(this);case 2:if(null==(n=this.renderer.plot_view.canvas_view.webgl)||!n.regl_wrapper.has_webgl){t.next=9;break}return t.next=6,Promise.resolve().then((function(){return(0,o.__importStar)(e(423))}));case 6:r=t.sent,a=r.CircleGL,this.glglyph=new a(n.regl_wrapper,this);case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"use_radius",get:function(){return!(this.radius.is_Scalar()&&isNaN(this.radius.value))}},{key:"_set_data",value:function(e){var t=this;(0,_.Z)((0,d.Z)(i.prototype),"_set_data",this).call(this,e);var n=function(){if(t.use_radius)return 2*t.max_radius;var e=t.size;return e.is_Scalar()?e.value:(0,A.max)(e.array)}();this._configure("max_size",{value:n})}},{key:"_map_data",value:function(){if(this.use_radius)if("data"==this.model.properties.radius.units)switch(this.model.radius_dimension){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);break;case"max":var e=this.sdist(this.renderer.xscale,this._x,this.radius),t=this.sdist(this.renderer.yscale,this._y,this.radius);this.sradius=(0,A.map)(e,(function(e,n){return Math.max(e,t[n])}));break;case"min":var n=this.sdist(this.renderer.xscale,this._x,this.radius),i=this.sdist(this.renderer.yscale,this._y,this.radius);this.sradius=(0,A.map)(n,(function(e,t){return Math.min(e,i[t])}))}else this.sradius=(0,u.to_screen)(this.radius);else{var r=u.ScreenArray.from(this.size);this.sradius=(0,A.map)(r,(function(e){return e/2}))}}},{key:"_mask_data",value:function(){var e,t,n=this,i=this.renderer.plot_view.frame,r=i.x_target,a=i.y_target;return this.use_radius&&"data"==this.model.properties.radius.units?(e=r.map((function(e){return n.renderer.xscale.invert(e)})).widen(this.max_radius),t=a.map((function(e){return n.renderer.yscale.invert(e)})).widen(this.max_radius)):(e=r.widen(this.max_size).map((function(e){return n.renderer.xscale.invert(e)})),t=a.widen(this.max_size).map((function(e){return n.renderer.yscale.invert(e)}))),this.index.indices({x0:e.start,x1:e.end,y0:t.start,y1:t.end})}},{key:"_render",value:function(e,t,n){var i,r=null!=n?n:this,a=r.sx,o=r.sy,s=r.sradius,l=(0,w.Z)(t);try{for(l.s();!(i=l.n()).done;){var u=i.value,c=a[u],h=o[u],_=s[u];isFinite(c+h+_)&&(e.beginPath(),e.arc(c,h,_,0,2*Math.PI,!1),this.visual
2s.fill.apply(e,u),this.visuals.hatch.apply(e,u),this.visuals.line.apply(e,u))}}catch(d){l.e(d)}finally{l.f()}}},{key:"_hit_point",value:function(e){var t,n,i,r,a=e.sx,o=e.sy,s=this.renderer.xscale.invert(a),l=this.renderer.yscale.invert(o),u=this.model.hit_dilation;if(this.use_radius&&"data"==this.model.properties.radius.units)t=s-this.max_radius*u,n=s+this.max_radius*u,i=l-this.max_radius*u,r=l+this.max_radius*u;else{var c=a-this.max_size*u,h=a+this.max_size*u,_=this.renderer.xscale.r_invert(c,h),d=(0,k.Z)(_,2);t=d[0],n=d[1];var f=o-this.max_size*u,v=o+this.max_size*u,p=this.renderer.yscale.r_invert(f,v),m=(0,k.Z)(p,2);i=m[0],r=m[1]}var y=this.index.indices({x0:t,x1:n,y0:i,y1:r}),g=[];if(this.use_radius&&"data"==this.model.properties.radius.units){var b,x=(0,w.Z)(y);try{for(x.s();!(b=x.n()).done;){var Z=b.value,A=Math.pow(this.sradius[Z]*u,2),T=this.renderer.xscale.r_compute(s,this._x[Z]),M=(0,k.Z)(T,2),C=M[0],z=M[1],E=this.renderer.yscale.r_compute(l,this._y[Z]),R=(0,k.Z)(E,2),B=R[0],N=R[1];Math.pow(C-z,2)+Math.pow(B-N,2)<=A&&g.push(Z)}}catch(V){x.e(V)}finally{x.f()}}else{var O,D=(0,w.Z)(y);try{for(D.s();!(O=D.n()).done;){var I=O.value,P=Math.pow(this.sradius[I]*u,2);Math.pow(this.sx[I]-a,2)+Math.pow(this.sy[I]-o,2)<=P&&g.push(I)}}catch(V){D.e(V)}finally{D.f()}}return new S.Selection({indices:g})}},{key:"_hit_span",value:function(e){var t,n,i,r,a,o,s,l,u,c,h,_,d=e.sx,f=e.sy,v=this.bounds();if("h"==e.direction)if(i=v.y0,r=v.y1,this.use_radius&&"data"==this.model.properties.radius.units)s=d-this.max_radius,l=d+this.max_radius,a=this.renderer.xscale.r_invert(s,l),t=(o=(0,k.Z)(a,2))[0],n=o[1];else{var p,m,g=this.max_size/2;s=d-g,l=d+g,p=this.renderer.xscale.r_invert(s,l),t=(m=(0,k.Z)(p,2))[0],n=m[1]}else if(t=v.x0,n=v.x1,this.use_radius&&"data"==this.model.properties.radius.units)h=f-this.max_radius,_=f+this.max_radius,u=this.renderer.yscale.r_invert(h,_),i=(c=(0,k.Z)(u,2))[0],r=c[1];else{var b,w,x=this.max_size/2;h=f-x,_=f+x,b=this.renderer.yscale.r_invert(h,_),i=(w=(0,k.Z)(b,2))[0],r=w[1]}var Z=(0,y.Z)(this.index.indices({x0:t,x1:n,y0:i,y1:r}));return new S.Selection({indices:Z})}},{key:"_hit_rect",value:function(e){var t=e.sx0,n=e.sx1,i=e.sy0,r=e.sy1,a=this.renderer.xscale.r_invert(t,n),o=(0,k.Z)(a,2),s=o[0],l=o[1],u=this.renderer.yscale.r_invert(i,r),c=(0,k.Z)(u,2),h=c[0],_=c[1],d=(0,y.Z)(this.index.indices({x0:s,x1:l,y0:h,y1:_}));return new S.Selection({indices:d})}},{key:"_hit_poly",value:function(e){for(var t=e.sx,n=e.sy,i=(0,m.range)(0,this.sx.length),r=[],a=0,o=i.length;a<o;a++){var s=i[a];h.point_in_poly(this.sx[a],this.sy[a],t,n)&&r.push(s)}return new S.Selection({indices:r})}},{key:"draw_legend_for_index",value:function(e,t,n){var i=t.x0,r=t.y0,a=t.x1,o=t.y1,s=n+1,l=new Array(s);l[n]=(i+a)/2;var u=new Array(s);u[n]=(r+o)/2;var c=new Array(s);c[n]=.2*Math.min(Math.abs(a-i),Math.abs(o-r)),this._render(e,[n],{sx:l,sy:u,sradius:c})}}]),i}(s.XYGlyphView);n.CircleView=T,T.__name__="CircleView";var M=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.XYGlyph);n.Circle=M,a=M,M.__name__="Circle",a.prototype.default_view=T,a.mixins([l.LineVector,l.FillVector,l.HatchVector]),a.define((function(e){var t=e.Number;return{angle:[f.AngleSpec,0],size:[f.ScreenSizeSpec,{value:4}],radius:[f.NullDistanceSpec,null],radius_dimension:[c.RadiusDimension,"x"],hit_dilation:[t,1]}}))},function(e,t,n,i,r){var a;i();var o=e(274),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(o.EllipseOvalView);n.EllipseView=s,s.__name__="EllipseView";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.EllipseOval);n.Ellipse=l,a=l,l.__name__="Ellipse",a.prototype.default_view=s},function(e,t,n,i,r){i();var a=e(1),o=e(275),s=(0,a.__importStar)(e(185)),l=e(24),u=e(72),c=(0,a.__importStar)(e(18)),h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_map_data",value:function(){"data"==this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this.width,"center"):this.sw=(0,l.to_screen)(this.width),"data"==this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this.height,"center"):this.sh=(0,l.to_screen)(this.height)}},{key:"_render",value:function(e,t,n){var i,r=null!=n?n:this,a=r.sx,o=r.sy,s=r.sw,l=r.sh,u=r.angle,c=(0,w.Z)(t);try{for(c.s();!(i=c.n()).done;){var h=i.value,_=a[h],d=o[h],f=s[h],v=l[h],p=u.get(h);isFinite(_+d+f+v+p)&&(e.beginPath(),e.ellipse(_,d,f/2,v/2,p,0,2*Math.PI),this.visual
2s.fill.apply(e,h),this.visuals.hatch.apply(e,h),this.visuals.line.apply(e,h))}}catch(m){c.e(m)}finally{c.f()}}},{key:"_hit_point",value:function(e){var t,n,i,r,a,o,l,c,h,_,d,f,v=e.sx,p=e.sy,m=this.renderer.xscale.invert(v),y=this.renderer.yscale.invert(p);"data"==this.model.properties.width.units?(a=m-this.max_width,o=m+this.max_width):(h=v-this.max_width,_=v+this.max_width,t=this.renderer.xscale.r_invert(h,_),a=(n=(0,k.Z)(t,2))[0],o=n[1]),"data"==this.model.properties.height.units?(l=y-this.max_height,c=y+this.max_height):(d=p-this.max_height,f=p+this.max_height,i=this.renderer.yscale.r_invert(d,f),l=(r=(0,k.Z)(i,2))[0],c=r[1]);var g,b=this.index.indices({x0:a,x1:o,y0:l,y1:c}),x=[],Z=(0,w.Z)(b);try{for(Z.s();!(g=Z.n()).done;){var A=g.value;s.point_in_ellipse(v,p,this.angle.get(A),this.sh[A]/2,this.sw[A]/2,this.sx[A],this.sy[A])&&x.push(A)}}catch(S){Z.e(S)}finally{Z.f()}return new u.Selection({indices:x})}},{key:"draw_legend_for_index",value:function(e,t,n){var i=t.x0,r=t.y0,a=t.x1,o=t.y1,s=n+1,l=new Array(s);l[n]=(i+a)/2;var u=new Array(s);u[n]=(r+o)/2;var h=this.sw[n]/this.sh[n],_=.8*Math.min(Math.abs(a-i),Math.abs(o-r)),d=new Array(s),f=new Array(s);h>1?(d[n]=_,f[n]=_/h):(d[n]=_*h,f[n]=_);var v=new c.UniformScalar(0,s);this._render(e,[n],{sx:l,sy:u,sw:d,sh:f,angle:v})}}]),n}(o.CenterRotatableView);n.EllipseOvalView=h,h.__name__="EllipseOvalView";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.CenterRotatable);n.EllipseOval=_,_.__name__="EllipseOval"},function(e,t,n,i,r){i();var a,s=e(1),l=e(178),u=e(48),c=(0,s.__importStar)(e(18)),h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"max_w2",get:function(){return"data"==this.model.properties.width.units?this.max_width/2:0}},{key:"max_h2",get:function(){return"data"==this.model.properties.height.units?this.max_height/2:0}},{key:"_bounds",value:function(e){var t=e.x0,n=e.x1,i=e.y0,r=e.y1,a=this.max_w2,o=this.max_h2;return{x0:t-a,x1:n+a,y0:i-o,y1:r+o}}}]),n}(l.XYGlyphView);n.CenterRotatableView=h,h.__name__="CenterRotatableView";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.XYGlyph);n.CenterRotatable=_,a=_,_.__name__="CenterRotatable",a.mixins([u.LineVector,u.FillVector,u.HatchVector]),a.define((function(e){return o(e),{angle:[c.AngleSpec,0],width:[c.DistanceSpec,{field:"width"}],height:[c.DistanceSpec,{field:"height"}]}}))},function(e,t,n,i,r){i();var a,s=e(1),l=e(277),u=e(24),c=(0,s.__importStar)(e(18)),h=function(t){(0,v.Z)(i,t);var n=(0,p.Z)(i);function i(){return(0,g.Z)(this,i),n.apply(this,arguments)}return(0,b.Z)(i,[{key:"lazy_initialize",value:function(){var t=(0,Z.Z)((0,x.Z)().mark((function t(){var n,r,a;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_.Z)((0,d.Z)(i.prototype),"lazy_initialize",this).call(this);case 2:if(null==(n=this.renderer.plot_view.canvas_view.webgl)||!n.regl_wrapper.has_webgl){t.next=9;break}return t.next=6,Promise.resolve().then((function(){return(0,s.__importStar)(e(427))}));case 6:r=t.sent,a=r.LRTBGL,this.glglyph=new a(n.regl_wrapper,this);case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"scenterxy",value:function(e){return[(this.sleft[e]+this.sright[e])/2,this.sy[e]]}},{key:"_lrtb",value:function(e){var t=this._left[e],n=this._right[e],i=this._y[e],r=this.height.get(e)/2;return[Math.min(t,n),Math.max(t,n),i+r,i-r]}},{key:"_map_data",value: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 e=this.sy.length;this.stop=new u.ScreenArray(e),this.sbottom=new u.ScreenArray(e);for(var t=0;t<e;t++)this.stop[t]=this.sy[t]-this.sh[t]/2,this.sbottom[t]=this.sy[t]+this.sh[t]/2;this._clamp_viewport()}}]),i}(l.BoxView);n.HBarView=h,h.__name__="HBarView";var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.Box);n.HBar=f,a=f,f.__name__="HBar",a.prototype.default_view=h,a.define((function(e){return o(e),{left:[c.XCoordinateSpec,{value:0}],y:[c.YCoordinateSpec,{field:"y"}],height:[c.NumberSpec,{value:1}],right:[c.XCoordinateSpec,{field:"right"}]}}))},function(e,t,n,i,r){var a;i();var o=e(48),s=e(179),l=e(184),u=e(72),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"get_anchor_point",value:function(e,t,n){var i=Math.min(this.sleft[t],this.sright[t]),r=Math.max(this.sright[t],this.sleft[t]),a=Math.min(this.stop[t],this.sbottom[t]),o=Math.max(this.sbottom[t],this.stop[t]);
2switch(e){case"top_left":return{x:i,y:a};case"top":case"top_center":return{x:(i+r)/2,y:a};case"top_right":return{x:r,y:a};case"bottom_left":return{x:i,y:o};case"bottom":case"bottom_center":return{x:(i+r)/2,y:o};case"bottom_right":return{x:r,y:o};case"left":case"center_left":return{x:i,y:(a+o)/2};case"center":case"center_center":return{x:(i+r)/2,y:(a+o)/2};case"right":case"center_right":return{x:r,y:(a+o)/2}}}},{key:"_index_data",value:function(e){for(var t=Math.min,n=Math.max,i=this.data_size,r=0;r<i;r++){var a=this._lrtb(r),o=(0,k.Z)(a,4),s=o[0],l=o[1],u=o[2],c=o[3];e.add_rect(t(s,l),t(u,c),n(l,s),n(u,c))}}},{key:"_render",value:function(e,t,n){var i,r=null!=n?n:this,a=r.sleft,o=r.sright,s=r.stop,l=r.sbottom,u=(0,w.Z)(t);try{for(u.s();!(i=u.n()).done;){var c=i.value,h=a[c],_=s[c],d=o[c],f=l[c];isFinite(h+_+d+f)&&(e.beginPath(),e.rect(h,_,d-h,f-_),this.visuals.fill.apply(e,c),this.visuals.hatch.apply(e,c),this.visuals.line.apply(e,c))}}catch(v){u.e(v)}finally{u.f()}}},{key:"_clamp_viewport",value:function(){for(var e=this.renderer.plot_view.frame.bbox.h_range,t=this.renderer.plot_view.frame.bbox.v_range,n=this.stop.length,i=0;i<n;i++)this.stop[i]=Math.max(this.stop[i],t.start),this.sbottom[i]=Math.min(this.sbottom[i],t.end),this.sleft[i]=Math.max(this.sleft[i],e.start),this.sright[i]=Math.min(this.sright[i],e.end)}},{key:"_hit_rect",value:function(e){return this._hit_rect_against_index(e)}},{key:"_hit_point",value:function(e){var t=e.sx,n=e.sy,i=this.renderer.xscale.invert(t),r=this.renderer.yscale.invert(n),a=(0,y.Z)(this.index.indices({x0:i,y0:r,x1:i,y1:r}));return new u.Selection({indices:a})}},{key:"_hit_span",value:function(e){var t,n=e.sx,i=e.sy;if("v"==e.direction){var r=this.renderer.yscale.invert(i),a=this.renderer.plot_view.frame.bbox.h_range,o=this.renderer.xscale.r_invert(a.start,a.end),s=(0,k.Z)(o,2),l=s[0],c=s[1];t=(0,y.Z)(this.index.indices({x0:l,y0:r,x1:c,y1:r}))}else{var h=this.renderer.xscale.invert(n),_=this.renderer.plot_view.frame.bbox.v_range,d=this.renderer.yscale.r_invert(_.start,_.end),f=(0,k.Z)(d,2),v=f[0],p=f[1];t=(0,y.Z)(this.index.indices({x0:h,y0:v,x1:h,y1:p}))}return new u.Selection({indices:t})}},{key:"draw_legend_for_index",value:function(e,t,n){(0,l.generic_area_vector_legend)(this.visuals,e,t,n)}}]),n}(s.GlyphView);n.BoxView=c,c.__name__="BoxView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.Glyph);n.Box=h,a=h,h.__name__="Box",a.mixins([o.LineVector,o.FillVector,o.HatchVector])},function(e,t,n,i,r){i();var a,o=e(1),s=e(179),l=(0,o.__importStar)(e(185)),u=(0,o.__importStar)(e(18)),c=e(48),h=e(20),f=e(78),m=e(184),A=e(72),S=function(t){(0,v.Z)(i,t);var n=(0,p.Z)(i);function i(){return(0,g.Z)(this,i),n.apply(this,arguments)}return(0,b.Z)(i,[{key:"lazy_initialize",value:function(){var t=(0,Z.Z)((0,x.Z)().mark((function t(){var n,r,a;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_.Z)((0,d.Z)(i.prototype),"lazy_initialize",this).call(this);case 2:if(null==(n=this.renderer.plot_view.canvas_view.webgl)||!n.regl_wrapper.has_webgl){t.next=9;break}return t.next=6,Promise.resolve().then((function(){return(0,o.__importStar)(e(425))}));case 6:r=t.sent,a=r.HexTileGL,this.glglyph=new a(n.regl_wrapper,this);case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"scenterxy",value:function(e){return[this.sx[e],this.sy[e]]}},{key:"_set_data",value:function(){var e=this.model,t=e.orientation,n=e.size,i=e.aspect_scale,r=this.q,a=this.r,o=this.q.length;this._x=new Float64Array(o),this._y=new Float64Array(o);var s=this._x,l=this._y,u=Math.sqrt(3);if("pointytop"==t)for(var c=0;c<o;c++){var h=r.get(c),_=a.get(c)/2;s[c]=n*u*(h+_)/i,l[c]=-3*n*_}else for(var d=0;d<o;d++){var f=r.get(d)/2,v=a.get(d);s[d]=3*n*f,l[d]=-n*u*(v+f)*i}}},{key:"_project_data",value:function(){f.inplace.project_xy(this._x,this._y)}},{key:"_index_data",value:function(e){var t,n=this.model.size,i=Math.sqrt(3)*n/2;"flattop"==this.model.orientation?(i=(t=[n,i])[0],n=t[1],n*=this.model.aspect_scale):i/=this.model.aspect_scale;for(var r=this.data_size,a=0;a<r;a++){var o=this._x[a],s=this._y[a];e.add_rect(o-i,s-n,o+i,s+n)}}},{key:"map_data",value:function(){var e,t,n,i,r;e=this.renderer.coordinates.map_to_screen(this._x,this._y),t=(0,k.Z)(e,2),this.sx=t[0],this.sy=t[1],n=this._get_unscaled_vertices(),i=(0,k.Z)(n,2),this.svx=i[0],this.svy=i[1],null===(r=this.glglyph)||void 0===r||r.set_data_changed()}},{key:"_get_unscaled_vertices",value:function(){var e=this.model.size,t=this.model.aspect_scale;if("pointytop"==this.model.orientation){var n=this.renderer.yscale,i=this.renderer.xscale,r=Math.abs(n.compute(0)-n.compute(e)),a=Math.sqrt(3)/2*Math.abs(i.compute(0)-i.compute(e))/t,o=r/2;return[[0,-a,-a,0,a,a],[r,o,-o,-r,-o,o]]}var s=this.renderer.xscale,l=this.renderer.yscale,u=Math.abs(s.compute(0)-s.compute(e)),c=Math.sqrt(3)/2*Math.abs(l.compute(0)-l.compute(e))*t,h=u/2;return[[u,h,-h,-u,-h,h],[0,-c,-c,0,c,c]]}},{key:"_render",value:function(e,t,n){var i,r=null!=n?n:this,a=r.sx,o=r.sy,s=r.svx,l=r.svy,u=r.scale,c=(0,w.Z)(t);try{for(c.s();!(i=c.n()).done;){var h=i.value,_=a[h],d=o[h],f=u.get(h);if(isFinite(_+d+f)){e.translate(_,d),e.beginPath();for(var v=0;v<6;v++)e.lineTo(s[v]*f,l[v]*f);
2e.closePath(),e.translate(-_,-d),this.visuals.fill.apply(e,h),this.visuals.hatch.apply(e,h),this.visuals.line.apply(e,h)}}}catch(p){c.e(p)}finally{c.f()}}},{key:"_hit_point",value:function(e){var t,n=e.sx,i=e.sy,r=this.renderer.xscale.invert(n),a=this.renderer.yscale.invert(i),o=this.index.indices({x0:r,y0:a,x1:r,y1:a}),s=[],u=(0,w.Z)(o);try{for(u.s();!(t=u.n()).done;){var c=t.value;l.point_in_poly(n-this.sx[c],i-this.sy[c],this.svx,this.svy)&&s.push(c)}}catch(h){u.e(h)}finally{u.f()}return new A.Selection({indices:s})}},{key:"_hit_span",value:function(e){var t,n=e.sx,i=e.sy;if("v"==e.direction){var r=this.renderer.yscale.invert(i),a=this.renderer.plot_view.frame.bbox.h_range,o=this.renderer.xscale.r_invert(a.start,a.end),s=(0,k.Z)(o,2),l=s[0],u=s[1];t=(0,y.Z)(this.index.indices({x0:l,y0:r,x1:u,y1:r}))}else{var c=this.renderer.xscale.invert(n),h=this.renderer.plot_view.frame.bbox.v_range,_=this.renderer.yscale.r_invert(h.start,h.end),d=(0,k.Z)(_,2),f=d[0],v=d[1];t=(0,y.Z)(this.index.indices({x0:c,y0:f,x1:c,y1:v}))}return new A.Selection({indices:t})}},{key:"_hit_rect",value:function(e){var t=e.sx0,n=e.sx1,i=e.sy0,r=e.sy1,a=this.renderer.xscale.r_invert(t,n),o=(0,k.Z)(a,2),s=o[0],l=o[1],u=this.renderer.yscale.r_invert(i,r),c=(0,k.Z)(u,2),h=c[0],_=c[1],d=(0,y.Z)(this.index.indices({x0:s,x1:l,y0:h,y1:_}));return new A.Selection({indices:d})}},{key:"draw_legend_for_index",value:function(e,t,n){(0,m.generic_area_vector_legend)(this.visuals,e,t,n)}}]),i}(s.GlyphView);n.HexTileView=S,S.__name__="HexTileView";var T=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.Glyph);n.HexTile=T,a=T,T.__name__="HexTile",a.prototype.default_view=S,a.mixins([c.LineVector,c.FillVector,c.HatchVector]),a.define((function(e){var t=e.Number;return{r:[u.NumberSpec,{field:"r"}],q:[u.NumberSpec,{field:"q"}],scale:[u.NumberSpec,1],size:[t,1],aspect_scale:[t,1],orientation:[h.HexTileOrientation,"pointytop"]}})),a.override({line_color:null})},function(e,t,n,i,r){var a;i();var o=e(280),s=e(173),l=e(201),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.color_mapper.change,(function(){return e._update_image()}))}},{key:"_update_image",value:function(){null!=this.image_data&&(this._set_data(null),this.renderer.request_render())}},{key:"_flat_img_to_buf8",value:function(e){return this.model.color_mapper.rgba_mapper.v_compute(e)}}]),n}(o.ImageBaseView);n.ImageView=u,u.__name__="ImageView";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.ImageBase);n.Image=c,a=c,c.__name__="Image",a.prototype.default_view=u,a.define((function(e){return{color_mapper:[(0,e.Ref)(s.ColorMapper),function(){return new l.LinearColorMapper({palette:["#000000","#252525","#525252","#737373","#969696","#bdbdbd","#d9d9d9","#f0f0f0","#ffffff"]})}]}}))},function(e,t,n,i,r){i();var a,o=e(1),s=e(178),l=e(24),u=(0,o.__importStar)(e(18)),c=e(72),h=e(9),f=e(29),m=e(11),y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.properties.global_alpha.change,(function(){return e.renderer.request_render()}))}},{key:"_render",value:function(e,t,n){var i=null!=n?n:this,r=i.image_data,a=i.sx,o=i.sy,s=i.sw,l=i.sh,u=i.global_alpha,c=e.getImageSmoothingEnabled();e.setImageSmoothingEnabled(!1);var h=u.is_Scalar();h&&(e.globalAlpha=u.value);var _,d=(0,w.Z)(t);try{for(d.s();!(_=d.n()).done;){var f=_.value,v=r[f],p=a[f],m=o[f],y=s[f],g=l[f],b=this.global_alpha.get(f);if(null!=v&&isFinite(p+m+y+g+b)){h||(e.globalAlpha=b);var x=m;e.translate(0,x),e.scale(1,-1),e.translate(0,-x),e.drawImage(v,0|p,0|m,y,g),e.translate(0,x),e.scale(1,-1),e.translate(0,-x)}}}catch(k){d.e(k)}finally{d.f()}e.setImageSmoothingEnabled(c)}},{key:"_set_data",value:function(e){this._set_width_heigh_data();for(var t=0,n=this.image.length;t<n;t++)if(!(null!=e&&e.indexOf(t)<0)){var i=this.image.get(t),r=void 0;(0,f.is_NDArray)(i)?((0,m.assert)(2==i.dimension,"expected a 2D array"),r=i,this._height[t]=i.shape[0],this._width[t]=i.shape[1]):(r=(0,h.concat)(i),this._height[t]=i.length,this._width[t]=i[0].length);var a=this._flat_img_to_buf8(r);this._set_image_data_from_buffer(t,a)}}},{key:"_index_data",value:function(e){for(var t=this.data_size,n=0;n<t;n++){var i=this._lrtb(n),r=(0,k.Z)(i,4),a=r[0],o=r[1],s=r[2],l=r[3];e.add_rect(a,l,o,s)}}},{key:"_lrtb",value:function(e){var t=this.dw.get(e),n=this.dh.get(e),i=this.renderer.xscale.source_range,r=this._x[e],a=i.is_reversed?r-t:r
2+t,o=this.renderer.yscale.source_range,s=this._y[e],l=o.is_reversed?s-n:s+n,u=r<a?[r,a]:[a,r],c=(0,k.Z)(u,2),h=c[0],_=c[1],d=s<l?[s,l]:[l,s],f=(0,k.Z)(d,2),v=f[0];return[h,_,f[1],v]}},{key:"_set_width_heigh_data",value: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 Uint32Array(this.image.length)),null!=this._height&&this._height.length==this.image.length||(this._height=new Uint32Array(this.image.length))}},{key:"_get_or_create_canvas",value:function(e){var t=this.image_data[e];if(null!=t&&t.width==this._width[e]&&t.height==this._height[e])return t;var n=document.createElement("canvas");return n.width=this._width[e],n.height=this._height[e],n}},{key:"_set_image_data_from_buffer",value:function(e,t){var n=this._get_or_create_canvas(e),i=n.getContext("2d"),r=i.getImageData(0,0,this._width[e],this._height[e]);r.data.set(t),i.putImageData(r,0,0),this.image_data[e]=n}},{key:"_map_data",value:function(){"data"==this.model.properties.dw.units?this.sw=this.sdist(this.renderer.xscale,this._x,this.dw,"edge",this.model.dilate):this.sw=(0,l.to_screen)(this.dw),"data"==this.model.properties.dh.units?this.sh=this.sdist(this.renderer.yscale,this._y,this.dh,"edge",this.model.dilate):this.sh=(0,l.to_screen)(this.dh)}},{key:"_image_index",value:function(e,t,n){var i=this._lrtb(e),r=(0,k.Z)(i,4),a=r[0],o=r[1],s=r[2],l=r[3],u=this._width[e],c=this._height[e],h=(o-a)/u,_=(s-l)/c,d=Math.floor((t-a)/h),f=Math.floor((n-l)/_);return this.renderer.xscale.source_range.is_reversed&&(d=u-d-1),this.renderer.yscale.source_range.is_reversed&&(f=c-f-1),{index:e,dim1:d,dim2:f,flat_index:f*u+d}}},{key:"_hit_point",value:function(e){var t,n=e.sx,i=e.sy,r=this.renderer.xscale.invert(n),a=this.renderer.yscale.invert(i),o=this.index.indices({x0:r,x1:r,y0:a,y1:a}),s=new c.Selection,l=(0,w.Z)(o);try{for(l.s();!(t=l.n()).done;){var u=t.value;n!=1/0&&i!=1/0&&s.image_indices.push(this._image_index(u,r,a))}}catch(h){l.e(h)}finally{l.f()}return s}}]),n}(s.XYGlyphView);n.ImageBaseView=y,y.__name__="ImageBaseView";var x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.XYGlyph);n.ImageBase=x,a=x,x.__name__="ImageBase",a.define((function(e){var t=e.Boolean;return{image:[u.NDArraySpec,{field:"image"}],dw:[u.DistanceSpec,{field:"dw"}],dh:[u.DistanceSpec,{field:"dh"}],global_alpha:[u.NumberSpec,{value:1}],dilate:[t,!1]}}))},function(e,t,n,i,r){var a;i();var o=e(280),s=e(8),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_flat_img_to_buf8",value:function(e){var t;return t=(0,s.isArray)(e)?new Uint32Array(e):e,new Uint8ClampedArray(t.buffer)}}]),n}(o.ImageBaseView);n.ImageRGBAView=l,l.__name__="ImageRGBAView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.ImageBase);n.ImageRGBA=u,a=u,u.__name__="ImageRGBA",a.prototype.default_view=l},function(e,t,n,i,r){i();var a,o=e(1),s=e(178),l=e(24),u=e(20),c=(0,o.__importStar)(e(18)),h=e(12),f=e(136),m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._images_rendered=!1,e._set_data_iteration=0,e}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.properties.global_alpha.change,(function(){return e.renderer.request_render()}))}},{key:"_index_data",value:function(e){for(var t=this.data_size,n=0;n<t;n++)e.add_empty()}},{key:"_set_data",value:function(){var e=this;this._set_data_iteration++;var t=this.url.length;this.image=new Array(t);for(var n=this.model,i=n.retry_attempts,r=n.retry_timeout,a=this._set_data_iteration,o=function(t){var n=e.url.get(t);n&&new f.ImageLoader(n,{loaded:function(n){e._set_data_iteration==a&&(e.image[t]=n,e.renderer.request_render())},attempts:i+1,timeout:r})},s=0;s<t;s++)o(s);var u="data"==this.model.properties.w.units,c="data"==this.model.properties.h.units,_=this._x.length,d=new l.ScreenArray(u?2*_:_),v=new l.ScreenArray(c?2*_:_),p=this.model.anchor;
2function m(e,t){switch(p){case"top_left":case"bottom_left":case"left":case"center_left":return[e,e+t];case"top":case"top_center":case"bottom":case"bottom_center":case"center":case"center_center":return[e-t/2,e+t/2];case"top_right":case"bottom_right":case"right":case"center_right":return[e-t,e]}}function y(e,t){switch(p){case"top_left":case"top":case"top_center":case"top_right":return[e,e-t];case"bottom_left":case"bottom":case"bottom_center":case"bottom_right":return[e+t,e];case"left":case"center_left":case"center":case"center_center":case"right":case"center_right":return[e+t/2,e-t/2]}}if(u)for(var g=0;g<_;g++){var b=m(this._x[g],this.w.get(g)),w=(0,k.Z)(b,2);d[g]=w[0],d[_+g]=w[1]}else d.set(this._x,0);if(c)for(var x=0;x<_;x++){var Z=y(this._y[x],this.h.get(x)),A=(0,k.Z)(Z,2);v[x]=A[0],v[_+x]=A[1]}else v.set(this._y,0);var S=(0,h.minmax)(d),T=(0,k.Z)(S,2),M=T[0],C=T[1],z=(0,h.minmax)(v),E=(0,k.Z)(z,2),R=E[0],B=E[1];this._bounds_rect={x0:M,x1:C,y0:R,y1:B}}},{key:"has_finished",value:function(){return(0,_.Z)((0,d.Z)(n.prototype),"has_finished",this).call(this)&&1==this._images_rendered}},{key:"_map_data",value:function(){"data"==this.model.properties.w.units?this.sw=this.sdist(this.renderer.xscale,this._x,this.w,"edge",this.model.dilate):this.sw=(0,l.to_screen)(this.w),"data"==this.model.properties.h.units?this.sh=this.sdist(this.renderer.yscale,this._y,this.h,"edge",this.model.dilate):this.sh=(0,l.to_screen)(this.h)}},{key:"_render",value:function(e,t,n){var i=null!=n?n:this,r=i.image,a=i.sx,o=i.sy,s=i.sw,l=i.sh,u=i.angle,c=i.global_alpha,h=this.renderer.plot_view.frame;e.beginPath(),e.rect(h.bbox.left+1,h.bbox.top+1,h.bbox.width-2,h.bbox.height-2),e.clip();var _,d=!0,f=(0,w.Z)(t);try{for(f.s();!(_=f.n()).done;){var v=_.value;if(isFinite(a[v]+o[v]+u.get(v)+c.get(v))){var p=r[v];null!=p?this._render_image(e,v,p,a,o,s,l,u,c):d=!1}}}catch(m){f.e(m)}finally{f.f()}d&&!this._images_rendered&&(this._images_rendered=!0,this.notify_finished())}},{key:"_final_sx_sy",value:function(e,t,n,i,r){switch(e){case"top_left":return[t,n];case"top":case"top_center":return[t-i/2,n];case"top_right":return[t-i,n];case"right":case"center_right":return[t-i,n-r/2];case"bottom_right":return[t-i,n-r];case"bottom":case"bottom_center":return[t-i/2,n-r];case"bottom_left":return[t,n-r];case"left":case"center_left":return[t,n-r/2];case"center":case"center_center":return[t-i/2,n-r/2]}}},{key:"_render_image",value:function(e,t,n,i,r,a,o,s,l){isFinite(a[t])||(a[t]=n.width),isFinite(o[t])||(o[t]=n.height);var u=a[t],c=o[t],h=this.model.anchor,_=this._final_sx_sy(h,i[t],r[t],u,c),d=(0,k.Z)(_,2),f=d[0],v=d[1],p=s.get(t),m=l.get(t);e.save(),e.globalAlpha=m;var y=u/2,g=c/2;p?(e.translate(f,v),e.translate(y,g),e.rotate(p),e.translate(-y,-g),e.drawImage(n,0,0,u,c),e.translate(y,g),e.rotate(-p),e.translate(-y,-g),e.translate(-f,-v)):e.drawImage(n,f,v,u,c),e.restore()}},{key:"bounds",value:function(){return this._bounds_rect}}]),n}(s.XYGlyphView);n.ImageURLView=m,m.__name__="ImageURLView";var y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.XYGlyph);n.ImageURL=y,a=y,y.__name__="ImageURL",a.prototype.default_view=m,a.define((function(e){var t=e.Boolean,n=e.Int;return{url:[c.StringSpec,{field:"url"}],anchor:[u.Anchor,"top_left"],global_alpha:[c.NumberSpec,{value:1}],angle:[c.AngleSpec,0],w:[c.NullDistanceSpec,null],h:[c.NullDistanceSpec,null],dilate:[t,!1],retry_attempts:[n,0],retry_timeout:[n,0]}}))},function(e,t,n,i,r){i();var a,s=e(1),l=e(78),u=e(48),c=(0,s.__importStar)(e(185)),h=(0,s.__importStar)(e(18)),_=e(12),d=e(13),f=e(179),m=e(184),x=e(72),Z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_project_data",value:function(){l.inplace.project_xy(this._xs.array,this._ys.array)}},{key:"_index_data",value:function(e){for(var t=this.data_size,n=0;n<t;n++){var i=this._xs.get(n),r=this._ys.get(n),a=(0,_.minmax2)(i,r),o=(0,k.Z)(a,4),s=o[0],l=o[1],u=o[2],c=o[3];e.add_rect(s,u,l,c)}}},{key:"_render",value:function(e,t,n){var i,r=null!=n?n:this,a=r.sxs,o=r.sys,s=(0,w.Z)(t);try{for(s.s();!(i=s.n()).done;){var l=i.value,u=a.get(l),c=o.get(l),h=Math.min(u.length,c.length),_=!0;e.beginPath();for(var d=0;d<h;d++){var f=u[d],v=c[d];isFinite(f+v)?_?(e.moveTo(f,v),_=!1):e.lineTo(f,v):_=!0}
2this.visuals.line.set_vectorize(e,l),e.stroke()}}catch(p){s.e(p)}finally{s.f()}}},{key:"_hit_point",value:function(e){for(var t={x:e.sx,y:e.sy},n=9999,i=new Map,r=0,a=this.sxs.length;r<a;r++){for(var o=Math.max(2,this.line_width.get(r)/2),s=this.sxs.get(r),l=this.sys.get(r),u=null,h=0,_=s.length-1;h<_;h++){var f={x:s[h],y:l[h]},v={x:s[h+1],y:l[h+1]},p=c.dist_to_segment(t,f,v);p<o&&p<n&&(n=p,u=[h])}null!=u&&i.set(r,u)}return new x.Selection({indices:(0,y.Z)(i.keys()),multiline_indices:(0,d.to_object)(i)})}},{key:"_hit_span",value:function(e){var t,n,i=e.sx,r=e.sy;"v"==e.direction?(t=this.renderer.yscale.invert(r),n=this._ys):(t=this.renderer.xscale.invert(i),n=this._xs);for(var a=new Map,o=0,s=n.length;o<s;o++){for(var l=n.get(o),u=[],c=0,h=l.length-1;c<h;c++)l[c]<=t&&t<=l[c+1]&&u.push(c);u.length>0&&a.set(o,u)}return new x.Selection({indices:(0,y.Z)(a.keys()),multiline_indices:(0,d.to_object)(a)})}},{key:"get_interpolation_hit",value:function(e,t,n){var i=this._xs.get(e),r=this._ys.get(e),a=i[t],o=r[t],s=i[t+1],l=r[t+1];return(0,m.line_interpolation)(this.renderer,n,a,o,s,l)}},{key:"draw_legend_for_index",value:function(e,t,n){(0,m.generic_line_vector_legend)(this.visuals,e,t,n)}},{key:"scenterxy",value:function(){throw new Error("".concat(this,".scenterxy() is not implemented"))}}]),n}(f.GlyphView);n.MultiLineView=Z,Z.__name__="MultiLineView";var A=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(f.Glyph);n.MultiLine=A,a=A,A.__name__="MultiLine",a.prototype.default_view=Z,a.define((function(e){return o(e),{xs:[h.XCoordinateSeqSpec,{field:"xs"}],ys:[h.YCoordinateSeqSpec,{field:"ys"}]}})),a.mixins(u.LineVector)},function(e,t,n,i,r){i();var a,s=e(1),l=e(181),u=e(179),c=e(184),h=e(12),_=e(12),d=e(48),f=(0,s.__importStar)(e(185)),m=(0,s.__importStar)(e(18)),y=e(72),x=e(11),Z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_project_data",value:function(){}},{key:"_index_data",value:function(e){for(var t=Math.min,n=Math.max,i=this.data_size,r=0;r<i;r++){var a=this._xs[r],o=this._ys[r];if(0!=a.length&&0!=o.length){for(var s=1/0,l=-1/0,u=1/0,c=-1/0,_=0,d=a.length;_<d;_++){var f=a[_][0],v=o[_][0];if(0!=f.length&&0!=v.length){var p=(0,h.minmax)(f),m=(0,k.Z)(p,2),y=m[0],g=m[1],b=(0,h.minmax)(v),w=(0,k.Z)(b,2),x=w[0],Z=w[1];s=t(s,y),l=n(l,g),u=t(u,x),c=n(c,Z)}}e.add_rect(s,u,l,c)}else e.add_empty()}this._hole_index=this._index_hole_data()}},{key:"_index_hole_data",value:function(){for(var e=Math.min,t=Math.max,n=this.data_size,i=new l.SpatialIndex(n),r=0;r<n;r++){var a=this._xs[r],o=this._ys[r];if(0!=a.length&&0!=o.length){for(var s=1/0,u=-1/0,c=1/0,_=-1/0,d=0,f=a.length;d<f;d++){var v=a[d],p=o[d];if(v.length>1&&p.length>1)for(var m=1,y=v.length;m<y;m++){var g=(0,h.minmax)(v[m]),b=(0,k.Z)(g,2),w=b[0],x=b[1],Z=(0,h.minmax)(p[m]),A=(0,k.Z)(Z,2),S=A[0],T=A[1];s=e(s,w),u=t(u,x),c=e(c,S),_=t(_,T)}}i.add_rect(s,c,u,_)}else i.add_empty()}return i.finish(),i}},{key:"_mask_data",value:function(){var e=this.renderer.plot_view.frame,t=e.x_range,n=e.y_range;return this.index.indices({x0:t.min,x1:t.max,y0:n.min,y1:n.max})}},{key:"_render",value:function(e,t,n){if(this.visuals.fill.doit||this.visual
2s.line.doit){var i,r=null!=n?n:this,a=r.sxs,o=r.sys,s=(0,w.Z)(t);try{for(s.s();!(i=s.n()).done;){var l=i.value;e.beginPath();for(var u=a[l],c=o[l],h=Math.min(u.length,c.length),_=0;_<h;_++)for(var d=u[_],f=c[_],v=Math.min(d.length,f.length),p=0;p<v;p++){for(var m=d[p],y=f[p],g=Math.min(m.length,y.length),b=0;b<g;b++){var x=m[b],k=y[b];0==b?e.moveTo(x,k):e.lineTo(x,k)}e.closePath()}this.visuals.fill.apply(e,l,"evenodd"),this.visuals.hatch.apply(e,l,"evenodd"),this.visuals.line.apply(e,l)}}catch(Z){s.e(Z)}finally{s.f()}}}},{key:"_hit_rect",value:function(e){var t,n=e.sx0,i=e.sx1,r=e.sy0,a=e.sy1,o=[n,i,i,n],s=[r,r,a,a],l=this.renderer.xscale.r_invert(n,i),u=(0,k.Z)(l,2),c=u[0],h=u[1],_=this.renderer.yscale.r_invert(r,a),d=(0,k.Z)(_,2),v=d[0],p=d[1],m=this.index.indices({x0:c,x1:h,y0:v,y1:p}),g=[],b=(0,w.Z)(m);try{for(b.s();!(t=b.n()).done;){for(var x=t.value,Z=this.sxs[x],A=this.sys[x],S=!0,T=0,M=Z.length;T<M;T++){for(var C=0,z=Z[T][0].length;C<z;C++){var E=Z[T][0][C],R=A[T][0][C];if(!f.point_in_poly(E,R,o,s)){S=!1;break}}if(!S)break}S&&g.push(x)}}catch(B){b.e(B)}finally{b.f()}return new y.Selection({indices:g})}},{key:"_hit_point",value:function(e){var t,n=e.sx,i=e.sy,r=this.renderer.xscale.invert(n),a=this.renderer.yscale.invert(i),o=this.index.indices({x0:r,y0:a,x1:r,y1:a}),s=this._hole_index.indices({x0:r,y0:a,x1:r,y1:a}),l=[],u=(0,w.Z)(o);try{for(u.s();!(t=u.n()).done;)for(var c=t.value,h=this.sxs[c],_=this.sys[c],d=0,v=h.length;d<v;d++){var p=h[d].length;if(f.point_in_poly(n,i,h[d][0],_[d][0]))if(1==p)l.push(c);else if(s.get(c)){if(p>1){for(var m=!1,g=1;g<p;g++){var b=h[d][g],x=_[d][g];if(f.point_in_poly(n,i,b,x)){m=!0;break}}m||l.push(c)}}else l.push(c)}}catch(k){u.e(k)}finally{u.f()}return new y.Selection({indices:l})}},{key:"_get_snap_coord",value:function(e){return(0,_.sum)(e)/e.length}},{key:"scenterxy",value:function(e,t,n){if(1==this.sxs[e].length)return[this._get_snap_coord(this.sxs[e][0][0]),this._get_snap_coord(this.sys[e][0][0])];for(var i=this.sxs[e],r=this.sys[e],a=0,o=i.length;a<o;a++)if(f.point_in_poly(t,n,i[a][0],r[a][0]))return[this._get_snap_coord(i[a][0]),this._get_snap_coord(r[a][0])];(0,x.unreachable)()}},{key:"map_data",value:function(){var e=this._xs.length;this.sxs=new Array(e),this.sys=new Array(e);for(var t=0;t<e;t++){var n=this._xs[t].length;this.sxs[t]=new Array(n),this.sys[t]=new Array(n);for(var i=0;i<n;i++){var r=this._xs[t][i].length;this.sxs[t][i]=new Array(r),this.sys[t][i]=new Array(r);for(var a=0;a<r;a++){var o=this.renderer.coordinates.map_to_screen(this._xs[t][i][a],this._ys[t][i][a]),s=(0,k.Z)(o,2),l=s[0],u=s[1];this.sxs[t][i][a]=l,this.sys[t][i][a]=u}}}}},{key:"draw_legend_for_index",value:function(e,t,n){(0,c.generic_area_vector_legend)(this.visuals,e,t,n)}}]),n}(u.GlyphView);n.MultiPolygonsView=Z,Z.__name__="MultiPolygonsView";var A=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(u.Glyph);n.MultiPolygons=A,a=A,A.__name__="MultiPolygons",a.prototype.default_view=Z,a.define((function(e){return o(e),{xs:[m.XCoordinateSeqSeqSeqSpec,{field:"xs"}],ys:[m.YCoordinateSeqSeqSeqSpec,{field:"ys"}]}})),a.mixins([d.LineVector,d.FillVector,d.HatchVector])},function(e,t,n,i,r){var a;i();var o=e(274),s=e(12),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_map_data",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"_map_data",this).call(this),(0,s.mul)(this.sw,.75)}}]),n}(o.EllipseOvalView);n.OvalView=l,l.__name__="OvalView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.EllipseOval);n.Oval=u,a=u,u.__name__="Oval",a.prototype.default_view=l},function(e,t,n,i,r){i();var a,s=e(1),l=e(179),u=e(184),c=e(12),h=e(48),_=(0,s.__importStar)(e(185)),d=(0,s.__importStar)(e(18)),f=e(72),m=e(11),y=e(78),x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_project_data",value:function(){y.inplace.project_xy(this._xs.array,this._ys.array)}},{key:"_index_data",value:function(e){for(var t=this.data_size,n=0;n<t;n++){var i=this._xs.get(n),r=this._ys.get(n),a=(0,c.minmax2)(i,r),o=(0,k.Z)(a,4),s=o[0],l=o[1],u=o[2],h=o[3];e.add_rect(s,u,l,h)}}},{key:"_mask_data",value:function(){var e=this.renderer.plot_view.frame,t=e.x_range,n=e.y_range;return this.index.indices({x0:t.min,x1:t.max,y0:n.min,y1:n.max})}},{key:"_render",value:function(e,t,n){var i,r=null!=n?n:this,a=r.sxs,o=r.sys,s=(0,w.Z)(t);try{for(s.s();!(i=s.n()).done;){var l=i.value,u=a.get(l),c=o.get(l),h=!0;e.beginPath();for(var _=Math.min(u.length,c.length),d=0;d<_;d++){var f=u[d],v=c[d];isFinite(f+v)?h?(e.moveTo(f,v),h=!1):e.lineTo(f,v):(e.closePath(),h=!0)}
2e.closePath(),this.visuals.fill.apply(e,l),this.visuals.hatch.apply(e,l),this.visuals.line.apply(e,l)}}catch(p){s.e(p)}finally{s.f()}}},{key:"_hit_rect",value:function(e){var t,n=e.sx0,i=e.sx1,r=e.sy0,a=e.sy1,o=[n,i,i,n],s=[r,r,a,a],l=this.renderer.xscale.r_invert(n,i),u=(0,k.Z)(l,2),c=u[0],h=u[1],d=this.renderer.yscale.r_invert(r,a),v=(0,k.Z)(d,2),p=v[0],m=v[1],y=this.index.indices({x0:c,x1:h,y0:p,y1:m}),g=[],b=(0,w.Z)(y);try{for(b.s();!(t=b.n()).done;){for(var x=t.value,Z=this.sxs.get(x),A=this.sys.get(x),S=!0,T=0,M=Z.length;T<M;T++){var C=Z[T],z=A[T];if(!_.point_in_poly(C,z,o,s)){S=!1;break}}S&&g.push(x)}}catch(E){b.e(E)}finally{b.f()}return new f.Selection({indices:g})}},{key:"_hit_point",value:function(e){var t,n=e.sx,i=e.sy,r=this.renderer.xscale.invert(n),a=this.renderer.yscale.invert(i),o=this.index.indices({x0:r,y0:a,x1:r,y1:a}),s=[],l=(0,w.Z)(o);try{for(l.s();!(t=l.n()).done;)for(var u=t.value,c=this.sxs.get(u),h=this.sys.get(u),d=c.length,v=0,p=0;;p++){if(isNaN(c[p])||p==d){var m=c.subarray(v,p),y=h.subarray(v,p);if(_.point_in_poly(n,i,m,y)){s.push(u);break}v=p+1}if(p==d)break}}catch(g){l.e(g)}finally{l.f()}return new f.Selection({indices:s})}},{key:"_get_snap_coord",value:function(e){return(0,c.sum)(e)/e.length}},{key:"scenterxy",value:function(e,t,n){for(var i=this.sxs.get(e),r=this.sys.get(e),a=i.length,o=!1,s=0,l=0;;l++){var u=isNaN(i[l]);if(o=o||u,l==a&&!o)return[this._get_snap_coord(i),this._get_snap_coord(r)];if(u||l==a){var c=i.subarray(s,l),h=r.subarray(s,l);if(_.point_in_poly(t,n,c,h))return[this._get_snap_coord(c),this._get_snap_coord(h)];s=l+1}if(l==a)break}(0,m.unreachable)()}},{key:"draw_legend_for_index",value:function(e,t,n){(0,u.generic_area_vector_legend)(this.visuals,e,t,n)}}]),n}(l.GlyphView);n.PatchesView=x,x.__name__="PatchesView";var Z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.Glyph);n.Patches=Z,a=Z,Z.__name__="Patches",a.prototype.default_view=x,a.define((function(e){return o(e),{xs:[d.XCoordinateSeqSpec,{field:"xs"}],ys:[d.YCoordinateSeqSpec,{field:"ys"}]}})),a.mixins([h.LineVector,h.FillVector,h.HatchVector])},function(e,t,n,i,r){i();var a,s=e(1),l=e(277),u=(0,s.__importStar)(e(18)),c=function(t){(0,v.Z)(i,t);var n=(0,p.Z)(i);function i(){return(0,g.Z)(this,i),n.apply(this,arguments)}return(0,b.Z)(i,[{key:"lazy_initialize",value:function(){var t=(0,Z.Z)((0,x.Z)().mark((function t(){var n,r,a;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_.Z)((0,d.Z)(i.prototype),"lazy_initialize",this).call(this);case 2:if(null==(n=this.renderer.plot_view.canvas_view.webgl)||!n.regl_wrapper.has_webgl){t.next=9;break}return t.next=6,Promise.resolve().then((function(){return(0,s.__importStar)(e(427))}));case 6:r=t.sent,a=r.LRTBGL,this.glglyph=new a(n.regl_wrapper,this);case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"scenterxy",value:function(e){return[this.sleft[e]/2+this.sright[e]/2,this.stop[e]/2+this.sbottom[e]/2]}},{key:"_lrtb",value:function(e){return[this._left[e],this._right[e],this._top[e],this._bottom[e]]}}]),i}(l.BoxView);n.QuadView=c,c.__name__="QuadView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.Box);n.Quad=h,a=h,h.__name__="Quad",a.prototype.default_view=c,a.define((function(e){return o(e),{right:[u.XCoordinateSpec,{field:"right"}],bottom:[u.YCoordinateSpec,{field:"bottom"}],left:[u.XCoordinateSpec,{field:"left"}],top:[u.YCoordinateSpec,{field:"top"}]}}))},function(e,t,n,i,r){i();var a,s=e(1),l=e(48),u=e(78),c=e(179),h=e(184),_=(0,s.__importStar)(e(18));function d(e,t,n){if(t==(e+n)/2)return[e,n];var i=(e-t)/(e-2*t+n),r=e*Math.pow(1-i,2)+2*t*(1-i)*i+n*Math.pow(i,2);return[Math.min(e,n,r),Math.max(e,n,r)]}var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_project_data",value:function(){u.inplace.project_xy(this._x0,this._y0),u.inplace.project_xy(this._x1,this._y1)}},{key:"_index_data",value:function(e){for(var t=this._x0,n=this._x1,i=this._y0,r=this._y1,a=this._cx,o=this._cy,s=this.data_size,l=0;l<s;l++){var u=t[l],c=n[l],h=i[l],_=r[l],f=a[l],v=o[l];if(isFinite(u+c+h+_+f+v)){var p=d(u,f,c),m=(0,k.Z)(p,2),y=m[0],g=m[1],b=d(h,v,_),w=(0,k.Z)(b,2),x=w[0],Z=w[1];e.add_rect(y,x,g,Z)}else e.add_empty()}}}
2,{key:"_render",value:function(e,t,n){if(this.visuals.line.doit){var i,r=null!=n?n:this,a=r.sx0,o=r.sy0,s=r.sx1,l=r.sy1,u=r.scx,c=r.scy,h=(0,w.Z)(t);try{for(h.s();!(i=h.n()).done;){var _=i.value,d=a[_],f=o[_],v=s[_],p=l[_],m=u[_],y=c[_];isFinite(d+f+v+p+m+y)&&(e.beginPath(),e.moveTo(d,f),e.quadraticCurveTo(m,y,v,p),this.visuals.line.set_vectorize(e,_),e.stroke())}}catch(g){h.e(g)}finally{h.f()}}}},{key:"draw_legend_for_index",value:function(e,t,n){(0,h.generic_line_vector_legend)(this.visuals,e,t,n)}},{key:"scenterxy",value:function(){throw new Error("".concat(this,".scenterxy() is not implemented"))}}]),n}(c.GlyphView);n.QuadraticView=f,f.__name__="QuadraticView";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(c.Glyph);n.Quadratic=m,a=m,m.__name__="Quadratic",a.prototype.default_view=f,a.define((function(e){return o(e),{x0:[_.XCoordinateSpec,{field:"x0"}],y0:[_.YCoordinateSpec,{field:"y0"}],x1:[_.XCoordinateSpec,{field:"x1"}],y1:[_.YCoordinateSpec,{field:"y1"}],cx:[_.XCoordinateSpec,{field:"cx"}],cy:[_.YCoordinateSpec,{field:"cy"}]}})),a.mixins(l.LineVector)},function(e,t,n,i,r){i();var a,s=e(1),l=e(178),u=e(184),c=e(48),h=e(24),_=(0,s.__importStar)(e(18)),d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_map_data",value:function(){"data"==this.model.properties.length.units?this.slength=this.sdist(this.renderer.xscale,this._x,this.length):this.slength=(0,h.to_screen)(this.length);for(var e=this.renderer.plot_view.frame.bbox,t=2*(e.width+e.height),n=this.slength,i=0,r=n.length;i<r;i++)0==n[i]&&(n[i]=t)}},{key:"_render",value:function(e,t,n){var i=null!=n?n:this,r=i.sx,a=i.sy,o=i.slength,s=i.angle;if(this.visuals.line.doit){var l,u=(0,w.Z)(t);try{for(u.s();!(l=u.n()).done;){var c=l.value,h=r[c],_=a[c],d=s.get(c),f=o[c];isFinite(h+_+d+f)&&(e.translate(h,_),e.rotate(d),e.beginPath(),e.moveTo(0,0),e.lineTo(f,0),this.visual
2s.line.set_vectorize(e,c),e.stroke(),e.rotate(-d),e.translate(-h,-_))}}catch(v){u.e(v)}finally{u.f()}}}},{key:"draw_legend_for_index",value:function(e,t,n){(0,u.generic_line_vector_legend)(this.visuals,e,t,n)}}]),n}(l.XYGlyphView);n.RayView=d,d.__name__="RayView";var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.XYGlyph);n.Ray=f,a=f,f.__name__="Ray",a.prototype.default_view=d,a.mixins(c.LineVector),a.define((function(e){return o(e),{length:[_.DistanceSpec,0],angle:[_.AngleSpec,0]}}))},function(e,t,n,i,r){var a,o=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return s(t,e),t};i();var u=e(275),c=e(184),h=e(24),f=e(12),m=e(72),y=function(t){(0,v.Z)(i,t);var n=(0,p.Z)(i);function i(){return(0,g.Z)(this,i),n.apply(this,arguments)}return(0,b.Z)(i,[{key:"lazy_initialize",value:function(){var t=(0,Z.Z)((0,x.Z)().mark((function t(){var n,r,a;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_.Z)((0,d.Z)(i.prototype),"lazy_initialize",this).call(this);case 2:if(!(null==(n=this.renderer.plot_view.canvas_view.webgl)?void 0:n.regl_wrapper.has_webgl)){t.next=9;break}return t.next=6,Promise.resolve().then((function(){return l(e(429))}));case 6:r=t.sent,a=r.RectGL,this.glglyph=new a(n.regl_wrapper,this);case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_map_data",value:function(){if("data"==this.model.properties.width.units){var e=this._map_dist_corner_for_data_side_length(this._x,this.width,this.renderer.xscale),t=(0,k.Z)(e,2);this.sw=t[0],this.sx0=t[1]}else{this.sw=(0,h.to_screen)(this.width);var n=this.sx.length;this.sx0=new h.ScreenArray(n);for(var i=0;i<n;i++)this.sx0[i]=this.sx[i]-this.sw[i]/2}if("data"==this.model.properties.height.units){var r=this._map_dist_corner_for_data_side_length(this._y,this.height,this.renderer.yscale),a=(0,k.Z)(r,2);this.sh=a[0],this.sy1=a[1]}else{this.sh=(0,h.to_screen)(this.height);var o=this.sy.length;this.sy1=new h.ScreenArray(o);for(var s=0;s<o;s++)this.sy1[s]=this.sy[s]-this.sh[s]/2}var l=this.sw.length;this.ssemi_diag=new h.ScreenArray(l);for(var u=0;u<l;u++)this.ssemi_diag[u]=Math.sqrt(this.sw[u]/2*this.sw[u]/2+this.sh[u]/2*this.sh[u]/2)}},{key:"_render",value:function(e,t,n){var i,r=null!=n?n:this,a=r.sx,o=r.sy,s=r.sx0,l=r.sy1,u=r.sw,c=r.sh,h=r.angle,_=(0,w.Z)(t);try{for(_.s();!(i=_.n()).done;){var d=i.value,f=a[d],v=o[d],p=s[d],m=l[d],y=u[d],g=c[d],b=h.get(d);isFinite(f+v+p+m+y+g+b)&&0!=y&&0!=g&&(e.beginPath(),b?(e.translate(f,v),e.rotate(b),e.rect(-y/2,-g/2,y,g),e.rotate(-b),e.translate(-f,-v)):e.rect(p,m,y,g),this.visual
2s.fill.apply(e,d),this.visuals.hatch.apply(e,d),this.visuals.line.apply(e,d))}}catch(x){_.e(x)}finally{_.f()}}},{key:"_hit_rect",value:function(e){return this._hit_rect_against_index(e)}},{key:"_hit_point",value:function(e){for(var t=e.sx,n=e.sy,i=this.renderer.xscale.invert(t),r=this.renderer.yscale.invert(n),a=this.sx0.length,o=new h.ScreenArray(a),s=0;s<a;s++)o[s]=this.sx0[s]+this.sw[s]/2;for(var l=new h.ScreenArray(a),u=0;u<a;u++)l[u]=this.sy1[u]+this.sh[u]/2;var c,_,d,v=(0,f.max)(this._ddist(0,o,this.ssemi_diag)),p=(0,f.max)(this._ddist(1,l,this.ssemi_diag)),y=i-v,g=i+v,b=r-p,x=r+p,k=[],Z=(0,w.Z)(this.index.indices({x0:y,x1:g,y0:b,y1:x}));try{for(Z.s();!(d=Z.n()).done;){var A=d.value,S=this.angle.get(A);if(S){var T=Math.sin(-S),M=Math.cos(-S),C=M*(t-this.sx[A])-T*(n-this.sy[A])+this.sx[A],z=T*(t-this.sx[A])+M*(n-this.sy[A])+this.sy[A];t=C,n=z,c=Math.abs(this.sx[A]-t)<=this.sw[A]/2,_=Math.abs(this.sy[A]-n)<=this.sh[A]/2}else{var E=t-this.sx0[A],R=n-this.sy1[A];c=0<=E&&E<=this.sw[A],_=0<=R&&R<=this.sh[A]}c&&_&&k.push(A)}}catch(B){Z.e(B)}finally{Z.f()}return new m.Selection({indices:k})}},{key:"_map_dist_corner_for_data_side_length",value:function(e,t,n){for(var i=e.length,r=new Float64Array(i),a=new Float64Array(i),o=0;o<i;o++){var s=e[o],l=t.get(o)/2;r[o]=s-l,a[o]=s+l}for(var u=n.v_compute(r),c=n.v_compute(a),h=this.sdist(n,r,t,"edge",this.model.dilate),_=u,d=0;d<i;d++){var f=u[d],v=c[d];if(!isNaN(f+v)&&f!=v){_=f<v?u:c;break}}return[h,_]}},{key:"_ddist",value:function(e,t,n){for(var i=(0,h.infer_type)(t,n),r=0==e?this.renderer.xscale:this.renderer.yscale,a=t,o=a.length,s=new i(o),l=0;l<o;l++)s[l]=a[l]+n[l];for(var u=r.v_invert(a),c=r.v_invert(s),_=u.length,d=new i(_),f=0;f<_;f++)d[f]=Math.abs(c[f]-u[f]);return d}},{key:"draw_legend_for_index",value:function(e,t,n){(0,c.generic_area_vector_legend)(this.visuals,e,t,n)}}]),i}(u.CenterRotatableView);n.RectView=y,y.__name__="RectView";var A=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(u.CenterRotatable);n.Rect=A,a=A,A.__name__="Rect",a.prototype.default_view=y,a.define((function(e){return{dilate:[e.Boolean,!1]}}))},function(e,t,n,i,r){i();var a,o=e(1),s=e(292),l=e(293),u=(0,o.__importStar)(e(18)),c=function(t){(0,v.Z)(i,t);var n=(0,p.Z)(i);function i(){return(0,g.Z)(this,i),n.apply(this,arguments)}return(0,b.Z)(i,[{key:"lazy_initialize",value:function(){var t=(0,Z.Z)((0,x.Z)().mark((function t(){var n,r,a;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_.Z)((0,d.Z)(i.prototype),"lazy_initialize",this).call(this);case 2:if(null==(n=this.renderer.plot_view.canvas_view.webgl)||!n.regl_wrapper.has_webgl){t.next=9;break}return t.next=6,Promise.resolve().then((function(){return(0,o.__importStar)(e(428))}));case 6:r=t.sent,a=r.MultiMarkerGL,this.glglyph=new a(n.regl_wrapper,this);case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_render",value:function(e,t,n){var i,r=null!=n?n:this,a=r.sx,o=r.sy,s=r.size,u=r.angle,c=r.marker,h=(0,w.Z)(t);try{for(h.s();!(i=h.n()).done;){var _=i.value,d=a[_],f=o[_],v=s.get(_),p=u.get(_),m=c.get(_);if(isFinite(d+f+v+p)&&null!=m){var y=v/2;e.beginPath(),e.translate(d,f),p&&e.rotate(p),l.marker_funcs[m](e,_,y,this.visual
2s),p&&e.rotate(-p),e.translate(-d,-f)}}}catch(g){h.e(g)}finally{h.f()}}},{key:"draw_legend_for_index",value:function(e,t,n){var i=t.x0,r=t.x1,a=t.y0,o=t.y1,s=n+1,l=this.marker.get(n),c=Object.assign(Object.assign({},this._get_legend_args({x0:i,x1:r,y0:a,y1:o},n)),{marker:new u.UniformScalar(l,s)});this._render(e,[n],c)}}]),i}(s.MarkerView);n.ScatterView=c,c.__name__="ScatterView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.Marker);n.Scatter=h,a=h,h.__name__="Scatter",a.prototype.default_view=c,a.define((function(){return{marker:[u.MarkerSpec,{value:"circle"}]}}))},function(e,t,n,i,r){i();var a,o=e(1),s=e(178),l=e(48),u=(0,o.__importStar)(e(185)),c=(0,o.__importStar)(e(18)),h=e(9),_=e(72),d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_render",value:function(e,t,n){var i,r=null!=n?n:this,a=r.sx,o=r.sy,s=r.size,l=r.angle,u=(0,w.Z)(t);try{for(u.s();!(i=u.n()).done;){var c=i.value,h=a[c],_=o[c],d=s.get(c),f=l.get(c);if(isFinite(h+_+d+f)){var v=d/2;e.beginPath(),e.translate(h,_),f&&e.rotate(f),this._render_one(e,c,v,this.visuals),f&&e.rotate(-f),e.translate(-h,-_)}}}catch(p){u.e(p)}finally{u.f()}}},{key:"_mask_data",value:function(){var e=this,t=this.renderer.plot_view.frame,n=t.x_target,i=t.y_target,r=n.widen(this.max_size).map((function(t){return e.renderer.xscale.invert(t)})),a=i.widen(this.max_size).map((function(t){return e.renderer.yscale.invert(t)}));return this.index.indices({x0:r.start,x1:r.end,y0:a.start,y1:a.end})}},{key:"_hit_point",value:function(e){var t,n=e.sx,i=e.sy,r=this.max_size,a=this.model.hit_dilation,o=n-r*a,s=n+r*a,l=this.renderer.xscale.r_invert(o,s),u=(0,k.Z)(l,2),c=u[0],h=u[1],d=i-r*a,f=i+r*a,v=this.renderer.yscale.r_invert(d,f),p=(0,k.Z)(v,2),m=p[0],y=p[1],g=this.index.indices({x0:c,x1:h,y0:m,y1:y}),b=[],x=(0,w.Z)(g);try{for(x.s();!(t=x.n()).done;){var Z=t.value,A=this.size.get(Z)/2*a;Math.abs(this.sx[Z]-n)<=A&&Math.abs(this.sy[Z]-i)<=A&&b.push(Z)}}catch(S){x.e(S)}finally{x.f()}return new _.Selection({indices:b})}},{key:"_hit_span",value:function(e){var t,n,i,r,a=e.sx,o=e.sy,s=this.bounds(),l=this.max_size/2;if("h"==e.direction){i=s.y0,r=s.y1;var u=a-l,c=a+l,h=this.renderer.xscale.r_invert(u,c),d=(0,k.Z)(h,2);t=d[0],n=d[1]}else{t=s.x0,n=s.x1;var f=o-l,v=o+l,p=this.renderer.yscale.r_invert(f,v),m=(0,k.Z)(p,2);i=m[0],r=m[1]}var g=(0,y.Z)(this.index.indices({x0:t,x1:n,y0:i,y1:r}));return new _.Selection({indices:g})}},{key:"_hit_rect",value:function(e){var t=e.sx0,n=e.sx1,i=e.sy0,r=e.sy1,a=this.renderer.xscale.r_invert(t,n),o=(0,k.Z)(a,2),s=o[0],l=o[1],u=this.renderer.yscale.r_invert(i,r),c=(0,k.Z)(u,2),h=c[0],d=c[1],f=(0,y.Z)(this.index.indices({x0:s,x1:l,y0:h,y1:d}));return new _.Selection({indices:f})}},{key:"_hit_poly",value:function(e){for(var t=e.sx,n=e.sy,i=(0,h.range)(0,this.sx.length),r=[],a=0,o=i.length;a<o;a++){var s=i[a];u.point_in_poly(this.sx[a],this.sy[a],t,n)&&r.push(s)}return new _.Selection({indices:r})}},{key:"_get_legend_args",value:function(e,t){var n=e.x0,i=e.x1,r=e.y0,a=e.y1,o=t+1,s=new Array(o),l=new Array(o);s[t]=(n+i)/2,l[t]=(r+a)/2;var u=.4*Math.min(Math.abs(i-n),Math.abs(a-r));return{sx:s,sy:l,size:new c.UniformScalar(u,o),angle:new c.UniformScalar(0,o)}}},{key:"draw_legend_for_index",value:function(e,t,n){var i=t.x0,r=t.x1,a=t.y0,o=t.y1,s=this._get_legend_args({x0:i,x1:r,y0:a,y1:o},n);this._render(e,[n],s)}}]),n}(s.XYGlyphView);n.MarkerView=d,d.__name__="MarkerView";var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.XYGlyph);n.Marker=f,a=f,f.__name__="Marker",a.mixins([l.LineVector,l.FillVector,l.HatchVector]),a.define((function(e){var t=e.Number;return{size:[c.ScreenSizeSpec,{value:4}],angle:[c.AngleSpec,0],hit_dilation:[t,1]}}))},function(e,t,n,i,r){i();var a=Math.sqrt(3),o=Math.sqrt(5),s=(o+1)/4,l=Math.sqrt((5-o)/8),u=(o-1)/4,c=Math.sqrt((5+o)/8);function h(e,t){e.rotate(Math.PI/4),d(e,t),e.rotate(-Math.PI/4)}function _(e,t){var n=t*a,i=n/3;e.moveTo(-n/2,-i),e.lineTo(0,0),e.lineTo(n/2,-i),e.lineTo(0,0),e.lineTo(0,t)}function d(e,t){e.moveTo(0,t),e.lineTo(0,-t),e.moveTo(-t,0),e.lineTo(t,0)}function f(e,t){e.moveTo(0,t),e.lineTo(t/1.5,0),e.lineTo(0,-t),e.lineTo(-t/1.5,0),e.closePath()}function v(e,t){var n=t*a,i=n/3;e.moveTo(-t,i),e.lineTo(t,i),e.lineTo(0,i-n),e.closePath()}function p(e,t,n,i){e.arc(0,0,n,0,2*Math.PI,!1),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.apply(e,t)}function m(e,t,n,i){f(e,n),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.apply(e,t)}function y(e,t,n,i){!function(e,t){e.beginPath(),e.arc(0,0,t/4,0,2*Math.PI,!1),e.closePath()}(e,n),i.line.set_vectorize(e,t),e.fillStyle=e.strokeStyle,e.fill()}function g(e,t,n,i){!function(e,t){var n=t/2,i=a*n;e.moveTo(t,0),e.lineTo(n,-i),e.lineTo(-n,-i),e.lineTo(-t,0),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}(e,n),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.apply(e,t)}function b(e,t,n,i){var r=2*n;e.rect(-n,-n,r,r),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.apply(e,t)}function w(e,t,n,i){!function(e,t){var n=Math.sqrt(5-2*o)*t;e.moveTo(0,-t),e.lineTo(n*u,n*c-t),e.lineTo(n*(1+u),n*c-t),e.lineTo(n*(1+u-s),n*(c+l)-t),e.lineTo(n*(1+2*u-s),n*(2*c+l)-t),e.lineTo(0,2*n*c-t),e.lineTo(-n*(1+2*u-s),n*(2*c+l)-t),e.lineTo(-n*(1+u-s),n*(c+l)-t),e.lineTo(-n*(1+u),n*c-t),e.lineTo(-n*u,n*c-t),e.closePath()}(e,n),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.apply(e,t)}function x(e,t,n,i){v(e,n),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.apply(e,t)}n.marker_funcs={asterisk:function(e,t,n,i){d(e,n),h(e,n),i.line.apply(e,t)},circle:p,circle_cross:function(e,t,n,i){e.arc(0,0,n,0,2*Math.PI,!1),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.doit&&(i.line.set_vectorize(e,t),d(e,n),e.stroke())},circle_dot:function(e,t,n,i){p(e,t,n,i),y(e,t,n,i)},circle_y:function(e,t,n,i){e.arc(0,0,n,0,2*Math.PI,!1),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.doit&&(i.line.set_vectorize(e,t),_(e,n),e.stroke())},circle_x:function(e,t,n,i){e.arc(0,0,n,0,2*Math.PI,!1),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.doit&&(i.line.set_vectorize(e,t),h(e,n),e.stroke())},cross:function(e,t,n,i){d(e,n),i.line.apply(e,t)},diamond:m,diamond_dot:function(e,t,n,i){m(e,t,n,i),y(e,t,n,i)},diamond_cross:function(e,t,n,i){f(e,n),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.doit&&(i.line.set_vectorize(e,t),e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-n/1.5,0),e.lineTo(n/1.5,0),e.stroke())},dot:y,hex:g,hex_dot:function(e,t,n,i){g(e,t,n,i),y(e,t,n,i)},inverted_triangle:function(e,t,n,i){e.rotate(Math.PI),v(e,n),e.rotate(-Math.PI),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.apply(e,t)},plus:function(e,t,n,i){var r=3*n/8,a=[r,r,n,n,r,r,-r,-r,-n,-n,-r,-r],o=[n,r,r,-r,-r,-n,-n,-r,-r,r,r,n];e.beginPath();for(var s=0;s<12;s++)e.lineTo(a[s],o[s]);e.closePath(),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.apply(e,t)},square:b,square_cross:function(e,t,n,i){var r=2*n;e.rect(-n,-n,r,r),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.doit&&(i.line.set_vectorize(e,t),d(e,n),e.stroke())},square_dot:function(e,t,n,i){b(e,t,n,i),y(e,t,n,i)},square_pin:function(e,t,n,i){var r=3*n/8;e.moveTo(-n,-n),e.quadraticCurveTo(0,-r,n,-n),e.quadraticCurveTo(r,0,n,n),e.quadraticCurveTo(0,r,-n,n),e.quadraticCurveTo(-r,0,-n,-n),e.closePath(),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.apply(e,t)},square_x:function(e,t,n,i){var r=2*n;e.rect(-n,-n,r,r),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.doit&&(i.line.set_vectorize(e,t),e.moveTo(-n,n),e.lineTo(n,-n),e.moveTo(-n,-n),e.lineTo(n,n),e.stroke())},star:w,star_dot:function(e,t,n,i){w(e,t,n,i),y(e,t,n,i)},triangle:x,triangle_dot:function(e,t,n,i){x(e,t,n,i),y(e,t,n,i)},triangle_pin:function(e,t,n,i){var r=n*a,o=r/3,s=3*o/8;e.moveTo(-n,o),e.quadraticCurveTo(0,s,n,o),e.quadraticCurveTo(a*s/2,s/2,0,o-r),e.quadraticCurveTo(-a*s/2,s/2,-n,o),e.closePath(),i.fill.apply(e,t),i.hatch.apply(e,t),i.line.apply(e,t)},dash:function(e,t,n,i){!function(e,t){e.moveTo(-t,0),e.lineTo(t,0)}
2(e,n),i.line.apply(e,t)},x:function(e,t,n,i){h(e,n),i.line.apply(e,t)},y:function(e,t,n,i){_(e,n),i.line.apply(e,t)}}},function(e,t,n,i,r){i();var a,s=e(1),l=(0,s.__importStar)(e(185)),u=(0,s.__importStar)(e(18)),c=e(48),h=e(78),_=e(179),d=e(184),f=e(72),m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_project_data",value:function(){h.inplace.project_xy(this._x0,this._y0),h.inplace.project_xy(this._x1,this._y1)}},{key:"_index_data",value:function(e){for(var t=Math.min,n=Math.max,i=this._x0,r=this._x1,a=this._y0,o=this._y1,s=this.data_size,l=0;l<s;l++){var u=i[l],c=r[l],h=a[l],_=o[l];e.add_rect(t(u,c),t(h,_),n(u,c),n(h,_))}}},{key:"_render",value:function(e,t,n){if(this.visuals.line.doit){var i,r=null!=n?n:this,a=r.sx0,o=r.sy0,s=r.sx1,l=r.sy1,u=(0,w.Z)(t);try{for(u.s();!(i=u.n()).done;){var c=i.value,h=a[c],_=o[c],d=s[c],f=l[c];isFinite(h+_+d+f)&&(e.beginPath(),e.moveTo(h,_),e.lineTo(d,f),this.visuals.line.set_vectorize(e,c),e.stroke())}}catch(v){u.e(v)}finally{u.f()}}}},{key:"_hit_point",value:function(e){var t,n=e.sx,i=e.sy,r={x:n,y:i},a=this.renderer.xscale.r_invert(n-2,n+2),o=(0,k.Z)(a,2),s=o[0],u=o[1],c=this.renderer.yscale.r_invert(i-2,i+2),h=(0,k.Z)(c,2),_=h[0],d=h[1],v=this.index.indices({x0:s,y0:_,x1:u,y1:d}),p=[],m=(0,w.Z)(v);try{for(m.s();!(t=m.n()).done;){var y=t.value,g=Math.pow(Math.max(2,this.line_width.get(y)/2),2),b={x:this.sx0[y],y:this.sy0[y]},x={x:this.sx1[y],y:this.sy1[y]};l.dist_to_segment_squared(r,b,x)<g&&p.push(y)}}catch(Z){m.e(Z)}finally{m.f()}return new f.Selection({indices:p})}},{key:"_hit_span",value:function(e){var t,n,i,r,a,o=(0,k.Z)(this.renderer.plot_view.frame.bbox.ranges,2),s=o[0],l=o[1],u=e.sx,c=e.sy;"v"==e.direction?(a=this.renderer.yscale.invert(c),i=(t=[this._y0,this._y1])[0],r=t[1]):(a=this.renderer.xscale.invert(u),i=(n=[this._x0,this._x1])[0],r=n[1]);var h,_=[],d=this.renderer.xscale.r_invert(s.start,s.end),v=(0,k.Z)(d,2),p=v[0],m=v[1],y=this.renderer.yscale.r_invert(l.start,l.end),g=(0,k.Z)(y,2),b=g[0],x=g[1],Z=this.index.indices({x0:p,y0:b,x1:m,y1:x}),A=(0,w.Z)(Z);try{for(A.s();!(h=A.n()).done;){var S=h.value;(i[S]<=a&&a<=r[S]||r[S]<=a&&a<=i[S])&&_.push(S);var T=1.5+this.line_width.get(S)/2;i[S]==r[S]&&("h"==e.direction?Math.abs(this.sx0[S]-u)<=T&&_.push(S):Math.abs(this.sy0[S]-c)<=T&&_.push(S))}}catch(M){A.e(M)}finally{A.f()}return new f.Selection({indices:_})}},{key:"scenterxy",value:function(e){return[this.sx0[e]/2+this.sx1[e]/2,this.sy0[e]/2+this.sy1[e]/2]}},{key:"draw_legend_for_index",value:function(e,t,n){(0,d.generic_line_vector_legend)(this.visuals,e,t,n)}}]),n}(_.GlyphView);n.SegmentView=m,m.__name__="SegmentView";var y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(_.Glyph);n.Segment=y,a=y,y.__name__="Segment",a.prototype.default_view=m,a.define((function(e){return o(e),{x0:[u.XCoordinateSpec,{field:"x0"}],y0:[u.YCoordinateSpec,{field:"y0"}],x1:[u.XCoordinateSpec,{field:"x1"}],y1:[u.YCoordinateSpec,{field:"y1"}]}})),a.mixins(c.LineVector)},function(e,t,n,i,r){i();var a,o=e(1),s=e(178),l=(0,o.__importStar)(e(48)),u=e(296),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_set_data",value:function(){var e=this.model,t=e.tension,n=e.closed,i=(0,u.catmullrom_spline)(this._x,this._y,20,t,n),r=(0,k.Z)(i,2);this._xt=r[0],this._yt=r[1]}},{key:"_map_data",value:function(){var e=this.renderer.coordinates,t=e.x_scale,n=e.y_scale;this.sxt=t.v_compute(this._xt),this.syt=n.v_compute(this._yt)}},{key:"_render",value:function(e,t,n){var i=null!=n?n:this,r=i.sxt,a=i.syt,o=!0;e.beginPath();for(var s=r.length,l=0;l<s;l++){var u=r[l],c=a[l];isFinite(u+c)?o?(e.moveTo(u,c),o=!1):e.lineTo(u,c):o=!0}this.visuals.line.set_value(e),e.stroke()}}]),n}(s.XYGlyphView);n.SplineView=c,c.__name__="SplineView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.XYGlyph);n.Spline=h,a=h,h.__name__="Spline",a.prototype.default_view=c,a.mixins(l.LineScalar),a.define((function(e){var t=e.Boolean;return{tension:[e.Number,.5],closed:[t,!1]}}))},function(e,t,n,i,r){i();var a=e(24),o=e(11);n.catmullrom_spline=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];(0,o.assert)(e.length==t.length);var s=e.length,l=r?s+1:s,u=(0,a.infer_type)(e,t),c=new u(l+2),h=new u(l+2);c.set(e,1),h.set(t,1),r?(c[0]=e[s-1],h[0]=t[s-1],c[l]=e[0],h[l]=t[0],c[l+1]=e[1],h[l+1]=t[1]):(c[0]=e[0],h[0]=t[0],c[l+1]=e[s-1],h[l+1]=t[s-1]);for(var _=new u(4*(n+1)),d=0,f=0;d<=n;d++){var v=d/n,p=Math.pow(v,2),m=v*p;_[f++]=2*m-3*p+1,_[f++]=-2*m+3*p,_[f++]=m-2*p+v,_[f++]=m-p}for(var y=new u((l-1)*(n+1)),g=new u((l-1)*(n+1)),b=1,w=0;b<l;b++)for(var x=(c[b+1]-c[b-1])*i,k=(h[b+1]-h[b-1])*i,Z=(c[b+2]-c[b])*i,A=(h[b+2]-h[b])*i,S=0;S<=4*n;w++){var T=_[S++],M=_[S++],C=_[S++],z=_[S++];y[w]=T*c[b]+M*c[b+1]+C*x+z*Z,g[w]=T*h[b]+M*h[b+1]+C*k+z*A}return[y,g]}},function(e,t,n,i,r){i();var a,o=e(1),s=e(178),l=e(184),u=(0,o.__importStar)(e(48)),c=e(20),h=e(11),_=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_render",value:function(e,t,n){var i,r,a,o,s=null!=n?n:this,l=s.sx,u=s.sy,c=!1,_=null;
2this.visuals.line.set_value(e);var d=t.length;if(!(d<2)){e.beginPath(),e.moveTo(l[0],u[0]);var f,v=(0,w.Z)(t);try{for(v.s();!(f=v.n()).done;){var p=f.value,m=void 0,y=void 0,g=void 0,b=void 0;switch(this.model.mode){case"before":m=(i=[l[p-1],u[p]])[0],g=i[1],y=(r=[l[p],u[p]])[0],b=r[1];break;case"after":m=(a=[l[p],u[p-1]])[0],g=a[1],y=(o=[l[p],u[p]])[0],b=o[1];break;case"center":var x,k,Z=(l[p-1]+l[p])/2;m=(x=[Z,u[p-1]])[0],g=x[1],y=(k=[Z,u[p]])[0],b=k[1];break;default:(0,h.unreachable)()}if(c){if(!isFinite(l[p]+u[p])){e.stroke(),e.beginPath(),c=!1,_=p;continue}null!=_&&p-_>1&&(e.stroke(),c=!1)}c?(e.lineTo(m,g),e.lineTo(y,b)):(e.beginPath(),e.moveTo(l[p],u[p]),c=!0),_=p}}catch(A){v.e(A)}finally{v.f()}e.lineTo(l[d-1],u[d-1]),e.stroke()}}},{key:"draw_legend_for_index",value:function(e,t,n){(0,l.generic_line_scalar_legend)(this.visuals,e,t)}}]),n}(s.XYGlyphView);n.StepView=_,_.__name__="StepView";var d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.XYGlyph);n.Step=d,a=d,d.__name__="Step",a.prototype.default_view=_,a.mixins(u.LineScalar),a.define((function(){return{mode:[c.StepMode,"before"]}}))},function(e,t,n,i,r){i();var a,s=e(1),l=e(178),u=e(48),c=(0,s.__importStar)(e(185)),h=(0,s.__importStar)(e(18)),_=e(121),d=e(11),f=e(72),m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_rotate_point",value:function(e,t,n,i,r){return[(e-n)*Math.cos(r)-(t-i)*Math.sin(r)+n,(e-n)*Math.sin(r)+(t-i)*Math.cos(r)+i]}},{key:"_text_bounds",value:function(e,t,n,i){return[[e,e+n,e+n,e,e],[t,t,t-i,t-i,t]]}},{key:"_render",value:function(e,t,n){var i=null!=n?n:this,r=i.sx,a=i.sy,o=i.x_offset,s=i.y_offset,l=i.angle,u=i.text;this._sys=[],this._sxs=[];var c,h=(0,w.Z)(t);try{for(h.s();!(c=h.n()).done;){var d=c.value,f=this._sxs[d]=[],v=this._sys[d]=[],p=r[d],m=a[d],y=o.get(d),g=s.get(d),b=l.get(d),x=u.get(d);
2if(isFinite(p+m+y+g+b)&&null!=x&&this.visuals.text.doit){var Z="".concat(x);e.save(),e.translate(p+y,m+g),e.rotate(b),this.visuals.text.set_vectorize(e,d);var A=this.visuals.text.font_value(d),S=(0,_.font_metrics)(A).height,T=this.text_line_height.get(d)*S;if(-1==Z.indexOf("\n")){e.fillText(Z,0,0);var M=p+y,C=m+g,z=e.measureText(Z).width,E=this._text_bounds(M,C,z,T),R=(0,k.Z)(E,2),B=R[0],N=R[1];f.push(B),v.push(N)}else{var O=Z.split("\n"),D=T*O.length,I=this.text_baseline.get(d),P=void 0;switch(I){case"top":P=0;break;case"middle":P=-D/2+T/2;break;case"bottom":P=-D+T;break;default:P=0,console.warn("'".concat(I,"' baseline not supported with multi line text"))}var V,L=(0,w.Z)(O);try{for(L.s();!(V=L.n()).done;){var j=V.value;e.fillText(j,0,P);var U=p+y,F=P+m+g,G=e.measureText(j).width,H=this._text_bounds(U,F,G,T),Y=(0,k.Z)(H,2),J=Y[0],W=Y[1];f.push(J),v.push(W),P+=T}}catch(q){L.e(q)}finally{L.f()}}e.restore()}}}catch(q){h.e(q)}finally{h.f()}}},{key:"_hit_point",value:function(e){for(var t=e.sx,n=e.sy,i=[],r=0;r<this._sxs.length;r++)for(var a=this._sxs[r],o=this._sys[r],s=a.length,l=0,u=s;l<u;l++){var h=this._rotate_point(t,n,a[s-1][0],o[s-1][0],-this.angle.get(r)),_=(0,k.Z)(h,2),d=_[0],v=_[1];c.point_in_poly(d,v,a[l],o[l])&&i.push(r)}return new f.Selection({indices:i})}},{key:"scenterxy",value:function(e){var t=this._sxs[e],n=this._sys[e];(0,d.assert)(0!=t.length&&0!=n.length);var i=t[0][0],r=n[0][0],a=(t[0][2]+i)/2,o=(n[0][2]+r)/2,s=this._rotate_point(a,o,i,r,this.angle.get(e)),l=(0,k.Z)(s,2);return[l[0],l[1]]}}]),n}(l.XYGlyphView);n.TextView=m,m.__name__="TextView";var y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.XYGlyph);n.Text=y,a=y,y.__name__="Text",a.prototype.default_view=m,a.mixins(u.TextVector),a.define((function(e){return o(e),{text:[h.NullStringSpec,{field:"text"}],angle:[h.AngleSpec,0],x_offset:[h.NumberSpec,0],y_offset:[h.NumberSpec,0]}}))},function(e,t,n,i,r){i();var a,s=e(1),l=e(277),u=e(24),c=(0,s.__importStar)(e(18)),h=function(t){(0,v.Z)(i,t);var n=(0,p.Z)(i);function i(){return(0,g.Z)(this,i),n.apply(this,arguments)}return(0,b.Z)(i,[{key:"lazy_initialize",value:function(){var t=(0,Z.Z)((0,x.Z)().mark((function t(){var n,r,a;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_.Z)((0,d.Z)(i.prototype),"lazy_initialize",this).call(this);case 2:if(null==(n=this.renderer.plot_view.canvas_view.webgl)||!n.regl_wrapper.has_webgl){t.next=9;break}return t.next=6,Promise.resolve().then((function(){return(0,s.__importStar)(e(427))}));case 6:r=t.sent,a=r.LRTBGL,this.glglyph=new a(n.regl_wrapper,this);case 9:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"scenterxy",value:function(e){return[this.sx[e],(this.stop[e]+this.sbottom[e])/2]}},{key:"_lrtb",value:function(e){var t=this.width.get(e)/2,n=this._x[e],i=this._top[e],r=this._bottom[e];return[n-t,n+t,Math.max(i,r),Math.min(i,r)]}},{key:"_map_data",value: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 e=this.sx.length;this.sleft=new u.ScreenArray(e),this.sright=new u.ScreenArray(e);for(var t=0;t<e;t++)this.sleft[t]=this.sx[t]-this.sw[t]/2,this.sright[t]=this.sx[t]+this.sw[t]/2;this._clamp_viewport()}}]),i}(l.BoxView);n.VBarView=h,h.__name__="VBarView";var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.Box);n.VBar=f,a=f,f.__name__="VBar",a.prototype.default_view=h,a.define((function(e){return o(e),{x:[c.XCoordinateSpec,{field:"x"}],bottom:[c.YCoordinateSpec,{value:0}],width:[c.NumberSpec,{value:1}],top:[c.YCoordinateSpec,{field:"top"}]}}))},function(e,t,n,i,r){i();var a,s=e(1),l=e(178),u=e(184),c=e(48),h=e(24),_=e(20),d=(0,s.__importStar)(e(18)),f=e(10),m=e(72),y=e(12),x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_map_data",value:function(){"data"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this.radius):this.sradius=(0,h.to_screen)(this.radius),this.max_sradius=(0,y.max)(this.sradius)}},{key:"_render",value:function(e,t,n){var i,r=null!=n?n:this,a=r.sx,o=r.sy,s=r.sradius,l=r.start_angle,u=r.end_angle,c="anticlock"==this.model.direction,h=(0,w.Z)(t);try{for(h.s();!(i=h.n()).done;){var _=i.value,d=a[_],f=o[_],v=s[_],p=l.get(_),m=u.get(_);isFinite(d+f+v+p+m)&&(e.beginPath(),e.arc(d,f,v,p,m,c),e.lineTo(d,f),e.closePath(),this.visual
2s.fill.apply(e,_),this.visuals.hatch.apply(e,_),this.visuals.line.apply(e,_))}}catch(y){h.e(y)}finally{h.f()}}},{key:"_hit_point",value:function(e){var t,n,i,r,a=e.sx,o=e.sy,s=this.renderer.xscale.invert(a),l=this.renderer.yscale.invert(o);t=a-this.max_sradius,n=a+this.max_sradius;var u=this.renderer.xscale.r_invert(t,n),c=(0,k.Z)(u,2),h=c[0],_=c[1];i=o-this.max_sradius,r=o+this.max_sradius;var d,v=this.renderer.yscale.r_invert(i,r),p=(0,k.Z)(v,2),y=p[0],g=p[1],b=[],x=(0,w.Z)(this.index.indices({x0:h,x1:_,y0:y,y1:g}));try{for(x.s();!(d=x.n()).done;){var Z,A,S,T,M=d.value,C=Math.pow(this.sradius[M],2);Z=this.renderer.xscale.r_compute(s,this._x[M]),t=(A=(0,k.Z)(Z,2))[0],n=A[1],S=this.renderer.yscale.r_compute(l,this._y[M]),i=(T=(0,k.Z)(S,2))[0],r=T[1],Math.pow(t-n,2)+Math.pow(i-r,2)<=C&&b.push(M)}}catch(D){x.e(D)}finally{x.f()}for(var z="anticlock"==this.model.direction,E=[],R=0,B=b;R<B.length;R++){var N=B[R],O=Math.atan2(o-this.sy[N],a-this.sx[N]);(0,f.angle_between)(-O,-this.start_angle.get(N),-this.end_angle.get(N),z)&&E.push(N)}return new m.Selection({indices:E})}},{key:"draw_legend_for_index",value:function(e,t,n){(0,u.generic_area_vector_legend)(this.visuals,e,t,n)}},{key:"scenterxy",value:function(e){var t=this.sradius[e]/2,n=(this.start_angle.get(e)+this.end_angle.get(e))/2;return[this.sx[e]+t*Math.cos(n),this.sy[e]+t*Math.sin(n)]}}]),n}(l.XYGlyphView);n.WedgeView=x,x.__name__="WedgeView";var Z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(l.XYGlyph);n.Wedge=Z,a=Z,Z.__name__="Wedge",a.prototype.default_view=x,a.mixins([c.LineVector,c.FillVector,c.HatchVector]),a.define((function(e){return o(e),{direction:[_.Direction,"anticlock"],radius:[d.DistanceSpec,{field:"radius"}],start_angle:[d.AngleSpec,{field:"start_angle"}],end_angle:[d.AngleSpec,{field:"end_angle"}]}}))},function(e,t,n,i,r){i();var a=e(1);(0,a.__exportStar)(e(302),n),(0,a.__exportStar)(e(303),n),(0,a.__exportStar)(e(304),n)},function(e,t,n,i,r){i();var a=e(53),o=e(12),s=e(9),l=e(72),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_hit_test",value:function(e,t,n){if(!t.model.visible)return null;var i=n.glyph.hit_test(e);return null==i?null:n.model.view.convert_selection_from_subset(i)}}]),n}(a.Model);n.GraphHitTestPolicy=u,u.__name__="GraphHitTestPolicy";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"hit_test",value:function(e,t){return this._hit_test(e,t,t.edge_view)}},{key:"do_selection",value:function(e,t,n,i){if(null==e)return!1;var r=t.edge_renderer.data_source.selected;return r.update(e,n,i),t.edge_renderer.data_source._select.emit(),!r.is_empty()}},{key:"do_inspection",value:function(e,t,n,i,r){if(null==e)return!1;var a=n.model.edge_renderer.get_selection_manager().get_or_create_inspector(n.edge_view.model);return a.update(e,i,r),n.edge_view.model.data_source.setv({inspected:a},{silent:!0}),n.edge_view.model.data_source.inspect.emit([n.edge_view.model,{geometry:t}]),!a.is_empty()}}]),n}(u);n.EdgesOnly=c,c.__name__="EdgesOnly";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"hit_test",value:function(e,t){return this._hit_test(e,t,t.node_view)}},{key:"do_selection",value:function(e,t,n,i){if(null==e)return!1;var r=t.node_renderer.data_source.selected;return r.update(e,n,i),t.node_renderer.data_source._select.emit(),!r.is_empty()}},{key:"do_inspection",value:function(e,t,n,i,r){if(null==e)return!1;var a=n.model.node_renderer.get_selection_manager().get_or_create_inspector(n.node_view.model);return a.update(e,i,r),n.node_view.model.data_source.setv({inspected:a},{silent:!0}),n.node_view.model.data_source.inspect.emit([n.node_view.model,{geometry:t}]),!a.is_empty()}}]),n}(u);n.NodesOnly=h,h.__name__="NodesOnly";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"hit_test",value:function(e,t){return this._hit_test(e,t,t.n
2ode_view)}},{key:"get_linked_edges",value:function(e,t,n){var i=[];"selection"==n?i=e.selected.indices.map((function(t){return e.data.index[t]})):"inspection"==n&&(i=e.inspected.indices.map((function(t){return e.data.index[t]})));for(var r=[],a=0;a<t.data.start.length;a++)((0,s.contains)(i,t.data.start[a])||(0,s.contains)(i,t.data.end[a]))&&r.push(a);for(var o=new l.Selection,u=0,c=r;u<c.length;u++){var h=c[u];o.multiline_indices[h]=[0]}return o.indices=r,o}},{key:"do_selection",value:function(e,t,n,i){if(null==e)return!1;var r=t.node_renderer.data_source.selected;r.update(e,n,i);var a=t.edge_renderer.data_source.selected,o=this.get_linked_edges(t.node_renderer.data_source,t.edge_renderer.data_source,"selection");return a.update(o,n,i),t.node_renderer.data_source._select.emit(),!r.is_empty()}},{key:"do_inspection",value:function(e,t,n,i,r){if(null==e)return!1;var a=n.node_view.model.data_source.selection_manager.get_or_create_inspector(n.node_view.model);a.update(e,i,r),n.node_view.model.data_source.setv({inspected:a},{silent:!0});var o=n.edge_view.model.data_source.selection_manager.get_or_create_inspector(n.edge_view.model),s=this.get_linked_edges(n.node_view.model.data_source,n.edge_view.model.data_source,"inspection");return o.update(s,i,r),n.edge_view.model.data_source.setv({inspected:o},{silent:!0}),n.node_view.model.data_source.inspect.emit([n.node_view.model,{geometry:t}]),!a.is_empty()}}]),n}(u);n.NodesAndLinkedEdges=_,_.__name__="NodesAndLinkedEdges";var d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"hit_test",value:function(e,t){return this._hit_test(e,t,t.edge_view)}},{key:"get_linked_nodes",value:function(e,t,n){var i=[];"selection"==n?i=t.selected.indices:"inspection"==n&&(i=t.inspected.indices);var r,a=[],u=(0,w.Z)(i);try{for(u.s();!(r=u.n()).done;){var c=r.value;a.push(t.data.start[c]),a.push(t.data.end[c])}}catch(_){u.e(_)}finally{u.f()}var h=(0,s.uniq)(a).map((function(t){return(0,o.indexOf)(e.data.index,t)}));return new l.Selection({indices:h})}},{key:"do_selection",value:function(e,t,n,i){if(null==e)return!1;var r=t.edge_renderer.data_source.selected;r.update(e,n,i);var a=t.node_renderer.data_source.selected,o=this.get_linked_nodes(t.node_renderer.data_source,t.edge_renderer.data_source,"selection");return a.update(o,n,i),t.edge_renderer.data_source._select.emit(),!r.is_empty()}},{key:"do_inspection",value:function(e,t,n,i,r){if(null==e)return!1;var a=n.edge_view.model.data_source.selection_manager.get_or_create_inspector(n.edge_view.model);a.update(e,i,r),n.edge_view.model.data_source.setv({inspected:a},{silent:!0});var o=n.node_view.model.data_source.selection_manager.get_or_create_inspector(n.node_view.model),s=this.get_linked_nodes(n.node_view.model.data_source,n.edge_view.model.data_source,"inspection");return o.update(s,i,r),n.node_view.model.data_source.setv({inspected:o},{silent:!0}),n.edge_view.model.data_source.inspect.emit([n.edge_view.model,{geometry:t}]),!a.is_empty()}}]),n}(u);n.EdgesAndLinkedNodes=d,d.__name__="EdgesAndLinkedNodes"},function(e,t,n,i,r){var a;i();var o=e(53),s=e(260),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"node_coordinates",get:function(){return new c({layout:this})}},{key:"edge_coordinates",get:function(){return new h({layout:this})}}]),n}(o.Model);n.LayoutProvider=l,l.__name__="LayoutProvider";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.CoordinateTransform);n.GraphCoordinates=u,a=u,u.__name__="GraphCoordinates",a.define((function(e){return{layout:[(0,e.Ref)(l)]}}));var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_v_compute",value:function(e){var t=this.layout.get_node_coordinates(e),n=(0,k.Z)(t,2);return{x:n[0],y:n[1]}}}]),n}(u);n.NodeCoordinates=c,c.__name__="NodeCoordinates";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_v_compute",value:function(e){var t=this.layout.get_edge_coordinates(e),n=(0,k.Z)(t,2);return{x:n[0],y:n[1]}}}]),n}(u);n.EdgeCoordinates=h,h.__name__="EdgeCoordinates"},function(e,t,n,i,r){var a;i();var o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_node_coordinates",value:function(e){for(var t,n=null!==(t=e.data.index)&&void 0!==t?t:[],i=n.length,r=new Float64Array(i),a=new Float64Array(i),o=0;o<i;o++){var s=this.graph_layout[n[o]],l=null!=s?s:[NaN,NaN],u=(0,k.Z)(l,2),c=u[0],h=u[1];r[o]=c,a[o]=h}return[r,a]}},{key:"get_edge_coordinates",value:function(e){for(var t,n,i=null!==(t=e.data.start)&&void 0!==t?t:[],r=null!==(n=e.data.end)&&void 0!==n?n:[],a=Math.min(i.length,r.length),o=[],s=[],l=null!=e.data.xs&&null!=e.data.ys,u=0;u<a;u++){var c=null!=this.graph_layout[i[u]]&&null!=this.graph_layout[r[u]];if(l&&c)o.push(e.data.xs[u]),s.push(e.data.ys[u]);else{var h=void 0,_=void 0;c?(h=this.graph_layout[i[u]],_=this.graph_layout[r[u]]):(h=[NaN,NaN],_=[NaN,NaN]),o.push([h[0],_[0]]),s.push([h[1],_[1]])}}return[o,s]}}]),n}(e(303).LayoutProvider);n.StaticLayoutProvider=o,a=o,o.__name__="StaticLayoutProvider",a.define((function(e){var t=e.Number,n=e.Tuple;return{graph_layout:[(0,e.Dict)(n(t,t)),{}]}}))},function(e,t,n,i,r){i(),r("Grid",e(306).Grid)},function(e,t,n,i,r){i();var a,o=e(1),s=e(127),l=e(129),u=e(130),c=(0,o.__importStar)(e(48)),h=e(8),f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_render",value:function(){var e=this.layer.ctx;e.save(),this._draw_regions(e),this._draw_minor_grids(e),this._draw_grids(e),e.restore(
2)}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.change,(function(){return e.request_render()}))}},{key:"_draw_regions",value:function(e){if(this.visuals.band_fill.doit||this.visuals.band_hatch.doit)for(var t=this.grid_coords("major",!1),n=(0,k.Z)(t,2),i=n[0],r=n[1],a=0;a<i.length-1;a++)if(a%2==1){var o=this.coordinates.map_to_screen(i[a],r[a]),s=(0,k.Z)(o,2),l=s[0],u=s[1],c=this.coordinates.map_to_screen(i[a+1],r[a+1]),h=(0,k.Z)(c,2),_=h[0],d=h[1];e.beginPath(),e.rect(l[0],u[0],_[1]-l[0],d[1]-u[0]),this.visuals.band_fill.apply(e),this.visuals.band_hatch.apply(e)}}},{key:"_draw_grids",value:function(e){if(this.visuals.grid_line.doit){var t=this.grid_coords("major"),n=(0,k.Z)(t,2),i=n[0],r=n[1];this._draw_grid_helper(e,this.visuals.grid_line,i,r)}}},{key:"_draw_minor_grids",value:function(e){if(this.visuals.minor_grid_line.doit){var t=this.grid_coords("minor"),n=(0,k.Z)(t,2),i=n[0],r=n[1];this._draw_grid_helper(e,this.visuals.minor_grid_line,i,r)}}},{key:"_draw_grid_helper",value:function(e,t,n,i){t.set_value(e),e.beginPath();for(var r=0;r<n.length;r++){var a=this.coordinates.map_to_screen(n[r],i[r]),o=(0,k.Z)(a,2),s=o[0],l=o[1];e.moveTo(Math.round(s[0]),Math.round(l[0]));for(var u=1;u<s.length;u++)e.lineTo(Math.round(s[u]),Math.round(l[u]))}e.stroke()}},{key:"ranges",value:function(){var e=this.model.dimension,t=(e+1)%2,n=this.coordinates.ranges;return[n[e],n[t]]}},{key:"computed_bounds",value:function(){var e,t,n=this.ranges(),i=(0,k.Z)(n,1)[0],r=this.model.bounds,a=[i.min,i.max];if((0,h.isArray)(r))e=Math.min(r[0],r[1]),t=Math.max(r[0],r[1]),e<a[0]&&(e=a[0]),t>a[1]&&(t=a[1]);else{e=a[0],t=a[1];var o,s=(0,w.Z)(this.plot_view.axis_views);try{for(s.s();!(o=s.n()).done;){var l,u,c=o.value;c.dimension==this.model.dimension&&c.model.x_range_name==this.model.x_range_name&&c.model.y_range_name==this.model.y_range_name&&(l=c.computed_bounds,e=(u=(0,k.Z)(l,2))[0],t=u[1])}}catch(_){s.e(_)}finally{s.f()}}return[e,t]}},{key:"grid_coords",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.model.dimension,i=(n+1)%2,r=this.ranges(),a=(0,k.Z)(r,2),o=a[0],s=a[1],l=this.computed_bounds(),u=(0,k.Z)(l,2),c=u[0],h=u[1],_=[Math.min(c,h),Math.max(c,h)];c=_[0],h=_[1];var d=[[],[]],f=this.model.get_ticker();if(null==f)return d;var v=f.get_ticks(c,h,o,s.min)[e],p=o.min,m=o.max,y=s.min,g=s.max;t||(v[0]!=p&&v.splice(0,0,p),v[v.length-1]!=m&&v.push(m));for(var b=0;b<v.length;b++)if(v[b]!=p&&v[b]!=m||!t){for(var w=[],x=[],Z=0;Z<2;Z++){var A=y+(g-y)/1*Z;w.push(v[b]),x.push(A)}d[n].push(w),d[i].push(x)}return d}}]),n}(l.GuideRendererView);n.GridView=f,f.__name__="GridView";var m=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_ticker",value:function(){return null!=this.ticker?this.ticker:null!=this.axis?this.axis.ticker:null}}]),n}(l.GuideRenderer);n.Grid=m,a=m,m.__name__="Grid",a.prototype.default_view=f,a.mixins([["grid_",c.Line],["minor_grid_",c.Line],["band_",c.Fill],["band_",c.Hatch]]),a.define((function(e){var t=e.Number,n=e.Auto,i=e.Enum,r=e.Ref,a=e.Tuple,o=e.Or,l=e.Nullable;return{bounds:[o(a(t,t),n),"auto"],dimension:[i(0,1),0],axis:[l(r(s.Axis)),null],ticker:[l(r(u.Ticker)),null]}})),a.override({level:"underlay",band_fill_color:null,band_fill_alpha:0,grid_line_color:"#e5e5e5",minor_grid_line_color:null})},function(e,t,n,i,r){i(),r("Box",e(308).Box),r("Column",e(310).Column),r("GridBox",e(311).GridBox),r("HTMLBox",e(312).HTMLBox),r("LayoutDOM",e(309).LayoutDOM),r("Panel",e(313).Panel),r("Row",e(314).Row),r("Spacer",e(315).Spacer),r("Tabs",e(316).Tabs),r("WidgetBox",e(319).WidgetBox)},function(e,t,n,i,r){var a;i();var o=e(309),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.properties.children.change,(function(){return e.rebuild()}))}},{key:"child_models",get:function(){return this.model.children}}]),n}(o.LayoutDOMView);n.BoxView=s,s.__name__="BoxView";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.LayoutDOM);n.Box=l,a=l,l.__name__="Box",a.define((function(e){var t=e.Number;return{children:[(0,e.Array)((0,e.Ref)(o.LayoutDOM)),[]],spacing:[t,0]}}))},function(e,t,n,i,r){var a;i();var o=e(53),s=e(20),l=e(43),u=e(19),c=e(8),h=e(22),f=e(121),m=e(113),A=e(226),S=e(207),T=e(44),M=e(235),C=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._offset_parent=null,e._viewport={},e}return(0,b.Z)(n,[{key:"is_layout_root",get:function(){return this.is_root||!(this.parent instanceof n)}},{key:"base_font_size",get:function(){var e=getComputedStyle(this.el).fontSize,t=(0,f.parse_css_font_size)(e);if(null!=t){var n=t.value;if("px"==t.unit)return n}return null}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.el.style.position=this.is_layout_root?"relative":"absolute",this._child_views=new Map}},{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:return e.next=4,this.build_child_views();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"remove",value:function(){var e,t=(0,w.Z)(this.child_views);try{for(t.s();!(e=t.n()).done;){e.value.remove()}}catch(i){t.e(i)}finally{t.f()}this._child_views.clear(),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.is_layout_root&&(this._on_resize=function(){return e.resize_layout()},window.addEventListener("resize",this._on_resize),this._parent_observer=setInterval((function(){var t=e.el.offsetParent;e._offset_parent!=t&&(e._offset_parent=t,null!=t&&(e.compute_viewport(),e.invali
2date_layout()))}),250));var t=this.model.properties;this.on_change([t.width,t.height,t.min_width,t.min_height,t.max_width,t.max_height,t.margin,t.width_policy,t.height_policy,t.sizing_mode,t.aspect_ratio,t.visible],(function(){return e.invalidate_layout()})),this.on_change([t.background,t.css_classes],(function(){return e.invalidate_render()}))}},{key:"disconnect_signals",value:function(){null!=this._parent_observer&&clearTimeout(this._parent_observer),null!=this._on_resize&&window.removeEventListener("resize",this._on_resize),(0,_.Z)((0,d.Z)(n.prototype),"disconnect_signals",this).call(this)}},{key:"css_classes",value:function(){return(0,_.Z)((0,d.Z)(n.prototype),"css_classes",this).call(this).concat(this.model.css_classes)}},{key:"child_views",get:function(){var e=this;return this.child_models.map((function(t){return e._child_views.get(t)}))}},{key:"build_child_views",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,m.build_views)(this._child_views,this.child_models,{parent:this});case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e;(0,_.Z)((0,d.Z)(n.prototype),"render",this).call(this),(0,l.empty)(this.el);var t=this.model.background;this.el.style.backgroundColor=null!=t?(0,h.color2css)(t):"",(e=(0,l.classes)(this.el).clear()).add.apply(e,(0,y.Z)(this.css_classes()));var i,r=(0,w.Z)(this.child_views);try{for(r.s();!(i=r.n()).done;){var a=i.value;this.el.appendChild(a.el),a.render()}}catch(o){r.e(o)}finally{r.f()}}},{key:"update_layout",value:function(){var e,t=(0,w.Z)(this.child_views);try{for(t.s();!(e=t.n()).done;){e.value.update_layout()}}catch(n){t.e(n)}finally{t.f()}this._update_layout()}},{key:"update_position",value:function(){this.el.style.display=this.model.visible?"block":"none";var e=this.is_layout_root?this.layout.sizing.margin:void 0;(0,l.position)(this.el,this.layout.bbox,e);var t,n=(0,w.Z)(this.child_views);try{for(n.s();!(t=n.n()).done;){t.value.update_position()}}catch(i){n.e(i)}finally{n.f()}}},{key:"after_layout",value:function(){var e,t=(0,w.Z)(this.child_views);try{for(t.s();!(e=t.n()).done;){e.value.after_layout()}}catch(n){t.e(n)}finally{t.f()}this._has_finished=!0}},{key:"compute_viewport",value:function(){this._viewport=this._viewport_size()}},{key:"renderTo",value:function(e){e.appendChild(this.el),this._offset_parent=this.el.offsetParent,this.compute_viewport(),this.build(),this.notify_finished()}},{key:"build",value:function(){if(!this.is_layout_root)throw new Error("".concat(this.toString()," is not a root layout"));return this.render(),this.update_layout(),this.compute_layout(),this}},{key:"rebuild",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.build_child_views();case 2:this.invalidate_render();case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"compute_layout",value:function(){var e=Date.now();this.layout.compute(this._viewport),this.update_position(),this.after_layout(),u.logger.debug("layout computed in ".concat(Date.now()-e," ms"))}},{key:"resize_layout",value:function(){this.root.compute_viewport(),this.root.compute_layout()}},{key:"invalidate_layout",value:function(){this.root.update_layout(),this.root.compute_layout()}},{key:"invalidate_render",value:function(){this.render(),this.invalidate_layout()}},{key:"has_finished",value:function(){if(!(0,_.Z)((0,d.Z)(n.prototype),"has_finished",this).call(this))return!1;var e,t=(0,w.Z)(this.child_views);try{for(t.s();!(e=t.n()).done;){if(!e.value.has_finished())return!1}}catch(i){t.e(i)}finally{t.f()}return!0}},{key:"_width_policy",value:function(){return null!=this.model.width?"fixed":"fit"}},{key:"_height_policy",value:function(){return null!=this.model.height?"fixed":"fit"}},{key:"box_sizing",value:function(){var e,t,n=this.model,i=n.width_policy,r=n.height_policy,a=n.aspect_ratio;"auto"==i&&(i=this._width_policy()),"auto"==r&&(r=this._height_policy());var o=this.model.sizing_mode;if(null!=o)if("fixed"==o)i=r="fixed";else if("stretch_both"==o)i=r="max";else if("stretch_width"==o)i="max";else if("stretch_height"==o)r="max";else switch(null==a&&(a="auto"),o){case"scale_width":i="max",r="min";break;case"scale_height":i="min",r="max";break;case"scale_both":i="max",r="max"}var s={width_policy:i,height_policy:r},l=this.model,u=l.min_width,h=l.min_height;null!=u&&(s.min_width=u),null!=h&&(s.min_height=h);var _=this.model,d=_.width,f=_.height;null!=d&&(s.width=d),null!=f&&(s.height=f);var v=this.model,p=v.max_width,m=v.max_height;null!=p&&(s.max_width=p),null!=m&&(s.max_height=m),"auto"==a&&null!=d&&null!=f?s.aspect=d/f:(0,c.isNumber)(a)&&(s.aspect=a);var y=this.model.margin;if(null!=y)if((0,c.isNumber)(y))s.margin={top:y,right:y,bottom:y,left:y};else if(2==y.length){var g=(0,k.Z)(y,2),b=g[0],w=g[1];s.margin={top:b,right:w,bottom:b,left:w}}else{var x=(0,k.Z)(y,4),Z=x[0],A=x[1],S=x[2],T=x[3];s.margin={top:Z,right:A,bottom:S,left:T}}s.visible=this.model.visible;var M=this.model.align;return(0,c.isArray)(M)?(e=M,t=(0,k.Z)(e,2),s.halign=t[0],s.valign=t[1]):s.halign=s.valign=M,s}},{key:"_viewport_size",value:function(){var e=this;return(0,l.undisplayed)(this.el,(function(){for(var t=e.el;t=t.parentElement;)if(!t.classList.contains(T.root)){if(t==document.body){var n=(0,l.extents)(document.body).margin,i=n.left,r=n.right,a=n.top,o=n.bottom;return{width:Math.ceil(document.documentElement.clientWidth-i-r),height:Math.ceil(document.documentElement.clientHeight-a-o)}}var s=(0,l.extents)(t).padding,u=s.left,c=s.right,h=s.top,_=s.bottom,d=t.getBoundingClientRect(),f=d.width,v=d.height,p=Math.ceil(f-u-c),m=Math.ceil(v-h-_);if(p>0||m>0)return{width:p>0?p:void 0,height:m>0?m:void 0}}return{}}))}},{key:"export",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="png"==e?"canvas":"svg",i=new M.CanvasLayer(n,t),r=this.layout.bbox,a=r.width,o=r.height;i.resize(a,o);var s,l=(0,w.Z)(this.child_views);try{for(l.s();!(s=l.n()).done;){var u=s.value,c=u.export(e,t),h=u.layout.bbox,_=h.x,d=h.y;i.ctx.drawImage(c.canvas,_,d)}}catch(f){l.e(f)}finally{l.f()}return i}},{key:"serializable_state",value:function(){return Object.assign(Object.assign({},(0,_.Z)((0,d.Z)(n.prototype),"serializable_state",this).call(this)),{bbox:this.layout.bbox.box,children:this.child_views.map((function(e){return e.serializable_state()}))})}}]),n}(A.DOMView);n.LayoutDOMView=C,C.__name__="LayoutDOMView";var z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Model);n.LayoutDOM=z,a=z,z.__name__="LayoutDOM",a.define((function(e){var t=e.Boolean,n=e.Number,i=e.String,r=e.Auto,a=e.Color,o=e.Array,l=e.Tuple,u=e.Or,c=e.Null,h=e.Nullable,_=l(n,n),d=l(n,n,n,n);return{width:[h(n),null],height:[h(n),null],min_width:[h(n),null],min_height:[h(n),null],max_width:[h(n),null],max_height:[h(n),null],margin:[h(u(n,_,d)),[0,0,0,0]],width_policy:[u(S.SizingPolicy,r),"auto"],height_policy:[u(S.SizingPolicy,r),"auto"],aspect_ratio:[u(n,r,c),null],sizing_mode:[h(s.SizingMode),null],visible:[t,!0],disabled:[t,!1],align:[u(s.Align,l(s.Align,s.Align)),"start"],background:[h(a),null],css_classes:[o(i),[]]}}))},function(e,t,n,i,r){var a;i();var o=e(308),s=e(209),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_update_layout",value:function(){var e=this.child_views.map((function(e){return e.layout}));this.layout=new s.Column(e),this.layout.rows=this.model.rows,this.layout.spacing=[this.model.spacing,0],this.layout.set_sizing(this.box_sizing())}}]),n}(o.BoxView);n.ColumnView=l,l.__name__="ColumnView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Box);n.Column=u,a=u,u.__name__="Column",a.prototype.default_view=l,a.define((function(e){return{rows:[e.Any,"auto"]}}))},function(e,t,n,i,r){var a;i();var o=e(309),s=e(209),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}
2return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this);var t=this.model.properties,i=t.children,r=t.rows,a=t.cols,o=t.spacing;this.on_change([i,r,a,o],(function(){return e.rebuild()}))}},{key:"child_models",get:function(){return this.model.children.map((function(e){return(0,k.Z)(e,1)[0]}))}},{key:"_update_layout",value:function(){this.layout=new s.Grid,this.layout.rows=this.model.rows,this.layout.cols=this.model.cols,this.layout.spacing=this.model.spacing;var e,t=(0,w.Z)(this.model.children);try{for(t.s();!(e=t.n()).done;){var n=(0,k.Z)(e.value,5),i=n[0],r=n[1],a=n[2],o=n[3],l=n[4],u=this._child_views.get(i);this.layout.items.push({layout:u.layout,row:r,col:a,row_span:o,col_span:l})}}catch(c){t.e(c)}finally{t.f()}this.layout.set_sizing(this.box_sizing())}}]),n}(o.LayoutDOMView);n.GridBoxView=l,l.__name__="GridBoxView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.LayoutDOM);n.GridBox=u,a=u,u.__name__="GridBox",a.prototype.default_view=l,a.define((function(e){var t=e.Any,n=e.Int,i=e.Number,r=e.Tuple,a=e.Array,s=e.Ref,l=e.Or,u=e.Opt;return{children:[a(r(s(o.LayoutDOM),n,n,u(n),u(n))),[]],rows:[t,"auto"],cols:[t,"auto"],spacing:[l(i,r(i,i)),0]}}))},function(e,t,n,i,r){i();var a=e(309),o=e(207),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"child_models",get:function(){return[]}},{key:"_update_layout",value:function(){this.layout=new o.ContentBox(this.el),this.layout.set_sizing(this.box_sizing())}}]),n}(a.LayoutDOMView);n.HTMLBoxView=s,s.__name__="HTMLBoxView";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(a.LayoutDOM);n.HTMLBox=l,l.__name__="HTMLBox"},function(e,t,n,i,r){var a;i();var o=e(53),s=e(309),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Model);n.Panel=l,a=l,l.__name__="Panel",a.define((function(e){var t=e.Boolean;return{title:[e.String,""],child:[(0,e.Ref)(s.LayoutDOM)],closable:[t,!1],disabled:[t,!1]}}))},function(e,t,n,i,r){var a;i();var o=e(308),s=e(209),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_update_layout",value:function(){var e=this.child_views.map((function(e){return e.layout}));this.layout=new s.Row(e),this.layout.cols=this.model.cols,this.layout.spacing=[0,this.model.spacing],this.layout.set_sizing(this.box_sizing())}}]),n}(o.BoxView);n.RowView=l,l.__name__="RowView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Box);n.Row=u,a=u,u.__name__="Row",a.prototype.default_view=l,a.define((function(e){return{cols:[e.Any,"auto"]}}))},function(e,t,n,i,r){var a;i();var o=e(309),s=e(207),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"child_models",get:function(){return[]}},{key:"_update_layout",value:function(){this.layout=new s.LayoutItem,this.layout.set_sizing(this.box_sizing())}}]),n}(o.LayoutDOMView);n.SpacerView=l,l.__name__="SpacerView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.LayoutDOM);n.Spacer=u,a=u,u.__name__="Spacer",a.prototype.default_view=l},function(e,t,n,i,r){i();var a,o=e(1),s=e(207),l=e(43),u=e(9),c=e(10),h=e(20),f=e(309),m=e(313),x=(0,o.__importStar)(e(317)),k=x,Z=(0,o.__importStar)(e(318)),A=Z,S=(0,o.__importStar)(e(229)),T=S,M=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._scroll_index=0,e}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.properties.tabs.change,(function(){return e.rebuild()})),this.connect(this.model.properties.active.change,(function(){return e.on_active_change()}))}},{key:"styles",value:function(){return[].concat((0,y.Z)((0,_.Z)((0,d.Z)(n.prototype),"styles",this).call(this)),[Z.default,S.default,x.default])}},{key:"child_models",get:function(){return this.model.tabs.map((function(e){return e.child}))}},{key:"_update_layout",value:function(){var e=this.model.tabs_location,t="above"==e||"below"==e,n=this.scroll_el,i=this.headers_el;this.header=new(function(e){(0,v.Z)(a,e);var r=(0,p.Z)(a);function a(){return(0,g.Z)(this,a),r.apply(this,arguments)}return(0,b.Z)(a,[{key:"_measure",value:function(e){var r=(0,l.size)(n),o=(0,l.children)(i).slice(0,3).map((function(e){return(0,l.size)(e)})),s=(0,_.Z)((0,d.Z)(a.prototype),"_measure",this).call(this,e),c=s.width,h=s.height;if(t){var f=r.width+(0,u.sum)(o.map((function(e){return e.width})));return{width:e.width!=1/0?e.width:f,height:h}}var v=r.height+(0,u.sum)(o.map((function(e){return e.height})));return{width:c,height:e.height!=1/0?e.height:v}}}]),a}(s.ContentBox))(this.header_el),t?this.header.set_sizing({width_policy:"fit",height_policy:"fixed"}):this.header.set_sizing({width_policy:"fixed",height_policy:"fit"});var r=1,a=1;switch(e){case"above":r-=1;break;case"below":r+=1;break;case"left":a-=1;break;case"right":a+=1}var o={layout:this.header,row:r,col:a},c=this.child_views.map((function(e){return{layout:e.layout,row:1,col:1}}));this.layout=new s.Grid([o].concat((0,y.Z)(c))),this.layout.set_sizing(this.box_sizing())}},{key:"update_position",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"update_position",this).call(this),this.header_el.style.position="absolute",(0,l.position)(this.header_el,this.header.bbox);var e=this.model.tabs_location,t="above"==e||"below"==e,i=(0,l.size)(this.scroll_el),r=(0,l.scroll_size)(this.headers_el);if(t){var a=this.header.bbox.width;r.width>a?(this.wrapper_el.style.maxWidth=a-i.width+"px",(0,l.display)(this.scroll_el),this.do_scroll(this.model.active)):(this.wrapper_el.style.maxWidth="",(0,l.undisplay)(this.scroll_el))}else{var o=this.header.bbox.height;r.height>o?(this.wrapper_el.style.maxHeight=o-i.height+"px",(0,l.display)(this.scroll_el),this.do_scroll(this.model.active)):(this.wrapper_el.style.maxHeight="",(0,l.undisplay)(this.scroll_el))}var s,u=this.child_views,c=(0,w.Z)(u);try{for(c.s();!(s=c.n()).done;){var h=s.value;(0,l.hide)(h.el)}}catch(v){c.e(v)}finally{c.f()}var f=u[this.model.active];null!=f&&(0,l.show)(f.el)}},{key:"render",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"render",this).call(this);var t=this.model.active,i=this.model.tabs.map((function(n,i){var r=(0,l.div)({class:[k.tab,i==t?k.active:null]},n.title);if(r.addEventListener("click",(function(t){e.model.disabled||t.target==t.currentTarget&&e.change_active(i)})),n.closable){var a=(0,l.div)({class:k.close});a.addEventListener("click",(function(t){if(t.target==t.currentTarget){e.model.tabs=(0,u.remove_at)(e.model.tabs,i);var n=e.model.tabs.length;e.model.active>n-1&&(e.model.active=n-1)}})),r.appendChild(a)}return(e.model.disabled||n.disabled)&&r.classList.add(k.disabled),r}));this.headers_el=(0,l.div)({class:[k.headers]},i),this.wrapper_el=(0,l.div)({class:k.headers_wrapper},this.headers_el),this.left_el=(0,l.div)({class:[A.btn,A.btn_default],disabled:""},(0,l.div)({class:[T.caret,k.left]})),this.right_el=(0,l.div)({class:[A.btn,A.btn_default]},(0,l.div)({class:[T.caret,k.right]})),this.left_el.addEventListener("click",(function(){return e.do_scroll("left")})),this.right_el.addEventListener("click",(function(){return e.do_scroll("right")})),this.scroll_el=(0,l.div)({class:A.btn_group},this.left_el,this.right_el);var r=this.model.tabs_location;this.header_el=(0,l.div)({class:[k.tabs_header,k[r]]},this.scroll_el,this.wrapper_el),this.el.appendChild(this.header_el)}},{key:"do_scroll",value:function(e){var t=this.model.tabs.length;"left"==e?this._scroll_index-=1:"right"==e?this._scroll_index+=1:this._scroll_index=e,this._scroll_index=(0,c.clamp)(this._scroll_index,0,t-1),0==this._scroll_index?this.left_el.setAttribute("disabled",""):this.left_el.removeAttribute("disabled"),this._scroll_index==t-1?this.right_el.setAttribute("disabled",""):this.right_el.removeAttribute("disabled");var n=(0,l.children)(this.headers_el).slice(0,this._scroll_index).map((function(e){return e.getBoundingClientRect()})),i=this.model.tabs_location;if("above"==i||"below"==i){var r=-(0,u.sum)(n.map((function(e){return e.width})));this.headers_el.style.left="".concat(r,"px")}else{var a=-(0,u.sum)(n.map((function(e){return e.height})));this.headers_el.style.top="".concat(a,"px")}}},{key:"change_active",value:function(e){e!=this.model.active&&(this.model.active=e)}},{key:"on_active_change",value:function(){var e,t=this.model.active,n=(0,l.children)(this.headers_el),i=(0,w.Z)(n);try{for(i.s();!(e=i.n()).done;){e.value.classList.remove(k.active)}}catch(u){i.e(u)}finally{i.f()}n[t].classList.add(k.active);var r,a=this.child_views,o=(0,w.Z)(a);try{for(o.s();!(r=o.n()).done;){var s=r.value;(0,l.hide)(s.el)}}catch(u){o.e(u)}finally{o.f()}(0,l.show)(a[t].el)}}]),n}(f.LayoutDOMView);n.TabsView=M,M.__name__="TabsView";var C=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(f.LayoutDOM);n.Tabs=C,a=C,C.__name__="Tabs",a.prototype.default_view=M,a.define((function(e){var t=e.Int;return{tabs:[(0,e.Array)((0,e.Ref)(m.Panel)),[]],tabs_location:[h.Location,"above"],active:[t,0]}}))},function(e,t,n,i,r){i(),n.root="bk-root",n.tabs_header="bk-tabs-header",n.btn_group="bk-btn-group",n.btn="bk-btn",n.headers_wrapper="bk-headers-wrapper",n.above="bk-above",n.right="bk-right",n.below="bk-below",n.left="bk-left",n.headers="bk-headers",n.tab="bk-tab",n.active="bk-active",n.close="bk-close",n.disabled="bk-disabled",n.default='.bk-root .bk-tabs-header{display:flex;flex-wrap:nowrap;align-items:center;overflow:hidden;user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;}.bk-root .bk-tabs-header .bk-btn-group{height:auto;margin-right:5px;}.bk-root .bk-tabs-header .bk-btn-group > .bk-btn{flex-grow:0;height:auto;padding:4px 4px;}.bk-root .bk-tabs-header .bk-headers-wrapper{flex-grow:1;overflow:hidden;color:#666666;}.bk-root .bk-tabs-header.bk-above .bk-headers-wrapper{border-bottom:1px solid #e6e6e6;}.bk-root .bk-tabs-header.bk-right .bk-headers-wrapper{border-left:1px solid #e6e6e6;}.bk-root .bk-tabs-header.bk-below .bk-headers-wrapper{border-top:1px solid #e6e6e6;}.bk-root .bk-tabs-header.bk-left .bk-headers-wrapper{border-right:1px solid #e6e6e6;}.bk-root .bk-tabs-header.bk-above,.bk-root .bk-tabs-header.bk-below{flex-direction:row;}.bk-root .bk-tabs-header.bk-above .bk-headers,.bk-root .bk-tabs-header.bk-below .bk-headers{flex-direction:row;}.bk-root .bk-tabs-header.bk-left,.bk-root .bk-tabs-header.bk-right{flex-direction:column;}.bk-root .bk-tabs-header.bk-left .bk-headers,.bk-root .bk-tabs-header.bk-right .bk-headers{flex-direction:column;}.bk-root .bk-tabs-header .bk-headers{position:relative;display:flex;flex-wrap:nowrap;align-items:center;}.bk-root .bk-tabs-header .bk-tab{padding:4px 8px;border:solid transparent;white-space:nowrap;cursor:pointer;}.bk-root .bk-tabs-header .bk-tab:hover{background-color:#f2f2f2;}.bk-root .bk-tabs-header .bk-tab.bk-active{color:#4d4d4d;background-color:white;border-color:#e6e6e6;}.bk-root .bk-tabs-header .bk-tab .bk-close{margin-left:10px;}.bk-root .bk-tabs-header .bk-tab.bk-disabled{cursor:not-allowed;pointer-events:none;opacity:0.65;}.bk-root .bk-tabs-header.bk-above .bk-tab{border-width:3px 1px 0px 1px;border-radius:4px 4px 0 0;}.bk-root .bk-tabs-header.bk-right .bk-tab{border-width:1px 3px 1px 0px;border-radius:0 4px 4px 0;}.bk-root .bk-tabs-header.bk-below .bk-tab{border-width:0px 1px 3px 1px;border-radius:0 0 4px 4px;}.bk-root .bk-tabs-header.bk-left .bk-tab{border-width:1px 0px 1px 3px;border-radius:4px 0 0 4px;}.bk-root .bk-close{display:inline-block;width:10px;height:10px;vertical-align:middle;background-image:url(\'data:image/svg+xml;utf8,      <svg viewPort="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg">        <line x1="1" y1="9" x2="9" y2="1" stroke="gray" stroke-width="2"/>        <line x1="1" y1="1" x2="9" y2="9" stroke="gray" stroke-width="2"/>      </svg>\');}.bk-root .bk-close:hover{background-image:url(\'data:image/svg+xml;utf8,      <svg viewPort="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg">        <line x1="1" y1="9" x2="9" y2="1" stroke="red" stroke-width="2"/>        <line x1="1" y1="1" x2="9" y2="9" stroke="red" stroke-width="2"/>      </svg>\');}'},function(e,t,n,i,r){i
vendor: 5,090 bytes, line 2
2(),n.root="bk-root",n.btn="bk-btn",n.active="bk-active",n.btn_default="bk-btn-default",n.btn_primary="bk-btn-primary",n.btn_success="bk-btn-success",n.btn_warning="bk-btn-warning",n.btn_danger="bk-btn-danger",n.btn_light="bk-btn-light",n.btn_group="bk-btn-group",n.vertical="bk-vertical",n.horizontal="bk-horizontal",n.dropdown_toggle="bk-dropdown-toggle",n.default=".bk-root .bk-btn{height:100%;display:inline-block;text-align:center;vertical-align:middle;white-space:nowrap;cursor:pointer;padding:6px 12px;font-size:12px;border:1px solid transparent;border-radius:4px;outline:0;user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;}.bk-root .bk-btn:hover,.bk-root .bk-btn:focus{text-decoration:none;}.bk-root .bk-btn:active,.bk-root .bk-btn.bk-active{background-image:none;box-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);}.bk-root .bk-btn[disabled]{cursor:not-allowed;pointer-events:none;opacity:0.65;box-shadow:none;}.bk-root .bk-btn-default{color:#333;background-color:#fff;border-color:#ccc;}.bk-root .bk-btn-default:hover{background-color:#f5f5f5;border-color:#b8b8b8;}.bk-root .bk-btn-default.bk-active{background-color:#ebebeb;border-color:#adadad;}.bk-root .bk-btn-default[disabled],.bk-root .bk-btn-default[disabled]:hover,.bk-root .bk-btn-default[disabled]:focus,.bk-root .bk-btn-default[disabled]:active,.bk-root .bk-btn-default[disabled].bk-active{background-color:#e6e6e6;border-color:#ccc;}.bk-root .bk-btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd;}.bk-root .bk-btn-primary:hover{background-color:#3681c1;border-color:#2c699e;}.bk-root .bk-btn-primary.bk-active{background-color:#3276b1;border-color:#285e8e;}.bk-root .bk-btn-primary[disabled],.bk-root .bk-btn-primary[disabled]:hover,.bk-root .bk-btn-primary[disabled]:focus,.bk-root .bk-btn-primary[disabled]:active,.bk-root .bk-btn-primary[disabled].bk-active{background-color:#506f89;border-color:#357ebd;}.bk-root .bk-btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c;}.bk-root .bk-btn-success:hover{background-color:#4eb24e;border-color:#409240;}.bk-root .bk-btn-success.bk-active{background-color:#47a447;border-color:#398439;}.bk-root .bk-btn-success[disabled],.bk-root .bk-btn-success[disabled]:hover,.bk-root .bk-btn-success[disabled]:focus,.bk-root .bk-btn-success[disabled]:active,.bk-root .bk-btn-success[disabled].bk-active{background-color:#667b66;border-color:#4cae4c;}.bk-root .bk-btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236;}.bk-root .bk-btn-warning:hover{background-color:#eea43b;border-color:#e89014;}.bk-root .bk-btn-warning.bk-active{background-color:#ed9c28;border-color:#d58512;}.bk-root .bk-btn-warning[disabled],.bk-root .bk-btn-warning[disabled]:hover,.bk-root .bk-btn-warning[disabled]:focus,.bk-root .bk-btn-warning[disabled]:active,.bk-root .bk-btn-warning[disabled].bk-active{background-color:#c89143;border-color:#eea236;}.bk-root .bk-btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a;}.bk-root .bk-btn-danger:hover{background-color:#d5433e;border-color:#bd2d29;}.bk-root .bk-btn-danger.bk-active{background-color:#d2322d;border-color:#ac2925;}.bk-root .bk-btn-danger[disabled],.bk-root .bk-btn-danger[disabled]:hover,.bk-root .bk-btn-danger[disabled]:focus,.bk-root .bk-btn-danger[disabled]:active,.bk-root .bk-btn-danger[disabled].bk-active{background-color:#a55350;border-color:#d43f3a;}.bk-root .bk-btn-light{color:#333;background-color:#fff;border-color:#ccc;border-color:transparent;}.bk-root .bk-btn-light:hover{background-color:#f5f5f5;border-color:#b8b8b8;}.bk-root .bk-btn-light.bk-active{background-color:#ebebeb;border-color:#adadad;}.bk-root .bk-btn-light[disabled],.bk-root .bk-btn-light[disabled]:hover,.bk-root .bk-btn-light[disabled]:focus,.bk-root .bk-btn-light[disabled]:active,.bk-root .bk-btn-light[disabled].bk-active{background-color:#e6e6e6;border-color:#ccc;}.bk-root .bk-btn-group{height:100%;display:flex;flex-wrap:nowrap;align-items:center;}.bk-root .bk-btn-group:not(.bk-vertical),.bk-root .bk-btn-group.bk-horizontal{flex-direction:row;}.bk-root .bk-btn-group.bk-vertical{flex-direction:column;}.bk-root .bk-btn-group > .bk-btn{flex-grow:1;}.bk-root .bk-btn-group:not(.bk-vertical) > .bk-btn + .bk-btn{margin-left:-1px;}.bk-root .bk-btn-group.bk-vertical > .bk-btn + .bk-btn{margin-top:-1px;}.bk-root .bk-btn-group:not(.bk-vertical) > .bk-btn:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0;}.bk-root .bk-btn-group.bk-vertical > .bk-btn:first-child:not(:last-child){border-bottom-left-radius:0;border-bottom-right-radius:0;}.bk-root .bk-btn-group:not(.bk-vertical) > .bk-btn:not(:first-child):last-child{border-bottom-left-radius:0;border-top-left-radius:0;}.bk-root .bk-btn-group.bk-vertical > .bk-btn:not(:first-child):last-child{border-top-left-radius:0;border-top-right-radius:0;}.bk-root .bk-btn-group > .bk-btn:not(:first-child):not(:last-child){border-radius:0;}.bk-root .bk-btn-group.bk-vertical > .bk-btn{width:100%;}.bk-root .bk-btn-group .bk-dropdown-toggle{flex:0 0 0;padding:6px 6px;}"},function(
2e,t,n,i,r){var a;i();var o=e(310),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(o.ColumnView);n.WidgetBoxView=s,s.__name__="WidgetBoxView";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Column);n.WidgetBox=l,a=l,l.__name__="WidgetBox",a.prototype.default_view=s},function(e,t,n,i,r){i();var a=e(135);r("MathText",a.MathText),r("Ascii",a.Ascii),r("MathML",a.MathML),r("TeX",a.TeX),r("PlainText",e(139).PlainText)},function(e,t,n,i,r){i(),r("CustomJSTransform",e(322).CustomJSTransform),r("Dodge",e(323).Dodge),r("Interpolator",e(325).Interpolator),r("Jitter",e(326).Jitter),r("LinearInterpolator",e(327).LinearInterpolator),r("StepInterpolator",e(328).StepInterpolator),r("Transform",e(56).Transform)},function(e,t,n,i,r){var a;i();var o=e(56),l=e(13),u=e(34),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"names",get:function(){return(0,l.keys)(this.args)}},{key:"values",get:function(){return(0,l.values)(this.args)}},{key:"_make_transform",value:function(e,t){return(0,s.Z)(Function,(0,y.Z)(this.names).concat([e,(0,u.use_strict)(t)]))}},{key:"scalar_transform",get:function(){return this._make_transform("x",this.func)}},{key:"vector_transform",get:function(){return this._make_transform("xs",this.v_func)}},{key:"compute",value:function(e){return this.scalar_transform.apply(this,(0,y.Z)(this.values).concat([e]))}},{key:"v_compute",value:function(e){return this.vector_transform.apply(this,(0,y.Z)(this.values).concat([e]))}}]),n}(o.Transform);n.CustomJSTransform=c,a=c,c.__name__="CustomJSTransform",a.define((function(e){var t=e.Unknown,n=e.String;return{args:[(0,e.Dict)(t),{}],func:[n,""],v_func:[n,""]}}))},function(e,t,n,i,r){var a;i();var o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"_compute",value:function(e){return e+this.value}}]),n}(e(324).RangeTransform);n.Dodge=o,a=o,o.__name__="Dodge",a.define((function(e){return{value:[e.Number,0]}}))},function(e,t,n,i,r){var a;i();var o=e(56),s=e(57),l=e(67),u=e(24),c=e(8),h=e(11),_=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"v_compute",value:function(e){var t;this.range instanceof l.FactorRange?t=this.range.v_synthetic(e):(0,c.isArrayableOf)(e,c.isNumber)?t=e:(0,h.unreachable)();for(var n=new((0,u.infer_type)(t))(t.length),i=0;i<t.length;i++){var r=t[i];n[i]=this._compute(r)}return n}},{key:"compute",value:function(e){return this.range instanceof l.FactorRange?this._compute(this.range.synthetic(e)):(0,c.isNumber)(e)?this._compute(e):void(0,h.unreachable)()}}]),n}(o.Transform);n.RangeTransform=_,a=_,_.__name__="RangeTransform",a.define((function(e){var t=e.Ref;return{range:[(0,e.Nullable)(t(s.Range)),null]}}))},function(e,t,n,i,r){var a;i();var o=e(56),s=e(70),l=e(24),u=e(9),c=e(8),h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e))._sorted_dirty=!0,i}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.change,(function(){return e._sorted_dirty=!0}))}},{key:"v_compute",value:function(e){for(var t=new((0,l.infer_type)(e))(e.length),n=0;n<e.length;n++){var i=e[n];t[n]=this.compute(i)}return t}},{key:"sort",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._sorted_dirty){var t,n;if((0,c.isString)(this.x)&&(0,c.isString)(this.y)&&null!=this.data){var i=this.data.columns();if(!(0,u.includes)(i,this.x))throw new Error("The x parameter does not correspond to a valid column name defined in the data parameter");if(!(0,u.includes)(i,this.y))throw new Error("The y parameter does not correspond to a valid column name defined in the data parameter");t=this.data.get_column(this.x),n=this.data.get_column(this.y)}else{if(!(0,c.isArray)(this.x)||!(0,c.isArray)(this.y))throw new Error("parameters 'x' and 'y' must be both either string fields or arrays");t=this.x,n=this.y}if(t.length!==n.length)throw new Error("The length for x and y do not match");if(t.length<2)throw new Error("x and y must have at least two elements to support interpolation");for(var r=t.length,a=new Uint32Array(r),o=0;o<r;o++)a[o]=o;var s=e?-1:1;a.sort((function(e,n){return s*(t[e]-t[n])})),this._x_sorted=new((0,l.infer_type)(t))(r),this._y_sorted=new((0,l.infer_type)(n))(r);for(var h=0;h<r;h++)this._x_sorted[h]=t[a[h]],this._y_sorted[h]=n[a[h]];this._sorted_dirty=!1}}}]),n}(o.Transform);n.Interpolator=h,a=h,h.__name__="Interpolator",a.define((function(e){var t=e.Boolean,n=e.Number,i=e.String,r=e.Ref,a=e.Array,o=e.Or,l=e.Nullable;return{x:[o(i,a(n))],y:[o(i,a(n))],data:[l(r(s.ColumnarDataSource)),null],clip:[t,!0]}}))},function(e,t,n,i,r){i();var a,o=e(1),s=e(324),l=e(67),u=e(20),c=e(8),h=e(12),_=(0,o.__importStar)(e(10)),d=e(11),f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"v_compute",value:function(e){var t,n,i=this;this.range instanceof l.FactorRange?n=this.range.v_synthetic(e):(0,c.isArrayableOf)(e,c.isNumber)?n=e:(0,d.unreachable)();var r=n.length;(null===(t=this.previous_offsets)||void 0===t?void 0:t.length)!=r&&(this.previous_offsets=new Array(r),this.previous_offsets=(0,h.map)(this.previous_offsets,(function(){return i._compute()})));var a=this.previous_offsets;return(0,h.map)(n,(function(e,t){return a[t]+e}))}},{key:"_compute",value:function(){switch(this.distribution){case"uniform":return this.mean+(_.random()-.5)*this.width;case"normal":return _.rnorm(this.mean,this.width)}}}]),n}(s.RangeTransform);n.Jitter=f,a=f,f.__name__="Jitter",a.define((function(e){var t=e.Number;return{mean:[t,0],width:[t,1],distribution:[u.Distribution,"uniform"]}}))},function(e,t,n,i,r){i();var a=e(9),o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}
2return(0,b.Z)(n,[{key:"compute",value: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=(0,a.find_last_index)(this._x_sorted,(function(t){return t<e})),n=this._x_sorted[t],i=this._x_sorted[t+1],r=this._y_sorted[t],o=this._y_sorted[t+1];return r+(e-n)/(i-n)*(o-r)}}]),n}(e(325).Interpolator);n.LinearInterpolator=o,o.__name__="LinearInterpolator"},function(e,t,n,i,r){var a;i();var o=e(325),s=e(20),l=e(9),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"compute",value: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=(0,l.find_last_index)(this._x_sorted,(function(t){return e>=t}));break;case"before":t=(0,l.find_index)(this._x_sorted,(function(t){return e<=t}));break;case"center":var n=(0,l.map)(this._x_sorted,(function(t){return Math.abs(t-e)})),i=(0,l.min)(n);t=(0,l.find_index)(n,(function(e){return i===e}));break;default:throw new Error("unknown mode: ".concat(this.mode))}return-1!=t?this._y_sorted[t]:NaN}}]),n}(o.Interpolator);n.StepInterpolator=u,a=u,u.__name__="StepInterpolator",a.define((function(){return{mode:[s.StepMode,"after"]}}))},function(e,t,n,i,r){i(),r("MapOptions",e(330).MapOptions),r("GMapOptions",e(330).GMapOptions),r("GMapPlot",e(330).GMapPlot),r("Plot",e(331).Plot)},function(e,t,n,i,r){var a,o,s;i();var l=e(331),u=e(53),c=e(58),h=e(336);r("GMapPlotView",h.GMapPlotView);var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(u.Model);n.MapOptions=_,a=_,_.__name__="MapOptions",a.define((function(e){var t=e.Int,n=e.Number;return{lat:[n],lng:[n],zoom:[t,12]}}));var d=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(_);n.GMapOptions=d,o=d,d.__name__="GMapOptions",o.define((function(e){var t=e.Boolean,n=e.Int,i=e.String;return{map_type:[i,"roadmap"],scale_control:[t,!1],styles:[i],tilt:[n,45]}}));var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).use_map=!0,i}return(0,b.Z)(n)}(l.Plot);n.GMapPlot=f,s=f,f.__name__="GMapPlot",s.prototype.default_view=h.GMapPlotView,s.define((function(e){var t=e.String;return{map_options:[(0,e.Ref)(d)],api_key:[t],api_version:[t,"weekly"]}})),s.override({x_range:function(){return new c.Range1d},y_range:function(){return new c.Range1d}})},function(e,t,n,i,r){i();var a,o=e(1),s=(0,o.__importStar)(e(48)),l=(0,o.__importStar)(e(18)),c=e(15),h=e(20),f=e(9),m=e(13),x=e(8),k=e(309),Z=e(128),A=e(306),S=e(40),T=e(118),M=e(59),C=e(221),z=e(57),E=e(55),R=e(75),B=e(41),N=e(176),O=e(175),D=e(63),I=e(332);r("PlotView",I.PlotView);var P=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).use_map=!1,i}return(0,b.Z)(n,[{key:"_doc_attached",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"_doc_attached",this).call(this),this._push_changes([[this.properties.inner_height,null,this.inner_height],[this.properties.inner_width,null,this.inner_width]])}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.reset=new c.Signal0(this,"reset");var e,t=(0,w.Z)((0,m.values)(this.extra_x_ranges).concat(this.x_range));try{for(t.s();!(e=t.n()).done;){var i=e.value,r=i.plots;(0,x.isArray)(r)&&(r=r.concat(this),i.setv({plots:r},{silent:!0}))}}catch(u){t.e(u)}finally{t.f()}var a,o=(0,w.Z)((0,m.values)(this.extra_y_ranges).concat(this.y_range));try{for(o.s();!(a=o.n()).done;){var s=a.value,l=s.plots;(0,x.isArray)(l)&&(l=l.concat(this),s.setv({plots:l},{silent:!0}))}}catch(u){o.e(u)}finally{o.f()}}},{key:"add_layout",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"center",n=this.properties[t].get_value();this.setv((0,u.Z)({},t,[].concat((0,y.Z)(n),[e])))}},{key:"remove_layout",value:function(e){var t=function(t){(0,f.remove_by)(t,(function(t){return t==e}))};t(this.left),t(this.right),t(this.above),t(this.below),t(this.center)}},{key:"data_renderers",get:function(){return this.renderers.filter((function(e){return e instanceof N.DataRenderer}))}},{key:"add_renderers",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.renderers=this.renderers.concat(t)}},{key:"add_glyph",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new R.ColumnDataSource,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new O.GlyphRenderer(Object.assign(Object.assign({},n),{data_source:t,glyph:e}));return this.add_renderers(i),i}},{key:"add_tools",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.toolbar.tools=this.toolbar.tools.concat(t)}},{key:"panels",get:function(){return[].concat((0,y.Z)(this.side_panels),(0,y.Z)(this.center))}},{key:"side_panels",get:function(){var e=this.above,t=this.below,n=this.left,i=this.right;return(0,f.concat)([e,t,n,i])}}]),n}(k.LayoutDOM);n.Plot=P,a=P,P.__name__="Plot",a.prototype.default_view=I.PlotView,a.mixins([["outline_",s.Line],["background_",s.Fill],["border_",s.Fill]]),a.define((function(e){var t=e.Boolean,n=e.Number,i=e.String,r=e.Array,a=e.Dict,o=e.Or,s=e.Ref,u=e.Null,c=e.Nullable;return{toolbar:[s(C.Toolbar),function(){return new C.Toolbar}],toolbar_location:[c(h.Location),"right"],toolbar_sticky:[t,!0],plot_width:[l.Alias("width")],plot_height:[l.Alias("height")],frame_width:[c(n),null],frame_height:[c(n),null],title:[o(s(T.Title),i,u),"",{convert:function(e){return(0,x.isString)(e)?new T.Title({text:e}):e}}],title_location:[c(h.Location),"above"],above:[r(o(s(S.Annotation),s(Z.Axis))),[]],below:[r(o(s(S.Annotation),s(Z.Axis))),[]],left:[r(o(s(S.Annotation),s(Z.Axis))),[]],right:[r(o(s(S.Annotation),s(Z.Axis))),[]],center:[r(o(s(S.Annotation),s(A.Grid))),[]],renderers:[r(s(B.Renderer)),[]],x_range:[s(z.Range),function(){return new D.DataRange1d}],y_range:[s(z.Range),function(){return new D.DataRange1d}],x_scale:[s(E.Scale),function(){return new M.LinearScale}],y_scale:[s(E.Scale),function(){return new M.LinearScale}],extra_x_ranges:[a(s(z.Range)),{}],extra_y_ranges:[a(s(z.Range)),{}],extra_x_scales:[a(s(E.Scale)),{}],extra_y_scales:[a(s(E.Scale)),{}],lod_factor:[n,10],lod_interval:[n,300],lod_threshold:[c(n),2e3],lod_timeout:[n,500],hidpi:[t,!0],output_backend:[h.OutputBackend,"canvas"],min_border:[c(n),5],min_border_top:[c(n),null],min_border_left:[c(n),null],min_border_bottom:[c(n),null],min_border_right:[c(n),null],inner_width:[n,0],inner_height:[n,0],outer_width:[n,0],outer_height:[n,0],match_aspect:[t,!1],aspect_scale:[n,1],reset_policy:[h.ResetPolicy,"standard"]}})),a.override({width:600,height:600,outline_line_color:"#e5e5e5",border_fill_color:"#ffffff",background_fill_color:"#ffffff"})},function(e,t,n,i,r){i();var a=e(1),o=e(126),s=e(249),l=e(309),c=e(40),h=e(118),f=e(128),m=e(220),A=e(251),S=e(113),T=e(45),M=e(19),C=e(251),z=e(333),E=e(8),R=e(9),B=e(235),N=e(208),O=e(211),D=e(209),I=e(123),P=e(65),V=e(334),L=e(335),j=e(28),U=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._outer_bbox=new P.BBox,e._inner_bbox=new P.BBox,e._needs_paint=!0,e._needs_layout=!1,e._invalidated_painters=new Set,e._invalidate_all=!0,e._needs_notify=!1,e}return(0,b.Z)(n,[{key:"canvas",get:function(){return this.canvas_view}},{key:"state",get:function(){return this._state_manager}},{key:"invalidate_dataranges",set:function(e){this._range_manager.invalidate_dataranges=e}},{key:"renderer_view",value:function(e){var t=this.renderer_views.get(e);if(null==t){var n,i=(0,w.Z)(this.renderer_views);try{for(i.s();!(n=i.n()).done;){var r=(0,k.Z)(n.value,2)[1].renderer_view(e);if(null!=r)return r}}catch(a){i.e(a)}finally{i.f()}}return t}},{key:"is_paused",get:function(){return null!=this._is_paused&&0!==this._is_paused}},{key:"child_models",get:function(){return[]}},{key:"pause",value:function(){null==this._is_paused?this._is_paused=1:this._is_paused+=1}},{key:"unpause",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null==this._is_paused)throw new Error("wasn't paused");this._is_paused-=1,0!=this._is_paused||e||this.request_paint("everything")}},{key:"notify_finished_after_paint",value:function(){this._needs_notify=!0}},{key:"request_render",value:function(){this.request_paint("everything")}},{key:"request_paint",value:function(e){this.invalidate_painters(e),this.schedule_paint(
2)}},{key:"invalidate_painters",value:function(e){if("everything"==e)this._invalidate_all=!0;else if((0,E.isArray)(e)){var t,n=(0,w.Z)(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this._invalidated_painters.add(i)}}catch(r){n.e(r)}finally{n.f()}}else this._invalidated_painters.add(e)}},{key:"schedule_paint",value:function(){if(!this.is_paused){var e=this.throttled_paint();this._ready=this._ready.then((function(){return e}))}}},{key:"request_layout",value:function(){this._needs_layout=!0,this.request_paint("everything")}},{key:"reset",value:function(){"standard"==this.model.reset_policy&&(this.state.clear(),this.reset_range(),this.reset_selection()),this.model.trigger_event(new A.Reset)}},{key:"remove",value:function(){(0,S.remove_views)(this.renderer_views),(0,S.remove_views)(this.tool_views),this.canvas_view.remove(),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"render",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"render",this).call(this),this.el.appendChild(this.canvas_view.el),this.canvas_view.render()}},{key:"initialize",value:function(){var e=this;this.pause(),(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.lod_started=!1,this.visual
2s=new T.Visuals(this),this._initial_state={selection:new Map,dimensions:{width:0,height:0}},this.visibility_callbacks=[],this.renderer_views=new Map,this.tool_views=new Map,this.frame=new o.CartesianFrame(this.model.x_scale,this.model.y_scale,this.model.x_range,this.model.y_range,this.model.extra_x_ranges,this.model.extra_y_ranges,this.model.extra_x_scales,this.model.extra_y_scales),this._range_manager=new V.RangeManager(this),this._state_manager=new L.StateManager(this,this._initial_state),this.throttled_paint=(0,z.throttle)((function(){return e.repaint()}),1e3/60);var t=this.model,i=t.title_location,r=t.title;null!=i&&null!=r&&(this._title=r instanceof h.Title?r:new h.Title({text:r}));var a=this.model,s=a.toolbar_location,l=a.toolbar;null!=s&&null!=l&&(this._toolbar=new m.ToolbarPanel({toolbar:l}),l.toolbar_location=s)}},{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,i,r,a;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:return t=this.model,i=t.hidpi,r=t.output_backend,a=new s.Canvas({hidpi:i,output_backend:r}),e.next=5,(0,S.build_view)(a,{parent:this});case 5:return this.canvas_view=e.sent,this.canvas_view.plot_views=[this],e.next=9,this.build_renderer_views();case 9:return e.next=11,this.build_tool_views();case 11:this._range_manager.update_dataranges(),this.unpause(!0),M.logger.debug("PlotView initialized");case 14:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_width_policy",value:function(){return null==this.model.frame_width?(0,_.Z)((0,d.Z)(n.prototype),"_width_policy",this).call(this):"min"}},{key:"_height_policy",value:function(){return null==this.model.frame_height?(0,_.Z)((0,d.Z)(n.prototype),"_height_policy",this).call(this):"min"}},{key:"_update_layout",value:function(){var e,t,n,i,r,a=this;this.layout=new O.BorderLayout,this.layout.set_sizing(this.box_sizing());var o=(0,R.copy)(this.model.above),s=(0,R.copy)(this.model.below),l=(0,R.copy)(this.model.left),_=(0,R.copy)(this.model.right),d=function(e){switch(e){case"above":return o;case"below":return s;case"left":return l;case"right":return _}},f=this.model,v=f.title_location,p=f.title;null!=v&&null!=p&&d(v).push(this._title);var y=this.model,g=y.toolbar_location,b=y.toolbar;if(null!=g&&null!=b){var x=d(g),k=!0;if(this.model.toolbar_sticky)for(var Z=0;Z<x.length;Z++){var A=x[Z];if(A instanceof h.Title){x[Z]="above"==g||"below"==g?[A,this._toolbar]:[this._toolbar,A],k=!1;break}}k&&x.push(this._toolbar)}var S=function(e,t){var n,i=a.renderer_view(t);return i.panel=new I.Panel(e),null===(n=i.update_layout)||void 0===n||n.call(i),i.layout},T=function(e,t){var n,i="above"==e||"below"==e,r=[],a=(0,w.Z)(t);try{for(a.s();!(n=a.n()).done;){var o=n.value;if((0,E.isArray)(o)){var s=o.map((function(t){var n=S(e,t);if(t instanceof m.ToolbarPanel){var r=i?"width_policy":"height_policy";n.set_sizing(Object.assign(Object.assign({},n.sizing),(0,u.Z)({},r,"min")))}return n})),l=void 0;i?(l=new D.Row(s)).set_sizing({width_policy:"max",height_policy:"min"}):(l=new D.Column(s)).set_sizing({width_policy:"min",height_policy:"max"}),l.absolute=!0,r.push(l)}else r.push(S(e,o))}}catch(c){a.e(c)}finally{a.f()}return r},M=null!==(e=this.model.min_border)&&void 0!==e?e:0;this.layout.min_border={left:null!==(t=this.model.min_border_left)&&void 0!==t?t:M,top:null!==(n=this.model.min_border_top)&&void 0!==n?n:M,right:null!==(i=this.model.min_border_right)&&void 0!==i?i:M,bottom:null!==(r=this.model.min_border_bottom)&&void 0!==r?r:M};var C=new N.NodeLayout,z=new N.VStack,B=new N.VStack,P=new N.HStack,V=new N.HStack;C.absolute=!0,z.absolute=!0,B.absolute=!0,P.absolute=!0,V.absolute=!0,C.children=this.model.center.filter((function(e){return e instanceof c.Annotation})).map((function(e){var t,n=a.renderer_view(e);return null===(t=n.update_layout)||void 0===t||t.call(n),n.layout})).filter((function(e){return null!=e}));var L=this.model,j=L.frame_width,U=L.frame_height;C.set_sizing(Object.assign(Object.assign({},null!=j?{width_policy:"fixed",width:j}:{width_policy:"fit"}),null!=U?{height_policy:"fixed",height:U}:{height_policy:"fit"})),C.on_resize((function(e){return a.frame.set_geometry(e)})),z.children=(0,R.reversed)(T("above",o)),B.children=T("below",s),P.children=(0,R.reversed)(T("left",l)),V.children=T("right",_),z.set_sizing({width_policy:"fit",height_policy:"min"}),B.set_sizing({width_policy:"fit",height_policy:"min"}),P.set_sizing({width_policy:"min",height_policy:"fit"}),V.set_sizing({width_policy:"min",height_policy:"fit"}),this.layout.center_panel=C,this.layout.top_panel=z,this.layout.bottom_panel=B,this.layout.left_panel=P,this.layout.right_panel=V}},{key:"axis_views",get:function(){var e,t=[],n=(0,w.Z)(this.renderer_views);try{for(n.s();!(e=n.n()).done;){var i=(0,k.Z)(e.value,2)[1];
2i instanceof f.AxisView&&t.push(i)}}catch(r){n.e(r)}finally{n.f()}return t}},{key:"set_toolbar_visibility",value:function(e){var t,n=(0,w.Z)(this.visibility_callbacks);try{for(n.s();!(t=n.n()).done;){(0,t.value)(e)}}catch(i){n.e(i)}finally{n.f()}}},{key:"update_range",value:function(e,t){this.pause(),this._range_manager.update(e,t),this.unpause()}},{key:"reset_range",value:function(){this.update_range(null),this.trigger_ranges_update_event()}},{key:"trigger_ranges_update_event",value:function(){var e=this.model,t=e.x_range,n=e.y_range;this.model.trigger_event(new C.RangesUpdate(t.start,t.end,n.start,n.end))}},{key:"get_selection",value:function(){var e,t=new Map,n=(0,w.Z)(this.model.data_renderers);try{for(n.s();!(e=n.n()).done;){var i=e.value,r=i.selection_manager.source.selected;t.set(i,r)}}catch(a){n.e(a)}finally{n.f()}return t}},{key:"update_selection",value:function(e){var t,n=(0,w.Z)(this.model.data_renderers);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=i.selection_manager.source;if(null!=e){var a=e.get(i);null!=a&&r.selected.update(a,!0)}else r.selection_manager.clear()}}catch(o){n.e(o)}finally{n.f()}}},{key:"reset_selection",value:function(){this.update_selection(null)}},{key:"_invalidate_layout",value:function(){var e=this;(function(){var t,n,i=(0,w.Z)(e.model.side_panels);try{for(i.s();!(n=i.n()).done;){var r=n.value,a=e.renderer_views.get(r);if(null===(t=a.layout)||void 0===t?void 0:t.has_size_changed())return e.invalidate_painters(a),!0}}catch(o){i.e(o)}finally{i.f()}return!1})()&&this.root.compute_layout()}},{key:"get_renderer_views",value:function(){var e=this;return this.computed_renderers.map((function(t){return e.renderer_views.get(t)}))}},{key:"_compute_renderers",value:(0,x.Z)().mark((function e(){var t,n,i,r,a,o,s,l,u,c;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.model,n=t.above,i=t.below,r=t.left,a=t.right,o=t.center,s=t.renderers,e.delegateYield(s,"t0",2);case 2:return e.delegateYield(n,"t1",3);case 3:return e.delegateYield(i,"t2",4);case 4:return e.delegateYield(r,"t3",5);case 5:return e.delegateYield(a,"t4",6);case 6:return e.delegateYield(o,"t5",7);case 7:if(e.t6=null!=this._title,!e.t6){e.next=11;break}return e.next=11,this._title;case 11:if(e.t7=null!=this._toolbar,!e.t7){e.next=15;break}return e.next=15,this._toolbar;case 15:l=(0,w.Z)(this.model.toolbar.tools),e.prev=16,l.s();case 18:if((u=l.n()).done){e.next=27;break}if(c=u.value,e.t8=null!=c.overlay,!e.t8){e.next=24;break}return e.next=24,c.overlay;case 24:return e.delegateYield(c.synthetic_renderers,"t9",25);case 25:e.next=18;break;case 27:e.next=32;break;case 29:e.prev=29,e.t10=e.catch(16),l.e(e.t10);case 32:return e.prev=32,l.f(),e.finish(32);case 35:case"end":return e.stop()}}),e,this,[[16,29,32,35]])}))},{key:"build_renderer_views",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.computed_renderers=(0,y.Z)(this._compute_renderers()),e.next=3,(0,S.build_views)(this.renderer_views,this.computed_renderers,{parent:this});case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"build_tool_views",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,n=this;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.model.toolbar.tools,e.next=3,(0,S.build_views)(this.tool_views,t,{parent:this});case 3:e.sent.map((function(e){return n.canvas_view.ui_event_bus.register_tool(e)}));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this);var t,i=this.frame,r=i.x_ranges,a=i.y_ranges,o=(0,w.Z)(r);try{for(o.s();!(t=o.n()).done;){var s=(0,k.Z)(t.value,2)[1];this.connect(s.change,(function(){e._needs_layout=!0,e.request_paint("everything")}))}}catch(b){o.e(b)}finally{o.f()}var l,u=(0,w.Z)(a);try{for(u.s();!(l=u.n()).done;){var c=(0,k.Z)(l.value,2)[1];this.connect(c.change,(function(){e._needs_layout=!0,e.request_paint("everything")}))}}catch(b){u.e(b)}finally{u.f()}var h=this.model.properties,f=h.above,v=h.below,p=h.left,m=h.right,y=h.center,g=h.renderers;this.on_change([f,v,p,m,y,g],(0,Z.Z)((0,x.Z)().mark((function t(){return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.build_renderer_views();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))),this.connect(this.model.toolbar.properties.tools.change,(0,Z.Z)((0,x.Z)().mark((function t(){return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.build_renderer_views();case 2:return t.next=4,e.build_tool_views();case 4:case"end":return t.stop()}}),t)})))),this.connect(this.model.change,(function(){return e.request_paint("everything")})),this.connect(this.model.reset,(function(){return e.reset()}))}},{key:"has_finished",value:function(){if(!(0,_.Z)((0,d.Z)(n.prototype),"has_finished",this).call(this))return!1;if(this.model.visible){var e,t=(0,w.Z)(this.renderer_views);try{for(t.s();!(e=t.n()).done;){if(!(0,k.Z)(e.value,2)[1].has_finished())return!1}}catch(i){t.e(i)}finally{t.f()}}return!0}},{key:"after_layout",value:function(){var e;(0,_.Z)((0,d.Z)(n.prototype),"after_layout",this).call(this);var t,i=(0,w.Z)(this.renderer_views);try{for(i.s();!(t=i.n()).done;){var r=(0,k.Z)(t.value,2)[1];
2r instanceof c.AnnotationView&&(null===(e=r.after_layout)||void 0===e||e.call(r))}}catch(u){i.e(u)}finally{i.f()}if(this._needs_layout=!1,this.model.setv({inner_width:Math.round(this.frame.bbox.width),inner_height:Math.round(this.frame.bbox.height),outer_width:Math.round(this.layout.bbox.width),outer_height:Math.round(this.layout.bbox.height)},{no_change:!0}),!1!==this.model.match_aspect&&(this.pause(),this._range_manager.update_dataranges(),this.unpause(!0)),!this._outer_bbox.equals(this.layout.bbox)){var a=this.layout.bbox,o=a.width,s=a.height;this.canvas_view.resize(o,s),this._outer_bbox=this.layout.bbox,this._invalidate_all=!0,this._needs_paint=!0}var l=this.layout.inner_bbox;this._inner_bbox.equals(l)||(this._inner_bbox=l,this._needs_paint=!0),this._needs_paint&&this.paint()}},{key:"repaint",value:function(){this._needs_layout&&this._invalidate_layout(),this.paint()}},{key:"paint",value:function(){this.is_paused||(this.model.visible&&(M.logger.trace("".concat(this.toString(),".paint()")),this._actual_paint()),this._needs_notify&&(this._needs_notify=!1,this.notify_finished()))}},{key:"_actual_paint",value:function(){var e,t=this,n=this.model.document;if(null!=n){var i=n.interactive_duration();i>=0&&i<this.model.lod_interval?setTimeout((function(){n.interactive_duration()>t.model.lod_timeout&&n.interactive_stop(),t.request_paint("everything")}),this.model.lod_timeout):n.interactive_stop()}this._range_manager.invalidate_dataranges&&(this._range_manager.update_dataranges(),this._invalidate_layout());var r=!1,a=!1;if(this._invalidate_all)r=!0,a=!0;else{var o,s=(0,w.Z)(this._invalidated_painters);try{for(s.s();!(o=s.n()).done;){if("overlay"!=o.value.model.level?r=!0:a=!0,r&&a)break}}catch(_){s.e(_)}finally{s.f()}}this._invalidated_painters.clear(),this._invalidate_all=!1;var l=[this.frame.bbox.left,this.frame.bbox.top,this.frame.bbox.width,this.frame.bbox.height],u=this.canvas_view,c=u.primary,h=u.overlays;r&&(c.prepare(),this.canvas_view.prepare_webgl(l),this._map_hook(c.ctx,l),this._paint_empty(c.ctx,l),this._paint_outline(c.ctx,l),this._paint_levels(c.ctx,"image",l,!0),this._paint_levels(c.ctx,"underlay",l,!0),this._paint_levels(c.ctx,"glyph",l,!0),this._paint_levels(c.ctx,"guide",l,!1),this._paint_levels(c.ctx,"annotation",l,!1),c.finish()),(a||j.settings.wireframe)&&(h.prepare(),this._paint_levels(h.ctx,"overlay",l,!1),j.settings.wireframe&&this._paint_layout(h.ctx,this.layout),h.finish()),null==this._initial_state.range&&(this._initial_state.range=null!==(e=this._range_manager.compute_initial())&&void 0!==e?e:void 0),this._needs_paint=!1}},{key:"_paint_levels",value:function(e,t,n,i){var r,a=(0,w.Z)(this.computed_renderers);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(o.level==t){var s=this.renderer_views.get(o);e.save(),(i||s.needs_clip)&&(e.beginPath(),e.rect.apply(e,(0,y.Z)(n)),e.clip()),s.render(),e.restore(),s.has_webgl&&s.needs_webgl_blit&&this.canvas_view.blit_webgl(e)}}}catch(l){a.e(l)}finally{a.f()}}},{key:"_paint_layout",value:function(e,t){var n=t.bbox,i=n.x,r=n.y,a=n.width,o=n.height;e.strokeStyle="blue",e.strokeRect(i,r,a,o);var s,l=(0,w.Z)(t);try{for(l.s();!(s=l.n()).done;){var u=s.value;e.save(),t.absolute||e.translate(i,r),this._paint_layout(e,u),e.restore()}}catch(c){l.e(c)}finally{l.f()}}},{key:"_map_hook",value:function(e,t){}},{key:"_paint_empty",value:function(e,t){var n=[0,0,this.layout.bbox.width,this.layout.bbox.height],i=n[0],r=n[1],a=n[2],o=n[3],s=(0,k.Z)(t,4),l=s[0],u=s[1],c=s[2],h=s[3];this.visuals.border_fill.doit&&(this.visuals.border_fill.set_value(e),e.fillRect(i,r,a,o),e.clearRect(l,u,c,h)),this.visual
2s.background_fill.doit&&(this.visuals.background_fill.set_value(e),e.fillRect(l,u,c,h))}},{key:"_paint_outline",value:function(e,t){if(this.visuals.outline_line.doit){e.save(),this.visuals.outline_line.set_value(e);var n=(0,k.Z)(t,4),i=n[0],r=n[1],a=n[2],o=n[3];i+a==this.layout.bbox.width&&(a-=1),r+o==this.layout.bbox.height&&(o-=1),e.strokeRect(i,r,a,o),e.restore()}}},{key:"to_blob",value:function(){return this.canvas_view.to_blob()}},{key:"export",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="png"==e?"canvas":"svg",i=new B.CanvasLayer(n,t),r=this.layout.bbox,a=r.width,o=r.height;i.resize(a,o);var s=this.canvas_view.compose().canvas;return i.ctx.drawImage(s,0,0),i}},{key:"serializable_state",value:function(){var e=(0,_.Z)((0,d.Z)(n.prototype),"serializable_state",this).call(this),t=e.children,i=(0,a.__rest)(e,["children"]),r=this.get_renderer_views().map((function(e){return e.serializable_state()})).filter((function(e){return null!=e.bbox}));return Object.assign(Object.assign({},i),{children:[].concat((0,y.Z)(null!=t?t:[]),(0,y.Z)(r))})}}]),n}(l.LayoutDOMView);n.PlotView=U,U.__name__="PlotView"},function(e,t,n,i,r){i(),n.throttle=function(e,t){var n=null,i=0,r=!1;return function(){return new Promise((function(a,o){var s=function(){i=Date.now(),n=null,r=!1;try{e(),a()}catch(e){o(e)}},l=Date.now(),u=t-(l-i);u<=0&&!r?(null!=n&&clearTimeout(n),r=!0,requestAnimationFrame(s)):n||r?a():n=setTimeout((function(){return requestAnimationFrame(s)}),u)}))}}},function(e,t,n,i,r){i();var a=e(63),o=e(19),s=function(){function e(t){(0,g.Z)(this,e),this.parent=t,this.invalidate_dataranges=!0}return(0,b.Z)(e,[{key:"frame",get:function(){return this.parent.frame}},{key:"update",value:function(e,t){var n=this.frame,i=n.x_ranges,r=n.y_ranges;if(null==e){var a,o=(0,w.Z)(i);try{for(o.s();!(a=o.n()).done;){(0,k.Z)(a.value,2)[1].reset()}}catch(b){o.e(b)}finally{o.f()}var s,l=(0,w.Z)(r);try{for(l.s();!(s=l.n()).done;){(0,k.Z)(s.value,2)[1].reset()}}catch(b){l.e(b)}finally{l.f()}this.update_dataranges()}else{var u,c=[],h=(0,w.Z)(i);try{for(h.s();!(u=h.n()).done;){var _=(0,k.Z)(u.value,2),d=_[0],f=_[1];c.push([f,e.xrs.get(d)])}}catch(b){h.e(b)}finally{h.f()}var v,p=(0,w.Z)(r);try{for(p.s();!(v=p.n()).done;){var m=(0,k.Z)(v.value,2),y=m[0],g=m[1];c.push([g,e.yrs.get(y)])}}catch(b){p.e(b)}finally{p.f()}(null==t?void 0:t.scrolling)&&this._update_ranges_together(c),this._update_ranges_individually(c,t)}}},{key:"reset",value:function(){this.update(null)}},{key:"_update_dataranges",value:function(e){var t,n=new Map,i=new Map,r=!1,s=(0,w.Z)(e.x_ranges);try{for(s.s();!(t=s.n()).done;){var l=(0,k.Z)(t.value,2)[1];l instanceof a.DataRange1d&&"log"==l.scale_hint&&(r=!0)}}catch(I){s.e(I)}finally{s.f()}var u,c=(0,w.Z)(e.y_ranges);try{for(c.s();!(u=c.n()).done;){var h=(0,k.Z)(u.value,2)[1];h instanceof a.DataRange1d&&"log"==h.scale_hint&&(r=!0)}}catch(I){c.e(I)}finally{c.f()}var _,d=(0,w.Z)(this.parent.model.data_renderers);try{for(d.s();!(_=d.n()).done;){var f=_.value,v=this.parent.renderer_view(f);if(null!=v){var p=v.glyph_view.bounds();if(null!=p&&n.set(f,p),r){var m=v.glyph_view.log_bounds();null!=m&&i.set(f,m)}}}}catch(I){d.e(I)}finally{d.f()}var y,g=!1,b=!1,x=e.x_target.span,Z=e.y_target.span;!1!==this.parent.model.match_aspect&&0!=x&&0!=Z&&(y=1/this.parent.model.aspect_scale*(x/Z));var A,S=(0,w.Z)(e.x_ranges);try{for(S.s();!(A=S.n()).done;){var T=(0,k.Z)(A.value,2)[1];if(T instanceof a.DataRange1d){var M="log"==T.scale_hint?i:n;T.update(M,0,this.parent.model,y),T.follow&&(g=!0)}null!=T.bounds&&(b=!0)}}catch(I){S.e(I)}finally{S.f()}var C,z=(0,w.Z)(e.y_ranges);try{for(z.s();!(C=z.n()).done;){var E=(0,k.Z)(C.value,2)[1];if(E instanceof a.DataRange1d){var R="log"==E.scale_hint?i:n;E.update(R,1,this.parent.model,y),E.follow&&(g=!0)}null!=E.bounds&&(b=!0)}}catch(I){z.e(I)}finally{z.f()}if(g&&b){o.logger.warn("Follow enabled so bounds are unset.");var B,N=(0,w.Z)(e.x_ranges);try{for(N.s();!(B=N.n()).done;){(0,k.Z)(B.value,2)[1].bounds=null}}catch(I){N.e(I)}finally{N.f()}var O,D=(0,w.Z)(e.y_ranges);try{for(D.s();!(O=D.n()).done;){(0,k.Z)(O.value,2)[1].bounds=null}}catch(I){D.e(I)}finally{D.f()}}}},{key:"update_dataranges",value:function(){this._update_dataranges(this.frame);var e,t=(0,w.Z)(this.parent.model.renderers);try{for(t.s();!(e=t.n()).done;){var n=e.value.coordinates;null!=n&&this._update_dataranges(n)}}catch(i){t.e(i)}finally{t.f()}null!=this.compute_initial()&&(this.invalidate_dataranges=!1)}},{key:"compute_initial",value:function(){var e,t=!0,n=this.frame,i=n.x_ranges,r=n.y_ranges,a=new Map,s=new Map,l=(0,w.Z)(i);try{for(l.s();!(e=l.n()).done;){var u=(0,k.Z)(e.value,2),c=u[0],h=u[1],_=h.start,d=h.end;if(null==_||null==d||isNaN(_+d)){t=!1;break}a.set(c,{start:_,end:d})}}catch(x){l.e(x)}finally{l.f()}if(t){var f,v=(0,w.Z)(r);try{for(v.s();!(f=v.n()).done;){var p=(0,k.Z)(f.value,2),m=p[0],y=p[1],g=y.start,b=y.end;if(null==g||null==b||isNaN(g+b)){t=!1;break}s.set(m,{start:g,end:b})}}catch(x){v.e(x)}finally{v.f()}}return t?{xrs:a,yrs:s}:(o.logger.warn("could not set initial ranges"),null)}},{key:"_update_ranges_together",value:function(e){var t,n=1,i=(0,w.Z)(e);try{for(i.s();!(t=i.n()).done;){var r=(0,k.Z)(t.value,2),a=r[0],o=r[1];n=Math.min(n,this._get_weight_to_constrain_interval(a,o))}}catch(_){i.e(_)}finally{i.f()}if(n<1){var s,l=(0,w.Z)(e);try{for(l.s();!(s=l.n()).done;){var u=(0,k.Z)(s.value,2),c=u[0],h=u[1];h.start=n*h.start+(1-n)*c.start,h.end=n*h.end+(1-n)*c.end}}catch(_){l.e(_)}finally{l.f()}}}},{key:"_update_ranges_individually",value:function(e,t){var n,i=!!(null==t?void 0:t.panning),r=!!(null==t?void 0:t.scrolling),a=!1,o=(0,w.Z)(e);try{for(o.s();!(n=o.n()).done;){var s=(0,k.Z)(n.value,2),l=s[0],u=s[1];if(!r){var c=this._get_weight_to_constrain_interval(l,u);c<1&&(u.start=c*u.start+(1-c)*l.start,u.end=c*u.end+(1-c)*l.end)}if(null!=l.bounds&&"auto"!=l.bounds){var h=(0,k.Z)(l.bounds,2),_=h[0],d=h[1],f=Math.abs(u.end-u.start);l.is_reversed?(null!=_&&_>u.end&&(a=!0,u.end=_,(i||r)&&(u.start=_+f)),null!=d&&d<u.start&&(a=!0,u.start=d,(i||r)&&(u.end=d-f))):(null!=_&&_>u.start&&(a=!0,u.start=_,(i||r)&&(u.end=_+f)),null!=d&&d<u.end&&(a=!0,u.end=d,(i||r)&&(u.start=d-f)))}}}catch(b){o.e(b)}finally{o.f()}if(!(r&&a&&(null==t?void 0:t.maintain_focus))){var v,p=(0,w.Z)(e);try{for(p.s();!(v=p.n()).done;){var m=(0,k.Z)(v.value,2),y=m[0],g=m[1];y.have_updated_interactively=!0,y.start==g.start&&y.end==g.end||y.setv(g)}}catch(b){p.e(b)}finally{p.f()}}}},{key:"_get_weight_to_constrain_interval",value:function(e,t){var n=e.min_interval,i=e.max_interval;if(null!=e.bounds&&"auto"!=e.bounds){var r=(0,k.Z)(e.bounds,2),a=r[0],o=r[1];if(null!=a&&null!=o){var s=Math.abs(o-a);i=null!=i?Math.min(i,s):s}}var l=1;if(null!=n||null!=i){var u=Math.abs(e.end-e.start),c=Math.abs(t.end-t.start);null!=n&&n>0&&c<n&&(l=(u-n)/(u-c)),null!=i&&i>0&&c>i&&(l=(i-u)/(c-u)),l=Math.max(0,Math.min(1,l))}return l}}]),e}();n.RangeManager=s,s.__name__="RangeManager"},function(e,t,n,i,r){i();var a=e(15),o=function(){function e(t,n){(0,g.Z)(this,e),this.parent=t,this.initial_state=n,this.changed=new a.Signal0(this.parent,"state_changed"),this.history=[],this.index=-1}return(0,b.Z)(e,[{key:"_do_state_change",value:function(e){var t=null!=this.history[e]?this.history[e].state:this.initial_state;return null!=t.range&&this.parent.update_range(t.range),null!=t.selection&&this.parent.update_selection(t.selection),t}},{key:"push",value:function(e,t){var n=this.history,i=this.index,r=null!=n[i]?n[i].state:{},a=Object.assign(Object.assign(Object.assign({},this.initial_state),r),t);this.history=this.history.slice(0,this.index+1),this.history.push({type:e,state:a}),this.index=this.history.length-1,this.changed.emit()}},{key:"clear",value:function(){this.history=[],this.index=-1,this.changed.emit()}},{key:"undo",value:function(){if(this.can_undo){this.index-=1;var e=this._do_state_change(this.index);return this.changed.emit(),e}return null}},{key:"redo",value:function(){if(this.can_redo){this.index+=1;var e=this._do_state_change(this.index);return this.changed.emit(),e}return null}},{key:"can_undo",get:function(){return this.index>=0}},{key:"can_redo",get:function(){return this.index<this.history.length-1}}]),e}();n.StateManager=o,o.__name__="StateManager"},function(e,t,n,i,r){i();var a=e(19),o=e(15),s=e(43),l=e(78),u=e(22),c=e(332),h=new o.Signal0({},"gmaps_ready"),f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"initialize",value:function(){var e=this;this.pause(),(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._tiles_loaded=!1,this.zoom_count=0;var t=this.model.map_options,i=t.zoom,r=t.lat,o=t.lng;if(this.initial_zoom=i,this.initial_lat=r,this.initial_lng=o,!this.model.api_key){a.logger.error("api_key is required. See ".concat("https://developers.google.com/maps/documentation/javascript/get-api-key"," for more information on how to obtain your own."))}if("undefined"==typeof google||null==google.maps){if(void 0===window._bokeh_gmaps_callback){var s=this.model;!function(e,t){window._bokeh_gmaps_callback=function(){return h.emit()};var n=encodeURIComponent,i=document.createElement("script");
2i.type="text/javascript",i.src="https://maps.googleapis.com/maps/api/js?v=".concat(n(t),"&key=").concat(n(e),"&callback=_bokeh_gmaps_callback"),document.body.appendChild(i)}(s.api_key,s.api_version)}h.connect((function(){return e.request_paint("everything")}))}this.unpause()}},{key:"remove",value:function(){(0,s.remove)(this.map_el),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"update_range",value:function(e,t){var i,r;if(null==e)this.map.setCenter({lat:this.initial_lat,lng:this.initial_lng}),this.map.setOptions({zoom:this.initial_zoom}),(0,_.Z)((0,d.Z)(n.prototype),"update_range",this).call(this,null,t);else if(null!=e.sdx||null!=e.sdy)this.map.panBy(null!==(i=e.sdx)&&void 0!==i?i:0,null!==(r=e.sdy)&&void 0!==r?r:0),(0,_.Z)((0,d.Z)(n.prototype),"update_range",this).call(this,e,t);else if(null!=e.factor){if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,this.pause(),(0,_.Z)((0,d.Z)(n.prototype),"update_range",this).call(this,e,t);var a=e.factor<0?-1:1,o=this.map.getZoom();if(null!=o){var s=o+a;if(s>=2){this.map.setZoom(s);var l=this._get_projected_bounds(),u=(0,k.Z)(l,2),c=u[0];u[1]-c<0&&this.map.setZoom(o)}}this.unpause()}this._set_bokeh_ranges()}},{key:"_build_map",value:function(){var e=this,t=google.maps;this.map_types={satellite:t.MapTypeId.SATELLITE,terrain:t.MapTypeId.TERRAIN,roadmap:t.MapTypeId.ROADMAP,hybrid:t.MapTypeId.HYBRID};var n=this.model.map_options,i={center:new t.LatLng(n.lat,n.lng),zoom:n.zoom,disableDefaultUI:!0,mapTypeId:this.map_types[n.map_type],scaleControl:n.scale_control,tilt:n.tilt};null!=n.styles&&(i.styles=JSON.parse(n.styles)),this.map_el=(0,s.div)({style:{position:"absolute"}}),this.canvas_view.add_underlay(this.map_el),this.map=new t.Map(this.map_el,i),t.event.addListener(this.map,"idle",(function(){return e._set_bokeh_ranges()})),t.event.addListener(this.map,"bounds_changed",(function(){return e._set_bokeh_ranges()})),t.event.addListenerOnce(this.map,"tilesloaded",(function(){return e._render_finished()})),this.connect(this.model.properties.map_options.change,(function(){return e._update_options()})),this.connect(this.model.map_options.properties.styles.change,(function(){return e._update_styles()})),this.connect(this.model.map_options.properties.lat.change,(function(){return e._update_center("lat")})),this.connect(this.model.map_options.properties.lng.change,(function(){return e._update_center("lng")})),this.connect(this.model.map_options.properties.zoom.change,(function(){return e._update_zoom()})),this.connect(this.model.map_options.properties.map_type.change,(function(){return e._update_map_type()})),this.connect(this.model.map_options.properties.scale_control.change,(function(){return e._update_scale_control()})),this.connect(this.model.map_options.properties.tilt.change,(function(){return e._update_tilt()}))}},{key:"_render_finished",value:function(){this._tiles_loaded=!0,this.notify_finished()}},{key:"has_finished",value:function(){return(0,_.Z)((0,d.Z)(n.prototype),"has_finished",this).call(this)&&!0===this._tiles_loaded}},{key:"_get_latlon_bounds",value:function(){var e=this.map.getBounds(),t=e.getNorthEast(),n=e.getSouthWest
2();return[n.lng(),t.lng(),n.lat(),t.lat()]}},{key:"_get_projected_bounds",value:function(){var e=this._get_latlon_bounds(),t=(0,k.Z)(e,4),n=t[0],i=t[1],r=t[2],a=t[3],o=l.wgs84_mercator.compute(n,r),s=(0,k.Z)(o,2),u=s[0],c=s[1],h=l.wgs84_mercator.compute(i,a),_=(0,k.Z)(h,2);return[u,_[0],c,_[1]]}},{key:"_set_bokeh_ranges",value:function(){var e=this._get_projected_bounds(),t=(0,k.Z)(e,4),n=t[0],i=t[1],r=t[2],a=t[3];this.frame.x_range.setv({start:n,end:i}),this.frame.y_range.setv({start:r,end:a})}},{key:"_update_center",value:function(e){var t,n=null===(t=this.map.getCenter())||void 0===t?void 0:t.toJSON();null!=n&&(n[e]=this.model.map_options[e],this.map.setCenter(n),this._set_bokeh_ranges())}},{key:"_update_map_type",value:function(){this.map.setOptions({mapTypeId:this.map_types[this.model.map_options.map_type]})}},{key:"_update_scale_control",value:function(){this.map.setOptions({scaleControl:this.model.map_options.scale_control})}},{key:"_update_tilt",value:function(){this.map.setOptions({tilt:this.model.map_options.tilt})}},{key:"_update_options",value:function(){this._update_styles(),this._update_center("lat"),this._update_center("lng"),this._update_zoom(),this._update_map_type()}},{key:"_update_styles",value:function(){this.map.setOptions({styles:JSON.parse(this.model.map_options.styles)})}},{key:"_update_zoom",value:function(){this.map.setOptions({zoom:this.model.map_options.zoom}),this._set_bokeh_ranges()}},{key:"_map_hook",value:function(e,t){if(null==this.map&&"undefined"!=typeof google&&null!=google.maps&&this._build_map(),null!=this.map_el){var n=(0,k.Z)(t,4),i=n[0],r=n[1],a=n[2],o=n[3];this.map_el.style.top="".concat(r,"px"),this.map_el.style.left="".concat(i,"px"),this.map_el.style.width="".concat(a,"px"),this.map_el.style.height="".concat(o,"px")}}},{key:"_paint_empty",value:function(e,t){var n=this.layout.bbox.width,i=this.layout.bbox.height,r=(0,k.Z)(t,4),a=r[0],o=r[1],s=r[2],l=r[3];e.clearRect(0,0,n,i),e.beginPath(),e.moveTo(0,0),e.lineTo(0,i),e.lineTo(n,i),e.lineTo(n,0),e.lineTo(0,0),e.moveTo(a,o),e.lineTo(a+s,o),e.lineTo(a+s,o+l),e.lineTo(a,o+l),e.lineTo(a,o),e.closePath(),null!=this.model.border_fill_color&&(e.fillStyle=(0,u.color2css)(this.model.border_fill_color),e.fill())}}]),n}(c.PlotView);n.GMapPlotView=f,f.__name__="GMapPlotView"},function(e,t,n,i,r){i(),(0,e(1).__exportStar)(e(132),n)},function(e,t,n,i,r){i(),r("GlyphRenderer",e(175).GlyphRenderer),r("GraphRenderer",e(339).GraphRenderer),r("GuideRenderer",e(129).GuideRenderer);var a=e(41);r("Renderer",a.Renderer),r("RendererGroup",a.RendererGroup)},function(e,t,n,i,r){var a;i();var o=e(176),s=e(175),l=e(303),u=e(302),c=e(113),h=e(178),f=e(283),m=e(286),y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"glyph_view",get:function(){return this.node_view.glyph}},{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,i,r,a;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:return this.apply_coordinates(),t=this.parent,i=this.model,r=i.edge_renderer,a=i.node_renderer,e.next=6,(0,c.build_view)(r,{parent:t});case 6:return this.edge_view=e.sent,e.next=9,(0,c.build_view)(a,{parent:t});case 9:this.node_view=e.sent;case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.layout_provider.change,(function(){e.apply_coordinates(),e.edge_view.set_data(),e.node_view.set_data(),e.request_render()}))}},{key:"apply_coordinates",value:function(){var e=this.model,t=e.edge_renderer,n=e.node_renderer;if(!(t.glyph instanceof f.MultiLine||t.glyph instanceof m.Patches))throw new Error("".concat(this,".edge_renderer.glyph must be a MultiLine glyph"));if(!(n.glyph instanceof h.XYGlyph))throw new Error("".concat(this,".node_renderer.glyph must be a XYGlyph glyph"));var i=this.model.layout_provider.edge_coordinates,r=this.model.layout_provider.node_coordinates;t.glyph.properties.xs.internal=!0,t.glyph.properties.ys.internal=!0,n.glyph.properties.x.internal=!0,n.glyph.properties.y.internal=!0,t.glyph.xs={expr:i.x},t.glyph.ys={expr:i.y},n.glyph.x={expr:r.x},n.glyph.y={expr:r.y}}},{key:"remove",value:function(){this.edge_view.remove(),this.node_view.remove(),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"_render",value:function(){this.edge_view.render(),this.node_view.render()}},{key:"renderer_view",value:function(e){if(e instanceof s.GlyphRenderer){if(e==this.edge_view.model)return this.edge_view;if(e==this.node_view.model)return this.node_view}return(0,_.Z)((0,d.Z)(n.prototype),"renderer_view",this).call(this,e)}}]),n}(o.DataRendererView);n.GraphRendererView=y,y.__name__="GraphRendererView";var w=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_selection_manager",value:function(){return this.node_renderer.data_source.selection_manager}}]),n}(o.DataRenderer);n.GraphRenderer=w,a=w,w.__name__="GraphRenderer",a.prototype.default_view=y,a.define((function(e){var t=e.Ref;return{layout_provider:[t(l.LayoutProvider)],node_renderer:[t(s.GlyphRenderer)],edge_renderer:[t(s.GlyphRenderer)],selection_policy:[t(u.GraphHitTestPolicy),function(){return new u.NodesOnly}],inspection_policy:[t(u.GraphHitTestPolicy),function(){return new u.NodesOnly}]}}))},function(e,t,n,i,r){i(),(0,e(1).__exportStar)(e(74),n),r("Selection",e(72).Selection)},function(e,t,n,i,r){i(),r("ServerSentDataSource",e(342).ServerSentDataSource),r("AjaxDataSource",e(344).AjaxDataSource),r("ColumnDataSource",e(75).ColumnDataSource),r("ColumnarDataSource",e(70).ColumnarDataSource),r("CDSView",e(190).CDSView),r("DataSource",e(71).DataSource),r("GeoJSONDataSource",e(345).GeoJSONDataSource),r("WebDataSource",e(343).WebDataSource)},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).initialized=!1,i}return(0,b.Z)(n,[{key:"setup",value:function(){var e=this;this.initialized||(this.initialized=!0,new EventSource(this.data_url).onmessage=function(t){var n;e.load_data(JSON.parse(t.data),e.mode,null!==(n=e.max_size)&&void 0!==n?n:void 0)})}}]),n}(e(343).WebDataSource);n.ServerSentDataSource=a,a.__name__="ServerSentDataSource"},function(e,t,n,i,r){var a;i();var o=e(75),s=e(20),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_column",value:function(e){var t=this.data[e];return null!=t?t:[]}},{key:"get_length",value:function(){var e;return null!==(e=(0,_.Z)((0,d.Z)(n.prototype),"get_length",this).call(this))&&void 0!==e?e:0}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.setup()}},{key:"load_data",value:function(e,t,n){var i,r=this.adapter;switch(i=null!=r?r.execute(this,{response:e}):e,t){case"replace":this.data=i;break;case"append":var a,o=this.data,s=(0,w.Z)(this.columns());try{for(s.s();!(a=s.n()).done;){var l=a.value,u=Array.from(o[l]),c=Array.from(i[l]),h=u.concat(c);i[l]=null!=n?h.slice(-n):h}}catch(_){s.e(_)}finally{s.f()}this.data=i}}}]),n}(o.ColumnDataSource);n.WebDataSource=l,a=l,l.__name__="WebDataSource",a.define((function(e){var t=e.Any,n=e.Int,i=e.String,r=e.Nullable;return{max_size:[r(n),null],mode:[s.UpdateMode,"replace"],adapter:[r(t),null],data_url:[i]}}))},function(e,t,n,i,r){var a;i();var o=e(343),s=e(20),l=e(19),u=e(13),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).interval=null,i.initialized=!1,i}return(0,b.Z)(n,[{key:"destroy",value:function(){null!=this.interval&&clearInterval(this.interval),(0,_.Z)((0,d.Z)(n.prototype),"destroy",this).call(this)}},{key:"setup",value:function(){var e=this;if(!this.initialized&&(this.initialized=!0,this.get_data(this.mode),null!=this.polling_interval)){this.interval=setInterval((function(){return e.get_data(e.mode,e.max_size,e.if_modified)}),this.polling_interval)}}},{key:"get_data",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.prepare_request();i.addEventListener("load",(function(){return t.do_load(i,e,null!=n?n:void 0)})),i.addEventListener("error",(function(){return t.do_error(i)})),i.send()}},{key:"prepare_request",value:function(){var e=new XMLHttpRequest;e.open(this.method,this.data_url,!0),e.withCredentials=!1,e.setRequestHeader("Content-Type",this.content_type);var t,n=this.http_headers,i=(0,w.Z)((0,u.entries)(n));try{for(i.s();!(t=i.n()).done;){var r=(0,k.Z)(t.value,2),a=r[0],o=r[1];e.setRequestHeader(a,o)}}catch(s){i.e(s)}finally{i.f()}return e}},{key:"do_load",value:function(e,t,n){if(200===e.status){var i=JSON.parse(e.responseText);this.load_data(i,t,n)}}},{key:"do_error",value:function(e){l.logger.error("Failed to fetch JSON from ".concat(this.data_url," with code ").concat(e.status))}}]),n}(o.WebDataSource);n.AjaxDataSource=c,a=c,c.__name__="AjaxDataSource",a.define((function(e){var t=e.Boolean,n=e.Int,i=e.String,r=e.Dict;return{polling_interval:[(0,e.Nullable)(n),null],content_type:[i,"application/json"],http_headers:[r(i),{}],method:[s.HTTPMethod,"POST"],if_modified:[t,!1]}}))},function(e,t,n,i,r){var a;i();var o=e(70),s=e(19),l=e(9),u=e(13);function c(e){return null!=e?e:NaN}var h=Object.prototype.hasOwnProperty,f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._update_data()}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.properties.geojson.change,(function(){return e._update_data()}))}},{key:"_update_data",value:function(){this.data=this.geojson_to_column_data()}},{key:"_get_new_list_array",value:function(e){return(0,l.range)(0,e).map((function(e){return[]}))}},{key:"_get_new_nan_array",value:function(e){return(0,l.range)(0,e).map((function(e){return NaN}))}},{key:"_add_properties",value:function(e,t,n,i){var r,a,o=null!==(r=e.properties)&&void 0!==r?r:{},s=(0,w.Z)((0,u.entries)(o));try{for(s.s();!(a=s.n()).done;){var l=(0,k.Z)(a.value,2),_=l[0],d=l[1];h.call(t,_)||(t[_]=this._get_new_nan_array(i)),t[_][n]=c(d)}}catch(f){s.e(f)}finally{s.f()}}},{key:"_add_geometry",value:function(e,t,n){function i(e,t){return e.concat([[NaN,NaN,NaN]]).concat(t)}switch(e.type){case"Point":var r=(0,k.Z)(e.coordinates,3),a=r[0],o=r[1],l=r[2];t.x[n]=a,t.y[n]=o,t.z[n]=c(l);break;case"LineString":for(var u=e.coordinates,h=0;h<u.length;h++){var _=(0,k.Z)(u[h],3),d=_[0],f=_[1],v=_[2];t.xs[n][h]=d,t.ys[n][h]=f,t.zs[n][h]=c(v)}break;
2case"Polygon":e.coordinates.length>1&&s.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used.");for(var p=e.coordinates[0],m=0;m<p.length;m++){var y=(0,k.Z)(p[m],3),g=y[0],b=y[1],x=y[2];t.xs[n][m]=g,t.ys[n][m]=b,t.zs[n][m]=c(x)}break;case"MultiPoint":s.logger.warn("MultiPoint not supported in Bokeh");break;case"MultiLineString":for(var Z=e.coordinates.reduce(i),A=0;A<Z.length;A++){var S=(0,k.Z)(Z[A],3),T=S[0],M=S[1],C=S[2];t.xs[n][A]=T,t.ys[n][A]=M,t.zs[n][A]=c(C)}break;case"MultiPolygon":var z,E=[],R=(0,w.Z)(e.coordinates);try{for(R.s();!(z=R.n()).done;){var B=z.value;B.length>1&&s.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),E.push(B[0])}}catch(L){R.e(L)}finally{R.f()}for(var N=E.reduce(i),O=0;O<N.length;O++){var D=(0,k.Z)(N[O],3),I=D[0],P=D[1],V=D[2];t.xs[n][O]=I,t.ys[n][O]=P,t.zs[n][O]=c(V)}break;default:throw new Error("Invalid GeoJSON geometry type: ".concat(e.type))}}},{key:"geojson_to_column_data",value:function(){var e,t=JSON.parse(this.geojson);switch(t.type){case"GeometryCollection":if(null==t.geometries)throw new Error("No geometries found in GeometryCollection");if(0===t.geometries.length)throw new Error("geojson.geometries must have one or more items");e=t.geometries;break;case"FeatureCollection":if(null==t.features)throw new Error("No features found in FeaturesCollection");if(0==t.features.length)throw new Error("geojson.features must have one or more items");e=t.features;break;default:throw new Error("Bokeh only supports type GeometryCollection and FeatureCollection at top level")}var n,i=0,r=(0,w.Z)(e);try{for(r.s();!(n=r.n()).done;){var a=n.value,o="Feature"===a.type?a.geometry:a;"GeometryCollection"==o.type?i+=o.geometries.length:i+=1}}catch(p){r.e(p)}finally{r.f()}var s,l={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)},u=0,c=(0,w.Z)(e);try{for(c.s();!(s=c.n()).done;){var h=s.value,_="Feature"==h.type?h.geometry:h;if("GeometryCollection"==_.type){var d,f=(0,w.Z)(_.geometries);try{for(f.s();!(d=f.n()).done;){var v=d.value;this._add_geometry(v,l,u),"Feature"===h.type&&this._add_properties(h,l,u,i),u+=1}}catch(p){f.e(p)}finally{f.f()}}else this._add_geometry(_,l,u),"Feature"===h.type&&this._add_properties(h,l,u,i),u+=1}}catch(p){c.e(p)}finally{c.f()}return l}}]),n}(o.ColumnarDataSource);n.GeoJSONDataSource=f,a=f,f.__name__="GeoJSONDataSource",a.define((function(e){return{geojson:[e.String]}})),a.internal((function(e){return{data:[(0,e.Dict)(e.Arrayable),{}]}}))},function(e,t,n,i,r){i(),r("BBoxTileSource",e(347).BBoxTileSource),r("MercatorTileSource",e(348).MercatorTileSource),r("QUADKEYTileSource",e(351).QUADKEYTileSource),r("TileRenderer",e(352).TileRenderer),r("TileSource",e(349).TileSource),r("TMSTileSource",e(355).TMSTileSource),r("WMTSTileSource",e(353).WMTSTileSource)},function(e,t,n,i,r){var a;i();var o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_image_url",value:function(e,t,n){var i,r,a,o,s,l,u,c,h=this.string_lookup_replace(this.url,this.extra_url_vars);return this.use_latlon?(i=this.get_tile_geographic_bounds(e,t,n),l=(r=(0,k.Z)(i,4))[0],c=r[1],s=r[2],u=r[3]):(a=this.get_tile_meter_bounds(e,t,n),l=(o=(0,k.Z)(a,4))[0],c=o[1],s=o[2],u=o[3]),h.replace("{XMIN}",l.toString()).replace("{YMIN}",c.toString()).replace("{XMAX}",s.toString()).replace("{YMAX}",u.toString())}}]),n}(e(348).MercatorTileSource);n.BBoxTileSource=o,a=o,o.__name__="BBoxTileSource",a.define((function(e){return{use_latlon:[e.Boolean,!1]}}))},function(e,t,n,i,r){var a;i();var o=e(349),s=e(9),l=e(350),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._resolutions=(0,s.range)(this.min_zoom,this.max_zoom+1).map((function(t){return e.get_resolution(t)}))}},{key:"_computed_initial_resolution",value:function(){return null!=this.initial_resolution?this.initial_resolution:2*Math.PI*6378137/this.tile_size}},{key:"is_valid_tile",value:function(e,t,n){return!(!this.wrap_around&&(e<0||e>=Math.pow(2,n)))&&!(t<0||t>=Math.pow(2,n))}},{key:"parent_by_tile_xyz",value:function(e,t,n){var i=this.tile_xyz_to_quadkey(e,t,n),r=i.substring(0,i.length-1);return this.quadkey_to_tile_xyz(r)}},{key:"get_resolution",value:function(e){return this._computed_initial_resolution()/Math.pow(2,e)}},{key:"get_resolution_by_extent",value:function(e,t,n){return[(e[2]-e[0])/n,(e[3]-e[1])/t]}},{key:"get_level_by_extent",value:function(e,t,n){var i,r=(e[2]-e[0])/n,a=(e[3]-e[1])/t,o=Math.max(r,a),s=0,l=(0,w.Z)(this._resolutions);try{for(l.s();!(i=l.n()).done;){if(o>i.value){if(0==s)return 0;if(s>0)return s-1}s+=1}}catch(u){l.e(u)}finally{l.f()}return s-1}},{key:"get_closest_level_by_extent",value:function(e,t,n){var i=(e[2]-e[0])/n,r=(e[3]-e[1])/t,a=Math.max(i,r),o=this._resolutions.reduce((function(e,t){return Math.abs(t-a)<Math.abs(e-a)?t:e}));return this._resolutions.indexOf(o)}},{key:"snap_to_zoom_level",value:function(e,t,n,i){var r=(0,k.Z)(e,4),a=r[0],o=r[1],s=r[2],l=r[3],u=this._resolutions[i],c=n*u,h=t*u;if(!this.snap_to_zoom){var _=(s-a)/c,d=(l-o)/h;_>d?(c=s-a,h*=_):(c*=d,h=l-o)}var f=(c-(s-a))/2,v=(h-(l-o))/2;return[a-f,o-v,s+f,l+v]}},{key:"tms_to_wmts",value:function(e,t,n){return[e,Math.pow(2,n)-1-t,n]}},{key:"wmts_to_tms",value:function(e,t,n){return[e,Math.pow(2,n)-1-t,n]}},{key:"pixels_to_meters",value:function(e,t,n){var i=this.get_resolution(n);return[e*i-this.x_origin_offset,t*i-this.y_origin_offset]}},{key:"meters_to_pixels",value:function(e,t,n){var i=this.get_resolution(n);return[(e+this.x_origin_offset)/i,(t+this.y_origin_offset)/i]}},{key:"pixels_to_tile",value:function(e,t){var n=Math.ceil(e/this.tile_size);return[n=0===n?n:n-1,Math.max(Math.ceil(t/this.tile_size)-1,0)]}},{key:"pixels_to_raster",value:function(e,t,n){return[e,(this.tile_size<<n)-t]}},{key:"meters_to_tile",value:function(e,t,n){var i=this.meters_to_pixels(e,t,n
2),r=(0,k.Z)(i,2),a=r[0],o=r[1];return this.pixels_to_tile(a,o)}},{key:"get_tile_meter_bounds",value:function(e,t,n){var i=this.pixels_to_meters(e*this.tile_size,t*this.tile_size,n),r=(0,k.Z)(i,2),a=r[0],o=r[1],s=this.pixels_to_meters((e+1)*this.tile_size,(t+1)*this.tile_size,n),l=(0,k.Z)(s,2);return[a,o,l[0],l[1]]}},{key:"get_tile_geographic_bounds",value:function(e,t,n){var i=this.get_tile_meter_bounds(e,t,n),r=(0,l.meters_extent_to_geographic)(i),a=(0,k.Z)(r,4);return[a[0],a[1],a[2],a[3]]}},{key:"get_tiles_by_extent",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=(0,k.Z)(e,4),r=i[0],a=i[1],o=i[2],s=i[3],l=this.meters_to_tile(r,a,t),u=(0,k.Z)(l,2),c=u[0],h=u[1],_=this.meters_to_tile(o,s,t),d=(0,k.Z)(_,2),f=d[0],v=d[1];c-=n,h-=n,f+=n;for(var p=[],m=v+=n;m>=h;m--)for(var y=c;y<=f;y++)this.is_valid_tile(y,m,t)&&p.push([y,m,t,this.get_tile_meter_bounds(y,m,t)]);return this.sort_tiles_from_center(p,[c,h,f,v]),p}},{key:"quadkey_to_tile_xyz",value:function(e){for(var t=0,n=0,i=e.length,r=i;r>0;r--){var a=1<<r-1;switch(e.charAt(i-r)){case"0":continue;case"1":t|=a;break;case"2":n|=a;break;case"3":t|=a,n|=a;break;default:throw new TypeError("Invalid Quadkey: ".concat(e))}}return[t,n,i]}},{key:"tile_xyz_to_quadkey",value:function(e,t,n){for(var i="",r=n;r>0;r--){var a=1<<r-1,o=0;0!=(e&a)&&(o+=1),0!=(t&a)&&(o+=2),i+=o.toString()}return i}},{key:"children_by_tile_xyz",value:function(e,t,n){for(var i=this.tile_xyz_to_quadkey(e,t,n),r=[],a=0;a<=3;a++){var o=this.quadkey_to_tile_xyz(i+a.toString()),s=(0,k.Z)(o,3),l=s[0],u=s[1],c=s[2],h=this.get_tile_meter_bounds(l,u,c);r.push([l,u,c,h])}return r}},{key:"get_closest_parent_by_tile_xyz",value:function(e,t,n){var i=this.calculate_world_x_by_tile_xyz(e,t,n),r=this.normalize_xyz(e,t,n),a=(0,k.Z)(r,3);e=a[0],t=a[1],n=a[2];for(var o=this.tile_xyz_to_quadkey(e,t,n);o.length>0;){var s,l,u,c;if(o=o.substring(0,o.length-1),s=this.quadkey_to_tile_xyz(o),e=(l=(0,k.Z)(s,3))[0],t=l[1],n=l[2],u=this.denormalize_xyz(e,t,n,i),e=(c=(0,k.Z)(u,3))[0],t=c[1],n=c[2],this.tiles.has(this.tile_xyz_to_key(e,t,n)))return[e,t,n]}return[0,0,0]}},{key:"normalize_xyz",value:function(e,t,n){if(this.wrap_around){var i=Math.pow(2,n);return[(e%i+i)%i,t,n]}return[e,t,n]}},{key:"denormalize_xyz",value:function(e,t,n,i){return[e+i*Math.pow(2,n),t,n]}},{key:"denormalize_meters",value:function(e,t,n,i){return[e+2*i*Math.PI*6378137,t]}},{key:"calculate_world_x_by_tile_xyz",value:function(e,t,n){return Math.floor(e/Math.pow(2,n))}}]),n}(o.TileSource);n.MercatorTileSource=u,a=u,u.__name__="MercatorTileSource",a.define((function(e){var t=e.Boolean;return{snap_to_zoom:[t,!1],wrap_around:[t,!0]}})),a.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097})},function(e,t,n,i,r){var a;i();var o=e(53),s=e(13),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.tiles=new Map,this._normalize_case()}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.change,(function(){return e._clear_cache()}))}},{key:"string_lookup_replace",value:function(e,t){var n,i=e,r=(0,w.Z)((0,s.entries)(t));try{for(r.s();!(n=r.n()).done;){var a=(0,k.Z)(n.value,2),o=a[0],l=a[1];i=i.replace("{".concat(o,"}"),l)}}catch(u){r.e(u)}finally{r.f()}return i}},{key:"_normalize_case",value:function(){var e=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=e}},{key:"_clear_cache",value:function(){this.tiles=new Map}},{key:"tile_xyz_to_key",value:function(e,t,n){return"".concat(e,":").concat(t,":").concat(n)}},{key:"key_to_tile_xyz",value:function(e){var t=e.split(":").map((function(e){return parseInt(e)})),n=(0,k.Z)(t,3);return[n[0],n[1],n[2]]}},{key:"sort_tiles_from_center",value:function(e,t){var n=(0,k.Z)(t,4),i=n[0],r=n[1],a=n[2],o=n[3],s=(a-i)/2+i,l=(o-r)/2+r;e.sort((function(e,t){return Math.sqrt(Math.pow(s-e[0],2)+Math.pow(l-e[1],2))-Math.sqrt(Math.pow(s-t[0],2)+Math.pow(l-t[1],2))}))}},{key:"get_image_url",value:function(e,t,n){return this.string_lookup_replace(this.url,this.extra_url_vars).replace("{X}",e.toString()).replace("{Y}",t.toString()).replace("{Z}",n.toString())}}]),n}(o.Model);n.TileSource=l,a=l,l.__name__="TileSource",a.define((function(e){var t=e.Number,n=e.String,i=e.Dict,r=e.Nullable;
2return{url:[n,""],tile_size:[t,256],max_zoom:[t,30],min_zoom:[t,0],extra_url_vars:[i(n),{}],attribution:[n,""],x_origin_offset:[t],y_origin_offset:[t],initial_resolution:[r(t),null]}}))},function(e,t,n,i,r){i();var a=e(78);function o(e,t){return a.wgs84_mercator.compute(e,t)}function s(e,t){return a.wgs84_mercator.invert(e,t)}n.geographic_to_meters=o,n.meters_to_geographic=s,n.geographic_extent_to_meters=function(e){var t=(0,k.Z)(e,4),n=t[0],i=t[1],r=t[2],a=t[3],s=o(n,i),l=(0,k.Z)(s,2),u=l[0],c=l[1],h=o(r,a),_=(0,k.Z)(h,2);return[u,c,_[0],_[1]]},n.meters_extent_to_geographic=function(e){var t=(0,k.Z)(e,4),n=t[0],i=t[1],r=t[2],a=t[3],o=s(n,i),l=(0,k.Z)(o,2),u=l[0],c=l[1],h=s(r,a),_=(0,k.Z)(h,2);return[u,c,_[0],_[1]]}},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_image_url",value:function(e,t,n){var i=this.string_lookup_replace(this.url,this.extra_url_vars),r=this.tms_to_wmts(e,t,n),a=(0,k.Z)(r,3),o=a[0],s=a[1],l=a[2],u=this.tile_xyz_to_quadkey(o,s,l);return i.replace("{Q}",u)}}]),n}(e(348).MercatorTileSource);n.QUADKEYTileSource=a,a.__name__="QUADKEYTileSource"},function(e,t,n,i,r){i();var a,o=e(1),s=e(349),l=e(353),u=e(41),c=e(58),h=e(43),f=e(136),m=e(9),x=e(8),Z=(0,o.__importStar)(e(354)),A=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"initialize",value:function(){this._tiles=[],(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this)}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.change,(function(){return e.request_render()})),this.connect(this.model.tile_source.change,(function(){return e.request_render()}))}},{key:"remove",value:function(){null!=this.attribution_el&&(0,h.removeElement)(this.attribution_el),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"styles",value:function(){return[].concat((0,y.Z)((0,_.Z)((0,d.Z)(n.prototype),"styles",this).call(this)),[Z.default])}},{key:"get_extent",value:function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]}},{key:"map_plot",get:function(){return this.plot_model}},{key:"map_canvas",get:function(){return this.layer.ctx}},{key:"map_frame",get:function(){return this.plot_view.frame}},{key:"x_range",get:function(){return this.map_plot.x_range}},{key:"y_range",get:function(){return this.map_plot.y_range}},{key:"_set_data",value:function(){this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0}},{key:"_update_attribution",value:function(){null!=this.attribution_el&&(0,h.removeElement)(this.attribution_el);var e=this.model.tile_source.attribution;if((0,x.isString)(e)&&e.length>0){var t=this.plot_view,n=t.layout,i=t.frame,r=n.bbox.width-i.bbox.right,a=n.bbox.height-i.bbox.bottom,o=i.bbox.width;this.attribution_el=(0,h.div)({class:Z.tile_attribution,style:{position:"absolute",right:"".concat(r,"px"),bottom:"".concat(a,"px"),"max-width":o-4+"px",padding:"2px","background-color":"rgba(255,255,255,0.5)","font-size":"9px","line-height":"1.05","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),this.plot_view.canvas_view.add_event(this.attribution_el),this.attribution_el.innerHTML=e,this.attribution_el.title=this.attribution_el.textContent.replace(/\s*\n\s*/g," ")}}},{key:"_map_data",value:function(){this.initial_extent=this.get_extent();var e=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame.bbox.height,this.map_frame.bbox.width),t=this.model.tile_source.snap_to_zoom_level(this.initial_extent,this.map_frame.bbox.height,this.map_frame.bbox.width,e);this.x_range.start=t[0],this.y_range.start=t[1],this.x_range.end=t[2],this.y_range.end=t[3],this.x_range instanceof c.Range1d&&(this.x_range.reset_start=t[0],this.x_range.reset_end=t[2]),this.y_range instanceof c.Range1d&&(this.y_range.reset_start=t[1],this.y_range.reset_end=t[3]),this._update_attribution()}},{key:"_create_tile",value:function(e,t,n,i){var r=this,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=this.model.tile_source.tile_xyz_to_quadkey(e,t,n),s=this.model.tile_source.tile_xyz_to_key(e,t,n);if(!this.model.tile_source.tiles.has(s)){var l=this.model.tile_source.normalize_xyz(e,t,n),u=(0,k.Z)(l,3),c=u[0],h=u[1],_=u[2],d=this.model.tile_source.get_image_url(c,h,_),v={img:void 0,tile_coords:[e,t,n],normalized_coords:[c,h,_],quadkey:o,cache_key:s,bounds:i,loaded:!1,finished:!1,x_coord:i[0],y_coord:i[3]};this.model.tile_source.tiles.set(s,v),this._tiles.push(v),new f.ImageLoader(d,{loaded:function(e){Object.assign(v,{img:e,loaded:!0}),a?(v.finished=!0,r.notify_finished()):r.request_render()},failed:function(){v.finished=!0}})}}},{key:"_enforce_aspect_ratio",value:function(){if(this._last_height!==this.map_frame.bbox.height||this._last_width!==this.map_frame.bbox.width){var e=this.get_extent(),t=this.model.tile_source.get_level_by_extent(e,this.map_frame.bbox.height,this.map_frame.bbox.width),n=this.model.tile_source.snap_to_zoom_level(e,this.map_frame.bbox.height,this.map_frame.bbox.width,t);this.x_range.setv({start:n[0],end:n[2]}),this.y_range.setv({start:n[1],end:n[3]}),this.extent=n,this._last_height=this.map_frame.bbox.height,this._last_width=this.map_frame.bbox.width}}},{key:"has_finished",value:function(){if(!(0,_.Z)((0,d.Z)(n.prototype),"has_finished",this).call(this))return!1;if(0==this._tiles.length)return!1;var e,t=(0,w.Z)(this._tiles);try{for(t.s();!(e=t.n()).done;){if(!e.value.finished)return!1}}catch(i){t.e(i)}finally{t.f()}return!0}},{key:"_render",value: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()}},{key:"_draw_tile",value:function(e){var t=this.model.tile_source.tiles.get(e);if(null!=t&&t.loaded){var n=this.coordinates.map_to_screen([t.bounds[0]],[t.bounds[3]]),i=(0,k.Z)(n,2),r=(0,k.Z)(i[0],1
2)[0],a=(0,k.Z)(i[1],1)[0],o=this.coordinates.map_to_screen([t.bounds[2]],[t.bounds[1]]),s=(0,k.Z)(o,2),l=(0,k.Z)(s[0],1)[0]-r,u=(0,k.Z)(s[1],1)[0]-a,c=r,h=a,_=this.map_canvas.getImageSmoothingEnabled();this.map_canvas.setImageSmoothingEnabled(this.model.smoothing),this.map_canvas.drawImage(t.img,c,h,l,u),this.map_canvas.setImageSmoothingEnabled(_),t.finished=!0}}},{key:"_set_rect",value:function(){var e=this.plot_model.outline_line_width,t=this.map_frame.bbox.left+e/2,n=this.map_frame.bbox.top+e/2,i=this.map_frame.bbox.width-e,r=this.map_frame.bbox.height-e;this.map_canvas.rect(t,n,i,r),this.map_canvas.clip()}},{key:"_render_tiles",value:function(e){this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha;var t,n=(0,w.Z)(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this._draw_tile(i)}}catch(r){n.e(r)}finally{n.f()}this.map_canvas.restore()}},{key:"_prefetch_tiles",value:function(){for(var e=this.model.tile_source,t=this.get_extent(),n=this.map_frame.bbox.height,i=this.map_frame.bbox.width,r=this.model.tile_source.get_level_by_extent(t,n,i),a=this.model.tile_source.get_tiles_by_extent(t,r),o=0,s=Math.min(10,a.length);o<s;o++){var l,u=(0,k.Z)(a[o],3),c=u[0],h=u[1],_=u[2],d=this.model.tile_source.children_by_tile_xyz(c,h,_),f=(0,w.Z)(d);try{for(f.s();!(l=f.n()).done;){var v=l.value,p=(0,k.Z)(v,4),m=p[0],y=p[1],g=p[2],b=p[3];e.tiles.has(e.tile_xyz_to_key(m,y,g))||this._create_tile(m,y,g,b,!0)}}catch(x){f.e(x)}finally{f.f()}}}},{key:"_fetch_tiles",value:function(e){var t,n=(0,w.Z)(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=(0,k.Z)(i,4),a=r[0],o=r[1],s=r[2],l=r[3];this._create_tile(a,o,s,l)}}catch(u){n.e(u)}finally{n.f()}}},{key:"_update",value:function(){var e=this,t=this.model.tile_source,n=t.min_zoom,i=t.max_zoom,r=this.get_extent(),a=this.extent[2]-this.extent[0]<r[2]-r[0],o=this.map_frame.bbox.height,s=this.map_frame.bbox.width,l=t.get_level_by_extent(r,o,s),u=!1;l<n?(r=this.extent,l=n,u=!0):l>i&&(r=this.extent,l=i,u=!0),u&&(this.x_range.setv({start:r[0],end:r[2]}),this.y_range.setv({start:r[1],end:r[3]})),this.extent=r;var c,h=t.get_tiles_by_extent(r,l),_=[],d=[],f=[],v=[],p=(0,w.Z)(h);try{for(p.s();!(c=p.n()).done;){var y=c.value,g=(0,k.Z)(y,3),b=g[0],x=g[1],Z=g[2],A=t.tile_xyz_to_key(b,x,Z),S=t.tiles.get(A);if(null!=S&&S.loaded)d.push(A);else if(this.model.render_parents){var T=t.get_closest_parent_by_tile_xyz(b,x,Z),M=(0,k.Z)(T,3),C=M[0],z=M[1],E=M[2],R=t.tile_xyz_to_key(C,z,E),B=t.tiles.get(R);if(null!=B&&B.loaded&&!(0,m.includes)(f,R)&&f.push(R),a){var N,O=t.children_by_tile_xyz(b,x,Z),D=(0,w.Z)(O);try{for(D.s();!(N=D.n()).done;){var I=(0,k.Z)(N.value,3),P=I[0],V=I[1],L=I[2],j=t.tile_xyz_to_key(P,V,L);t.tiles.has(j)&&v.push(j)}}catch(U){D.e(U)}finally{D.f()}}}null==S&&_.push(y)}}catch(U){p.e(U)}finally{p.f()}this._render_tiles(f),this._render_tiles(v),this._render_tiles(d),null!=this.render_timer&&clearTimeout(this.render_timer),this.render_timer=setTimeout((function(){return e._fetch_tiles(_)}),65)}}]),n}(u.RendererView);n.TileRendererView=A,A.__name__="TileRendererView";var S=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(u.Renderer);n.TileRenderer=S,a=S,S.__name__="TileRenderer",a.prototype.default_view=A,a.define((function(e){var t=e.Boolean;return{alpha:[e.Number,1],smoothing:[t,!0],tile_source:[(0,e.Ref)(s.TileSource),function(){return new l.WMTSTileSource}],render_parents:[t,!0]}})),a.override({level:"image"})},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_image_url",value:function(e,t,n){var i=this.string_lookup_replace(this.url,this.extra_url_vars),r=this.tms_to_wmts(e,t,n),a=(0,k.Z)(r,3),o=a[0],s=a[1],l=a[2];return i.replace("{X}",o.toString()).replace("{Y}",s.toString()).replace("{Z}",l.toString())}}]),n}(e(348).MercatorTileSource);n.WMTSTileSource=a,a.__name__="WMTSTileSource"},function(e,t,n,i,r){i(),n.root="bk-root",n.tile_attribution="bk-tile-attribution",n.default=".bk-root .bk-tile-attribution a{color:black;}"},function(e,t,n,i,r){i();var a=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"get_image_url",value:function(e,t,n){return this.string_lookup_replace(this.url,this.extra_url_vars).replace("{X}",e.toString()).replace("{Y}",t.toString()).replace("{Z}",n.toString())}}]),n}(e(348).MercatorTileSource);n.TMSTileSource=a,a.__name__="TMSTileSource"},function(e,t,n,i,r){i(),r("CanvasTexture",e(357).CanvasTexture),r("ImageURLTexture",e(359).ImageURLTexture),r("Texture",e(358).Texture)},function(e,t,n,i,r){var a;i();var o=e(358),s=e(34),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"func",get:function(){var e=(0,s.use_strict)(this.code);return new Function("ctx","color","scale","weight",e)}},{key:"get_pattern",value:function(e,t,n){var i=document.createElement("canvas");i.width=t,i.height=t;var r=i.getContext("2d");return this.func.call(this,r,e,t,n),i}}]),n}(o.Texture);n.CanvasTexture=l,a=l,l.__name__="CanvasTexture",a.define((function(e){return{code:[e.String]}}))},function(e,t,n,i,r){var a;i();var o=e(53),s=e(20),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(o.Model);n.Texture=l,a=l,l.__name__="Texture",a.define((function(){return{repetition:[s.TextureRepetition,"repeat"]}}
2))},function(e,t,n,i,r){var a;i();var o=e(358),s=e(136),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._loader=new s.ImageLoader(this.url)}},{key:"get_pattern",value:function(e,t,n){var i=this._loader;return this._loader.finished?i.image:i.promise}}]),n}(o.Texture);n.ImageURLTexture=l,a=l,l.__name__="ImageURLTexture",a.define((function(e){return{url:[e.String]}}))},function(e,t,n,i,r){i(),r("ActionTool",e(238).ActionTool),r("CustomAction",e(361).CustomAction),r("HelpTool",e(239).HelpTool),r("RedoTool",e(362).RedoTool),r("ResetTool",e(363).ResetTool),r("SaveTool",e(364).SaveTool),r("UndoTool",e(365).UndoTool),r("ZoomInTool",e(366).ZoomInTool),r("ZoomOutTool",e(369).ZoomOutTool),r("ButtonTool",e(224).ButtonTool),r("EditTool",e(370).EditTool),r("BoxEditTool",e(371).BoxEditTool),r("FreehandDrawTool",e(372).FreehandDrawTool),r("PointDrawTool",e(373).PointDrawTool),r("PolyDrawTool",e(374).PolyDrawTool),r("PolyTool",e(375).PolyTool),r("PolyEditTool",e(376).PolyEditTool),r("BoxSelectTool",e(377).BoxSelectTool),r("BoxZoomTool",e(379).BoxZoomTool),r("GestureTool",e(223).GestureTool),r("LassoSelectTool",e(380).LassoSelectTool),r("LineEditTool",e(382).LineEditTool),r("PanTool",e(384).PanTool),r("PolySelectTool",e(381).PolySelectTool),r("RangeTool",e(385).RangeTool),r("SelectTool",e(378).SelectTool),r("TapTool",e(386).TapTool),r("WheelPanTool",e(387).WheelPanTool),r("WheelZoomTool",e(388).WheelZoomTool),r("CrosshairTool",e(389).CrosshairTool),r("CustomJSHover",e(390).CustomJSHover),r("HoverTool",e(391).HoverTool),r("InspectTool",e(232).InspectTool),r("Tool",e(222).Tool),r("ToolProxy",e(394).ToolProxy),r("Toolbar",e(221).Toolbar),r("ToolbarBase",e(233).ToolbarBase),r("ProxyToolbar",e(395).ProxyToolbar),r("ToolbarBox",e(395).ToolbarBox)},function(e,t,n,i,r){var a;i();var o=e(238),s=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"css_classes",value:function(){return(0,_.Z)((0,d.Z)(n.prototype),"css_classes",this).call(this).concat("bk-toolbar-button-custom-action")}}]),n}(o.ActionToolButtonView);n.CustomActionButtonView=s,s.__name__="CustomActionButtonView";var l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"doit",value:function(){var e;null===(e=this.model.callback)||void 0===e||e.execute(this.model)}}]),n}(o.ActionToolView);n.CustomActionView=l,l.__name__="CustomActionView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Custom Action",i.button_view=s,i}return(0,b.Z)(n)}(o.ActionTool);n.CustomAction=u,a=u,u.__name__="CustomAction",a.prototype.default_view=l,a.define((function(e){var t=e.Any,n=e.String;return{callback:[(0,e.Nullable)(t)],icon:[n]}})),a.override({description:"Perform a Custom Action"})},function(e,t,n,i,r){var a;i();var o=e(238),s=e(228),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.plot_view.state.changed,(function(){return e.model.disabled=!e.plot_view.state.can_redo}))}},{key:"doit",value:function(){var e=this.plot_view.state.redo();null!=(null==e?void 0:e.range)&&this.plot_view.trigger_ranges_update_event()}}]),n}(o.ActionToolView);n.RedoToolView=l,l.__name__="RedoToolView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Redo",i.icon=s.tool_icon_redo,i}return(0,b.Z)(n)}(o.ActionTool);n.RedoTool=u,a=u,u.__name__="RedoTool",a.prototype.default_view=l,a.override({disabled:!0}),a.register_alias("redo",(function(){return new u}))},function(e,t,n,i,r){var a;i();var o=e(238),s=e(228),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"doit",value:function(){this.plot_view.reset()}}]),n}(o.ActionToolView);n.ResetToolView=l,l.__name__="ResetToolView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Reset",i.icon=s.tool_icon_reset,i}return(0,b.Z)(n)}(o.ActionTool);n.ResetTool=u,a=u,u.__name__="ResetTool",a.prototype.default_view=l,a.register_alias("reset",(function(){return new u}))},function(e,t,n,i,r){var a;i();var o=e(238),s=e(228),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}
2return(0,b.Z)(n,[{key:"copy",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,n;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.plot_view.to_blob();case 2:return t=e.sent,n=new ClipboardItem((0,u.Z)({},t.type,Promise.resolve(t))),e.next=6,navigator.clipboard.write([n]);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"save",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(t){var n,i;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.plot_view.to_blob();case 2:n=e.sent,(i=document.createElement("a")).href=URL.createObjectURL(n),i.download=t,i.target="_blank",i.dispatchEvent(new MouseEvent("click"));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"doit",value:function(){switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"save"){case"save":this.save("bokeh_plot");break;case"copy":this.copy()}}}]),n}(o.ActionToolView);n.SaveToolView=l,l.__name__="SaveToolView";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Save",i.icon=s.tool_icon_save,i}return(0,b.Z)(n,[{key:"menu",get:function(){var e=this;return[{icon:"bk-tool-icon-copy-to-clipboard",tooltip:"Copy image to clipboard",if:function(){return"undefined"!=typeof ClipboardItem},handler:function(){e.do.emit("copy")}}]}}]),n}(o.ActionTool);n.SaveTool=c,a=c,c.__name__="SaveTool",a.prototype.default_view=l,a.register_alias("save",(function(){return new c}))},function(e,t,n,i,r){var a;i();var o=e(238),s=e(228),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.plot_view.state.changed,(function(){return e.model.disabled=!e.plot_view.state.can_undo}))}},{key:"doit",value:function(){var e=this.plot_view.state.undo();null!=(null==e?void 0:e.range)&&this.plot_view.trigger_ranges_update_event()}}]),n}(o.ActionToolView);n.UndoToolView=l,l.__name__="UndoToolView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Undo",i.icon=s.tool_icon_undo,i}return(0,b.Z)(n)}(o.ActionTool);n.UndoTool=u,a=u,u.__name__="UndoTool",a.prototype.default_view=l,a.override({disabled:!0}),a.register_alias("undo",(function(){return new u}))},function(e,t,n,i,r){var a;i();var o=e(367),s=e(228),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(o.ZoomBaseToolView);n.ZoomInToolView=l,l.__name__="ZoomInToolView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).sign=1,i.tool_name="Zoom In",i.icon=s.tool_icon_zoom_in,i}return(0,b.Z)(n)}(o.ZoomBaseTool);n.ZoomInTool=u,a=u,u.__name__="ZoomInTool",a.prototype.default_view=l,a.register_alias("zoom_in",(function(){return new u({dimensions:"both"})})),a.register_alias("xzoom_in",(function(){return new u({dimensions:"width"})})),a.register_alias("yzoom_in",(function(){return new u({dimensions:"height"})}))},function(e,t,n,i,r){var a;i();var o=e(238),s=e(20),l=e(368),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"doit",value:function(){var e,t=this.plot_view.frame,n=this.model.dimensions,i="width"==n||"both"==n,r="height"==n||"both"==n,a=(0,l.scale_range)(t,this.model.sign*this.model.factor,i,r);this.plot_view.state.push("zoom_out",{range:a}),this.plot_view.update_range(a,{scrolling:!0,maintain_focus:this.model.maintain_focus}),null===(e=this.model.document)||void 0===e||e.interactive_start(this.plot_model),this.plot_view.trigger_ranges_update_event()}}]),n}(o.ActionToolView);n.ZoomBaseToolView=u,u.__name__="ZoomBaseToolView";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).maintain_focus=!0,i}return(0,b.Z)(n,[{key:"tooltip",get:function(){return this._get_dim_tooltip(this.dimensions)}}]),n}(o.ActionTool);n.ZoomBaseTool=c,a=c,c.__name__="ZoomBaseTool",a.define((function(e){return{factor:[e.Percent,.1],dimensions:[s.Dimensions,"both"]}}))},function(e,t,n,i,r){i();var a=e(10);function o(e,t,n){var i=[e.start,e.end],r=i[0],a=i[1],o=null!=n?n:(a+r)/2;return[r-(r-o)*t,a-(a-o)*t]}function s(e,t){var n,i=(0,k.Z)(t,2),r=i[0],a=i[1],o=new Map,s=(0,w.Z)(e);try{for(s.s();!(n=s.n()).done;){var l=(0,k.Z)(n.value,2),u=l[0],c=l[1].r_invert(r,a),h=(0,k.Z)(c,2),_=h[0],d=h[1];o.set(u,{start:_,end:d})}}catch(f){s.e(f)}finally{s.f()}return o}n.scale_highlow=o,n.get_info=s,n.scale_range=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4?arguments[4]:void 0;t=(0,a.clamp)(t,-.9,.9);var l=n?t:0,u=o(e.bbox.h_range,l,null!=r?r.x:void 0),c=(0,k.Z)(u,2),h=c[0],_=c[1],d=s(e.x_scales,[h,_]),f=i?t:0,v=o(e.bbox.v_range,f,null!=r?r.y:void 0),p=(0,k.Z)(v,2),m=p[0],y=p[1];return{xrs:d,yrs:s(e.y_scales,[m,y]),factor:t}}},function(e,t,n,i,r){var a;i();var o=e(367),s=e(228),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(o.ZoomBaseToolView);n.ZoomOutToolView=l,l.__name__="ZoomOutToolView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).sign=-1,i.tool_name="Zoom Out",i.icon=s.tool_icon_zoom_out,i}return(0,b.Z)(n)}(o.ZoomBaseTool);n.ZoomOutTool=u,a=u,u.__name__="ZoomOutTool",a.prototype.default_view=l,a.define((function(e){return{maintain_focus:[e.Boolean,!0]}})),a.register_alias("zoom_out",(function(){return new u({dimensions:"both"})})),a.register_alias("xzoom_out",(function(){return new u({dimensions:"width"})})),a.register_alias("yzoom_out",(function(){return new u({dimensions:"height"})}))},function(e,t,n,i,r){var a;i();var o=e(9),s=e(8),l=e(11),u=e(175),c=e(223),h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._mouse_in_frame=!0,e}return(0,b.Z)(n,[{key:"_select_mode",value:function(e){var t=e.shiftKey,n=e.ctrlKey;return t||n?t&&!n?"append":!t&&n?"intersect":t&&n?"subtract":void(0,l.unreachable)():"replace"}},{key:"_move_enter",value:function(e){this._mouse_in_frame=!0}},{key:"_move_exit",value:function(e){this._mouse_in_frame=!1}},{key:"_map_drag",value:function(e,t,n){if(!this.plot_view.frame.bbox.contains(e,t))return null;var i=this.plot_view.renderer_view(n);return null==i?null:[i.coordinates.x_scale.invert(e),i.coordinates.y_scale.invert(t)]}},{key:"_delete_selected",value:function(e){var t=e.data_source,n=t.selected.indices;n.sort();var i,r=(0,w.Z)(t.columns());try{for(r.s();!(i=r.n()).done;)for(var a=i.value,o=t.get_array(a),s=0;s<n.length;s++){var l=n[s];o.splice(l-s,1)}}catch(u){r.e(u)}finally{r.f()}this._emit_cds_changes(t)}},{key:"_pop_glyphs",value:function(e,t){var n=e.columns();if(t&&n.length){var i,r=(0,w.Z)(n);try{for(r.s();!(i=r.n()).done;){var a=i.value,o=e.get_array(a),l=o.length-t+1;l<1||((0,s.isArray)(o)||(o=Array.from(o),e.data[a]=o),o.splice(0,l))}}catch(u){r.e(u)}finally{r.f()}}}},{key:"_emit_cds_changes",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&e.selection_manager.clear(),t&&e.change.emit(),n&&(e.data=e.data,e.properties.data.change.emit())}},{key:"_drag_points",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"both";if(null!=this._basepoint){var i,r=(0,k.Z)(this._basepoint,2),a=r[0],o=r[1],s=(0,w.Z)(t);try{for(s.s();!(i=s.n()).done;){var l=i.value,u=this._map_drag(a,o,l),c=this._map_drag(e.sx,e.sy,l);if(null!=c&&null!=u){var h,_=(0,k.Z)(c,2),d=_[0],f=_[1],v=(0,k.Z)(u,2),p=v[0],m=v[1],y=d-p,g=f-m,b=l.glyph,x=l.data_source,Z=[b.x.field,b.y.field],A=Z[0],S=Z[1],T=(0,w.Z)(x.selected.indices);try{for(T.s();!(h=T.n()).done;){var M=h.value;!A||"width"!=n&&"both"!=n||(x.data[A][M]+=y),!S||"height"!=n&&"both"!=n||(x.data[S][M]+=g)}}catch(C){T.e(C)}finally{T.f()}x.change.emit()}}}catch(C){s.e(C)}finally{s.f()}this._basepoint=[e.sx,e.sy]}}},{key:"_pad_empty_columns",value:function(e,t){var n,i=(0,w.Z)(e.columns());try{for(i.s();!(n=i.n()).done;){var r=n.value;(0,o.includes)(t,r)||e.get_array(r).push(this.model.empty_value)}}catch(a){i.e(a)}finally{i.f()}}},{key:"_select_event",value:function(e,t,n){var i=this.plot_view.frame,r=e.sx,a=e.sy;if(!i.bbox.contains(r,a))return[];var o,s={type:"point",sx:r,sy:a},l=[],u=(0,w.Z)(n);try{for(u.s();!(o=u.n()).done;){var c=o.value,h=c.get_selection_manager(),_=c.data_source,d=this.plot_view.renderer_view(c);null!=d&&(h.select([d],s,!0,t)&&l.push(c),_.properties.selected.change.emit())}}catch(f){u.e(f)}finally{u.f()}return l}}]),n}(c.GestureToolView);n.EditToolView=h,h.__name__="EditToolView";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}
2return(0,b.Z)(n,[{key:"computed_icon",get:function(){var e;return null!==(e=this.custom_icon)&&void 0!==e?e:this.icon}}]),n}(c.GestureTool);n.EditTool=_,a=_,_.__name__="EditTool",a.define((function(e){var t=e.Unknown,n=e.String,i=e.Array,r=e.Ref;return{custom_icon:[(0,e.Nullable)(n),null],empty_value:[t],renderers:[i(r(u.GlyphRenderer)),[]]}}))},function(e,t,n,i,r){var a;i();var o=e(43),s=e(20),l=e(370),u=e(228),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_tap",value:function(e){null==this._draw_basepoint&&null==this._basepoint&&this._select_event(e,this._select_mode(e),this.model.renderers)}},{key:"_keyup",value:function(e){if(this.model.active&&this._mouse_in_frame){var t,n=(0,w.Z)(this.model.renderers);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.keyCode===o.Keys.Backspace?this._delete_selected(i):e.keyCode==o.Keys.Esc&&i.data_source.selection_manager.clear()}}catch(r){n.e(r)}finally{n.f()}}}},{key:"_set_extent",value:function(e,t,n){var i=(0,k.Z)(e,2),r=i[0],a=i[1],o=(0,k.Z)(t,2),s=o[0],l=o[1],u=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=this.model.renderers[0],h=this.plot_view.renderer_view(c);if(null!=h){var _=c.glyph,d=c.data_source,f=h.coordinates.x_scale.r_invert(r,a),v=(0,k.Z)(f,2),p=v[0],m=v[1],y=h.coordinates.y_scale.r_invert(s,l),g=(0,k.Z)(y,2),b=g[0],w=g[1],x=(p+m)/2,Z=(b+w)/2,A=m-p,S=w-b,T=[_.x.field,_.y.field],M=T[0],C=T[1],z=[_.width.field,_.height.field],E=z[0],R=z[1];if(n)this._pop_glyphs(d,this.model.num_objects),M&&d.get_array(M).push(x),C&&d.get_array(C).push(Z),E&&d.get_array(E).push(A),R&&d.get_array(R).push(S),this._pad_empty_columns(d,[M,C,E,R]);else{var B=d.data[M].length-1;M&&(d.data[M][B]=x),C&&(d.data[C][B]=Z),E&&(d.data[E][B]=A),R&&(d.data[R][B]=S)}this._emit_cds_changes(d,!0,!1,u)}}},{key:"_update_box",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!=this._draw_basepoint){var i=[e.sx,e.sy],r=this.plot_view.frame,a=this.model.dimensions,o=this.model._get_dim_limits(this._draw_basepoint,i,r,a);if(null!=o){var s=(0,k.Z)(o,2),l=s[0],u=s[1];this._set_extent(l,u,t,n)}}}},{key:"_doubletap",value:function(e){this.model.active&&(null!=this._draw_basepoint?(this._update_box(e,!1,!0),this._draw_basepoint=null):(this._draw_basepoint=[e.sx,e.sy],this._select_event(e,"append",this.model.renderers),this._update_box(e,!0,!1)))}},{key:"_move",value:function(e){this._update_box(e,!1,!1)}},{key:"_pan_start",value:function(e){if(e.shiftKey){if(null!=this._draw_basepoint)return;this._draw_basepoint=[e.sx,e.sy],this._update_box(e,!0,!1)}else{if(null!=this._basepoint)return;this._select_event(e,"append",this.model.renderers),this._basepoint=[e.sx,e.sy]}}},{key:"_pan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.shiftKey){if(null==this._draw_basepoint)return;this._update_box(e,t,n)}else{if(null==this._basepoint)return;this._drag_points(e,this.model.renderers)}}},{key:"_pan_end",value:function(e){if(this._pan(e,!1,!0),e.shiftKey)this._draw_basepoint=null;else{this._basepoint=null;var t,n=(0,w.Z)(this.model.renderers);try{for(n.s();!(t=n.n()).done;){var i=t.value;this._emit_cds_changes(i.data_source,!1,!0,!0)}}catch(r){n.e(r)}finally{n.f()}}}}]),n}(l.EditToolView);n.BoxEditToolView=c,c.__name__="BoxEditToolView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Box Edit Tool",i.icon=u.tool_icon_box_edit,i.event_type=["tap","pan","move"],i.default_order=1,i}return(0,b.Z)(n)}(l.EditTool);n.BoxEditTool=h,a=h,h.__name__="BoxEditTool",a.prototype.default_view=c,a.define((function(e){var t=e.Int;return{dimensions:[s.Dimensions,"both"],num_objects:[t,0]}}))},function(e,t,n,i,r){var a;i();var o=e(43),s=e(8),l=e(370),u=e(228),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_draw",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.model.active){var i=this.model.renderers[0],r=this._map_drag(e.sx,e.sy,i);if(null!=r){var a=(0,k.Z)(r,2),o=a[0],l=a[1],u=i.data_source,c=i.glyph,h=[c.xs.field,c.ys.field],_=h[0],d=h[1];if("new"==t)this._pop_glyphs(u,this.model.num_objects),_&&u.get_array(_).push([o]),d&&u.get_array(d).push([l]),this._pad_empty_columns(u,[_,d]);else if("add"==t){if(_){var f=u.data[_].length-1,v=u.get_array(_)[f];(0,s.isArray)(v)||(v=Array.from(v),u.data[_][f]=v),v.push(o)}if(d){var p=u.data[d].length-1,m=u.get_array(d)[p];(0,s.isArray)(m)||(m=Array.from(m),u.data[d][p]=m),m.push(l)}}this._emit_cds_changes(u,!0,!0,n)}}}},{key:"_pan_start",value:function(e){this._draw(e,"new")}},{key:"_pan",value:function(e){this._draw(e,"add")}},{key:"_pan_end",value:function(e){this._draw(e,"add",!0)}},{key:"_tap",value:function(e){this._select_event(e,this._select_mode(e),this.model.renderers)}},{key:"_keyup",value:function(e){if(this.model.active&&this._mouse_in_frame){var t,n=(0,w.Z)(this.model.renderers);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.keyCode===o.Keys.Esc?i.data_source.selection_manager.clear():e.keyCode===o.Keys.Backspace&&this._delete_selected(i)}}catch(r){n.e(r)}finally{n.f()}}}}]),n}(l.EditToolView);n.FreehandDrawToolView=c,c.__name__="FreehandDrawToolView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Freehand Draw Tool",i.icon=u.tool_icon_freehand_draw,i.event_type=["pan","ta
2p"],i.default_order=3,i}return(0,b.Z)(n)}(l.EditTool);n.FreehandDrawTool=h,a=h,h.__name__="FreehandDrawTool",a.prototype.default_view=c,a.define((function(e){return{num_objects:[e.Int,0]}})),a.register_alias("freehand_draw",(function(){return new h}))},function(e,t,n,i,r){var a;i();var o=e(43),s=e(370),l=e(228),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_tap",value:function(e){if(!this._select_event(e,this._select_mode(e),this.model.renderers).length&&this.model.add){var t=this.model.renderers[0],n=this._map_drag(e.sx,e.sy,t);if(null!=n){var i=t.glyph,r=t.data_source,a=[i.x.field,i.y.field],o=a[0],s=a[1],l=(0,k.Z)(n,2),u=l[0],c=l[1];this._pop_glyphs(r,this.model.num_objects),o&&r.get_array(o).push(u),s&&r.get_array(s).push(c),this._pad_empty_columns(r,[o,s]),r.change.emit(),r.data=r.data,r.properties.data.change.emit()}}}},{key:"_keyup",value:function(e){if(this.model.active&&this._mouse_in_frame){var t,n=(0,w.Z)(this.model.renderers);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.keyCode===o.Keys.Backspace?this._delete_selected(i):e.keyCode==o.Keys.Esc&&i.data_source.selection_manager.clear()}}catch(r){n.e(r)}finally{n.f()}}}},{key:"_pan_start",value:function(e){this.model.drag&&(this._select_event(e,"append",this.model.renderers),this._basepoint=[e.sx,e.sy])}},{key:"_pan",value:function(e){this.model.drag&&null!=this._basepoint&&this._drag_points(e,this.model.renderers)}},{key:"_pan_end",value:function(e){if(this.model.drag){this._pan(e);var t,n=(0,w.Z)(this.model.renderers);try{for(n.s();!(t=n.n()).done;){var i=t.value;this._emit_cds_changes(i.data_source,!1,!0,!0)}}catch(r){n.e(r)}finally{n.f()}this._basepoint=null}}}]),n}(s.EditToolView);n.PointDrawToolView=u,u.__name__="PointDrawToolView";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Point Draw Tool",i.icon=l.tool_icon_point_draw,i.event_type=["tap","pan","move"],i.default_order=2,i}return(0,b.Z)(n)}(s.EditTool);n.PointDrawTool=c,a=c,c.__name__="PointDrawTool",a.prototype.default_view=u,a.define((function(e){var t=e.Boolean;return{add:[t,!0],drag:[t,!0],num_objects:[e.Int,0]}}))},function(e,t,n,i,r){var a;i();var o=e(43),s=e(8),l=e(375),u=e(228),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._drawing=!1,e._initialized=!1,e}return(0,b.Z)(n,[{key:"_tap",value:function(e){this._drawing?this._draw(e,"add",!0):this._select_event(e,this._select_mode(e),this.model.renderers)}},{key:"_draw",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.model.renderers[0],r=this._map_drag(e.sx,e.sy,i);if(this._initialized||this.activate(),null!=r){var a=this._snap_to_vertex.apply(this,[e].concat((0,y.Z)(r))),o=(0,k.Z)(a,2),l=o[0],u=o[1],c=i.data_source,h=i.glyph,_=[h.xs.field,h.ys.field],d=_[0],f=_[1];if("new"==t)this._pop_glyphs(c,this.model.num_objects),d&&c.get_array(d).push([l,l]),f&&c.get_array(f).push([u,u]),this._pad_empty_columns(c,[d,f]);else if("edit"==t){if(d){var v=c.data[d][c.data[d].length-1];v[v.length-1]=l}if(f){var p=c.data[f][c.data[f].length-1];p[p.length-1]=u}}else if("add"==t){if(d){var m=c.data[d].length-1,g=c.get_array(d)[m],b=g[g.length-1];g[g.length-1]=l,(0,s.isArray)(g)||(g=Array.from(g),c.data[d][m]=g),g.push(b)}if(f){var w=c.data[f].length-1,x=c.get_array(f)[w],Z=x[x.length-1];x[x.length-1]=u,(0,s.isArray)(x)||(x=Array.from(x),c.data[f][w]=x),x.push(Z)}}this._emit_cds_changes(c,!0,!1,n)}}},{key:"_show_vertices",value:function(){if(this.model.active){for(var e=[],t=[],n=0;n<this.model.renderers.length;n++){var i=this.model.renderers[n],r=i.data_source,a=i.glyph,o=[a.xs.field,a.ys.field],s=o[0],l=o[1];if(s){var u,c=(0,w.Z)(r.get_array(s));try{for(c.s();!(u=c.n()).done;){var h=u.value;e.push.apply(e,(0,y.Z)(h))}}catch(v){c.e(v)}finally{c.f()}}if(l){var _,d=(0,w.Z)(r.get_array(l));try{for(d.s();!(_=d.n()).done;){var f=_.value;t.push.apply(t,(0,y.Z)(f))}}catch(v){d.e(v)}finally{d.f()}}this._drawing&&n==this.model.renderers.length-1&&(e.splice(e.length-1,1),t.splice(t.length-1,1))}this._set_vertices(e,t)}}},{key:"_doubletap",value:function(e){this.model.active&&(this._drawing?(this._drawing=!1,this._draw(e,"edit",!0)):(this._drawing=!0,this._draw(e,"new",!0)))}},{key:"_move",value:function(e){this._drawing&&this._draw(e,"edit")}},{key:"_remove",value:function(){var e=this.model.renderers[0],t=e.data_source,n=e.glyph,i=[n.xs.field,n.ys.field],r=i[0],a=i[1];if(r){var o=t.data[r].length-1,s=t.get_array(r)[o];s.splice(s.length-1,1)}if(a){var l=t.data[a].length-1,u=t.get_array(a)[l];u.splice(u.length-1,1)}this._emit_cds_changes(t)}},{key:"_keyup",value:function(e){if(this.model.active&&this._mouse_in_frame){var t,n=(0,w.Z)(this.model.renderers);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.keyCode===o.Keys.Backspace?this._delete_selected(i):e.keyCode==o.Keys.Esc&&(this._drawing&&(this._remove(),this._drawing=!1),i.data_source.selection_manager.clear())}}catch(r){n.e(r)}finally{n.f()}}}},{key:"_pan_start",value:function(e){this.model.drag&&(this._select_event(e,"append",this.model.renderers),this._basepoint=[e.sx,e.sy])}},{key:"_pan",value:function(e){if(null!=this._basepoint&&this.model.drag){var t,n=(0,k.Z)(this._basepoint,2),i=n[0],r=n[1],a=(0,w.Z)(this.model.renderers);try{for(a.s();!(t=a.n()).done;){var o=t.value,s=this._map_drag(i,r,o),l=this._map_drag(e.sx,e.sy,o);if(null!=l&&null!=s){var u=o.data_source,c=o.glyph,h=[c.xs.field,c.ys.field],_=h[0],d=h[1];if(_||d){var f,v=(0,k.Z)(l,2),p=v[0],m=v[1],y=(0,k.Z)(s,2),g=y[0],b=y[1],x=p-g,Z=m-b,A=(0,w.Z)(u.selected.indices);try{for(A.s();!(f=A.n()).done;){var S=f.value,T=void 0,M=void 0,C=void 0;_&&(M=u.data[_][S]),d?T=(C=u.data[d][S]).length:T=M.length;for(var z=0;z<T;z++)M&&(M[z]+=x),C&&(C[z]+=Z)}}catch(E){A.e(E)}finally{A.f()}u.change.emit()}}}}catch(E){a.e(E)}finally{a.f()}this._basepoint=[e.sx,e.sy]}}},{key:"_pan_end",value:function(e){if(this.model.drag){this._pan(e);var t,n=(0,w.Z)(this.model.renderers);try{for(n.s();!(t=n.n()).done;){var i=t.value;this._emit_cds_changes(i.data_source)}}catch(r){n.e(r)}finally{n.f()}this._basepoint=null}}},{key:"activate",value:function(){var e=this;if(this.model.vertex_renderer&&this.model.active){if(this._show_vertices(),!this._initialized){var t,n=(0,w.Z)(this.model.renderers);try{for(n.s();!(t=n.n()).done;){var i=t.value.data_source;i.connect(i.properties.data.change,(function(){return e._show_vertices()}))}}catch(r){n.e(r)}finally{n.f()}}this._initialized=!0}}},{key:"deactivate",value:function(){this._drawing&&(this._remove(),this._drawing=!1),this.model.vertex_renderer&&this._hide_vertices()}}]),n}(l.PolyToolView);n.PolyDrawToolView=c,c.__name__="PolyDrawToolView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Polygon Draw Tool",i.icon=u.tool_icon_poly_draw,i.event_type=["pan","ta
2p","move"],i.default_order=3,i}return(0,b.Z)(n)}(l.PolyTool);n.PolyDrawTool=h,a=h,h.__name__="PolyDrawTool",a.prototype.default_view=c,a.define((function(e){return{drag:[e.Boolean,!0],num_objects:[e.Int,0]}}))},function(e,t,n,i,r){var a;i();var o=e(8),s=e(370),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_set_vertices",value:function(e,t){var n=this.model.vertex_renderer.glyph,i=this.model.vertex_renderer.data_source,r=[n.x.field,n.y.field],a=r[0],s=r[1];a&&((0,o.isArray)(e)?i.data[a]=e:n.x={value:e}),s&&((0,o.isArray)(t)?i.data[s]=t:n.y={value:t}),this._emit_cds_changes(i,!0,!0,!1)}},{key:"_hide_vertices",value:function(){this._set_vertices([],[])}},{key:"_snap_to_vertex",value:function(e,t,n){if(this.model.vertex_renderer){var i=this._select_event(e,"replace",[this.model.vertex_renderer]),r=this.model.vertex_renderer.data_source,a=this.model.vertex_renderer.glyph,o=[a.x.field,a.y.field],s=o[0],l=o[1];if(i.length){var u=r.selected.indices[0];s&&(t=r.data[s][u]),l&&(n=r.data[l][u]),r.selection_manager.clear()}}return[t,n]}}]),n}(s.EditToolView);n.PolyToolView=l,l.__name__="PolyToolView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.EditTool);n.PolyTool=u,a=u,u.__name__="PolyTool",a.define((function(e){return{vertex_renderer:[(0,e.AnyRef)()]}}))},function(e,t,n,i,r){var a;i();var o=e(43),s=e(8),l=e(375),u=e(228),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._drawing=!1,e._cur_index=null,e}return(0,b.Z)(n,[{key:"_doubletap",value:function(e){if(this.model.active){var t=this._map_drag(e.sx,e.sy,this.model.vertex_renderer);if(null!=t){var n=(0,k.Z)(t,2),i=n[0],r=n[1],a=this._select_event(e,"replace",[this.model.vertex_renderer]),o=this.model.vertex_renderer.data_source,s=this.model.vertex_renderer.glyph,l=[s.x.field,s.y.field],u=l[0],c=l[1];if(a.length&&null!=this._selected_renderer){var h=o.selected.indices[0];this._drawing?(this._drawing=!1,o.selection_manager.clear()):(o.selected.indices=[h+1],u&&o.get_array(u).splice(h+1,0,i),c&&o.get_array(c).splice(h+1,0,r),this._drawing=!0),o.change.emit(),this._emit_cds_changes(this._selected_renderer.data_source)}else this._show_vertices(e)}}}},{key:"_show_vertices",value:function(e){var t=this;if(this.model.active){var n=this.model.renderers[0],i=function(){return t._update_vertices(n)},r=null==n?void 0:n.data_source,a=this._select_event(e,"replace",this.model.renderers);if(!a.length)return this._set_vertices([],[]),this._selected_renderer=null,this._drawing=!1,this._cur_index=null,void(null!=r&&r.disconnect(r.properties.data.change,i));null!=r&&r.connect(r.properties.data.change,i),this._cur_index=a[0].data_source.selected.indices[0],this._update_vertices(a[0])}}},{key:"_update_vertices",value:function(e){var t,n,i=e.glyph,r=e.data_source,a=this._cur_index,o=[i.xs.field,i.ys.field],l=o[0],u=o[1];this._drawing||(null==a&&(l||u)||(l&&null!=a?(t=r.data[l][a],(0,s.isArray)(t)||(r.data[l][a]=t=Array.from(t))):t=i.xs.value,u&&null!=a?(n=r.data[u][a],(0,s.isArray)(n)||(r.data[u][a]=n=Array.from(n))):n=i.ys.value,this._selected_renderer=e,this._set_vertices(t,n)))}},{key:"_move",value:function(e){if(this._drawing&&null!=this._selected_renderer){var t,n,i=this.model.vertex_renderer,r=i.data_source,a=i.glyph,o=this._map_drag(e.sx,e.sy,i);if(null==o)return;var s=(0,k.Z)(o,2),l=s[0],u=s[1],c=r.selected.indices;t=this._snap_to_vertex(e,l,u),l=(n=(0,k.Z)(t,2))[0],u=n[1],r.selected.indices=c;var h=[a.x.field,a.y.field],_=h[0],d=h[1],f=c[0];_&&(r.data[_][f]=l),d&&(r.data[d][f]=u),r.change.emit(),this._selected_renderer.data_source.change.emit()}}},{key:"_tap",value:function(e){var t=this.model.vertex_renderer,n=this._map_drag(e.sx,e.sy,t);if(null!=n){if(this._drawing&&this._selected_renderer){var i=(0,k.Z)(n,2),r=i[0],a=i[1],o=t.data_source,s=t.glyph,l=[s.x.field,s.y.field],u=l[0],c=l[1],h=o.selected.indices,_=this._snap_to_vertex(e,r,a),d=(0,k.Z)(_,2);r=d[0],a=d[1];var f=h[0];if(o.selected.indices=[f+1],u){var v=o.get_array(u),p=v[f];v[f]=r,v.splice(f+1,0,p)}if(c){var m=o.get_array(c),y=m[f];m[f]=a,m.splice(f+1,0,y)}return o.change.emit(),void this._emit_cds_changes(this._selected_renderer.data_source,!0,!1,!0)}var g=this._select_mode(e);this._select_event(e,g,[t]),this._select_event(e,g,this.model.renderers)}}},{key:"_remove_vertex",value:function(){if(this._drawing&&this._selected_renderer){var e=this.model.vertex_renderer,t=e.data_source,n=e.glyph,i=t.selected.indices[
20],r=[n.x.field,n.y.field],a=r[0],o=r[1];a&&t.get_array(a).splice(i,1),o&&t.get_array(o).splice(i,1),t.change.emit(),this._emit_cds_changes(this._selected_renderer.data_source)}}},{key:"_pan_start",value:function(e){this._select_event(e,"append",[this.model.vertex_renderer]),this._basepoint=[e.sx,e.sy]}},{key:"_pan",value:function(e){null!=this._basepoint&&(this._drag_points(e,[this.model.vertex_renderer]),this._selected_renderer&&this._selected_renderer.data_source.change.emit())}},{key:"_pan_end",value:function(e){null!=this._basepoint&&(this._drag_points(e,[this.model.vertex_renderer]),this._emit_cds_changes(this.model.vertex_renderer.data_source,!1,!0,!0),this._selected_renderer&&this._emit_cds_changes(this._selected_renderer.data_source),this._basepoint=null)}},{key:"_keyup",value:function(e){if(this.model.active&&this._mouse_in_frame){var t;t=this._selected_renderer?[this.model.vertex_renderer]:this.model.renderers;var n,i=(0,w.Z)(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;e.keyCode===o.Keys.Backspace?(this._delete_selected(r),this._selected_renderer&&this._emit_cds_changes(this._selected_renderer.data_source)):e.keyCode==o.Keys.Esc&&(this._drawing?(this._remove_vertex(),this._drawing=!1):this._selected_renderer&&this._hide_vertices(),r.data_source.selection_manager.clear())}}catch(a){i.e(a)}finally{i.f()}}}},{key:"deactivate",value:function(){this._selected_renderer&&(this._drawing&&(this._remove_vertex(),this._drawing=!1),this._hide_vertices())}}]),n}(l.PolyToolView);n.PolyEditToolView=c,c.__name__="PolyEditToolView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Poly Edit Tool",i.icon=u.tool_icon_poly_edit,i.event_type=["tap","pan","move"],i.default_order=4,i}return(0,b.Z)(n)}(l.PolyTool);n.PolyEditTool=h,a=h,h.__name__="PolyEditTool",a.prototype.default_view=c},function(e,t,n,i,r){var a;i();var o=e(378),s=e(116),l=e(20),u=e(228),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_compute_limits",value:function(e){var t=this.plot_view.frame,n=this.model.dimensions,i=this._base_point;if("center"==this.model.origin){var r=i,a=(0,k.Z)(r,2),o=a[0],s=a[1],l=(0,k.Z)(e,2);i=[o-(l[0]-o),s-(l[1]-s)]}return this.model._get_dim_limits(i,e,t,n)}},{key:"_pan_start",value:function(e){var t=e.sx,n=e.sy;this._base_point=[t,n]}},{key:"_pan",value:function(e){var t=[e.sx,e.sy],n=this._compute_limits(t),i=(0,k.Z)(n,2),r=i[0],a=i[1];this.model.overlay.update({left:r[0],right:r[1],top:a[0],bottom:a[1]}),this.model.select_every_mousemove&&this._do_select(r,a,!1,this._select_mode(e))}},{key:"_pan_end",value:function(e){var t=[e.sx,e.sy],n=this._compute_limits(t),i=(0,k.Z)(n,2),r=i[0],a=i[1];this._do_select(r,a,!0,this._select_mode(e)),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null,this.plot_view.state.push("box_select",{selection:this.plot_view.get_selection()})}},{key:"_do_select",value:function(e,t,n){var i=(0,k.Z)(e,2),r=i[0],a=i[1],o=(0,k.Z)(t,2),s=o[0],l=o[1],u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"replace",c={type:"rect",sx0:r,sx1:a,sy0:s,sy1:l};this._select(c,n,u)}}]),n}(o.SelectToolView);n.BoxSelectToolView=c,c.__name__="BoxSelectToolView";var h=function(){return new s.BoxAnnotation({level:"overlay",top_units:"screen",left_units:"screen",bottom_units:"screen",right_units:"screen",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]})},_=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Box Select",i.icon=u.tool_icon_box_select,i.event_type="pan",i.default_order=30,i}return(0,b.Z)(n,[{key:"tooltip",get:function(){return this._get_dim_tooltip(this.dimensions)}}]),n}(o.SelectTool);n.BoxSelectTool=_,a=_,_.__name__="BoxSelectTool",a.prototype.default_view=c,a.define((function(e){var t=e.Boolean,n=e.Ref;return{dimensions:[l.Dimensions,"both"],select_every_mousemove:[t,!1],overlay:[n(s.BoxAnnotation),h],origin:[l.BoxOrigin,"corner"]}})),a.register_alias("box_select",(function(){return new _})),a.register_alias("xbox_select",(function(){return new _({dimensions:"width"})})),a.register_alias("ybox_select",(function(){return new _({dimensions:"height"})}))},function(e,t,n,i,r){var a;i();var o=e(223),s=e(175),l=e(339),u=e(176),c=e(66),h=e(20),f=e(43),m=e(251),x=e(15),Z=e(11),A=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}
2return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.model.clear.connect((function(){return e._clear()}))}},{key:"computed_renderers",get:function(){var e=this.model,t=e.renderers,n=e.names,i=this.plot_model.data_renderers;return(0,c.compute_renderers)(t,i,n)}},{key:"_computed_renderers_by_data_source",value:function(){var e,t,n=new Map,i=(0,w.Z)(this.computed_renderers);try{for(i.s();!(t=i.n()).done;){var r=t.value,a=void 0;if(r instanceof s.GlyphRenderer)a=r.data_source;else{if(!(r instanceof l.GraphRenderer))continue;a=r.node_renderer.data_source}var o=null!==(e=n.get(a))&&void 0!==e?e:[];n.set(a,[].concat((0,y.Z)(o),[r]))}}catch(u){i.e(u)}finally{i.f()}return n}},{key:"_select_mode",value:function(e){var t=e.shiftKey,n=e.ctrlKey;return t||n?t&&!n?"append":!t&&n?"intersect":t&&n?"subtract":void(0,Z.unreachable)():this.model.mode}},{key:"_keyup",value:function(e){e.keyCode==f.Keys.Esc&&this._clear()}},{key:"_clear",value:function(){var e,t=this,n=(0,w.Z)(this.computed_renderers);try{for(n.s();!(e=n.n()).done;){e.value.get_selection_manager().clear()}}catch(r){n.e(r)}finally{n.f()}var i=this.computed_renderers.map((function(e){return t.plot_view.renderer_view(e)}));this.plot_view.request_paint(i)}},{key:"_select",value:function(e,t,n){var i,r=this._computed_renderers_by_data_source(),a=(0,w.Z)(r);try{for(a.s();!(i=a.n()).done;){var o,s=(0,k.Z)(i.value,2)[1],l=s[0].get_selection_manager(),u=[],c=(0,w.Z)(s);try{for(c.s();!(o=c.n()).done;){var h=o.value,_=this.plot_view.renderer_view(h);null!=_&&u.push(_)}}catch(d){c.e(d)}finally{c.f()}l.select(u,e,t,n)}}catch(d){a.e(d)}finally{a.f()}null!=this.model.callback&&this._emit_callback(e),this._emit_selection_event(e,t)}},{key:"_emit_selection_event",value:function(e){var t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.plot_view.frame,r=i.x_scale,a=i.y_scale;switch(e.type){case"point":var o=e.sx,s=e.sy,l=r.invert(o),u=a.invert(s);t=Object.assign(Object.assign({},e),{x:l,y:u});break;case"span":var c=e.sx,h=e.sy,_=r.invert(c),d=a.invert(h);t=Object.assign(Object.assign({},e),{x:_,y:d});break;case"rect":var f=e.sx0,v=e.sx1,p=e.sy0,y=e.sy1,g=r.r_invert(f,v),b=(0,k.Z)(g,2),w=b[0],x=b[1],Z=a.r_invert(p,y),A=(0,k.Z)(Z,2),S=A[0],T=A[1];t=Object.assign(Object.assign({},e),{x0:w,y0:S,x1:x,y1:T});break;case"poly":var M=e.sx,C=e.sy,z=r.v_invert(M),E=a.v_invert(C);t=Object.assign(Object.assign({},e),{x:z,y:E})}this.plot_model.trigger_event(new m.SelectionGeometry(t,n))}}]),n}(o.GestureToolView);n.SelectToolView=A,A.__name__="SelectToolView";var S=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.clear=new x.Signal0(this,"clear")}},{key:"menu",get:function(){var e=this;return[{icon:"bk-tool-icon-replace-mode",tooltip:"Replace the current selection",active:function(){return"replace"==e.mode},handler:function(){e.mode="replace",e.active=!0}},{icon:"bk-tool-icon-append-mode",tooltip:"Append to the current selection (Shift)",active:function(){return"append"==e.mode},handler:function(){e.mode="append",e.active=!0}},{icon:"bk-tool-icon-intersect-mode",tooltip:"Intersect with the current selection (Ctrl)",active:function(){return"intersect"==e.mode},handler:function(){e.mode="intersect",e.active=!0}},{icon:"bk-tool-icon-subtract-mode",tooltip:"Subtract from the current selection (Shift+Ctrl)",active:function(){return"subtract"==e.mode},handler:function(){e.mode="subtract",e.active=!0}},null,{icon:"bk-tool-icon-clear-selection",tooltip:"Clear the current selection (Esc)",handler:function(){e.clear.emit()}}]}}]),n}(o.GestureTool);n.SelectTool=S,a=S,S.__name__="SelectTool",a.define((function(e){var t=e.String,n=e.Array,i=e.Ref,r=e.Or,a=e.Auto;return{renderers:[r(n(i(u.DataRenderer)),a),"auto"],names:[n(t),[]],mode:[h.SelectionMode,"replace"]}}))},function(e,t,n,i,r){var a;i();var o=e(223),s=e(116),l=e(20),u=e(228),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_match_aspect",value:function(e,t,n){var i,r,a,o,s=n.bbox.aspect,l=n.bbox.h_range.end,u=n.bbox.h_range.start,c=n.bbox.v_range.end,h=n.bbox.v_range.start,_=Math.abs(e[0]-t[0]),d=Math.abs(e[1]-t[1]),f=0==d?0:_/d,v=f>=s?[1,f/s]:[s/f,1],p=(0,k.Z)(v,1)[0];return e[0]<=t[0]?(i=e[0],(r=e[0]+_*p)>l&&(r=l)):(r=e[0],(i=e[0]-_*p)<u&&(i=u)),_=Math.abs(r-i),e[1]<=t[1]?(o=e[1],(a=e[1]+_/s)>c&&(a=c)):(a=e[1],(o=e[1]-_/s)<h&&(o=h)),d=Math.abs(a-o),e[0]<=t[0]?r=e[0]+s*d:i=e[0]-s*d,[[i,r],[o,a]]}},{key:"_compute_limits",value:function(e){var t,n,i,r,a,o,s=this.plot_view.frame,l=this.model.dimensions,u=this._base_point;if("center"==this.model.origin){var c=u,h=(0,k.Z)(c,2),_=h[0],d=h[1],f=(0,k.Z)(e,2);u=[_-(f[0]-_),d-(f[1]-d)]}return this.model.match_aspect&&"both"==l?(t=this._match_aspect(u,e,s),a=(n=(0,k.Z)(t,2))[0],o=n[1]):(i=this.model._get_dim_limits(u,e,s,l),a=(r=(0,k.Z)(i,2))[0],o=r[1]),[a,o]}},{key:"_pan_start",value:function(e){this._base_point=[e.sx,e.sy]}},{key:"_pan",value:function(e){var t=[e.sx,e.sy],n=this._compute_limits(t),i=(0,k.Z)(n,2),r=i[0],a=i[1];this.model.overlay.update({left:r[0],right:r[1],top:a[0],bottom:a[1]})}},{key:"_pan_end",value:function(e){var t=[e.sx,e.sy],n=this._compute_limits(t),i=(0,k.Z)(n,2),r=i[0],a=i[1];this._update(r,a),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null,this.plot_view.trigger_ranges_update_event()}},{key:"_update",value:function(e,t){var n=(0,k.Z)(e,2),i=n[0],r=n[1],a=(0,k.Z)(t,2),o=a[0],s=a[1];if(!(Math.abs(r-i)<=5||Math.abs(s-o)<=5)){var l,u=this.plot_view.frame,c=u.x_scales,h=u.y_scales,_=new Map,d=(0,w.Z)(c);try{for(d.s();!(l=d.n()).done;){var f=(0,k.Z)(l.value,2),v=f[0],p=f[1].r_invert(i,r),m=(0,k.Z)(p,2),y=m[0],g=m[1];_.set(v,{start:y,end:g})}}catch(R){d.e(R)}finally{d.f()}var b,x=new Map,Z=(0,w.Z)(h);try{for(Z.s();!(b=Z.n()).done;){var A=(0,k.Z)(b.value,2),S=A[0],T=A[1].r_invert(o,s),M=(0,k.Z)(T,2),C=M[0],z=M[1];x.set(S,{start:C,end:z})}}catch(R){Z.e(R)}finally{Z.f()}var E={xrs:_,yrs:x};this.plot_view.state.push("box_zoom",{range:E}),this.plot_view.update_range(E)}}}]),n}(o.GestureToolView);n.BoxZoomToolView=c,c.__name__="BoxZoomToolView";var h=function(){return new s.BoxAnnotation({level:"overlay",top_units:"screen",left_units:"screen",bottom_units:"screen",right_units:"screen",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]})},_=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Box Zoom",i.icon=u.tool_icon_box_zoom,i.event_type="pan",i.default_order=20,i}return(0,b.Z)(n,[{key:"tooltip",get:function(){return this._get_dim_tooltip(this.dimensions)}}]),n}(o.GestureTool);n.BoxZoomTool=_,a=_,_.__name__="BoxZoomTool",a.prototype.default_view=c,a.define((function(e){var t=e.Boolean,n=e.Ref;return{dimensions:[l.Dimensions,"both"],overlay:[n(s.BoxAnnotation),h],match_aspect:[t,!1],origin:[l.BoxOrigin,"corner"]}})),a.register_alias("box_zoom",(function(){return new _({dimensions:"both"})})),a.register_alias("xbox_zoom",(function(){return new _({dimensions:"width"})})),a.register_alias("ybox_zoom",(function(){return new _({dimensions:"height"})}))},function(e,t,n,i,r){var a;i();var o=e(378),s=e(217),l=e(381),u=e(43),c=e(228),h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments)).sxs=[],e.sys=[],e}
2return(0,b.Z)(n,[{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.properties.active.change,(function(){return e._active_change()}))}},{key:"_active_change",value:function(){this.model.active||this._clear_overlay()}},{key:"_keyup",value:function(e){e.keyCode==u.Keys.Enter&&this._clear_overlay()}},{key:"_pan_start",value:function(e){this.sxs=[],this.sys=[];var t=e.sx,n=e.sy;this._append_overlay(t,n)}},{key:"_pan",value:function(e){var t=this.plot_view.frame.bbox.clip(e.sx,e.sy),n=(0,k.Z)(t,2),i=n[0],r=n[1];this._append_overlay(i,r),this.model.select_every_mousemove&&this._do_select(this.sxs,this.sys,!1,this._select_mode(e))}},{key:"_pan_end",value:function(e){var t=this.sxs,n=this.sys;this._clear_overlay(),this._do_select(t,n,!0,this._select_mode(e)),this.plot_view.state.push("lasso_select",{selection:this.plot_view.get_selection()})}},{key:"_append_overlay",value:function(e,t){var n=this.sxs,i=this.sys;n.push(e),i.push(t),this.model.overlay.update({xs:n,ys:i})}},{key:"_clear_overlay",value:function(){this.sxs=[],this.sys=[],this.model.overlay.update({xs:this.sxs,ys:this.sys})}},{key:"_do_select",value:function(e,t,n,i){var r={type:"poly",sx:e,sy:t};this._select(r,n,i)}}]),n}(o.SelectToolView);n.LassoSelectToolView=h,h.__name__="LassoSelectToolView";var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Lasso Select",i.icon=c.tool_icon_lasso_select,i.event_type="pan",i.default_order=12,i}return(0,b.Z)(n)}(o.SelectTool);n.LassoSelectTool=f,a=f,f.__name__="LassoSelectTool",a.prototype.default_view=h,a.define((function(e){return{select_every_mousemove:[e.Boolean,!0],overlay:[(0,e.Ref)(s.PolyAnnotation),l.DEFAULT_POLY_OVERLAY]}})),a.register_alias("lasso_select",(function(){return new f}))},function(e,t,n,i,r){var a;i();var o=e(378),s=e(217),l=e(43),u=e(9),c=e(228),h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.data={sx:[],sy:[]}}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.model.properties.active.change,(function(){return e._active_change()}))}},{key:"_active_change",value:function(){this.model.active||this._clear_data()}},{key:"_keyup",value:function(e){e.keyCode==l.Keys.Enter&&this._clear_data()}},{key:"_doubletap",value:function(e){this._do_select(this.data.sx,this.data.sy,!0,this._select_mode(e)),this.plot_view.state.push("poly_select",{selection:this.plot_view.get_selection()}),this._clear_data()}},{key:"_clear_data",value:function(){this.data={sx:[],sy:[]},this.model.overlay.update({xs:[],ys:[]})}},{key:"_tap",value:function(e){var t=e.sx,n=e.sy;this.plot_view.frame.bbox.contains(t,n)&&(this.data.sx.push(t),this.data.sy.push(n),this.model.overlay.update({xs:(0,u.copy)(this.data.sx),ys:(0,u.copy)(this.data.sy)}))}},{key:"_do_select",value:function(e,t,n,i){var r={type:"poly",sx:e,sy:t};this._select(r,n,i)}}]),n}(o.SelectToolView);n.PolySelectToolView=h,h.__name__="PolySelectToolView",n.DEFAULT_POLY_OVERLAY=function(){return new s.PolyAnnotation({level:"overlay",xs_units:"screen",ys_units:"screen",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]})};var f=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Poly Select",i.icon=c.tool_icon_polygon_select,i.event_type="tap",i.default_order=11,i}return(0,b.Z)(n)}(o.SelectTool);n.PolySelectTool=f,a=f,f.__name__="PolySelectTool",a.prototype.default_view=h,a.define((function(e){return{overlay:[(0,e.Ref)(s.PolyAnnotation),n.DEFAULT_POLY_OVERLAY]}})),a.register_alias("poly_select",(function(){return new f}))},function(e,t,n,i,r){var a;i();var o=e(20),s=e(383),l=e(228),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments))._drawing=!1,e}return(0,b.Z)(n,[{key:"_doubletap",value:function(e){if(this.model.active){var t,n=this.model.renderers,i=(0,w.Z)(n);try{for(i.s();!(t=i.n()).done;){var r=t.value;1==this._select_event(e,"replace",[r]).length&&(this._selected_renderer=r)}}catch(a){i.e(a)}finally{i.f()}this._show_intersections(),this._update_line_cds()}}},{key:"_show_intersections",value:function(){if(this.model.active&&null!=this._selected_renderer){if(!this.model.renderers.length)return this._set_intersection([],[]),this._selected_renderer=null,void(this._drawing=!1);var e=this._selected_renderer.data_source,t=this._selected_renderer.glyph,n=[t.x.field,t.y.field],i=n[0],r=n[1],a=e.get_array(i),o=e.get_array(r);this._set_intersection(a,o)}}},{key:"_tap",value:function(e){var t=this.model.intersection_renderer;if(null!=this._map_drag(e.sx,e.sy,t)){if(this._drawing&&this._selected_renderer){var n=this._select_mode(e);if(0==this._select_event(e,n,[t]).length)return}var i=this._select_mode(e);this._select_event(e,i,[t]),this._select_event(e,i,this.model.renderers)}}},{key:"_update_line_cds",value:function(){if(null!=this._selected_renderer){var e=this.model.intersection_renderer.glyph,t=this.model.intersection_renderer.data_source,n=[e.x.field,e.y.field],i=n[0],r=n[1];if(i&&r){var a=t.data[i],o=t.data[r];this._selected_renderer.data_source.data[i]=a,this._selected_renderer.data_source.data[r]=o}this._emit_cds_changes(this._selected_renderer.data_source,!0,!0,!1)}}},{key:"_pan_start",value:function(e){this._select_event(e,"append",[this.model.intersection_renderer]),this._basepoint=[e.sx,e.sy]}},{key:"_pan",value:function(e){null!=this._basepoint&&(this._drag_points(e,[this.model.intersection_renderer],this.model.dimensions),this._selected_renderer&&this._selected_renderer.data_source.change.emit())}},{key:"_pan_end",value:function(e){null!=this._basepoint&&(this._drag_points(e,[this.model.intersection_renderer]),this._emit_cds_changes(this.model.intersection_renderer.data_source,!1,!0,!0),this._selected_renderer&&this._emit_cds_changes(this._selected_renderer.data_source),this._basepoint=null)}},{key:"activate",value:function(){this._drawing=!0}},{key:"deactivate",value:function(){this._selected_renderer&&(this._drawing&&(this._drawing=!1),this._hide_intersections())}}]),n}(s.LineToolView);
2n.LineEditToolView=u,u.__name__="LineEditToolView";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Line Edit Tool",i.icon=l.tool_icon_line_edit,i.event_type=["tap","pan","move"],i.default_order=4,i}return(0,b.Z)(n,[{key:"tooltip",get:function(){return this._get_dim_tooltip(this.dimensions)}}]),n}(s.LineTool);n.LineEditTool=c,a=c,c.__name__="LineEditTool",a.prototype.default_view=u,a.define((function(){return{dimensions:[o.Dimensions,"both"]}}))},function(e,t,n,i,r){var a;i();var o=e(8),s=e(370),l=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_set_intersection",value:function(e,t){var n=this.model.intersection_renderer.glyph,i=this.model.intersection_renderer.data_source,r=[n.x.field,n.y.field],a=r[0],s=r[1];a&&((0,o.isArray)(e)?i.data[a]=e:n.x={value:e}),s&&((0,o.isArray)(t)?i.data[s]=t:n.y={value:t}),this._emit_cds_changes(i,!0,!0,!1)}},{key:"_hide_intersections",value:function(){this._set_intersection([],[])}}]),n}(s.EditToolView);n.LineToolView=l,l.__name__="LineToolView";var u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(s.EditTool);n.LineTool=u,a=u,u.__name__="LineTool",a.define((function(e){return{intersection_renderer:[(0,e.AnyRef)()]}}))},function(e,t,n,i,r){i();var a,o=e(1),s=e(223),l=e(20),u=(0,o.__importStar)(e(228));function c(e,t,n){var i,r=new Map,a=(0,w.Z)(e);try{for(a.s();!(i=a.n()).done;){var o=(0,k.Z)(i.value,2),s=o[0],l=o[1].r_invert(t,n),u=(0,k.Z)(l,2),c=u[0],h=u[1];r.set(s,{start:c,end:h})}}catch(_){a.e(_)}finally{a.f()}return r}n.update_ranges=c;var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_pan_start",value:function(e){var t;this.last_dx=0,this.last_dy=0;var n=e.sx,i=e.sy,r=this.plot_view.frame.bbox;if(!r.contains(n,i)){var a=r.h_range,o=r.v_range;(n<a.start||n>a.end)&&(this.v_axis_only=!0),(i<o.start||i>o.end)&&(this.h_axis_only=!0)}null===(t=this.model.document)||void 0===t||t.interactive_start(this.plot_model)}},{key:"_pan",value:function(e){var t;this._update(e.deltaX,e.deltaY),null===(t=this.model.document)||void 0===t||t.interactive_start(this.plot_model)}},{key:"_pan_end",value:function(e){this.h_axis_only=!1,this.v_axis_only=!1,null!=this.pan_info&&this.plot_view.state.push("pan",{range:this.pan_info}),this.plot_view.trigger_ranges_update_event()}},{key:"_update",value:function(e,t){var n,i,r,a,o,s,l=this.plot_view.frame,u=e-this.last_dx,h=t-this.last_dy,_=l.bbox.h_range,d=_.start-u,f=_.end-u,v=l.bbox.v_range,p=v.start-h,m=v.end-h,y=this.model.dimensions;"width"!=y&&"both"!=y||this.v_axis_only?(n=_.start,i=_.end,r=0):(n=d,i=f,r=-u),"height"!=y&&"both"!=y||this.h_axis_only?(a=v.start,o=v.end,s=0):(a=p,o=m,s=-h),this.last_dx=e,this.last_dy=t;var g=l.x_scales,b=l.y_scales,w=c(g,n,i),x=c(b,a,o);
2this.pan_info={xrs:w,yrs:x,sdx:r,sdy:s},this.plot_view.update_range(this.pan_info,{panning:!0})}}]),n}(s.GestureToolView);n.PanToolView=h,h.__name__="PanToolView";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Pan",i.event_type="pan",i.default_order=10,i}return(0,b.Z)(n,[{key:"tooltip",get:function(){return this._get_dim_tooltip(this.dimensions)}}]),n}(s.GestureTool);n.PanTool=_,a=_,_.__name__="PanTool",a.prototype.default_view=h,a.define((function(){return{dimensions:[l.Dimensions,"both",{on_update:function(e,t){switch(e){case"both":t.icon=u.tool_icon_pan;break;case"width":t.icon=u.tool_icon_xpan;break;case"height":t.icon=u.tool_icon_ypan}}}]}})),a.register_alias("pan",(function(){return new _({dimensions:"both"})})),a.register_alias("xpan",(function(){return new _({dimensions:"width"})})),a.register_alias("ypan",(function(){return new _({dimensions:"height"})}))},function(e,t,n,i,r){var a;i();var o=e(116),s=e(58),l=e(19),u=e(223),c=e(228);function h(e){switch(e){case 1:return 2;case 2:return 1;case 4:return 5;case 5:return 4;default:return e}}function f(e,t,n,i){if(null==t)return!1;var r=n.compute(t);return Math.abs(e-r)<i}function m(e,t,n,i,r){var a=!0;if(null!=r.left&&null!=r.right){var o=n.invert(e);(o<r.left||o>r.right)&&(a=!1)}if(null!=r.bottom&&null!=r.top){var s=i.invert(t);(s<r.bottom||s>r.top)&&(a=!1)}return a}function y(e,t,n){var i=0;return e>=n.start&&e<=n.end&&(i+=1),t>=n.start&&t<=n.end&&(i+=1),i}function w(e,t,n,i){var r=t.compute(e),a=t.invert(r+n);return a>=i.start&&a<=i.end?a:e}function x(e,t,n){return e>t.start?(t.end=e,n):(t.end=t.start,t.start=e,h(n))}function Z(e,t,n){return e<t.end?(t.start=e,n):(t.start=t.end,t.end=e,h(n))}function A(e,t,n,i){var r=t.r_compute(e.start,e.end),a=(0,k.Z)(r,2),o=a[0],s=a[1],l=t.r_invert(o+n,s+n),u=(0,k.Z)(l,2),c=u[0],h=u[1],_=y(e.start,e.end,i);y(c,h,i)>=_&&(e.start=c,e.end=h)}n.flip_side=h,n.is_near=f,n.is_inside=m,n.sides_inside=y,n.compute_value=w,n.update_range_end_side=x,n.update_range_start_side=Z,n.update_range=A;var S=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.side=0,this.model.update_overlay_from_ranges()}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),null!=this.model.x_range&&this.connect(this.model.x_range.change,(function(){return e.model.update_overlay_from_ranges()})),null!=this.model.y_range&&this.connect(this.model.y_range.change,(function(){return e.model.update_overlay_from_ranges()}))}},{key:"_pan_start",value:function(e){this.last_dx=0,this.last_dy=0;var t=this.model.x_range,n=this.model.y_range,i=this.plot_view.frame,r=i.x_scale,a=i.y_scale,s=this.model.overlay,l=s.left,u=s.right,c=s.top,h=s.bottom,_=this.model.overlay.line_width+o.EDGE_TOLERANCE;null!=t&&this.model.x_interaction&&(f(e.sx,l,r,_)?this.side=1:f(e.sx,u,r,_)?this.side=2:m(e.sx,e.sy,r,a,s)&&(this.side=3)),null!=n&&this.model.y_interaction&&(0==this.side&&f(e.sy,h,a,_)&&(this.side=4),0==this.side&&f(e.sy,c,a,_)?this.side=5:m(e.sx,e.sy,r,a,this.model.overlay)&&(3==this.side?this.side=7:this.side=6))}},{key:"_pan",value:function(e){var t=this.plot_view.frame,n=e.deltaX-this.last_dx,i=e.deltaY-this.last_dy,r=this.model.x_range,a=this.model.y_range,o=t.x_scale,s=t.y_scale;if(null!=r)if(3==this.side||7==this.side)A(r,o,n,t.x_range);else if(1==this.side){var l=w(r.start,o,n,t.x_range);this.side=Z(l,r,this.side)}else if(2==this.side){var u=w(r.end,o,n,t.x_range);this.side=x(u,r,this.side)}if(null!=a)if(6==this.side||7==this.side)A(a,s,i,t.y_range);else if(4==this.side){var c=w(a.start,s,i,t.y_range);this.side=Z(c,a,this.side)}else if(5==this.side){var h=w(a.end,s,i,t.y_range);this.side=x(h,a,this.side)}this.last_dx=e.deltaX,this.last_dy=e.deltaY}},{key:"_pan_end",value:function(e){this.side=0,this.plot_view.trigger_ranges_update_event()}}]),n}(u.GestureToolView);n.RangeToolView=S,S.__name__="RangeToolView";var T=function(){return new o.BoxAnnotation({level:"overlay",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:.5,line_dash:[2,2]})},M=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Range Tool",i.icon=c.tool_icon_range,i.event_type="pan",i.default_order=1,i}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.overlay.in_cursor="grab",this.overlay.ew_curs
2or=null!=this.x_range&&this.x_interaction?"ew-resize":null,this.overlay.ns_cursor=null!=this.y_range&&this.y_interaction?"ns-resize":null}},{key:"update_overlay_from_ranges",value: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,l.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)}}]),n}(u.GestureTool);n.RangeTool=M,a=M,M.__name__="RangeTool",a.prototype.default_view=S,a.define((function(e){var t=e.Boolean,n=e.Ref,i=e.Nullable;return{x_range:[i(n(s.Range1d)),null],x_interaction:[t,!0],y_range:[i(n(s.Range1d)),null],y_interaction:[t,!0],overlay:[n(o.BoxAnnotation),T]}}))},function(e,t,n,i,r){var a;i();var o=e(378),s=e(20),l=e(228),u=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_tap",value:function(e){"tap"==this.model.gesture&&this._handle_tap(e)}},{key:"_doubletap",value:function(e){"doubletap"==this.model.gesture&&this._handle_tap(e)}},{key:"_handle_tap",value:function(e){var t={type:"point",sx:e.sx,sy:e.sy};this._select(t,!0,this._select_mode(e))}},{key:"_select",value:function(e,t,n){var i=this,r=this.model.callback;if("select"==this.model.behavior){var a,o=this._computed_renderers_by_data_source(),s=(0,w.Z)(o);try{for(s.s();!(a=s.n()).done;){var l=(0,k.Z)(a.value,2)[1],u=l[0].get_selection_manager(),c=l.map((function(e){return i.plot_view.renderer_view(e)})).filter((function(e){return null!=e}));if(u.select(c,e,t,n)&&null!=r){var h=c[0].coordinates.x_scale.invert(e.sx),_=c[0].coordinates.y_scale.invert(e.sy),d={geometries:Object.assign(Object.assign({},e),{x:h,y:_}),source:u.source};r.execute(this.model,d)}}}catch(Z){s.e(Z)}finally{s.f()}this._emit_selection_event(e),this.plot_view.state.push("tap",{selection:this.plot_view.get_selection()})}else{var f,v=(0,w.Z)(this.computed_renderers);try{for(v.s();!(f=v.n()).done;){var p=f.value,m=this.plot_view.renderer_view(p);if(null!=m){var y=p.get_selection_manager();if(y.inspect(m,e)&&null!=r){var g=m.coordinates.x_scale.invert(e.sx),b=m.coordinates.y_scale.invert(e.sy),x={geometries:Object.assign(Object.assign({},e),{x:g,y:b}),source:y.source};r.execute(this.model,x)}}}}catch(Z){v.e(Z)}finally{v.f()}}}}]),n}(o.SelectToolView);n.TapToolView=u,u.__name__="TapToolView";var c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Tap",i.icon=l.tool_icon_tap_select,i.event_type="tap",i.default_order=10,i}return(0,b.Z)(n)}(o.SelectTool);n.TapTool=c,a=c,c.__name__="TapTool",a.prototype.default_view=u,a.define((function(e){var t=e.Any,n=e.Enum,i=e.Nullable;return{behavior:[s.TapBehavior,"select"],gesture:[n("tap","doubletap"),"tap"],callback:[i(t)]}})),a.register_alias("click",(function(){return new c({behavior:"inspect"})})),a.register_alias("tap",(function(){return new c})),a.register_alias("doubletap",(function(){return new c({gesture:"doubletap"})}))},function(e,t,n,i,r){var a;i();var o=e(223),s=e(20),l=e(228),u=e(384),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_scroll",value:function(e){var t=this.model.speed*e.delta;t>.9?t=.9:t<-.9&&(t=-.9),this._update_ranges(t)}},{key:"_update_ranges",value:function(e){var t,n,i,r,a,o=this,s=this.plot_view.frame,l=s.bbox.h_range,c=s.bbox.v_range,h=[l.start,l.end],_=h[0],d=h[1],f=[c.start,c.end],v=f[0],p=f[1];switch(this.model.dimension){case"height":var m=Math.abs(p-v);n=_,i=d,r=v-m*e,a=p-m*e;break;case"width":var y=Math.abs(d-_);n=_-y*e,i=d-y*e,r=v,a=p}var g=s.x_scales,b=s.y_scales,w={xrs:(0,u.update_ranges)(g,n,i),yrs:(0,u.update_ranges)(b,r,a),factor:e};this.plot_view.state.push("wheel_pan",{range:w}),this.plot_view.update_range(w,{scrolling:!0}),null===(t=this.model.document)||void 0===t||t.interactive_start(this.plot_model,(function(){return o.plot_view.trigger_ranges_update_event()}))}}]),n}(o.GestureToolView);n.WheelPanToolView=c,c.__name__="WheelPanToolView";var h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Wheel Pan",i.icon=l.tool_icon_wheel_pan,i.event_type="scroll",i.default_order=12,i}return(0,b.Z)(n,[{key:"tooltip",get:function(){return this._get_dim_tooltip(this.dimension)}}]),n}(o.GestureTool);n.WheelPanTool=h,a=h,h.__name__="WheelPanTool",a.prototype.default_view=c,a.define((function(){return{dimension:[s.Dimension,"width"]}})),a.internal((function(e){return{speed:[e.Number,.001]}})),a.register_alias("xwheel_pan",(function(){return new h({dimension:"width"})})),a.register_alias("ywheel_pan",(function(){return new h({dimension:"height"})}))},function(e,t,n,i,r){var a;i();var o=e(223),s=e(368),l=e(20),u=e(27),c=e(228),h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_pinch",value:function(e){var t,n=e.sx,i=e.sy,r=e.scale,a=e.ctrlKey,o=e.shiftKey;t=r>=1?20*(r-1):-20/r,this._scroll({type:"wheel",sx:n,sy:i,delta:t,ctrlKey:a,shift
2Key:o})}},{key:"_scroll",value:function(e){var t,n=this,i=this.plot_view.frame,r=i.bbox.h_range,a=i.bbox.v_range,o=e.sx,l=e.sy,u=this.model.dimensions,c=("width"==u||"both"==u)&&r.start<o&&o<r.end,h=("height"==u||"both"==u)&&a.start<l&&l<a.end;if(c&&h||this.model.zoom_on_axis){var _=this.model.speed*e.delta,d=(0,s.scale_range)(i,_,c,h,{x:o,y:l});this.plot_view.state.push("wheel_zoom",{range:d});var f=this.model.maintain_focus;this.plot_view.update_range(d,{scrolling:!0,maintain_focus:f}),null===(t=this.model.document)||void 0===t||t.interactive_start(this.plot_model,(function(){return n.plot_view.trigger_ranges_update_event()}))}}}]),n}(o.GestureToolView);n.WheelZoomToolView=h,h.__name__="WheelZoomToolView";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Wheel Zoom",i.icon=c.tool_icon_wheel_zoom,i.event_type=u.is_mobile?"pinch":"scroll",i.default_order=10,i}return(0,b.Z)(n,[{key:"tooltip",get:function(){return this._get_dim_tooltip(this.dimensions)}}]),n}(o.GestureTool);n.WheelZoomTool=_,a=_,_.__name__="WheelZoomTool",a.prototype.default_view=h,a.define((function(e){var t=e.Boolean,n=e.Number;return{dimensions:[l.Dimensions,"both"],maintain_focus:[t,!0],zoom_on_axis:[t,!0],speed:[n,1/600]}})),a.register_alias("wheel_zoom",(function(){return new _({dimensions:"both"})})),a.register_alias("xwheel_zoom",(function(){return new _({dimensions:"width"})})),a.register_alias("ywheel_zoom",(function(){return new _({dimensions:"height"})}))},function(e,t,n,i,r){var a;i();var o=e(232),s=e(219),l=e(20),u=e(13),c=e(228),h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"_move",value:function(e){if(this.model.active){var t=e.sx,n=e.sy;this.plot_view.frame.bbox.contains(t,n)?this._update_spans(t,n):this._update_spans(null,null)}}},{key:"_move_exit",value:function(e){this._update_spans(null,null)}},{key:"_update_spans",value:function(e,t){var n=this.model.dimensions;"width"!=n&&"both"!=n||(this.model.spans.width.location=t),"height"!=n&&"both"!=n||(this.model.spans.height.location=e)}}]),n}(o.InspectToolView);n.CrosshairToolView=h,h.__name__="CrosshairToolView";var _=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Crosshair",i.icon=c.tool_icon_crosshair,i}return(0,b.Z)(n,[{key:"tooltip",get:function(){return this._get_dim_tooltip(this.dimensions)}},{key:"synthetic_renderers",get:function(){return(0,u.values)(this.spans)}}]),n}(o.InspectTool);n.CrosshairTool=_,a=_,_.__name__="CrosshairTool",function(){function e(e,t){return new s.Span({for_hover:!0,dimension:t,location_units:"screen",level:"overlay",line_color:e.line_color,line_width:e.line_width,line_alpha:e.line_alpha})}a.prototype.default_view=h,a.define((function(e){var t=e.Alpha,n=e.Number,i=e.Color;return{dimensions:[l.Dimensions,"both"],line_color:[i,"black"],line_width:[n,1],line_alpha:[t,1]}})),a.internal((function(t){var n=t.Struct,i=t.Ref;return{spans:[n({width:i(s.Span),height:i(s.Span)}),function(t){return{width:e(t,"width"),height:e(t,"height")}}]}})),a.register_alias("crosshair",(function(){return new _}))}()},function(e,t,n,i,r){var a;i();var o=e(53),l=e(13),u=e(34),c=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"values",get:function(){return(0,l.values)(this.args)}},{key:"_make_code",value:function(e,t,n,i){return(0,s.Z)(Function,(0,y.Z)((0,l.keys)(this.args)).concat([e,t,n,(0,u.use_strict)(i)]))}},{key:"format",value:function(e,t,n){return this._make_code("value","format","special_vars",this.code).apply(void 0,(0,y.Z)(this.values).concat([e,t,n]))}}]),n}(o.Model);n.CustomJSHover=c,a=c,c.__name__="CustomJSHover",a.define((function(e){var t=e.Unknown,n=e.String;return{args:[(0,e.Dict)(t),{}],code:[n,""]}}))},function(e,t,n,i,r){i();var a,o=e(1),s=e(232),l=e(390),u=e(241),c=e(175),h=e(339),f=e(176),m=e(177),A=e(283),S=e(186),T=e(187),M=e(189),C=(0,o.__importStar)(e(185)),z=e(152),E=e(43),R=e(22),B=e(13),N=e(234),O=e(8),D=e(113),I=e(20),P=e(228),V=e(15),L=e(66),j=(0,o.__importStar)(e(242)),U=e(392);function F(e,t,n,i,r,a){var o,s,l={x:r[e],y:a[e]},u={x:r[e+1],y:a[e+1]};if("span"==t.type)"h"==t.direction?(o=Math.abs(l.x-n),s=Math.abs(u.x-n)):(o=Math.abs(l.
2y-i),s=Math.abs(u.y-i));else{var c={x:n,y:i};o=C.dist_2_pts(l,c),s=C.dist_2_pts(u,c)}return o<s?[[l.x,l.y],e]:[[u.x,u.y],e+1]}function G(e,t,n){return[[e[n],t[n]],n]}n._nearest_line_hit=F,n._line_hit=G;var H=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._ttmodels=new Map,this._ttviews=new Map}},{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:return e.next=4,this._update_ttmodels();case 4:if(t=this.model.tooltips,e.t0=t instanceof U.Template,!e.t0){e.next=11;break}return e.next=9,(0,D.build_view)(t,{parent:this});case 9:this._template_view=e.sent,this._template_view.render();case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"remove",value:function(){var e;null===(e=this._template_view)||void 0===e||e.remove(),(0,D.remove_views)(this._ttviews),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this);var t=this.plot_model.properties.renderers,i=this.model.properties,r=i.renderers,a=i.tooltips;this.on_change(a,(function(){return delete e._template_el})),this.on_change([t,r,a],(0,Z.Z)((0,x.Z)().mark((function t(){return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e._update_ttmodels();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)}))))}},{key:"_update_ttmodels",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,n,i,r,a,o,s,l,_,d,f,v,p,m,g,b;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._ttmodels,n=this.computed_renderers,t.clear(),null!=(i=this.model.tooltips)){r=(0,w.Z)(this.computed_renderers);try{for(r.s();!(a=r.n()).done;)o=a.value,s=new u.Tooltip({custom:(0,O.isString)(i)||(0,O.isFunction)(i),attachment:this.model.attachment,show_arrow:this.model.show_arrow}),o instanceof c.GlyphRenderer?t.set(o,s):o instanceof h.GraphRenderer&&(t.set(o.node_renderer,s),t.set(o.edge_renderer,s))}catch(k){r.e(k)}finally{r.f()}}return e.next=6,(0,D.build_views)(this._ttviews,(0,y.Z)(t.values()),{parent:this.plot_view});case 6:l=e.sent,_=(0,w.Z)(l);try{for(_.s();!(d=_.n()).done;)d.value.render()}catch(k){_.e(k)}finally{_.f()}f=(0,y.Z)((0,x.Z)().mark((function e(){var t,i,r;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=(0,w.Z)(n),e.prev=1,t.s();case 3:if((i=t.n()).done){e.next=18;break}if(!((r=i.value)instanceof c.GlyphRenderer)){e.next=10;break}return e.next=8,r;case 8:e.next=16;break;case 10:if(e.t0=r instanceof h.GraphRenderer,!e.t0){e.next=16;break}return e.next=14,r.node_renderer;case 14:return e.next=16,r.edge_renderer;case 16:e.next=3;break;case 18:e.next=23;break;case 20:e.prev=20,e.t1=e.catch(1),t.e(e.t1);case 23:return e.prev=23,t.f(),e.finish(23);case 26:case"end":return e.stop()}}),e,null,[[1,20,23,26]])}))()),null!=(v=this._slots.get(this._update))&&(p=new Set(f.map((function(e){return e.data_source}))),V.Signal.disconnect_receiver(this,v,p)),m=(0,w.Z)(f);try{for(m.s();!(g=m.n()).done;)b=g.value,this.connect(b.data_source.inspect,this._update)}catch(k){m.e(k)}finally{m.f()}case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"computed_renderers",get:function(){var e=this.model,t=e.renderers,n=e.names,i=this.plot_model.data_renderers;return(0,L.compute_renderers)(t,i,n)}},{key:"ttmodels",get:function(){return this._ttmodels}},{key:"_clear",value:function(){this._inspect(1/0,1/0);var e,t=(0,w.Z)(this.ttmodels);try{for(t.s();!(e=t.n()).done;){(0,k.Z)(e.value,2)[1].clear()}}catch(n){t.e(n)}finally{t.f()}}},{key:"_move",value:function(e){if(this.model.active){var t=e.sx,n=e.sy;this.plot_view.frame.bbox.contains(t,n)?this._inspect(t,n):this._clear()}}},{key:"_move_exit",value:function(){this._clear()}},{key:"_inspect",value:function(e,t){var n;n="mouse"==this.model.mode?{type:"point",sx:e,sy:t}:{type:"span",direction:"vline"==this.model.mode?"h":"v",sx:e,sy:t};var i,r=(0,w.Z)(this.computed_renderers);try{for(r.s();!(i=r.n()).done;){var a=i.value,o=a.get_selection_manager(),s=this.plot_view.renderer_view(a);null!=s&&o.inspect(s,n)}}catch(l){r.e(l)}finally{r.f()}this._emit_callback(n)}},{key:"_update",value:function(e){var t,n,i,r,a,o,s,l,u,h,_,d,f=(0,k.Z)(e,2),v=f[0],p=f[1].geometry;if(this.model.active&&("point"==p.type||"span"==p.type)&&v instanceof c.GlyphRenderer&&("ignore"!=this.model.muted_policy||!v.muted)){var y=this.ttmodels.get(v);if(null!=y){var g=v.get_selection_manager(),b=g.inspectors.get(v),x=v.view.convert_selection_to_subset(b);if(b.is_empty()&&null==b.view)y.clear();else{var Z=g.source,C=this.plot_view.renderer_view(v);if(null!=C){var z=p.sx,R=p.sy,N=C.coordinates.x_scale,O=C.coordinates.y_scale,D=N.invert(z),I=O.invert(R),P=C.glyph,V=[];if(P instanceof S.PatchView){var L=z,j=R,U={x:D,y:I,sx:z,sy:R,rx:L,ry:j,name:v.name};V.push([L,j,this._render_tooltips(Z,-1,U)])}if(P instanceof T.HAreaView){var H,Y=(0,w.Z)(x.line_indices);try{for(Y.s();!(H=Y.n()).done;){var J=H.value,W=P._x1,q=P._x2,X=P._y,K=z,Q=R,$={index:J,x:D,y:I,sx:z,sy:R,data_x1:W,data_x2:q,data_y:X,rx:K,ry:Q,indices:x.line_indices,name:v.name};V.push([K,Q,this._render_tooltips(Z,J,$)])}}catch(lt){Y.e(lt)}finally{Y.f()}}if(P instanceof M.VAreaView){var ee,te=(0,w.Z)(x.line_indices);try{for(te.s();!(ee=te.n()).done;){var ne=ee.value,ie=P._x,re=P._y1,ae=P._y2,oe=z,se=R,le={index:ne,x:D,y:I,sx:z,sy:R,data_x:ie,data_y1:re,data_y2:ae,rx:oe,ry:se,indices:x.line_indices,name:v.name};V.push([oe,se,this._render_tooltips(Z,ne,le)])}}
2catch(lt){te.e(lt)}finally{te.f()}}if(P instanceof m.LineView){var ue,ce=(0,w.Z)(x.line_indices);try{for(ce.s();!(ue=ce.n()).done;){var he=ue.value,_e=void 0,de=void 0,fe=P._x[he+1],ve=P._y[he+1],pe=he;switch(this.model.line_policy){case"interp":t=P.get_interpolation_hit(he,p),fe=(n=(0,k.Z)(t,2))[0],ve=n[1],_e=N.compute(fe),de=O.compute(ve);break;case"prev":var me=G(P.sx,P.sy,he),ye=(0,k.Z)(me,2),ge=(0,k.Z)(ye[0],2);_e=ge[0],de=ge[1],pe=ye[1];break;case"next":var be=G(P.sx,P.sy,he+1),we=(0,k.Z)(be,2),xe=(0,k.Z)(we[0],2);_e=xe[0],de=xe[1],pe=we[1];break;case"nearest":i=F(he,p,z,R,P.sx,P.sy),r=(0,k.Z)(i,2),_e=(a=(0,k.Z)(r[0],2))[0],de=a[1],pe=r[1],fe=P._x[pe],ve=P._y[pe];break;default:_e=z,de=R}var ke={index:pe,x:D,y:I,sx:z,sy:R,data_x:fe,data_y:ve,rx:_e,ry:de,indices:x.line_indices,name:v.name};V.push([_e,de,this._render_tooltips(Z,pe,ke)])}}catch(lt){ce.e(lt)}finally{ce.f()}}var Ze,Ae=(0,w.Z)(b.image_indices);try{for(Ae.s();!(Ze=Ae.n()).done;){var Se=Ze.value,Te={index:Se.index,x:D,y:I,sx:z,sy:R,name:v.name},Me=this._render_tooltips(Z,Se,Te);V.push([z,R,Me])}}catch(lt){Ae.e(lt)}finally{Ae.f()}var Ce,ze=(0,w.Z)(x.indices);try{for(ze.s();!(Ce=ze.n()).done;){var Ee=Ce.value;if(P instanceof A.MultiLineView&&!(0,B.isEmpty)(x.multiline_indices)){var Re,Be=(0,w.Z)(x.multiline_indices[Ee.toString()]);try{for(Be.s();!(Re=Be.n()).done;){var Ne,Oe=Re.value,De=void 0,Ie=void 0,Pe=P._xs.get(Ee)[Oe],Ve=P._ys.get(Ee)[Oe],Le=Oe;switch(this.model.line_policy){case"interp":o=P.get_interpolation_hit(Ee,Oe,p),Pe=(s=(0,k.Z)(o,2))[0],Ve=s[1],De=N.compute(Pe),Ie=O.compute(Ve);break;case"prev":var je=G(P.sxs.get(Ee),P.sys.get(Ee),Oe),Ue=(0,k.Z)(je,2),Fe=(0,k.Z)(Ue[0],2);De=Fe[0],Ie=Fe[1],Le=Ue[1];break;case"next":var Ge=G(P.sxs.get(Ee),P.sys.get(Ee),Oe+1),He=(0,k.Z)(Ge,2),Ye=(0,k.Z)(He[0],2);De=Ye[0],Ie=Ye[1],Le=He[1];break;case"nearest":l=F(Oe,p,z,R,P.sxs.get(Ee),P.sys.get(Ee)),u=(0,k.Z)(l,2),De=(h=(0,k.Z)(u[0],2))[0],Ie=h[1],Le=u[1],Pe=P._xs.get(Ee)[Le],Ve=P._ys.get(Ee)[Le];break;default:throw new Error("shouldn't have happened")}var Je={index:Ne=v instanceof c.GlyphRenderer?v.view.convert_indices_from_subset([Ee])[0]:Ee,x:D,y:I,sx:z,sy:R,data_x:Pe,data_y:Ve,segment_index:Le,indices:x.multiline_indices,name:v.name};V.push([De,Ie,this._render_tooltips(Z,Ne,Je)])}}catch(lt){Be.e(lt)}finally{Be.f()}}else{var We,qe=null===(_=P._x)||void 0===_?void 0:_[Ee],Xe=null===(d=P._y)||void 0===d?void 0:d[Ee],Ke=void 0,Qe=void 0;if("snap_to_data"==this.model.point_policy){var $e=P.get_anchor_point(this.model.anchor,Ee,[z,R]);if(null==$e&&null==($e=P.get_anchor_point("center",Ee,[z,R])))continue;Ke=$e.x,Qe=$e.y}else Ke=z,Qe=R;var et={index:We=v instanceof c.GlyphRenderer?v.view.convert_indices_from_subset([Ee])[0]:Ee,x:D,y:I,sx:z,sy:R,data_x:qe,data_y:Xe,indices:x.indices,name:v.name};V.push([Ke,Qe,this._render_tooltips(Z,We,et)])}}}catch(lt){ze.e(lt)}finally{ze.f()}if(0==V.length)y.clear();else{var tt=y.content;(0,E.empty)(y.content);var nt,it=(0,w.Z)(V);try{for(it.s();!(nt=it.n()).done;){var rt=(0,k.Z)(nt.value,3)[2];null!=rt&&tt.appendChild(rt)}}catch(lt){it.e(lt)}finally{it.f()}var at=(0,k.Z)(V[V.length-1],2),ot=at[0],st=at[1];y.setv({position:[ot,st]},{check_eq:!1})}}}}}}},{key:"_emit_callback",value:function(e){var t=this.model.callback;if(null!=t){var n,i=(0,w.Z)(this.computed_renderers);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r instanceof c.GlyphRenderer){var a=this.plot_view.renderer_view(r);if(null!=a){var o=a.coordinates,s=o.x_scale,l=o.y_scale,u=s.invert(e.sx),h=l.invert(e.sy),_=r.data_source.inspected;t.execute(this.model,{geometry:Object.assign({x:u,y:h},e),renderer:r,index:_})}}}}catch(d){i.e(d)}finally{i.f()}}}},{key:"_create_template",value:function(e){var t,n=(0,E.div)({style:{display:"table",borderSpacing:"2px"}}),i=(0,w.Z)(e);try{for(i.s();!(t=i.n()).done;){var r=(0,k.Z)(t.value,1)[0],a=(0,E.div)({style:{display:"table-row"}});n.appendChild(a);var o=(0,E.div)({style:{display:"table-cell"},class:j.tooltip_row_label},0!=r.length?"".concat(r,": "):"");a.appendChild(o);var s=(0,E.span)();s.dataset.value="";var l=(0,E.span)({class:j.tooltip_color_block}," ");l.dataset.swatch="",(0,E.undisplay)(l);var u=(0,E.div)({style:{display:"table-cell"},class:j.tooltip_row_value},s,l);a.appendChild(u)}}catch(c){i.e(c)}finally{i.f()}return n}},{key:"_render_template",value:function(e,t,n,i,r){var a,o=e.cloneNode(!0),s=o.querySelectorAll("[data-value]"),l=o.querySelectorAll("[data-swatch]"),u=/\$color(\[.*\])?:(\w*)/,c=/\$swatch:(\w*)/,h=(0,w.Z)((0,N.enumerate)(t));try{for(h.s();!(a=h.n()).done;){var _=(0,k.Z)(a.value,2),d=(0,k.Z)(_[0],2)[1],f=_[1],v=d.match(c),p=d.match(u);if(null!=v||null!=p){if(null!=v){var m=(0,k.Z)(v,2)[1],y=n.get_column(m);if(null==y)s[f].textContent="".concat(m," unknown");else{var g=(0,O.isNumber)(i)?y[i]:null;null!=g&&(l[f].style.backgroundColor=(0,R.color2css)(g),(0,E.display)(l[f]))}}if(null!=p){var b=(0,k.Z)(p,3),x=b[1],Z=void 0===x?"":x,A=b[2],S=n.get_column(A);if(null==S){s[f].textContent="".concat(A," unknown");continue}var T=Z.indexOf("hex")>=0,M=Z.indexOf("swatch")>=0,C=(0,O.isNumber)(i)?S[i]:null;if(null==C){s[f].textContent="(null)";continue}s[f].textContent=T?(0,R.color2hex)(C):(0,R.color2css)(C),M&&(l[f].style.backgroundColor=(0,R.color2css)(C),(0,E.display)(l[f]))}}else{var B=(0,z.replace_placeholders)(d.replace("$~","$data_"),n,i,this.model.formatters,r);if((0,O.isString)(B))s[f].textContent=B;else{var D,I=(0,w.Z)(B);try{for(I.s();!(D=I.n()).done;){var P=D.value;s[f].appendChild(P)}}catch(V){I.e(V)}finally{I.f()}}}}}catch(V){h.e(V)}finally{h.f()}return o}},{key:"_render_tooltips",value:function(e,t,n){var i,r=this.model.tooltips;if((0,O.isString)(r)){var a=(0,z.replace_placeholders)({html:r},e,t,this.model.formatters,n);return(0,E.div)(a)}if((0,O.isFunction)(r))return r(e,n);if(r instanceof U.Template)return this._template_view.update(e,t,n),this._template_view.el;if(null!=r){var o=null!==(i=this._template_el)&&void 0!==i?i:this._template_el=this._create_template(r);return this._render_template(o,r,e,t,n)}return null}}]),n}(s.InspectToolView);n.HoverToolView=H,H.__name__="HoverToolView";var Y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){var i;return(0,g.Z)(this,n),(i=t.call(this,e)).tool_name="Hover",i.icon=P.tool_icon_hover,i}return(0,b.Z)(n)}(s.InspectTool);n.HoverTool=Y,a=Y,Y.__name__="HoverTool",a.prototype.default_view=H,a.define((function(e){var t=e.Any,n=e.Boolean,i=e.String,r=e.Array,a=e.Tuple,o=e.Dict,s=e.Or,u=e.Ref,c=e.Function,h=e.Auto,_=e.Nullable;return{tooltips:[_(s(u(U.Template),i,r(a(i,i)),c())),[["index","$index"],["data (x, y)","($x, $y)"],["screen (x, y)","($sx, $sy)"]]],formatters:[o(s(u(l.CustomJSHover),z.FormatterType)),{}],renderers:[s(r(u(f.DataRenderer)),h),"auto"],names:[r(i),[]],mode:[I.HoverMode,"mouse"],muted_policy:[I.MutedPol
2icy,"show"],point_policy:[I.PointPolicy,"snap_to_data"],line_policy:[I.LinePolicy,"nearest"],show_arrow:[n,!0],anchor:[I.Anchor,"center"],attachment:[I.TooltipAttachment,"horizontal"],callback:[_(t)]}})),a.register_alias("hover",(function(){return new Y}))},function(e,t,n,i,r){i();var a,s,l,u,c,h,f,m,y,A,S,T,M,C=e(1),z=e(53),E=e(309),R=e(393);r("Styles",R.Styles);var B=e(43),N=e(42),O=e(226),D=e(113),I=e(8),P=e(13),V=(0,C.__importStar)(e(242)),L=e(152),j=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(O.DOMView);n.DOMNodeView=j,j.__name__="DOMNodeView";var U=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(z.Model);n.DOMNode=U,U.__name__="DOMNode",U.__module__="bokeh.models.dom";var F=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"render",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"render",this).call(this),this.el.textContent=this.model.content}},{key:"_createElement",value:function(){return document.createTextNode("")}}]),n}(j);n.TextView=F,F.__name__="TextView";var G=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(U);n.Text=G,a=G,G.__name__="Text",a.prototype.default_view=F,a.define((function(e){return{content:[e.String,""]}}));var H=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(j);n.PlaceholderView=H,H.__name__="PlaceholderView",H.tag_name="span";var Y=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(U);n.Placeholder=Y,s=Y,Y.__name__="Placeholder",s.define((function(e){return o(e),{}}));var J=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"update",value:function(e,t,n){this.el.textContent=t.toString()}}]),n}(H);n.IndexView=J,J.__name__="IndexView";var W=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(Y);n.Index=W,l=W,W.__name__="Index",l.prototype.default_view=J,l.define((function(e){return o(e),{}}));var q=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"update",value:function(e,t,n){var i=(0,L._get_column_value)(this.model.field,e,t),r=null==i?"???":"".concat(i);this.el.textContent=r}}]),n}(H);n.ValueRefView=q,q.__name__="ValueRefView";var X=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(Y);n.ValueRef=X,u=X,X.__name__="ValueRef",u.prototype.default_view=q,u.define((function(e){return{field:[e.String]}}));var K=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"render",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"render",this).call(this),this.value_el=(0,B.span)(),this.swatch_el=(0,B.span)({class:V.tooltip_color_block}," "),this.el.appendChild(this.value_el),this.el.appendChild(this.swatch_el)}},{key:"update",value:function(e,t,n){var i=(0,L._get_column_value)(this.model.field,e,t),r=null==i?"???":"".concat(i);this.el.textContent=r}}]),n}(q);n.ColorRefView=K,K.__name__="ColorRefView";var Q=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(X);n.ColorRef=Q,c=Q,Q.__name__="ColorRef",c.prototype.default_view=K,c.define((function(e){var t=e.Boolean;return{hex:[t,!0],swatch:[t,!0]}}));var $=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments)).child_views=new Map,e}return(0,b.Z)(n,[{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:return t=this.model.children.filter((function(e){return e instanceof z.Model})),e.next=5,(0,D.build_views)(this.child_views,t,{parent:this});case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"render",this).call(this);var e=this.model.style;if(null!=e)if(e instanceof R.Styles){var t,i=(0,w.Z)(e);try{for(i.s();!(t=i.n()).done;){var r=t.value,a=r.get_value();if((0,I.isString)(a)){var o=r.attr.replace(/_/g,"-");this.el.style.hasOwnProperty(o)&&this.el.style.setProperty(o,a)}}}catch(g){i.e(g)}finally{i.f()}}else{var s,l=(0,w.Z)((0,P.entries)(e));try{for(l.s();!(s=l.n()).done;){var u=(0,k.Z)(s.value,2),c=u[0],h=u[1],f=c.replace(/_/g,"-");this.el.style.hasOwnProperty(f)&&this.el.style.setProperty(f,h)}}catch(g){l.e(g)}finally{l.f()}}var v,p=(0,w.Z)(this.model.children);try{for(p.s();!(v=p.n()).done;){var m=v.value;if((0,I.isString)(m)){var y=document.createTextNode(m);this.el.appendChild(y)}else this.child_views.get(m).renderTo(this.el)}}catch(g){p.e(g)}finally{p.f()}}}]),n}(j);n.DOMElementView=$,$.__name__="DOMElementView";var ee=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(U);n.DOMElement=ee,h=ee,ee.__name__="DOMElement",h.define((function(e){var t=e.String,n=e.Array,i=e.Dict,r=e.Or,a=e.Nullable,o=e.Ref;return{style:[a(r(o(R.Styles),i(t))),null],children:[n(r(t,o(U),o(E.LayoutDOM))),[]]}}));var te=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(N.View);n.ActionView=te,te.__name__="ActionView";var ne=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(z.Model);n.Action=ne,f=ne,ne.__name__="Action",ne.__module__="bokeh.models.dom",f.define((function(e){return o(e),{}}));var ie=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.apply(this,arguments)).action_views=new Map,e}return(0,b.Z)(n,[{key:"lazy_initialize",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Z)((0,d.Z)(n.prototype),"lazy_initialize",this).call(this);case 2:return e.next=4,(0,D.build_views)(this.action_views,this.model.actions,{parent:this});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"remove",value:function(){(0,D.remove_views)(this.action_views),(0,_.Z)((0,d.Z)(n.prototype),"remove",this).call(this)}},{key:"update",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function i(r){var a,o=(0,w.Z)(r.child_views.values());try{for(o.s();!(a=o.n()).done;){var s=a.value;s instanceof H?s.update(e,t,n):s instanceof $&&i(s)}}catch(l){o.e(l)}finally{o.f()}}(this);var i,r=(0,w.Z)(this.action_views.values());try{for(r.s();!(i=r.n()).done;){i.value.update(e,t,n)}}catch(a){r.e(a)}finally{r.f()}}}]),n}($);n.TemplateView=ie,ie.__name__="TemplateView",ie.tag_name="div";var re=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(ee);n.Template=re,m=re,re.__name__="Template",m.prototype.default_view=ie,m.define((function(e){return{actions:[(0,e.Array)((0,e.Ref)(ne)),[]]}}));var ae=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}($);n.SpanView=ae,ae.__name__="SpanView",ae.tag_name="span";var oe=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(ee);n.Span=oe,y=oe,oe.__name__="Span",y.prototype.default_view=ae;var se=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}($);n.DivView=se,se.__name__="DivView",se.tag_name="div";var le=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(ee);n.Div=le,A=le,le.__name__="Div",A.prototype.default_view=se;var ue=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}($);n.TableView=ue,ue.__name__="TableView",ue.tag_name="table";var ce=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(ee);n.Table=ce,S=ce,ce.__name__="Table",S.prototype.default_view=ue;var he=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}($);n.TableRowView=he,he.__name__="TableRowView",he.tag_name="tr";var _e=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(ee);n.TableRow=_e,T=_e,_e.__name__="TableRow",T.prototype.default_view=he;var de=e(41),fe=e(234),ve=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"update",value:function(e,t,n){var i,r=(0,w.Z)((0,fe.enumerate)(this.model.groups));try{for(r.s();!(i=r.n()).done;){var a=(0,k.Z)(i.value,2),o=a[0],s=a[1];o.visible=t==s}}catch(l){r.e(l)}finally{r.f()}}}]),n}(te);n.ToggleGroupView=ve,ve.__name__="ToggleGroupView";var pe=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(ne);n.ToggleGroup=pe,M=pe,pe.__name__="ToggleGroup",M.prototype.default_view=ve,M.define((function(e){return{groups:[(0,e.Array)((0,e.Ref)(de.RendererGroup)),[]]}}))},function(e,t,n,i,r){var a;i();var o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(e(53).Model);n.Styles=o,a=o,o.__name__="Styles",o.__module__="bokeh.models.css",a.define((function(e){var t=e.String,n=e.Nullable;return{align_content:[n(t),null],align_items:[n(t),null],align_self:[n(t),null],alignment_baseline:[n(t),null],all:[n(t),null],animation:[n(t),null],animation_delay:[n(t),null],animation_direction:[n(t),null],animation_duration:[n(t),null],animation_fill_mode:[n(t),null],animation_iteration_count:[n(t),null],animation_name:[n(t),null],animation_play_state:[n(t),null],animation_timing_function:[n(t),null],backface_visibility:[n(t),null],background:[n(t),null],background_attachment:[n(t),null],background_clip:[n(t),null],background_color:[n(t),null],background_image:[n(t),null],background_origin:[n(t),null],background_position:[n(t),null],background_position_x:[n(t),null],background_position_y:[n(t),null],background_repeat:[n(t),null],background_size:[n(t),null],baseline_shift:[n(t),null],block_size:[n(t),null],border:[n(t),null],border_block_end:[n(t),null],border_block_end_color:[n(t),null],border_block_end_style:[n(t),null],border_block_end_width:[n(t),null],border_block_start:[n(t),null],border_block_start_color:[n(t),null],border_block_start_style:[n(t),null],border_block_start_width:[n(t),null],border_bottom:[n(t),null],border_bottom_color:[n(t),null],border_bottom_left_radius:[n(t),null],border_bottom_right_radius:[n(t),null],border_bottom_style:[n(t),null],border_bottom_width:[n(t),null],border_collapse:[n(t),null],border_color:[n(t),null],border_image:[n(t),null],border_image_outset:[n(t),null],border_image_repeat:[n(t),null],border_image_slice:[n(t),null],border_image_source:[n(t),null],border_image_width:[n(t),null],border_inline_end:[n(t),null],border_inline_end_color:[n(t),null],border_inline_end_style:[n(t),null],border_inline_end_width:[n(t),null],border_inline_start:[n(t),null],border_inline_start_color:[n(t),null],border_inline_start_style:[n(t),null],border_inline_start_width:[n(t),null],border_left:[n(t),null],border_left_color:[n(t),null],border_left_style:[n(t),null],border_left_width:[n(t),null],border_radius:[n(t),null],border_right:[n(t),null],border_right_color:[n(t),null],border_right_style:[n(t),null],border_right_width:[n(t),null],border_spacing:[n(t),null],border_style:[n(t),null],border_top:[n(t),null],border_top_color:[n(t),null],border_top_left_radius:[n(t),null],border_top_right_radius:[n(t),null],border_top_style:[n(t),null],border_top_width:[n(t),null],border_width:[n(t),null],bottom:[n(t),null],box_shadow:[n(t),null],box_sizing:[n(t),null],break_after:[n(t),null],break_before:[n(t),null],break_inside:[n(t),null],caption_side:[n(t),null],caret_color:[n(t),null],clear:[n(t),null],clip:[n(t),null],clip_path:[n(t),null],clip_rule:[n(t),null],color:[n(t),null],color_interpolation:[n(t),null],color_interpolation_filters:[n(t),null],column_count:[n(t),null],column_fill:[n(t),null],column_gap:[n(t),null],column_rule:[n(t),null],column_rule_color:[n(t),null],column_rule_style:[n(t),null],column_rule_width:[n(t),null],column_span:[n(t),null],column_width:[n(t),null],columns:[n(t),null],content:[n(t),null],counter_increment:[n(t),null],counter_reset:[n(t),null],css_float:[n(t),null],css_text:[n(t),null],cursor:[n(t),null],direction:[n(t),null],display:[n(t),null],dominant_baseline:[n(t),null],empty_cells:[n(t),null],fill:[n(t),null],fill_opacity:[n(t),null],fill_rule:[n(t),null],filter:[n(t),null],flex:[n(t),null],flex_basis:[n(t),null],flex_direction:[n(t),null],flex_flow:[n(t),null],flex_grow:[n(t),null],flex_shrink:[n(t),null],flex_wrap:[n(t),null],float:[n(t),null],flood_color:[n(t),null],flood_opacity:[n(t),null],font:[n(t),null],font_family:[n(t),null],font_feature_settings:[n(t),null],font_kerning:[n(t),null],font_size:[n(t),null],font_size_adjust:[n(t),null],font_stretch:[n(t),null],font_style:[n(t),null],font_synthesis:[n(t),null],font_variant:[n(t),null],font_variant_caps:[n(t),null],font_variant_east_asian:[n(t),null],font_variant_ligatures:[n(t),null],font_variant_numeric:[n(t),null],font_variant_position:[n(t),null],font_weight:[n(t),null],gap:[n(t),null],glyph_orientation_vertical:[n(t),null],grid:[n(t),null],grid_area:[n(t),null],grid_auto_columns:[n(t),null],grid_auto_flow:[n(t),null],grid_auto_rows:[n(t),null],grid_column:[n(t),null],grid_column_end:[n(t),null],grid_column_gap:[n(t),null],grid_column_start:[n(t),null],grid_gap:[n(t),null],grid_row:[n(t),null],grid_row_end:[n(t),null],grid_row_gap:[n(t),null],grid_row_start:[n(t),null],grid_template:[n(t),null],grid_template_areas:[n(t),null],grid_template_columns:[n(t),null],grid_template_rows:[n(t),null],height:[n(t),null],hyphens:[n(t),null],image_orientation:[n(t),null],image_rendering:[n(t),null],inline_size:[n(t),null],justify_content:[n(t),null],justify_items:[n(t),null],justify_self:[n(t),null],left:[n(t),null],letter_spacing:[n(t),null],lighting_color:[n(t),null],line_break:[n(t),null],line_height:[n(t),null],list_style:[n(t),null],list_style_image:[n(t),null],list_style_position:[n(t),null],list_style_type:[n(t),null],margin:[n(t),null],margin_block_end:[n(t),null],margin_block_start:[n(t),null],margin_bottom:[n(t),null],margin_inline_end:[n(t),null],margin_inline_start:[n(t),null],margin_left:[n(t),null],margin_right:[n(t),null],margin_top:[n(t),null],marker:[n(t),null],marker_end:[n(t),null],marker_mid:[n(t),null],marker_start:[n(t),null],mask:[n(t),null],mask_composite:[n(t),null],mask_image:[n(t),null],mask_position:[n(t),null],mask_repeat:[n(t),null],mask_size:[n(t),null],mask_type:[n(t),null],max_block_size:[n(t),null],max_height:[n(t),null],max_inline_size:[n(t),null],max_width:[n(t),null],min_block_size:[n(t),null],min_height:[n(t),null],min_inline_size:[n(t),null],min_width:[n(t),null],object_fit:[n(t),null],object_position:[n(t),null],opacity:[n(t),null],order:[n(t),null],orphans:[n(t),null],outline:[n(t),null],outline_color:[n(t),null],outline_offset:[n(t),null],outline_style:[n(t),null],outline_width:[n(t),null],overflow:[n(t),null],overflow_anchor:[n(t),null],overflow_wrap:[n(t),null],overflow_x:[n(t),null],overflow_y:[n(t),null],overscroll_behavior:[n(t),null],overscroll_behavior_block:[n(t),null],overscroll_behavior_inline:[n(t),null],overscroll_behavior_x:[n(t),null],overscroll_behavior_y:[n(t),null],padding:[n(t),null],padding_block_end:[n(t),null],padding_block_start:[n(t),null],padding_bottom:[n(t),null],padding_inline_end:[n(t),null],padding_inline_start:[n(t),null],padding_left:[n(t),null],padding_right:[n(t),null],padding_top:[n(t),null],page_break_after:[n(t),null],page_break_before:[n(t),null],page_break_in
2side:[n(t),null],paint_order:[n(t),null],perspective:[n(t),null],perspective_origin:[n(t),null],place_content:[n(t),null],place_items:[n(t),null],place_self:[n(t),null],pointer_events:[n(t),null],position:[n(t),null],quotes:[n(t),null],resize:[n(t),null],right:[n(t),null],rotate:[n(t),null],row_gap:[n(t),null],ruby_align:[n(t),null],ruby_position:[n(t),null],scale:[n(t),null],scroll_behavior:[n(t),null],shape_rendering:[n(t),null],stop_color:[n(t),null],stop_opacity:[n(t),null],stroke:[n(t),null],stroke_dasharray:[n(t),null],stroke_dashoffset:[n(t),null],stroke_linecap:[n(t),null],stroke_linejoin:[n(t),null],stroke_miterlimit:[n(t),null],stroke_opacity:[n(t),null],stroke_width:[n(t),null],tab_size:[n(t),null],table_layout:[n(t),null],text_align:[n(t),null],text_align_last:[n(t),null],text_anchor:[n(t),null],text_combine_upright:[n(t),null],text_decoration:[n(t),null],text_decoration_color:[n(t),null],text_decoration_line:[n(t),null],text_decoration_style:[n(t),null],text_emphasis:[n(t),null],text_emphasis_color:[n(t),null],text_emphasis_position:[n(t),null],text_emphasis_style:[n(t),null],text_indent:[n(t),null],text_justify:[n(t),null],text_orientation:[n(t),null],text_overflow:[n(t),null],text_rendering:[n(t),null],text_shadow:[n(t),null],text_transform:[n(t),null],text_underline_position:[n(t),null],top:[n(t),null],touch_action:[n(t),null],transform:[n(t),null],transform_box:[n(t),null],transform_origin:[n(t),null],transform_style:[n(t),null],transition:[n(t),null],transition_delay:[n(t),null],transition_duration:[n(t),null],transition_property:[n(t),null],transition_timing_function:[n(t),null],translate:[n(t),null],unicode_bidi:[n(t),null],user_select:[n(t),null],vertical_align:[n(t),null],visibility:[n(t),null],white_space:[n(t),null],widows:[n(t),null],width:[n(t),null],will_change:[n(t),null],word_break:[n(t),null],word_spacing:[n(t),null],word_wrap:[n(t),null],writing_mode:[n(t),null],z_index:[n(t),null]}}))},function(e,t,n,i,r){var a;i();var o=e(15),s=e(53),l=e(224),u=e(232),c=e(234),h=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"button_view",get:function(){return this.tools[0].button_view}},{key:"event_type",get:function(){return this.tools[0].event_type}},{key:"tooltip",get:function(){return this.tools[0].tooltip}},{key:"tool_name",get:function(){return this.tools[0].tool_name}},{key:"icon",get:function(){return this.tools[0].computed_icon}},{key:"computed_icon",get:function(){return this.icon}},{key:"toggleable",get:function(){var e=this.tools[0];return e instanceof u.InspectTool&&e.toggleable}},{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this.do=new o.Signal0(this,"do")}},{key:"connect_signals",value:function(){var e=this;(0,_.Z)((0,d.Z)(n.prototype),"connect_signals",this).call(this),this.connect(this.do,(function(){return e.doit()})),this.connect(this.properties.active.change,(function(){return e.set_active()}));var t,i=(0,w.Z)(this.tools);try{var r=function(){var n=t.value;e.connect(n.properties.active.change,(function(){e.active=n.active}))};for(i.s();!(t=i.n()).done;)r()}catch(a){i.e(a)}finally{i.f()}}},{key:"doit",value:function(){var e,t=(0,w.Z)(this.tools);try{for(t.s();!(e=t.n()).done;){e.value.do.emit()}}catch(n){t.e(n)}finally{t.f()}}},{key:"set_active",value:function(){var e,t=(0,w.Z)(this.tools);try{for(t.s();!(e=t.n()).done;){e.value.active=this.active}}catch(n){t.e(n)}finally{t.f()}}},{key:"menu",get:function(){var e=this,t=this.tools[0].menu;if(null==t)return null;var n,i=[],r=(0,w.Z)((0,c.enumerate)(t));try{var a=function(){var t=(0,k.Z)(n.value,2),r=t[0],a=t[1];if(null==r)i.push(null);else{i.push(Object.assign(Object.assign({},r),{handler:function(){var t,n,i,r,o=(0,w.Z)(e.tools);try{for(o.s();!(r=o.n()).done;){null===(i=null===(n=null===(t=r.value.menu)||void 0===t?void 0:t[a])||void 0===n?void 0:n.handler)||void 0===i||i.call(n)}}catch(s){o.e(s)}finally{o.f()}}}))}};for(r.s();!(n=r.n()).done;)a()}catch(o){r.e(o)}finally{r.f()}return i}}]),n}(s.Model);n.ToolProxy=h,a=h,h.__name__="ToolProxy",a.define((function(e){var t=e.Boolean;return{tools:[(0,e.Array)((0,e.Ref)(l.ButtonTool)),[]],active:[t,!1],disabled:[t,!1]}}))},function(e,t,n,i,r){var a,o;i();var s=e(20),l=e(9),u=e(13),c=e(233),h=e(221),f=e(394),m=e(309),y=e(207),x=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n,[{key:"initialize",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this),this._merge_tools()}},{key:"_merge_tools",value:function(){var e,t=this;this._proxied_tools=[];var n,i={},r={},a={},o=[],s=[],c=(0,w.Z)(this.help);try{for(c.s();!(n=c.n()).done;){var h=n.value;(0,l.includes)(s,h.redirect)||(o.push(h),s.push(h.redirect))}}catch($){c.e($)}finally{c.f()}(e=this._proxied_tools).push.apply(e,o),this.help=o;var _,d=(0,w.Z)((0,u.entries)(this.gestures));try{for(d.s();!(_=d.n()).done;){var v=(0,k.Z)(_.value,2),p=v[0],m=v[1];p in a||(a[p]={});var y,g=(0,w.Z)(m.tools);try{for(g.s();!(y=g.n()).done;){var b=y.value;b.type in a[p]||(a[p][b.type]=[]),a[p][b.type].push(b)}}catch($){g.e($)}finally{g.f()}}}catch($){d.e($)}finally{d.f()}var x,Z=(0,w.Z)(this.inspectors);try{for(Z.s();!(x=Z.n()).done;){var A=x.value;A.type in i||(i[A.type]=[]),i[A.type].push(A)}}catch($){Z.e($)}finally{Z.f()}var S,T=(0,w.Z)(this.actions);try{for(T.s();!(S=T.n()).done;){var M=S.value;M.type in r||(r[M.type]=[]),r[M.type].push(M)}}catch($){T.e($)}finally{T.f()}var C,z=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=new f.ToolProxy({tools:e,active:n});return t._proxied_tools.push(i),i},E=(0,w.Z)((0,u.keys)(a));try{for(E.s();!(C=E.n()).done;){var R=C.value,B=this.gestures[R];B.tools=[];var N,O=(0,w.Z)((0,u.keys)(a[R]));
2try{var D=function(){var e=N.value,n=a[R][e];if(n.length>0)if("multi"==R){var i,r=(0,w.Z)(n);try{var o=function(){var e=i.value,n=z([e]);B.tools.push(n),t.connect(n.properties.active.change,(function(){return t._active_change(n)}))};for(r.s();!(i=r.n()).done;)o()}catch($){r.e($)}finally{r.f()}}else{var s=z(n);B.tools.push(s),t.connect(s.properties.active.change,(function(){return t._active_change(s)}))}};for(O.s();!(N=O.n()).done;)D()}catch($){O.e($)}finally{O.f()}}}catch($){E.e($)}finally{E.f()}this.actions=[];var I,P=(0,w.Z)((0,u.entries)(r));try{for(P.s();!(I=P.n()).done;){var V=(0,k.Z)(I.value,2),L=V[0],j=V[1];if("CustomAction"==L){var U,F=(0,w.Z)(j);try{for(F.s();!(U=F.n()).done;){var G=U.value;this.actions.push(z([G]))}}catch($){F.e($)}finally{F.f()}}else j.length>0&&this.actions.push(z(j))}}catch($){P.e($)}finally{P.f()}this.inspectors=[];var H,Y=(0,w.Z)((0,u.values)(i));try{for(Y.s();!(H=Y.n()).done;){var J=H.value;J.length>0&&this.inspectors.push(z(J,!0))}}catch($){Y.e($)}finally{Y.f()}var W,q=(0,w.Z)((0,u.entries)(this.gestures));try{for(q.s();!(W=q.n()).done;){var X=(0,k.Z)(W.value,2),K=X[0],Q=X[1];0!=Q.tools.length&&(Q.tools=(0,l.sort_by)(Q.tools,(function(e){return e.default_order})),"pinch"!=K&&"scroll"!=K&&"multi"!=K&&(Q.tools[0].active=!0))}}catch($){q.e($)}finally{q.f()}}}]),n}(c.ToolbarBase);n.ProxyToolbar=x,a=x,x.__name__="ProxyToolbar",a.define((function(e){return{toolbars:[(0,e.Array)((0,e.Ref)(h.Toolbar)),[]]}}));var Z=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n,[{key:"initialize",value:function(){this.model.toolbar.toolbar_location=this.model.toolbar_location,(0,_.Z)((0,d.Z)(n.prototype),"initialize",this).call(this)}},{key:"child_models",get:function(){return[this.model.toolbar]}},{key:"_update_layout",value:function(){this.layout=new y.ContentBox(this.child_views[0].el),this.model.toolbar.horizontal?this.layout.set_sizing({width_policy:"fit",min_width:100,height_policy:"fixed"}):this.layout.set_sizing({width_policy:"fixed",height_policy:"fit",min_height:100})}},{key:"after_layout",value:function(){(0,_.Z)((0,d.Z)(n.prototype),"after_layout",this).call(this);var e=this.child_views[0];e.layout.bbox=this.layout.bbox,e.render()}}]),n}(m.LayoutDOMView);n.ToolbarBoxView=Z,Z.__name__="ToolbarBoxView";var A=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e)}return(0,b.Z)(n)}(m.LayoutDOM);n.ToolbarBox=A,o=A,A.__name__="ToolbarBox",o.prototype.default_view=Z,o.define((function(e){return{toolbar:[(0,e.Ref)(c.ToolbarBase)],toolbar_location:[s.Location,"right"]}}))},function(e,t,n,i,r){i();var o=e(1),s=e(53),l=(0,o.__importStar)(e(21)),c=e(8),h=e(13);n.resolve_defs=function(e,t){var n,i,r,o;function _(e){return null!=e.module?"".concat(e.module,".").concat(e.name):e.name}function d(e){if((0,c.isString)(e))switch(e){case"Any":return l.Any;case"Unknown":return l.Unknown;case"Boolean":return l.Boolean;case"Number":return l.Number;case"Int":return l.Int;case"String":return l.String;case"Null":return l.Null}else switch(e[0]){case"Nullable":var n=(0,k.Z)(e,2)[1];return l.Nullable(d(n));case"Or":var i=(0,a.Z)(e).slice(1);return l.Or.apply(l,(0,y.Z)(i.map(d)));case"Tuple":var r=(0,a.Z)(e),o=r[1],s=r.slice(2);return l.Tuple.apply(l,[d(o)].concat((0,y.Z)(s.map(d))));case"Array":var u=(0,k.Z)(e,2)[1];return l.Array(d(u));case"Struct":var f=(0,a.Z)(e).slice(1).map((function(e){var t=(0,k.Z)(e,2);return[t[0],d(t[1])]}));return l.Struct((0,h.to_object)(f));case"Dict":var v=(0,k.Z)(e,2)[1];return l.Dict(d(v));case"Map":var p=(0,k.Z)(e,3),m=p[1],g=p[2];return l.Map(d(m),d(g));case"Enum":var b=(0,a.Z)(e).slice(1);return l.Enum.apply(l,(0,y.Z)(b));case"Ref":var w=(0,k.Z)(e,2)[1],x=t.get(_(w));if(null!=x)return l.Ref(x);throw new Error("".concat(_(w)," wasn't defined before referencing it"));case"AnyRef":return l.AnyRef()}}var f,m=(0,w.Z)(e);try{var x=function(){var e,a=f.value,l=function(){if(null==a.extends)return s.Model;var e=t.get(_(a.extends));if(null!=e)return e;throw new Error("base model ".concat(_(a.extends)," of ").concat(_(a)," is not defined"))}(),c=((o=function(e){(0,v.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,b.Z)(n)}(l)).__name__=a.name,o.__module__=a.module,o),h=(0,w.Z)(null!==(n=a.properties)&&void 0!==n?n:[]);try{for(h.s();!(e=h.n()).done;){var m=e.value,y=d(null!==(i=m.kind)&&void 0!==i?i:"Unknown");c.define((0,u.Z)({},m.name,[y,m.default]))}}catch(A){h.e(A)}finally{h.f()}var x,k=(0,w.Z)(null!==(r=a.overrides)&&void 0!==r?r:[]);try{for(k.s();!(x=k.n()).done;){var Z=x.value;c.override((0,u.Z)({},Z.name,Z.default))}}catch(A){k.e(A)}finally{k.f()}t.register(c)};for(m.s();!(f=m.n()).done;)x()}catch(Z){m.e(Z)}finally{m.f()}}},function(e,t,n,i,r){i();var a=e(5),o=e(226),s=e(113),l=e(43),u=e(398);n.index={},n.add_document_standalone=function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(t,i){var r,c,h,_,d,f,v,p,m=arguments;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d=function(){return d=(0,Z.Z)((0,x.Z)().mark((function e(a){var c,_,d,f;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _=t.roots().indexOf(a),null!=(d=r[_])?c=d:i.classList.contains(u.BOKEH_ROOT)?c=i:(c=(0,l.div)({class:u.BOKEH_ROOT}),i.appendChild(c)),e.next=4,(0,s.build_view)(a,{parent:null});case 4:return f=e.sent,e.abrupt("return",(f instanceof o.DOMView&&f.renderTo(c),h.set(a,f),n.index[a.id]=f,f));case 6:case"end":return e.stop()}}),e)}))),d.apply(this,arguments)},_=function(e){return d.apply(this,arguments)},r=m.length>2&&void 0!==m[2]?m[2]:[],c=m.length>3&&void 0!==m[3]&&m[3],h=new Map,f=(0,w.Z)(t.roots()),e.prev=6,f.s();case 8:if((v=f.n()).done){e.next=14;break}
2return p=v.value,e.next=12,_(p);case 12:e.next=8;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(6),f.e(e.t0);case 19:return e.prev=19,f.f(),e.finish(19);case 22:return e.abrupt("return",(c&&(window.document.title=t.title()),t.on_change((function(e){e instanceof a.RootAddedEvent?_(e.model):e instanceof a.RootRemovedEvent?function(e){var t=h.get(e);null!=t&&(t.remove(),h.delete(e),delete n.index[e.id])}(e.model):c&&e instanceof a.TitleChangedEvent&&(window.document.title=e.title)})),(0,y.Z)(h.values())));case 23:case"end":return e.stop()}}),e,null,[[6,16,19,22]])})));return function(t,n){return e.apply(this,arguments)}}()},function(e,t,n,i,r){i();var a=e(43),o=e(44);function s(e){var t=document.getElementById(e);if(null==t)throw new Error("Error rendering Bokeh model: could not find #".concat(e," HTML tag"));if(!document.body.contains(t))throw new Error("Error rendering Bokeh model: element #".concat(e," must be under <body>"));if("SCRIPT"==t.tagName){var i=(0,a.div)({class:n.BOKEH_ROOT});(0,a.replaceWith)(t,i),t=i}return t}n.BOKEH_ROOT=o.root,n._resolve_element=function(e){var t=e.elementid;return null!=t?s(t):document.body},n._resolve_root_elements=function(e){var t=[];if(null!=e.root_ids&&null!=e.roots){var n,i=(0,w.Z)(e.root_ids);try{for(i.s();!(n=i.n()).done;){var r=n.value;t.push(s(e.roots[r]))}}catch(a){i.e(a)}finally{i.f()}}return t}},function(e,t,n,i,r){i();var a=e(400),o=e(19),s=e(397);n._get_ws_url=function(e,t){var n,i="ws:";return"https:"==window.location.protocol&&(i="wss:"),null!=t?(n=document.createElement("a")).href=t:n=window.location,null!=e?"/"==e&&(e=""):e=n.pathname.replace(/\/+$/,""),"".concat(i,"//").concat(n.host).concat(e,"/ws")};var l={};n.add_document_from_session=function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(t,n,i){var r,u,c,h,_,d=arguments;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.length>3&&void 0!==d[3]?d[3]:[],u=d.length>4&&void 0!==d[4]&&d[4],c=window.location.search.substr(1),e.prev=3,e.next=6,function(e,t,n){var i=(0,a.parse_token)(t).session_id;e in l||(l[e]={});var r=l[e];
2return i in r||(r[i]=(0,a.pull_session)(e,t,n)),r[i]}(t,n,c);case 6:h=e.sent,e.next=13;break;case 9:throw e.prev=9,e.t0=e.catch(3),_=(0,a.parse_token)(n).session_id,o.logger.error("Failed to load Bokeh session ".concat(_,": ").concat(e.t0)),e.t0;case 13:return e.abrupt("return",(0,s.add_document_standalone)(h.document,i,r,u));case 14:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t,n,i){return e.apply(this,arguments)}}()},function(e,t,n,i,r){i();var a=e(19),o=e(5),s=e(401),l=e(402),u=e(403);n.DEFAULT_SERVER_WEBSOCKET_URL="ws://localhost:5006/ws",n.DEFAULT_TOKEN="eyJzZXNzaW9uX2lkIjogImRlZmF1bHQifQ";var c=0;function h(e){var t=e.split(".")[0],n=t.length%4;return 0!=n&&(t+="=".repeat(4-n)),JSON.parse(atob(t.replace(/_/g,"/").replace(/-/g,"+")))}n.parse_token=h;var _=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.DEFAULT_SERVER_WEBSOCKET_URL,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.DEFAULT_TOKEN,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,g.Z)(this,e),this.url=t,this.token=i,this.args_string=r,this._number=c++,this.socket=null,this.session=null,this.closed_permanently=!1,this._current_handler=null,this._pending_replies=new Map,this._pending_messages=[],this._receiver=new l.Receiver,this.id=h(i).session_id.split(".")[0],a.logger.debug("Creating websocket ".concat(this._number," to '").concat(this.url,"' session '").concat(this.id,"'"))}return(0,b.Z)(e,[{key:"connect",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,n=this;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.closed_permanently){e.next=2;break}throw new Error("Cannot connect() a closed ClientConnection");case 2:if(null==this.socket){e.next=4;break}throw new Error("Already connected");case 4:return this._current_handler=null,this._pending_replies.clear(),this._pending_messages=[],e.prev=5,t="".concat(this.url),e.abrupt("return",(null!=this.args_string&&this.args_string.length>0&&(t+="?".concat(this.args_string)),this.socket=new WebSocket(t,["bokeh",this.token]),new Promise((function(e,t){n.socket.b
2inaryType="arraybuffer",n.socket.onopen=function(){return n._on_open(e,t)},n.socket.onmessage=function(e){return n._on_message(e)},n.socket.onclose=function(e){return n._on_close(e,t)},n.socket.onerror=function(){return n._on_error(t)}}))));case 10:throw e.prev=10,e.t0=e.catch(5),a.logger.error("websocket creation failed to url: ".concat(this.url)),a.logger.error(" - ".concat(e.t0)),e.t0;case 13:case"end":return e.stop()}}),e,this,[[5,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){this.closed_permanently||(a.logger.debug("Permanently closing websocket connection ".concat(this._number)),this.closed_permanently=!0,null!=this.socket&&this.socket.close(1e3,"close method called on ClientConnection ".concat(this._number)),this.session._connection_closed())}},{key:"_schedule_reconnect",value:function(e){var t=this;setTimeout((function(){t.closed_permanently||a.logger.info("Websocket connection ".concat(t._number," disconnected, will not attempt to reconnect"))}),e)}},{key:"send",value:function(e){if(null==this.socket)throw new Error("not connected so cannot send ".concat(e));e.send(this.socket)}},{key:"send_with_reply",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(t){var n,i=this;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e,n){i._pending_replies.set(t.msgid(),{resolve:e,reject:n}),i.send(t)}));case 2:if("ERROR"!==(n=e.sent).msgtype()){e.next=5;break}throw new Error("Error reply ".concat(n.content.text));case 5:return e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"_pull_doc_json",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t,n;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.Message.create("PULL-DOC-REQ",{}),e.next=3,this.send_with_reply(t);case 3:if("doc"in(n=e.sent).content){e.next=6;break}throw new Error("No 'doc' field in PULL-DOC-REPLY");case 6:return e.abrupt("return",n.content.doc);case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_repull_session_doc",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(t,n){var i,r,l,c,h,_,d,f;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a.logger.debug(this.session?"Repulling session":"Pulling session for first time"),e.prev=1,e.next=4,this._pull_doc_json();case 4:if(r=e.sent,null==this.session)if(this.closed_permanently)a.logger.debug("Got new document after connection was already closed"),n(new Error("The connection has been closed"));else{l=o.Document.from_json(r),(c=o.Document._compute_patch_since_json(r,l)).events.length>0&&(a.logger.debug("Sending ".concat(c.events.length," changes from model construction back to server")),h=s.Message.create("PATCH-DOC",{},c),this.send(h)),this.session=new u.ClientSession(this,l,this.id),_=(0,w.Z)(this._pending_messages);try{for(_.s();!(d=_.n()).done;)f=d.value,this.session.handle(f)}catch(v){_.e(v)}finally{_.f()}this._pending_messages=[],a.logger.debug("Created a new session from new pulled doc"),t(this.session)}else this.session.document.replace_with_json(r),a.logger.debug("Updated existing session with new pulled doc");e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),null===(i=console.trace)||void 0===i||i.call(console,e.t0),a.logger.error("Failed to repull session ".concat(e.t0)),n(e.t0 instanceof Error?e.t0:"".concat(e.t0));case 11:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_on_open",value:function(e,t){var n=this;a.logger.info("Websocket connection ".concat(this._number," is now open")),this._current_handler=function(i){n._awaiting_ack_handler(i,e,t)}}},{key:"_on_message",value:function(e){null==this._current_handler&&a.logger.error("Got a message with no current handler set");try{this._receiver.consume(e.data)}catch(e){this._close_bad_protocol("".concat(e))}var t=this._receiver.message;if(null!=t){var n=t.problem();null!=n&&this._close_bad_protocol(n),this._current_handler(t)}}},{key:"_on_close",value:function(e,t){a.logger.info("Lost websocket ".concat(this._number," connection, ").concat(e.code," (").concat(e.reason,")")),this.socket=null,this._pending_replies.forEac
2h((function(e){return e.reject("Disconnected")})),this._pending_replies.clear(),this.closed_permanently||this._schedule_reconnect(2e3),t(new Error("Lost websocket connection, ".concat(e.code," (").concat(e.reason,")")))}},{key:"_on_error",value:function(e){a.logger.debug("Websocket error on socket ".concat(this._number));var t="Could not open websocket";a.logger.error("Failed to connect to Bokeh server: ".concat(t)),e(new Error(t))}},{key:"_close_bad_protocol",value:function(e){a.logger.error("Closing connection: ".concat(e)),null!=this.socket&&this.socket.close(1002,e)}},{key:"_awaiting_ack_handler",value:function(e,t,n){var i=this;"ACK"===e.msgtype()?(this._current_handler=function(e){return i._steady_state_handler(e)},this._repull_session_doc(t,n)):this._close_bad_protocol("First message was not an ACK")}},{key:"_steady_state_handler",value:function(e){var t=e.reqid(),n=this._pending_replies.get(t);n?(this._pending_replies.delete(t),n.resolve(e)):this.session?this.session.handle(e):"PATCH-DOC"!=e.msgtype()&&this._pending_messages.push(e)}}]),e}();n.ClientConnection=_,_.__name__="ClientConnection",n.pull_session=function(e,t,n){return new _(e,t,n).connect()}},function(e,t,n,i,r){i();var a=e(34),o=function(){function e(t,n,i){(0,g.Z)(this,e),this.header=t,this.metadata=n,this.content=i,this.buffers=new Map}return(0,b.Z)(e,[{key:"assemble_buffer",value:function(e,t){var n=null!=this.header.num_buffers?this.header.num_buffers:0;if(n<=this.buffers.size)throw new Error("too many buffers received, expecting ".concat(n));var i=JSON.parse(e).id;this.buffers.set(i,t)}},{key:"complete",value:function(){return null!=this.header&&null!=this.metadata&&null!=this.content&&(null==this.header.num_buffers||this.buffers.size==this.header.num_buffers)}},{key:"send",value:function(e){if((null!=this.header.num_buffers?this.header.num_buffers:0)>0)throw new Error("BokehJS only supports receiving buffers, not sending");var t=JSON.stringify(this.header),n=JSON.stringify(this.metadata),i=JSON.stringify(this.content);e.send(t),e.send(n),e.send(i)}},{key:"msgid",value:function(){return this.header.msgid}},{key:"msgtype",value:function(){return this.header.msgtype}},{key:"reqid",value:function(){return this.header.reqid}},{key:"problem",value:function(){return"msgid"in this.header?"msgtype"in this.header?null:"No msgtype in header":"No msgid in header"}}],[{key:"assemble",value:function(t,n,i){return new e(JSON.parse(t),JSON.parse(n),JSON.parse(i))}},{key:"create",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.create_header(t);return new e(r,n,i)}},{key:"create_header",value:function(e){return{msgid:(0,a.uniqueId)(),msgtype:e}}}]),e}();n.Message=o,o.__name__="Message"},function(e,t,n,i,r){i();var a=e(401),o=e(8),s=function(){function e(){(0,g.Z)(this,e),this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}return(0,b.Z)(e,[{key:"consume",value:function(e){this._current_consumer(e)}},{key:"_HEADER",value:function(e){this._assume_text(e),this.message=null,this._partial=null,this._fragments=[e],this._buf_header=null,this._current_consumer=this._METADATA}},{key:"_METADATA",value:function(e){this._assume_text(e),this._fragments.push(e),this._current_consumer=this._CONTENT}},{key:"_CONTENT",value:function(e){this._assume_text(e),this._fragments.push(e);var t=this._fragments.slice(0,3),n=(0,k.Z)(t,3),i=n[0],r=n[1],o=n[2];this._partial=a.Message.assemble(i,r,o),this._check_complete()}},{key:"_BUFFER_HEADER",value:function(e){this._assume_text(e),this._buf_header=e,this._current_consumer=this._BUFFER_PAYLOAD}},{key:"_BUFFER_PAYLOAD",value:function(e){this._assume_binary(e),this._partial.assemble_buffer(this._buf_header,e),this._check_complete()}},{key:"_assume_text",value:function(e){if(!(0,o.isString)(e))throw new Error("Expected text fragment but received binary fragment")}},{key:"_assume_binary",value:function(e){if(!(e instanceof ArrayBuffer))throw new Error("Expected binary fragment but received text fragment")}},{key:"_check_complete",value:function(){this._partial.complete()?(this.message=this._partial,this._current_consumer=this._HEADER):this._current_consumer=this._BUFFER_HEADER}}]),e}();n.Receiver=s,s.__name__="Receiver"},function(e,t,n,i,r){i();var a=e(5),o=e(401),s=e(19),l=function(){function e(t,n,i){var r=this;(0,g.Z)(this,e),this._connection=t,this.document=n,this.id=i,this._document_listener=function(e){r._document_changed(e)},this.document.on_change(this._document_listener,!0)}return(0,b.Z)(e,[{key:"handle",value:function(e){var t=e.msgtype();"PATCH-DOC"===t?this._handle_patch(e):"OK"===t?this._handle_ok(e):"ERROR"===t?this._handle_error(e):s.logger.debug("Doing nothing with message ".concat(e.msgtype()))}},{key:"close",value:function(){this._connection.close()}},{key:"_connection_closed",value:function(){this.document.remove_on_change(this._document_listener)}},{key:"request_server_info",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){var t;return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.Message.create("SERVER-INFO-REQ",{}),e.next=3,this._connection.send_with_reply(t);case 3:return e.abrupt("return",e.sent.content);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"force_roundtrip",value:function(){var e=(0,Z.Z)((0,x.Z)().mark((function e(){return(0,x.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.request_server_info();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_document_changed",value:function(e){if(e.setter_id!==this.id){var t=e instanceof a.DocumentEventBatch?e.events:[e],n=this.document.create_json_patch(t),i=o.Message.create("PATCH-DOC",{},n);this._connection.send(i)}}},{key:"_handle_patch",value:function(e){this.document.apply_json_patch(e.content,e.buffers,this.id)}},{key:"_handle_ok",value:function(e){s.logger.trace("Unhandled OK reply to ".concat(e.reqid()))}},{key:"_handle_error",value:function(e){s.logger.error("Unhandled ERROR reply to ".concat(e.reqid(),": ").concat(e.content.text))}}]),e}();n.ClientSession=l,l.__name__="ClientSession"},function(e,t,n,i,r){i();var a=e(1),o=e(5),s=e(402),l=e(19),u=e(43),c=e(13),h=e(397),_=e(398),d=(0,a.__importDefault)(e(44)),f=(0,a.__importDefault)(e(240)),v=(0,a.__importDefault)(e(405));function p(e,t){t.buffers.length>0?e.consume(t.buffers[0].buffer):e.consume(t.content.data);var n=e.message;null!=n&&this.apply_json_patch(n.content,n.buffers)}function m(e,t){if("undefined"!=typeof Jupyter&&null!=Jupyter.notebook.kernel){l.logger.info("Registering Jupyter comms for target ".concat(e));var i=Jupyter.notebook.kernel.comm_manager;try{i.register_target(e,(function(n){l.logger.info("Registering Jupyter comms for target ".concat(e));var i=new s.Receiver;n.on_msg(p.bind(t,i))}))}catch(e){l.logger.warn("Jupyter comms failed to register. push_notebook() will not function. (exception reported: ".concat(e,")"))}}else if(t.roots()[0].id in n.kernels){l.logger.info("Registering JupyterLab comms for target ".concat(e));var r=n.kernels[t.roots()[0].id];try{r.registerCommTarget(e,(function(n){l.logger.info("Registering JupyterLab comms for target ".concat(e));var i=new s.Receiver;n.onMsg=p.bind(t,i)}))}catch(e){l.logger.warn("Jupyter comms failed to register. push_notebook() will not function. (exception reported: ".concat(e,")"))}}else if("undefined"!=typeof google&&null!=google.colab.kernel){l.logger.info("Registering Google Colab comms for target ".concat(e));var o=google.colab.kernel.comms;try{o.registerTarget(e,function(){var n=(0,Z.Z)((0,x.Z)().mark((function n(i){var r,o,u,c,h,_,d,f,v,m,y,g,b;return(0,x.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:l.logger.info("Registering Google Colab comms for target ".concat(e)),c=new s.Receiver,n.prev=2,_=(0,a.__asyncValues)(i.messages);case 4:return n.next=6,_.next();case 6:if((h=n.sent).done){n.next=14;break}d=h.value,f={data:d.data},v=[],m=(0,w.Z)(null!==(u=d.buffers)&&void 0!==u?u:[]);try{for(m.s();!(y=m.n()).done;)g=y.value,v.push(new DataView(g))}catch(x){m.e(x)}finally{m.f()}b={content:f,buffers:v},p.bind(t)(c,b);case 12:n.next=4;break;case 14:n.next=19;break;case 16:n.prev=16,n.t0=n.catch(2),r={error:n.t0};
2case 19:if(n.prev=19,n.prev=20,n.t1=h&&!h.done&&(o=_.return),!n.t1){n.next=25;break}return n.next=25,o.call(_);case 25:if(n.prev=25,!r){n.next=28;break}throw r.error;case 28:return n.finish(25);case 29:return n.finish(19);case 30:case"end":return n.stop()}}),n,null,[[2,16,19,30],[20,,25,29]])})));return function(e){return n.apply(this,arguments)}}())}catch(e){l.logger.warn("Google Colab comms failed to register. push_notebook() will not function. (exception reported: ".concat(e,")"))}}else console.warn("Jupyter notebooks comms not available. push_notebook() will not function. If running JupyterLab ensure the latest @bokeh/jupyter_bokeh extension is installed. In an exported notebook this warning is expected.")}u.stylesheet.append(d.default),u.stylesheet.append(f.default),u.stylesheet.append(v.default),n.kernels={},n.embed_items_notebook=function(e,t){if(1!=(0,c.size)(e))throw new Error("embed_items_notebook expects exactly one document in docs_json");var n,i=o.Document.from_json((0,c.values)(e)[0]),r=(0,w.Z)(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;null!=a.notebook_comms_target&&m(a.notebook_comms_target,i);var s=(0,_._resolve_element)(a),l=(0,_._resolve_root_elements)(a);(0,h.add_document_standalone)(i,s,l)}}catch(u){r.e(u)}finally{r.f()}}},function(e,t,n,i,r){i(),n.root="bk-root",n.tooltip="bk-tooltip",n.default=".rendered_html .bk-root .bk-tooltip table,.rendered_html .bk-root .bk-tooltip tr,.rendered_html .bk-root .bk-tooltip th,.rendered_html .bk-root .bk-tooltip td{border:none;padding:1px;}"},function(e,t,n,i,r){i();var a=e(1);(0,a.__exportStar)(e(401),n),(0,a.__exportStar)(e(402),n)},function(e,t,n,i,r){function a(){var e=document.getElementsByTagName("body")[0],t=document.getElementsByClassName("bokeh-test-div");1==t.length&&(e.removeChild(t[0]),delete t[0]);var n=document.createElement("div");n.classList.add("bokeh-test-div"),n.style.display="none",e.insertBefore(n,e.firstChild)}i(),n.results={},n.init=function(){a()},n.record0=function(e,t){n.results[e]=t},n.record=function(e,t){n.results[e]=t,a()},n.count=function(e){null==n.results[e]&&(n.results[e]=0),n.results[e]+=1,a()}},function(e,t,n,i,r){i(),n.safely=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{return e()}catch(e){if(function(e){var t=document.createElement("div");t.style.backgroundColor="#f2dede",t.style.border="1px solid #a94442",t.style.borderRadius="4px",t.style.display="inline-block",t.style.fontFamily="sans-serif",t.style.marginTop="5px",t.style.minWidth="200px",t.style.padding="5px 5px 5px 10px",t.classList.add("bokeh-error-box-into-flames");var n=document.createElement("span");n.style.backgroundColor="#a94442",n.style.borderRadius="0px 4px 0px 0px",n.style.color="white",n.style.cursor="pointer",n.style.cssFloat="right",n.style.fontSize="0.8em",n.style.margin="-6px -6px 0px 0px",n.style.padding="2px 5px 4px 5px",n.title="close",n.setAttribute("aria-label","close"),n.appendChild(document.createTextNode("x")),n.addEventListener("click",(function(){return a.removeChild(t)}));var i=document.createElement("h3");i.style.color="#a94442",i.style.margin="8px 0px 0px 0px",i.style.padding="0px",i.appendChild(document.createTextNode("Bokeh Error"));var r=document.createElement("pre");r.style.whiteSpace="unset",r.style.overflowX="auto",r.appendChild(document.createTextNode(e)),t.appendChild(n),t.appendChild(i),t.appendChild(r);var a=document.getElementsByTagName("body")[0];a.insertBefore(t,a.firstChild)}(e instanceof Error&&e.stack?e.stack:"".concat(e)),t)return;throw e
vendor: 11,091 bytes, line 2
2}}}],0,{main:0,tslib:1,index:2,version:3,"embed/index":4,"document/index":5,"document/document":6,base:7,"core/util/types":8,"core/util/array":9,"core/util/math":10,"core/util/assert":11,"core/util/arrayable":12,"core/util/object":13,"core/has_props":14,"core/signaling":15,"core/util/defer":16,"core/util/refs":17,"core/properties":18,"core/logging":19,"core/enums":20,"core/kinds":21,"core/util/color":22,"core/util/svg_colors":23,"core/types":24,"core/util/bitset":25,"core/util/eq":26,"core/util/platform":27,"core/settings":28,"core/util/ndarray":29,"core/serializer":30,"core/util/serialization":31,"core/util/buffer":32,"core/uniforms":33,"core/util/string":34,"document/events":35,"core/util/pretty":36,"core/util/cloneable":37,"models/index":38,"models/annotations/index":39,"models/annotations/annotation":40,"models/renderers/renderer":41,"core/view":42,"core/dom":43,"styles/root.css":44,"core/visuals/index":45,"core/visuals/line":46,"core/visuals/visual":47,"core/property_mixins":48,"core/visuals/fill":49,"core/visuals/text":50,"core/visuals/hatch":51,"core/visuals/patterns":52,model:53,"models/canvas/coordinates":54,"models/scales/scale":55,"models/transforms/transform":56,"models/ranges/range":57,"models/ranges/range1d":58,"models/scales/linear_scale":59,"models/scales/continuous_scale":60,"models/scales/log_scale":61,"models/scales/categorical_scale":62,"models/ranges/data_range1d":63,"models/ranges/data_range":64,"core/util/bbox":65,"models/util":66,"models/ranges/factor_range":67,"models/annotations/arrow":68,"models/annotations/data_annotation":69,"models/sources/columnar_data_source":70,"models/sources/data_source":71,"models/selections/selection":72,"core/selection_manager":73,"models/selections/interaction_policy":74,"models/sources/column_data_source":75,"core/util/typed_array":76,"core/util/set":77,"core/util/projections":78,"models/annotations/arrow_head":112,"core/build_views":113,"models/annotations/band":114,"models/annotations/upper_lower":115,"models/annotations/box_annotation":116,"models/annotations/color_bar":117,"models/annotations/title":118,"models/annotations/text_annotation":119,"core/graphics":120,"core/util/text":121,"core/util/affine":122,"core/layout/side_panel":123,"core/layout/types":124,"core/layout/layoutable":125,"models/canvas/cartesian_frame":126,"models/axes/index":127,"models/axes/axis":128,"models/renderers/guide_renderer":129,"models/tickers/ticker":130,"models/formatters/tick_formatter":131,"models/policies/labeling":132,"models/text/base_text":133,"models/text/utils":134,"models/text/math_text":135,"core/util/image":136,"models/text/providers":137,"core/util/modules":138,"models/text/plain_text":139,"models/axes/categorical_axis":140,"models/tickers/categorical_ticker":141,"models/formatters/categorical_tick_formatter":142,"models/axes/continuous_axis":143,"models/axes/datetime_axis":144,"models/axes/linear_axis":145,"models/formatters/basic_tick_formatter":146,"models/tickers/basic_ticker":147,"models/tickers/adaptive_ticker":148,"models/tickers/continuous_ticker":149,"models/formatters/datetime_tick_formatter":150,"core/util/templating":152,"models/tickers/datetime_ticker":155,"models/tickers/composite_ticker":156,"models/tickers/days_ticker":157,"models/tickers/single_interval_ticker":158,"models/tickers/util":159,"models/tickers/months_ticker":160,"models/tickers/years_ticker":161,"models/axes/log_axis":162,"models/formatters/log_tick_formatter":163,"models/tickers/log_ticker":164,"models/axes/mercator_axis":165,"models/formatters/mercator_tick_formatter":166,"models/tickers/mercator_ticker":167,"models/tickers/index":168,"models/tickers/fixed_ticker":169,"models/tickers/binned_ticker":170,"models/mappers/scanning_color_mapper":171,"models/mappers/continuous_color_mapper":172,"models/mappers/color_mapper":173,"models/mappers/mapper":174,"models/renderers/glyph_renderer":175,"models/renderers/data_renderer":176,"models/glyphs/line":177,"models/glyphs/xy_glyph":178,"models/glyphs/glyph":179,"core/util/ragged_array":180,"core/util/spatial":181,"models/glyphs/utils":184,"core/hittest":185,"models/glyphs/patch":186,"models/glyphs/harea":187,"models/glyphs/area":188,"models/glyphs/varea":189,"models/sources/cds_view":190,"models/filters/filter":191,"models/formatters/index":192,"models/formatters/func_tick_formatter":193,"models/formatters/numeral_tick_formatter":194,"models/formatters/printf_tick_formatter":195,"models/mappers/index":196,"models/mappers/categorical_color_mapper":197,"models/mappers/categorical_mapper":198,"models/mappers/categorical_marker_mapper":199,"models/mappers/categorical_pattern_mapper":200,"models/mappers/linear_color_mapper":201,"models/mappers/log_color_mapper":202,"models/mappers/eqhist_color_mapper":203,"models/scales/index":204,"models/scales/linear_interpolation_scale":205,"models/ranges/index":206,"core/layout/index":207,"core/layout/alignments":208,"core/layout/grid":209,"core/layout/html":210,"core/layout/border":211,"models/annotations/label":212,"models/annotations/label_set":213,"models/annotations/legend":214,"models/annotations/legend_item":215,"core/vectorization":216,"models/annotations/poly_annotation":217,"models/annotations/slope":218,"models/annotations/span":219,"models/annotations/toolbar_panel":220,"models/tools/toolbar":221,"models/tools/tool":222,"models/tools/gestures/gesture_tool":223,"models/tools/button_tool":224,"core/dom_view":226,"styles/toolbar.css":227,"styles/icons.css":228,"styles/menus.css":229,"core/util/menus":230,"models/tools/on_off_button":231,"models/tools/inspectors/inspect_tool":232,"models/tools/toolbar_base":233,"core/util/iterator":234,"core/util/canvas":235,"core/util/svg":236,"core/util/random":237,"models/tools/actions/action_tool":238,"models/tools/actions/help_tool":239,"styles/logo.css":240,"models/annotations/tooltip":241,"styles/tooltips.css":242,"models/annotations/whisker":243,"models/callbacks/index":244,"models/callbacks/customjs":245,"models/callbacks/callback":246,"models/callbacks/open_url":247,"models/canvas/index":248,"models/canvas/canvas":249,"core/ui_events":250,"core/bokeh_events":251,"core/util/wheel":252,"models/expressions/index":253,"models/expressions/expression":254,"models/expressions/customjs_expr":255,"models/expressions/stack":256,"models/expressions/cumsum":257,"models/expressions/minimum":258,"models/expressions/maximum":259,"models/expressions/coordinate_transform":260,"models/expressions/polar":261,"models/filters/index":262,"models/filters/boolean_filter":263,"models/filters/customjs_filter":264,"models/filters/group_filter":265,"models/filters/index_filter":266,"models/glyphs/index":267,"models/glyphs/annular_wedge":268,"models/glyphs/annulus":269,"models/glyphs/arc":270,"models/glyphs/bezier":271,"models/glyphs/circle":272,"models/glyphs/ellipse":273,"models/glyphs/ellipse_oval":274,"models/glyphs/center_rotatable":275,"models/glyphs/hbar":276,"models/glyphs/box":277,"models/glyphs/hex_tile":278,"models/glyphs/image":279,"models/glyphs/image_base":280,"models/glyphs/image_rgba":281,"models/glyphs/image_url":282,"models/glyphs/multi_line":283,"models/glyphs/multi_polygons":284,"models/glyphs/oval":285,"models/glyphs/patches":286,"models/glyphs/quad":287,"models/glyphs/quadratic":288,"models/glyphs/ray":289,"models/glyphs/rect":290,"models/glyphs/scatter":291,"models/glyphs/marker":292,"models/glyphs/defs":293,"models/glyphs/segment":294,"models/glyphs/spline":295,"core/util/interpolation":296,"models/glyphs/step":297,"models/glyphs/text":298,"models/glyphs/vbar":299,"models/glyphs/wedge":300,"models/graphs/index":301,"models/graphs/graph_hit_test_policy":302,"models/graphs/layout_provider":303,"models/graphs/static_layout_provider":304,"models/grids/index":305,"models/grids/grid":306,"models/layouts/index":307,"models/layouts/box":308,"models/layouts/layout_dom":309,"models/layouts/column":310,"models/layouts/grid_box":311,"models/layouts/html_box":312,"models/layouts/panel":313,"models/layouts/row":314,"models/layouts/spacer":315,"models/layouts/tabs":316,"styles/tabs.css":317,"styles/buttons.css":318,"models/layouts/widget_box":319,"models/text/index":320,"models/transforms/index":321,"models/transforms/customjs_transform":322,"models/transforms/dodge":323,"models/transforms/range_transform":324,"models/transforms/interpolator":325,"models/transforms/jitter":326,"models/transforms/linear_interpolator":327,"models/transforms/step_interpolator":328,"models/plots/index":329,"models/plots/gmap_plot":330,"models/plots/plot":331,"models/plots/plot_canvas":332,"core/util/throttle":333,"models/plots/range_manager":334,"models/plots/state_manager":335,"models/plots/gmap_plot_canvas":336,"models/policies/index":337,"models/renderers/index":338,"models/renderers/graph_renderer":339,"models/selections/index":340,"models/sources/index":341,"models/sources/server_sent_data_source":342,"models/sources/web_data_source":343,"models/sources/ajax_data_source":344,"models/sources/geojson_data_source":345,"models/tiles/index":346,"models/tiles/bbox_tile_source":347,"models/tiles/mercator_tile_source":348,"models/tiles/tile_source":349,"models/tiles/tile_utils":350,"models/tiles/quadkey_tile_source":351,"models/tiles/tile_renderer":352,"models/tiles/wmts_tile_source":353,"styles/tiles.css":354,"models/tiles/tms_tile_source":355,"models/textures/index":356,"models/textures/canvas_texture":357,"models/textures/texture":358,"models/textures/image_url_texture":359,"models/tools/index":360,"models/tools/actions/custom_action":361,"models/tools/actions/redo_tool":362,"models/tools/actions/reset_tool":363,"models/tools/actions/save_tool":364,"models/tools/actions/undo_tool":365,"models/tools/actions/zoom_in_tool":366,"models/tools/actions/zoom_base_tool":367,"core/util/zoom":368,"models/tools/actions/zoom_out_tool":369,"models/tools/edit/edit_tool":370,"models/tools/edit/box_edit_tool":371,"models/tools/edit/freehand_draw_tool":372,"models/tools/edit/point_draw_tool":373,"models/tools/edit/poly_draw_tool":374,"models/tools/edit/poly_tool":375,"models/tools/edit/poly_edit_tool":376,"models/tools/gestures/box_select_tool":377,"models/tools/gestures/select_tool":378,"models/tools/gestures/box_zoom_tool":379,"models/tools/gestures/lasso_select_tool":380,"models/tools/gestures/poly_select_tool":381,"models/tools/edit/line_edit_tool":382,"models/tools/edit/line_tool":383,"models/tools/gestures/pan_tool":384,"models/tools/gestures/range_tool":385,"models/tools/gestures/tap_tool":386,"models/tools/gestures/wheel_pan_tool":387,"models/tools/gestures/wheel_zoom_tool":388,"models/tools/inspectors/crosshair_tool":389,"models/tools/inspectors/customjs_hover":390,"models/tools/inspectors/hover_tool":391,"models/dom/index":392,"models/dom/styles":393,"models/tools/tool_proxy":394,"models/tools/toolbar_box":395,"document/defs":396,"embed/standalone":397,"embed/dom":398,"embed/server":399,"client/connection":400,"protocol/message":401,"protocol/receiver":402,"client/session":403,"embed/notebook":404,"styles/notebook.css":405,"protocol/index":406,testing:407,safely:408},{})
2,S=A,T=n(40864);var M=(0,r.Z)((function(e){var t=e.width,n=e.element,r=e.height,a="bokeh-chart-".concat(n.elementId),o=(0,i.useCallback)((function(){return JSON.parse(n.figure)}),[n]),s=(0,i.useCallback)((function(e){var i=e.attributes.plot_width,a=e.attributes.plot_height;return r?(i=t,a=r):n.useContainerWidth&&(i=t),{chartWidth:i,chartHeight:a}}),[n.useContainerWidth,r,t]),l=(0,i.useCallback)((function(e){var t=document.getElementById(a),n=e&&e.doc&&e.doc.roots&&e.doc.roots.references?e.doc.roots.references.find((function(e){return"Plot"===e.type})):void 0;if(n){var i=s(n),r=i.chartWidth,o=i.chartHeight;r>0&&(n.attributes.plot_width=r),o>0&&(n.attributes.plot_height=o)}null!==t&&(!function(e){for(;e.lastChild;)e.lastChild.remove()}(t),S.embed.embed_item(e,a))}),[a,s]);return(0,i.useEffect)((function(){l(o())}),[t,r,n,o,l]),(0,T.jsx)("div",{id:a,className:"stBokehChart"})}))}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.