diff --git a/contributing/contributing.html b/contributing/contributing.html index f10b1e439..26d1d55ff 100644 --- a/contributing/contributing.html +++ b/contributing/contributing.html @@ -729,21 +729,21 @@
Both sets of equations of motion have common aerodynamic models.
First, the lift coefficient is computed using a model which assumes linearity in lift wrt the angle of attack.
-Next, the drag-due-to-lift factor is computed (Equations 12.48 and 12.61 in Raymer[@raymer2012aircraft]).
-Finally, the lift and drag are computed after computing the dynamic pressure.
-The runway equations of motion are used to integrate range and speed as the vehicle rolls along the runway.
-The flight equations of motion include two additional state variables: the flight-path angle (\(\gamma\)) and altitude (\(h\)).
-<dymos.phase.phase.Phase at 0x7fe2b0ebb580>
+<dymos.phase.phase.Phase at 0x7ff1a4da78e0>
INFO: checking out_of_order
INFO:check_config:checking out_of_order
@@ -1420,27 +1421,25 @@ Building and running the problemColoring for 'traj.phases.br_to_v1.rhs_all' (class BalancedFieldODEComp)
-
-
Jacobian shape: (132, 60) ( 9.80% nonzero)
+
+Jacobian shape: (132, 60) ( 9.81% nonzero)
FWD solves: 16 REV solves: 0
Total colors vs. total size: 16 vs 60 (73.3% improvement)
Sparsity computed using tolerance: 1e-25
-Time to compute sparsity: 0.019714 sec.
-Time to compute coloring: 0.015048 sec.
+Time to compute sparsity: 0.025481 sec.
+Time to compute coloring: 0.018218 sec.
Memory to compute coloring: 0.000000 MB.
-
Coloring for 'traj.phases.rto.rhs_all' (class BalancedFieldODEComp)
-Jacobian shape: (132, 60) ( 9.80% nonzero)
+Coloring for 'traj.phases.rto.rhs_all' (class BalancedFieldODEComp)
+
+Jacobian shape: (132, 60) ( 9.79% nonzero)
FWD solves: 16 REV solves: 0
Total colors vs. total size: 16 vs 60 (73.3% improvement)
Sparsity computed using tolerance: 1e-25
-Time to compute sparsity: 0.019854 sec.
-Time to compute coloring: 0.014563 sec.
+Time to compute sparsity: 0.025783 sec.
+Time to compute coloring: 0.018428 sec.
Memory to compute coloring: 0.000000 MB.
Coloring for 'traj.phases.v1_to_vr.rhs_all' (class BalancedFieldODEComp)
@@ -1450,8 +1449,8 @@ Building and running the problemFull total jacobian was computed 3 times, taking 1.376847 seconds.
+Full total jacobian was computed 3 times, taking 1.709031 seconds.
Total jacobian shape: (178, 166)
@@ -1487,8 +1486,8 @@ Building and running the problemColoring for 'traj.phases.br_to_v1.rhs_all' (class ExplicitFuncComp)
-Jacobian shape: (132, 60) ( 9.81% nonzero)
+Jacobian shape: (132, 60) ( 9.79% nonzero)
FWD solves: 16 REV solves: 0
Total colors vs. total size: 16 vs 60 (73.3% improvement)
Sparsity computed using tolerance: 1e-25
-Time to compute sparsity: 0.345102 sec.
-Time to compute coloring: 0.071380 sec.
+Time to compute sparsity: 0.407177 sec.
+Time to compute coloring: 0.084174 sec.
Memory to compute coloring: 0.000000 MB.
@@ -1003,13 +1003,13 @@ Building and running the problemColoring for 'traj.phases.rto.rhs_all' (class ExplicitFuncComp)
-Jacobian shape: (132, 60) ( 9.77% nonzero)
+Jacobian shape: (132, 60) ( 9.79% nonzero)
FWD solves: 16 REV solves: 0
Total colors vs. total size: 16 vs 60 (73.3% improvement)
Sparsity computed using tolerance: 1e-25
-Time to compute sparsity: 0.327971 sec.
-Time to compute coloring: 0.071099 sec.
+Time to compute sparsity: 0.379886 sec.
+Time to compute coloring: 0.082436 sec.
Memory to compute coloring: 0.000000 MB.
@@ -1023,8 +1023,8 @@ Building and running the problemFull total jacobian was computed 3 times, taking 4.735711 seconds.
+Full total jacobian was computed 3 times, taking 5.520926 seconds.
Total jacobian shape: (178, 166)
@@ -1067,8 +1067,8 @@ Building and running the problem
System dynamics#
From the free-body diagram above, the evolution of the state variables is given by the following ordinary differential equations (ODE).
-
-(13)#\[\begin{align}
+
+(13)#\[\begin{align}
\frac{d x}{d t} &= v \sin(\theta) \\
\frac{d y}{d t} &= -v \cos(\theta) \\
\frac{d v}{d t} &= g \cos(\theta)
@@ -556,8 +556,8 @@ The initial and final conditions
-(14)#\[\begin{align}
+
+(14)#\[\begin{align}
x_0 &= 0 \\
y_0 &= 10 \\
v_0 &= 0
@@ -565,8 +565,8 @@ The initial and final conditions
-(15)#\[\begin{align}
+
+(15)#\[\begin{align}
x_f &= 10 \\
y_f &= 5 \\
v_f &= \mathrm{free}
@@ -732,27 +732,27 @@ Testing the ODEModel viewer data has already been recorded for Driver.
-Full total jacobian was computed 3 times, taking 0.031635 seconds.
+
@@ -1016,7 +1016,7 @@ Solving the problem with Legendre-Gauss-Lobatto collocation in Dymos/usr/share/miniconda/envs/test/lib/python3.10/site-packages/openmdao/recorders/sqlite_recorder.py:227: UserWarning:The existing case recorder file, dymos_solution.db, is being overwritten.
-Full total jacobian was computed 3 times, taking 0.017414 seconds.
+Full total jacobian was computed 3 times, taking 0.021104 seconds.
Total jacobian shape: (12, 51)
@@ -1025,10 +1025,10 @@ Solving the problem with Legendre-Gauss-Lobatto collocation in DymosSolving the problem with Legendre-Gauss-Lobatto collocation in Dymos
@@ -1055,13 +1055,13 @@ Solving the problem with Legendre-Gauss-Lobatto collocation in Dymos
-[1.80185208]
-
-
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/openmdao/visualization/opt_report/opt_report.py:634: UserWarning: Attempting to set identical low and high ylims makes transformation singular; automatically expanding.
ax.set_ylim([ymin_plot, ymax_plot])
+[1.80185208]
+
+
diff --git a/examples/brachistochrone/brachistochrone_tandem_phases.html b/examples/brachistochrone/brachistochrone_tandem_phases.html
index a16534b1f..2f536f5e7 100644
--- a/examples/brachistochrone/brachistochrone_tandem_phases.html
+++ b/examples/brachistochrone/brachistochrone_tandem_phases.html
@@ -682,7 +682,7 @@ Setup and runModel viewer data has already been recorded for Driver.
-Full total jacobian was computed 3 times, taking 0.283968 seconds.
+Full total jacobian was computed 3 times, taking 0.336792 seconds.
Total jacobian shape: (223, 287)
@@ -691,9 +691,9 @@ Setup and run/usr/share/miniconda/envs/test/lib/python3.10/site-packages/openmdao/visualization/opt_report/opt_report.py:634: UserWarning: Attempting to set identical low and high ylims makes transformation singular; automatically expanding.
@@ -938,10 +938,10 @@ Plots#
function _(t,_,n,o,r){o();t(1).__exportStar(t(2),n),t(70)},
function _(e,t,r,n,o){n();var a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)};r.__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 r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};function i(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function u(e){return this instanceof u?(this.v=e,this):new u(e)}r.__assign=function(){return r.__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;c--)(o=e[c])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},r.__param=function(e,t){return function(r,n){t(r,n,e)}},r.__esDecorate=function(e,t,r,n,o,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var c,u=n.kind,f="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?n.static?e:e.prototype:null,s=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),p=!1,y=r.length-1;y>=0;y--){var d={};for(var h in n)d[h]="access"===h?{}:n[h];for(var h in n.access)d.access[h]=n.access[h];d.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var _=(0,r[y])("accessor"===u?{get:s.get,set:s.set}:s[f],d);if("accessor"===u){if(void 0===_)continue;if(null===_||"object"!=typeof _)throw new TypeError("Object expected");(c=i(_.get))&&(s.get=c),(c=i(_.set))&&(s.set=c),(c=i(_.init))&&o.push(c)}else(c=i(_))&&("field"===u?o.push(c):s[f]=c)}l&&Object.defineProperty(l,n.name,s),p=!0},r.__runInitializers=function(e,t,r){for(var n=arguments.length>2,o=0;o0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]1||c(e,t)}))})}function c(e,t){try{(r=o[e](t)).value instanceof u?Promise.resolve(r.value.v).then(f,l):s(a[0][2],r)}catch(e){s(a[0][3],e)}var r}function f(e){c("next",e)}function l(e){c("throw",e)}function s(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}},r.__asyncDelegator=function(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:u(e[n](t)),done:!1}:o?o(t):t}:o}},r.__asyncValues=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=i(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}},r.__makeTemplateObject=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};var f=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};r.__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)&&(0,r.__createBinding)(t,e,n);return f(t,e),t},r.__importDefault=function(e){return e&&e.__esModule?e:{default:e}},r.__classPrivateFieldGet=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},r.__classPrivateFieldSet=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},r.__classPrivateFieldIn=function(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},
function _(e,t,o,s,l){s();const r=e(1);l("version",e(3).version),l("index",e(4).index),o.embed=r.__importStar(e(4)),o.protocol=r.__importStar(e(67)),o._testing=r.__importStar(e(68));var _=e(18);l("logger",_.logger),l("set_log_level",_.set_log_level),l("settings",e(28).settings),l("Models",e(7).default_resolver),l("documents",e(5).documents),l("safely",e(69).safely)},
-function _(n,i,o,c,e){c(),o.version="3.2.0"},
-function _(e,o,t,n,r){n();const s=e(5),d=e(28),i=e(18),_=e(38),c=e(9),a=e(8),u=e(16),l=e(53),m=e(60),f=e(65);var w=e(53);r("add_document_standalone",w.add_document_standalone),r("index",w.index),r("add_document_from_session",e(60).add_document_from_session);var g=e(66);async function k(e,o,t,n){(0,a.isString)(e)&&(e=JSON.parse((0,_.unescape)(e)));const r={};for(const[o,t]of(0,c.entries)(e))r[o]=s.Document.from_json(t);const u=[];for(const e of o){const o=(0,f._resolve_element)(e),s=(0,f._resolve_root_elements)(e);if(null!=e.docid)u.push(await(0,l.add_document_standalone)(r[e.docid],o,s,e.use_for_title));else{if(null==e.token)throw new Error("Error rendering Bokeh items: either 'docid' or 'token' was expected.");{const r=(0,m._get_ws_url)(t,n);i.logger.debug(`embed: computed ws url: ${r}`);try{u.push(await(0,m.add_document_from_session)(r,e.token,o,s,e.use_for_title)),console.log("Bokeh items were rendered successfully")}catch(e){if(d.settings.dev)throw e;console.error("Error rendering Bokeh items:",e)}}}}return u}r("embed_items_notebook",g.embed_items_notebook),r("kernels",g.kernels),t.embed_item=async function(e,o){const t={},n=(0,_.uuid4)();t[n]=e.doc,null==o&&(o=e.target_id);const r={roots:{[e.root_id]:o},root_ids:[e.root_id],docid:n};await(0,u.defer)();const[s]=await k(t,[r]);return s},t.embed_items=async function(e,o,t,n){return await(0,u.defer)(),k(e,o,t,n)}},
-function _(t,_,o,r,n){r();const a=t(1);a.__exportStar(t(6),o),a.__exportStar(t(39),o)},
-function _(e,t,s,o,n){o();const i=e(1),_=e(7),l=e(3),r=e(18),a=e(45),c=e(30),d=e(46),h=e(49),m=e(15),u=e(8),f=e(25),v=e(10),g=e(9),p=i.__importStar(e(43)),w=e(50),b=e(51),k=e(52),y=e(39);d.Deserializer.register("model",b.decode_def);class z{constructor(e){this.subscribed_models=new Set,this.document=e}send_event(e){if(e.publish){const t=new y.MessageSentEvent(this.document,"bokeh_event",e);this.document._trigger_on_change(t)}this.document._trigger_on_event(e)}trigger(e){for(const t of this.subscribed_models)null!=e.origin&&e.origin!=t||t._process_event(e)}}s.EventManager=z,z.__name__="EventManager",s.documents=[],s.DEFAULT_TITLE="Bokeh Application";class S{constructor(e){var t;s.documents.push(this),this._init_timestamp=Date.now(),this._resolver=null!==(t=null==e?void 0:e.resolver)&&void 0!==t?t:new a.ModelResolver(_.default_resolver),this._title=s.DEFAULT_TITLE,this._roots=[],this._all_models=new Map,this._new_models=new Set,this._all_models_freeze_count=0,this._callbacks=new Map,this._document_callbacks=new Map,this._message_callbacks=new Map,this.event_manager=new z(this),this.idle=new m.Signal0(this,"idle"),this._idle_roots=new WeakSet,this._interactive_timestamp=null,this._interactive_plot=null}[f.equals](e,t){return this==e}get is_idle(){for(const e of this._roots)if(!this._idle_roots.has(e))return!1;return!0}notify_idle(e){this._idle_roots.add(e),this.is_idle&&(r.logger.info(`document idle at ${Date.now()-this._init_timestamp} ms`),this.event_manager.send_event(new k.DocumentReady),this.idle.emit())}clear(){this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}}interactive_start(e,t=null){null==this._interactive_plot&&(this._interactive_plot=e,this._interactive_plot.trigger_event(new k.LODStart)),this._interactive_finalize=t,this._interactive_timestamp=Date.now()}interactive_stop(){null!=this._interactive_plot&&(this._interactive_plot.trigger_event(new k.LODEnd),null!=this._interactive_finalize&&this._interactive_finalize()),this._interactive_plot=null,this._interactive_timestamp=null,this._interactive_finalize=null}interactive_duration(){return null==this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp}destructively_move(e){if(e===this)throw new Error("Attempted to overwrite a document with itself");e.clear();const t=(0,v.copy)(this._roots);this.clear();for(const e of t)if(null!=e.document)throw new Error(`Somehow we didn't detach ${e}`);if(0!=this._all_models.size)throw new Error(`this._all_models still had stuff in it: ${this._all_models}`);for(const s of t)e.add_root(s);e.set_title(this._title)}_push_all_models_freeze(){this._all_models_freeze_count+=1}_pop_all_models_freeze(){this._all_models_freeze_count-=1,0===this._all_models_freeze_count&&this._recompute_all_models()}_invalidate_all_models(){r.logger.debug("invalidating document models"),0===this._all_models_freeze_count&&this._recompute_all_models()}_recompute_all_models(){let e=new Set;for(const t of this._roots)e=p.union(e,t.references());const t=new Set(this._all_models.values()),s=p.difference(t,e),o=p.difference(e,t),n=new Map;for(const t of e)n.set(t.id,t);for(const e of s)e.detach_document();for(const e of o)e.attach_document(this),this._new_models.add(e);this._all_models=n}roots(){return this._roots}_add_root(e){if((0,v.includes)(this._roots,e))return!1;this._push_all_models_freeze();try{this._roots.push(e)}finally{this._pop_all_models_freeze()}return!0}_remove_root(e){const t=this._roots.indexOf(e);if(t<0)return!1;this._push_all_models_freeze();try{this._roots.splice(t,1)}finally{this._pop_all_models_freeze()}return!0}_set_title(e){const t=e!=this._title;return t&&(this._title=e),t}add_root(e){this._add_root(e)&&this._trigger_on_change(new y.RootAddedEvent(this,e))}remove_root(e){this._remove_root(e)&&this._trigger_on_change(new y.RootRemovedEvent(this,e))}set_title(e){this._set_title(e)&&this._trigger_on_change(new y.TitleChangedEvent(this,e))}title(){return this._title}get_model_by_id(e){var t;return null!==(t=this._all_models.get(e))&&void 0!==t?t:null}get_model_by_name(e){const t=[];for(const s of this._all_models.values())s instanceof w.Model&&s.name==e&&t.push(s);switch(t.length){case 0:return null;case 1:return t[0];default:throw new Error(`Multiple models are named '${e}'`)}}on_message(e,t){const s=this._message_callbacks.get(e);null==s?this._message_callbacks.set(e,new Set([t])):s.add(t)}remove_on_message(e,t){var s;null===(s=this._message_callbacks.get(e))||void 0===s||s.delete(t)}_trigger_on_message(e,t){const s=this._message_callbacks.get(e);if(null!=s)for(const e of s)e(t)}on_change(e,t=!1){this._callbacks.has(e)||this._callbacks.set(e,t)}remove_on_change(e){this._callbacks.delete(e)}_trigger_on_change(e){for(const[t,s]of this._callbacks)if(!s&&e instanceof y.DocumentEventBatch)for(const s of e.events)t(s);else t(e)}_trigger_on_event(e){const t=this._document_callbacks.get(e.event_name);if(null!=t)for(const s of t)s.execute(this,e)}on_event(e,...t){var s;const o=(0,u.isString)(e)?e:e.prototype.event_name,n=null!==(s=this._document_callbacks.get(o))&&void 0!==s?s:[],i=t.map((e=>(0,u.isFunction)(e)?{execute:e}:e));this._document_callbacks.set(o,[...n,...i])}to_json_string(e=!0){return JSON.stringify(this.to_json(e))}to_json(e=!0){const t=new c.Serializer({include_defaults:e}).encode(this._roots);return{version:l.version,title:this._title,roots:t}}static from_json_string(e,t){const s=JSON.parse(e);return S.from_json(s,t)}static _handle_version(e){if(null!=e.version){const t=e.version,s=-1!==t.indexOf("+")||-1!==t.indexOf("-"),o=`Library versions: JS (${l.version}) / Python (${t})`;s||(0,h.pyify_version)(l.version)==t?r.logger.debug(o):(r.logger.warn("JS/Python version mismatch"),r.logger.warn(o))}else r.logger.warn("'version' field is missing")}static from_json(e,t){r.logger.debug("Creating Document from JSON"),S._handle_version(e);const s=new a.ModelResolver(_.default_resolver);if(null!=e.defs){new d.Deserializer(s).decode(e.defs)}const o=new S({resolver:s});o._push_all_models_freeze();const n=e=>null==t?void 0:t.push(e);o.on_change(n,!0);const i=new d.Deserializer(s,o._all_models,(e=>e.attach_document(o))),l=i.decode(e.roots),c=null!=e.callbacks?i.decode(e.callbacks):{};o.remove_on_change(n);for(const[e,t]of(0,g.entries)(c))o.on_event(e,...t);for(const e of l)o.add_root(e);return null!=e.title&&o.set_title(e.title),o._pop_all_models_freeze(),o}replace_with_json(e){S.from_json(e).destructively_move(this)}create_json_patch(e){for(const t of e)if(t.document!=this)throw new Error("Cannot create a patch using events from a different document");const t=new Map;for(const e of this._all_models.values())this._new_models.has(e)||t.set(e,e.ref());const s={events:new c.Serializer({references:t,binary:!0}).encode(e)};return this._new_models.clear(),s}apply_json_patch(e,t=new Map){this._push_all_models_freeze();const s=new d.Deserializer(this._resolver,this._all_models,(e=>e.attach_document(this))).decode(e.events,t);for(const e of s)switch(e.kind){case"MessageSent":{const{msg_type:t,msg_data:s}=e;this._trigger_on_message(t,s);break}case"ModelChanged":{const{model:t,attr:s,new:o}=e;t.setv({[s]:o},{sync:!1});break}case"ColumnDataChanged":{const{model:t,attr:s,cols:o,data:n}=e;if(null!=o){const e=t.property(s).get_value();for(const t in e)t in n||(n[t]=e[t])}t.setv({data:n},{sync:!1,check_eq:!1});break}case"ColumnsStreamed":{const{model:t,attr:s,data:o,rollover:n}=e,i=t.property(s);t.stream_to(i,o,n,{sync:!1});break}case"ColumnsPatched":{const{model:t,attr:s,patches:o}=e,n=t.property(s);t.patch_to(n,o,{sync:!1});break}case"RootAdded":this._add_root(e.model);break;case"RootRemoved":this._remove_root(e.model);break;case"TitleChanged":this._set_title(e.title);break;default:throw new Error(`unknown patch event type '${e.kind}'`)}this._pop_all_models_freeze()}}s.Document=S,S.__name__="Document"},
+function _(n,i,o,c,e){c(),o.version="3.2.1"},
+function _(e,o,t,n,r){n();const s=e(5),d=e(28),i=e(18),_=e(39),c=e(9),a=e(8),u=e(16),l=e(53),m=e(60),f=e(65);var w=e(53);r("add_document_standalone",w.add_document_standalone),r("index",w.index),r("add_document_from_session",e(60).add_document_from_session);var g=e(66);async function k(e,o,t,n){(0,a.isString)(e)&&(e=JSON.parse((0,_.unescape)(e)));const r={};for(const[o,t]of(0,c.entries)(e))r[o]=s.Document.from_json(t);const u=[];for(const e of o){const o=(0,f._resolve_element)(e),s=(0,f._resolve_root_elements)(e);if(null!=e.docid)u.push(await(0,l.add_document_standalone)(r[e.docid],o,s,e.use_for_title));else{if(null==e.token)throw new Error("Error rendering Bokeh items: either 'docid' or 'token' was expected.");{const r=(0,m._get_ws_url)(t,n);i.logger.debug(`embed: computed ws url: ${r}`);try{u.push(await(0,m.add_document_from_session)(r,e.token,o,s,e.use_for_title)),console.log("Bokeh items were rendered successfully")}catch(e){if(d.settings.dev)throw e;console.error("Error rendering Bokeh items:",e)}}}}return u}r("embed_items_notebook",g.embed_items_notebook),r("kernels",g.kernels),t.embed_item=async function(e,o){const t={},n=(0,_.uuid4)();t[n]=e.doc,null==o&&(o=e.target_id);const r={roots:{[e.root_id]:o},root_ids:[e.root_id],docid:n};await(0,u.defer)();const[s]=await k(t,[r]);return s},t.embed_items=async function(e,o,t,n){return await(0,u.defer)(),k(e,o,t,n)}},
+function _(t,_,o,r,n){r();const a=t(1);a.__exportStar(t(6),o),a.__exportStar(t(40),o)},
+function _(e,t,s,o,n){o();const i=e(1),_=e(7),l=e(3),r=e(18),a=e(45),c=e(31),d=e(46),h=e(49),m=e(15),u=e(8),f=e(25),v=e(10),g=e(9),p=i.__importStar(e(43)),w=e(50),b=e(51),k=e(52),y=e(40);d.Deserializer.register("model",b.decode_def);class z{constructor(e){this.subscribed_models=new Set,this.document=e}send_event(e){if(e.publish){const t=new y.MessageSentEvent(this.document,"bokeh_event",e);this.document._trigger_on_change(t)}this.document._trigger_on_event(e)}trigger(e){for(const t of this.subscribed_models)null!=e.origin&&e.origin!=t||t._process_event(e)}}s.EventManager=z,z.__name__="EventManager",s.documents=[],s.DEFAULT_TITLE="Bokeh Application";class S{constructor(e){var t;s.documents.push(this),this._init_timestamp=Date.now(),this._resolver=null!==(t=null==e?void 0:e.resolver)&&void 0!==t?t:new a.ModelResolver(_.default_resolver),this._title=s.DEFAULT_TITLE,this._roots=[],this._all_models=new Map,this._new_models=new Set,this._all_models_freeze_count=0,this._callbacks=new Map,this._document_callbacks=new Map,this._message_callbacks=new Map,this.event_manager=new z(this),this.idle=new m.Signal0(this,"idle"),this._idle_roots=new WeakSet,this._interactive_timestamp=null,this._interactive_plot=null}[f.equals](e,t){return this==e}get is_idle(){for(const e of this._roots)if(!this._idle_roots.has(e))return!1;return!0}notify_idle(e){this._idle_roots.add(e),this.is_idle&&(r.logger.info(`document idle at ${Date.now()-this._init_timestamp} ms`),this.event_manager.send_event(new k.DocumentReady),this.idle.emit())}clear(){this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}}interactive_start(e,t=null){null==this._interactive_plot&&(this._interactive_plot=e,this._interactive_plot.trigger_event(new k.LODStart)),this._interactive_finalize=t,this._interactive_timestamp=Date.now()}interactive_stop(){null!=this._interactive_plot&&(this._interactive_plot.trigger_event(new k.LODEnd),null!=this._interactive_finalize&&this._interactive_finalize()),this._interactive_plot=null,this._interactive_timestamp=null,this._interactive_finalize=null}interactive_duration(){return null==this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp}destructively_move(e){if(e===this)throw new Error("Attempted to overwrite a document with itself");e.clear();const t=(0,v.copy)(this._roots);this.clear();for(const e of t)if(null!=e.document)throw new Error(`Somehow we didn't detach ${e}`);if(0!=this._all_models.size)throw new Error(`this._all_models still had stuff in it: ${this._all_models}`);for(const s of t)e.add_root(s);e.set_title(this._title)}_push_all_models_freeze(){this._all_models_freeze_count+=1}_pop_all_models_freeze(){this._all_models_freeze_count-=1,0===this._all_models_freeze_count&&this._recompute_all_models()}_invalidate_all_models(){r.logger.debug("invalidating document models"),0===this._all_models_freeze_count&&this._recompute_all_models()}_recompute_all_models(){let e=new Set;for(const t of this._roots)e=p.union(e,t.references());const t=new Set(this._all_models.values()),s=p.difference(t,e),o=p.difference(e,t),n=new Map;for(const t of e)n.set(t.id,t);for(const e of s)e.detach_document();for(const e of o)e.attach_document(this),this._new_models.add(e);this._all_models=n}roots(){return this._roots}_add_root(e){if((0,v.includes)(this._roots,e))return!1;this._push_all_models_freeze();try{this._roots.push(e)}finally{this._pop_all_models_freeze()}return!0}_remove_root(e){const t=this._roots.indexOf(e);if(t<0)return!1;this._push_all_models_freeze();try{this._roots.splice(t,1)}finally{this._pop_all_models_freeze()}return!0}_set_title(e){const t=e!=this._title;return t&&(this._title=e),t}add_root(e){this._add_root(e)&&this._trigger_on_change(new y.RootAddedEvent(this,e))}remove_root(e){this._remove_root(e)&&this._trigger_on_change(new y.RootRemovedEvent(this,e))}set_title(e){this._set_title(e)&&this._trigger_on_change(new y.TitleChangedEvent(this,e))}title(){return this._title}get_model_by_id(e){var t;return null!==(t=this._all_models.get(e))&&void 0!==t?t:null}get_model_by_name(e){const t=[];for(const s of this._all_models.values())s instanceof w.Model&&s.name==e&&t.push(s);switch(t.length){case 0:return null;case 1:return t[0];default:throw new Error(`Multiple models are named '${e}'`)}}on_message(e,t){const s=this._message_callbacks.get(e);null==s?this._message_callbacks.set(e,new Set([t])):s.add(t)}remove_on_message(e,t){var s;null===(s=this._message_callbacks.get(e))||void 0===s||s.delete(t)}_trigger_on_message(e,t){const s=this._message_callbacks.get(e);if(null!=s)for(const e of s)e(t)}on_change(e,t=!1){this._callbacks.has(e)||this._callbacks.set(e,t)}remove_on_change(e){this._callbacks.delete(e)}_trigger_on_change(e){for(const[t,s]of this._callbacks)if(!s&&e instanceof y.DocumentEventBatch)for(const s of e.events)t(s);else t(e)}_trigger_on_event(e){const t=this._document_callbacks.get(e.event_name);if(null!=t)for(const s of t)s.execute(this,e)}on_event(e,...t){var s;const o=(0,u.isString)(e)?e:e.prototype.event_name,n=null!==(s=this._document_callbacks.get(o))&&void 0!==s?s:[],i=t.map((e=>(0,u.isFunction)(e)?{execute:e}:e));this._document_callbacks.set(o,[...n,...i])}to_json_string(e=!0){return JSON.stringify(this.to_json(e))}to_json(e=!0){const t=new c.Serializer({include_defaults:e}).encode(this._roots);return{version:l.version,title:this._title,roots:t}}static from_json_string(e,t){const s=JSON.parse(e);return S.from_json(s,t)}static _handle_version(e){if(null!=e.version){const t=e.version,s=-1!==t.indexOf("+")||-1!==t.indexOf("-"),o=`Library versions: JS (${l.version}) / Python (${t})`;s||(0,h.pyify_version)(l.version)==t?r.logger.debug(o):(r.logger.warn("JS/Python version mismatch"),r.logger.warn(o))}else r.logger.warn("'version' field is missing")}static from_json(e,t){r.logger.debug("Creating Document from JSON"),S._handle_version(e);const s=new a.ModelResolver(_.default_resolver);if(null!=e.defs){new d.Deserializer(s).decode(e.defs)}const o=new S({resolver:s});o._push_all_models_freeze();const n=e=>null==t?void 0:t.push(e);o.on_change(n,!0);const i=new d.Deserializer(s,o._all_models,(e=>e.attach_document(o))),l=i.decode(e.roots),c=null!=e.callbacks?i.decode(e.callbacks):{};o.remove_on_change(n);for(const[e,t]of(0,g.entries)(c))o.on_event(e,...t);for(const e of l)o.add_root(e);return null!=e.title&&o.set_title(e.title),o._pop_all_models_freeze(),o}replace_with_json(e){S.from_json(e).destructively_move(this)}create_json_patch(e){for(const t of e)if(t.document!=this)throw new Error("Cannot create a patch using events from a different document");const t=new Map;for(const e of this._all_models.values())this._new_models.has(e)||t.set(e,e.ref());const s={events:new c.Serializer({references:t,binary:!0}).encode(e)};return this._new_models.clear(),s}apply_json_patch(e,t=new Map){this._push_all_models_freeze();const s=new d.Deserializer(this._resolver,this._all_models,(e=>e.attach_document(this))).decode(e.events,t);for(const e of s)switch(e.kind){case"MessageSent":{const{msg_type:t,msg_data:s}=e;this._trigger_on_message(t,s);break}case"ModelChanged":{const{model:t,attr:s,new:o}=e;t.setv({[s]:o},{sync:!1});break}case"ColumnDataChanged":{const{model:t,attr:s,cols:o,data:n}=e;if(null!=o){const e=t.property(s).get_value();for(const t in e)t in n||(n[t]=e[t])}t.setv({data:n},{sync:!1,check_eq:!1});break}case"ColumnsStreamed":{const{model:t,attr:s,data:o,rollover:n}=e,i=t.property(s);t.stream_to(i,o,n,{sync:!1});break}case"ColumnsPatched":{const{model:t,attr:s,patches:o}=e,n=t.property(s);t.patch_to(n,o,{sync:!1});break}case"RootAdded":this._add_root(e.model);break;case"RootRemoved":this._remove_root(e.model);break;case"TitleChanged":this._set_title(e.title);break;default:throw new Error(`unknown patch event type '${e.kind}'`)}this._pop_all_models_freeze()}}s.Document=S,S.__name__="Document"},
function _(e,o,r,s,t){s();const l=e(8),n=e(9),a=e(14),f=e(45);r.default_resolver=new f.ModelResolver(null),r.register_models=function(e,o=!1){for(const t of(0,l.isArray)(e)?e:(0,n.values)(e))s=t,(0,l.isObject)(s)&&s.prototype instanceof a.HasProps&&r.default_resolver.register(t,o);var s}},
function _(n,t,r,e,i){e();
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
@@ -955,10 +955,10 @@ Plots#
function _(n,t,r,o,e){o();const a=n(8),c=n(12),{PI:u,abs:i,sign:f}=Math;function l(n){if(0==n)return 0;for(;n<=0;)n+=2*u;for(;n>2*u;)n-=2*u;return n}function s(n,t){return l(n-t)}function h(n){switch(n){case"deg":return u/180;case"rad":return 1;case"grad":return u/200;case"turn":return 2*u}}function g(n,t){for(n=Math.abs(n),t=Math.abs(t);0!=t;)[n,t]=[t,n%t];return n}r.angle_norm=l,r.angle_dist=s,r.angle_between=function(n,t,r,o=!1){const e=s(t,r);if(0==e)return!1;if(e==2*u)return!0;const a=l(n),c=s(t,a)<=e&&s(a,r)<=e;return o?!c:c},r.randomIn=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},r.atan2=function(n,t){return Math.atan2(t[1]-n[1],t[0]-n[0])},r.radians=function(n){return n*(u/180)},r.degrees=function(n){return n/(u/180)},r.compute_angle=function(n,t,r="anticlock"){return-("anticlock"==r?1:-1)*n*h(t)},r.invert_angle=function(n,t,r="anticlock"){return-("anticlock"==r?1:-1)*n/h(t)},r.to_radians_coeff=h,r.clamp=function(n,t,r){return nr?r:n},r.log=function(n,t=Math.E){return Math.log(n)/Math.log(t)},r.gcd=g,r.lcm=function(n,...t){for(const r of t)n=Math.floor(n*r/g(n,r));return n},r.float=Symbol("float"),r.is_Floating=function(n){return(0,a.isObject)(n)&&r.float in n};class m{constructor(n,t){(0,c.assert)(0!=t,"Zero divisor");const r=g(n,t),o=f(n)*f(t);this.numer=o*i(n)/r,this.denom=i(t)/r}[r.float](){return this.numer/this.denom}toString(){return`${this.numer}/${this.denom}`}}function _(n){let t=1;for(let r=2;r<=n;r++)t*=r;return t}r.Fraction=m,m.__name__="Fraction",r.float32_epsilon=1.1920928955078125e-7,r.factorial=_,r.hermite=function(n){const t=new Array(n+1);t.fill(0);const r=_(n);for(let o=0;o<=Math.floor(n/2);o++){const e=(-1)**o*r/(_(o)*_(n-2*o))*2**(n-2*o);t[2*o]=e}return t},r.eval_poly=function(n,t){let r=0,o=1;for(let e=n.length-1;e>=0;e--)r+=o*n[e],o*=t;return r}},
function _(r,n,e,o,s){o();class t extends Error{}e.AssertionError=t,t.__name__="AssertionError",e.assert=function(r,n){if(!(!0===r||!1!==r&&r()))throw new t(null!=n?n:"Assertion failed")},e.unreachable=function(){throw new Error("unreachable code")}},
function _(n,t,e,r,o){r();const i=n(11);function u(n,t,e,...r){const o=n.length;t<0&&(t+=o),t<0?t=0:t>o&&(t=o),null==e||e>o-t?e=o-t:e<0&&(e=0);const i=o-e+r.length,u=new n.constructor(i);let c=0;for(;c0?0:r-1;for(;o>=0&&ot[t.length-1])return t.length;if(1==t.length)return 0;let e=0,r=t.length-1;for(;r-e!=1;){const o=e+Math.floor((r-e)/2);n>=t[o]?e=o:r=o}return e}e.is_empty=function(n){return 0==n.length},e.copy=function(n){return Array.isArray(n)?n.slice():new n.constructor(n)},e.splice=u,e.head=c,e.insert=function(n,t,e){return u(n,e,0,t)},e.append=function(n,t){return u(n,n.length,0,t)},e.prepend=function(n,t){return u(n,0,0,t)},e.index_of=function(n,t){return n.indexOf(t)},e.includes=l,e.contains=l,e.subselect=function(n,t){const e=t.length,r=new n.constructor(e);for(let o=0;o({index:e,key:t(n)})));return e.sort(((n,t)=>{const e=n.key,r=t.key;if(e!==r){if(e>r)return 1;if(en[e[r].index]))},e.min=function(n){let t,e=1/0;for(let r=0,o=n.length;re&&(e=t);return e},e.minmax=function(n){let t,e=1/0,r=-1/0;for(let o=0,i=n.length;or&&(r=t));return[e,r]},e.minmax2=function(n,t){let e,r,o=1/0,i=-1/0,u=1/0,c=-1/0;const l=Math.min(n.length,t.length);for(let f=0;fi&&(i=e),rc&&(c=r));return[o,i,u,c]},e.min_by=function(n,t){if(0==n.length)throw new Error("min_by() called with an empty array");let e=n[0],r=t(e);for(let o=1,i=n.length;or&&(e=i,r=u)}return e},e.sum=function(n){let t=0;for(let e=0,r=n.length;et[r]=n+e),0),t},e.every=function(n,t){for(const e of n)if(!t(e))return!1;return!0},e.some=function(n,t){for(const e of n)if(t(e))return!0;return!1},e.find_index=a(1),e.find_last_index=a(-1),e.find=function(n,t){const r=(0,e.find_index)(n,t);return-1==r?void 0:n[r]},e.find_last=function(n,t){const r=(0,e.find_last_index)(n,t);return-1==r?void 0:n[r]},e.sorted_index=h,e.bin_counts=function(n,t){const e=t.length-1,r=Array(e).fill(0);for(let o=0;o(n-t)/r))}},
-function _(t,e,s,n,i){var r;n();const o=t(1),c=t(15),a=o.__importStar(t(17)),h=o.__importStar(t(20)),_=t(12),l=t(38),u=t(9),f=t(8),p=t(25),d=t(30),g=t(39),y=t(25),m=t(40),v=t(41),w=o.__importStar(t(20)),b=t(27),S=t(42),$=new WeakMap;class j extends((0,c.Signalable)()){get is_syncable(){return!0}get type(){return this.constructor.__qualified__}static get __qualified__(){let t=$.get(this);if(null==t){const{__module__:e,__name__:s}=this;t=null!=e?`${e}.${s}`:s,$.set(this,t)}return t}static set __qualified__(t){$.set(this,t)}get[Symbol.toStringTag](){return this.constructor.__qualified__}static _fix_default(t,e){if(void 0===t||t===a.unset)return()=>a.unset;if((0,f.isFunction)(t))return t;if((0,f.isPrimitive)(t))return()=>t;{const e=new v.Cloner;return()=>e.clone(t)}}static define(t){for(const[e,s]of(0,u.entries)((0,f.isFunction)(t)?t(w):t)){if(e in this.prototype._props)throw new Error(`attempted to redefine property '${this.prototype.type}.${e}'`);if(e in this.prototype)throw new Error(`attempted to redefine attribute '${this.prototype.type}.${e}'`);Object.defineProperty(this.prototype,e,{get(){return this.properties[e].get_value()},set(t){return this.setv({[e]:t}),this},configurable:!1,enumerable:!0});const[t,n,i={}]=s,r={type:t,default_value:this._fix_default(n,e),options:i};this.prototype._props=Object.assign(Object.assign({},this.prototype._props),{[e]:r})}}static internal(t){const e={};for(const[s,n]of(0,u.entries)((0,f.isFunction)(t)?t(w):t)){const[t,i,r={}]=n;e[s]=[t,i,Object.assign(Object.assign({},r),{internal:!0})]}this.define(e)}static mixins(t){function e(t,e){const s={};for(const[n,i]of(0,u.entries)(e))s[t+n]=i;return s}const s={},n=[];for(const i of(0,f.isArray)(t)?t:[t])if((0,f.isArray)(i)){const[t,r]=i;(0,u.extend)(s,e(t,r)),n.push([t,r])}else{const t=i;(0,u.extend)(s,t),n.push(["",t])}this.define(s),this.prototype._mixins=[...this.prototype._mixins,...n]}static override(t){for(const[e,s]of(0,u.entries)(t)){const t=this._fix_default(s,e);if(!(e in this.prototype._props))throw new Error(`attempted to override nonexistent '${this.prototype.type}.${e}'`);const n=this.prototype._props[e],i=Object.assign({},this.prototype._props);i[e]=Object.assign(Object.assign({},n),{default_value:t}),this.prototype._props=i}}static toString(){return this.__qualified__}toString(){return`${this.type}(${this.id})`}property(t){if(t in this.properties)return this.properties[t];throw new Error(`unknown property ${this.type}.${t}`)}get attributes(){const t={};for(const e of this)e.is_unset||(t[e.attr]=e.get_value());return t}[v.clone](t){const e=new Map;for(const s of this)s.dirty&&e.set(s.attr,t.clone(s.get_value()));return new this.constructor(e)}[y.equals](t,e){for(const s of this){const n=t.property(s.attr);if(!e.eq(s.get_value(),n.get_value()))return!1}return!0}[m.pretty](t){const e=t.token,s=[];for(const n of this)if(n.dirty){const i=n.get_value();s.push(`${n.attr}${e(":")} ${t.to_string(i)}`)}return`${this.constructor.__qualified__}${e("(")}${e("{")}${s.join(`${e(",")} `)}${e("}")}${e(")")}`}[d.serialize](t){const e=this.ref();t.add_ref(this,e);const s={};for(const e of this)if(e.syncable&&(t.include_defaults||e.dirty)){const n=e.get_value();s[e.attr]=t.encode(n)}const{type:n,id:i}=this,r={type:"object",name:n,id:i};return(0,u.is_empty)(s)?r:Object.assign(Object.assign({},r),{attributes:s})}constructor(t={}){super(),this.document=null,this.destroyed=new c.Signal0(this,"destroyed"),this.change=new c.Signal0(this,"change"),this.transformchange=new c.Signal0(this,"transformchange"),this.exprchange=new c.Signal0(this,"exprchange"),this.streaming=new c.Signal0(this,"streaming"),this.patching=new c.Signal(this,"patching"),this.properties={},this._watchers=new WeakMap,this._pending=!1,this._changing=!1;const e=(0,f.isPlainObject)(t)&&"id"in t;this.id=e?t.id:(0,l.unique_id)();for(const[t,{type:e,default_value:s,options:n}]of(0,u.entries)(this._props)){let i;e instanceof a.PropertyAlias?Object.defineProperty(this.properties,t,{get:()=>this.properties[e.attr],configurable:!1,enumerable:!1}):(i=e instanceof h.Kind?new a.PrimitiveProperty(this,t,e,s,n):new e(this,t,h.Any,s,n),this.properties[t]=i)}if(e)(0,_.assert)(1==(0,u.keys)(t).length,"'id' cannot be used together with property initializers");else{const e=t instanceof Map?t:new u.Dict(t);this.initialize_props(e),this.finalize(),this.connect_signals()}}initialize_props(t){const e=new Set;for(const s of this){const n=t.get(s.attr);s.initialize(n),e.add(s.attr)}for(const s of t.keys())e.has(s)||this.property(s)}finalize(){this.initialize()}initialize(){}assert_initialized(){for(const t of this)t.syncable&&!t.readonly&&t.get_value()}connect_signals(){for(const t of this){if(!(t instanceof a.VectorSpec||t instanceof a.ScalarSpec))continue;if(t.is_unset)continue;const e=t.get_value();null!=e.transform&&this.connect(e.transform.change,(()=>this.transformchange.emit())),(0,b.isExpr)(e)&&this.connect(e.expr.change,(()=>this.exprchange.emit()))}}disconnect_signals(){c.Signal.disconnect_receiver(this)}destroy(){this.disconnect_signals(),this.destroyed.emit()}clone(){return(new v.Cloner).clone(this)}_clear_watchers(){this._watchers=new WeakMap}changed_for(t){const e=this._watchers.get(t);return this._watchers.set(t,!1),null==e||e}_setv(t,e){var s;const n=e.check_eq,i=new Set,r=this._changing;this._changing=!0;for(const[e,s]of t)!1!==n&&!e.is_unset&&(0,p.is_equal)(e.get_value(),s)||(e.set_value(s),i.add(e));i.size>0&&(this._clear_watchers(),this._pending=!0);for(const t of i)t.change.emit();if(!r){if(null===(s=e.no_change)||void 0===s||!s)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}return i}setv(t,e={}){var s,n;const i=(0,u.entries)(t);if(0==i.length)return;if(null!==(s=e.silent)&&void 0!==s&&s){this._clear_watchers();for(const[t,e]of i)this.properties[t].set_value(e);return}const r=new Map,o=new Map;for(const[t,e]of i){const s=this.properties[t];r.set(s,e),o.set(s,s.is_unset?void 0:s.get_value())}const c=this._setv(r,e),{document:a}=this;if(null!=a){const t=[];for(const[e,s]of o)c.has(e)&&t.push([e,s,e.get_value()]);for(const[,e,s]of t)if(this._needs_invalidate(e,s)){a._invalidate_all_models();break}(null===(n=e.sync)||void 0===n||n)&&this._push_changes(t)}}ref(){return{id:this.id}}*[Symbol.iterator](){yield*(0,u.values)(this.properties)}*syncable_properties(){for(const t of this)t.syncable&&(yield t)}static _value_record_references(t,e,s){const{recursive:n}=s;if((0,f.isObject)(t))if(t instanceof j){if(!e.has(t)&&(e.add(t),n))for(const s of t.syncable_properties())if(!s.is_unset){const t=s.get_value();j._value_record_references(t,e,{recursive:n})}}else if((0,f.isIterable)(t))for(const s of t)j._value_record_references(s,e,{recursive:n});else if((0,f.isPlainObject)(t))for(const s of(0,u.values)(t))j._value_record_references(s,e,{recursive:n})}references(){const t=new Set;return j._value_record_references(this,t,{recursive:!0}),t}_doc_attached(){}_doc_detached(){}attach_document(t){if(null!=this.document){if(this.document==t)return;throw new Error("models must be owned by only a single document")}this.document=t,this._doc_attached()}detach_document(){this._doc_detached(),this.document=null}_needs_invalidate(t,e){const s=new Set;j._value_record_references(e,s,{recursive:!1});const n=new Set;j._value_record_references(t,n,{recursive:!1});for(const t of s)if(!n.has(t))return!0;for(const t of n)if(!s.has(t))return!0;return!1}_push_changes(t){if(!this.is_syncable)return;const{document:e}=this;if(null==e)return;const s=[];for(const[n,,i]of t)n.syncable&&s.push(new g.ModelChangedEvent(e,this,n.attr,i));if(0!=s.length){let t;1==s.length?[t]=s:t=new g.DocumentEventBatch(e,s),e._trigger_on_change(t)}}on_change(t,e){for(const s of(0,f.isArray)(t)?t:[t])this.connect(s.change,e)}stream_to(t,e,s,{sync:n}={}){const i=t.get_value();if((0,S.stream_to_columns)(i,e,s),this._clear_watchers(),t.set_value(i),this.streaming.emit(),null!=this.document&&(null==n||n)){const n=new g.ColumnsStreamedEvent(this.document,this,t.attr,e,s);this.document._trigger_on_change(n)}}patch_to(t,e,{sync:s}={}){const n=t.get_value(),i=(0,S.patch_to_columns)(n,e);if(this._clear_watchers(),t.set_value(n),this.patching.emit([...i]),null!=this.document&&(null==s||s)){const s=new g.ColumnsPatchedEvent(this.document,this,t.attr,e);this.document._trigger_on_change(s)}}}s.HasProps=j,(r=j).prototype._props={},r.prototype._mixins=[]},
+function _(t,e,s,n,i){var r;n();const o=t(1),c=t(15),a=o.__importStar(t(17)),h=o.__importStar(t(20)),_=t(12),l=t(39),u=t(9),f=t(8),p=t(25),d=t(31),g=t(40),y=t(25),m=t(41),v=t(30),w=o.__importStar(t(20)),b=t(27),S=t(42),$=new WeakMap;class j extends((0,c.Signalable)()){get is_syncable(){return!0}get type(){return this.constructor.__qualified__}static get __qualified__(){let t=$.get(this);if(null==t){const{__module__:e,__name__:s}=this;t=null!=e?`${e}.${s}`:s,$.set(this,t)}return t}static set __qualified__(t){$.set(this,t)}get[Symbol.toStringTag](){return this.constructor.__qualified__}static _fix_default(t,e){if(void 0===t||t===a.unset)return()=>a.unset;if((0,f.isFunction)(t))return t;if((0,f.isPrimitive)(t))return()=>t;{const e=new v.Cloner;return()=>e.clone(t)}}static define(t){for(const[e,s]of(0,u.entries)((0,f.isFunction)(t)?t(w):t)){if(e in this.prototype._props)throw new Error(`attempted to redefine property '${this.prototype.type}.${e}'`);if(e in this.prototype)throw new Error(`attempted to redefine attribute '${this.prototype.type}.${e}'`);Object.defineProperty(this.prototype,e,{get(){return this.properties[e].get_value()},set(t){return this.setv({[e]:t}),this},configurable:!1,enumerable:!0});const[t,n,i={}]=s,r={type:t,default_value:this._fix_default(n,e),options:i};this.prototype._props=Object.assign(Object.assign({},this.prototype._props),{[e]:r})}}static internal(t){const e={};for(const[s,n]of(0,u.entries)((0,f.isFunction)(t)?t(w):t)){const[t,i,r={}]=n;e[s]=[t,i,Object.assign(Object.assign({},r),{internal:!0})]}this.define(e)}static mixins(t){function e(t,e){const s={};for(const[n,i]of(0,u.entries)(e))s[t+n]=i;return s}const s={},n=[];for(const i of(0,f.isArray)(t)?t:[t])if((0,f.isArray)(i)){const[t,r]=i;(0,u.extend)(s,e(t,r)),n.push([t,r])}else{const t=i;(0,u.extend)(s,t),n.push(["",t])}this.define(s),this.prototype._mixins=[...this.prototype._mixins,...n]}static override(t){for(const[e,s]of(0,u.entries)(t)){const t=this._fix_default(s,e);if(!(e in this.prototype._props))throw new Error(`attempted to override nonexistent '${this.prototype.type}.${e}'`);const n=this.prototype._props[e],i=Object.assign({},this.prototype._props);i[e]=Object.assign(Object.assign({},n),{default_value:t}),this.prototype._props=i}}static toString(){return this.__qualified__}toString(){return`${this.type}(${this.id})`}property(t){if(t in this.properties)return this.properties[t];throw new Error(`unknown property ${this.type}.${t}`)}get attributes(){const t={};for(const e of this)e.is_unset||(t[e.attr]=e.get_value());return t}[v.clone](t){const e=new Map;for(const s of this)s.dirty&&e.set(s.attr,t.clone(s.get_value()));return new this.constructor(e)}[y.equals](t,e){for(const s of this){const n=t.property(s.attr);if(!e.eq(s.get_value(),n.get_value()))return!1}return!0}[m.pretty](t){const e=t.token,s=[];for(const n of this)if(n.dirty){const i=n.get_value();s.push(`${n.attr}${e(":")} ${t.to_string(i)}`)}return`${this.constructor.__qualified__}${e("(")}${e("{")}${s.join(`${e(",")} `)}${e("}")}${e(")")}`}[d.serialize](t){const e=this.ref();t.add_ref(this,e);const s={};for(const e of this)if(e.syncable&&(t.include_defaults||e.dirty)){const n=e.get_value();s[e.attr]=t.encode(n)}const{type:n,id:i}=this,r={type:"object",name:n,id:i};return(0,u.is_empty)(s)?r:Object.assign(Object.assign({},r),{attributes:s})}constructor(t={}){super(),this.document=null,this.destroyed=new c.Signal0(this,"destroyed"),this.change=new c.Signal0(this,"change"),this.transformchange=new c.Signal0(this,"transformchange"),this.exprchange=new c.Signal0(this,"exprchange"),this.streaming=new c.Signal0(this,"streaming"),this.patching=new c.Signal(this,"patching"),this.properties={},this._watchers=new WeakMap,this._pending=!1,this._changing=!1;const e=(0,f.isPlainObject)(t)&&"id"in t;this.id=e?t.id:(0,l.unique_id)();for(const[t,{type:e,default_value:s,options:n}]of(0,u.entries)(this._props)){let i;e instanceof a.PropertyAlias?Object.defineProperty(this.properties,t,{get:()=>this.properties[e.attr],configurable:!1,enumerable:!1}):(i=e instanceof h.Kind?new a.PrimitiveProperty(this,t,e,s,n):new e(this,t,h.Any,s,n),this.properties[t]=i)}if(e)(0,_.assert)(1==(0,u.keys)(t).length,"'id' cannot be used together with property initializers");else{const e=t instanceof Map?t:new u.Dict(t);this.initialize_props(e),this.finalize(),this.connect_signals()}}initialize_props(t){const e=new Set;for(const s of this){const n=t.get(s.attr);s.initialize(n),e.add(s.attr)}for(const s of t.keys())e.has(s)||this.property(s)}finalize(){this.initialize()}initialize(){}assert_initialized(){for(const t of this)t.syncable&&!t.readonly&&t.get_value()}connect_signals(){for(const t of this){if(!(t instanceof a.VectorSpec||t instanceof a.ScalarSpec))continue;if(t.is_unset)continue;const e=t.get_value();null!=e.transform&&this.connect(e.transform.change,(()=>this.transformchange.emit())),(0,b.isExpr)(e)&&this.connect(e.expr.change,(()=>this.exprchange.emit()))}}disconnect_signals(){c.Signal.disconnect_receiver(this)}destroy(){this.disconnect_signals(),this.destroyed.emit()}clone(){return(new v.Cloner).clone(this)}_clear_watchers(){this._watchers=new WeakMap}changed_for(t){const e=this._watchers.get(t);return this._watchers.set(t,!1),null==e||e}_setv(t,e){var s;const n=e.check_eq,i=new Set,r=this._changing;this._changing=!0;for(const[e,s]of t)!1!==n&&!e.is_unset&&(0,p.is_equal)(e.get_value(),s)||(e.set_value(s),i.add(e));i.size>0&&(this._clear_watchers(),this._pending=!0);for(const t of i)t.change.emit();if(!r){if(null===(s=e.no_change)||void 0===s||!s)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}return i}setv(t,e={}){var s,n;const i=(0,u.entries)(t);if(0==i.length)return;if(null!==(s=e.silent)&&void 0!==s&&s){this._clear_watchers();for(const[t,e]of i)this.properties[t].set_value(e);return}const r=new Map,o=new Map;for(const[t,e]of i){const s=this.properties[t];r.set(s,e),o.set(s,s.is_unset?void 0:s.get_value())}const c=this._setv(r,e),{document:a}=this;if(null!=a){const t=[];for(const[e,s]of o)c.has(e)&&t.push([e,s,e.get_value()]);for(const[,e,s]of t)if(this._needs_invalidate(e,s)){a._invalidate_all_models();break}(null===(n=e.sync)||void 0===n||n)&&this._push_changes(t)}}ref(){return{id:this.id}}*[Symbol.iterator](){yield*(0,u.values)(this.properties)}*syncable_properties(){for(const t of this)t.syncable&&(yield t)}static _value_record_references(t,e,s){const{recursive:n}=s;if((0,f.isObject)(t))if(t instanceof j){if(!e.has(t)&&(e.add(t),n))for(const s of t.syncable_properties())if(!s.is_unset){const t=s.get_value();j._value_record_references(t,e,{recursive:n})}}else if((0,f.isIterable)(t))for(const s of t)j._value_record_references(s,e,{recursive:n});else if((0,f.isPlainObject)(t))for(const s of(0,u.values)(t))j._value_record_references(s,e,{recursive:n})}references(){const t=new Set;return j._value_record_references(this,t,{recursive:!0}),t}_doc_attached(){}_doc_detached(){}attach_document(t){if(null!=this.document){if(this.document==t)return;throw new Error("models must be owned by only a single document")}this.document=t,this._doc_attached()}detach_document(){this._doc_detached(),this.document=null}_needs_invalidate(t,e){const s=new Set;j._value_record_references(e,s,{recursive:!1});const n=new Set;j._value_record_references(t,n,{recursive:!1});for(const t of s)if(!n.has(t))return!0;for(const t of n)if(!s.has(t))return!0;return!1}_push_changes(t){if(!this.is_syncable)return;const{document:e}=this;if(null==e)return;const s=[];for(const[n,,i]of t)n.syncable&&s.push(new g.ModelChangedEvent(e,this,n.attr,i));if(0!=s.length){let t;1==s.length?[t]=s:t=new g.DocumentEventBatch(e,s),e._trigger_on_change(t)}}on_change(t,e){for(const s of(0,f.isArray)(t)?t:[t])this.connect(s.change,e)}stream_to(t,e,s,{sync:n}={}){const i=t.get_value();if((0,S.stream_to_columns)(i,e,s),this._clear_watchers(),t.set_value(i),this.streaming.emit(),null!=this.document&&(null==n||n)){const n=new g.ColumnsStreamedEvent(this.document,this,t.attr,e,s);this.document._trigger_on_change(n)}}patch_to(t,e,{sync:s}={}){const n=t.get_value(),i=(0,S.patch_to_columns)(n,e);if(this._clear_watchers(),t.set_value(n),this.patching.emit([...i]),null!=this.document&&(null==s||s)){const s=new g.ColumnsPatchedEvent(this.document,this,t.attr,e);this.document._trigger_on_change(s)}}}s.HasProps=j,(r=j).prototype._props={},r.prototype._mixins=[]},
function _(n,e,t,s,l){s();const r=n(16),i=n(10);class o{constructor(n,e){this.sender=n,this.name=e}connect(n,e=null){t.receivers_for_sender.has(this.sender)||t.receivers_for_sender.set(this.sender,[]);const s=t.receivers_for_sender.get(this.sender);if(null!=f(s,this,n,e))return!1;const l=null!=e?e:n;u.has(l)||u.set(l,[]);const r=u.get(l),i={signal:this,slot:n,context:e};return s.push(i),r.push(i),!0}disconnect(n,e=null){const s=t.receivers_for_sender.get(this.sender);if(null==s||0===s.length)return!1;const l=f(s,this,n,e);if(null==l)return!1;const r=null!=e?e:n,i=u.get(r);return l.signal=null,g(s),g(i),!0}emit(n){var e;const s=null!==(e=t.receivers_for_sender.get(this.sender))&&void 0!==e?e:[];for(const{signal:e,slot:t,context:l}of s)e===this&&t.call(l,n,this.sender)}}t.Signal=o,o.__name__="Signal";class c extends o{emit(){super.emit(void 0)}}t.Signal0=c,c.__name__="Signal0",function(n){n.disconnect_between=function(n,e){const s=t.receivers_for_sender.get(n);if(null==s||0===s.length)return;const l=u.get(e);if(null!=l&&0!==l.length){for(const e of l){if(null==e.signal)return;e.signal.sender===n&&(e.signal=null)}g(s),g(l)}},n.disconnect_sender=function(n){var e;const s=t.receivers_for_sender.get(n);if(null!=s&&0!==s.length){for(const n of s){if(null==n.signal)return;const t=null!==(e=n.context)&&void 0!==e?e:n.slot;n.signal=null,g(u.get(t))}g(s)}},n.disconnect_receiver=function(n,e,s){const l=u.get(n);if(null!=l&&0!==l.length){for(const n of l){if(null==n.signal)return;if(null!=e&&n.slot!=e)continue;const l=n.signal.sender;null!=s&&s.has(l)||(n.signal=null,g(t.receivers_for_sender.get(l)))}g(l)}},n.disconnect_all=function(n){const e=t.receivers_for_sender.get(n);if(null!=e&&0!==e.length){for(const n of e)n.signal=null;g(e)}const s=u.get(n);if(null!=s&&0!==s.length){for(const n of s)n.signal=null;g(s)}}}(o||(t.Signal=o={})),t.Signalable=function(){return class{connect(n,e){return n.connect(e,this)}disconnect(n,e){return n.disconnect(e,this)}}},t.receivers_for_sender=new WeakMap;const u=new WeakMap;function f(n,e,t,s){return(0,i.find)(n,(n=>n.signal===e&&n.slot===t&&n.context===s))}const a=new Set;function g(n){0===a.size&&(async()=>{await(0,r.defer)(),function(){for(const n of a)(0,i.remove_by)(n,(n=>null==n.signal));a.clear()}()})(),a.add(n)}},
function _(e,n,t,r,o){r();const s=new MessageChannel,i=new Map;s.port1.onmessage=e=>{const n=e.data,t=i.get(n);if(null!=t)try{t()}finally{i.delete(n)}};let a=1;t.defer=function(){return new Promise((e=>{const n=a++;i.set(n,e),s.port2.postMessage(n)}))},t.delay=function(e){return new Promise((n=>setTimeout(n,e)))},t.paint=function(){return new Promise((e=>{requestAnimationFrame((()=>e()))}))},t.idle=function(){return new Promise((e=>{requestIdleCallback((()=>e()))}))}},
-function _(e,t,r,n,a){n(),r.TextBaselineSpec=r.TextAlignSpec=r.FontStyleSpec=r.FontSizeSpec=r.FontSpec=r.LineDashSpec=r.LineCapSpec=r.LineJoinSpec=r.MarkerSpec=r.ArraySpec=r.NullStringSpec=r.StringSpec=r.AnySpec=void 0;const s=e(1),i=e(15),l=e(18),_=s.__importStar(e(19)),o=e(23),c=e(10),u=e(13),d=e(11),S=e(21),p=e(26),h=e(8),m=e(27),v=e(28),f=e(29),y=e(36),x=e(12),g=e(30),A=e(37);function w(e){try{return JSON.stringify(e)}catch(t){return e.toString()}}function z(e){return(0,h.isPlainObject)(e)&&(void 0===e.value?0:1)+(void 0===e.field?0:1)+(void 0===e.expr?0:1)==1}a("Uniform",A.Uniform),a("UniformScalar",A.UniformScalar),a("UniformVector",A.UniformVector),r.isSpec=z;let b=null;r.use_theme=function(e=null){b=e},r.unset=Symbol("unset");class C extends Error{}r.UnsetValueError=C,C.__name__="UnsetValueError";class F{get syncable(){return!this.internal}get is_unset(){return this._value===r.unset}get initialized(){return this._initialized}initialize(e=r.unset){if(this._initialized)throw new Error("already initialized");let t=r.unset;if(e!==r.unset)t=e,this._dirty=!0;else{const e=this._default_override();if(e!==r.unset)t=e;else{let e=!1;if(null!=b){const r=b.get(this.obj,this.attr);void 0!==r&&(t=r,e=!0)}e||(t=this.default_value(this.obj))}}t!==r.unset?this._update(t):this._value=r.unset,this._initialized=!0}get_value(){if(this._value!==r.unset)return this._value;throw new C(`${this.obj}.${this.attr} is unset`)}set_value(e){this._initialized?(this._update(e),this._dirty=!0):this.initialize(e),y.diagnostics.report(this)}_default_override(){return r.unset}get dirty(){return this._dirty}constructor(e,t,n,a,s={}){var l,_;this._value=r.unset,this._initialized=!1,this._dirty=!1,this.obj=e,this.attr=t,this.kind=n,this.default_value=a,this.change=new i.Signal0(this.obj,"change"),this.internal=null!==(l=s.internal)&&void 0!==l&&l,this.readonly=null!==(_=s.readonly)&&void 0!==_&&_,this.convert=s.convert,this.on_update=s.on_update}_update(e){var t;if(this.validate(e),null!=this.convert){const t=this.convert(e);void 0!==t&&(e=t)}this._value=e,null===(t=this.on_update)||void 0===t||t.call(this,e,this.obj)}toString(){return`Prop(${this.obj}.${this.attr}, value: ${w(this._value)})`}normalize(e){return e}validate(e){if(!this.valid(e))throw new Error(`${this.obj}.${this.attr} given invalid value: ${w(e)}`)}valid(e){return this.kind.valid(e)}}r.Property=F,F.__name__="Property";class q{constructor(e){this.attr=e}}r.PropertyAlias=q,q.__name__="PropertyAlias",r.Alias=function(e){return new q(e)};class N extends F{}r.PrimitiveProperty=N,N.__name__="PrimitiveProperty";class U extends N{_default_override(){return v.settings.dev?"Bokeh":r.unset}}r.Font=U,U.__name__="Font";class $ extends F{constructor(){super(...arguments),this._value=r.unset}get_value(){if(this._value!==r.unset)return this._value;throw new Error(`${this.obj}.${this.attr} is unset`)}_update(e){if(z(e)?this._value=e:this._value={value:e},(0,h.isPlainObject)(this._value)){const{_value:e}=this;this._value[g.serialize]=t=>{const{value:r,field:n,expr:a,transform:s,units:i}=e;return t.encode_struct(void 0!==r?{type:"value",value:r,transform:s,units:i}:void 0!==n?{type:"field",field:n,transform:s,units:i}:{type:"expr",expr:a,transform:s,units:i})}}(0,m.isValue)(this._value)&&this.validate(this._value.value)}materialize(e){return e}scalar(e,t){return new A.UniformScalar(e,t)}uniform(e){var t;const r=this.get_value(),n=null!==(t=e.get_length())&&void 0!==t?t:1;if((0,m.isExpr)(r)){const{expr:t,transform:a}=r;let s=t.compute(e);return null!=a&&(s=a.compute(s)),s=this.materialize(s),this.scalar(s,n)}{const{value:e,transform:t}=r;let a=e;return null!=t&&(a=t.compute(a)),a=this.materialize(a),this.scalar(a,n)}}}r.ScalarSpec=$,$.__name__="ScalarSpec";class j extends ${}r.AnyScalar=j,j.__name__="AnyScalar";class B extends ${}r.ColorScalar=B,B.__name__="ColorScalar";class L extends ${}r.NumberScalar=L,L.__name__="NumberScalar";class D extends ${}r.StringScalar=D,D.__name__="StringScalar";class E extends ${}r.NullStringScalar=E,E.__name__="NullStringScalar";class P extends ${}r.ArrayScalar=P,P.__name__="ArrayScalar";class T extends ${}r.LineJoinScalar=T,T.__name__="LineJoinScalar";class V extends ${}r.LineCapScalar=V,V.__name__="LineCapScalar";class k extends ${}r.LineDashScalar=k,k.__name__="LineDashScalar";class J extends ${_default_override(){return v.settings.dev?"Bokeh":r.unset}}r.FontScalar=J,J.__name__="FontScalar";class X extends ${}r.FontSizeScalar=X,X.__name__="FontSizeScalar";class Y extends ${}r.FontStyleScalar=Y,Y.__name__="FontStyleScalar";class G extends ${}r.TextAlignScalar=G,G.__name__="TextAlignScalar";class I extends ${}r.TextBaselineScalar=I,I.__name__="TextBaselineScalar";class O extends F{constructor(){super(...arguments),this._value=r.unset}get_value(){if(this._value!==r.unset)return this._value;throw new Error(`${this.obj}.${this.attr} is unset`)}_update(e){if(z(e)?this._value=e:this._value={value:e},(0,h.isPlainObject)(this._value)){const{_value:e}=this;this._value[g.serialize]=t=>{const{value:r,field:n,expr:a,transform:s,units:i}=e;return t.encode_struct(void 0!==r?{type:"value",value:r,transform:s,units:i}:void 0!==n?{type:"field",field:n,transform:s,units:i}:{type:"expr",expr:a,transform:s,units:i})}}(0,m.isValue)(this._value)&&this.validate(this._value.value)}materialize(e){return e}v_materialize(e){return e}scalar(e,t){return new A.UniformScalar(e,t)}vector(e){return new A.UniformVector(e)}uniform(e){var t;const r=this.get_value(),n=null!==(t=e.get_length())&&void 0!==t?t:1;if((0,m.isField)(r)){const{field:t,transform:a}=r;let s=e.get_column(t);return null!=s?(null!=a&&(s=a.v_compute(s)),s=this.v_materialize(s),this.vector(s)):(l.logger.warn(`attempted to retrieve property array for nonexistent field '${t}'`),this.scalar(null,n))}if((0,m.isExpr)(r)){const{expr:t,transform:n}=r;let a=t.v_compute(e);return null!=n&&(a=n.v_compute(a)),a=this.v_materialize(a),this.vector(a)}if((0,m.isValue)(r)){const{value:e,transform:t}=r;let a=e;return null!=t&&(a=t.compute(a)),a=this.materialize(a),this.scalar(a,n)}(0,x.unreachable)()}array(e){var t;let r;const n=null!==(t=e.get_length())&&void 0!==t?t:1,a=this.get_value();if((0,m.isField)(a)){const{field:t}=a,s=e.get_column(t);if(null!=s)r=this.normalize(s);else{l.logger.warn(`attempted to retrieve property array for nonexistent field '${t}'`);const e=new Float64Array(n);e.fill(NaN),r=e}}else if((0,m.isExpr)(a)){const{expr:t}=a;r=this.normalize(t.v_compute(e))}else{const e=this.normalize([a.value])[0];if((0,h.isNumber)(e)){const t=new Float64Array(n);t.fill(e),r=t}else r=(0,c.repeat)(e,n)}const{transform:s}=a;return null!=s&&(r=s.v_compute(r)),r}}r.VectorSpec=O,O.__name__="VectorSpec";class R extends O{}r.DataSpec=R,R.__name__="DataSpec";class M extends O{constructor(){super(...arguments),this._value=r.unset}_update(e){if(super._update(e),this._value!==r.unset){const{units:e}=this._value;if(null!=e&&!(0,c.includes)(this.valid_units,e))throw new Error(`units must be one of ${this.valid_units.join(", ")}; got: ${e}`)}}get units(){var e;return this._value!==r.unset&&null!==(e=this._value.units)&&void 0!==e?e:this.default_units}set units(e){if(this._value===r.unset)throw new Error(`${this.obj}.${this.attr} is unset`);e!=this.default_units?this._value.units=e:delete this._value.units}}r.UnitsSpec=M,M.__name__="UnitsSpec";class H extends M{array(e){return new Float64Array(super.array(e))}}r.NumberUnitsSpec=H,H.__name__="NumberUnitsSpec";class K extends R{}r.BaseCoordinateSpec=K,K.__name__="BaseCoordinateSpec";class Q extends K{}r.CoordinateSpec=Q,Q.__name__="CoordinateSpec";class W extends K{}r.CoordinateSeqSpec=W,W.__name__="CoordinateSeqSpec";class Z extends K{}r.CoordinateSeqSeqSeqSpec=Z,Z.__name__="CoordinateSeqSeqSeqSpec";class ee extends Q{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSpec=ee,ee.__name__="XCoordinateSpec";class te extends Q{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSpec=te,te.__name__="YCoordinateSpec";class re extends W{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSeqSpec=re,re.__name__="XCoordinateSeqSpec";class ne extends W{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSeqSpec=ne,ne.__name__="YCoordinateSeqSpec";class ae extends Z{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSeqSeqSeqSpec=ae,ae.__name__="XCoordinateSeqSeqSeqSpec";class se extends Z{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSeqSeqSeqSpec=se,se.__name__="YCoordinateSeqSeqSeqSpec";class ie extends H{get default_units(){return"rad"}get valid_units(){return[..._.AngleUnits]}materialize(e){return e*-(0,d.to_radians_coeff)(this.units)}v_materialize(e){const t=-(0,d.to_radians_coeff)(this.units),r=new Float32Array(e.length);return(0,u.mul)(e,t,r),r}array(e){throw new Error("not supported")}}r.AngleSpec=ie,ie.__name__="AngleSpec";class le extends H{get default_units(){return"data"}get valid_units(){return[..._.SpatialUnits]}}r.DistanceSpec=le,le.__name__="DistanceSpec";class _e extends le{materialize(e){return null!=e?e:NaN}}r.NullDistanceSpec=_e,_e.__name__="NullDistanceSpec";class oe extends R{v_materialize(e){return new Uint8Array(e)}array(e){return new Uint8Array(super.array(e))}}r.BooleanSpec=oe,oe.__name__="BooleanSpec";class ce extends R{v_materialize(e){return(0,h.isTypedArray)(e)?e:new Int32Array(e)}array(e){return new Int32Array(super.array(e))}}r.IntSpec=ce,ce.__name__="IntSpec";class ue extends R{v_materialize(e){return(0,h.isTypedArray)(e)?e:new Float64Array(e)}array(e){return new Float64Array(super.array(e))}}r.NumberSpec=ue,ue.__name__="NumberSpec";class de extends ue{valid(e){return(0,h.isNumber)(e)&&e>=0}}r.ScreenSizeSpec=de,de.__name__="ScreenSizeSpec";class Se extends R{materialize(e){return(0,S.encode_rgba)((0,S.color2rgba)(e))}v_materialize(e){if(!(0,f.is_NDArray)(e))return this._from_css_array(e);if("uint32"==e.dtype&&1==e.dimension)return(0,p.to_big_endian)(e);if("uint8"==e.dtype&&1==e.dimension){const[t]=e.shape,r=new o.RGBAArray(4*t);let n=0;for(const t of e)r[n++]=t,r[n++]=t,r[n++]=t,r[n++]=255;return new o.ColorArray(r.buffer)}if("uint8"==e.dtype&&2==e.dimension){const[t,r]=e.shape;if(4==r)return new o.ColorArray(e.buffer);if(3==r){const n=new o.RGBAArray(4*t);for(let a=0,s=0;a{const{value:r,field:n,expr:a,transform:s,units:i}=e;return t.encode_struct(void 0!==r?{type:"value",value:r,transform:s,units:i}:void 0!==n?{type:"field",field:n,transform:s,units:i}:{type:"expr",expr:a,transform:s,units:i})}}(0,m.isValue)(this._value)&&this.validate(this._value.value)}materialize(e){return e}scalar(e,t){return new A.UniformScalar(e,t)}uniform(e){var t;const r=this.get_value(),n=null!==(t=e.get_length())&&void 0!==t?t:1;if((0,m.isExpr)(r)){const{expr:t,transform:a}=r;let s=t.compute(e);return null!=a&&(s=a.compute(s)),s=this.materialize(s),this.scalar(s,n)}{const{value:e,transform:t}=r;let a=e;return null!=t&&(a=t.compute(a)),a=this.materialize(a),this.scalar(a,n)}}}r.ScalarSpec=$,$.__name__="ScalarSpec";class j extends ${}r.AnyScalar=j,j.__name__="AnyScalar";class B extends ${}r.ColorScalar=B,B.__name__="ColorScalar";class L extends ${}r.NumberScalar=L,L.__name__="NumberScalar";class D extends ${}r.StringScalar=D,D.__name__="StringScalar";class E extends ${}r.NullStringScalar=E,E.__name__="NullStringScalar";class P extends ${}r.ArrayScalar=P,P.__name__="ArrayScalar";class T extends ${}r.LineJoinScalar=T,T.__name__="LineJoinScalar";class V extends ${}r.LineCapScalar=V,V.__name__="LineCapScalar";class k extends ${}r.LineDashScalar=k,k.__name__="LineDashScalar";class J extends ${_default_override(){return v.settings.dev?"Bokeh":r.unset}}r.FontScalar=J,J.__name__="FontScalar";class X extends ${}r.FontSizeScalar=X,X.__name__="FontSizeScalar";class Y extends ${}r.FontStyleScalar=Y,Y.__name__="FontStyleScalar";class G extends ${}r.TextAlignScalar=G,G.__name__="TextAlignScalar";class I extends ${}r.TextBaselineScalar=I,I.__name__="TextBaselineScalar";class O extends F{constructor(){super(...arguments),this._value=r.unset}get_value(){if(this._value!==r.unset)return this._value;throw new Error(`${this.obj}.${this.attr} is unset`)}_update(e){if(z(e)?this._value=e:this._value={value:e},(0,h.isPlainObject)(this._value)){const{_value:e}=this;this._value[g.serialize]=t=>{const{value:r,field:n,expr:a,transform:s,units:i}=e;return t.encode_struct(void 0!==r?{type:"value",value:r,transform:s,units:i}:void 0!==n?{type:"field",field:n,transform:s,units:i}:{type:"expr",expr:a,transform:s,units:i})}}(0,m.isValue)(this._value)&&this.validate(this._value.value)}materialize(e){return e}v_materialize(e){return e}scalar(e,t){return new A.UniformScalar(e,t)}vector(e){return new A.UniformVector(e)}uniform(e){var t;const r=this.get_value(),n=null!==(t=e.get_length())&&void 0!==t?t:1;if((0,m.isField)(r)){const{field:t,transform:a}=r;let s=e.get_column(t);return null!=s?(null!=a&&(s=a.v_compute(s)),s=this.v_materialize(s),this.vector(s)):(l.logger.warn(`attempted to retrieve property array for nonexistent field '${t}'`),this.scalar(null,n))}if((0,m.isExpr)(r)){const{expr:t,transform:n}=r;let a=t.v_compute(e);return null!=n&&(a=n.v_compute(a)),a=this.v_materialize(a),this.vector(a)}if((0,m.isValue)(r)){const{value:e,transform:t}=r;let a=e;return null!=t&&(a=t.compute(a)),a=this.materialize(a),this.scalar(a,n)}(0,x.unreachable)()}array(e){var t;let r;const n=null!==(t=e.get_length())&&void 0!==t?t:1,a=this.get_value();if((0,m.isField)(a)){const{field:t}=a,s=e.get_column(t);if(null!=s)r=this.normalize(s);else{l.logger.warn(`attempted to retrieve property array for nonexistent field '${t}'`);const e=new Float64Array(n);e.fill(NaN),r=e}}else if((0,m.isExpr)(a)){const{expr:t}=a;r=this.normalize(t.v_compute(e))}else{const e=this.normalize([a.value])[0];if((0,h.isNumber)(e)){const t=new Float64Array(n);t.fill(e),r=t}else r=(0,c.repeat)(e,n)}const{transform:s}=a;return null!=s&&(r=s.v_compute(r)),r}}r.VectorSpec=O,O.__name__="VectorSpec";class R extends O{}r.DataSpec=R,R.__name__="DataSpec";class M extends O{constructor(){super(...arguments),this._value=r.unset}_update(e){if(super._update(e),this._value!==r.unset){const{units:e}=this._value;if(null!=e&&!(0,c.includes)(this.valid_units,e))throw new Error(`units must be one of ${this.valid_units.join(", ")}; got: ${e}`)}}get units(){var e;return this._value!==r.unset&&null!==(e=this._value.units)&&void 0!==e?e:this.default_units}set units(e){if(this._value===r.unset)throw new Error(`${this.obj}.${this.attr} is unset`);e!=this.default_units?this._value.units=e:delete this._value.units}}r.UnitsSpec=M,M.__name__="UnitsSpec";class H extends M{array(e){return new Float64Array(super.array(e))}}r.NumberUnitsSpec=H,H.__name__="NumberUnitsSpec";class K extends R{}r.BaseCoordinateSpec=K,K.__name__="BaseCoordinateSpec";class Q extends K{}r.CoordinateSpec=Q,Q.__name__="CoordinateSpec";class W extends K{}r.CoordinateSeqSpec=W,W.__name__="CoordinateSeqSpec";class Z extends K{}r.CoordinateSeqSeqSeqSpec=Z,Z.__name__="CoordinateSeqSeqSeqSpec";class ee extends Q{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSpec=ee,ee.__name__="XCoordinateSpec";class te extends Q{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSpec=te,te.__name__="YCoordinateSpec";class re extends W{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSeqSpec=re,re.__name__="XCoordinateSeqSpec";class ne extends W{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSeqSpec=ne,ne.__name__="YCoordinateSeqSpec";class ae extends Z{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSeqSeqSeqSpec=ae,ae.__name__="XCoordinateSeqSeqSeqSpec";class se extends Z{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSeqSeqSeqSpec=se,se.__name__="YCoordinateSeqSeqSeqSpec";class ie extends H{get default_units(){return"rad"}get valid_units(){return[..._.AngleUnits]}materialize(e){return e*-(0,d.to_radians_coeff)(this.units)}v_materialize(e){const t=-(0,d.to_radians_coeff)(this.units),r=new Float32Array(e.length);return(0,u.mul)(e,t,r),r}array(e){throw new Error("not supported")}}r.AngleSpec=ie,ie.__name__="AngleSpec";class le extends H{get default_units(){return"data"}get valid_units(){return[..._.SpatialUnits]}}r.DistanceSpec=le,le.__name__="DistanceSpec";class _e extends le{materialize(e){return null!=e?e:NaN}}r.NullDistanceSpec=_e,_e.__name__="NullDistanceSpec";class oe extends R{v_materialize(e){return new Uint8Array(e)}array(e){return new Uint8Array(super.array(e))}}r.BooleanSpec=oe,oe.__name__="BooleanSpec";class ce extends R{v_materialize(e){return(0,h.isTypedArray)(e)?e:new Int32Array(e)}array(e){return new Int32Array(super.array(e))}}r.IntSpec=ce,ce.__name__="IntSpec";class ue extends R{v_materialize(e){return(0,h.isTypedArray)(e)?e:new Float64Array(e)}array(e){return new Float64Array(super.array(e))}}r.NumberSpec=ue,ue.__name__="NumberSpec";class de extends ue{valid(e){return(0,h.isNumber)(e)&&e>=0}}r.ScreenSizeSpec=de,de.__name__="ScreenSizeSpec";class Se extends R{materialize(e){return(0,S.encode_rgba)((0,S.color2rgba)(e))}v_materialize(e){if(!(0,f.is_NDArray)(e))return this._from_css_array(e);if("uint32"==e.dtype&&1==e.dimension)return(0,p.to_big_endian)(e);if("uint8"==e.dtype&&1==e.dimension){const[t]=e.shape,r=new o.RGBAArray(4*t);let n=0;for(const t of e)r[n++]=t,r[n++]=t,r[n++]=t,r[n++]=255;return new o.ColorArray(r.buffer)}if("uint8"==e.dtype&&2==e.dimension){const[t,r]=e.shape;if(4==r)return new o.ColorArray(e.buffer);if(3==r){const n=new o.RGBAArray(4*t);for(let a=0,s=0;a0)return e in r?r[e]:r[e]=new v(e,l);throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")}constructor(e,l=v.INFO){this._name=e,this.set_level(l)}get level(){return this.get_level()}get_level(){return this._log_level}set_level(e){if(e instanceof i)this._log_level=e;else{if(!(0,s.isString)(e)||!(e in v.log_levels))throw new Error("Logger.set_level() expects a log-level object or a string name of a log-level");this._log_level=v.log_levels[e]}const l=`[${this._name}]`;for(const[e,o]of(0,g.entries)(v.log_levels))o.level","*"),n.HTTPMethod=(0,a.Enum)("POST","GET"),n.HexTileOrientation=(0,a.Enum)("pointytop","flattop"),n.HoverMode=(0,a.Enum)("mouse","hline","vline"),n.ImageOrigin=(0,a.Enum)("bottom_left","top_left","bottom_right","top_right"),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.LineDash=(0,a.Enum)("solid","dashed","dotted","dotdash","dashdot"),n.LineJoin=(0,a.Enum)("miter","round","bevel"),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.MapType=(0,a.Enum)("satellite","roadmap","terrain","hybrid"),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.ResetPolicy=(0,a.Enum)("standard","event_only"),n.RoundingFunction=(0,a.Enum)("round","nearest","floor","rounddown","ceil","roundup"),n.ScrollbarPolicy=(0,a.Enum)("auto","visible","hidden"),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","inherit"),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.TapGesture=(0,a.Enum)("tap","doubletap"),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.LabelOrientation=(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"),n.ToolIcon=(0,a.Enum)("append_mode","box_edit","box_select","box_zoom","clear_selection","copy","crosshair","freehand_draw","help","hover","intersect_mode","lasso_select","line_edit","pan","point_draw","poly_draw","poly_edit","polygon_select","range","redo","replace_mode","reset","save","subtract_mode","tap_select","undo","wheel_pan","wheel_zoom","xpan","ypan","zoom_in","zoom_out")},
function _(t,e,n,r,s){r();const i=t(1).__importStar(t(8)),a=t(21),o=t(9),u=globalThis.Map,_=globalThis.Set,{hasOwnProperty:l}=Object.prototype;class c{}n.Kind=c,c.__name__="Kind",function(t){class e extends c{valid(t){return void 0!==t}toString(){return"Any"}}e.__name__="Any",t.Any=e;class n extends c{valid(t){return void 0!==t}toString(){return"Unknown"}}n.__name__="Unknown",t.Unknown=n;class r extends c{valid(t){return i.isBoolean(t)}toString(){return"Boolean"}}r.__name__="Boolean",t.Boolean=r;class s extends c{constructor(t){super(),this.obj_type=t}valid(t){return t instanceof this.obj_type}toString(){var t;const e=this.obj_type;return`Ref(${null!==(t=e.__name__)&&void 0!==t?t:e.toString()})`}}s.__name__="Ref",t.Ref=s;class d extends c{valid(t){return i.isObject(t)}toString(){return"AnyRef"}}d.__name__="AnyRef",t.AnyRef=d;class p extends c{valid(t){return i.isNumber(t)}toString(){return"Number"}}p.__name__="Number",t.Number=p;class y extends p{valid(t){return super.valid(t)&&i.isInteger(t)}toString(){return"Int"}}y.__name__="Int",t.Int=y;class S extends p{valid(t){return super.valid(t)&&0<=t&&t<=1}toString(){return"Percent"}}S.__name__="Percent",t.Percent=S;class g extends c{constructor(t){super(),this.types=t,this.types=t}valid(t){return this.types.some((e=>e.valid(t)))}toString(){return`Or(${this.types.map((t=>t.toString())).join(", ")})`}}g.__name__="Or",t.Or=g;class m extends c{constructor(t){super(),this.types=t,this.types=t}valid(t){if(!i.isArray(t))return!1;for(let e=0;et.toString())).join(", ")})`}}m.__name__="Tuple",t.Tuple=m;class h extends c{constructor(t){super(),this.struct_type=t}valid(t){if(!i.isPlainObject(t))return!1;const{struct_type:e}=this;for(const n of(0,o.keys)(t))if(!l.call(e,n))return!1;for(const n in e)if(l.call(e,n)){const r=e[n],s=t[n];if(!r.valid(s))return!1}return!0}toString(){return`Struct({${(0,o.entries)(this.struct_type).map((([t,e])=>`${t}: ${e}`)).join(", ")}})`}}h.__name__="Struct",t.Struct=h;class v extends c{constructor(t){super(),this.struct_type=t}valid(t){if(!i.isPlainObject(t))return!1;const{struct_type:e}=this;for(const n of(0,o.keys)(t))if(!l.call(e,n))return!1;for(const n in e)if(l.call(t,n)&&l.call(e,n)){const r=e[n],s=t[n];if(!r.valid(s))return!1}return!0}toString(){return`Struct({${(0,o.entries)(this.struct_type).map((([t,e])=>`${t}?: ${e}`)).join(", ")}})`}}v.__name__="PartialStruct",t.PartialStruct=v;class f extends c{constructor(t){super(),this.item_type=t}valid(t){return i.isArray(t)||i.isTypedArray(t)}toString(){return`Arrayable(${this.item_type.toString()})`}}f.__name__="Arrayable",t.Arrayable=f;class b extends c{constructor(t){super(),this.item_type=t}valid(t){return i.isArray(t)&&t.every((t=>this.item_type.valid(t)))}toString(){return`Array(${this.item_type.toString()})`}}b.__name__="Array",t.Array=b;class x extends c{valid(t){return null===t}toString(){return"Null"}}x.__name__="Null",t.Null=x;class w extends c{constructor(t){super(),this.base_type=t}valid(t){return null===t||this.base_type.valid(t)}toString(){return`Nullable(${this.base_type.toString()})`}}w.__name__="Nullable",t.Nullable=w;class K extends c{constructor(t){super(),this.base_type=t}valid(t){return void 0===t||this.base_type.valid(t)}toString(){return`Opt(${this.base_type.toString()})`}}K.__name__="Opt",t.Opt=K;class N extends c{valid(t){return t instanceof ArrayBuffer}toString(){return"Bytes"}}N.__name__="Bytes",t.Bytes=N;class A extends c{valid(t){return i.isString(t)}toString(){return"String"}}A.__name__="String",t.String=A;class O extends A{constructor(t){super(),this.regex=t}valid(t){return super.valid(t)&&this.regex.test(t)}toString(){return`Regex(${this.regex.toString()})`}}O.__name__="Regex",t.Regex=O;class $ extends c{constructor(t){super(),this.values=new _(t)}valid(t){return this.values.has(t)}*[Symbol.iterator](){yield*this.values}toString(){return`Enum(${[...this.values].map((t=>t.toString())).join(", ")})`}}$.__name__="Enum",t.Enum=$;class P extends c{constructor(t){super(),this.item_type=t}valid(t){if(!i.isPlainObject(t))return!1;for(const e in t)if(l.call(t,e)){const n=t[e];if(!this.item_type.valid(n))return!1}return!0}toString(){return`Dict(${this.item_type.toString()})`}}P.__name__="Dict",t.Dict=P;class R extends c{constructor(t,e){super(),this.key_type=t,this.item_type=e}valid(t){if(!(t instanceof u))return!1;for(const[e,n]of t.entries())if(!this.key_type.valid(e)||!this.item_type.valid(n))return!1;return!0}toString(){return`Map(${this.key_type.toString()}, ${this.item_type.toString()})`}}R.__name__="Map",t.Map=R;class j extends c{constructor(t){super(),this.item_type=t}valid(t){if(!(t instanceof _))return!1;for(const e of t)if(!this.item_type.valid(e))return!1;return!0}toString(){return`Set(${this.item_type.toString()})`}}j.__name__="Set",t.Set=j;class B extends c{valid(t){return(0,a.is_Color)(t)}toString(){return"Color"}}B.__name__="Color",t.Color=B;class C extends A{toString(){return"CSSLength"}}C.__name__="CSSLength",t.CSSLength=C;class M extends c{valid(t){return i.isFunction(t)}toString(){return"Function(...)"}}M.__name__="Function",t.Function=M;class k extends c{constructor(t){super(),this.base_type=t}valid(t){return this.base_type.valid(t)&&t>=0}toString(){return`NonNegative(${this.base_type.toString()})`}}k.__name__="NonNegative",t.NonNegative=k;class D extends c{constructor(t){super(),this.base_type=t}valid(t){return this.base_type.valid(t)&&t>0}toString(){return`Positive(${this.base_type.toString()})`}}D.__name__="Positive",t.Positive=D;class F extends c{valid(t){return t instanceof Node}toString(){return"DOMNode"}}F.__name__="DOMNode",t.DOMNode=F}(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.Bytes=new n.Kinds.Bytes,n.String=new n.Kinds.String;n.Regex=t=>new n.Kinds.Regex(t),n.Null=new n.Kinds.Null;n.Nullable=t=>new n.Kinds.Nullable(t);n.Opt=t=>new n.Kinds.Opt(t);n.Or=(...t)=>new n.Kinds.Or(t);n.Tuple=(...t)=>new n.Kinds.Tuple(t);n.Struct=t=>new n.Kinds.Struct(t);n.PartialStruct=t=>new n.Kinds.PartialStruct(t);n.Arrayable=t=>new n.Kinds.Arrayable(t);n.Array=t=>new n.Kinds.Array(t);n.Dict=t=>new n.Kinds.Dict(t);n.Map=(t,e)=>new n.Kinds.Map(t,e);n.Set=t=>new n.Kinds.Set(t);n.Enum=(...t)=>new n.Kinds.Enum(t);n.Ref=t=>new n.Kinds.Ref(t);n.AnyRef=()=>new n.Kinds.AnyRef;n.Function=()=>new n.Kinds.Function,n.DOMNode=new n.Kinds.DOMNode;n.NonNegative=t=>new n.Kinds.NonNegative(t);n.Positive=t=>new n.Kinds.Positive(t),n.Percent=new n.Kinds.Percent,n.Alpha=n.Percent,n.Color=new n.Kinds.Color,n.Auto=(0,n.Enum)("auto"),n.CSSLength=new n.Kinds.CSSLength,n.FontSize=n.String,n.Font=n.String,n.Angle=n.Number},
@@ -970,40 +970,40 @@ Plots#
function _(n,t,i,e,r){e(),i.is_mobile="ontouchstart"in globalThis||"undefined"!=typeof navigator&&navigator.maxTouchPoints>0,i.is_little_endian=(()=>{const n=new ArrayBuffer(4),t=new Uint8Array(n);new Uint32Array(n)[1]=168496141;let i=!0;return 10==t[4]&&11==t[5]&&12==t[6]&&13==t[7]&&(i=!1),i})(),i.BYTE_ORDER=i.is_little_endian?"little":"big",i.to_big_endian=function(n){if(i.is_little_endian){const t=new Uint32Array(n.length),i=new DataView(t.buffer);let e=0;for(const t of n)i.setUint32(e,t),e+=4;return t}return n}},
function _(i,n,e,t,u){t();const c=i(8);e.isValue=function(i){return(0,c.isPlainObject)(i)&&"value"in i},e.isField=function(i){return(0,c.isPlainObject)(i)&&"field"in i},e.isExpr=function(i){return(0,c.isPlainObject)(i)&&"expr"in i}},
function _(e,t,r,s,_){s();class i{constructor(){this._dev=!1,this._wireframe=!1,this._force_webgl=!1}set dev(e){this._dev=e}get dev(){return this._dev}set wireframe(e){this._wireframe=e}get wireframe(){return this._wireframe}set force_webgl(e){this._force_webgl=e}get force_webgl(){return this._force_webgl}}r.Settings=i,i.__name__="Settings",r.settings=new i},
-function _(t,e,s,r,n){var a,i,h,u,l,o,p,c,y,_;r();const A=t(8),d=t(26),g=t(25),f=t(30),m=Symbol("__ndarray__");function N(t,e){return{type:"ndarray",array:e.encode("object"==t.dtype?Array.from(t):t.buffer),order:d.BYTE_ORDER,dtype:t.dtype,shape:t.shape}}class D extends Uint8Array{constructor(t,e){super(t),this[a]=!0,this.dtype="bool",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(a=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return 1==this[t]}}s.BoolNDArray=D,D.__name__="BoolNDArray";class q extends Uint8Array{constructor(t,e){super(t),this[i]=!0,this.dtype="uint8",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(i=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Uint8NDArray=q,q.__name__="Uint8NDArray";class b extends Int8Array{constructor(t,e){super(t),this[h]=!0,this.dtype="int8",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(h=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Int8NDArray=b,b.__name__="Int8NDArray";class w extends Uint16Array{constructor(t,e){super(t),this[u]=!0,this.dtype="uint16",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(u=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Uint16NDArray=w,w.__name__="Uint16NDArray";class U extends Int16Array{constructor(t,e){super(t),this[l]=!0,this.dtype="int16",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(l=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Int16NDArray=U,U.__name__="Int16NDArray";class I extends Uint32Array{constructor(t,e){super(t),this[o]=!0,this.dtype="uint32",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(o=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Uint32NDArray=I,I.__name__="Uint32NDArray";class x extends Int32Array{constructor(t,e){super(t),this[p]=!0,this.dtype="int32",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(p=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Int32NDArray=x,x.__name__="Int32NDArray";class z extends Float32Array{constructor(t,e){super(t),this[c]=!0,this.dtype="float32",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(c=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Float32NDArray=z,z.__name__="Float32NDArray";class F extends Float64Array{constructor(t,e){super(t),this[y]=!0,this.dtype="float64",this.shape=null!=e?e:B(t)?t.shape:[this.length],this.dimension=this.shape.length}[(y=m,g.equals)](t,e){return e.eq(this.shape,t.shape)&&e.arrays(this,t)}[f.serialize](t){return N(this,t)}get(t){return this[t]}}s.Float64NDArray=F,F.__name__="Float64NDArray";class j extends Array{get shape(){var t;return null!==(t=this._shape)&&void 0!==t?t:[this.length]}get dimension(){return this.shape.length}constructor(t,e){const s=t instanceof ArrayBuffer?new Float64Array(t):t;if(super((0,A.isNumber)(s)?s:s.length),this[_]=!0,this.dtype="object",!(0,A.isNumber)(s))for(let t=0;t{switch(!0){case t instanceof Uint8Array:return"uint8";case t instanceof Int8Array:return"int8";case t instanceof Uint16Array:return"uint16";case t instanceof Int16Array:return"int16";case t instanceof Uint32Array:return"uint32";case t instanceof Int32Array:return"int32";case t instanceof Float32Array:return"float32";case t instanceof ArrayBuffer:case t instanceof Float64Array:return"float64";default:return"object"}})()),e){case"bool":return new D(t,s);case"uint8":return new q(t,s);case"int8":return new b(t,s);case"uint16":return new w(t,s);case"int16":return new U(t,s);case"uint32":return new I(t,s);case"int32":return new x(t,s);case"float32":return new z(t,s);case"float64":return new F(t,s);case"object":return new j(t,s)}}},
-function _(r,e,i,a,f){a();const o=r(1);var l=r(31);f("Serializer",l.Serializer),f("SerializationError",l.SerializationError),f("serialize",l.serialize);var t=r(33);f("Buffer",t.Buffer),f("Base64Buffer",t.Base64Buffer),o.__exportStar(r(35),i)},
-function _(e,r,t,n,i){n();const s=e(12),a=e(9),o=e(8),c=e(32),l=e(26),u=e(33);t.serialize=Symbol("serialize");class f extends Error{}t.SerializationError=f,f.__name__="SerializationError";class y{constructor(e){this.value=e}to_json(){return JSON.stringify(this.value)}}y.__name__="Serialized";class d{constructor(e){var r,t;this._circular=new WeakSet,this.binary=null!==(r=null==e?void 0:e.binary)&&void 0!==r&&r,this.include_defaults=null!==(t=null==e?void 0:e.include_defaults)&&void 0!==t&&t;const n=null==e?void 0:e.references;this._references=null!=n?new Map(n):new Map}get_ref(e){return this._references.get(e)}add_ref(e,r){(0,s.assert)(!this._references.has(e)),this._references.set(e,r)}to_serializable(e){return new y(this.encode(e))}encode(e){const r=this.get_ref(e);if(null!=r)return r;if(!(0,o.isObject)(e))return this._encode(e);this._circular.has(e)&&this.error("circular reference"),this._circular.add(e);try{return this._encode(e)}finally{this._circular.delete(e)}}_encode(e){if(function(e){return(0,o.isObject)(e)&&t.serialize in e}(e))return e[t.serialize](this);if((0,o.isArray)(e)){const r=e.length,t=new Array(r);for(let n=0;n[this.encode(e),this.encode(r)]))]}}if(null===e||(0,o.isBoolean)(e)||(0,o.isString)(e))return e;if((0,o.isNumber)(e))return isNaN(e)?{type:"number",value:"nan"}:isFinite(e)?e:{type:"number",value:(e<0?"-":"+")+"inf"};if(e instanceof Date){return{type:"date",iso:e.toISOString()}}if(e instanceof Set)return 0==e.size?{type:"set"}:{type:"set",entries:[...(0,c.map)(e.values(),(e=>this.encode(e)))]};if(e instanceof Map)return 0==e.size?{type:"map"}:{type:"map",entries:[...(0,c.map)(e.entries(),(([e,r])=>[this.encode(e),this.encode(r)]))]};if((0,o.isSymbol)(e)&&null!=e.description)return{type:"symbol",name:e.description};throw new f(`${Object.prototype.toString.call(e)} is not serializable`)}encode_struct(e){const r={};for(const[t,n]of(0,a.entries)(e))void 0!==n&&(r[t]=this.encode(n));return r}error(e){throw new f(e)}_encode_typed_array(e){const r=this.encode(e.buffer),t=(()=>{switch(e.constructor){case Uint8Array:return"uint8";case Int8Array:return"int8";case Uint16Array:return"uint16";case Int16Array:return"int16";case Uint32Array:return"uint32";case Int32Array:return"int32";case Float32Array:return"float32";case Float64Array:return"float64";default:this.error(`can't serialize typed array of type '${e[Symbol.toStringTag]}'`)}})();return{type:"typed_array",array:r,order:l.BYTE_ORDER,dtype:t}}}t.Serializer=d,d.__name__="Serializer"},
+function _(e,t,s,r,n){var a,i,h,u,l,o,c,p,y,_;r();const A=e(8),d=e(26),g=e(25),f=e(30),m=e(31),w=Symbol("__ndarray__");function N(e,t){return{type:"ndarray",array:t.encode("object"==e.dtype?Array.from(e):e.buffer),order:d.BYTE_ORDER,dtype:e.dtype,shape:e.shape}}class D extends Uint8Array{constructor(e,t){super(e),this[a]=!0,this.dtype="bool",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(a=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new D(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return 1==this[e]}}s.BoolNDArray=D,D.__name__="BoolNDArray";class q extends Uint8Array{constructor(e,t){super(e),this[i]=!0,this.dtype="uint8",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(i=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new q(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Uint8NDArray=q,q.__name__="Uint8NDArray";class b extends Int8Array{constructor(e,t){super(e),this[h]=!0,this.dtype="int8",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(h=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new b(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Int8NDArray=b,b.__name__="Int8NDArray";class U extends Uint16Array{constructor(e,t){super(e),this[u]=!0,this.dtype="uint16",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(u=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new U(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Uint16NDArray=U,U.__name__="Uint16NDArray";class I extends Int16Array{constructor(e,t){super(e),this[l]=!0,this.dtype="int16",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(l=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new I(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Int16NDArray=I,I.__name__="Int16NDArray";class x extends Uint32Array{constructor(e,t){super(e),this[o]=!0,this.dtype="uint32",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(o=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new x(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Uint32NDArray=x,x.__name__="Uint32NDArray";class z extends Int32Array{constructor(e,t){super(e),this[c]=!0,this.dtype="int32",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(c=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new z(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Int32NDArray=z,z.__name__="Int32NDArray";class F extends Float32Array{constructor(e,t){super(e),this[p]=!0,this.dtype="float32",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(p=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new F(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Float32NDArray=F,F.__name__="Float32NDArray";class j extends Float64Array{constructor(e,t){super(e),this[y]=!0,this.dtype="float64",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(y=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new j(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Float64NDArray=j,j.__name__="Float64NDArray";class B extends Array{get shape(){var e;return null!==(e=this._shape)&&void 0!==e?e:[this.length]}get dimension(){return this.shape.length}constructor(e,t){const s=e instanceof ArrayBuffer?new Float64Array(e):e;if(super((0,A.isNumber)(s)?s:s.length),this[_]=!0,this.dtype="object",!(0,A.isNumber)(s))for(let e=0;e{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 ArrayBuffer:case e instanceof Float64Array:return"float64";default:return"object"}})()),t){case"bool":return new D(e,s);case"uint8":return new q(e,s);case"int8":return new b(e,s);case"uint16":return new U(e,s);case"int16":return new I(e,s);case"uint32":return new x(e,s);case"int32":return new z(e,s);case"float32":return new F(e,s);case"float64":return new j(e,s);case"object":return new B(e,s)}}},
+function _(n,e,t,o,r){o();const i=n(9),c=n(8);function l(n){return(0,c.isObject)(n)&&t.clone in n}t.clone=Symbol("clone"),t.is_Cloneable=l;class s extends Error{}t.CloningError=s,s.__name__="CloningError";class a{constructor(){}clone(n){if(l(n))return n[t.clone](this);if((0,c.isPrimitive)(n))return n;if((0,c.isArray)(n)){const e=n.length,t=new Array(e);for(let o=0;o[this.clone(n),this.clone(e)])));if(n instanceof Set)return new Set([...n].map((n=>this.clone(n))));throw new s(`${Object.prototype.toString.call(n)} is not cloneable`)}}t.Cloner=a,a.__name__="Cloner"},
+function _(r,e,i,a,f){a();const o=r(1);var l=r(32);f("Serializer",l.Serializer),f("SerializationError",l.SerializationError),f("serialize",l.serialize);var t=r(34);f("Buffer",t.Buffer),f("Base64Buffer",t.Base64Buffer),o.__exportStar(r(36),i)},
+function _(e,r,t,n,i){n();const s=e(12),a=e(9),o=e(8),c=e(33),l=e(26),u=e(34);t.serialize=Symbol("serialize");class f extends Error{}t.SerializationError=f,f.__name__="SerializationError";class y{constructor(e){this.value=e}to_json(){return JSON.stringify(this.value)}}y.__name__="Serialized";class d{constructor(e){var r,t;this._circular=new WeakSet,this.binary=null!==(r=null==e?void 0:e.binary)&&void 0!==r&&r,this.include_defaults=null!==(t=null==e?void 0:e.include_defaults)&&void 0!==t&&t;const n=null==e?void 0:e.references;this._references=null!=n?new Map(n):new Map}get_ref(e){return this._references.get(e)}add_ref(e,r){(0,s.assert)(!this._references.has(e)),this._references.set(e,r)}to_serializable(e){return new y(this.encode(e))}encode(e){const r=this.get_ref(e);if(null!=r)return r;if(!(0,o.isObject)(e))return this._encode(e);this._circular.has(e)&&this.error("circular reference"),this._circular.add(e);try{return this._encode(e)}finally{this._circular.delete(e)}}_encode(e){if(function(e){return(0,o.isObject)(e)&&t.serialize in e}(e))return e[t.serialize](this);if((0,o.isArray)(e)){const r=e.length,t=new Array(r);for(let n=0;n[this.encode(e),this.encode(r)]))]}}if(null===e||(0,o.isBoolean)(e)||(0,o.isString)(e))return e;if((0,o.isNumber)(e))return isNaN(e)?{type:"number",value:"nan"}:isFinite(e)?e:{type:"number",value:(e<0?"-":"+")+"inf"};if(e instanceof Date){return{type:"date",iso:e.toISOString()}}if(e instanceof Set)return 0==e.size?{type:"set"}:{type:"set",entries:[...(0,c.map)(e.values(),(e=>this.encode(e)))]};if(e instanceof Map)return 0==e.size?{type:"map"}:{type:"map",entries:[...(0,c.map)(e.entries(),(([e,r])=>[this.encode(e),this.encode(r)]))]};if((0,o.isSymbol)(e)&&null!=e.description)return{type:"symbol",name:e.description};throw new f(`${Object.prototype.toString.call(e)} is not serializable`)}encode_struct(e){const r={};for(const[t,n]of(0,a.entries)(e))void 0!==n&&(r[t]=this.encode(n));return r}error(e){throw new f(e)}_encode_typed_array(e){const r=this.encode(e.buffer),t=(()=>{switch(e.constructor){case Uint8Array:return"uint8";case Int8Array:return"int8";case Uint16Array:return"uint16";case Int16Array:return"int16";case Uint32Array:return"uint32";case Int32Array:return"int32";case Float32Array:return"float32";case Float64Array:return"float64";default:this.error(`can't serialize typed array of type '${e[Symbol.toStringTag]}'`)}})();return{type:"typed_array",array:r,order:l.BYTE_ORDER,dtype:t}}}t.Serializer=d,d.__name__="Serializer"},
function _(n,o,t,e,f){e();const i=n(10),r=n(12),{abs:l,ceil:c,max:s}=Math;function*u(n){const o=n.length;for(let t=0;t=0);for(const t of n)0==o?yield t:o-=1}function*y(n,o){const t=n.length;if(o>t)return;const e=(0,i.range)(o);for(yield e.map((o=>n[o]));;){let f;for(const n of u((0,i.range)(o)))if(e[n]!=n+t-o){f=n;break}if(null==f)return;e[f]+=1;for(const n of(0,i.range)(f+1,o))e[n]=e[n-1]+1;yield e.map((o=>n[o]))}}t.range=function*(n,o,t=1){(0,r.assert)(t>0),null==o&&(o=n,n=0);const e=n<=o?t:-t,f=s(c(l(o-n)/t),0);for(let o=0;o=0);let t=0;for(const e of n){if(!(t++String.fromCharCode(t)));return btoa(e.join(""))},e.base64_to_buffer=function(t){const n=atob(t),e=n.length,r=new Uint8Array(e);for(let t=0,o=e;t"'`])/g,(e=>{switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"`":return"`";default:return e}}))},r.unescape=function(e){return e.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,((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}}))},r.use_strict=function(e){return`'use strict';\n${e}`},r.to_fixed=function(e,t){return e.toFixed(t).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"")},r.insert_text_on_position=function(e,t,r){const n=[];return n.push(e.slice(0,t)),n.push(r),n.push(e.slice(t)),n.join("")}},
-function _(e,t,s,n,a){n();const i=e(25),r=e(30);class d{constructor(e){this.document=e}get[Symbol.toStringTag](){return this.constructor.__name__}[i.equals](e,t){return t.eq(this.document,e.document)}}s.DocumentEvent=d,d.__name__="DocumentEvent";class o extends d{constructor(e,t){super(e),this.events=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.events,e.events)}}s.DocumentEventBatch=o,o.__name__="DocumentEventBatch";class l extends d{}s.DocumentChangedEvent=l,l.__name__="DocumentChangedEvent";class h extends l{constructor(e,t,s){super(e),this.kind="MessageSent",this.msg_type=t,this.msg_data=s}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.msg_type,e.msg_type)&&t.eq(this.msg_data,e.msg_data)}[r.serialize](e){return{kind:this.kind,msg_type:this.msg_type,msg_data:e.encode(this.msg_data)}}}s.MessageSentEvent=h,h.__name__="MessageSentEvent";class u extends l{constructor(e,t,s,n){super(e),this.kind="ModelChanged",this.model=t,this.attr=s,this.value=n}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.value,e.value)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,new:e.encode(this.value)}}}s.ModelChangedEvent=u,u.__name__="ModelChangedEvent";class m extends l{constructor(e,t,s,n,a){super(e),this.kind="ColumnDataChanged",this.model=t,this.attr=s,this.data=n,this.cols=a}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.data,e.data)&&t.eq(this.cols,e.cols)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,data:e.encode(this.data),cols:this.cols}}}s.ColumnDataChangedEvent=m,m.__name__="ColumnDataChangedEvent";class c extends l{constructor(e,t,s,n,a){super(e),this.kind="ColumnsStreamed",this.model=t,this.attr=s,this.data=n,this.rollover=a}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.data,e.data)&&t.eq(this.rollover,e.rollover)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,data:e.encode(this.data),rollover:this.rollover}}}s.ColumnsStreamedEvent=c,c.__name__="ColumnsStreamedEvent";class _ extends l{constructor(e,t,s,n){super(e),this.kind="ColumnsPatched",this.model=t,this.attr=s,this.patches=n}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.patches,e.patches)}[r.serialize](e){return{kind:this.kind,attr:this.attr,model:this.model.ref(),patches:e.encode(this.patches)}}}s.ColumnsPatchedEvent=_,_.__name__="ColumnsPatchedEvent";class q extends l{constructor(e,t){super(e),this.kind="TitleChanged",this.title=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.title,e.title)}[r.serialize](e){return{kind:this.kind,title:this.title}}}s.TitleChangedEvent=q,q.__name__="TitleChangedEvent";class v extends l{constructor(e,t){super(e),this.kind="RootAdded",this.model=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)}[r.serialize](e){return{kind:this.kind,model:e.encode(this.model)}}}s.RootAddedEvent=v,v.__name__="RootAddedEvent";class p extends l{constructor(e,t){super(e),this.kind="RootRemoved",this.model=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)}[r.serialize](e){return{kind:this.kind,model:this.model.ref()}}}s.RootRemovedEvent=p,p.__name__="RootRemovedEvent"},
+function _(e,t,s,n,a){n();const i=e(25),r=e(31);class d{constructor(e){this.document=e}get[Symbol.toStringTag](){return this.constructor.__name__}[i.equals](e,t){return t.eq(this.document,e.document)}}s.DocumentEvent=d,d.__name__="DocumentEvent";class o extends d{constructor(e,t){super(e),this.events=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.events,e.events)}}s.DocumentEventBatch=o,o.__name__="DocumentEventBatch";class l extends d{}s.DocumentChangedEvent=l,l.__name__="DocumentChangedEvent";class h extends l{constructor(e,t,s){super(e),this.kind="MessageSent",this.msg_type=t,this.msg_data=s}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.msg_type,e.msg_type)&&t.eq(this.msg_data,e.msg_data)}[r.serialize](e){return{kind:this.kind,msg_type:this.msg_type,msg_data:e.encode(this.msg_data)}}}s.MessageSentEvent=h,h.__name__="MessageSentEvent";class u extends l{constructor(e,t,s,n){super(e),this.kind="ModelChanged",this.model=t,this.attr=s,this.value=n}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.value,e.value)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,new:e.encode(this.value)}}}s.ModelChangedEvent=u,u.__name__="ModelChangedEvent";class m extends l{constructor(e,t,s,n,a){super(e),this.kind="ColumnDataChanged",this.model=t,this.attr=s,this.data=n,this.cols=a}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.data,e.data)&&t.eq(this.cols,e.cols)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,data:e.encode(this.data),cols:this.cols}}}s.ColumnDataChangedEvent=m,m.__name__="ColumnDataChangedEvent";class c extends l{constructor(e,t,s,n,a){super(e),this.kind="ColumnsStreamed",this.model=t,this.attr=s,this.data=n,this.rollover=a}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.data,e.data)&&t.eq(this.rollover,e.rollover)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,data:e.encode(this.data),rollover:this.rollover}}}s.ColumnsStreamedEvent=c,c.__name__="ColumnsStreamedEvent";class _ extends l{constructor(e,t,s,n){super(e),this.kind="ColumnsPatched",this.model=t,this.attr=s,this.patches=n}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.patches,e.patches)}[r.serialize](e){return{kind:this.kind,attr:this.attr,model:this.model.ref(),patches:e.encode(this.patches)}}}s.ColumnsPatchedEvent=_,_.__name__="ColumnsPatchedEvent";class q extends l{constructor(e,t){super(e),this.kind="TitleChanged",this.title=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.title,e.title)}[r.serialize](e){return{kind:this.kind,title:this.title}}}s.TitleChangedEvent=q,q.__name__="TitleChangedEvent";class v extends l{constructor(e,t){super(e),this.kind="RootAdded",this.model=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)}[r.serialize](e){return{kind:this.kind,model:e.encode(this.model)}}}s.RootAddedEvent=v,v.__name__="RootAddedEvent";class p extends l{constructor(e,t){super(e),this.kind="RootRemoved",this.model=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)}[r.serialize](e){return{kind:this.kind,model:this.model.ref()}}}s.RootRemovedEvent=p,p.__name__="RootRemovedEvent"},
function _(t,r,i,n,e){n();const s=t(8),o=t(9);i.pretty=Symbol("pretty");class u{constructor(t){this.visited=new Set,this.precision=null==t?void 0:t.precision}to_string(t){if((0,s.isObject)(t)){if(this.visited.has(t))return"";this.visited.add(t)}return function(t){return(0,s.isObject)(t)&&i.pretty in t}(t)?t[i.pretty](this):(0,s.isBoolean)(t)?this.boolean(t):(0,s.isNumber)(t)?this.number(t):(0,s.isString)(t)?this.string(t):(0,s.isArray)(t)?this.array(t):(0,s.isIterable)(t)?this.iterable(t):(0,s.isPlainObject)(t)?this.object(t):(0,s.isSymbol)(t)?this.symbol(t):t instanceof ArrayBuffer?this.array_buffer(t):`${t}`}token(t){return t}boolean(t){return`${t}`}number(t){return null!=this.precision?t.toFixed(this.precision):`${t}`}string(t){const r=t.includes("'"),i=t.includes('"');return r&&i?`\`${t.replace(/`/g,"\\`")}\``:i?`'${t}'`:`"${t}"`}symbol(t){return t.toString()}array(t){const r=this.token,i=[];for(const r of t)i.push(this.to_string(r));return`${r("[")}${i.join(`${r(",")} `)}${r("]")}`}iterable(t){var r;const i=this.token,n=null!==(r=Object(t)[Symbol.toStringTag])&&void 0!==r?r:"Object",e=this.array(t);return`${n}${i("(")}${e}${i(")")}`}object(t){const r=this.token,i=[];for(const[n,e]of(0,o.entries)(t))i.push(`${n}${r(":")} ${this.to_string(e)}`);return`${r("{")}${i.join(`${r(",")} `)}${r("}")}`}array_buffer(t){return`ArrayBuffer(#${t.byteLength})`}}i.Printer=u,u.__name__="Printer",i.to_string=function(t,r){return new u(r).to_string(t)}},
-function _(n,e,t,o,r){o();const i=n(9),c=n(8);function l(n){return(0,c.isObject)(n)&&t.clone in n}t.clone=Symbol("clone"),t.is_Cloneable=l;class s extends Error{}t.CloningError=s,s.__name__="CloningError";class a{constructor(){}clone(n){if(l(n))return n[t.clone](this);if((0,c.isPrimitive)(n))return n;if((0,c.isArray)(n)){const e=n.length,t=new Array(e);for(let o=0;o[this.clone(n),this.clone(e)])));if(n instanceof Set)return new Set([...n].map((n=>this.clone(n))));throw new s(`${Object.prototype.toString.call(n)} is not cloneable`)}}t.Cloner=a,a.__name__="Cloner"},
function _(t,r,n,e,o){e();const s=t(1),u=t(8),c=t(9),l=t(43),i=s.__importStar(t(44));function a(t,r,n){if((0,u.isArray)(t)&&(0,u.isArray)(r)){const e=t.concat(r);return null!=n&&e.length>n?e.slice(-n):e}const e=t.length+r.length;if(null!=n&&e>n){const o=e-n,s=t.length,c=(()=>{if(t.length{if((0,u.isTypedArray)(t))return t.constructor;if((0,u.isTypedArray)(r))return r.constructor;throw new Error("unsupported array types")})())(n);return e.set(t,0),e}return t})();for(let t=o,r=s;t{if((0,u.isTypedArray)(t))return t;if((0,u.isTypedArray)(r))return new r.constructor(t);throw new Error("unsupported array types")})();return i.concat(n,r)}}function f(t,r){let n,e,o;return(0,u.isNumber)(t)?(n=t,o=t+1,e=1):(n=null!=t.start?t.start:0,o=null!=t.stop?t.stop:r,e=null!=t.step?t.step:1),[n,o,e]}function p(t,r){const n=new Set;let e=!1;for(const[o,s]of r){let r,c,l,i;if((0,u.isArray)(o)){const[e]=o;n.add(e),r=t[e].shape,c=t[e],i=s,2===o.length?(r=[1,r[0]],l=[o[0],0,o[1]]):l=o}else(0,u.isNumber)(o)?(i=[s],n.add(o)):(i=s,e=!0),l=[0,0,o],r=[1,t.length],c=t;let a=0;const[p,y,h]=f(l[1],r[0]),[d,_,m]=f(l[2],r[1]);for(let t=p;t{try{return this._decode(e)}finally{n=new Set(this._finalizable),this._decoding=!1,this._buffers.clear(),this._finalizable.clear()}})();for(const e of n)null===(t=this.finalize)||void 0===t||t.call(this,e),e.finalize(),e.assert_initialized();for(const e of n)e.connect_signals();return s}_decode(e){if((0,l.isArray)(e))return this._decode_plain_array(e);if(!(0,l.isPlainObject)(e))return e;if(!(0,l.isString)(e.type))return(0,l.isString)(e.id)?this._decode_ref(e):this._decode_plain_object(e);{const r=h.get(e.type);if(null!=r)return r(e,this);switch(e.type){case"ref":return this._decode_ref(e);case"symbol":return this._decode_symbol(e);case"number":return this._decode_number(e);case"array":return this._decode_array(e);case"set":return this._decode_set(e);case"map":return this._decode_map(e);case"bytes":return this._decode_bytes(e);case"slice":return this._decode_slice(e);case"date":return this._decode_date(e);case"value":return this._decode_value(e);case"field":return this._decode_field(e);case"expr":return this._decode_expr(e);case"typed_array":return this._decode_typed_array(e);case"ndarray":return this._decode_ndarray(e);case"object":return(0,l.isString)(e.id)?this._decode_object_ref(e):this._decode_object(e);default:this.error(`unable to decode an object of type '${e.type}'`)}}}_decode_symbol(e){this.error(`can't resolve named symbol '${e.name}'`)}_decode_number(e){if("value"in e){const{value:r}=e;if((0,l.isString)(r))switch(r){case"nan":return NaN;case"+inf":return 1/0;case"-inf":return-1/0}else if((0,l.isNumber)(r))return r}this.error(`invalid number representation '${e}'`)}_decode_plain_array(e){return(0,c.map)(e,(e=>this._decode(e)))}_decode_plain_object(e){const r={};for(const[t,n]of(0,a.entries)(e))r[t]=this._decode(n);return r}_decode_array(e){var r;const t=[];for(const n of null!==(r=e.entries)&&void 0!==r?r:[])t.push(this._decode(n));return t}_decode_set(e){var r;const t=new Set;for(const n of null!==(r=e.entries)&&void 0!==r?r:[])t.add(this._decode(n));return t}_decode_map(e){var r;const t=(0,c.map)(null!==(r=e.entries)&&void 0!==r?r:[],(([e,r])=>[this._decode(e),this._decode(r)]));if((0,c.every)(t,(([e])=>(0,l.isString)(e)))){const e={};for(const[r,n]of t)e[r]=n;return e}return new Map(t)}_decode_bytes(e){const{data:r}=e;if(!(0,d.is_ref)(r))return(0,l.isString)(r)?(0,u.base64_to_buffer)(r):r.buffer;{const e=this._buffers.get(r.id);if(null!=e)return e;this.error(`buffer for id=${r.id} not found`)}}_decode_slice(e){const r=this._decode(e.start),t=this._decode(e.stop),n=this._decode(e.step);return new f.Slice({start:r,stop:t,step:n})}_decode_date(e){const r=this._decode(e.iso);return new Date(r)}_decode_value(e){return{value:this._decode(e.value),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_field(e){return{field:this._decode(e.field),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_expr(e){return{expr:this._decode(e.expr),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_typed_array(e){const{array:r,order:t,dtype:n}=e,s=this._decode(r);switch(t!=_.BYTE_ORDER&&(0,u.swap)(s,n),n){case"uint8":return new Uint8Array(s);case"int8":return new Int8Array(s);case"uint16":return new Uint16Array(s);case"int16":return new Int16Array(s);case"uint32":return new Uint32Array(s);case"int32":return new Int32Array(s);case"float32":return new Float32Array(s);case"float64":return new Float64Array(s);default:this.error(`unsupported dtype '${n}'`)}}_decode_ndarray(e){const{array:r,order:t,dtype:n,shape:s}=e,i=this._decode(r);return i instanceof ArrayBuffer&&t!=_.BYTE_ORDER&&(0,u.swap)(i,n),(0,o.ndarray)(i,{dtype:n,shape:s})}_decode_object(e){const{type:r,attributes:t}=e,n=this._resolve_type(r);return null!=t?new n(this._decode(t)):new n}_decode_ref(e){const r=this.references.get(e.id);if(null!=r)return r;this.error(`reference ${e.id} isn't known`)}_decode_object_ref(e){const r=this.references.get(e.id);if(null!=r)return this.warning(`reference already known '${e.id}'`),r;const{id:t,name:n,attributes:s}=e,i=new(this._resolve_type(n))({id:t});this.references.set(t,i);const d=this._decode(null!=s?s:{});return i.initialize_props(new a.Dict(d)),this._finalizable.add(i),i}error(e){throw new y(e)}warning(e){i.logger.warn(e)}_resolve_type(e){const r=this.resolver.get(e);if(null!=r)return r;this.error(`could not resolve type '${e}', which could be due to a widget or a custom model not being registered before first usage`)}}t.Deserializer=p,p.__name__="Deserializer"},
+function _(e,r,t,n,s){n();const i=e(18),d=e(47),o=e(29),a=e(9),c=e(10),_=e(26),u=e(35),l=e(8),f=e(48),h=new Map;class y extends Error{}t.DeserializationError=y,y.__name__="DeserializationError";class p{static register(e,r){if(h.has(e))throw new Error(`'${e}' already registered for decoding`);h.set(e,r)}constructor(e,r=new Map,t){this._decoding=!1,this._buffers=new Map,this._finalizable=new Set,this.resolver=e,this.references=r,this.finalize=t}decode(e,r){var t;if(null!=r)for(const[e,t]of r)this._buffers.set(e,t);if(this._decoding)return this._decode(e);let n;this._decoding=!0;const s=(()=>{try{return this._decode(e)}finally{n=new Set(this._finalizable),this._decoding=!1,this._buffers.clear(),this._finalizable.clear()}})();for(const e of n)null===(t=this.finalize)||void 0===t||t.call(this,e),e.finalize(),e.assert_initialized();for(const e of n)e.connect_signals();return s}_decode(e){if((0,l.isArray)(e))return this._decode_plain_array(e);if(!(0,l.isPlainObject)(e))return e;if(!(0,l.isString)(e.type))return(0,l.isString)(e.id)?this._decode_ref(e):this._decode_plain_object(e);{const r=h.get(e.type);if(null!=r)return r(e,this);switch(e.type){case"ref":return this._decode_ref(e);case"symbol":return this._decode_symbol(e);case"number":return this._decode_number(e);case"array":return this._decode_array(e);case"set":return this._decode_set(e);case"map":return this._decode_map(e);case"bytes":return this._decode_bytes(e);case"slice":return this._decode_slice(e);case"date":return this._decode_date(e);case"value":return this._decode_value(e);case"field":return this._decode_field(e);case"expr":return this._decode_expr(e);case"typed_array":return this._decode_typed_array(e);case"ndarray":return this._decode_ndarray(e);case"object":return(0,l.isString)(e.id)?this._decode_object_ref(e):this._decode_object(e);default:this.error(`unable to decode an object of type '${e.type}'`)}}}_decode_symbol(e){this.error(`can't resolve named symbol '${e.name}'`)}_decode_number(e){if("value"in e){const{value:r}=e;if((0,l.isString)(r))switch(r){case"nan":return NaN;case"+inf":return 1/0;case"-inf":return-1/0}else if((0,l.isNumber)(r))return r}this.error(`invalid number representation '${e}'`)}_decode_plain_array(e){return(0,c.map)(e,(e=>this._decode(e)))}_decode_plain_object(e){const r={};for(const[t,n]of(0,a.entries)(e))r[t]=this._decode(n);return r}_decode_array(e){var r;const t=[];for(const n of null!==(r=e.entries)&&void 0!==r?r:[])t.push(this._decode(n));return t}_decode_set(e){var r;const t=new Set;for(const n of null!==(r=e.entries)&&void 0!==r?r:[])t.add(this._decode(n));return t}_decode_map(e){var r;const t=(0,c.map)(null!==(r=e.entries)&&void 0!==r?r:[],(([e,r])=>[this._decode(e),this._decode(r)]));if((0,c.every)(t,(([e])=>(0,l.isString)(e)))){const e={};for(const[r,n]of t)e[r]=n;return e}return new Map(t)}_decode_bytes(e){const{data:r}=e;if(!(0,d.is_ref)(r))return(0,l.isString)(r)?(0,u.base64_to_buffer)(r):r.buffer;{const e=this._buffers.get(r.id);if(null!=e)return e;this.error(`buffer for id=${r.id} not found`)}}_decode_slice(e){const r=this._decode(e.start),t=this._decode(e.stop),n=this._decode(e.step);return new f.Slice({start:r,stop:t,step:n})}_decode_date(e){const r=this._decode(e.iso);return new Date(r)}_decode_value(e){return{value:this._decode(e.value),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_field(e){return{field:this._decode(e.field),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_expr(e){return{expr:this._decode(e.expr),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_typed_array(e){const{array:r,order:t,dtype:n}=e,s=this._decode(r);switch(t!=_.BYTE_ORDER&&(0,u.swap)(s,n),n){case"uint8":return new Uint8Array(s);case"int8":return new Int8Array(s);case"uint16":return new Uint16Array(s);case"int16":return new Int16Array(s);case"uint32":return new Uint32Array(s);case"int32":return new Int32Array(s);case"float32":return new Float32Array(s);case"float64":return new Float64Array(s);default:this.error(`unsupported dtype '${n}'`)}}_decode_ndarray(e){const{array:r,order:t,dtype:n,shape:s}=e,i=this._decode(r);return i instanceof ArrayBuffer&&t!=_.BYTE_ORDER&&(0,u.swap)(i,n),(0,o.ndarray)(i,{dtype:n,shape:s})}_decode_object(e){const{type:r,attributes:t}=e,n=this._resolve_type(r);return null!=t?new n(this._decode(t)):new n}_decode_ref(e){const r=this.references.get(e.id);if(null!=r)return r;this.error(`reference ${e.id} isn't known`)}_decode_object_ref(e){const r=this.references.get(e.id);if(null!=r)return this.warning(`reference already known '${e.id}'`),r;const{id:t,name:n,attributes:s}=e,i=new(this._resolve_type(n))({id:t});this.references.set(t,i);const d=this._decode(null!=s?s:{});return i.initialize_props(new a.Dict(d)),this._finalizable.add(i),i}error(e){throw new y(e)}warning(e){i.logger.warn(e)}_resolve_type(e){const r=this.resolver.get(e);if(null!=r)return r;this.error(`could not resolve type '${e}', which could be due to a widget or a custom model not being registered before first usage`)}}t.Deserializer=p,p.__name__="Deserializer"},
function _(n,i,t,c,e){c();const f=n(8);t.is_ref=function(n){return(0,f.isPlainObject)(n)&&"id"in n&&!("type"in n)}},
-function _(t,s,e,l,n){l();const i=t(30);class c{constructor({start:t,stop:s,step:e}={}){this.start=null!=t?t:null,this.stop=null!=s?s:null,this.step=null!=e?e:null}[i.serialize](t){return{type:"slice",start:t.encode(this.start),stop:t.encode(this.stop),step:t.encode(this.step)}}}e.Slice=c,c.__name__="Slice"},
+function _(t,s,e,l,n){l();const i=t(31);class c{constructor({start:t,stop:s,step:e}={}){this.start=null!=t?t:null,this.stop=null!=s?s:null,this.step=null!=e?e:null}[i.serialize](t){return{type:"slice",start:t.encode(this.start),stop:t.encode(this.stop),step:t.encode(this.step)}}}e.Slice=c,c.__name__="Slice"},
function _(n,e,r,c,i){c(),r.pyify_version=function(n){return n.replace(/-(dev|rc)\./,".$1")}},
function _(e,t,s,n,c){var i;n();const a=e(14),r=e(8),l=e(9),o=e(25),_=e(18);class h extends a.HasProps{get is_syncable(){return this.syncable}[o.equals](e,t){return(!!t.structural||t.eq(this.id,e.id))&&super[o.equals](e,t)}constructor(e){super(e)}initialize(){super.initialize(),this._js_callbacks=new Map}connect_signals(){super.connect_signals(),this._update_property_callbacks(),this.connect(this.properties.js_property_callbacks.change,(()=>this._update_property_callbacks())),this.connect(this.properties.js_event_callbacks.change,(()=>this._update_event_callbacks())),this.connect(this.properties.subscribed_events.change,(()=>this._update_event_callbacks()))}_process_event(e){var t;for(const s of null!==(t=(0,l.dict)(this.js_event_callbacks).get(e.event_name))&&void 0!==t?t:[])s.execute(e);null!=this.document&&this.subscribed_events.has(e.event_name)&&this.document.event_manager.send_event(e)}trigger_event(e){null!=this.document&&(e.origin=this,this.document.event_manager.trigger(e))}_update_event_callbacks(){null!=this.document?this.document.event_manager.subscribed_models.add(this):_.logger.warn("WARNING: Document not defined for updating event callbacks")}_update_property_callbacks(){const e=e=>{const[t,s=null]=e.split(":");return null!=s?this.properties[s][t]:this[t]};for(const[t,s]of this._js_callbacks){const n=e(t);for(const e of s)this.disconnect(n,e)}this._js_callbacks.clear();for(const[t,s]of(0,l.dict)(this.js_property_callbacks)){const n=s.map((e=>()=>e.execute(this)));this._js_callbacks.set(t,n);const c=e(t);for(const e of n)this.connect(c,e)}}_doc_attached(){(0,l.dict)(this.js_event_callbacks).is_empty&&0==this.subscribed_events.size||this._update_event_callbacks()}_doc_detached(){this.document.event_manager.subscribed_models.delete(this)}select(e){if((0,r.isString)(e))return[...this.references()].filter((t=>t instanceof h&&t.name===e));if((0,r.isPlainObject)(e)&&"type"in e)return[...this.references()].filter((t=>t.type==e.type));if(e.prototype instanceof a.HasProps)return[...this.references()].filter((t=>t instanceof e));throw new Error(`invalid selector ${e}`)}select_one(e){const 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 ${e}`)}}on_event(e,t){var s;const n=(0,r.isString)(e)?e:e.prototype.event_name;this.js_event_callbacks[n]=[...null!==(s=(0,l.dict)(this.js_event_callbacks).get(n))&&void 0!==s?s:[],(0,r.isFunction)(t)?{execute:t}:t]}}s.Model=h,i=h,h.__name__="Model",i.define((({Any:e,Unknown:t,Boolean:s,String:n,Array:c,Set:i,Dict:a,Nullable:r})=>({tags:[c(t),[]],name:[r(n),null],js_property_callbacks:[a(c(e)),{}],js_event_callbacks:[a(c(e)),{}],subscribed_events:[i(n),new globalThis.Set],syncable:[s,!0]})))},
function _(e,n,r,t,o){t();const s=e(1),c=e(50),u=s.__importStar(e(20)),a=e(8),i=e(9);r.decode_def=function(e,n){var r,t,o;function l(e){if((0,a.isString)(e))switch(e){case"Any":return u.Any;case"Unknown":return u.Unknown;case"Boolean":return u.Boolean;case"Number":return u.Number;case"Int":return u.Int;case"Bytes":return u.Bytes;case"String":return u.String;case"Null":return u.Null}else switch(e[0]){case"Regex":{const[,n,r]=e;return u.Regex(new RegExp(n,r))}case"Nullable":{const[,n]=e;return u.Nullable(l(n))}case"Or":{const[,n,...r]=e;return u.Or(l(n),...r.map(l))}case"Tuple":{const[,n,...r]=e;return u.Tuple(l(n),...r.map(l))}case"Array":{const[,n]=e;return u.Array(l(n))}case"Struct":{const[,...n]=e,r=n.map((([e,n])=>[e,l(n)]));return u.Struct((0,i.to_object)(r))}case"Dict":{const[,n]=e;return u.Dict(l(n))}case"Map":{const[,n,r]=e;return u.Map(l(n),l(r))}case"Enum":{const[,...n]=e;return u.Enum(...n)}case"Ref":{const[,r]=e,t=n.resolver.get(r.id);if(null!=t)return u.Ref(t);throw new Error(`${r.id} wasn't defined before referencing it`)}case"AnyRef":return u.AnyRef()}}const d=(()=>{var r,t;const o=null!==(t=null===(r=e.extends)||void 0===r?void 0:r.id)&&void 0!==t?t:"Model";if("Model"==o)return c.Model;const s=n.resolver.get(o);if(null!=s)return s;throw new Error(`base model ${o} of ${e.name} is not defined`)})(),f=(o=class extends d{},s.__setFunctionName(o,"model"),o.__qualified__=e.name,o);function m(e){return void 0===e?e:n.decode(e)}for(const n of null!==(r=e.properties)&&void 0!==r?r:[]){const e=l(n.kind);f.define({[n.name]:[e,m(n.default)]})}for(const n of null!==(t=e.overrides)&&void 0!==t?t:[])f.override({[n.name]:m(n.default)});return n.resolver.register(f),f}},
-function _(e,t,s,n,a){var _,l,o,r,c,u,i,v,d,m,p,h,x,g,y,b,P,E,O,j,M,R,f,S,D,L,k,C;n();var B=this&&this.__decorate||function(e,t,s,n){var a,_=arguments.length,l=_<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,s,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(l=(_<3?a(l):_>3?a(t,s,l):a(t,s))||l);return _>3&&l&&Object.defineProperty(t,s,l),l};const U=e(30),T=e(25),I=e(20);function w(e){return t=>{t.prototype.event_name=e}}s.KeyModifiers=(0,I.PartialStruct)({shift:I.Boolean,ctrl:I.Boolean,alt:I.Boolean});class G{[U.serialize](e){const{event_name:t,event_values:s}=this;return{type:"event",name:t,values:e.encode(s)}}[T.equals](e,t){return this.event_name==e.event_name&&t.eq(this.event_values,e.event_values)}}s.BokehEvent=G,_=G,G.__name__="BokehEvent",_.prototype.publish=!0;class V extends G{constructor(){super(...arguments),this.origin=null}get event_values(){return{model:this.origin}}}s.ModelEvent=V,V.__name__="ModelEvent";class W extends G{}s.DocumentEvent=W,W.__name__="DocumentEvent";let q=((l=class extends W{get event_values(){return{}}}).__name__="DocumentReady",l);s.DocumentReady=q,s.DocumentReady=q=B([w("document_ready")],q);class z extends W{}s.ConnectionEvent=z,z.__name__="ConnectionEvent";class K extends z{constructor(){super(...arguments),this.timestamp=new Date}get event_values(){const{timestamp:e}=this;return{timestamp:e}}}s.ConnectionLost=K,o=K,K.__name__="ConnectionLost",o.prototype.event_name="connection_lost",o.prototype.publish=!1;let A=((r=class extends V{}).__name__="ButtonClick",r);s.ButtonClick=A,s.ButtonClick=A=B([w("button_click")],A);let F=((c=class extends V{constructor(e){super(),this.item=e}get event_values(){const{item:e}=this;return Object.assign(Object.assign({},super.event_values),{item:e})}}).__name__="MenuItemClick",c);s.MenuItemClick=F,s.MenuItemClick=F=B([w("menu_item_click")],F);let H=((u=class extends V{constructor(e){super(),this.value=e}get event_values(){const{value:e}=this;return Object.assign(Object.assign({},super.event_values),{value:e})}}).__name__="ValueSubmit",u);s.ValueSubmit=H,s.ValueSubmit=H=B([w("value_submit")],H);class J extends V{}s.UIEvent=J,J.__name__="UIEvent";let N=((i=class extends J{}).__name__="LODStart",i);s.LODStart=N,s.LODStart=N=B([w("lodstart")],N);let Q=((v=class extends J{}).__name__="LODEnd",v);s.LODEnd=Q,s.LODEnd=Q=B([w("lodend")],Q);let X=((d=class extends J{constructor(e,t,s,n){super(),this.x0=e,this.x1=t,this.y0=s,this.y1=n}get event_values(){const{x0:e,x1:t,y0:s,y1:n}=this;return Object.assign(Object.assign({},super.event_values),{x0:e,x1:t,y0:s,y1:n})}}).__name__="RangesUpdate",d);s.RangesUpdate=X,s.RangesUpdate=X=B([w("rangesupdate")],X);let Y=((m=class extends J{constructor(e,t){super(),this.geometry=e,this.final=t}get event_values(){const{geometry:e,final:t}=this;return Object.assign(Object.assign({},super.event_values),{geometry:e,final:t})}}).__name__="SelectionGeometry",m);s.SelectionGeometry=Y,s.SelectionGeometry=Y=B([w("selectiongeometry")],Y);let Z=((p=class extends J{}).__name__="Reset",p);s.Reset=Z,s.Reset=Z=B([w("reset")],Z);class $ extends J{constructor(e,t,s,n,a){super(),this.sx=e,this.sy=t,this.x=s,this.y=n,this.modifiers=a}get event_values(){const{sx:e,sy:t,x:s,y:n,modifiers:a}=this;return Object.assign(Object.assign({},super.event_values),{sx:e,sy:t,x:s,y:n,modifiers:a})}}s.PointEvent=$,$.__name__="PointEvent";let ee=((h=class extends ${constructor(e,t,s,n,a,_,l){super(e,t,s,n,l),this.delta_x=a,this.delta_y=_}get event_values(){const{delta_x:e,delta_y:t}=this;return Object.assign(Object.assign({},super.event_values),{delta_x:e,delta_y:t})}}).__name__="Pan",h);s.Pan=ee,s.Pan=ee=B([w("pan")],ee);let te=((x=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.scale=a}get event_values(){const{scale:e}=this;return Object.assign(Object.assign({},super.event_values),{scale:e})}}).__name__="Pinch",x);s.Pinch=te,s.Pinch=te=B([w("pinch")],te);let se=((g=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.rotation=a}get event_values(){const{rotation:e}=this;return Object.assign(Object.assign({},super.event_values),{rotation:e})}}).__name__="Rotate",g);s.Rotate=se,s.Rotate=se=B([w("rotate")],se);let ne=((y=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.delta=a}get event_values(){const{delta:e}=this;return Object.assign(Object.assign({},super.event_values),{delta:e})}}).__name__="MouseWheel",y);s.MouseWheel=ne,s.MouseWheel=ne=B([w("wheel")],ne);let ae=((b=class extends ${}).__name__="MouseMove",b);s.MouseMove=ae,s.MouseMove=ae=B([w("mousemove")],ae);let _e=((P=class extends ${}).__name__="MouseEnter",P);s.MouseEnter=_e,s.MouseEnter=_e=B([w("mouseenter")],_e);let le=((E=class extends ${}).__name__="MouseLeave",E);s.MouseLeave=le,s.MouseLeave=le=B([w("mouseleave")],le);let oe=((O=class extends ${}).__name__="Tap",O);s.Tap=oe,s.Tap=oe=B([w("tap")],oe);let re=((j=class extends ${}).__name__="DoubleTap",j);s.DoubleTap=re,s.DoubleTap=re=B([w("doubletap")],re);let ce=((M=class extends ${}).__name__="Press",M);s.Press=ce,s.Press=ce=B([w("press")],ce);let ue=((R=class extends ${}).__name__="PressUp",R);s.PressUp=ue,s.PressUp=ue=B([w("pressup")],ue);let ie=((f=class extends ${}).__name__="PanStart",f);s.PanStart=ie,s.PanStart=ie=B([w("panstart")],ie);let ve=((S=class extends ${}).__name__="PanEnd",S);s.PanEnd=ve,s.PanEnd=ve=B([w("panend")],ve);let de=((D=class extends ${}).__name__="PinchStart",D);s.PinchStart=de,s.PinchStart=de=B([w("pinchstart")],de);let me=((L=class extends ${}).__name__="PinchEnd",L);s.PinchEnd=me,s.PinchEnd=me=B([w("pinchend")],me);let pe=((k=class extends ${}).__name__="RotateStart",k);s.RotateStart=pe,s.RotateStart=pe=B([w("rotatestart")],pe);let he=((C=class extends ${}).__name__="RotateEnd",C);s.RotateEnd=he,s.RotateEnd=he=B([w("rotateend")],he)},
+function _(e,t,s,n,a){var _,l,o,r,c,u,i,v,d,m,p,h,x,g,y,b,P,E,O,j,M,R,f,S,D,L,k,C;n();var B=this&&this.__decorate||function(e,t,s,n){var a,_=arguments.length,l=_<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,s,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(l=(_<3?a(l):_>3?a(t,s,l):a(t,s))||l);return _>3&&l&&Object.defineProperty(t,s,l),l};const U=e(31),T=e(25),I=e(20);function w(e){return t=>{t.prototype.event_name=e}}s.KeyModifiers=(0,I.PartialStruct)({shift:I.Boolean,ctrl:I.Boolean,alt:I.Boolean});class G{[U.serialize](e){const{event_name:t,event_values:s}=this;return{type:"event",name:t,values:e.encode(s)}}[T.equals](e,t){return this.event_name==e.event_name&&t.eq(this.event_values,e.event_values)}}s.BokehEvent=G,_=G,G.__name__="BokehEvent",_.prototype.publish=!0;class V extends G{constructor(){super(...arguments),this.origin=null}get event_values(){return{model:this.origin}}}s.ModelEvent=V,V.__name__="ModelEvent";class W extends G{}s.DocumentEvent=W,W.__name__="DocumentEvent";let q=((l=class extends W{get event_values(){return{}}}).__name__="DocumentReady",l);s.DocumentReady=q,s.DocumentReady=q=B([w("document_ready")],q);class z extends W{}s.ConnectionEvent=z,z.__name__="ConnectionEvent";class K extends z{constructor(){super(...arguments),this.timestamp=new Date}get event_values(){const{timestamp:e}=this;return{timestamp:e}}}s.ConnectionLost=K,o=K,K.__name__="ConnectionLost",o.prototype.event_name="connection_lost",o.prototype.publish=!1;let A=((r=class extends V{}).__name__="ButtonClick",r);s.ButtonClick=A,s.ButtonClick=A=B([w("button_click")],A);let F=((c=class extends V{constructor(e){super(),this.item=e}get event_values(){const{item:e}=this;return Object.assign(Object.assign({},super.event_values),{item:e})}}).__name__="MenuItemClick",c);s.MenuItemClick=F,s.MenuItemClick=F=B([w("menu_item_click")],F);let H=((u=class extends V{constructor(e){super(),this.value=e}get event_values(){const{value:e}=this;return Object.assign(Object.assign({},super.event_values),{value:e})}}).__name__="ValueSubmit",u);s.ValueSubmit=H,s.ValueSubmit=H=B([w("value_submit")],H);class J extends V{}s.UIEvent=J,J.__name__="UIEvent";let N=((i=class extends J{}).__name__="LODStart",i);s.LODStart=N,s.LODStart=N=B([w("lodstart")],N);let Q=((v=class extends J{}).__name__="LODEnd",v);s.LODEnd=Q,s.LODEnd=Q=B([w("lodend")],Q);let X=((d=class extends J{constructor(e,t,s,n){super(),this.x0=e,this.x1=t,this.y0=s,this.y1=n}get event_values(){const{x0:e,x1:t,y0:s,y1:n}=this;return Object.assign(Object.assign({},super.event_values),{x0:e,x1:t,y0:s,y1:n})}}).__name__="RangesUpdate",d);s.RangesUpdate=X,s.RangesUpdate=X=B([w("rangesupdate")],X);let Y=((m=class extends J{constructor(e,t){super(),this.geometry=e,this.final=t}get event_values(){const{geometry:e,final:t}=this;return Object.assign(Object.assign({},super.event_values),{geometry:e,final:t})}}).__name__="SelectionGeometry",m);s.SelectionGeometry=Y,s.SelectionGeometry=Y=B([w("selectiongeometry")],Y);let Z=((p=class extends J{}).__name__="Reset",p);s.Reset=Z,s.Reset=Z=B([w("reset")],Z);class $ extends J{constructor(e,t,s,n,a){super(),this.sx=e,this.sy=t,this.x=s,this.y=n,this.modifiers=a}get event_values(){const{sx:e,sy:t,x:s,y:n,modifiers:a}=this;return Object.assign(Object.assign({},super.event_values),{sx:e,sy:t,x:s,y:n,modifiers:a})}}s.PointEvent=$,$.__name__="PointEvent";let ee=((h=class extends ${constructor(e,t,s,n,a,_,l){super(e,t,s,n,l),this.delta_x=a,this.delta_y=_}get event_values(){const{delta_x:e,delta_y:t}=this;return Object.assign(Object.assign({},super.event_values),{delta_x:e,delta_y:t})}}).__name__="Pan",h);s.Pan=ee,s.Pan=ee=B([w("pan")],ee);let te=((x=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.scale=a}get event_values(){const{scale:e}=this;return Object.assign(Object.assign({},super.event_values),{scale:e})}}).__name__="Pinch",x);s.Pinch=te,s.Pinch=te=B([w("pinch")],te);let se=((g=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.rotation=a}get event_values(){const{rotation:e}=this;return Object.assign(Object.assign({},super.event_values),{rotation:e})}}).__name__="Rotate",g);s.Rotate=se,s.Rotate=se=B([w("rotate")],se);let ne=((y=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.delta=a}get event_values(){const{delta:e}=this;return Object.assign(Object.assign({},super.event_values),{delta:e})}}).__name__="MouseWheel",y);s.MouseWheel=ne,s.MouseWheel=ne=B([w("wheel")],ne);let ae=((b=class extends ${}).__name__="MouseMove",b);s.MouseMove=ae,s.MouseMove=ae=B([w("mousemove")],ae);let _e=((P=class extends ${}).__name__="MouseEnter",P);s.MouseEnter=_e,s.MouseEnter=_e=B([w("mouseenter")],_e);let le=((E=class extends ${}).__name__="MouseLeave",E);s.MouseLeave=le,s.MouseLeave=le=B([w("mouseleave")],le);let oe=((O=class extends ${}).__name__="Tap",O);s.Tap=oe,s.Tap=oe=B([w("tap")],oe);let re=((j=class extends ${}).__name__="DoubleTap",j);s.DoubleTap=re,s.DoubleTap=re=B([w("doubletap")],re);let ce=((M=class extends ${}).__name__="Press",M);s.Press=ce,s.Press=ce=B([w("press")],ce);let ue=((R=class extends ${}).__name__="PressUp",R);s.PressUp=ue,s.PressUp=ue=B([w("pressup")],ue);let ie=((f=class extends ${}).__name__="PanStart",f);s.PanStart=ie,s.PanStart=ie=B([w("panstart")],ie);let ve=((S=class extends ${}).__name__="PanEnd",S);s.PanEnd=ve,s.PanEnd=ve=B([w("panend")],ve);let de=((D=class extends ${}).__name__="PinchStart",D);s.PinchStart=de,s.PinchStart=de=B([w("pinchstart")],de);let me=((L=class extends ${}).__name__="PinchEnd",L);s.PinchEnd=me,s.PinchEnd=me=B([w("pinchend")],me);let pe=((k=class extends ${}).__name__="RotateStart",k);s.RotateStart=pe,s.RotateStart=pe=B([w("rotatestart")],pe);let he=((C=class extends ${}).__name__="RotateEnd",C);s.RotateEnd=he,s.RotateEnd=he=B([w("rotateend")],he)},
function _(n,e,t,o,i){o();const d=n(5),a=n(54),c=n(55),l=n(59);t.index={},t.add_document_standalone=async function(n,e,o=[],i=!1){const s=new a.ViewManager;async function f(i){null!=i.default_view?await async function(i){var d;const a=await(0,l.build_view)(i,{parent:null,owner:s});if(a instanceof c.DOMView){const t=n.roots().indexOf(i),c=null!==(d=o[t])&&void 0!==d?d:e;a.render_to(c)}s.add(a),t.index[i.id]=a}(i):n.notify_idle(i)}for(const e of n.roots())await f(e);return i&&(window.document.title=n.title()),n.on_change((n=>{n instanceof d.RootAddedEvent?f(n.model):n instanceof d.RootRemovedEvent?function(n){const e=s.get(n);null!=e&&(e.remove(),s.delete(e),delete t.index[n.id])}(n.model):i&&n instanceof d.TitleChangedEvent&&(window.document.title=n.title)})),s}},
-function _(t,e,i,s,n){s();const o=t(15),r=t(8);class h{get ready(){return this._ready}*children(){}connect(t,e){let i=this._slots.get(e);return null==i&&(i=(t,i)=>{const s=Promise.resolve(e.call(this,t,i));this._ready=this._ready.then((()=>s)),this.root!=this&&(this.root._ready=this.root._ready.then((()=>this._ready)))},this._slots.set(e,i)),t.connect(i,this)}disconnect(t,e){return t.disconnect(e,this)}constructor(t){this.removed=new o.Signal0(this,"removed"),this._ready=Promise.resolve(void 0),this._slots=new WeakMap,this._removed=!1,this._idle_notified=!1;const{model:e,parent:i,owner:s}=t;this.model=e,this.parent=i,null==i?(this.root=this,this.owner=null!=s?s:new d([this])):(this.root=i.root,this.owner=this.root.owner)}initialize(){this._has_finished=!1}async lazy_initialize(){}remove(){this.disconnect_signals(),this.removed.emit(),this._removed=!0}toString(){return`${this.model.type}View(${this.model.id})`}serializable_state(){return{type:this.model.type}}get is_root(){return null==this.parent}has_finished(){return this._has_finished}get is_idle(){return this.has_finished()}connect_signals(){}disconnect_signals(){o.Signal.disconnect_receiver(this)}on_change(t,e){for(const i of(0,r.isArray)(t)?t:[t])this.connect(i.change,e)}cursor(t,e){return null}notify_finished(){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()}}i.View=h,h.__name__="View";class d{constructor(t=[]){this.roots=new Set(t)}get(t){for(const e of this.roots)if(e.model==t)return e;return null}add(t){this.roots.add(t)}delete(t){this.roots.delete(t)}*[Symbol.iterator](){yield*this.roots}*query(t){function*e(i){if(t(i))yield i;else for(const t of i.children())yield*e(t)}for(const t of this.roots)yield*e(t)}*find(t){yield*this.query((e=>e.model==t))}get_one(t){const e=this.find_one(t);if(null!=e)return e;throw new Error(`cannot find a view for ${t}`)}find_one(t){for(const e of this.find(t))return e;return null}find_all(t){return[...this.find(t)]}}i.ViewManager=d,d.__name__="ViewManager"},
+function _(t,e,i,s,n){s();const o=t(15),r=t(8);class h{get ready(){return this._ready}*children(){}mark_finished(){this._has_finished=!0}connect(t,e){let i=this._slots.get(e);return null==i&&(i=(t,i)=>{const s=Promise.resolve(e.call(this,t,i));this._ready=this._ready.then((()=>s)),this.root!=this&&(this.root._ready=this.root._ready.then((()=>this._ready)))},this._slots.set(e,i)),t.connect(i,this)}disconnect(t,e){return t.disconnect(e,this)}constructor(t){this.removed=new o.Signal0(this,"removed"),this._ready=Promise.resolve(void 0),this._slots=new WeakMap,this._removed=!1,this._idle_notified=!1;const{model:e,parent:i,owner:s}=t;this.model=e,this.parent=i,null==i?(this.root=this,this.owner=null!=s?s:new d([this])):(this.root=i.root,this.owner=this.root.owner)}initialize(){this._has_finished=!1}async lazy_initialize(){}remove(){this.disconnect_signals(),this.removed.emit(),this._removed=!0}toString(){return`${this.model.type}View(${this.model.id})`}serializable_state(){return{type:this.model.type}}get is_root(){return null==this.parent}has_finished(){return this._has_finished}get is_idle(){return this.has_finished()}connect_signals(){}disconnect_signals(){o.Signal.disconnect_receiver(this)}on_change(t,e){for(const i of(0,r.isArray)(t)?t:[t])this.connect(i.change,e)}cursor(t,e){return null}notify_finished(){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()}}i.View=h,h.__name__="View";class d{constructor(t=[]){this.roots=new Set(t)}get(t){for(const e of this.roots)if(e.model==t)return e;return null}add(t){this.roots.add(t)}delete(t){this.roots.delete(t)}*[Symbol.iterator](){yield*this.roots}*query(t){function*e(i){if(t(i))yield i;else for(const t of i.children())yield*e(t)}for(const t of this.roots)yield*e(t)}*find(t){yield*this.query((e=>e.model==t))}get_one(t){const e=this.find_one(t);if(null!=e)return e;throw new Error(`cannot find a view for ${t}`)}find_one(t){for(const e of this.find(t))return e;return null}find_all(t){return[...this.find(t)]}}i.ViewManager=d,d.__name__="ViewManager"},
function _(s,e,t,i,l){i();const _=s(1),a=s(54),h=s(56),c=s(8),n=_.__importDefault(s(58));class p extends a.View{get children_el(){var s;return null!==(s=this.shadow_el)&&void 0!==s?s:this.el}initialize(){super.initialize(),this.el=this._createElement()}remove(){(0,h.remove)(this.el),super.remove()}stylesheets(){return[]}css_classes(){return[]}render_to(s){s.appendChild(this.el),this.render()}finish(){this._has_finished=!0,this.notify_finished()}_createElement(){return(0,h.createElement)(this.constructor.tag_name,{class:this.css_classes()})}}t.DOMView=p,p.__name__="DOMView",p.tag_name="div";class r extends p{initialize(){super.initialize(),this.class_list=new h.ClassList(this.el.classList)}}t.DOMElementView=r,r.__name__="DOMElementView";class d extends r{constructor(){super(...arguments),this._applied_stylesheets=[],this._applied_css_classes=[]}initialize(){super.initialize(),this.shadow_el=this.el.attachShadow({mode:"open"})}stylesheets(){return[...super.stylesheets(),n.default]}empty(){(0,h.empty)(this.shadow_el),this.class_list.clear(),this._applied_css_classes=[],this._applied_stylesheets=[]}render(){this.empty(),this._update_stylesheets(),this._update_css_classes()}*_stylesheets(){for(const s of this.stylesheets())yield(0,c.isString)(s)?new h.InlineStyleSheet(s):s}*_css_classes(){yield`bk-${this.model.type.replace(/\./g,"-")}`,yield*this.css_classes()}_apply_stylesheets(s){this._applied_stylesheets.push(...s),s.forEach((s=>s.install(this.shadow_el)))}_apply_css_classes(s){this._applied_css_classes.push(...s),this.class_list.add(...s)}_update_stylesheets(){this._applied_stylesheets.forEach((s=>s.uninstall())),this._applied_stylesheets=[],this._apply_stylesheets([...this._stylesheets()])}_update_css_classes(){this.class_list.remove(this._applied_css_classes),this._applied_css_classes=[],this._apply_css_classes([...this._css_classes()])}}t.DOMComponentView=d,d.__name__="DOMComponentView"},
function _(t,e,n,o,i){o(),n.supports_adopted_stylesheets=n.px=n.dom_ready=void 0;const s=t(8),l=t(9),r=t(57),c=t=>(e={},...n)=>{const o=document.createElement(t);(0,s.isPlainObject)(e)||(n=[e,...n],e={});for(let[t,n]of(0,l.entries)(e))if(null!=n&&(!(0,s.isBoolean)(n)||n))if("class"===t&&((0,s.isString)(n)&&(n=n.split(/\s+/)),(0,s.isArray)(n)))for(const t of n)null!=t&&o.classList.add(t);else if("style"===t&&(0,s.isPlainObject)(n))for(const[t,e]of(0,l.entries)(n))o.style[t]=e;else if("data"===t&&(0,s.isPlainObject)(n))for(const[t,e]of(0,l.entries)(n))o.dataset[t]=e;else o.setAttribute(t,n);function i(t){if((0,s.isString)(t))o.appendChild(document.createTextNode(t));else if(t instanceof Node)o.appendChild(t);else if(t instanceof NodeList||t instanceof HTMLCollection)for(const e of t)o.appendChild(e);else if(null!=t&&!1!==t)throw new Error(`expected a DOM element, string, false or null, got ${JSON.stringify(t)}`)}for(const t of n)if((0,s.isArray)(t))for(const e of t)i(e);else i(t);return o};function a(t){return document.createTextNode(t)}function d(t){const e=t.parentNode;null!=e&&e.removeChild(t)}function h(t){const e=parseFloat(t);return isFinite(e)?e:0}function u(t){const e=getComputedStyle(t);return{border:{top:h(e.borderTopWidth),bottom:h(e.borderBottomWidth),left:h(e.borderLeftWidth),right:h(e.borderRightWidth)},margin:{top:h(e.marginTop),bottom:h(e.marginBottom),left:h(e.marginLeft),right:h(e.marginRight)},padding:{top:h(e.paddingTop),bottom:h(e.paddingBottom),left:h(e.paddingLeft),right:h(e.paddingRight)}}}function f(t){const e=t.getBoundingClientRect();return{width:Math.ceil(e.width),height:Math.ceil(e.height)}}n.createElement=function(t,e,...n){return c(t)(e,...n)},n.div=c("div"),n.span=c("span"),n.canvas=c("canvas"),n.link=c("link"),n.style=c("style"),n.a=c("a"),n.p=c("p"),n.i=c("i"),n.pre=c("pre"),n.button=c("button"),n.label=c("label"),n.legend=c("legend"),n.fieldset=c("fieldset"),n.input=c("input"),n.select=c("select"),n.option=c("option"),n.optgroup=c("optgroup"),n.textarea=c("textarea"),n.createSVGElement=function(t,e=null,...n){const o=document.createElementNS("http://www.w3.org/2000/svg",t);for(const[t,n]of(0,l.entries)(null!=e?e:{}))null!=n&&!1!==n&&o.setAttribute(t,n);function i(t){if((0,s.isString)(t))o.appendChild(document.createTextNode(t));else if(t instanceof Node)o.appendChild(t);else if(t instanceof NodeList||t instanceof HTMLCollection)for(const e of t)o.appendChild(e);else if(null!=t&&!1!==t)throw new Error(`expected a DOM element, string, false or null, got ${JSON.stringify(t)}`)}for(const t of n)if((0,s.isArray)(t))for(const e of t)i(e);else i(t);return o},n.text=a,n.nbsp=function(){return a("\xa0")},n.append=function(t,...e){for(const n of e)t.appendChild(n)},n.remove=d,n.replaceWith=function(t,e){const n=t.parentNode;null!=n&&n.replaceChild(e,t)},n.prepend=function(t,...e){const n=t.firstChild;for(const o of e)t.insertBefore(o,n)},n.empty=function(t,e=!1){let n;for(;null!=(n=t.firstChild);)t.removeChild(n);if(e&&t instanceof Element)for(const e of t.attributes)t.removeAttributeNode(e)},n.contains=function(t,e){let n=e;for(;null!=n.parentNode;){const e=n.parentNode;if(e==t)return!0;n=e instanceof ShadowRoot?e.host:e}return!1},n.display=function(t,e=!0){t.style.display=e?"":"none"},n.undisplay=function(t){t.style.display="none"},n.show=function(t){t.style.visibility=""},n.hide=function(t){t.style.visibility="hidden"},n.offset_bbox=function(t){const{top:e,left:n,width:o,height:i}=t.getBoundingClientRect();return new r.BBox({left:n+scrollX-document.documentElement.clientLeft,top:e+scrollY-document.documentElement.clientTop,width:o,height:i})},n.parent=function(t,e){let n=t;for(;null!=(n=n.parentElement);)if(n.matches(e))return n;return null},n.extents=u,n.size=f,n.scroll_size=function(t){return{width:Math.ceil(t.scrollWidth),height:Math.ceil(t.scrollHeight)}},n.outer_size=function(t){const{margin:{left:e,right:n,top:o,bottom:i}}=u(t),{width:s,height:l}=f(t);return{width:Math.ceil(s+e+n),height:Math.ceil(l+o+i)}},n.content_size=function(t){var e;const{left:n,top:o}=t.getBoundingClientRect(),{padding:i}=u(t);let s=0,l=0;for(const r of(null!==(e=t.shadowRoot)&&void 0!==e?e:t).children){const t=r.getBoundingClientRect();s=Math.max(s,Math.ceil(t.left-n-i.left+t.width)),l=Math.max(l,Math.ceil(t.top-o-i.top+t.height))}return{width:s,height:l}},n.bounding_box=function(t){const{x:e,y:n,width:o,height:i}=t.getBoundingClientRect();return new r.BBox({x:e,y:n,width:o,height:i})},n.position=function(t,e,n){const{style:o}=t;if(o.left=`${e.x}px`,o.top=`${e.y}px`,o.width=`${e.width}px`,o.height=`${e.height}px`,null==n)o.margin="";else{const{top:t,right:e,bottom:i,left:s}=n;o.margin=`${t}px ${e}px ${i}px ${s}px`}};class p{constructor(t){this.class_list=t}get values(){const t=[];for(let e=0;ethis.class_list.remove(t))):this.class_list.remove(e);return this}clear(){for(const t of this.values)this.class_list.remove(t);return this}toggle(t,e){return(null!=e?e:!this.has(t))?this.add(t):this.remove(t),this}}var g;n.ClassList=p,p.__name__="ClassList",n.classes=function(t){return new p(t.classList)},n.toggle_attribute=function(t,e,n){null==n&&(n=!t.hasAttribute(e)),n?t.setAttribute(e,"true"):t.removeAttribute(e)},(g=n.MouseButton||(n.MouseButton={}))[g.None=0]="None",g[g.Primary=1]="Primary",g[g.Secondary=2]="Secondary",g[g.Auxiliary=4]="Auxiliary",g[g.Left=1]="Left",g[g.Right=2]="Right",g[g.Middle=4]="Middle";class m{install(t){t.append(this.el)}uninstall(){this.el.remove()}}n.StyleSheet=m,m.__name__="StyleSheet";class _ extends m{constructor(t){super(),this.el=(0,n.style)({type:"text/css"},t)}clear(){this.replace("")}*_to_rules(t){for(const[e,n]of(0,l.entries)(t))if(null!=n){const t=e.replace(/_/g,"-");yield`${t}: ${n};`}}_to_css(t,e){return null==e?t:`${t}{${[...this._to_rules(e)].join("")}}`}replace(t,e){this.el.textContent=this._to_css(t,e)}prepend(t,e){var n;const o=null!==(n=this.el.textContent)&&void 0!==n?n:"";this.el.textContent=`${this._to_css(t,e)}\n${o}`}append(t,e){var n;const o=null!==(n=this.el.textContent)&&void 0!==n?n:"";this.el.textContent=`${o}\n${this._to_css(t,e)}`}remove(){d(this.el)}}n.InlineStyleSheet=_,_.__name__="InlineStyleSheet";class y extends _{install(){this.el.isConnected||document.head.appendChild(this.el)}}n.GlobalInlineStyleSheet=y,y.__name__="GlobalInlineStyleSheet";class x extends m{constructor(t){super(),this.el=(0,n.link)({rel:"stylesheet",href:t})}replace(t){this.el.href=t}remove(){d(this.el)}}n.ImportedStyleSheet=x,x.__name__="ImportedStyleSheet";class b extends x{install(){this.el.isConnected||document.head.appendChild(this.el)}}n.GlobalImportedStyleSheet=b,b.__name__="GlobalImportedStyleSheet",n.dom_ready=async function(){if("loading"==document.readyState)return new Promise(((t,e)=>{document.addEventListener("DOMContentLoaded",(()=>t()),{once:!0})}))},n.px=function(t){return`${t}px`},n.supports_adopted_stylesheets="adoptedStyleSheets"in ShadowRoot.prototype},
-function _(t,e,i,r,n){r();const h=t(23),s=t(25),o=t(13),{min:x,max:y,round:u}=Math;function g(t,e){return isNaN(t)?e:isNaN(e)?t:x(t,e)}function a(t,e){return isNaN(t)?e:isNaN(e)?t:y(t,e)}i.empty=function(){return{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}},i.positive_x=function(){return{x0:Number.MIN_VALUE,y0:-1/0,x1:1/0,y1:1/0}},i.positive_y=function(){return{x0:-1/0,y0:Number.MIN_VALUE,x1:1/0,y1:1/0}},i.union=function(t,e){return{x0:g(t.x0,e.x0),x1:a(t.x1,e.x1),y0:g(t.y0,e.y0),y1:a(t.y1,e.y1)}};class c{constructor(t,e=!1){if(null==t)this.x0=0,this.y0=0,this.x1=0,this.y1=0;else if("x0"in t){const{x0:e,y0:i,x1:r,y1:n}=t;if(isFinite(e+i+r+n)){if(!(e<=r&&i<=n))throw new Error(`invalid bbox {x0: ${e}, y0: ${i}, x1: ${r}, y1: ${n}}`);this.x0=e,this.y0=i,this.x1=r,this.y1=n}else this.x0=NaN,this.y0=NaN,this.x1=NaN,this.y1=NaN}else if("x"in t){const{x:e,y:i,width:r,height:n}=t;if(!(r>=0&&n>=0))throw new Error(`invalid bbox {x: ${e}, y: ${i}, width: ${r}, height: ${n}}`);this.x0=e,this.y0=i,this.x1=e+r,this.y1=i+n}else{let i,r,n,h;if("width"in t)if("left"in t)i=t.left,r=i+t.width;else if("right"in t)r=t.right,i=r-t.width;else{const e=t.width/2;i=t.hcenter-e,r=t.hcenter+e}else i=t.left,r=t.right;if("height"in t)if("top"in t)n=t.top,h=n+t.height;else if("bottom"in t)h=t.bottom,n=h-t.height;else{const e=t.height/2;n=t.vcenter-e,h=t.vcenter+e}else n=t.top,h=t.bottom;if(i>r||n>h){if(!e)throw new Error(`invalid bbox {left: ${i}, top: ${n}, right: ${r}, bottom: ${h}}`);i>r&&(i=r),n>h&&(n=h)}this.x0=i,this.y0=n,this.x1=r,this.y1=h}}static from_lrtb({left:t,right:e,top:i,bottom:r}){return new c({x0:Math.min(t,e),y0:Math.min(i,r),x1:Math.max(t,e),y1:Math.max(i,r)})}clone(){return new c(this)}equals(t){return this.x0==t.x0&&this.y0==t.y0&&this.x1==t.x1&&this.y1==t.y1}[s.equals](t,e){return e.eq(this.x0,t.x0)&&e.eq(this.y0,t.y0)&&e.eq(this.x1,t.x1)&&e.eq(this.y1,t.y1)}toString(){return`BBox({left: ${this.left}, top: ${this.top}, width: ${this.width}, height: ${this.height}})`}get is_valid(){const{x0:t,x1:e,y0:i,y1:r}=this;return isFinite(t+e+i+r)}get is_empty(){const{x0:t,x1:e,y0:i,y1:r}=this;return 0==t&&0==e&&0==i&&0==r}get left(){return this.x0}get top(){return this.y0}get right(){return this.x1}get bottom(){return this.y1}get p0(){return{x:this.x0,y:this.y0}}get p1(){return{x:this.x1,y:this.y1}}get x(){return this.x0}get y(){return this.y0}get width(){return this.x1-this.x0}get height(){return this.y1-this.y0}get size(){return{width:this.width,height:this.height}}get rect(){const{x0:t,y0:e,x1:i,y1:r}=this;return{p0:{x:t,y:e},p1:{x:i,y:e},p2:{x:i,y:r},p3:{x:t,y:r}}}get box(){const{x:t,y:e,width:i,height:r}=this;return{x:t,y:e,width:i,height:r}}get lrtb(){const{left:t,right:e,top:i,bottom:r}=this;return{left:t,right:e,top:i,bottom:r}}get x_range(){return{start:this.x0,end:this.x1}}get y_range(){return{start:this.y0,end:this.y1}}get h_range(){return this.x_range}get v_range(){return this.y_range}get ranges(){return[this.x_range,this.y_range]}get aspect(){return this.width/this.height}get hcenter(){return(this.left+this.right)/2}get vcenter(){return(this.top+this.bottom)/2}get area(){return this.width*this.height}round(){return new c({x0:u(this.x0),x1:u(this.x1),y0:u(this.y0),y1:u(this.y1)})}relative(){const{width:t,height:e}=this;return new c({x:0,y:0,width:t,height:e})}translate(t,e){const{x:i,y:r,width:n,height:h}=this;return new c({x:t+i,y:e+r,width:n,height:h})}relativize(t,e){return[t-this.x,e-this.y]}contains(t,e){return this.x0<=t&&t<=this.x1&&this.y0<=e&&e<=this.y1}clip(t,e){return tthis.x1&&(t=this.x1),ethis.y1&&(e=this.y1),[t,e]}grow_by(t){return new c({left:this.left-t,right:this.right+t,top:this.top-t,bottom:this.bottom+t})}shrink_by(t){return new c({left:this.left+t,right:this.right-t,top:this.top+t,bottom:this.bottom-t},!0)}union(t){return new c({x0:x(this.x0,t.x0),y0:x(this.y0,t.y0),x1:y(this.x1,t.x1),y1:y(this.y1,t.y1)})}intersection(t){return this.intersects(t)?new c({x0:y(this.x0,t.x0),y0:y(this.y0,t.y0),x1:x(this.x1,t.x1),y1:x(this.y1,t.y1)}):null}intersects(t){return!(t.x1this.x1||t.y1this.y1)}get x_screen(){var t;const e=this;return null!==(t=this._x_screen)&&void 0!==t?t:this._x_screen={compute:t=>e.left+t,invert:t=>t-e.left,v_compute(t){const{left:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{left:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.x_range},get target_range(){return e.x_range}}}get y_screen(){var t;const e=this;return null!==(t=this._y_screen)&&void 0!==t?t:this._y_screen={compute:t=>e.top+t,invert:t=>t-e.top,v_compute(t){const{top:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{top:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.y_range},get target_range(){return e.y_range}}}get x_view(){var t;const e=this;return null!==(t=this._x_view)&&void 0!==t?t:this._x_view={compute:t=>e.left+t,invert:t=>t-e.left,v_compute(t){const{left:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{left:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.x_range},get target_range(){return e.x_range}}}get y_view(){var t;const e=this;return null!==(t=this._y_view)&&void 0!==t?t:this._y_view={compute:t=>e.bottom-t,invert:t=>e.bottom-t,v_compute(t){const{bottom:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i-t)))},v_invert(t){const{bottom:i}=e;return(0,o.map)(t,(t=>i-t))},get source_range(){return e.y_range},get target_range(){return{start:e.bottom,end:e.top}}}}get xview(){return this.x_view}get yview(){return this.y_view}}i.BBox=c,c.__name__="BBox"},
+function _(t,e,i,r,n){r();const h=t(23),s=t(25),o=t(13),{min:x,max:y,round:u}=Math;function g(t,e){return isNaN(t)?e:isNaN(e)?t:x(t,e)}function a(t,e){return isNaN(t)?e:isNaN(e)?t:y(t,e)}i.empty=function(){return{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}},i.positive_x=function(){return{x0:Number.MIN_VALUE,y0:-1/0,x1:1/0,y1:1/0}},i.positive_y=function(){return{x0:-1/0,y0:Number.MIN_VALUE,x1:1/0,y1:1/0}},i.union=function(t,e){return{x0:g(t.x0,e.x0),x1:a(t.x1,e.x1),y0:g(t.y0,e.y0),y1:a(t.y1,e.y1)}};class c{constructor(t,e=!1){if(null==t)this.x0=0,this.y0=0,this.x1=0,this.y1=0;else if("x0"in t){const{x0:e,y0:i,x1:r,y1:n}=t;if(isFinite(e+i+r+n)){if(!(e<=r&&i<=n))throw new Error(`invalid bbox {x0: ${e}, y0: ${i}, x1: ${r}, y1: ${n}}`);this.x0=e,this.y0=i,this.x1=r,this.y1=n}else this.x0=NaN,this.y0=NaN,this.x1=NaN,this.y1=NaN}else if("x"in t){const{x:e,y:i,width:r,height:n}=t;if(!(r>=0&&n>=0))throw new Error(`invalid bbox {x: ${e}, y: ${i}, width: ${r}, height: ${n}}`);this.x0=e,this.y0=i,this.x1=e+r,this.y1=i+n}else{let i,r,n,h;if("width"in t)if("left"in t)i=t.left,r=i+t.width;else if("right"in t)r=t.right,i=r-t.width;else{const e=t.width/2;i=t.hcenter-e,r=t.hcenter+e}else i=t.left,r=t.right;if("height"in t)if("top"in t)n=t.top,h=n+t.height;else if("bottom"in t)h=t.bottom,n=h-t.height;else{const e=t.height/2;n=t.vcenter-e,h=t.vcenter+e}else n=t.top,h=t.bottom;if(i>r||n>h){if(!e)throw new Error(`invalid bbox {left: ${i}, top: ${n}, right: ${r}, bottom: ${h}}`);i>r&&(i=r),n>h&&(n=h)}this.x0=i,this.y0=n,this.x1=r,this.y1=h}}static from_lrtb({left:t,right:e,top:i,bottom:r}){return new c({x0:Math.min(t,e),y0:Math.min(i,r),x1:Math.max(t,e),y1:Math.max(i,r)})}clone(){return new c(this)}equals(t){return this.x0==t.x0&&this.y0==t.y0&&this.x1==t.x1&&this.y1==t.y1}[s.equals](t,e){return e.eq(this.x0,t.x0)&&e.eq(this.y0,t.y0)&&e.eq(this.x1,t.x1)&&e.eq(this.y1,t.y1)}toString(){return`BBox({left: ${this.left}, top: ${this.top}, width: ${this.width}, height: ${this.height}})`}get is_valid(){const{x0:t,x1:e,y0:i,y1:r}=this;return isFinite(t+e+i+r)}get is_empty(){const{x0:t,x1:e,y0:i,y1:r}=this;return 0==t&&0==e&&0==i&&0==r}get left(){return this.x0}get top(){return this.y0}get right(){return this.x1}get bottom(){return this.y1}get p0(){return{x:this.x0,y:this.y0}}get p1(){return{x:this.x1,y:this.y1}}get x(){return this.x0}get y(){return this.y0}get width(){return this.x1-this.x0}get height(){return this.y1-this.y0}get size(){return{width:this.width,height:this.height}}get rect(){const{x0:t,y0:e,x1:i,y1:r}=this;return{p0:{x:t,y:e},p1:{x:i,y:e},p2:{x:i,y:r},p3:{x:t,y:r}}}get box(){const{x:t,y:e,width:i,height:r}=this;return{x:t,y:e,width:i,height:r}}get lrtb(){const{left:t,right:e,top:i,bottom:r}=this;return{left:t,right:e,top:i,bottom:r}}get x_range(){return{start:this.x0,end:this.x1}}get y_range(){return{start:this.y0,end:this.y1}}get h_range(){return this.x_range}get v_range(){return this.y_range}get ranges(){return[this.x_range,this.y_range]}get aspect(){return this.width/this.height}get hcenter(){return(this.left+this.right)/2}get vcenter(){return(this.top+this.bottom)/2}get area(){return this.width*this.height}round(){return new c({x0:u(this.x0),x1:u(this.x1),y0:u(this.y0),y1:u(this.y1)})}relative(){const{width:t,height:e}=this;return new c({x:0,y:0,width:t,height:e})}translate(t,e){const{x:i,y:r,width:n,height:h}=this;return new c({x:t+i,y:e+r,width:n,height:h})}scale(t){return new c({x0:this.x0*t,x1:this.x1*t,y0:this.y0*t,y1:this.y1*t})}relativize(t,e){return[t-this.x,e-this.y]}contains(t,e){return this.x0<=t&&t<=this.x1&&this.y0<=e&&e<=this.y1}clip(t,e){return tthis.x1&&(t=this.x1),ethis.y1&&(e=this.y1),[t,e]}grow_by(t){return new c({left:this.left-t,right:this.right+t,top:this.top-t,bottom:this.bottom+t})}shrink_by(t){return new c({left:this.left+t,right:this.right-t,top:this.top+t,bottom:this.bottom-t},!0)}union(t){return new c({x0:x(this.x0,t.x0),y0:x(this.y0,t.y0),x1:y(this.x1,t.x1),y1:y(this.y1,t.y1)})}intersection(t){return this.intersects(t)?new c({x0:y(this.x0,t.x0),y0:y(this.y0,t.y0),x1:x(this.x1,t.x1),y1:x(this.y1,t.y1)}):null}intersects(t){return!(t.x1this.x1||t.y1this.y1)}get x_screen(){var t;const e=this;return null!==(t=this._x_screen)&&void 0!==t?t:this._x_screen={compute:t=>e.left+t,invert:t=>t-e.left,v_compute(t){const{left:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{left:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.x_range},get target_range(){return e.x_range}}}get y_screen(){var t;const e=this;return null!==(t=this._y_screen)&&void 0!==t?t:this._y_screen={compute:t=>e.top+t,invert:t=>t-e.top,v_compute(t){const{top:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{top:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.y_range},get target_range(){return e.y_range}}}get x_view(){var t;const e=this;return null!==(t=this._x_view)&&void 0!==t?t:this._x_view={compute:t=>e.left+t,invert:t=>t-e.left,v_compute(t){const{left:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{left:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.x_range},get target_range(){return e.x_range}}}get y_view(){var t;const e=this;return null!==(t=this._y_view)&&void 0!==t?t:this._y_view={compute:t=>e.bottom-t,invert:t=>e.bottom-t,v_compute(t){const{bottom:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i-t)))},v_invert(t){const{bottom:i}=e;return(0,o.map)(t,(t=>i-t))},get source_range(){return e.y_range},get target_range(){return{start:e.bottom,end:e.top}}}}get xview(){return this.x_view}get yview(){return this.y_view}}i.BBox=c,c.__name__="BBox"},
function _(o,e,i,n,t){n(),i.default=":host{--base-font:var(--bokeh-base-font, Helvetica, Arial, sans-serif);--mono-font:var(--bokeh-mono-font, monospace);--font-size:12px;--line-height:calc(20 / 14);--line-height-computed:calc(var(--font-size) * var(--line-height));--border-radius:4px;--padding-vertical:6px;--padding-horizontal:12px;}:host{box-sizing:border-box;font-family:var(--base-font);font-size:13px;line-height:var(--line-height);}*,*:before,*:after{box-sizing:inherit;font-family:inherit;}pre,code{font-family:var(--mono-font);margin:0;}"},
function _(e,n,t,o,s){o();const i=e(10),c=e(12);async function a(e,n,t){(0,c.assert)(null!=e,"model doesn't implement a view");const o=new e(Object.assign(Object.assign({},t),{model:n}));return o.initialize(),await o.lazy_initialize(),o}t.build_view=async function(e,n={parent:null},t=(e=>e.default_view)){const o=await a(t(e),e,n);return o.connect_signals(),o},t.build_views=async function(e,n,t={parent:null},o=(e=>e.default_view)){const s=(0,i.difference)([...e.keys()],n),c=[];for(const n of s){const t=e.get(n);null!=t&&(e.delete(n),c.push(t),t.remove())}const l=[],r=n.filter((n=>!e.has(n)));for(const n of r){const s=await a(o(n),n,t);e.set(n,s),l.push(s)}for(const e of l)e.connect_signals();return{created:l,removed:c}},t.remove_views=function(e){for(const[n,t]of e)t.remove(),e.delete(n)}},
function _(n,t,o,e,s){e();const a=n(61),c=n(18),r=n(53);o._get_ws_url=function(n,t){let o,e="ws:";return"https:"==window.location.protocol&&(e="wss:"),null!=t?(o=document.createElement("a"),o.href=t):o=window.location,null!=n?"/"==n&&(n=""):n=o.pathname.replace(/\/+$/,""),`${e}//${o.host}${n}/ws`};const i=new Map;o.add_document_from_session=async function(n,t,o,e=[],s=!1){const l=window.location.search.substring(1);let d;try{d=await function(n,t,o){const e=(0,a.parse_token)(t).session_id;i.has(n)||i.set(n,new Map);const s=i.get(n);return s.has(e)||s.set(e,(0,a.pull_session)(n,t,o)),s.get(e)}(n,t,l)}catch(n){const o=(0,a.parse_token)(t).session_id;throw c.logger.error(`Failed to load Bokeh session ${o}: ${n}`),n}return(0,r.add_document_standalone)(d.document,o,e,s)}},
function _(e,s,n,t,o){t();const r=e(18),i=e(5),l=e(62),c=e(63),_=e(64);n.DEFAULT_SERVER_WEBSOCKET_URL="ws://localhost:5006/ws",n.DEFAULT_TOKEN="eyJzZXNzaW9uX2lkIjogImRlZmF1bHQifQ";let h=0;function a(e){let s=e.split(".")[0];const n=s.length%4;return 0!=n&&(s+="=".repeat(4-n)),JSON.parse(atob(s.replace(/_/g,"/").replace(/-/g,"+")))}n.parse_token=a;class d{constructor(e=n.DEFAULT_SERVER_WEBSOCKET_URL,s=n.DEFAULT_TOKEN,t=null){this._number=h++,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 c.Receiver,this.url=e,this.token=s,this.args_string=t,this.id=a(s).session_id.split(".")[0],r.logger.debug(`Creating websocket ${this._number} to '${this.url}' session '${this.id}'`)}async connect(){if(this.closed_permanently)throw new Error("Cannot connect() a closed ClientConnection");if(null!=this.socket)throw new Error("Already connected");this._current_handler=null,this._pending_replies.clear(),this._pending_messages=[];try{let e=`${this.url}`;return null!=this.args_string&&this.args_string.length>0&&(e+=`?${this.args_string}`),this.socket=new WebSocket(e,["bokeh",this.token]),new Promise(((e,s)=>{this.socket.binaryType="arraybuffer",this.socket.onopen=()=>this._on_open(e,s),this.socket.onmessage=e=>this._on_message(e),this.socket.onclose=e=>this._on_close(e,s),this.socket.onerror=()=>this._on_error(s)}))}catch(e){throw r.logger.error(`websocket creation failed to url: ${this.url}`),r.logger.error(` - ${e}`),e}}close(){this.closed_permanently||(r.logger.debug(`Permanently closing websocket connection ${this._number}`),this.closed_permanently=!0,null!=this.socket&&this.socket.close(1e3,`close method called on ClientConnection ${this._number}`),this.session._connection_closed())}_schedule_reconnect(e){setTimeout((()=>{var e;this.closed_permanently||(r.logger.info(`Websocket connection ${this._number} disconnected, will not attempt to reconnect`),null===(e=this.session)||void 0===e||e.notify_connection_lost())}),e)}send(e){null!=this.socket?e.send(this.socket):r.logger.error("not connected so cannot send",e)}async send_with_reply(e){const s=await new Promise(((s,n)=>{this._pending_replies.set(e.msgid(),{resolve:s,reject:n}),this.send(e)}));if("ERROR"==s.msgtype())throw new Error(`Error reply ${s.content.text}`);return s}async _pull_doc_json(){const e=l.Message.create("PULL-DOC-REQ",{},{}),s=await this.send_with_reply(e);if(!("doc"in s.content))throw new Error("No 'doc' field in PULL-DOC-REPLY");return s.content.doc}async _repull_session_doc(e,s){r.logger.debug(null!=this.session?"Repulling session":"Pulling session for first time");try{const n=await this._pull_doc_json();if(null==this.session)if(this.closed_permanently)r.logger.debug("Got new document after connection was already closed"),s(new Error("The connection has been closed"));else{const s=[],t=i.Document.from_json(n,s);this.session=new _.ClientSession(this,t);for(const e of s)t._trigger_on_change(e);for(const e of this._pending_messages)this.session.handle(e);this._pending_messages=[],r.logger.debug("Created a new session from new pulled doc"),e(this.session)}else this.session.document.replace_with_json(n),r.logger.debug("Updated existing session with new pulled doc")}catch(e){console.trace(e),r.logger.error(`Failed to repull session ${e}`),s(e instanceof Error?e:`${e}`)}}_on_open(e,s){r.logger.info(`Websocket connection ${this._number} is now open`),this._current_handler=n=>{this._awaiting_ack_handler(n,e,s)}}_on_message(e){null==this._current_handler&&r.logger.error("Got a message with no current handler set");try{this._receiver.consume(e.data)}catch(e){this._close_bad_protocol(`${e}`)}const s=this._receiver.message;if(null!=s){const e=s.problem();null!=e&&this._close_bad_protocol(e),this._current_handler(s)}}_on_close(e,s){r.logger.info(`Lost websocket ${this._number} connection, ${e.code} (${e.reason})`),this.socket=null,this._pending_replies.forEach((e=>e.reject("Disconnected"))),this._pending_replies.clear(),this.closed_permanently||this._schedule_reconnect(2e3),s(new Error(`Lost websocket connection, ${e.code} (${e.reason})`))}_on_error(e){r.logger.debug(`Websocket error on socket ${this._number}`);const s="Could not open websocket";r.logger.error(`Failed to connect to Bokeh server: ${s}`),e(new Error(s))}_close_bad_protocol(e){r.logger.error(`Closing connection: ${e}`),null!=this.socket&&this.socket.close(1002,e)}_awaiting_ack_handler(e,s,n){"ACK"===e.msgtype()?(this._current_handler=e=>this._steady_state_handler(e),this._repull_session_doc(s,n)):this._close_bad_protocol("First message was not an ACK")}_steady_state_handler(e){const s=e.reqid(),n=this._pending_replies.get(s);null!=n?(this._pending_replies.delete(s),n.resolve(e)):null!=this.session?this.session.handle(e):"PATCH-DOC"!=e.msgtype()&&this._pending_messages.push(e)}}n.ClientConnection=d,d.__name__="ClientConnection",n.pull_session=function(e,s,n){return new d(e,s,n).connect()}},
-function _(e,s,t,r,n){r();const i=e(30),a=e(38),h=e(12);class f{get buffers(){return this._buffers}constructor(e,s,t){this._buffers=new Map,this.header=e,this.metadata=s,this.content=t}static assemble(e,s,t){const r=JSON.parse(e),n=JSON.parse(s),i=JSON.parse(t);return new f(r,n,i)}assemble_buffer(e,s){var t;const r=null!==(t=this.header.num_buffers)&&void 0!==t?t:0;if(r<=this._buffers.size)throw new Error(`too many buffers received, expecting ${r}`);const{id:n}=JSON.parse(e);this._buffers.set(n,s)}static create(e,s,t){const r=f.create_header(e);return new f(r,s,t)}static create_header(e){return{msgid:(0,a.unique_id)(),msgtype:e}}complete(){const{num_buffers:e}=this.header;return null==e||this._buffers.size==e}send(e){(0,h.assert)(null==this.header.num_buffers);const s=[],t=JSON.stringify(this.content,((e,t)=>{if(t instanceof i.Buffer){const e={id:`${s.length}`};return s.push([e,t.buffer]),e}return t})),r=s.length;r>0&&(this.header.num_buffers=r);const n=JSON.stringify(this.header),a=JSON.stringify(this.metadata);e.send(n),e.send(a),e.send(t);for(const[t,r]of s)e.send(JSON.stringify(t)),e.send(r)}msgid(){return this.header.msgid}msgtype(){return this.header.msgtype}reqid(){return this.header.reqid}problem(){return"msgid"in this.header?"msgtype"in this.header?null:"No msgtype in header":"No msgid in header"}}t.Message=f,f.__name__="Message"},
+function _(e,s,t,r,n){r();const i=e(31),a=e(39),h=e(12);class f{get buffers(){return this._buffers}constructor(e,s,t){this._buffers=new Map,this.header=e,this.metadata=s,this.content=t}static assemble(e,s,t){const r=JSON.parse(e),n=JSON.parse(s),i=JSON.parse(t);return new f(r,n,i)}assemble_buffer(e,s){var t;const r=null!==(t=this.header.num_buffers)&&void 0!==t?t:0;if(r<=this._buffers.size)throw new Error(`too many buffers received, expecting ${r}`);const{id:n}=JSON.parse(e);this._buffers.set(n,s)}static create(e,s,t){const r=f.create_header(e);return new f(r,s,t)}static create_header(e){return{msgid:(0,a.unique_id)(),msgtype:e}}complete(){const{num_buffers:e}=this.header;return null==e||this._buffers.size==e}send(e){(0,h.assert)(null==this.header.num_buffers);const s=[],t=JSON.stringify(this.content,((e,t)=>{if(t instanceof i.Buffer){const e={id:`${s.length}`};return s.push([e,t.buffer]),e}return t})),r=s.length;r>0&&(this.header.num_buffers=r);const n=JSON.stringify(this.header),a=JSON.stringify(this.metadata);e.send(n),e.send(a),e.send(t);for(const[t,r]of s)e.send(JSON.stringify(t)),e.send(r)}msgid(){return this.header.msgid}msgtype(){return this.header.msgtype}reqid(){return this.header.reqid}problem(){return"msgid"in this.header?"msgtype"in this.header?null:"No msgtype in header":"No msgid in header"}}t.Message=f,f.__name__="Message"},
function _(t,e,s,_,r){_();const i=t(62),h=t(8),a=t(12);class n{constructor(){this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}consume(t){this._current_consumer(t)}_HEADER(t){this._assume_text(t),this.message=null,this._partial=null,this._fragments=[t],this._buf_header=null,this._current_consumer=this._METADATA}_METADATA(t){this._assume_text(t),this._fragments.push(t),this._current_consumer=this._CONTENT}_CONTENT(t){this._assume_text(t),this._fragments.push(t);const[e,s,_]=this._fragments;(0,a.assert)(null!=e&&null!=s&&null!=_),this._partial=i.Message.assemble(e,s,_),this._check_complete()}_BUFFER_HEADER(t){this._assume_text(t),this._buf_header=t,this._current_consumer=this._BUFFER_PAYLOAD}_BUFFER_PAYLOAD(t){this._assume_binary(t),(0,a.assert)(null!=this._partial&&null!=this._buf_header),this._partial.assemble_buffer(this._buf_header,t),this._check_complete()}_assume_text(t){if(!(0,h.isString)(t))throw new Error("Expected text fragment but received binary fragment")}_assume_binary(t){if(!(t instanceof ArrayBuffer))throw new Error("Expected binary fragment but received text fragment")}_check_complete(){this._partial.complete()?(this.message=this._partial,this._current_consumer=this._HEADER):this._current_consumer=this._BUFFER_HEADER}}s.Receiver=n,n.__name__="Receiver"},
function _(e,n,t,o,s){o();const c=e(5),_=e(52),i=e(62),r=e(18);class a{constructor(e,n){this._document_listener=e=>{this._document_changed(e)},this._connection=e,this.document=n,this.document.on_change(this._document_listener,!0)}get id(){return this._connection.id}handle(e){const n=e.msgtype();switch(n){case"PATCH-DOC":this._handle_patch(e);break;case"OK":this._handle_ok(e);break;case"ERROR":this._handle_error(e);break;default:r.logger.debug(`Doing nothing with message '${n}'`)}}notify_connection_lost(){this.document.event_manager.send_event(new _.ConnectionLost)}close(){this._connection.close()}_connection_closed(){this.document.remove_on_change(this._document_listener)}async request_server_info(){const e=i.Message.create("SERVER-INFO-REQ",{},{});return(await this._connection.send_with_reply(e)).content}async force_roundtrip(){await this.request_server_info()}_document_changed(e){const n=e instanceof c.DocumentEventBatch?e.events:[e],t=this.document.create_json_patch(n),o=i.Message.create("PATCH-DOC",{},t);this._connection.send(o)}_handle_patch(e){this.document.apply_json_patch(e.content,e.buffers)}_handle_ok(e){r.logger.trace(`Unhandled OK reply to ${e.reqid()}`)}_handle_error(e){r.logger.error(`Unhandled ERROR reply to ${e.reqid()}: ${e.content.text}`)}}t.ClientSession=a,a.__name__="ClientSession"},
function _(n,e,o,t,r){t();const i=n(56),l=n(8);function s(n){let e=(0,l.isString)(n)?document.getElementById(n):n;if(null==e)throw new Error(`Error rendering Bokeh model: could not find ${(0,l.isString)(n)?`#${n}`:n} HTML tag`);if(!(0,i.contains)(document.body,e))throw new Error(`Error rendering Bokeh model: element ${(0,l.isString)(n)?`#${n}`:n} must be under `);if(e instanceof HTMLElement&&"SCRIPT"==e.tagName){const n=(0,i.div)();(0,i.replaceWith)(e,n),e=n}return e}o._resolve_element=function(n){const{elementid:e}=n;return null!=e?s(e):document.body},o._resolve_root_elements=function(n){const e=[];if(null!=n.root_ids&&null!=n.roots)for(const o of n.root_ids)e.push(s(n.roots[o]));return e}},
@@ -1034,7 +1034,7 @@ Plots#
function _(n,c,o,s,e){s();const t=n(85);class u extends t.Scale{constructor(n){super(n)}}o.ContinuousScale=u,u.__name__="ContinuousScale"},
function _(t,e,s,a,r){a();const o=t(90);class n extends o.ContinuousScale{constructor(t){super(t)}get s_compute(){const[t,e,s,a]=this._compute_state();return r=>{if(0==s)return 0;{const o=(Math.log(r)-a)/s;return isFinite(o)?o*t+e:NaN}}}get s_invert(){const[t,e,s,a]=this._compute_state();return r=>{const o=(r-e)/t;return Math.exp(s*o+a)}}_get_safe_factor(t,e){let s=t<0?0:t,a=e<0?0:e;if(s==a)if(0==s)[s,a]=[1,10];else{const t=Math.log10(s);s=10**Math.floor(t),a=Math.ceil(t)!=Math.floor(t)?10**Math.ceil(t):10**(Math.ceil(t)+1)}return[s,a]}_compute_state(){const t=this.source_range.start,e=this.source_range.end,s=this.target_range.start,a=this.target_range.end-s,[r,o]=this._get_safe_factor(t,e);let n,c;0==r?(n=Math.log(o),c=0):(n=Math.log(o/r),c=Math.log(r));return[a,s,n,c]}}s.LogScale=n,n.__name__="LogScale"},
function _(t,e,c,a,s){a();const n=t(85),r=t(89),{_linear_compute_state:o}=r.LinearScale.prototype;class l extends n.Scale{constructor(t){super(t)}get s_compute(){const[t,e]=o.call(this),c=this.source_range;return a=>t*c.synthetic(a)+e}get s_invert(){const[t,e]=o.call(this);return c=>(c-e)/t}}c.CategoricalScale=l,l.__name__="CategoricalScale"},
-function _(t,i,n,e,a){var s;e();const l=t(1),_=t(94),o=t(19),r=t(32),d=t(18),h=l.__importStar(t(57)),u=t(95);n.auto_ranged=Symbol("auto_ranged"),n.is_auto_ranged=function(t){return n.auto_ranged in t};class g extends _.DataRange{constructor(t){super(t),this.have_updated_interactively=!1}initialize(){super.initialize(),this._initial_start=isNaN(this.start)?null:this.start,this._initial_end=isNaN(this.end)?null: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}get min(){return Math.min(this.start,this.end)}get max(){return Math.max(this.start,this.end)}computed_renderers(){const{renderers:t}=this,i=(0,r.flat_map)(this.plots,(t=>t.auto_ranged_renderers.map((t=>t.model))));return(0,u.compute_renderers)(0==t.length?"auto":t,[...i])}_compute_plot_bounds(t,i){let n=h.empty();for(const e of t){const t=i.get(e);null==t||!e.visible&&this.only_visible||(n=h.union(n,t))}return n}adjust_bounds_for_aspect(t,i){const n=h.empty();let e=t.x1-t.x0;e<=0&&(e=1);let a=t.y1-t.y0;a<=0&&(a=1);const s=.5*(t.x1+t.x0),l=.5*(t.y1+t.y0);return el&&("start"==this.follow?a=e+s*l:"end"==this.follow&&(e=a-s*l)),[e,a]}update(t,i,n,e){if(this.have_updated_interactively)return;const a=this.computed_renderers();let s=this._compute_plot_bounds(a,t);null!=e&&(s=this.adjust_bounds_for_aspect(s,e)),this._plot_bounds.set(n,s);const[l,_]=this._compute_min_max(this._plot_bounds.entries(),i);let[o,r]=this._compute_range(l,_);null!=this._initial_start&&("log"==this.scale_hint?this._initial_start>0&&(o=this._initial_start):o=this._initial_start),null!=this._initial_end&&("log"==this.scale_hint?this._initial_end>0&&(r=this._initial_end):r=this._initial_end);let d=!1;"auto"==this.bounds&&(this.setv({bounds:[o,r]},{silent:!0}),d=!0);const[h,u]=[this.start,this.end];if(o!=h||r!=u){const t={};o!=h&&(t.start=o),r!=u&&(t.end=r),this.setv(t),d=!1}d&&this.change.emit()}reset(){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.DataRange1d=g,s=g,g.__name__="DataRange1d",s.define((({Boolean:t,Number:i,Nullable:n})=>({start:[i,NaN],end:[i,NaN],range_padding:[i,.1],range_padding_units:[o.PaddingUnits,"percent"],flipped:[t,!1],follow:[n(o.StartEnd),null],follow_interval:[n(i),null],default_span:[i,2],only_visible:[t,!1]}))),s.internal((({Enum:t})=>({scale_hint:[t("log","auto"),"auto"]})))},
+function _(t,i,n,e,a){var s;e();const l=t(1),_=t(94),o=t(19),r=t(33),d=t(18),h=l.__importStar(t(57)),u=t(95);n.auto_ranged=Symbol("auto_ranged"),n.is_auto_ranged=function(t){return n.auto_ranged in t};class g extends _.DataRange{constructor(t){super(t),this.have_updated_interactively=!1}initialize(){super.initialize(),this._initial_start=isNaN(this.start)?null:this.start,this._initial_end=isNaN(this.end)?null: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}get min(){return Math.min(this.start,this.end)}get max(){return Math.max(this.start,this.end)}computed_renderers(){const{renderers:t}=this,i=(0,r.flat_map)(this.plots,(t=>t.auto_ranged_renderers.map((t=>t.model))));return(0,u.compute_renderers)(0==t.length?"auto":t,[...i])}_compute_plot_bounds(t,i){let n=h.empty();for(const e of t){const t=i.get(e);null==t||!e.visible&&this.only_visible||(n=h.union(n,t))}return n}adjust_bounds_for_aspect(t,i){const n=h.empty();let e=t.x1-t.x0;e<=0&&(e=1);let a=t.y1-t.y0;a<=0&&(a=1);const s=.5*(t.x1+t.x0),l=.5*(t.y1+t.y0);return el&&("start"==this.follow?a=e+s*l:"end"==this.follow&&(e=a-s*l)),[e,a]}update(t,i,n,e){if(this.have_updated_interactively)return;const a=this.computed_renderers();let s=this._compute_plot_bounds(a,t);null!=e&&(s=this.adjust_bounds_for_aspect(s,e)),this._plot_bounds.set(n,s);const[l,_]=this._compute_min_max(this._plot_bounds.entries(),i);let[o,r]=this._compute_range(l,_);null!=this._initial_start&&("log"==this.scale_hint?this._initial_start>0&&(o=this._initial_start):o=this._initial_start),null!=this._initial_end&&("log"==this.scale_hint?this._initial_end>0&&(r=this._initial_end):r=this._initial_end);let d=!1;"auto"==this.bounds&&(this.setv({bounds:[o,r]},{silent:!0}),d=!0);const[h,u]=[this.start,this.end];if(o!=h||r!=u){const t={};o!=h&&(t.start=o),r!=u&&(t.end=r),this.setv(t),d=!1}d&&this.change.emit()}reset(){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.DataRange1d=g,s=g,g.__name__="DataRange1d",s.define((({Boolean:t,Number:i,Nullable:n})=>({start:[i,NaN],end:[i,NaN],range_padding:[i,.1],range_padding_units:[o.PaddingUnits,"percent"],flipped:[t,!1],follow:[n(o.StartEnd),null],follow_interval:[n(i),null],default_span:[i,2],only_visible:[t,!1]}))),s.internal((({Enum:t})=>({scale_hint:[t("log","auto"),"auto"]})))},
function _(e,n,a,r,t){var s;r();const c=e(87);class o extends c.Range{constructor(e){super(e)}}a.DataRange=o,s=o,o.__name__="DataRange",s.define((({Array:e,AnyRef:n,Or:a,Auto:r})=>({renderers:[a(e(n()),r),[]]})))},
function _(n,u,e,r,t){r(),e.compute_renderers=function(n,u){return"auto"==n?u:null!=n?n:[]}},
function _(t,n,e,i,s){var r;i();const a=t(1),o=t(87),g=t(19),p=a.__importStar(t(17)),c=t(20),l=t(23),u=t(10),h=t(8),d=t(12);function _(t,n,e=0){const i=new Map;for(let s=0;sa.get(t).value)));r.set(t,{value:c/s,mapping:a}),o+=s+n+p}return[r,(a.size-1)*n+g]}function m(t,n,e,i,s=0){var r;const a=new Map,o=new Map;for(const[n,e,i]of t){const t=null!==(r=o.get(n))&&void 0!==r?r:[];o.set(n,[...t,[e,i]])}let g=s,p=0;for(const[t,s]of o){const r=s.length,[o,c]=f(s,e,i,g);p+=c;const l=(0,u.sum)(s.map((([t])=>o.get(t).value)));a.set(t,{value:l/r,mapping:o}),g+=r+n+c}return[a,(o.size-1)*n+p]}e.Factor=(0,c.Or)(c.String,(0,c.Tuple)(c.String,c.String),(0,c.Tuple)(c.String,c.String,c.String)),e.FactorSeq=(0,c.Or)((0,c.Array)(c.String),(0,c.Array)((0,c.Tuple)(c.String,c.String)),(0,c.Array)((0,c.Tuple)(c.String,c.String,c.String))),e.map_one_level=_,e.map_two_levels=f,e.map_three_levels=m;class v extends o.Range{constructor(t){super(t)}get min(){return this.start}get max(){return this.end}initialize(){super.initialize(),this._init(!0)}connect_signals(){super.connect_signals(),this.connect(this.properties.factors.change,(()=>this.reset())),this.connect(this.properties.factor_padding.change,(()=>this.reset())),this.connect(this.properties.group_padding.change,(()=>this.reset())),this.connect(this.properties.subgroup_padding.change,(()=>this.reset())),this.connect(this.properties.range_padding.change,(()=>this.reset())),this.connect(this.properties.range_padding_units.change,(()=>this.reset()))}reset(){this._init(!1),this.change.emit()}_lookup(t){switch(t.length){case 1:{const[n]=t,e=this._mapping.get(n);return null!=e?e.value:NaN}case 2:{const[n,e]=t,i=this._mapping.get(n);if(null!=i){const t=i.mapping.get(e);if(null!=t)return t.value}return NaN}case 3:{const[n,e,i]=t,s=this._mapping.get(n);if(null!=s){const t=s.mapping.get(e);if(null!=t){const n=t.mapping.get(i);if(null!=n)return n.value}}return NaN}default:(0,d.unreachable)()}}synthetic(t){if((0,h.isNumber)(t))return t;if((0,h.isString)(t))return this._lookup([t]);let n=0;const e=t[t.length-1];return(0,h.isNumber)(e)&&(n=e,t=t.slice(0,-1)),this._lookup(t)+n}v_synthetic(t){const n=t.length,e=new l.ScreenArray(n);for(let i=0;i{if((0,u.every)(this.factors,h.isString)){const t=this.factors,[n,e]=_(t,this.factor_padding);return{levels:1,mapping:n,tops:null,mids:null,inside_padding:e}}if((0,u.every)(this.factors,(t=>(0,h.isArray)(t)&&2==t.length&&(0,h.isString)(t[0])&&(0,h.isString)(t[1])))){const t=this.factors,[n,e]=f(t,this.group_padding,this.factor_padding),i=[...n.keys()];return{levels:2,mapping:n,tops:i,mids:null,inside_padding:e}}if((0,u.every)(this.factors,(t=>(0,h.isArray)(t)&&3==t.length&&(0,h.isString)(t[0])&&(0,h.isString)(t[1])&&(0,h.isString)(t[2])))){const t=this.factors,[n,e]=m(t,this.group_padding,this.subgroup_padding,this.factor_padding),i=[...n.keys()],s=[];for(const[t,e]of n)for(const n of e.mapping.keys())s.push([t,n]);return{levels:3,mapping:n,tops:i,mids:s,inside_padding:e}}(0,d.unreachable)()})();this._mapping=e,this.tops=i,this.mids=s;let a=0,o=this.factors.length+r;if("percent"==this.range_padding_units){const t=(o-a)*this.range_padding/2;a-=t,o+=t}else a-=this.range_padding,o+=this.range_padding;this.setv({start:a,end:o,levels:n},{silent:t}),"auto"==this.bounds&&this.setv({bounds:[a,o]},{silent:!0})}}e.FactorRange=v,r=v,v.__name__="FactorRange",r.define((({Number:t})=>({factors:[e.FactorSeq,[]],factor_padding:[t,0],subgroup_padding:[t,.8],group_padding:[t,1.4],range_padding:[t,0],range_padding_units:[g.PaddingUnits,"percent"],start:[t,p.unset,{readonly:!0}],end:[t,p.unset,{readonly:!0}]}))),r.internal((({Number:t,String:n,Array:e,Tuple:i,Nullable:s})=>({levels:[t],mids:[s(e(i(n,n))),null],tops:[s(e(n)),null]})))},
@@ -1090,7 +1090,7 @@ Plots#
function _(i,t,h,e,s){e();const n=i(145),g=i(57),r=i(8),_=i(12),{abs:l,min:o,max:d,round:a}=Math;class u{constructor(){this.absolute=!1,this.position={left:0,top:0},this._bbox=new g.BBox,this._inner_bbox=new g.BBox,this._sizing=null,this._dirty=!1,this._handlers=[]}*[Symbol.iterator](){}get bbox(){return this._bbox}get inner_bbox(){return this._inner_bbox}get sizing(){return(0,_.assert)(null!=this._sizing),this._sizing}set dirty(i){this._dirty=i}get dirty(){return this._dirty}get visible(){return this.sizing.visible}set visible(i){this.sizing.visible!=i&&(this.sizing.visible=i,this._dirty=!0)}set_sizing(i={}){var t,h,e,s,n,g;const r=null!==(t=i.width_policy)&&void 0!==t?t:"fit",_=i.width,l=i.min_width,o=i.max_width,d=null!==(h=i.height_policy)&&void 0!==h?h:"fit",a=i.height,u=i.min_height,c=i.max_height,w=i.aspect,b=null!==(e=i.margin)&&void 0!==e?e:{top:0,right:0,bottom:0,left:0},x=null===(s=i.visible)||void 0===s||s,m=null!==(n=i.halign)&&void 0!==n?n:"start",z=null!==(g=i.valign)&&void 0!==g?g:"start";this._sizing={width_policy:r,min_width:l,width:_,max_width:o,height_policy:d,min_height:u,height:a,max_height:c,aspect:w,margin:b,visible:x,halign:m,valign:z,size:{width:_,height:a}},this._init()}_init(){}_set_geometry(i,t){this._bbox=i,this._inner_bbox=t}set_geometry(i,t){const{fixup_geometry:h}=this;null!=h&&([i,t]=h(i,t)),this._set_geometry(i,null!=t?t:i);for(const i of this._handlers)i(this._bbox,this._inner_bbox)}on_resize(i){this._handlers.push(i)}is_width_expanding(){return"max"==this.sizing.width_policy}is_height_expanding(){return"max"==this.sizing.height_policy}apply_aspect(i,{width:t,height:h}){const{aspect:e}=this.sizing;if(null!=e){const{width_policy:s,height_policy:n}=this.sizing,g=(i,t)=>{const h={max:4,fit:3,min:2,fixed:1};return h[i]>h[t]};if("fixed"!=s&&"fixed"!=n)if(s==n){const s=t,n=a(t/e),g=a(h*e),r=h;l(i.width-s)+l(i.height-n)<=l(i.width-g)+l(i.height-r)?(t=s,h=n):(t=g,h=r)}else g(s,n)?h=a(t/e):t=a(h*e);else"fixed"==s?h=a(t/e):"fixed"==n&&(t=a(h*e))}return{width:t,height:h}}measure(i){if(null==this._sizing&&this.set_sizing(),!this.sizing.visible)return{width:0,height:0};const t=i=>"fixed"==this.sizing.width_policy&&null!=this.sizing.width?this.sizing.width:i,h=i=>"fixed"==this.sizing.height_policy&&null!=this.sizing.height?this.sizing.height:i,e=new n.Sizeable(i).shrink_by(this.sizing.margin).map(t,h),s=this._measure(e),g=this.clip_size(s,e),r=t(g.width),_=h(g.height),l=this.apply_aspect(e,{width:r,height:_});return Object.assign(Object.assign({},s),l)}compute(i={}){const t=this.measure({width:null!=i.width&&this.is_width_expanding()?i.width:1/0,height:null!=i.height&&this.is_height_expanding()?i.height:1/0}),{width:h,height:e}=t,{left:s,top:n}=this.position,r=new g.BBox({left:s,top:n,width:h,height:e});let _;if(null!=t.inner){const{left:i,top:s,right:n,bottom:r}=t.inner;_=new g.BBox({left:i,top:s,right:h-n,bottom:e-r})}this.set_geometry(r,_)}get xview(){return this.bbox.xview}get yview(){return this.bbox.yview}clip_size(i,t){function h(i,t,h,e){return null==h?h=0:(0,r.isNumber)(h)||(h=a(h.percent*t)),null==e?e=1/0:(0,r.isNumber)(e)||(e=a(e.percent*t)),d(h,o(i,e))}return{width:h(i.width,t.width,this.sizing.min_width,this.sizing.max_width),height:h(i.height,t.height,this.sizing.min_height,this.sizing.max_height)}}has_size_changed(){const{_dirty:i}=this;return this._dirty=!1,i}}h.Layoutable=u,u.__name__="Layoutable";class c extends u{_measure(i){const t=this._content_size(),h=i.bounded_to(this.sizing.size).bounded_to(t);return{width:(()=>{switch(this.sizing.width_policy){case"fixed":return null!=this.sizing.width?this.sizing.width:t.width;case"min":return t.width;case"fit":return h.width;case"max":return d(t.width,h.width)}})(),height:(()=>{switch(this.sizing.height_policy){case"fixed":return null!=this.sizing.height?this.sizing.height:t.height;case"min":return t.height;case"fit":return h.height;case"max":return d(t.height,h.height)}})()}}}h.ContentLayoutable=c,c.__name__="ContentLayoutable"},
function _(e,s,t,n,a){var _;n();const x=e(50),c=e(54);class i extends c.View{}t.BaseTextView=i,i.__name__="BaseTextView";class o extends x.Model{constructor(e){super(e)}}t.BaseText=o,_=o,o.__name__="BaseText",_.define((({String:e})=>({text:[e]})))},
function _(n,e,t,i,r){i();const s=n(149),l=n(156),d=[{start:"$$",end:"$$",inline:!1},{start:"\\[",end:"\\]",inline:!1},{start:"\\(",end:"\\)",inline:!0}];t.parse_delimited_string=function(n){for(const e of d){const t=n.indexOf(e.start),i=t+e.start.length;if(0==t){const t=n.indexOf(e.end,i),r=t;if(t==n.length-e.end.length)return new s.TeX({text:n.slice(i,r),inline:e.inline});break}}return new l.PlainText({text:n})}},
-function _(t,e,i,s,n){var h,o,r;s();const a=t(8),l=t(150),_=t(21),c=t(151),d=t(152),u=t(38),g=t(153),x=t(57),p=t(147),f=t(154);class m extends p.BaseTextView{constructor(){super(...arguments),this._position={sx:0,sy:0},this.align="left",this._x_anchor="left",this._y_anchor="center",this._base_font_size=13,this.font_size_scale=1,this.svg_image=null}graphics(){return this}infer_text_height(){return"ascent_descent"}set base_font_size(t){null!=t&&(this._base_font_size=t)}get base_font_size(){return this._base_font_size}_rect(){const{width:t,height:e}=this._size(),{x:i,y:s}=this._computed_position();return new x.BBox({x:i,y:s,width:t,height:e}).rect}set position(t){this._position=t}get position(){return this._position}get text(){return this.model.text}get provider(){return f.default_provider}async lazy_initialize(){await super.lazy_initialize(),"not_started"==this.provider.status&&await this.provider.fetch()}connect_signals(){super.connect_signals(),this.on_change(this.model.properties.text,(()=>this.load_image()))}set visuals(t){const e=t.color,i=t.alpha,s=t.font_style;let n=t.font_size;const h=t.font,{font_size_scale:o,_base_font_size:r}=this,a=(0,d.parse_css_font_size)(n);if(null!=a){let{value:t,unit:e}=a;t*=o,"em"==e&&0!=r&&(t*=r,e="px"),n=`${t}${e}`}const l=`${s} ${n} ${h}`;this.font=l,this.color=(0,_.color2css)(e,i);const c=t.align;this._x_anchor=c;const u=t.baseline;this._y_anchor=(()=>{switch(u){case"top":return"top";case"middle":return"center";case"bottom":return"bottom";default:return"baseline"}})()}_computed_position(){const{width:t,height:e}=this._size(),{sx:i,sy:s,x_anchor:n=this._x_anchor,y_anchor:h=this._y_anchor}=this.position,o=(0,d.font_metrics)(this.font);return{x:i-(()=>{if((0,a.isNumber)(n))return n*t;switch(n){case"left":return 0;case"center":return.5*t;case"right":return t}})(),y:s-(()=>{if((0,a.isNumber)(h))return h*e;switch(h){case"top":return o.height>e?e-(-this.valign-o.descent)-o.height:0;case"center":case"baseline":return.5*e;case"bottom":return o.height>e?e+o.descent+this.valign:e}})()}}size(){const{width:t,height:e}=this._size(),{angle:i}=this;if(null==i||0==i)return{width:t,height:e};{const s=Math.cos(Math.abs(i)),n=Math.sin(Math.abs(i));return{width:Math.abs(t*s+e*n),height:Math.abs(t*n+e*s)}}}get_image_dimensions(){var t;const e=(0,d.font_metrics)(this.font),i=null===(t=this.svg_element.getAttribute("style"))||void 0===t?void 0:t.split(";");if(null!=i){const t=new Map;i.forEach((e=>{const[i,s]=e.split(":");""!=i.trim()&&t.set(i.trim(),s.trim())}));const s=(0,d.parse_css_length)(t.get("vertical-align"));"ex"==(null==s?void 0:s.unit)?this.valign=s.value*e.x_height:"px"==(null==s?void 0:s.unit)&&(this.valign=s.value)}const s=(()=>{const t=this.svg_element.getAttribute("width"),e=this.svg_element.getAttribute("height");return{width:null!=t&&t.endsWith("ex")?parseFloat(t):1,height:null!=e&&e.endsWith("ex")?parseFloat(e):1}})();return{width:e.x_height*s.width,height:e.x_height*s.height}}get truncated_text(){return this.model.text.length>6?`${this.model.text.substring(0,6)}...`:this.model.text}_size(){var t,e;if(null==this.svg_image)return"failed"==this.provider.status||"not_started"==this.provider.status?{width:(0,c.text_width)(this.truncated_text,this.font),height:(0,d.font_metrics)(this.font).height}:{width:this._base_font_size,height:this._base_font_size};const i=(0,d.font_metrics)(this.font);let{width:s,height:n}=this.get_image_dimensions();n=Math.max(n,i.height);return{width:s*("%"==(null===(t=this.width)||void 0===t?void 0:t.unit)?this.width.value:1),height:n*("%"==(null===(e=this.height)||void 0===e?void 0:e.unit)?this.height.value:1)}}bbox(){const{p0:t,p1:e,p2:i,p3:s}=this.rect(),n=Math.min(t.x,e.x,i.x,s.x),h=Math.min(t.y,e.y,i.y,s.y),o=Math.max(t.x,e.x,i.x,s.x),r=Math.max(t.y,e.y,i.y,s.y);return new x.BBox({left:n,right:o,top:h,bottom:r})}rect(){const t=this._rect(),{angle:e}=this;if(null==e||0==e)return t;{const{sx:i,sy:s}=this.position,n=new g.AffineTransform;return n.translate(i,s),n.rotate(e),n.translate(-i,-s),n.apply_rect(t)}}paint_rect(t){const{p0:e,p1:i,p2:s,p3:n}=this.rect();t.save(),t.strokeStyle="red",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e.x),h(e.y)),t.lineTo(h(i.x),h(i.y)),t.lineTo(h(s.x),h(s.y)),t.lineTo(h(n.x),h(n.y)),t.closePath(),t.stroke(),t.restore()}paint_bbox(t){const{x:e,y:i,width:s,height:n}=this.bbox();t.save(),t.strokeStyle="blue",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e),h(i)),t.lineTo(h(e),h(i+n)),t.lineTo(h(e+s),h(i+n)),t.lineTo(h(e+s),h(i)),t.closePath(),t.stroke(),t.restore()}async load_image(){if(null==this.provider.MathJax)return null;const t=this._process_text();if(null==t)return this._has_finished=!0,null;const e=t.children[0];this.svg_element=e,e.setAttribute("font",this.font),e.setAttribute("stroke",this.color);const i=e.outerHTML,s=`data:image/svg+xml;utf-8,${encodeURIComponent(i)}`;return this.svg_image=await(0,l.load_image)(s),this.parent.request_layout(),this.svg_image}paint(t){null==this.svg_image&&("not_started"!=this.provider.status&&"loading"!=this.provider.status||this.provider.ready.connect((()=>this.load_image())),"loaded"==this.provider.status&&this.load_image()),t.save();const{sx:e,sy:i}=this.position,{angle:s}=this;null!=s&&0!=s&&(t.translate(e,i),t.rotate(s),t.translate(-e,-i));const{x:n,y:h}=this._computed_position();if(null!=this.svg_image){const{width:e,height:i}=this.get_image_dimensions();t.drawImage(this.svg_image,n,h,e,i)}else"failed"!=this.provider.status&&"not_started"!=this.provider.status||(t.fillStyle=this.color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic",t.fillText(this.truncated_text,n,h+(0,d.font_metrics)(this.font).ascent));t.restore(),this._has_finished||"failed"!=this.provider.status&&null==this.svg_image||(this._has_finished=!0,this.parent.notify_finished_after_paint())}}i.MathTextView=m,m.__name__="MathTextView";class v extends p.BaseText{constructor(t){super(t)}}i.MathText=v,v.__name__="MathText";class y extends m{get styled_text(){return this.text}_process_text(){}_size(){return{width:(0,c.text_width)(this.text,this.font),height:(0,d.font_metrics)(this.font).height}}paint(t){t.save();const{sx:e,sy:i}=this.position,{angle:s}=this;null!=s&&0!=s&&(t.translate(e,i),t.rotate(s),t.translate(-e,-i));const{x:n,y:h}=this._computed_position();t.fillStyle=this.color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic",t.fillText(this.text,n,h+(0,d.font_metrics)(this.font).ascent),t.restore(),this._has_finished=!0,this.parent.notify_finished_after_paint()}}i.AsciiView=y,y.__name__="AsciiView";class b extends v{constructor(t){super(t)}}i.Ascii=b,h=b,b.__name__="Ascii",h.prototype.default_view=y;class w extends m{get styled_text(){let t=this.text.trim(),e=t.match(/