@holoviz/panel 1.10.0 → 1.11.0-b.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled/bootstraptemplate/bootstrap.css +4 -0
- package/dist/bundled/deckglplot/@deck.gl/carto@^9.1.14/dist.min.js +8 -8
- package/dist/bundled/deckglplot/maplibre-gl/dist/maplibre-gl.js +2 -2
- package/dist/bundled/fastbasetemplate/fast.css +8 -1
- package/dist/bundled/filedropper/filepond@^4/dist/filepond.css +1 -1
- package/dist/bundled/filedropper/filepond@^4/dist/filepond.esm.min.js +2 -2
- package/dist/bundled/licenses/index.json +6 -6
- package/dist/bundled/reacttemplate/react.css +4 -0
- package/dist/bundled/theme/fast.css +0 -18
- package/dist/bundled/vanillatemplate/vanilla.css +4 -0
- package/dist/css/progress.css +24 -19
- package/dist/lib/models/comm_manager.d.ts +4 -0
- package/dist/lib/models/comm_manager.js +76 -18
- package/dist/lib/models/comm_manager.js.map +1 -1
- package/dist/lib/models/data.d.ts +1 -0
- package/dist/lib/models/data.js +47 -18
- package/dist/lib/models/data.js.map +1 -1
- package/dist/lib/models/html.d.ts +12 -2
- package/dist/lib/models/html.js +95 -20
- package/dist/lib/models/html.js.map +1 -1
- package/dist/lib/models/icon.js +2 -0
- package/dist/lib/models/icon.js.map +1 -1
- package/dist/lib/models/location.js +3 -0
- package/dist/lib/models/location.js.map +1 -1
- package/dist/lib/models/plotly.d.ts +15 -1
- package/dist/lib/models/plotly.js +99 -33
- package/dist/lib/models/plotly.js.map +1 -1
- package/dist/lib/models/react_component.js +65 -26
- package/dist/lib/models/react_component.js.map +1 -1
- package/dist/lib/models/reactive_esm.d.ts +13 -0
- package/dist/lib/models/reactive_esm.js +25 -0
- package/dist/lib/models/reactive_esm.js.map +1 -1
- package/dist/lib/models/reactive_html.js +32 -16
- package/dist/lib/models/reactive_html.js.map +1 -1
- package/dist/lib/models/resources.d.ts +4 -3
- package/dist/lib/models/resources.js +104 -24
- package/dist/lib/models/resources.js.map +1 -1
- package/dist/lib/models/tabs.d.ts +2 -0
- package/dist/lib/models/tabs.js +11 -0
- package/dist/lib/models/tabs.js.map +1 -1
- package/dist/lib/models/tabulator.d.ts +32 -4
- package/dist/lib/models/tabulator.js +279 -101
- package/dist/lib/models/tabulator.js.map +1 -1
- package/dist/lib/models/vega.d.ts +20 -3
- package/dist/lib/models/vega.js +123 -55
- package/dist/lib/models/vega.js.map +1 -1
- package/dist/lib/styles/progress.css.js +22 -16
- package/dist/panel.js +1004 -353
- package/dist/panel.js.map +1 -1
- package/dist/panel.json +1 -1
- package/dist/panel.min.js +24 -24
- package/package.json +1 -1
- package/dist/css/katex.css +0 -3
- package/dist/dts/styles/katex.css.d.ts +0 -4
- package/dist/lib/styles/katex.css.d.ts +0 -2
- package/dist/lib/styles/katex.css.js +0 -1
package/dist/panel.min.js
CHANGED
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
})
|
|
44
44
|
({
|
|
45
45
|
"4e90918c0a": function _(e,s,t,o,i){o();const n=e("tslib").__importStar(e("36236053e8"));t.Panel=n;(0,e("@bokehjs/base").register_models)(n)},
|
|
46
|
-
"36236053e8": function _(e,t,o,
|
|
46
|
+
"36236053e8": function _(e,t,a,o,c){o(),a.VizzuChart=a.VideoStream=a.Video=a.VegaPlot=a.TrendIndicator=a.TooltipIcon=a.ToggleIcon=a.TimePicker=a.TextToSpeech=void 0;const r=e("tslib");c("AcePlot",e("7b034b2ba5").AcePlot),c("AnyWidgetComponent",e("f4bc4e23b4").AnyWidgetComponent),c("Audio",e("fdf76c2b8b").Audio),c("BrowserInfo",e("f25f215a58").BrowserInfo),c("Button",e("29120fca73").Button),c("ButtonIcon",e("7e77f478cb").ButtonIcon),c("ClickableIcon",e("ac804884fa").ClickableIcon),c("Card",e("a668a42a0f").Card),c("CheckboxButtonGroup",e("138d8a2ed1").CheckboxButtonGroup),c("ChatAreaInput",e("a9ce3554f5").ChatAreaInput),c("Column",e("3967d78fb5").Column),c("CommManager",e("5f6e6991cc").CommManager),c("CustomSelect",e("519009caed").CustomSelect),c("CustomMultiSelect",e("8653ba687c").CustomMultiSelect);var d=e("ab964e46db");c("DataTabulator",d.DataTabulator),c("TabulatorColumn",d.TabulatorColumn),c("DatetimePicker",e("7408873be7").DatetimePicker),c("DatetimeSlider",e("47671196f6").DatetimeSlider),c("DeckGLPlot",e("609f06c18b").DeckGLPlot),c("DiscretePlayer",e("eee856b107").DiscretePlayer),c("ECharts",e("df5e7d36e5").ECharts),c("Feed",e("56255f9c11").Feed),c("FileDownload",e("a7746def5a").FileDownload),c("FileDropper",e("bff8eeed36").FileDropper),c("HTML",e("e40e09e4dd").HTML),c("IPyWidget",e("fd4c3f6bc4").IPyWidget),c("JSON",e("19285971d9").JSON),c("JSONEditor",e("372d3e3a52").JSONEditor),c("KaTeX",e("052b7b0298").KaTeX),c("Location",e("cc871e1a06").Location),c("MathJax",e("07688254ed").MathJax),c("Modal",e("37ed29726e").Modal),c("PDF",e("87a65d7fb5").PDF),c("Perspective",e("7a00e4d590").Perspective),c("Player",e("ed49986321").Player),c("PlotlyPlot",e("736be77caa").PlotlyPlot),c("Progress",e("443fb5cf42").Progress),c("QuillInput",e("3df70ba3b3").QuillInput),c("RadioButtonGroup",e("08a22fed1a").RadioButtonGroup),c("ReactComponent",e("da0e69965d").ReactComponent),c("ReactiveHTML",e("44b7d77ba5").ReactiveHTML),c("ReactiveESM",e("8e484b67b0").ReactiveESM),c("resources",e("133ce95cfa").resources),c("SingleSelect",e("3766e0c917").SingleSelect),c("SpeechToText",e("95fa78f501").SpeechToText),c("State",e("188544eb0b").State),c("Tabs",e("c5ac7daa0f").Tabs),c("Terminal",e("4fecff5c68").Terminal),c("TextAreaInput",e("2f8fe6797e").TextAreaInput),c("TextInput",e("e9d16ed037").TextInput),c("TextToSpeech",e("1fb38b62cd").TextToSpeech),c("TimePicker",e("5e05e2d651").TimePicker),c("ToggleIcon",e("49efbd99ad").ToggleIcon),c("TooltipIcon",e("aad04f1876").TooltipIcon),c("TrendIndicator",e("eb967020e9").TrendIndicator),c("VegaPlot",e("f71ac626f9").VegaPlot),c("Video",e("e8830cc759").Video),c("VideoStream",e("73b5826147").VideoStream),c("VizzuChart",e("e8cb25b7b8").VizzuChart),r.__exportStar(e("c51f25e2a7"),a)},
|
|
47
47
|
"7b034b2ba5": function _(e,t,i,o,s){o();const n=e("@bokehjs/core/dom"),d=e("00beb93e38"),a=e("aa07eb54cc");class AcePlotView extends d.HTMLBoxView{_editor;_langTools;_modelist;_container;connect_signals(){super.connect_signals();const{code:e,theme:t,language:i,filename:o,print_margin:s,annotations:n,soft_tabs:d,indent:a,readonly:h}=this.model.properties;this.on_change(e,()=>this._update_code_from_model()),this.on_change(t,()=>this._update_theme()),this.on_change(i,()=>this._update_language()),this.on_change(o,()=>this._update_filename()),this.on_change(s,()=>this._update_print_margin()),this.on_change(n,()=>this._add_annotations()),this.on_change(a,()=>this._editor.setOptions({tabSize:this.model.indent})),this.on_change(d,()=>this._editor.setOptions({useSoftTabs:this.model.soft_tabs})),this.on_change(h,()=>{this._editor.setReadOnly(this.model.readonly)})}render(){super.render(),this._container=(0,n.div)({id:(0,a.ID)(),style:{width:"100%",height:"100%",zIndex:"0"}}),this.shadow_el.append(this._container),this._container.textContent=this.model.code,this._editor=ace.edit(this._container),this._editor.renderer.attachToShadowRoot(),this._langTools=ace.require("ace/ext/language_tools"),this._modelist=ace.require("ace/ext/modelist"),this._editor.setOptions({enableBasicAutocompletion:!0,tabSize:this.model.indent,useSoftTabs:this.model.soft_tabs,enableSnippets:!0,fontFamily:"monospace"}),this._update_theme(),this._update_filename(),this._update_language(),this._editor.setReadOnly(this.model.readonly),this._editor.setShowPrintMargin(this.model.print_margin),this.model.on_keyup?this._editor.on("change",()=>this._update_code_from_editor()):(this._editor.on("blur",()=>this._update_code_from_editor()),this._editor.commands.addCommand({name:"updateCodeFromEditor",bindKey:{win:"Ctrl-Enter",mac:"Command-Enter"},exec:()=>{this._update_code_from_editor()}})),this._editor.on("change",()=>this._update_code_input_from_editor())}_update_code_from_model(){if(this._editor&&this._editor.getValue()!=this.model.code){const e=this._editor.getCursorPosition(),t=this._editor.session.getScrollTop(),i=this._editor.session.getScrollLeft();this._editor.setValue(this.model.code,-1);const o=this._editor.session.getLength();if(e.row<o){const t=this._editor.session.getLine(e.row).length,i=Math.min(e.column,t);this._editor.moveCursorToPosition({row:e.row,column:i})}else this._editor.moveCursorToPosition({row:o-1,column:this._editor.session.getLine(o-1).length});this._editor.clearSelection(),this._editor.session.setScrollTop(t),this._editor.session.setScrollLeft(i)}}_update_print_margin(){this._editor.setShowPrintMargin(this.model.print_margin)}_update_code_from_editor(){this._editor.getValue()!=this.model.code&&(this.model.code=this._editor.getValue())}_update_code_input_from_editor(){this._editor.getValue()!=this.model.code_input&&(this.model.code_input=this._editor.getValue())}_update_theme(){this._editor&&this._editor.setTheme(`ace/theme/${this.model.theme}`)}_update_filename(){if(this.model.filename){const e=this._modelist.getModeForPath(this.model.filename).mode;this.model.language=e.slice(9)}}_update_language(){null!=this.model.language&&(this._editor.session.setMode(`ace/mode/${this.model.language}`),this._add_annotations())}_add_annotations(){this._editor.session.setUseWorker(0===this.model.annotations.length),this._editor.session.setAnnotations(this.model.annotations)}after_layout(){super.after_layout(),void 0!==this._editor&&this._editor.resize()}}i.AcePlotView=AcePlotView;class AcePlot extends d.HTMLBox{constructor(e){super(e)}static __module__="panel.models.ace";static{this.prototype.default_view=AcePlotView,this.define(({Any:e,Bool:t,Int:i,List:o,Str:s,Nullable:n})=>({annotations:[o(e),[]],code:[s,""],code_input:[s,""],filename:[n(s),null],indent:[i,4],language:[s,""],on_keyup:[t,!0],print_margin:[t,!1],theme:[s,"github_light_default"],readonly:[t,!1],soft_tabs:[t,!1]})),this.override({height:300,width:300})}}i.AcePlot=AcePlot},
|
|
48
|
-
"00beb93e38": function _(e,t,s,i,r){i(),s.rerender_view=c,s.set_size=m;const h=e("@bokehjs/core/dom"),l=e("@bokehjs/core/util/types"),a=e("@bokehjs/core/util/assert"),n=e("@bokehjs/models/widgets/widget"),o=e("@bokehjs/models/layouts/layout_dom"),d=e("
|
|
49
|
-
"
|
|
48
|
+
"00beb93e38": function _(e,t,s,i,r){i(),s.rerender_view=c,s.set_size=m;const h=e("@bokehjs/core/dom"),l=e("@bokehjs/core/util/types"),a=e("@bokehjs/core/util/assert"),n=e("@bokehjs/models/widgets/widget"),o=e("@bokehjs/models/layouts/layout_dom"),d=e("133ce95cfa");function c(e,t=!0){e instanceof o.LayoutDOMView?(e.render(),e.update_layout(),e.r_after_render(),t&&e.compute_layout()):e.rerender?e.rerender():(e.render(),e.r_after_render())}function u(e,t,s){const i=new Map,r=()=>[...i.values()].every(e=>e);for(const h of e){const e=h.el;if(e instanceof HTMLLinkElement){i.set(e.href,null!=e.sheet);const h=()=>{i.set(e.href,!0),r()&&s()};e.addEventListener("load",h,{signal:t}),e.addEventListener("error",h,{signal:t})}}return r()&&s(),i}class PanelMarkupView extends n.WidgetView{container;_initialized_stylesheets;_stylesheets_watcher=null;connect_signals(){super.connect_signals();const{width:e,height:t,min_height:s,max_height:i,margin:r,sizing_mode:h}=this.model.properties;this.on_change([e,t,s,i,r,h],()=>{m(this.el,this.model),m(this.container,this.model,!1)})}async lazy_initialize(){await super.lazy_initialize();const e=await(0,d.await_resources)(this.model);null!=e&&(0,d.render_resource_error)(this,e,PanelMarkupView.prototype.render),"not_started"!=this.provider.status&&"loading"!=this.provider.status||this.provider.ready.connect(()=>{this.contains_tex_string(this.model.text)&&this.render()})}watch_stylesheets(){this._stylesheets_watcher?.abort();const{signal:e}=this._stylesheets_watcher=new AbortController;let t=!1;this._initialized_stylesheets=u(this._applied_stylesheets,e,()=>{t?requestAnimationFrame(()=>this.style_redraw()):this.style_redraw()}),t=!0}_update_stylesheets(){super._update_stylesheets(),null!=this._stylesheets_watcher&&this.watch_stylesheets()}rerender_(e=null){c(e??this)}style_redraw(){}has_math_disabled(){return this.model.disable_math||!this.contains_tex_string(this.model.text)}render(){super.render(),m(this.el,this.model),this.container=(0,h.div)(),m(this.container,this.model,!1),this.shadow_el.appendChild(this.container),"failed"!=this.provider.status&&"loaded"!=this.provider.status||(this._has_finished=!0)}}function m(e,t,s=!0){let i=null!=t.width?"fixed":"fit",r=null!=t.height?"fixed":"fit";const{sizing_mode:n,margin:o}=t;if(null!=n)if("fixed"==n)i=r="fixed";else if("stretch_both"==n)i=r="max";else if("stretch_width"==n)i="max";else if("stretch_height"==n)r="max";else switch(n){case"scale_width":i="max",r="min";break;case"scale_height":i="min",r="max";break;case"scale_both":i="max",r="max";break;case"inherit":break;default:(0,a.unreachable)()}let d,c;s?(0,l.isArray)(o)?4===o.length?(c=o[0]+o[2],d=o[1]+o[3]):(c=2*o[0],d=2*o[1]):null==o?c=d=0:d=c=2*o:c=d=0,"fixed"==i&&null!=t.width?e.style.width=(0,h.px)(t.width):"max"==i&&(e.style.width=0!=d?`calc(100% - ${(0,h.px)(d)})`:"100%"),null!=t.min_width&&(e.style.minWidth=(0,h.px)(t.min_width)),null!=t.max_width&&(e.style.maxWidth=(0,h.px)(t.max_width)),"fixed"==r&&null!=t.height?e.style.height=(0,h.px)(t.height):"max"==r&&(e.style.height=0!=c?`calc(100% - ${(0,h.px)(c)})`:"100%"),null!=t.min_height&&(e.style.minHeight=(0,h.px)(t.min_height)),null!=t.max_height&&(e.style.maxHeight=(0,h.px)(t.max_height))}s.PanelMarkupView=PanelMarkupView;class HTMLBoxView extends o.LayoutDOMView{_initialized_stylesheets=new Map;_stylesheets_watcher=null;connect_signals(){super.connect_signals();const{width:e,height:t,min_height:s,max_height:i,margin:r,sizing_mode:h}=this.model.properties;this.on_change([e,t,s,i,r,h],()=>{m(this.el,this.model)})}async lazy_initialize(){await super.lazy_initialize();const e=await(0,d.await_resources)(this.model);null!=e&&(0,d.render_resource_error)(this,e,HTMLBoxView.prototype.render)}render(){super.render(),m(this.el,this.model)}rerender_(e=null){c(e??this)}watch_stylesheets(){this._stylesheets_watcher?.abort();const{signal:e}=this._stylesheets_watcher=new AbortController;this._initialized_stylesheets=u(this._applied_stylesheets,e,()=>{requestAnimationFrame(()=>this.style_redraw())})}get stylesheets_settled(){return[...this._initialized_stylesheets.values()].every(e=>e)}_update_stylesheets(){super._update_stylesheets(),null!=this._stylesheets_watcher&&this.watch_stylesheets()}remove(){this._stylesheets_watcher?.abort(),this._stylesheets_watcher=null,super.remove()}style_redraw(){}get child_models(){return[]}}s.HTMLBoxView=HTMLBoxView;class HTMLBox extends o.LayoutDOM{constructor(e){super(e)}static{(0,d.define_external_resources)(this)}initialize(){super.initialize(),(0,d.load_resources)(this)}}s.HTMLBox=HTMLBox},
|
|
49
|
+
"133ce95cfa": function _(e,t,s,n,r){n(),s.cdn_url=b,s.resource_url=g,s.define_external_resources=function(e){e.define(({Any:e,Nullable:t})=>({external_resources:[t(e),null]}))},s.load_resources=P,s.await_resources=function(e){return P(e),S.get(e)??Promise.resolve(null)},s.render_resource_error=function(e,t,s){e.render=()=>{s.call(e),e.shadow_el.appendChild(function(e){const t=document.createElement("div");return t.className="pn-resource-error",t.style.cssText="color: red; font-family: monospace; white-space: pre-wrap; padding: 0.5em;",t.textContent=`Could not load the resources this component requires:\n${e.message}`,t}(t))}};const o=e("tslib"),l=e("@bokehjs/models/dom/stylesheets"),i=o.__importStar(e("@bokehjs/core/dom"));function c(e){try{return new URL(g(e),document.baseURI).href}catch(t){return e}}function u(e){return e=g(e),/^[a-z][a-z0-9+.-]*:/i.test(e)?e:c(e)}s.REGISTRY_VERSION=1,s.DEFAULT_TIMEOUT=15e3;const a="static/extensions/";function m(e,t){if(e.has(c(t)))return!0;const s=function(e){const t=/static\/extensions\/[^/]+\/(bundled\/.+)$/.exec(e.split(/[?#]/)[0]);return null==t?null:`/${t[1]}`}(t);if(null==s)return!1;for(const t of e)if(t.split(/[?#]/)[0].endsWith(s))return!0;return!1}function h(e,t){const s=new Set;for(const n of document.querySelectorAll(e)){const e=n.getAttribute(t);null!=e&&""!==e&&s.add(c(e))}return s}const d="/panel-preview/",f=[];function p(e){const t=e.indexOf(a);if(-1===t)return null;const s=e.slice(t);for(const[e,t]of f)if(s.startsWith(e))return t+s.slice(e.length);return null}function b(e){const t=globalThis;let s=t.__panel_cdn_map__??null;null==s&&"string"==typeof t.__panel_cdn_dist__&&(s=[["static/extensions/panel/",t.__panel_cdn_dist__]]);const n=e.indexOf(d);if(null==s||-1===n)return p(e);const r=e.slice(n+d.length);for(const[e,t]of s)if(r.startsWith(e))return t+r.slice(e.length);return p(e)}function g(e){const t=globalThis;return!1===t.__panel_live_notebook__||!0===t.__panel_endpoint_failed__?b(e)??e:e}function y(e,t){return new Promise((s,n)=>{let r=null;const o=e=>{e.addEventListener("load",()=>s(),{once:!0}),e.addEventListener("error",()=>{const s=t?.url??(e.src||e.href),l=function(e,t){const s=b(t);return null==s||null!=e.dataset.panelCdnFallback?null:(e.dataset.panelCdnFallback="",s)}(e,s);if(null!=l){r=[s,l],e.remove();const n=document.createElement(e.tagName.toLowerCase());for(const{name:t,value:s}of Array.from(e.attributes))n.setAttribute(t,s);return n instanceof HTMLLinkElement?n.href=l:(n.async=e.async,n.src=null!=t?t.src(l):l),o(n),void document.head.appendChild(n)}if(function(e){return e.includes(`${d}static/`)}(s)){const e=globalThis;e.__panel_jupyter_extension_error__?.()}n(new Error(null==r?`Failed to load ${s}`:`Failed to load ${r[0]} or its CDN fallback ${r[1]}`))},{once:!0})};o(e),document.head.appendChild(e)})}const w="data-panel-no-amd";function T(){const e=globalThis,t=e.define;if("function"!=typeof t||null==t.amd||!0===t.__panel_no_amd__)return;const s=e.__panel_no_amd_dirs__??=[];let n=t.amd;try{Object.defineProperty(t,"amd",{configurable:!0,enumerable:!0,get:()=>(()=>{const e=document.currentScript;if(null!=e)return e.hasAttribute(w);const t=(new Error).stack??"";return s.some(e=>t.includes(e))})()?void 0:n,set:e=>{n=e}}),Object.defineProperty(t,"__panel_no_amd__",{value:!0})}catch(e){console.warn(`Panel: could not hide RequireJS from component libraries: ${e}`)}}function v(e){const t=globalThis.__panel_no_amd_dirs__??=[],s=c(e).split("?")[0].replace(/[^/]*$/,"");/\/(dist|static\/extensions\/panel)\/$/.test(s)||t.includes(s)||t.push(s),T()}function E(e){const t=document.createElement("script");return t.async=!1,t.src=g(e),function(e){e.setAttribute(w,""),T()}(t),y(t)}function x(e){const t=e.probe?.custom_element;return null==t||null!=customElements.get(t)?Promise.resolve():customElements.whenDefined(t).then(()=>{})}class ResourceRegistry{v=s.REGISTRY_VERSION;libs=new Map;urls=new Map;modules=new Map;specs=new Map;exports=new Map;_shim=null;declare(e){const{libs:t,css:s}=Array.isArray(e)?{libs:e,css:[]}:e;for(const e of t??[])if(null!=e&&null!=e.name){this.specs.set(e.name,e),this.libs.set(e.name,x(e));for(const t of e.js??[])this.urls.set(c(t),Promise.resolve());for(const{url:t}of e.modules??[])this.urls.set(c(t),Promise.resolve())}for(const e of s??[])this.urls.set(c(e),Promise.resolve())}claim(e,t){for(const s of e.libs??[])if(null!=s&&null!=s.name){this.specs.set(s.name,s),this.libs.set(s.name,t.then(()=>{if(this.loaded(s))return x(s);const e=[...s.js??[],...(s.modules??[]).map(e=>e.url)];for(const s of e)this.urls.get(c(s))===t&&this.urls.delete(c(s));const n=null!=s.probe?.custom_element?[s.probe.custom_element]:[];return this._load(s.js??[],s.modules??[],n)}));for(const e of s.js??[])this.urls.set(c(e),t);for(const{url:e}of s.modules??[])this.urls.set(c(e),t)}}loaded(e,t){if(!(e.modules??[]).every(({export:e})=>null==e||null!=globalThis[e]))return!1;const{probe:s}=e;if(null!=s){if(null!=s.global){const e=globalThis[s.global];if(null!=e&&!(e instanceof HTMLElement))return!0}if(null!=s.custom_element&&null!=customElements.get(s.custom_element))return!0}const n=[...e.js??[],...(e.modules??[]).map(e=>e.url)];return 0===n.length||n.every(e=>this.urls.has(c(e))||null!=t&&m(t,e))}async ensure(e){if(null==e)return;!function(e){for(const[t,s]of e??[])f.some(([e])=>e===t)||f.push([t,s])}(e.cdn);const t=h("script[src]","src"),s=[],n=[],r=[],o=[],l=[];for(let i of e.libs??[]){if("string"==typeof i){const e=this.specs.get(i);if(null==e)continue;i=e}this.specs.has(i.name)||this.specs.set(i.name,i);const e=this.libs.get(i.name);if(null==e){if(this.loaded(i,t)){const e=x(i);this.libs.set(i.name,e),s.push(e);continue}o.push(i.name),n.push(...i.js??[]),r.push(...i.modules??[]),null!=i.probe?.custom_element&&l.push(i.probe.custom_element)}else s.push(e)}if(null!=e.css&&e.css.length>0&&s.push(this.ensure_css(e.css)),n.length>0||r.length>0){const e=this._load(n,r,l);for(const t of o)this.libs.set(t,e);e.catch(()=>{for(const t of o)this.libs.get(t)===e&&this.libs.delete(t)}),s.push(e)}await Promise.all(s)}ensure_css(e){const t=h("link[rel~='stylesheet']","href"),s=e.map(e=>{const s=c(e);let n=this.urls.get(s);return null==n&&(n=m(t,e)?Promise.resolve():function(e){const t=document.createElement("link");return t.rel="stylesheet",t.type="text/css",t.href=g(e),y(t)}(e),this.urls.set(s,n)),n.catch(t=>{this.urls.delete(s),console.warn(`Panel: could not load stylesheet ${e}: ${t.message}`)})});return Promise.all(s).then(()=>{})}ensure_shim(e){if("function"==typeof globalThis.importShim)return Promise.resolve();if(null!=this._shim)return this._shim;if(null==e)return Promise.reject(new Error("No es-module-shims url available"));if(null==document.querySelector("script[type='esms-options']")){const e=document.createElement("script");e.type="esms-options",e.textContent=JSON.stringify({shimMode:!0}),document.head.appendChild(e)}const t=c(e),s=m(h("script[src]","src"),e)?Promise.resolve():E(e);return this.urls.set(t,s),this._shim=s.catch(e=>{throw this._shim=null,e}),this._shim}import_module(e,t){if((e=u(e)).startsWith("blob:"))return this.ensure_shim(t).then(()=>globalThis.importShim(e));let s=this.modules.get(e);if(null==s){const n=b(e);s=this.ensure_shim(t).then(()=>globalThis.importShim(e)),null!=n&&n!==e&&(s=s.catch(()=>globalThis.importShim(n))),this.modules.set(e,s),s.catch(()=>this.modules.delete(e))}return s}add_import_map(e){try{globalThis.importShim.addImportMap({...e})}catch(e){console.warn(`Failed to add import map: ${e}`)}}async _load(e,t,s=[]){e.length>0&&await this._load_scripts(e),t.length>0&&await this._load_modules(t),s.length>0&&await Promise.all(s.map(e=>customElements.whenDefined(e)))}_load_scripts(e){const t=h("script[src]","src"),s=e.map(e=>{const s=c(e);let n=this.urls.get(s);return null==n&&(n=m(t,e)?Promise.resolve():E(e),this.urls.set(s,n),n.catch(()=>this.urls.delete(s))),n});return Promise.all(s).then(()=>{})}_load_modules(e){const t=h("script[src]","src"),s=e.map(({url:e,export:s})=>{const n=c(e);let r=this.urls.get(n);return null==r&&(r=m(t,e)?Promise.resolve():function(e,t){const s=document.createElement("script");if(s.type="module",s.async=!1,v(e),null==t)return s.src=g(e),y(s);const n=[],r=e=>{const s=`import * as ns from ${JSON.stringify(e)}\nglobalThis[${JSON.stringify(t)}] = ns.default ?? ns\n`,r=URL.createObjectURL(new Blob([s],{type:"text/javascript"}));return n.push(r),r};return e=u(e),s.src=r(e),y(s,{url:e,src:e=>(v(e),r(e))}).finally(()=>n.forEach(e=>URL.revokeObjectURL(e)))}(e,s),this.urls.set(n,r),r.catch(()=>this.urls.delete(n))),r});return Promise.all(s).then(()=>{for(const{export:t}of e)if(null!=t&&null==this.exports.get(t)){const e=globalThis[t];null!=e&&this.exports.set(t,e)}})}}s.ResourceRegistry=ResourceRegistry,s.resources=function(){const e=globalThis,t=e.__panel_resources__;let s;null!=t&&"function"==typeof t.ensure&&"function"==typeof t.declare?s=t:(s=new ResourceRegistry,e.__panel_resources__=s);const n=e.__panel_resources_declared__;if(Array.isArray(n)){e.__panel_resources_declared__=[];for(const e of n){const t=e?.ready;null!=t&&"function"==typeof t.then?s.claim(e,t):s.declare(e)}}return s}();const S=new WeakMap;function P(e){const t=e.external_resources;if(null==t||S.has(e))return;const n=t.timeout??s.DEFAULT_TIMEOUT;var r,o;S.set(e,(r=s.resources.ensure(t),o=n,o>0?new Promise((e,t)=>{const s=setTimeout(()=>t(new Error(`Timed out after ${o}ms waiting for external resources`)),o);r.then(t=>{clearTimeout(s),e(t)},e=>{clearTimeout(s),t(e)})}):r).then(()=>null,e=>(console.error(`Panel: could not load external resources: ${e.message}`),e)))}const R=l.ImportedStyleSheet.prototype.underlying;l.ImportedStyleSheet.prototype.underlying=function(){const e=g(this.url);return e===this.url?R.call(this):new i.ImportedStyleSheet(e)}},
|
|
50
50
|
"aa07eb54cc": function _(t,e,n,r,o){r(),n.throttle=function(t,e){let n=0,r=null;return function(...o){const c=this,s=Date.now();r&&clearTimeout(r),s-n>=e?(t.apply(c,o),n=Date.now()):r=setTimeout(function(){t.apply(c,o),n=Date.now(),r=null},e-(s-n))}},n.deepCopy=function t(e){let n;if(null==e||"object"!=typeof e)return e;if(e instanceof Array){n=[];for(let r=0,o=e.length;r<o;r++)n[r]=t(e[r]);return n}if(e instanceof Object){const n={};for(const r in e){const o=r;e.hasOwnProperty(o)&&(n[o]=t(e[o]))}return n}throw new Error("Unable to copy obj! Its type isn't supported.")},n.reshape=function(t,e){let n=0;if(!e||!t)return[];return function r(o){let s=[];if(o===e.length-1)s=(0,c.concat)(t.slice(n,n+e[o])),n+=e[o];else for(let t=0;t<e[o];t++)s.push(r(o+1));return s}(0)},n.loadScript=async function(t,e){const n=document.createElement("script");return n.type=t,n.src=e,n.defer=!0,document.head.appendChild(n),new Promise((t,e)=>{n.onload=()=>{t()},n.onerror=()=>{e()}})},n.ID=function(){return`_${Math.random().toString(36).substring(2,11)}`},n.convertUndefined=function t(e){if((0,s.isArray)(e))return e.map(t);(0,s.isPlainObject)(e)&&Object.entries(e).forEach(([n,r])=>{(0,s.isPlainObject)(r)||(0,s.isArray)(r)?t(r):void 0===r&&(e[n]=null)});return e},n.formatError=function(t,e){let n=`<span class="msg">${t}</span>`;const r=n.match(/\((\d+):(\d+)\)/);if(!r)return n;const o=parseInt(r[1]),c=parseInt(r[2]),s=Math.max(0,o-5),i=o-s,u=e.replace(/>/g,"<").replace(/</g,">").split(/\r?\n/).slice(s,o+5);n+="<br><br>";for(let t=0;t<i;t++){n+=`<pre${t==i-1?' class="highlight"':""}>${u[t]}</pre>`}const l=" ".repeat(c-1);n+=`<pre class="highlight">${l}^</pre>`;for(let t=i;t<u.length;t++)n+=`<pre>${u[t]}</pre>`;return n},n.find_attributes=function(t,e,n){const r=RegExp(`\\b${e}\\.([a-zA-Z_][a-zA-Z0-9_]*)\\b`,"g"),o=[];let s,i;for(;null!==(s=r.exec(t))&&null!==(i=s[0].slice(e.length+1))&&!n.includes(i);)o.push(i);return(0,c.uniq)(o)},n.schedule_when=function(t,e,n=10){const r=()=>{e()?t():setTimeout(r,n)};r()},n.compileToFunction=l,n.transformJsPlaceholders=function(t,e){return function t(n){if("string"==typeof n){const t=n.match(i);return t?l(t[1],e):n}if(Array.isArray(n))return n.map(t);if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){const e={};for(const[r,o]of Object.entries(n))e[r]=t(o);return e}return n}(t)};const c=t("@bokehjs/core/util/array"),s=t("@bokehjs/core/util/types");n.get=(t,e,n=void 0)=>{const r=n=>String.prototype.split.call(e,n).filter(Boolean).reduce((t,e)=>null!=t?t[e]:t,t),o=r(/[,[\]]+?/)||r(/[,[\].]+?/);return void 0===o||o===t?n:o},n.MARK="--x_x--0_0--";const i=new RegExp(`^${n.MARK}([\\s\\S]*?)${n.MARK}$`),u={mode:"expression",args:[]};function l(t,e=u){const{mode:n,args:r}={...u,...e};return new Function(...r,"expression"===n?`"use strict";\nreturn (${t});`:`"use strict";\n${t}`)()}},
|
|
51
|
-
"f4bc4e23b4": function _(e,t,i,s,n){s();const r=e("
|
|
52
|
-
"f3226cbf82": function _(e,t,s,i,n){i(),s.model_getter=j,s.model_setter=$;const r=e("tslib");var l,o=this&&this.__decorate||function(e,t,s,i){var n,r=arguments.length,l=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,s,l):n(t,s))||l);return r>3&&l&&Object.defineProperty(t,s,l),l};const a=e("28a8b14fda"),c=e("@bokehjs/core/bokeh_events"),d=e("@bokehjs/core/dom"),h=e("@bokehjs/core/dom"),u=e("@bokehjs/core/dom_view"),m=e("@bokehjs/core/kinds"),f=e("@bokehjs/models/layouts/layout_dom"),p=e("@bokehjs/core/util/types"),y=e("@bokehjs/models/ui/ui_element"),v=e("e5a0036205"),g=e("9012c2f5ae"),w=e("00beb93e38"),b=e("3ec7d872e2"),k=e("aa07eb54cc"),M=r.__importDefault(e("727a14f76b")),R=new Map,z=new Map,x=new Map,E=new Set;class DataEvent extends c.ModelEvent{data;constructor(e){super(),this.data=e}get event_values(){return{model:this.origin,data:this.data}}static{this.prototype.event_name="data_event"}}s.DataEvent=DataEvent;let S=l=class ESMEvent extends DataEvent{static from_values(e){const{model:t,data:s}=e,i=new l(s);return i.origin=t,i}};s.ESMEvent=S,s.ESMEvent=S=l=o([(0,c.server_event)("esm_event")],S);const P=new Set(["get_child","send_msg","send_event","off","on"]);function j(e,t){const s=e.model;if(P.has(t)){let s=e._proxy_methods.get(t);return void 0===s&&(s=function(e,t){const s=e.model;if("get_child"===t)return t=>{e.accessed_children.includes(t)||e.accessed_children.push(t);const i=s.data[t];if((0,p.isArray)(i)){const t=[];for(const s of i)t.push(e.get_child_view(s)?.el);return t}return null!=s?e.get_child_view(i)?.el:null};if("send_msg"===t)return e=>{s.trigger_event(new DataEvent(e))};if("send_event"===t)return(e,t)=>{const i=(0,k.convertUndefined)((0,v.serializeEvent)(t));s.trigger_event(new g.DOMEvent(e,i))};if("off"===t)return(t,i)=>{const n=(0,p.isArray)(t)?t:[t];for(let t of n)if(t.startsWith("change:")&&(t=t.slice(7)),t in s.attributes||t.split(".")[0]in s.data.attributes)s.unwatch(e,t,i);else if("msg:custom"!==t){if(t.startsWith("lifecycle:")&&(t=t.slice(10)),e._lifecycle_handlers.has(t)){const s=e._lifecycle_handlers.get(t);s&&s.includes(i)&&e._lifecycle_handlers.set(t,s.filter(e=>e!==i));continue}console.warn(`Could not unregister callback for event type '${t}'`)}else e.remove_on_event(i)};if("on"===t)return(t,i,n=!1)=>{const r=(0,p.isArray)(t)?t:[t];for(let t of r)t.startsWith("change:")&&(t=t.slice(7)),t in s.attributes||t.split(".")[0]in s.data.attributes?s.watch(e,t,i,n):"msg:custom"!==t?(t.startsWith("lifecycle:")&&(t=t.slice(10)),e._lifecycle_handlers.has(t)?(e._lifecycle_handlers.get(t)||[]).push(i):console.warn(`Could not register callback for event type '${t}'`)):e.on_event(i)};throw new Error(`unknown proxy method '${t}'`)}(e,t),e._proxy_methods.set(t,s)),s}return Reflect.has(s.data,t)?(t in s.data.attributes&&!e.accessed_properties.includes(t)&&e.accessed_properties.push(t),Reflect.get(s.data,t)):Reflect.has(s,t)?Reflect.get(s,t):void 0}function $(e,t,s){const i=e.model;return Reflect.has(i.data,t)?Reflect.set(i.data,t,s):!!Reflect.has(i,t)&&Reflect.set(i,t,s)}function A(e,t){return Reflect.has(e.data,t)?Reflect.get(e.data,t):Reflect.has(e,t)?Reflect.get(e,t):void 0}function C(e,t,s){return Reflect.has(e.data,t)?Reflect.set(e.data,t,s):!!Reflect.has(e,t)&&Reflect.set(e,t,s)}const D=new WeakMap;function L(e){return e.then(t=>D.set(e,t),()=>{}),e}const O=L(Promise.resolve({default:{render:function(e){if(e.is_destroyed)return;const t=e.render_fn({view:e,model:e.model_proxy,data:e.model.data,el:e.container});Promise.resolve(t).then(t=>{t instanceof Element&&e.container.replaceChildren(t),e.after_rendered()})}}})),V=new Set;class ReactiveESMView extends w.HTMLBoxView{container;accessed_properties=[];accessed_children=[];compiled_module=null;model_proxy;_child_callbacks;_child_rendered=new Map;_event_handlers=[];_lifecycle_handlers=new Map([["update_layout",[]],["after_layout",[]],["after_render",[]],["resize",[]],["remove",[]],["mounted",[]]]);_module_cache;_rendered=!1;_stale_children=!1;_mounted=new Map;_update_children_chain=Promise.resolve();_layout_pending=!1;_proxy_methods=new Map;_last_size=null;initialize(){super.initialize(),this._module_cache=R,this._child_callbacks=new Map,this.model_proxy=new Proxy(this,{get:j,set:$})}async lazy_initialize(){await super.lazy_initialize(),this.compiled_module=await this.model.compiled_module}stylesheets(){const e=super.stylesheets();return e.push(M.default),this.model.css_bundle&&("url"===this.model.bundle?e.push(new h.ImportedStyleSheet((0,b.resource_url)(this.model.css_bundle))):e.push(this.model.css_bundle)),e}connect_signals(){super.connect_signals();const{esm:e,importmap:t,class_name:s}=this.model.properties;this.on_change([e,t],async()=>{this.compiled_module=await this.model.compiled_module,this.invalidate_render()}),this.on_change(s,()=>{this.container.className=this.model.class_name.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()});const i=this.model.children.map(e=>this.model.data.properties[e]);for(const e of i)this.connect(e.change,()=>this.update_children());this.model._event_views.add(this)}disconnect_signals(){super.disconnect_signals(),this._child_callbacks=new Map,this.model._event_views.delete(this),this.model.disconnect_watchers(this)}_dispatch_event(e){for(const t of this._event_handlers)t(e)}_on_mounted(){}r_after_render(){for(const e of this.children_views())e instanceof u.DOMView&&this._is_mountable(e)&&e.r_after_render();this.after_render(),this._was_built=!0}_is_mountable(e){return!this._child_views.has(e.model)||e.el.isConnected}notify_mount(e,t,s=!1){this._mounted.has(e)||this._mounted.set(e,new Set),s?this._mounted.get(e)?.delete(t):this._mounted.get(e)?.add(t);let i=this.model.data[e];(0,p.isArray)(i)||(i=[i]);const n=this._mounted.get(e);if(n.size>=i.length&&i.every(e=>n.has(e.id))){this._on_mounted();for(const t of this._lifecycle_handlers.get("mounted")||[])t(e)}}on_event(e){this._event_handlers.push(e)}remove_on_event(e){return!!this._event_handlers.includes(e)&&(this._event_handlers=this._event_handlers.filter(t=>t!==e),!0)}get_child_view(e){return this._child_views.get(e)}get render_fn(){return null===this.compiled_module?null:this.compiled_module.default?this.compiled_module.default.render:this.compiled_module.render}get child_models(){const e=[];for(const t of this.model.children){const s=this.model.data[t];if((0,p.isArray)(s))for(const t of s)e.push(t);else null!=s&&e.push(s)}return e}render_error(e){const t=(0,d.div)({class:"error"});t.innerHTML=(0,k.formatError)(e,this.model.esm),this.container.appendChild(t)}render(){this.empty(),this._update_stylesheets(),this._update_css_classes(),this._apply_styles(),this._update_css_variables(),this._apply_visible(),this._child_callbacks=new Map,this._child_rendered.clear(),this._rendered=!1,(0,w.set_size)(this.el,this.model),this.container=(0,d.div)(),this.container.className=this.model.class_name.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),(0,w.set_size)(this.container,this.model,!1),this.shadow_el.append(this.container),this.model.compile_error?this.render_error(this.model.compile_error):this.render_esm();for(const e of this.element_views){const t=e.rendering_target()??this.self_target??this.shadow_el;e.render_to(t)}}get is_managed(){return this.parent instanceof f.LayoutDOMView&&!(this.parent instanceof ReactiveESMView)}render_child(e){(0,w.rerender_view)(e,!1),this.schedule_layout()}schedule_layout(){this._layout_pending||(this._layout_pending=!0,queueMicrotask(()=>{this._layout_pending&&!this.is_destroyed&&(this.compute_layout(),this.notify_finished())}))}compute_layout(){this._layout_pending=!1,this.is_managed?super.compute_layout():(this.measure_layout(),this.update_bbox(),this._compute_layout(),this.after_layout(),this._layout_computed=!0)}_update_bbox(){const e=(()=>{if(this.el.isConnected){if(null!=this.el.offsetParent)return!0;{const{position:e,display:t}=getComputedStyle(this.el);return"fixed"==e&&"none"!=t}}return!1})();this._is_displayed=e;const t=e?this.el.offsetWidth:0,s=e?this.el.offsetHeight:0,i=this._last_size;return(null==i||i[0]!==t||i[1]!==s)&&(this._last_size=[t,s],!0)}after_rendered(){const e=this._lifecycle_handlers.get("after_render")||[];for(const t of e)t();if(this.render_children(),this.model_proxy.on(this.accessed_children,()=>{this._stale_children=!0}),!this._rendered)for(const e of this._lifecycle_handlers.get("after_layout")||[])e();this._rendered=!0}render_esm(){if(null===this.model.compiled||null===this.model.render_module)return;this.container.replaceChildren(),this.accessed_properties=[];for(const e of this._lifecycle_handlers.keys())(this._lifecycle_handlers.get(e)||[]).splice(0);this.model.disconnect_watchers(this);const e=this.model.render_module.then(e=>e.default.render(this));this._await_ready(e)}render_children(){for(const e of this.accessed_children){const t=this.model.data[e],s=(0,p.isArray)(t)?t:[t];for(const e of s){const t=this._child_views.get(e);if(!t||this._child_rendered.get(t))continue;t.el.parentNode&&(this._child_rendered.set(t,!1),this.render_child(t),this._child_rendered.set(t,!0))}}this._stale_children=!1,this.after_render()}has_finished(){if(!y.UIElementView.prototype.has_finished.call(this))return!1;if(this.is_layout_root&&!this._layout_computed)return!1;for(const e of this.child_views)if(this._child_rendered.has(e)&&!e.has_finished())return!1;return!0}notify_finished(){if(this.is_root)return void super.notify_finished();const e=this.root;V.has(e)||(V.add(e),queueMicrotask(()=>{V.delete(e),e.is_destroyed||e.notify_finished()}))}invalidate_layout(){this.is_managed?super.invalidate_layout():(this.update_layout(),this.schedule_layout())}remove(){super.remove();for(const e of this._lifecycle_handlers.get("remove")||[])e();this._child_callbacks.clear(),this._child_rendered.clear(),this._mounted.clear()}after_resize(){if(this._rendered){super.after_resize();for(const e of this._lifecycle_handlers.get("resize")||[])e()}}after_layout(){if(super.after_layout(),this._rendered)for(const e of this._lifecycle_handlers.get("after_layout")||[])e()}_child_names(){const e=new Map;for(const t of this.model.children){const s=this.model.data[t];for(const i of(0,p.isArray)(s)?s:[s])null==i||e.has(i)||e.set(i,t)}return e}async update_children(){const e=this._update_children_chain.then(()=>this._update_children_pass());return this._update_children_chain=e.then(()=>{},()=>{}),e}_group_new_views(e){const t=this._child_names(),s=new Map;for(const i of this.child_views){if(!e.has(i))continue;const n=t.get(i.model);if(null==n)continue;const r=s.get(n);null==r?s.set(n,[i]):r.push(i)}return s}async _update_children_pass(){const e=new Set(await this.build_child_views()),t=this.child_views;if("manual"!==this.model.render_policy)for(const e of t)e.el.remove();const s=this._group_new_views(e),i=new Set(t);for(const e of this._child_rendered.keys())i.has(e)||this._child_rendered.delete(e);for(const e of this.model.children){const t=this._child_callbacks.get(e)||[],i=s.get(e)||[];for(const e of t)e(i)}this._stale_children&&"manual"!==this.model.render_policy&&(this.render_esm(),this._update_children(),this.invalidate_layout()),this._stale_children=!1}on_child_render(e,t){this._child_callbacks.has(e)||this._child_callbacks.set(e,[]);(this._child_callbacks.get(e)||[]).push(t)}remove_on_child_render(e,t){if(this._child_callbacks.has(e))if(void 0===t)this._child_callbacks.delete(e);else{let s=this._child_callbacks.get(e)||[];s=s.filter(e=>e!==t),this._child_callbacks.set(e,s)}}}s.ReactiveESMView=ReactiveESMView,s.RenderPolicy=(0,m.Enum)("manual","children");class ReactiveESM extends w.HTMLBox{compiled=null;compiled_module=null;compile_error=null;model_proxy;render_module=null;sucrase_transforms=["typescript"];_destroyer=null;_esm_watchers=new Map;_event_views=new Set;constructor(e){super(e)}initialize(){super.initialize(),this.model_proxy=new Proxy(this,{get:A,set:C}),this.recompile()}connect_signals(){super.connect_signals(),this.connect(this.properties.esm.change,()=>this.recompile()),this.connect(this.properties.importmap.change,()=>this.recompile()),this.on_event(S,e=>{for(const t of this._event_views)t._dispatch_event(e.data)})}_resolve_watch(e){const t=e.split(".");let s=this.data;for(let e=0;e<t.length-1;e++){if(null==s||null==s.properties||!(t[e]in s.properties)){s=null;break}s=s[t[e]]}const i=t[t.length-1];return null!=s&&null!=s.properties&&i in s.properties?{target:s,name:i,signal:s.property(i).change}:e in this.properties?{target:this,name:e,signal:this.property(e).change}:null}watch(e,t,s,i=!1){const n=this._resolve_watch(t);if(null==n)return;const{target:r,name:l,signal:o}=n,a=s;if(!i&&r===this.data&&this.events.includes(l)){const e=s;s=()=>{this.data[l]&&(e(),this.data.setv({[l]:!1}))}}if(r===this.data&&this.children.includes(l)){const t=s;s=async()=>{if(null==e)return void t();if(e._stale_children=!0,await e._update_children_chain,"manual"!==this.render_policy)return void t();let s;e.root._await_ready(new Promise(e=>{s=e})),t(),e.render_children(),e._update_children(),e.invalidate_layout();const i=e=>{const t=[e.ready];for(const s of e.child_views||[])t.push(...i(s));return t},n=[];for(const t of e.child_views)n.push(...i(t));n.length>0?Promise.all(n).then(()=>s()):s()}}o.connect(s);const c=this._esm_watchers.get(t),d={view:e,orig:a,cb:s,signal:o};null==c?this._esm_watchers.set(t,[d]):c.push(d)}unwatch(e,t,s){const i=this._esm_watchers.get(t);if(null==i)return!1;let n=!1;const r=[];for(const t of i)t.view===e&&t.orig===s?n=t.signal.disconnect(t.cb)||n:r.push(t);return r.length>0?this._esm_watchers.set(t,r):this._esm_watchers.delete(t),n}disconnect_watchers(e){for(const[t,s]of this._esm_watchers){const i=[];for(const t of s)t.view===e?t.signal.disconnect(t.cb):i.push(t);i.length>0?this._esm_watchers.set(t,i):this._esm_watchers.delete(t)}}async _declare_importmap(){if(await b.resources.ensure_shim(this.external_resources?.shim),this.importmap){const e=JSON.stringify(this.importmap);E.has(e)||(E.add(e),b.resources.add_import_map(this.importmap))}}_run_initializer(e){const t={model:this.model_proxy};this._destroyer=e(t)}destroy(){super.destroy(),this._destroyer&&this._destroyer(this.model_proxy)}init_module(){this.compile_error||(this.render_module=this._render_module())}_render_module(){return O}_cached_module(e,t){let s=R.get(e);return null==s&&(s=L(t()),R.set(e,s)),s}get resolved_render_module(){return null==this.render_module?null:D.get(this.render_module)??null}_import_source(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),s=b.resources.import_module(t,this.external_resources?.shim);return s.finally(()=>URL.revokeObjectURL(t)).catch(()=>{}),s}compile(){if(null!=this.bundle)return this.esm;let e;try{e=(0,a.transform)(this.esm,{transforms:this.sucrase_transforms,filePath:"render.tsx"}).code}catch(e){if(e instanceof SyntaxError){if(this.dev)return this.compile_error=e,null;throw e.message=`${e.message}. See more information with '--dev' flag.`,e}throw e}return e}get _module_cache_key(){return"url"===this.bundle?this.esm:this.bundle||`${this.class_name}-${function(e){let t=x.get(e);return void 0===t&&(t=x.size,x.set(e,t)),t}(this.esm)}`}async recompile(){this.compile_error=null;const e=!this.dev||this.bundle,t=e?this._module_cache_key:"",s=`${this.type}:${t}`;let i=e?z.get(s)??null:null;if(null===i){if(i=this.compile(),null===i)return void(this.compiled_module=Promise.resolve(null));e&&z.set(s,i)}const n=i;this.compiled=n;const r=this._declare_importmap();let l,o;if(e&&R.has(t)){const e=R.get(t);l=r.then(()=>e)}else e&&R.set(t,new Promise(e=>{o=e})),l="url"===this.bundle?r.then(()=>b.resources.import_module(this.esm,this.external_resources?.shim)):r.then(()=>this._import_source(n));this.compiled_module=l.then(e=>{o&&o(e);try{let t;if(null!=this.bundle&&(e.default||{}).hasOwnProperty(this.class_name)&&(e=e.default[this.class_name]),e.initialize)t=e.initialize;else if(e.default&&e.default.initialize)t=e.default.initialize;else if("function"==typeof e.default){const s=e.default();e={default:s},t=s.initialize}return t&&this._run_initializer(t),this.init_module(),e}catch(e){return this.dev&&(this.compile_error=e),console.error(`Could not initialize module due to error: ${e}`),null}})}static __module__="panel.models.esm";static{this.prototype.default_view=ReactiveESMView,this.define(({Any:e,Array:t,Bool:i,Nullable:n,Str:r})=>({_defs:[t(e),[]],css_bundle:[n(r),null],bundle:[n(r),null],children:[t(r),[]],class_name:[r,""],data:[e],dev:[i,!1],esm:[r,""],events:[t(r),[]],importmap:[e,{}],render_policy:[s.RenderPolicy,"children"]}))}}s.ReactiveESM=ReactiveESM},
|
|
51
|
+
"f4bc4e23b4": function _(e,t,i,s,n){s();const r=e("8e484b67b0");class AnyWidgetModelAdapter{constructor(e){this.view=null,this.model=e,this.model_changes={},this.data_changes={}}get(e){let t;const i=e.split(".");let s=this.model.data;for(let e=0;e<i.length-1;e++){if(!(s&&s.attributes&&i[e]in s.attributes)){s=null;break}s=s.attributes[i[e]]}return t=s&&s.attributes&&i[i.length-1]in s.attributes?s.attributes[i[i.length-1]]:this.model.attributes[e],t instanceof ArrayBuffer&&(t=new DataView(t)),t}set(e,t){e.split(".")[0]in this.model.data.attributes?this.data_changes={...this.data_changes,[e]:t}:e in this.model.attributes&&(this.model_changes={...this.model_changes,[e]:t})}save_changes(){this.model.setv(this.model_changes),this.model_changes={};for(const e in this.data_changes){const t=e.split(".");let i=this.model.data;for(let s=0;s<t.length-1;s++){if(!(i&&i.attributes&&t[s]in i.attributes)){console.warn(`Skipping '${e}': '${t[s]}' does not exist.`),i=null;break}i=i.attributes[t[s]]}i&&i.attributes&&t[t.length-1]in i.attributes?i.setv({[t[t.length-1]]:this.data_changes[e]}):console.warn(`Skipping '${e}': Final property '${t[t.length-1]}' not found.`)}this.data_changes={}}on(e,t){e.startsWith("change:")?this.model.watch(this.view,e.slice(7),t):"msg:custom"===e&&this.view?this.view.on_event(t):console.error(`Event of type '${e}' not recognized.`)}off(e,t){e.startsWith("change:")?this.model.unwatch(this.view,e.slice(7),t):"msg:custom"===e&&this.view?this.view.remove_on_event(t):console.error(`Event of type '${e}' not recognized.`)}}class AnyWidgetAdapter extends AnyWidgetModelAdapter{constructor(e){super(e.model),this.view=e}get_child(e){const t=this.model.data[e];if(Array.isArray(t)){const e=[];for(const i of t){const t=this.view.get_child_view(i);t&&e.push(t.el)}return e}return this.view.get_child_view(t)?.el}}const o=Promise.resolve({default:{render:function(e){if(e.is_destroyed)return;const t=Promise.resolve(e.render_fn({view:e,model:e.adapter,data:e.model.data,el:e.container})||null);e.destroyer=t,t.then(()=>e.after_rendered())}}});class AnyWidgetComponentView extends r.ReactiveESMView{adapter;destroyer;initialize(){super.initialize(),this.adapter=new AnyWidgetAdapter(this)}remove(){super.remove(),this.destroyer&&this.destroyer.then(e=>e({model:this.adapter,el:this.container}))}after_rendered(){this.render_children(),this._rendered=!0}}i.AnyWidgetComponentView=AnyWidgetComponentView;class AnyWidgetComponent extends r.ReactiveESM{sucrase_transforms=["typescript","jsx"];constructor(e){super(e)}_render_module(){return o}_run_initializer(e){e({model:new AnyWidgetModelAdapter(this)})}static __module__="panel.models.esm";static{this.prototype.default_view=AnyWidgetComponentView}}i.AnyWidgetComponent=AnyWidgetComponent},
|
|
52
|
+
"8e484b67b0": function _(e,t,s,i,n){i(),s.model_getter=j,s.model_setter=$;const r=e("tslib");var l,o=this&&this.__decorate||function(e,t,s,i){var n,r=arguments.length,l=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,s,l):n(t,s))||l);return r>3&&l&&Object.defineProperty(t,s,l),l};const a=e("28a8b14fda"),c=e("@bokehjs/core/bokeh_events"),d=e("@bokehjs/core/dom"),h=e("@bokehjs/core/dom"),u=e("@bokehjs/core/dom_view"),m=e("@bokehjs/core/kinds"),f=e("@bokehjs/models/layouts/layout_dom"),p=e("@bokehjs/core/util/types"),y=e("@bokehjs/models/ui/ui_element"),v=e("e5a0036205"),g=e("e40e09e4dd"),w=e("00beb93e38"),b=e("133ce95cfa"),k=e("aa07eb54cc"),M=r.__importDefault(e("727a14f76b")),R=new Map,z=new Map,x=new Map,E=new Set;class DataEvent extends c.ModelEvent{data;constructor(e){super(),this.data=e}get event_values(){return{model:this.origin,data:this.data}}static{this.prototype.event_name="data_event"}}s.DataEvent=DataEvent;let S=l=class ESMEvent extends DataEvent{static from_values(e){const{model:t,data:s}=e,i=new l(s);return i.origin=t,i}};s.ESMEvent=S,s.ESMEvent=S=l=o([(0,c.server_event)("esm_event")],S);const P=new Set(["get_child","send_msg","send_event","off","on"]);function j(e,t){const s=e.model;if(P.has(t)){let s=e._proxy_methods.get(t);return void 0===s&&(s=function(e,t){const s=e.model;if("get_child"===t)return t=>{e.accessed_children.includes(t)||e.accessed_children.push(t);const i=s.data[t];if((0,p.isArray)(i)){const t=[];for(const s of i)t.push(e.get_child_view(s)?.el);return t}return null!=s?e.get_child_view(i)?.el:null};if("send_msg"===t)return e=>{s.trigger_event(new DataEvent(e))};if("send_event"===t)return(e,t)=>{const i=(0,k.convertUndefined)((0,v.serializeEvent)(t));s.trigger_event(new g.DOMEvent(e,i))};if("off"===t)return(t,i)=>{const n=(0,p.isArray)(t)?t:[t];for(let t of n)if(t.startsWith("change:")&&(t=t.slice(7)),t in s.attributes||t.split(".")[0]in s.data.attributes)s.unwatch(e,t,i);else if("msg:custom"!==t){if(t.startsWith("lifecycle:")&&(t=t.slice(10)),e._lifecycle_handlers.has(t)){const s=e._lifecycle_handlers.get(t);s&&s.includes(i)&&e._lifecycle_handlers.set(t,s.filter(e=>e!==i));continue}console.warn(`Could not unregister callback for event type '${t}'`)}else e.remove_on_event(i)};if("on"===t)return(t,i,n=!1)=>{const r=(0,p.isArray)(t)?t:[t];for(let t of r)t.startsWith("change:")&&(t=t.slice(7)),t in s.attributes||t.split(".")[0]in s.data.attributes?s.watch(e,t,i,n):"msg:custom"!==t?(t.startsWith("lifecycle:")&&(t=t.slice(10)),e._lifecycle_handlers.has(t)?(e._lifecycle_handlers.get(t)||[]).push(i):console.warn(`Could not register callback for event type '${t}'`)):e.on_event(i)};throw new Error(`unknown proxy method '${t}'`)}(e,t),e._proxy_methods.set(t,s)),s}return Reflect.has(s.data,t)?(t in s.data.attributes&&!e.accessed_properties.includes(t)&&e.accessed_properties.push(t),Reflect.get(s.data,t)):Reflect.has(s,t)?Reflect.get(s,t):void 0}function $(e,t,s){const i=e.model;return Reflect.has(i.data,t)?Reflect.set(i.data,t,s):!!Reflect.has(i,t)&&Reflect.set(i,t,s)}function A(e,t){return Reflect.has(e.data,t)?Reflect.get(e.data,t):Reflect.has(e,t)?Reflect.get(e,t):void 0}function C(e,t,s){return Reflect.has(e.data,t)?Reflect.set(e.data,t,s):!!Reflect.has(e,t)&&Reflect.set(e,t,s)}const D=new WeakMap;function L(e){return e.then(t=>D.set(e,t),()=>{}),e}const O=L(Promise.resolve({default:{render:function(e){if(e.is_destroyed)return;const t=e.render_fn({view:e,model:e.model_proxy,data:e.model.data,el:e.container});Promise.resolve(t).then(t=>{t instanceof Element&&e.container.replaceChildren(t),e.after_rendered()})}}})),V=new Set;class ReactiveESMView extends w.HTMLBoxView{container;accessed_properties=[];accessed_children=[];compiled_module=null;model_proxy;_child_callbacks;_child_rendered=new Map;_event_handlers=[];_lifecycle_handlers=new Map([["update_layout",[]],["after_layout",[]],["after_render",[]],["resize",[]],["remove",[]],["mounted",[]]]);_module_cache;_rendered=!1;_stale_children=!1;_mounted=new Map;_update_children_chain=Promise.resolve();_layout_pending=!1;_proxy_methods=new Map;_last_size=null;initialize(){super.initialize(),this._module_cache=R,this._child_callbacks=new Map,this.model_proxy=new Proxy(this,{get:j,set:$})}async lazy_initialize(){await super.lazy_initialize(),this.compiled_module=await this.model.compiled_module}stylesheets(){const e=super.stylesheets();return e.push(M.default),this.model.css_bundle&&("url"===this.model.bundle?e.push(new h.ImportedStyleSheet((0,b.resource_url)(this.model.css_bundle))):e.push(this.model.css_bundle)),e}connect_signals(){super.connect_signals();const{esm:e,importmap:t,class_name:s}=this.model.properties;this.on_change([e,t],async()=>{this.compiled_module=await this.model.compiled_module,this.invalidate_render()}),this.on_change(s,()=>{this.container.className=this.model.class_name.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()});const i=this.model.children.map(e=>this.model.data.properties[e]);for(const e of i)this.connect(e.change,()=>this.update_children());this.model._event_views.add(this)}disconnect_signals(){super.disconnect_signals(),this._child_callbacks=new Map,this.model._event_views.delete(this),this.model.disconnect_watchers(this)}_dispatch_event(e){for(const t of this._event_handlers)t(e)}_on_mounted(){}r_after_render(){for(const e of this.children_views())e instanceof u.DOMView&&this._is_mountable(e)&&e.r_after_render();this.after_render(),this._was_built=!0}_is_mountable(e){return!this._child_views.has(e.model)||e.el.isConnected}get layoutable_views(){return super.layoutable_views.filter(e=>this._is_mountable(e)&&e._was_built)}update_layout(){this.update_style();for(const e of this.child_views)e.parent_style.clear();for(const e of this.child_views)e instanceof f.LayoutDOMView&&e.update_layout();this._update_layout()}notify_mount(e,t,s=!1){this._mounted.has(e)||this._mounted.set(e,new Set),s?this._mounted.get(e)?.delete(t):this._mounted.get(e)?.add(t);let i=this.model.data[e];(0,p.isArray)(i)||(i=[i]);const n=this._mounted.get(e);if(n.size>=i.length&&i.every(e=>n.has(e.id))){this._on_mounted();for(const t of this._lifecycle_handlers.get("mounted")||[])t(e)}}on_event(e){this._event_handlers.push(e)}remove_on_event(e){return!!this._event_handlers.includes(e)&&(this._event_handlers=this._event_handlers.filter(t=>t!==e),!0)}get_child_view(e){return this._child_views.get(e)}get render_fn(){return null===this.compiled_module?null:this.compiled_module.default?this.compiled_module.default.render:this.compiled_module.render}get child_models(){const e=[];for(const t of this.model.children){const s=this.model.data[t];if((0,p.isArray)(s))for(const t of s)e.push(t);else null!=s&&e.push(s)}return e}render_error(e){const t=(0,d.div)({class:"error"});t.innerHTML=(0,k.formatError)(e,this.model.esm),this.container.appendChild(t)}render(){this.empty(),this._update_stylesheets(),this._update_css_classes(),this._apply_styles(),this._update_css_variables(),this._apply_visible(),this._child_callbacks=new Map,this._child_rendered.clear(),this._rendered=!1,(0,w.set_size)(this.el,this.model),this.container=(0,d.div)(),this.container.className=this.model.class_name.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),(0,w.set_size)(this.container,this.model,!1),this.shadow_el.append(this.container),this.model.compile_error?this.render_error(this.model.compile_error):this.render_esm();for(const e of this.element_views){const t=e.rendering_target()??this.self_target??this.shadow_el;e.render_to(t)}}get is_managed(){return this.parent instanceof f.LayoutDOMView&&!(this.parent instanceof ReactiveESMView)}render_child(e){(0,w.rerender_view)(e,!1),this.schedule_layout()}schedule_layout(){this._layout_pending||(this._layout_pending=!0,queueMicrotask(()=>{this._layout_pending&&!this.is_destroyed&&(this.compute_layout(),this.notify_finished())}))}compute_layout(){this._layout_pending=!1,this.is_managed?super.compute_layout():(this.measure_layout(),this.update_bbox(),this._compute_layout(),this.after_layout(),this._layout_computed=!0)}_update_bbox(){const e=(()=>{if(this.el.isConnected){if(null!=this.el.offsetParent)return!0;{const{position:e,display:t}=getComputedStyle(this.el);return"fixed"==e&&"none"!=t}}return!1})();this._is_displayed=e;const t=e?this.el.offsetWidth:0,s=e?this.el.offsetHeight:0,i=this._last_size;return(null==i||i[0]!==t||i[1]!==s)&&(this._last_size=[t,s],!0)}after_rendered(){const e=this._lifecycle_handlers.get("after_render")||[];for(const t of e)t();if(this.render_children(),this.model_proxy.on(this.accessed_children,()=>{this._stale_children=!0}),!this._rendered)for(const e of this._lifecycle_handlers.get("after_layout")||[])e();this._rendered=!0}render_esm(){if(null===this.model.compiled||null===this.model.render_module)return;this.container.replaceChildren(),this.accessed_properties=[];for(const e of this._lifecycle_handlers.keys())(this._lifecycle_handlers.get(e)||[]).splice(0);this.model.disconnect_watchers(this);const e=this.model.render_module.then(e=>e.default.render(this));this._await_ready(e)}render_children(){for(const e of this.accessed_children){const t=this.model.data[e],s=(0,p.isArray)(t)?t:[t];for(const e of s){const t=this._child_views.get(e);if(!t||this._child_rendered.get(t))continue;t.el.parentNode&&(this._child_rendered.set(t,!1),this.render_child(t),this._child_rendered.set(t,!0))}}this._stale_children=!1,this.after_render()}has_finished(){if(!y.UIElementView.prototype.has_finished.call(this))return!1;if(this.is_layout_root&&!this._layout_computed)return!1;for(const e of this.child_views)if(this._child_rendered.has(e)&&!e.has_finished())return!1;return!0}notify_finished(){if(this.is_root)return void super.notify_finished();const e=this.root;V.has(e)||(V.add(e),queueMicrotask(()=>{V.delete(e),e.is_destroyed||e.notify_finished()}))}invalidate_layout(){this.is_managed?super.invalidate_layout():(this.update_layout(),this.schedule_layout())}remove(){super.remove();for(const e of this._lifecycle_handlers.get("remove")||[])e();this._child_callbacks.clear(),this._child_rendered.clear(),this._mounted.clear()}after_resize(){if(this._rendered){super.after_resize();for(const e of this._lifecycle_handlers.get("resize")||[])e()}}after_layout(){if(super.after_layout(),this._rendered)for(const e of this._lifecycle_handlers.get("after_layout")||[])e()}_child_names(){const e=new Map;for(const t of this.model.children){const s=this.model.data[t];for(const i of(0,p.isArray)(s)?s:[s])null==i||e.has(i)||e.set(i,t)}return e}async update_children(){const e=this._update_children_chain.then(()=>this._update_children_pass());return this._update_children_chain=e.then(()=>{},()=>{}),e}_group_new_views(e){const t=this._child_names(),s=new Map;for(const i of this.child_views){if(!e.has(i))continue;const n=t.get(i.model);if(null==n)continue;const r=s.get(n);null==r?s.set(n,[i]):r.push(i)}return s}async _update_children_pass(){const e=new Set(await this.build_child_views()),t=this.child_views;if("manual"!==this.model.render_policy)for(const e of t)e.el.remove();const s=this._group_new_views(e),i=new Set(t);for(const e of this._child_rendered.keys())i.has(e)||this._child_rendered.delete(e);for(const e of this.model.children){const t=this._child_callbacks.get(e)||[],i=s.get(e)||[];for(const e of t)e(i)}this._stale_children&&"manual"!==this.model.render_policy&&(this.render_esm(),this._update_children(),this.invalidate_layout()),this._stale_children=!1}on_child_render(e,t){this._child_callbacks.has(e)||this._child_callbacks.set(e,[]);(this._child_callbacks.get(e)||[]).push(t)}remove_on_child_render(e,t){if(this._child_callbacks.has(e))if(void 0===t)this._child_callbacks.delete(e);else{let s=this._child_callbacks.get(e)||[];s=s.filter(e=>e!==t),this._child_callbacks.set(e,s)}}}s.ReactiveESMView=ReactiveESMView,s.RenderPolicy=(0,m.Enum)("manual","children");class ReactiveESM extends w.HTMLBox{compiled=null;compiled_module=null;compile_error=null;model_proxy;render_module=null;sucrase_transforms=["typescript"];_destroyer=null;_esm_watchers=new Map;_event_views=new Set;constructor(e){super(e)}initialize(){super.initialize(),this.model_proxy=new Proxy(this,{get:A,set:C}),this.recompile()}connect_signals(){super.connect_signals(),this.connect(this.properties.esm.change,()=>this.recompile()),this.connect(this.properties.importmap.change,()=>this.recompile()),this.on_event(S,e=>{for(const t of this._event_views)t._dispatch_event(e.data)})}_resolve_watch(e){const t=e.split(".");let s=this.data;for(let e=0;e<t.length-1;e++){if(null==s||null==s.properties||!(t[e]in s.properties)){s=null;break}s=s[t[e]]}const i=t[t.length-1];return null!=s&&null!=s.properties&&i in s.properties?{target:s,name:i,signal:s.property(i).change}:e in this.properties?{target:this,name:e,signal:this.property(e).change}:null}watch(e,t,s,i=!1){const n=this._resolve_watch(t);if(null==n)return;const{target:r,name:l,signal:o}=n,a=s;if(!i&&r===this.data&&this.events.includes(l)){const e=s;s=()=>{this.data[l]&&(e(),this.data.setv({[l]:!1}))}}if(r===this.data&&this.children.includes(l)){const t=s;s=async()=>{if(null==e)return void t();if(e._stale_children=!0,await e._update_children_chain,"manual"!==this.render_policy)return void t();let s;e.root._await_ready(new Promise(e=>{s=e})),t(),e.render_children(),e._update_children(),e.invalidate_layout();const i=e=>{const t=[e.ready];for(const s of e.child_views||[])t.push(...i(s));return t},n=[];for(const t of e.child_views)n.push(...i(t));n.length>0?Promise.all(n).then(()=>s()):s()}}o.connect(s);const c=this._esm_watchers.get(t),d={view:e,orig:a,cb:s,signal:o};null==c?this._esm_watchers.set(t,[d]):c.push(d)}unwatch(e,t,s){const i=this._esm_watchers.get(t);if(null==i)return!1;let n=!1;const r=[];for(const t of i)t.view===e&&t.orig===s?n=t.signal.disconnect(t.cb)||n:r.push(t);return r.length>0?this._esm_watchers.set(t,r):this._esm_watchers.delete(t),n}disconnect_watchers(e){for(const[t,s]of this._esm_watchers){const i=[];for(const t of s)t.view===e?t.signal.disconnect(t.cb):i.push(t);i.length>0?this._esm_watchers.set(t,i):this._esm_watchers.delete(t)}}async _declare_importmap(){if(await b.resources.ensure_shim(this.external_resources?.shim),this.importmap){const e=JSON.stringify(this.importmap);E.has(e)||(E.add(e),b.resources.add_import_map(this.importmap))}}_run_initializer(e){const t={model:this.model_proxy};this._destroyer=e(t)}destroy(){super.destroy(),this._destroyer&&this._destroyer(this.model_proxy)}init_module(){this.compile_error||(this.render_module=this._render_module())}_render_module(){return O}_cached_module(e,t){let s=R.get(e);return null==s&&(s=L(t()),R.set(e,s)),s}get resolved_render_module(){return null==this.render_module?null:D.get(this.render_module)??null}_import_source(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),s=b.resources.import_module(t,this.external_resources?.shim);return s.finally(()=>URL.revokeObjectURL(t)).catch(()=>{}),s}compile(){if(null!=this.bundle)return this.esm;let e;try{e=(0,a.transform)(this.esm,{transforms:this.sucrase_transforms,filePath:"render.tsx"}).code}catch(e){if(e instanceof SyntaxError){if(this.dev)return this.compile_error=e,null;throw e.message=`${e.message}. See more information with '--dev' flag.`,e}throw e}return e}get _module_cache_key(){return"url"===this.bundle?this.esm:this.bundle||`${this.class_name}-${function(e){let t=x.get(e);return void 0===t&&(t=x.size,x.set(e,t)),t}(this.esm)}`}async recompile(){this.compile_error=null;const e=!this.dev||this.bundle,t=e?this._module_cache_key:"",s=`${this.type}:${t}`;let i=e?z.get(s)??null:null;if(null===i){if(i=this.compile(),null===i)return void(this.compiled_module=Promise.resolve(null));e&&z.set(s,i)}const n=i;this.compiled=n;const r=this._declare_importmap();let l,o;if(e&&R.has(t)){const e=R.get(t);l=r.then(()=>e)}else e&&R.set(t,new Promise(e=>{o=e})),l="url"===this.bundle?r.then(()=>b.resources.import_module(this.esm,this.external_resources?.shim)):r.then(()=>this._import_source(n));this.compiled_module=l.then(e=>{o&&o(e);try{let t;if(null!=this.bundle&&(e.default||{}).hasOwnProperty(this.class_name)&&(e=e.default[this.class_name]),e.initialize)t=e.initialize;else if(e.default&&e.default.initialize)t=e.default.initialize;else if("function"==typeof e.default){const s=e.default();e={default:s},t=s.initialize}return t&&this._run_initializer(t),this.init_module(),e}catch(e){return this.dev&&(this.compile_error=e),console.error(`Could not initialize module due to error: ${e}`),null}})}static __module__="panel.models.esm";static{this.prototype.default_view=ReactiveESMView,this.define(({Any:e,Array:t,Bool:i,Nullable:n,Str:r})=>({_defs:[t(e),[]],css_bundle:[n(r),null],bundle:[n(r),null],children:[t(r),[]],class_name:[r,""],data:[e],dev:[i,!1],esm:[r,""],events:[t(r),[]],importmap:[e,{}],render_policy:[s.RenderPolicy,"children"]}))}}s.ReactiveESM=ReactiveESM},
|
|
53
53
|
"28a8b14fda": function _(e,t,r,s,o){s(),r.getVersion=function(){return"3.35.1"},r.transform=function(e,t){(0,i.validateOptions)(t);try{const r=k(e,t),s=new m.default(r,t.transforms,Boolean(t.enableLegacyBabel5ModuleInterop),t).transform();let o={code:s.code};if(t.sourceMapOptions){if(!t.filePath)throw new Error("filePath must be specified when generating a source map.");o={...o,sourceMap:(0,f.default)(s,t.filePath,t.sourceMapOptions,e,r.tokenProcessor.tokens)}}return o}catch(e){throw t.filePath&&(e.message=`Error transforming ${t.filePath}: ${e.message}`),e}},r.getFormattedTokens=function(e,t){const r=k(e,t).tokenProcessor.tokens;return(0,g.default)(e,r)};const n=e("tslib"),a=n.__importDefault(e("add4298d4c")),f=n.__importDefault(e("03a5a23920")),l=e("40e1a4d3af"),c=n.__importDefault(e("5f4ada3fc1")),p=n.__importDefault(e("425f39b83e")),i=e("bb0c9c6022"),u=e("7a45c9fdec"),d=n.__importDefault(e("1c7cc5e988")),m=n.__importDefault(e("131f5202c7")),g=n.__importDefault(e("2e6a9a5b28")),b=n.__importDefault(e("4160f5108d"));function k(e,t){const r=t.transforms.includes("jsx"),s=t.transforms.includes("typescript"),o=t.transforms.includes("flow"),n=!0===t.disableESTransforms,f=(0,u.parse)(e,r,s,o),i=f.tokens,m=f.scopes,g=new p.default(e,i),k=new l.HelperManager(g),h=new d.default(e,i,o,n,k),w=Boolean(t.enableLegacyTypeScriptModuleInterop);let y=null;return t.transforms.includes("imports")?(y=new a.default(g,h,w,t,t.transforms.includes("typescript"),Boolean(t.keepUnusedImports),k),y.preprocessTokens(),(0,c.default)(h,m,y.getGlobalNames()),t.transforms.includes("typescript")&&!t.keepUnusedImports&&y.pruneTypeOnlyImports()):t.transforms.includes("typescript")&&!t.keepUnusedImports&&(0,c.default)(h,m,(0,b.default)(h)),{tokenProcessor:h,scopes:m,nameManager:g,importProcessor:y,helperManager:k}}},
|
|
54
54
|
"add4298d4c": function _(e,t,n,s,o){s();const r=e("tslib"),i=e("bfb18d0576"),a=e("99ff836c64"),p=e("f0c35cbd76"),h=r.__importDefault(e("14d4ae78a4")),m=e("1ff9c9004b");class CJSImportProcessor{__init(){this.nonTypeIdentifiers=new Set}__init2(){this.importInfoByPath=new Map}__init3(){this.importsToReplace=new Map}__init4(){this.identifierReplacements=new Map}__init5(){this.exportBindingsByLocalName=new Map}constructor(e,t,n,s,o,r,i){this.nameManager=e,this.tokens=t,this.enableLegacyTypeScriptModuleInterop=n,this.options=s,this.isTypeScriptTransformEnabled=o,this.keepUnusedImports=r,this.helperManager=i,CJSImportProcessor.prototype.__init.call(this),CJSImportProcessor.prototype.__init2.call(this),CJSImportProcessor.prototype.__init3.call(this),CJSImportProcessor.prototype.__init4.call(this),CJSImportProcessor.prototype.__init5.call(this)}preprocessTokens(){for(let e=0;e<this.tokens.tokens.length;e++)this.tokens.matches1AtIndex(e,p.TokenType._import)&&!this.tokens.matches3AtIndex(e,p.TokenType._import,p.TokenType.name,p.TokenType.eq)&&this.preprocessImportAtIndex(e),this.tokens.matches1AtIndex(e,p.TokenType._export)&&!this.tokens.matches2AtIndex(e,p.TokenType._export,p.TokenType.eq)&&this.preprocessExportAtIndex(e);this.generateImportReplacements()}pruneTypeOnlyImports(){this.nonTypeIdentifiers=(0,m.getNonTypeIdentifiers)(this.tokens,this.options);for(const[e,t]of this.importInfoByPath.entries()){if(t.hasBareImport||t.hasStarExport||t.exportStarNames.length>0||t.namedExports.length>0)continue;[...t.defaultNames,...t.wildcardNames,...t.namedImports.map(({localName:e})=>e)].every(e=>this.shouldAutomaticallyElideImportedName(e))&&this.importsToReplace.set(e,"")}}shouldAutomaticallyElideImportedName(e){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.nonTypeIdentifiers.has(e)}generateImportReplacements(){for(const[e,t]of this.importInfoByPath.entries()){const{defaultNames:n,wildcardNames:s,namedImports:o,namedExports:r,exportStarNames:i,hasStarExport:a}=t;if(0===n.length&&0===s.length&&0===o.length&&0===r.length&&0===i.length&&!a){this.importsToReplace.set(e,`require('${e}');`);continue}const p=this.getFreeIdentifierForPath(e);let h;h=this.enableLegacyTypeScriptModuleInterop?p:s.length>0?s[0]:this.getFreeIdentifierForPath(e);let m=`var ${p} = require('${e}');`;if(s.length>0)for(const e of s){m+=` var ${e} = ${this.enableLegacyTypeScriptModuleInterop?p:`${this.helperManager.getHelperName("interopRequireWildcard")}(${p})`};`}else i.length>0&&h!==p?m+=` var ${h} = ${this.helperManager.getHelperName("interopRequireWildcard")}(${p});`:n.length>0&&h!==p&&(m+=` var ${h} = ${this.helperManager.getHelperName("interopRequireDefault")}(${p});`);for(const{importedName:e,localName:t}of r)m+=` ${this.helperManager.getHelperName("createNamedExportFrom")}(${p}, '${t}', '${e}');`;for(const e of i)m+=` exports.${e} = ${h};`;a&&(m+=` ${this.helperManager.getHelperName("createStarExport")}(${p});`),this.importsToReplace.set(e,m);for(const e of n)this.identifierReplacements.set(e,`${h}.default`);for(const{importedName:e,localName:t}of o)this.identifierReplacements.set(t,`${p}.${e}`)}}getFreeIdentifierForPath(e){const t=e.split("/"),n=t[t.length-1].replace(/\W/g,"");return this.nameManager.claimFreeName(`_${n}`)}preprocessImportAtIndex(e){const t=[],n=[],s=[];if(e++,(this.tokens.matchesContextualAtIndex(e,a.ContextualKeyword._type)||this.tokens.matches1AtIndex(e,p.TokenType._typeof))&&!this.tokens.matches1AtIndex(e+1,p.TokenType.comma)&&!this.tokens.matchesContextualAtIndex(e+1,a.ContextualKeyword._from))return;if(this.tokens.matches1AtIndex(e,p.TokenType.parenL))return;if(this.tokens.matches1AtIndex(e,p.TokenType.name)&&(t.push(this.tokens.identifierNameAtIndex(e)),e++,this.tokens.matches1AtIndex(e,p.TokenType.comma)&&e++),this.tokens.matches1AtIndex(e,p.TokenType.star)&&(e+=2,n.push(this.tokens.identifierNameAtIndex(e)),e++),this.tokens.matches1AtIndex(e,p.TokenType.braceL)){const n=this.getNamedImports(e+1);e=n.newIndex;for(const e of n.namedImports)"default"===e.importedName?t.push(e.localName):s.push(e)}if(this.tokens.matchesContextualAtIndex(e,a.ContextualKeyword._from)&&e++,!this.tokens.matches1AtIndex(e,p.TokenType.string))throw new Error("Expected string token at the end of import statement.");const o=this.tokens.stringValueAtIndex(e),r=this.getImportInfo(o);r.defaultNames.push(...t),r.wildcardNames.push(...n),r.namedImports.push(...s),0===t.length&&0===n.length&&0===s.length&&(r.hasBareImport=!0)}preprocessExportAtIndex(e){if(this.tokens.matches2AtIndex(e,p.TokenType._export,p.TokenType._var)||this.tokens.matches2AtIndex(e,p.TokenType._export,p.TokenType._let)||this.tokens.matches2AtIndex(e,p.TokenType._export,p.TokenType._const))this.preprocessVarExportAtIndex(e);else if(this.tokens.matches2AtIndex(e,p.TokenType._export,p.TokenType._function)||this.tokens.matches2AtIndex(e,p.TokenType._export,p.TokenType._class)){const t=this.tokens.identifierNameAtIndex(e+2);this.addExportBinding(t,t)}else if(this.tokens.matches3AtIndex(e,p.TokenType._export,p.TokenType.name,p.TokenType._function)){const t=this.tokens.identifierNameAtIndex(e+3);this.addExportBinding(t,t)}else this.tokens.matches2AtIndex(e,p.TokenType._export,p.TokenType.braceL)?this.preprocessNamedExportAtIndex(e):this.tokens.matches2AtIndex(e,p.TokenType._export,p.TokenType.star)&&this.preprocessExportStarAtIndex(e)}preprocessVarExportAtIndex(e){let t=0;for(let n=e+2;;n++)if(this.tokens.matches1AtIndex(n,p.TokenType.braceL)||this.tokens.matches1AtIndex(n,p.TokenType.dollarBraceL)||this.tokens.matches1AtIndex(n,p.TokenType.bracketL))t++;else if(this.tokens.matches1AtIndex(n,p.TokenType.braceR)||this.tokens.matches1AtIndex(n,p.TokenType.bracketR))t--;else{if(0===t&&!this.tokens.matches1AtIndex(n,p.TokenType.name))break;if(this.tokens.matches1AtIndex(1,p.TokenType.eq)){const e=this.tokens.currentToken().rhsEndIndex;if(null==e)throw new Error("Expected = token with an end index.");n=e-1}else{const e=this.tokens.tokens[n];if((0,i.isDeclaration)(e)){const e=this.tokens.identifierNameAtIndex(n);this.identifierReplacements.set(e,`exports.${e}`)}}}}preprocessNamedExportAtIndex(e){e+=2;const{newIndex:t,namedImports:n}=this.getNamedImports(e);if(e=t,!this.tokens.matchesContextualAtIndex(e,a.ContextualKeyword._from)){for(const{importedName:e,localName:t}of n)this.addExportBinding(e,t);return}if(e++,!this.tokens.matches1AtIndex(e,p.TokenType.string))throw new Error("Expected string token at the end of import statement.");const s=this.tokens.stringValueAtIndex(e);this.getImportInfo(s).namedExports.push(...n)}preprocessExportStarAtIndex(e){let t=null;if(this.tokens.matches3AtIndex(e,p.TokenType._export,p.TokenType.star,p.TokenType._as)?(e+=3,t=this.tokens.identifierNameAtIndex(e),e+=2):e+=3,!this.tokens.matches1AtIndex(e,p.TokenType.string))throw new Error("Expected string token at the end of star export statement.");const n=this.tokens.stringValueAtIndex(e),s=this.getImportInfo(n);null!==t?s.exportStarNames.push(t):s.hasStarExport=!0}getNamedImports(e){const t=[];for(;;){if(this.tokens.matches1AtIndex(e,p.TokenType.braceR)){e++;break}const n=(0,h.default)(this.tokens,e);if(e=n.endIndex,n.isType||t.push({importedName:n.leftName,localName:n.rightName}),this.tokens.matches2AtIndex(e,p.TokenType.comma,p.TokenType.braceR)){e+=2;break}if(this.tokens.matches1AtIndex(e,p.TokenType.braceR)){e++;break}if(!this.tokens.matches1AtIndex(e,p.TokenType.comma))throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.tokens[e])}`);e++}return{newIndex:e,namedImports:t}}getImportInfo(e){const t=this.importInfoByPath.get(e);if(t)return t;const n={defaultNames:[],wildcardNames:[],namedImports:[],namedExports:[],hasBareImport:!1,exportStarNames:[],hasStarExport:!1};return this.importInfoByPath.set(e,n),n}addExportBinding(e,t){this.exportBindingsByLocalName.has(e)||this.exportBindingsByLocalName.set(e,[]),this.exportBindingsByLocalName.get(e).push(t)}claimImportCode(e){const t=this.importsToReplace.get(e);return this.importsToReplace.set(e,""),t||""}getIdentifierReplacement(e){return this.identifierReplacements.get(e)||null}resolveExportBinding(e){const t=this.exportBindingsByLocalName.get(e);return t&&0!==t.length?t.map(e=>`exports.${e}`).join(" = "):null}getGlobalNames(){return new Set([...this.identifierReplacements.keys(),...this.exportBindingsByLocalName.keys()])}}n.default=CJSImportProcessor},
|
|
55
55
|
"bfb18d0576": function _(e,t,o,a,s){a(),o.isDeclaration=function(e){const t=e.identifierRole;return t===o.IdentifierRole.TopLevelDeclaration||t===o.IdentifierRole.FunctionScopedDeclaration||t===o.IdentifierRole.BlockScopedDeclaration||t===o.IdentifierRole.ObjectShorthandTopLevelDeclaration||t===o.IdentifierRole.ObjectShorthandFunctionScopedDeclaration||t===o.IdentifierRole.ObjectShorthandBlockScopedDeclaration},o.isNonTopLevelDeclaration=function(e){const t=e.identifierRole;return t===o.IdentifierRole.FunctionScopedDeclaration||t===o.IdentifierRole.BlockScopedDeclaration||t===o.IdentifierRole.ObjectShorthandFunctionScopedDeclaration||t===o.IdentifierRole.ObjectShorthandBlockScopedDeclaration},o.isTopLevelDeclaration=function(e){const t=e.identifierRole;return t===o.IdentifierRole.TopLevelDeclaration||t===o.IdentifierRole.ObjectShorthandTopLevelDeclaration||t===o.IdentifierRole.ImportDeclaration},o.isBlockScopedDeclaration=function(e){const t=e.identifierRole;return t===o.IdentifierRole.TopLevelDeclaration||t===o.IdentifierRole.BlockScopedDeclaration||t===o.IdentifierRole.ObjectShorthandTopLevelDeclaration||t===o.IdentifierRole.ObjectShorthandBlockScopedDeclaration},o.isFunctionScopedDeclaration=function(e){const t=e.identifierRole;return t===o.IdentifierRole.FunctionScopedDeclaration||t===o.IdentifierRole.ObjectShorthandFunctionScopedDeclaration},o.isObjectShorthandDeclaration=function(e){return e.identifierRole===o.IdentifierRole.ObjectShorthandTopLevelDeclaration||e.identifierRole===o.IdentifierRole.ObjectShorthandBlockScopedDeclaration||e.identifierRole===o.IdentifierRole.ObjectShorthandFunctionScopedDeclaration},o.next=T,o.nextTemplateToken=function(){r.state.tokens.push(new Token),r.state.start=r.state.pos,function(){for(;;){if(r.state.pos>=r.input.length)return void(0,c.unexpected)("Unterminated template");const e=r.input.charCodeAt(r.state.pos);if(e===i.charCodes.graveAccent||e===i.charCodes.dollarSign&&r.input.charCodeAt(r.state.pos+1)===i.charCodes.leftCurlyBrace)return r.state.pos===r.state.start&&k(u.TokenType.template)?e===i.charCodes.dollarSign?(r.state.pos+=2,void v(u.TokenType.dollarBraceL)):(++r.state.pos,void v(u.TokenType.backQuote)):void v(u.TokenType.template);e===i.charCodes.backslash&&r.state.pos++,r.state.pos++}}()},o.retokenizeSlashAsRegex=function(){r.state.type===u.TokenType.assign&&--r.state.pos;!function(){const e=r.state.pos;let t=!1,o=!1;for(;;){if(r.state.pos>=r.input.length)return void(0,c.unexpected)("Unterminated regular expression",e);const a=r.input.charCodeAt(r.state.pos);if(t)t=!1;else{if(a===i.charCodes.leftSquareBracket)o=!0;else if(a===i.charCodes.rightSquareBracket&&o)o=!1;else if(a===i.charCodes.slash&&!o)break;t=a===i.charCodes.backslash}++r.state.pos}++r.state.pos,O(),v(u.TokenType.regexp)}()},o.pushTypeContext=function(e){for(let t=r.state.tokens.length-e;t<r.state.tokens.length;t++)r.state.tokens[t].isType=!0;const t=r.state.isType;return r.state.isType=!0,t},o.popTypeContext=function(e){r.state.isType=e},o.eat=C,o.eatTypeToken=function(e){const t=r.state.isType;r.state.isType=!0,C(e),r.state.isType=t},o.match=k,o.lookaheadType=function(){const e=r.state.snapshot();T();const t=r.state.type;return r.state.restoreFromSnapshot(e),t},o.lookaheadTypeAndKeyword=function(){const e=r.state.snapshot();T();const t=r.state.type,o=r.state.contextualKeyword;return r.state.restoreFromSnapshot(e),new TypeAndKeyword(t,o)},o.nextTokenStart=f,o.nextTokenStartSince=y,o.lookaheadCharCode=function(){return r.input.charCodeAt(f())},o.nextToken=g,o.skipLineComment=A,o.skipSpace=b,o.finishToken=v,o.rescan_gt=function(){r.state.type===u.TokenType.greaterThan&&(r.state.pos-=1,D())},o.getTokenFromCode=R,o.skipWord=O;const n=e("tslib"),r=e("540718e523"),c=e("bc94bbadc1"),i=e("22746c8ce8"),d=e("364148c9f0"),p=e("2a3176644a"),h=e("99ff836c64"),l=n.__importDefault(e("e6eb78033b")),u=e("f0c35cbd76");!function(e){e[e.Access=0]="Access";e[e.ExportAccess=1]="ExportAccess";e[e.TopLevelDeclaration=2]="TopLevelDeclaration";e[e.FunctionScopedDeclaration=3]="FunctionScopedDeclaration";e[e.BlockScopedDeclaration=4]="BlockScopedDeclaration";e[e.ObjectShorthandTopLevelDeclaration=5]="ObjectShorthandTopLevelDeclaration";e[e.ObjectShorthandFunctionScopedDeclaration=6]="ObjectShorthandFunctionScopedDeclaration";e[e.ObjectShorthandBlockScopedDeclaration=7]="ObjectShorthandBlockScopedDeclaration";e[e.ObjectShorthand=8]="ObjectShorthand";e[e.ImportDeclaration=9]="ImportDeclaration";e[e.ObjectKey=10]="ObjectKey";e[e.ImportAccess=11]="ImportAccess"}(o.IdentifierRole||(o.IdentifierRole={})),function(e){e[e.NoChildren=0]="NoChildren";e[e.OneChild=1]="OneChild";e[e.StaticChildren=2]="StaticChildren";e[e.KeyAfterPropSpread=3]="KeyAfterPropSpread"}(o.JSXRole||(o.JSXRole={}));class Token{constructor(){this.type=r.state.type,this.contextualKeyword=r.state.contextualKeyword,this.start=r.state.start,this.end=r.state.end,this.scopeDepth=r.state.scopeDepth,this.isType=r.state.isType,this.identifierRole=null,this.jsxRole=null,this.shadowsGlobal=!1,this.isAsyncOperation=!1,this.contextId=null,this.rhsEndIndex=null,this.isExpression=!1,this.numNullishCoalesceStarts=0,this.numNullishCoalesceEnds=0,this.isOptionalChainStart=!1,this.isOptionalChainEnd=!1,this.subscriptStartIndex=null,this.nullishStartIndex=null}}function T(){r.state.tokens.push(new Token),g()}function C(e){return!!k(e)&&(T(),!0)}function k(e){return r.state.type===e}o.Token=Token;class TypeAndKeyword{constructor(e,t){this.type=e,this.contextualKeyword=t}}function f(){return y(r.state.pos)}function y(e){p.skipWhiteSpace.lastIndex=e;return e+p.skipWhiteSpace.exec(r.input)[0].length}function g(){if(b(),r.state.start=r.state.pos,r.state.pos>=r.input.length){const e=r.state.tokens;return e.length>=2&&e[e.length-1].start>=r.input.length&&e[e.length-2].start>=r.input.length&&(0,c.unexpected)("Unexpectedly reached the end of input."),void v(u.TokenType.eof)}var e;e=r.input.charCodeAt(r.state.pos),d.IS_IDENTIFIER_START[e]||e===i.charCodes.backslash||e===i.charCodes.atSign&&r.input.charCodeAt(r.state.pos+1)===i.charCodes.atSign?(0,l.default)():R(e)}function S(){for(;r.input.charCodeAt(r.state.pos)!==i.charCodes.asterisk||r.input.charCodeAt(r.state.pos+1)!==i.charCodes.slash;)if(r.state.pos++,r.state.pos>r.input.length)return void(0,c.unexpected)("Unterminated comment",r.state.pos-2);r.state.pos+=2}function A(e){let t=r.input.charCodeAt(r.state.pos+=e);if(r.state.pos<r.input.length)for(;t!==i.charCodes.lineFeed&&t!==i.charCodes.carriageReturn&&t!==i.charCodes.lineSeparator&&t!==i.charCodes.paragraphSeparator&&++r.state.pos<r.input.length;)t=r.input.charCodeAt(r.state.pos)}function b(){for(;r.state.pos<r.input.length;){const e=r.input.charCodeAt(r.state.pos);switch(e){case i.charCodes.carriageReturn:r.input.charCodeAt(r.state.pos+1)===i.charCodes.lineFeed&&++r.state.pos;case i.charCodes.lineFeed:case i.charCodes.lineSeparator:case i.charCodes.paragraphSeparator:++r.state.pos;break;case i.charCodes.slash:switch(r.input.charCodeAt(r.state.pos+1)){case i.charCodes.asterisk:r.state.pos+=2,S();break;case i.charCodes.slash:A(2);break;default:return}break;default:if(!p.IS_WHITESPACE[e])return;++r.state.pos}}}function v(e,t=h.ContextualKeyword.NONE){r.state.end=r.state.pos,r.state.type=e,r.state.contextualKeyword=t}function D(){if(r.state.isType)return void I(u.TokenType.greaterThan,1);const e=r.input.charCodeAt(r.state.pos+1);if(e===i.charCodes.greaterThan){const e=r.input.charCodeAt(r.state.pos+2)===i.charCodes.greaterThan?3:2;return r.input.charCodeAt(r.state.pos+e)===i.charCodes.equalsTo?void I(u.TokenType.assign,e+1):void I(u.TokenType.bitShiftR,e)}e===i.charCodes.equalsTo?I(u.TokenType.relationalOrEqual,2):I(u.TokenType.greaterThan,1)}function R(e){switch(e){case i.charCodes.numberSign:return++r.state.pos,void v(u.TokenType.hash);case i.charCodes.dot:return void function(){const e=r.input.charCodeAt(r.state.pos+1);e>=i.charCodes.digit0&&e<=i.charCodes.digit9?x(!0):e===i.charCodes.dot&&r.input.charCodeAt(r.state.pos+2)===i.charCodes.dot?(r.state.pos+=3,v(u.TokenType.ellipsis)):(++r.state.pos,v(u.TokenType.dot))}();case i.charCodes.leftParenthesis:return++r.state.pos,void v(u.TokenType.parenL);case i.charCodes.rightParenthesis:return++r.state.pos,void v(u.TokenType.parenR);case i.charCodes.semicolon:return++r.state.pos,void v(u.TokenType.semi);case i.charCodes.comma:return++r.state.pos,void v(u.TokenType.comma);case i.charCodes.leftSquareBracket:return++r.state.pos,void v(u.TokenType.bracketL);case i.charCodes.rightSquareBracket:return++r.state.pos,void v(u.TokenType.bracketR);case i.charCodes.leftCurlyBrace:return void(r.isFlowEnabled&&r.input.charCodeAt(r.state.pos+1)===i.charCodes.verticalBar?I(u.TokenType.braceBarL,2):(++r.state.pos,v(u.TokenType.braceL)));case i.charCodes.rightCurlyBrace:return++r.state.pos,void v(u.TokenType.braceR);case i.charCodes.colon:return void(r.input.charCodeAt(r.state.pos+1)===i.charCodes.colon?I(u.TokenType.doubleColon,2):(++r.state.pos,v(u.TokenType.colon)));case i.charCodes.questionMark:return void function(){const e=r.input.charCodeAt(r.state.pos+1),t=r.input.charCodeAt(r.state.pos+2);e!==i.charCodes.questionMark||r.isFlowEnabled&&r.state.isType?e!==i.charCodes.dot||t>=i.charCodes.digit0&&t<=i.charCodes.digit9?(++r.state.pos,v(u.TokenType.question)):(r.state.pos+=2,v(u.TokenType.questionDot)):t===i.charCodes.equalsTo?I(u.TokenType.assign,3):I(u.TokenType.nullishCoalescing,2)}();case i.charCodes.atSign:return++r.state.pos,void v(u.TokenType.at);case i.charCodes.graveAccent:return++r.state.pos,void v(u.TokenType.backQuote);case i.charCodes.digit0:{const e=r.input.charCodeAt(r.state.pos+1);if(e===i.charCodes.lowercaseX||e===i.charCodes.uppercaseX||e===i.charCodes.lowercaseO||e===i.charCodes.uppercaseO||e===i.charCodes.lowercaseB||e===i.charCodes.uppercaseB)return void function(){r.state.pos+=2;for(;;){const e=r.input.charCodeAt(r.state.pos);if(!(e>=i.charCodes.digit0&&e<=i.charCodes.digit9||e>=i.charCodes.lowercaseA&&e<=i.charCodes.lowercaseF||e>=i.charCodes.uppercaseA&&e<=i.charCodes.uppercaseF||e===i.charCodes.underscore))break;r.state.pos++}const e=r.input.charCodeAt(r.state.pos);e===i.charCodes.lowercaseN?(++r.state.pos,v(u.TokenType.bigint)):v(u.TokenType.num)}()}case i.charCodes.digit1:case i.charCodes.digit2:case i.charCodes.digit3:case i.charCodes.digit4:case i.charCodes.digit5:case i.charCodes.digit6:case i.charCodes.digit7:case i.charCodes.digit8:case i.charCodes.digit9:return void x(!1);case i.charCodes.quotationMark:case i.charCodes.apostrophe:return void function(e){for(r.state.pos++;;){if(r.state.pos>=r.input.length)return void(0,c.unexpected)("Unterminated string constant");const t=r.input.charCodeAt(r.state.pos);if(t===i.charCodes.backslash)r.state.pos++;else if(t===e)break;r.state.pos++}r.state.pos++,v(u.TokenType.string)}(e);case i.charCodes.slash:return void(r.input.charCodeAt(r.state.pos+1)===i.charCodes.equalsTo?I(u.TokenType.assign,2):I(u.TokenType.slash,1));case i.charCodes.percentSign:case i.charCodes.asterisk:return void function(e){let t=e===i.charCodes.asterisk?u.TokenType.star:u.TokenType.modulo,o=1,a=r.input.charCodeAt(r.state.pos+1);e===i.charCodes.asterisk&&a===i.charCodes.asterisk&&(o++,a=r.input.charCodeAt(r.state.pos+2),t=u.TokenType.exponent),a===i.charCodes.equalsTo&&r.input.charCodeAt(r.state.pos+2)!==i.charCodes.greaterThan&&(o++,t=u.TokenType.assign),I(t,o)}(e);case i.charCodes.verticalBar:case i.charCodes.ampersand:return void function(e){const t=r.input.charCodeAt(r.state.pos+1);if(t!==e){if(e===i.charCodes.verticalBar){if(t===i.charCodes.greaterThan)return void I(u.TokenType.pipeline,2);if(t===i.charCodes.rightCurlyBrace&&r.isFlowEnabled)return void I(u.TokenType.braceBarR,2)}t!==i.charCodes.equalsTo?I(e===i.charCodes.verticalBar?u.TokenType.bitwiseOR:u.TokenType.bitwiseAND,1):I(u.TokenType.assign,2)}else r.input.charCodeAt(r.state.pos+2)===i.charCodes.equalsTo?I(u.TokenType.assign,3):I(e===i.charCodes.verticalBar?u.TokenType.logicalOR:u.TokenType.logicalAND,2)}(e);case i.charCodes.caret:return void(r.input.charCodeAt(r.state.pos+1)===i.charCodes.equalsTo?I(u.TokenType.assign,2):I(u.TokenType.bitwiseXOR,1));case i.charCodes.plusSign:case i.charCodes.dash:return void function(e){const t=r.input.charCodeAt(r.state.pos+1);t!==e?t===i.charCodes.equalsTo?I(u.TokenType.assign,2):e===i.charCodes.plusSign?I(u.TokenType.plus,1):I(u.TokenType.minus,1):I(u.TokenType.preIncDec,2)}(e);case i.charCodes.lessThan:return void function(){const e=r.input.charCodeAt(r.state.pos+1);if(e===i.charCodes.lessThan)return r.input.charCodeAt(r.state.pos+2)===i.charCodes.equalsTo?void I(u.TokenType.assign,3):void(r.state.isType?I(u.TokenType.lessThan,1):I(u.TokenType.bitShiftL,2));e===i.charCodes.equalsTo?I(u.TokenType.relationalOrEqual,2):I(u.TokenType.lessThan,1)}();case i.charCodes.greaterThan:return void D();case i.charCodes.equalsTo:case i.charCodes.exclamationMark:return void function(e){const t=r.input.charCodeAt(r.state.pos+1);if(t!==i.charCodes.equalsTo)return e===i.charCodes.equalsTo&&t===i.charCodes.greaterThan?(r.state.pos+=2,void v(u.TokenType.arrow)):void I(e===i.charCodes.equalsTo?u.TokenType.eq:u.TokenType.bang,1);I(u.TokenType.equality,r.input.charCodeAt(r.state.pos+2)===i.charCodes.equalsTo?3:2)}(e);case i.charCodes.tilde:return void I(u.TokenType.tilde,1)}(0,c.unexpected)(`Unexpected character '${String.fromCharCode(e)}'`,r.state.pos)}function I(e,t){r.state.pos+=t,v(e)}function m(){for(;;){const e=r.input.charCodeAt(r.state.pos);if(!(e>=i.charCodes.digit0&&e<=i.charCodes.digit9||e===i.charCodes.underscore))break;r.state.pos++}}function x(e){let t=!1,o=!1;e||m();let a=r.input.charCodeAt(r.state.pos);a===i.charCodes.dot&&(++r.state.pos,m(),a=r.input.charCodeAt(r.state.pos)),a!==i.charCodes.uppercaseE&&a!==i.charCodes.lowercaseE||(a=r.input.charCodeAt(++r.state.pos),a!==i.charCodes.plusSign&&a!==i.charCodes.dash||++r.state.pos,m(),a=r.input.charCodeAt(r.state.pos)),a===i.charCodes.lowercaseN?(++r.state.pos,t=!0):a===i.charCodes.lowercaseM&&(++r.state.pos,o=!0),v(t?u.TokenType.bigint:o?u.TokenType.decimal:u.TokenType.num)}function O(){for(;r.state.pos<r.input.length;){const e=r.input.charCodeAt(r.state.pos);if(d.IS_IDENTIFIER_CHAR[e])r.state.pos++;else{if(e!==i.charCodes.backslash)break;if(r.state.pos+=2,r.input.charCodeAt(r.state.pos)===i.charCodes.leftCurlyBrace){for(;r.state.pos<r.input.length&&r.input.charCodeAt(r.state.pos)!==i.charCodes.rightCurlyBrace;)r.state.pos++;r.state.pos++}}}}o.TypeAndKeyword=TypeAndKeyword},
|
|
@@ -141,24 +141,24 @@
|
|
|
141
141
|
SOFTWARE.
|
|
142
142
|
*/
|
|
143
143
|
function(e){const t={};void 0!==e.detail&&Object.assign(t,{detail:JSON.parse(JSON.stringify(e.detail))});e.type in u&&Object.assign(t,u[e.type](e));return t.target=i(e.target),t.currentTarget=e.target===e.currentTarget?t.target:i(e.currentTarget),t.relatedTarget=i(e.relatedTarget),t};const o={hasValue:e=>({value:e.value}),hasCurrentTime:e=>({currentTime:e.currentTime}),hasFiles:e=>"file"===e.type?{files:[...e.files??[]].map(e=>({lastModified:e.lastModified,name:e.name,size:e.size,type:e.type}))}:{}};const s={hasValue:["BUTTON","INPUT","OPTION","LI","METER","PROGRESS","PARAM","SELECT","TEXTAREA"],hasCurrentTime:["AUDIO","VIDEO"],hasFiles:["INPUT"]},l={};Object.keys(s).forEach(e=>{s[e].forEach(t=>{(l[t]||(l[t]=[])).push(o[e])})});const c={clipboard:["copy","cut","paste"],composition:["compositionend","compositionstart","compositionupdate"],keyboard:["keydown","keypress","keyup"],mouse:["click","contextmenu","doubleclick","drag","dragend","dragenter","dragexit","dragleave","dragover","dragstart","drop","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup"],pointer:["pointerdown","pointermove","pointerup","pointercancel","gotpointercapture","lostpointercapture","pointerenter","pointerleave","pointerover","pointerout"],selection:["select"],touch:["touchcancel","touchend","touchmove","touchstart"],ui:["scroll"],wheel:["wheel"],animation:["animationstart","animationend","animationiteration"],transition:["transitionend"]},u={},d=new class EventTransformCategories{clipboard(e){return{clipboardData:e.clipboardData}}composition(e){return{data:e.data}}keyboard(e){return{altKey:e.altKey,charCode:e.charCode,ctrlKey:e.ctrlKey,key:e.key,keyCode:e.keyCode,locale:e.locale,location:e.location,metaKey:e.metaKey,repeat:e.repeat,shiftKey:e.shiftKey,which:e.which}}mouse(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,metaKey:e.metaKey,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY,shiftKey:e.shiftKey}}pointer(e){return{...this.mouse(e),pointerId:e.pointerId,width:e.width,height:e.height,pressure:e.pressure,tiltX:e.tiltX,tiltY:e.tiltY,pointerType:e.pointerType,isPrimary:e.isPrimary}}selection(){return{selectedText:window.getSelection().toString()}}touch(e){return{altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}ui(e){return{detail:e.detail}}wheel(e){return{deltaMode:e.deltaMode,deltaX:e.deltaX,deltaY:e.deltaY,deltaZ:e.deltaZ}}animation(e){return{animationName:e.animationName,pseudoElement:e.pseudoElement,elapsedTime:e.elapsedTime}}transition(e){return{propertyName:e.propertyName,pseudoElement:e.pseudoElement,elapsedTime:e.elapsedTime}}};Object.keys(c).forEach(e=>{c[e].forEach(t=>{u[t]=d[e].bind(d)})})},
|
|
144
|
-
"9012c2f5ae": function _(e,t,s,n,i){n(),s.escape_html=w,s.unescape_html=M,s.split_blocks=T,s.html_decode=H,s.run_scripts=j;const o=e("tslib");var r,l=this&&this.__decorate||function(e,t,s,n){var i,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(r=(o<3?i(r):o>3?i(t,s,r):i(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r};const a=e("@bokehjs/core/bokeh_events"),c=e("@bokehjs/core/signaling"),h=e("@bokehjs/core/util/object"),d=e("@bokehjs/models/widgets/markup"),u=e("00beb93e38"),m=e("e5a0036205"),p=o.__importDefault(e("9b8139e439")),f='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-clipboard"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" /><path d="M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"/></svg>';function v(e,t){let s=[];return e instanceof Element&&e.matches(t)&&s.push(e),e.children&&Array.from(e.children).forEach(e=>{s=s.concat(v(e,t))}),e instanceof Element&&e.shadowRoot&&(s=s.concat(v(e.shadowRoot,t))),s}let b=r=class HTMLStreamEvent extends a.ModelEvent{model;patch;start;end;version;constructor(e,t,s,n=null,i=null){super(),this.model=e,this.patch=t,this.start=s,this.end=n,this.version=i,this.patch=t,this.start=s,this.end=n,this.version=i,this.origin=e}get event_values(){return{model:this.origin,patch:this.patch,start:this.start,end:this.end,version:this.version}}static from_values(e){const{model:t,patch:s,start:n,end:i,version:o}=e;return new r(t,s,n,i,o)}};s.HTMLStreamEvent=b,s.HTMLStreamEvent=b=r=l([(0,a.server_event)("html_stream")],b);const x={"&":"&","<":"<",">":">",'"':""","'":"'"},g=Object.fromEntries(Object.entries(x).map(([e,t])=>[t,e]));function w(e){return e.replace(/[&<>"']/g,e=>x[e])}function M(e){return e.replace(/&(?:amp|lt|gt|quot|#x27);/g,e=>g[e])}const y=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),k=new Set(["script","style","textarea","title","xmp","iframe","noembed","noframes","noscript","plaintext"]),E=/[a-zA-Z][^\s/>]*/y;function L(e,t){let s=null,n="";for(let i=t;i<e.length;i++){const t=e[i];if(null!=s)t===s&&(s=null);else if('"'!==t&&"'"!==t||"="!==n){if(">"===t)return i+1}else s=t;""!==t.trim()&&(n=t)}return-1}function T(e,t=0){const s=[],n=[];let i=0,o=t,r=t;const l=()=>{0===n.length&&(s.push([o,r]),o=r)};for(;;){const t=e.indexOf("<",r);if(-1===t)break;r=t;const s=e[r+1];if("!"===s||"?"===s){const t=e.startsWith("\x3c!--",r),s=t?e.indexOf("--\x3e",r+4):e.indexOf(">",r+2);if(-1===s)break;r=s+(t?3:1),l();continue}const o="/"===s;E.lastIndex=r+(o?2:1);const a=E.exec(e);if(null==a){r+=1;continue}const c=a[0].toLowerCase(),h=L(e,E.lastIndex);if(-1===h)break;if(r=h,o){const e=n.lastIndexOf(c);if(-1!==e){for(const t of n.splice(e))"svg"!==t&&"math"!==t||i--;l()}}else if(y.has(c)||i>0&&"/"===e[h-2])l();else if(0===i&&k.has(c)){const t=new RegExp(`</${c}[\\s/>]`,"ig");t.lastIndex=r;const s=t.exec(e),n=null==s?-1:e.indexOf(">",s.index);if(-1===n)break;r=n+1,l()}else n.push(c),"svg"!==c&&"math"!==c||i++}return o<e.length&&s.push([o,e.length]),s}function O(e,t){const s=[];for(const n of e)n instanceof Element&&(n.matches(t)&&s.push(n),s.push(...n.querySelectorAll(t)));return s}class DOMEvent extends a.ModelEvent{node;data;constructor(e,t){super(),this.node=e,this.data=t}get event_values(){return{model:this.origin,node:this.node,data:this.data}}static{this.prototype.event_name="dom_event"}}function H(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}function j(e){D(e.querySelectorAll("script"))}function D(e){for(const t of e){const e=document.createElement("script");for(const s of t.attributes)e.setAttribute(s.name,s.value);e.append(document.createTextNode(t.innerHTML));const s=t.parentNode;null!=s&&s.replaceChild(e,t)}}s.DOMEvent=DOMEvent;class HTMLView extends u.PanelMarkupView{_blocks=null;_dirty=null;_frame=null;_event_listeners=new Map;connect_signals(){super.connect_signals();const{text:e,visible:t,events:s}=this.model.properties;this.on_change(e,()=>{this.model.reset_stream(),this._dirty=null;const e=this.process_tex();this.set_html(e)}),this.on_change(t,()=>{this.model.visible&&(this.container.style.visibility="visible")}),this.on_change(s,()=>{this._remove_event_listeners(),this._setup_event_listeners()}),this.model.on_event(b,e=>this.model.apply_stream(e)),this.connect(this.model.streamed,e=>{this._dirty=Math.min(this._dirty??e,e),null==this._frame&&(this._frame=requestAnimationFrame(()=>this._flush_stream()))})}remove(){null!=this._frame&&(cancelAnimationFrame(this._frame),this._frame=null),super.remove()}stylesheets(){return[...super.stylesheets(),p.default]}_flush_stream(){this._frame=null;const e=this._dirty;if(this._dirty=null,null==e||null==this.container)return;const t=this.model.stream_text;!this.model.disable_math&&this.contains_tex(t)?this.set_html(this.process_tex()):this._update_blocks(t,e)}_update_blocks(e,t){let s=this._blocks,n=0;if(null==s)this.container.replaceChildren(),s=[];else{for(;n<s.length-1&&s[n].end<=t;)n++;for(const e of s.splice(n))for(const t of e.nodes)t.remove()}const i=n>0?s[n-1].end:0,o=document.createDocumentFragment(),r=document.createElement("div"),l=[];for(const[t,n]of T(e,i)){r.innerHTML=e.slice(t,n);const i=[...r.childNodes];o.append(...i),l.push(...i),s.push({end:n,nodes:i})}this.container.append(o),this._blocks=s,this.model.run_scripts&&D(O(l,"script")),0!==Object.keys(this.model.events).length&&(this._remove_event_listeners(),this._setup_event_listeners()),this._decorate(l)}set_html(e){null!==e&&null!=this.container&&(this._blocks=null,this.container.innerHTML=e,this.model.run_scripts&&j(this.container),this._setup_event_listeners(),this._decorate([this.container]))}_decorate(e){for(const t of O(e,".codehilite")){const e=document.createElement("button"),s=t.children[0];e.className="copybtn",e.innerHTML=f,e.addEventListener("click",()=>{const t=s.innerText;navigator.clipboard.writeText(t).then(()=>{e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-check"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10"/></svg>',setTimeout(()=>{e.innerHTML=f},300)})}),t.insertBefore(e,s)}for(const t of O(e,"a")){const e=t.getAttribute("href");e&&e.startsWith("#")&&(t.addEventListener("click",()=>{const t=v(document.body,e);t.length>0&&t[0]instanceof Element&&t[0].scrollIntoView()}),!this.root.has_finished()&&this.model.document&&window.location.hash===e&&this.model.document.on_event("document_ready",()=>{t.scrollIntoView(),setTimeout(()=>t.scrollIntoView(),5)}))}}render(){super.render(),this.container.style.visibility="hidden",this.shadow_el.appendChild(this.container),"failed"!=this.provider.status&&"loaded"!=this.provider.status||(this._has_finished=!0);const e=this.process_tex();this.watch_stylesheets(),this.set_html(e)}style_redraw(){this.model.visible&&(this.container.style.visibility="visible")}process_tex(){const e=H(this.model.text)??this.model.text;if(this.model.disable_math||!this.contains_tex(e))return e;const t=this.provider.MathJax.find_tex(e),s=[];let n=0;for(const i of t)s.push(e.slice(n,i.start.n)),s.push(this.provider.MathJax.tex2svg(i.math,{display:i.display}).outerHTML),n=i.end.n;return n<e.length&&s.push(e.slice(n)),s.join("")}contains_tex(e){return!!this.provider.MathJax&&this.provider.MathJax.find_tex(e).length>0}_remove_event_listeners(){for(const[e,t]of this._event_listeners){const s=document.getElementById(e);if(null!=s)for(const[e,n]of t)s.removeEventListener(e,n);else console.warn(`DOM node '${e}' could not be found. Cannot subscribe to DOM events.`)}this._event_listeners.clear()}_setup_event_listeners(){for(const[e,t]of(0,h.entries)(this.model.events)){const s=document.getElementById(e);if(null!=s)for(const n of t){const t=t=>{this.model.trigger_event(new DOMEvent(e,(0,m.serializeEvent)(t)))};s.addEventListener(n,t);let i=this._event_listeners.get(e);void 0===i&&this._event_listeners.set(e,i=new Map),i.set(n,t)}else console.warn(`DOM node '${e}' could not be found. Cannot subscribe to DOM events.`)}}}s.HTMLView=HTMLView;class HTML extends d.Markup{_stream_text=null;_stream_queue=new Map;streamed=new c.Signal(this,"streamed");constructor(e){super(e)}get stream_text(){return this._stream_text??=M(this.text)}apply_stream(e){if(null==e.version)return void this._apply_stream(e);if(e.version<=this.stream_version)return;let t;for(this._stream_queue.set(e.version,e);null!=(t=this._stream_queue.get(this.stream_version+1));)this._stream_queue.delete(t.version),this._apply_stream(t)}_apply_stream(e){const t=this.stream_text,s=e.end??t.length;this._stream_text=t.slice(0,e.start)+M(e.patch)+t.slice(s);const n={text:w(this._stream_text)};null!=e.version&&(n.stream_version=e.version),this.setv(n,{silent:!0}),this.streamed.emit(e.start)}reset_stream(){this._stream_text=null}static __module__="panel.models.markup";static{this.prototype.default_view=HTMLView,this.define(({Bool:e,Int:t,Str:s,List:n,Dict:i})=>({events:[i(n(s)),{}],run_scripts:[e,!0],stream_version:[t,0]}))}}s.HTML=HTML},
|
|
144
|
+
"e40e09e4dd": function _(e,t,s,n,i){n(),s.escape_html=E,s.unescape_html=L,s.split_blocks=$,s.html_decode=I,s.run_scripts=C;const r=e("tslib");var o,l=this&&this.__decorate||function(e,t,s,n){var i,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(o=(r<3?i(o):r>3?i(t,s,o):i(t,s))||o);return r>3&&o&&Object.defineProperty(t,s,o),o};const a=e("@bokehjs/core/bokeh_events"),c=e("@bokehjs/core/signaling"),h=e("@bokehjs/core/util/object"),d=e("@bokehjs/models/widgets/markup"),u=e("@bokehjs/version"),m=e("00beb93e38"),p=e("e5a0036205"),f=e("aa07eb54cc"),v=r.__importDefault(e("9b8139e439")),b=/\$\$[\s\S]*?\$\$|\\\[[\s\S]*?\\\]|\\\([\s\S]*?\\\)/;let x=null;function g(e){return null!=e.MathJax?Promise.resolve(!0):(null==x&&(x=(async()=>{try{await(0,f.loadScript)("text/javascript",function(){for(const e of document.scripts){const t=/^(.*\/)bokeh(-\d[\w.-]*?)?(\.min)?\.js(?:\?.*)?$/.exec(e.src);if(null!=t){const[,e,s="",n=""]=t;return`${e}bokeh-mathjax${s}${n}.js`}}return`https://cdn.bokeh.org/bokeh/${/dev|rc/.test(u.version)?"dev":"release"}/bokeh-mathjax-${u.version}.min.js`}())}catch{return!1}return e.status="not_started",await e.fetch(),null!=e.MathJax})()),x)}const w='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-clipboard"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" /><path d="M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"/></svg>';function y(e,t){let s=[];return e instanceof Element&&e.matches(t)&&s.push(e),e.children&&Array.from(e.children).forEach(e=>{s=s.concat(y(e,t))}),e instanceof Element&&e.shadowRoot&&(s=s.concat(y(e.shadowRoot,t))),s}let M=o=class HTMLStreamEvent extends a.ModelEvent{model;patch;start;end;version;constructor(e,t,s,n=null,i=null){super(),this.model=e,this.patch=t,this.start=s,this.end=n,this.version=i,this.patch=t,this.start=s,this.end=n,this.version=i,this.origin=e}get event_values(){return{model:this.origin,patch:this.patch,start:this.start,end:this.end,version:this.version}}static from_values(e){const{model:t,patch:s,start:n,end:i,version:r}=e;return new o(t,s,n,i,r)}};s.HTMLStreamEvent=M,s.HTMLStreamEvent=M=o=l([(0,a.server_event)("html_stream")],M);const k={"&":"&","<":"<",">":">",'"':""","'":"'"},j=Object.fromEntries(Object.entries(k).map(([e,t])=>[t,e]));function E(e){return e.replace(/[&<>"']/g,e=>k[e])}function L(e){return e.replace(/&(?:amp|lt|gt|quot|#x27);/g,e=>j[e])}const T=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),O=new Set(["script","style","textarea","title","xmp","iframe","noembed","noframes","noscript","plaintext"]),H=/[a-zA-Z][^\s/>]*/y;function S(e,t){let s=null,n="";for(let i=t;i<e.length;i++){const t=e[i];if(null!=s)t===s&&(s=null);else if('"'!==t&&"'"!==t||"="!==n){if(">"===t)return i+1}else s=t;""!==t.trim()&&(n=t)}return-1}function $(e,t=0){const s=[],n=[];let i=0,r=t,o=t;const l=()=>{0===n.length&&(s.push([r,o]),r=o)};for(;;){const t=e.indexOf("<",o);if(-1===t)break;o=t;const s=e[o+1];if("!"===s||"?"===s){const t=e.startsWith("\x3c!--",o),s=t?e.indexOf("--\x3e",o+4):e.indexOf(">",o+2);if(-1===s)break;o=s+(t?3:1),l();continue}const r="/"===s;H.lastIndex=o+(r?2:1);const a=H.exec(e);if(null==a){o+=1;continue}const c=a[0].toLowerCase(),h=S(e,H.lastIndex);if(-1===h)break;if(o=h,r){const e=n.lastIndexOf(c);if(-1!==e){for(const t of n.splice(e))"svg"!==t&&"math"!==t||i--;l()}}else if(T.has(c)||i>0&&"/"===e[h-2])l();else if(0===i&&O.has(c)){const t=new RegExp(`</${c}[\\s/>]`,"ig");t.lastIndex=o;const s=t.exec(e),n=null==s?-1:e.indexOf(">",s.index);if(-1===n)break;o=n+1,l()}else n.push(c),"svg"!==c&&"math"!==c||i++}return r<e.length&&s.push([r,e.length]),s}function D(e,t){const s=[];for(const n of e)n instanceof Element&&(n.matches(t)&&s.push(n),s.push(...n.querySelectorAll(t)));return s}class DOMEvent extends a.ModelEvent{node;data;constructor(e,t){super(),this.node=e,this.data=t}get event_values(){return{model:this.origin,node:this.node,data:this.data}}static{this.prototype.event_name="dom_event"}}s.DOMEvent=DOMEvent;const q=/^(?:[^&<\r\0]|&(?:amp|lt|gt|quot|#x27);)*$/;function I(e){if(q.test(e))return L(e).replace(/^[\t\n\f\r ]+/,"");return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}function C(e){A(e.querySelectorAll("script"))}function A(e){for(const t of e){const e=document.createElement("script");for(const s of t.attributes)e.setAttribute(s.name,s.value);e.append(document.createTextNode(t.innerHTML));const s=t.parentNode;null!=s&&s.replaceChild(e,t)}}class HTMLView extends m.PanelMarkupView{_blocks=null;_dirty=null;_frame=null;_mathjax_pending=!1;_event_listeners=new Map;connect_signals(){super.connect_signals();const{text:e,visible:t,events:s}=this.model.properties;this.on_change(e,()=>{this.model.reset_stream(),this._dirty=null;const e=this.process_tex();this.set_html(e)}),this.on_change(t,()=>{this.model.visible&&null!=this.container&&(this.container.style.visibility="visible")}),this.on_change(s,()=>{this._remove_event_listeners(),this._setup_event_listeners()}),this.model.on_event(M,e=>this.model.apply_stream(e)),this.connect(this.model.streamed,e=>{this._dirty=Math.min(this._dirty??e,e),null==this._frame&&(this._frame=requestAnimationFrame(()=>this._flush_stream()))})}remove(){null!=this._frame&&(cancelAnimationFrame(this._frame),this._frame=null),super.remove()}stylesheets(){return[...super.stylesheets(),v.default]}_flush_stream(){this._frame=null;const e=this._dirty;if(this._dirty=null,null==e||null==this.container)return;const t=this.model.stream_text;this._ensure_mathjax(t),this._update_blocks(t,e)}_ensure_mathjax(e){this._mathjax_pending||this.model.disable_math||null!=this.provider.MathJax||!b.test(e)||(this._mathjax_pending=!0,g(this.provider).then(e=>{e&&(this._dirty=null,this.set_html(this.process_tex())),this._mathjax_pending=!e}))}_update_blocks(e,t){let s=this._blocks,n=0;if(null==s)this.container.replaceChildren(),s=[];else{for(;n<s.length-1&&s[n].end<=t;)n++;for(const e of s.splice(n))for(const t of e.nodes)t.remove()}const i=n>0?s[n-1].end:0,r=document.createDocumentFragment(),o=document.createElement("div"),l=[];for(const[t,n]of $(e,i)){o.innerHTML=this.typeset(e.slice(t,n));const i=[...o.childNodes];r.append(...i),l.push(...i),s.push({end:n,nodes:i})}this.container.append(r),this._blocks=s,this.model.run_scripts&&A(D(l,"script")),0!==Object.keys(this.model.events).length&&(this._remove_event_listeners(),this._setup_event_listeners()),this._decorate(l)}set_html(e){null!==e&&null!=this.container&&(this._blocks=null,this.container.innerHTML=e,this.model.run_scripts&&C(this.container),this._setup_event_listeners(),this._decorate([this.container]))}_decorate(e){for(const t of D(e,".codehilite")){const e=document.createElement("button"),s=t.children[0];e.className="copybtn",e.innerHTML=w,e.addEventListener("click",()=>{const t=s.innerText;navigator.clipboard.writeText(t).then(()=>{e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-check"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10"/></svg>',setTimeout(()=>{e.innerHTML=w},300)})}),t.insertBefore(e,s)}for(const t of D(e,"a")){const e=t.getAttribute("href");e&&e.startsWith("#")&&(t.addEventListener("click",()=>{const t=y(document.body,e);t.length>0&&t[0]instanceof Element&&t[0].scrollIntoView()}),!this.root.has_finished()&&this.model.document&&window.location.hash===e&&this.model.document.on_event("document_ready",()=>{t.scrollIntoView(),setTimeout(()=>t.scrollIntoView(),5)}))}}render(){super.render(),this.container.style.visibility="hidden",this.shadow_el.appendChild(this.container),"failed"!=this.provider.status&&"loaded"!=this.provider.status||(this._has_finished=!0);const e=this.process_tex();this.watch_stylesheets(),this.set_html(e)}style_redraw(){this.model.visible&&null!=this.container&&(this.container.style.visibility="visible")}process_tex(){const e=I(this.model.text)??this.model.text;return this._ensure_mathjax(e),this.typeset(e)}typeset(e){const{MathJax:t}=this.provider;if(this.model.disable_math||!t)return e;const s=t.find_tex(e);if(0===s.length)return e;const n=[];let i=0;for(const r of s)n.push(e.slice(i,r.start.n)),n.push(t.tex2svg(r.math,{display:r.display}).outerHTML),i=r.end.n;return i<e.length&&n.push(e.slice(i)),n.join("")}_remove_event_listeners(){for(const[e,t]of this._event_listeners){const s=document.getElementById(e);if(null!=s)for(const[e,n]of t)s.removeEventListener(e,n);else console.warn(`DOM node '${e}' could not be found. Cannot subscribe to DOM events.`)}this._event_listeners.clear()}_setup_event_listeners(){for(const[e,t]of(0,h.entries)(this.model.events)){const s=document.getElementById(e);if(null!=s)for(const n of t){const t=t=>{this.model.trigger_event(new DOMEvent(e,(0,p.serializeEvent)(t)))};s.addEventListener(n,t);let i=this._event_listeners.get(e);void 0===i&&this._event_listeners.set(e,i=new Map),i.set(n,t)}else console.warn(`DOM node '${e}' could not be found. Cannot subscribe to DOM events.`)}}}s.HTMLView=HTMLView;class HTML extends d.Markup{_stream_text=null;_stream_queue=new Map;streamed=new c.Signal(this,"streamed");constructor(e){super(e)}get stream_text(){return this._stream_text??=L(this.text)}apply_stream(e){if(null==e.version)return void this._apply_stream(e);if(e.version<=this.stream_version)return;let t;for(this._stream_queue.set(e.version,e);null!=(t=this._stream_queue.get(this.stream_version+1));)this._stream_queue.delete(t.version),this._apply_stream(t)}_apply_stream(e){const t=this.stream_text,s=e.end??t.length;this._stream_text=t.slice(0,e.start)+L(e.patch)+t.slice(s);const n={text:E(this._stream_text)};null!=e.version&&(n.stream_version=e.version),this.setv(n,{silent:!0}),this.streamed.emit(e.start)}reset_stream(){this._stream_text=null}static __module__="panel.models.markup";static{this.prototype.default_view=HTMLView,this.define(({Bool:e,Int:t,Str:s,List:n,Dict:i})=>({events:[i(n(s)),{}],run_scripts:[e,!0],stream_version:[t,0]}))}}s.HTML=HTML},
|
|
145
145
|
"9b8139e439": function _(o,e,r,t,i){t(),r.default=".copybtn{position:sticky;display:flex;top:0;left:100%;width:1.7em;height:1.7em;opacity:0;transition:opacity 0.3s, border 0.3s, background-color 0.3s;user-select:none;padding:0;border:none;outline:none;border-radius:0.4em;border:#1b1f2426 1px solid;background-color:#f6f8fa;color:#57606a;}.codehilite pre{margin-top:-1.5em;}.copybtn svg{stroke:currentColor;width:1.5em;height:1.5em;padding:0.1em;}.codehilite:hover .copybtn{opacity:1;cursor:pointer;}"},
|
|
146
146
|
"727a14f76b": function _(r,e,o,d,t){d(),o.default=".error-wrapper,.child-wrapper{display:contents;}.error{padding:0.75rem 1.25rem;border:1px solid transparent;border-radius:0.25rem;color:var(--danger-text-color);background-color:var(--danger-bg-subtle);border-color:var(--danger-border-subtle);}.error .msg{font-weight:bold;}.error pre.highlight{backdrop-filter:brightness(0.8);font-weight:900;}"},
|
|
147
147
|
"fdf76c2b8b": function _(e,t,i,o,s){o();const l=e("00beb93e38");class AudioView extends l.HTMLBoxView{audioEl;dialogEl;_blocked;_time;_setting;initialize(){super.initialize(),this._blocked=!1,this._setting=!1,this._time=Date.now()}connect_signals(){super.connect_signals();const{loop:e,paused:t,time:i,value:o,volume:s,muted:l,autoplay:u}=this.model.properties;this.on_change(e,()=>this.set_loop()),this.on_change(t,()=>this.set_paused()),this.on_change(i,()=>this.set_time()),this.on_change(o,()=>this.set_value()),this.on_change(s,()=>this.set_volume()),this.on_change(l,()=>this.set_muted()),this.on_change(u,()=>this.set_autoplay())}render(){super.render(),this.audioEl=document.createElement("audio"),this.audioEl.controls=!0,this.audioEl.src=this.model.value,this.audioEl.currentTime=this.model.time,this.audioEl.loop=this.model.loop,this.audioEl.muted=this.model.muted,this.audioEl.autoplay=this.model.autoplay,null!=this.model.volume?this.audioEl.volume=this.model.volume/100:this.model.volume=100*this.audioEl.volume,this.audioEl.onpause=()=>this.model.paused=!0,this.audioEl.onplay=()=>this.model.paused=!1,this.audioEl.ontimeupdate=()=>this.update_time(this),this.audioEl.onvolumechange=()=>this.update_volume(this),(0,l.set_size)(this.audioEl,this.model,!1),this.shadow_el.appendChild(this.audioEl),this.model.paused||this.audioEl.play()}update_time(e){e._setting?e._setting=!1:Date.now()-e._time<e.model.throttle||(e._blocked=!0,e.model.time=e.audioEl.currentTime,e._time=Date.now())}update_volume(e){e._setting?e._setting=!1:(e._blocked=!0,e.model.volume=100*e.audioEl.volume)}set_loop(){this.audioEl.loop=this.model.loop}set_muted(){this.audioEl.muted=this.model.muted}set_autoplay(){this.audioEl.autoplay=this.model.autoplay}set_paused(){!this.audioEl.paused&&this.model.paused&&this.audioEl.pause(),this.audioEl.paused&&!this.model.paused&&this.audioEl.play()}set_volume(){this._blocked?this._blocked=!1:(this._setting=!0,null!=this.model.volume&&(this.audioEl.volume=this.model.volume/100))}set_time(){this._blocked?this._blocked=!1:(this._setting=!0,this.audioEl.currentTime=this.model.time)}set_value(){this.audioEl.src=this.model.value}}i.AudioView=AudioView;class Audio extends l.HTMLBox{constructor(e){super(e)}static __module__="panel.models.widgets";static{this.prototype.default_view=AudioView,this.define(({Any:e,Bool:t,Float:i,Nullable:o})=>({loop:[t,!1],paused:[t,!0],muted:[t,!1],autoplay:[t,!1],time:[i,0],throttle:[i,250],value:[e,""],volume:[o(i),null]}))}}i.Audio=Audio},
|
|
148
148
|
"f25f215a58": function _(e,o,t,i,n){i();const l=e("@bokehjs/core/view"),s=e("@bokehjs/model");class BrowserInfoView extends l.View{initialize(){if(super.initialize(),null!=window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)");e.addEventListener("change",e=>{this.model.dark_mode=e.matches}),this.model.dark_mode=e.matches}this.model.device_pixel_ratio=window.devicePixelRatio,null!=navigator&&(this.model.language=navigator.language,this.model.webdriver=navigator.webdriver);const e=Intl.DateTimeFormat().resolvedOptions().timeZone;null!=e&&(this.model.timezone=e);const o=(new Date).getTimezoneOffset();null!=o&&(this.model.timezone_offset=o);try{const e=document.createElement("canvas");this.model.webgl=!(!window.WebGLRenderingContext||!e.getContext("webgl")&&!e.getContext("experimental-webgl"))}catch(e){this.model.webgl=!1}this._has_finished=!0,this.notify_finished()}}t.BrowserInfoView=BrowserInfoView;class BrowserInfo extends s.Model{static __module__="panel.models.browser";constructor(e){super(e)}static{this.prototype.default_view=BrowserInfoView,this.define(({Bool:e,Nullable:o,Float:t,Str:i})=>({dark_mode:[o(e),null],device_pixel_ratio:[o(t),null],language:[o(i),null],timezone:[o(i),null],timezone_offset:[o(t),null],webdriver:[o(e),null],webgl:[o(e),null]}))}}t.BrowserInfo=BrowserInfo},
|
|
149
149
|
"29120fca73": function _(t,e,o,i,l){i();const s=t("@bokehjs/models/ui/tooltip"),n=t("@bokehjs/core/build_views"),u=t("@bokehjs/models/widgets/button");class ButtonView extends u.ButtonView{tooltip;*children(){yield*super.children(),null!=this.tooltip&&(yield this.tooltip)}connect_signals(){super.connect_signals();const{tooltip:t}=this.model.properties;this.on_change(t,()=>this.update_tooltip())}async update_tooltip(){null!=this.tooltip&&this.tooltip.remove();const{tooltip:t}=this.model;null!=t&&(this.tooltip=await(0,n.build_view)(t,{parent:this}))}async lazy_initialize(){await super.lazy_initialize();const{tooltip:t}=this.model;null!=t&&(this.tooltip=await(0,n.build_view)(t,{parent:this}))}remove(){this.tooltip?.remove(),super.remove()}render(){super.render();const t=t=>{this.tooltip?.model.setv({visible:t})};let e;this.el.addEventListener("mouseenter",()=>{e=setTimeout(()=>t(!0),this.model.tooltip_delay)}),this.el.addEventListener("mouseleave",()=>{clearTimeout(e),t(!1)})}}o.ButtonView=ButtonView;class Button extends u.Button{static __module__="panel.models.widgets";constructor(t){super(t)}static{this.prototype.default_view=ButtonView,this.define(({Nullable:t,Ref:e,Float:o})=>({tooltip:[t(e(s.Tooltip)),null],tooltip_delay:[o,500]}))}}o.Button=Button},
|
|
150
|
-
"7e77f478cb": function _(t,e,o,i,n){i();const
|
|
151
|
-
"
|
|
150
|
+
"7e77f478cb": function _(t,e,o,i,n){i();const c=t("ac804884fa");class ButtonIconView extends c.ClickableIconView{_click_listener;*controls(){}update_cursor(){this.icon_view.el.style.cursor=this.model.disabled?"default":"pointer"}click(){if(this.model.disabled)return;super.click();const t=(t,e)=>{this.model.value=t,this.model.disabled=e};t(!0,!0),new Promise(t=>setTimeout(t,this.model.toggle_duration)).then(()=>{t(!1,!1)})}}o.ButtonIconView=ButtonIconView;class ButtonIcon extends c.ClickableIcon{static __module__="panel.models.icon";constructor(t){super(t)}static{this.prototype.default_view=ButtonIconView,this.define(({Int:t})=>({toggle_duration:[t,75]}))}}o.ButtonIcon=ButtonIcon},
|
|
151
|
+
"ac804884fa": function _(i,e,t,o,s){o();const l=i("@bokehjs/models/ui/tooltip"),n=i("@bokehjs/models/ui/icons/tabler_icon"),c=i("@bokehjs/models/ui/icons/svg_icon"),a=i("@bokehjs/models/widgets/control"),h=i("@bokehjs/core/dom"),d=i("@bokehjs/core/build_views"),r=i("@bokehjs/core/bokeh_events");class ClickableIconView extends a.ControlView{icon_view;label_el;was_svg_icon;row_div;tooltip;*controls(){}remove(){this.tooltip?.remove(),this.icon_view.remove(),super.remove()}async lazy_initialize(){await super.lazy_initialize(),this.was_svg_icon=this.is_svg_icon(this.model.icon),this.label_el=(0,h.div)({class:"bk-IconLabel"},this.model.title),this.label_el.style.fontSize=this.calculate_size(.6),this.icon_view=await this.build_icon_model(this.model.icon,this.was_svg_icon);const{tooltip:i}=this.model;null!=i&&(this.tooltip=await(0,d.build_view)(i,{parent:this}))}*children(){yield*super.children(),yield this.icon_view,null!=this.tooltip&&(yield this.tooltip)}is_svg_icon(i){return i.trim().startsWith("<svg")}connect_signals(){super.connect_signals();const{icon:i,active_icon:e,disabled:t,value:o,size:s,tooltip:l}=this.model.properties;this.on_change([e,i,o],()=>this.update_icon()),this.on_change(this.model.properties.title,()=>this.update_label()),this.on_change(t,()=>this.update_cursor()),this.on_change(s,()=>this.update_size()),this.on_change(l,()=>this.update_tooltip())}async update_tooltip(){null!=this.tooltip&&this.tooltip.remove();const{tooltip:i}=this.model;null!=i&&(this.tooltip=await(0,d.build_view)(i,{parent:this}))}render(){super.render(),this.icon_view.render(),this.update_icon(),this.update_label(),this.update_cursor(),this.row_div=(0,h.div)({class:"bk-IconRow"},this.icon_view.el,this.label_el),this.shadow_el.appendChild(this.row_div);const i=i=>{this.tooltip?.model.setv({visible:i})};let e;this.el.addEventListener("mouseenter",()=>{e&&clearTimeout(e),e=setTimeout(()=>i(!0),this.model.tooltip_delay)}),this.el.addEventListener("pointerleave",()=>{clearTimeout(e),e=void 0,i(!1)})}update_label(){this.label_el.innerText=this.model.title}update_cursor(){this.icon_view.el.style.cursor=this.model.disabled?"not-allowed":"pointer"}update_size(){this.icon_view.model.size=this.calculate_size(),this.label_el.style.fontSize=this.calculate_size(.6)}async build_icon_model(i,e){const t=this.calculate_size(),o=e?new c.SVGIcon({svg:i,size:t}):new n.TablerIcon({icon_name:i,size:t}),s=await(0,d.build_view)(o,{parent:this});return s.el.addEventListener("click",()=>this.click()),s}async update_icon(){const i=this.model.value?this.get_active_icon():this.model.icon;this.class_list.toggle("active",this.model.value);const e=this.is_svg_icon(i);if(this.was_svg_icon!==e){const t=await this.build_icon_model(i,e);t.render(),this.icon_view.remove(),this.icon_view=t,this.was_svg_icon=e,this.update_size(),this.update_cursor(),this.row_div.insertBefore(this.icon_view.el,this.label_el)}else e?this.icon_view.model.svg=i:this.icon_view.model.icon_name=i;this.icon_view.el.style.lineHeight="0"}get_active_icon(){return""!==this.model.active_icon?this.model.active_icon:`${this.model.icon}-filled`}calculate_size(i=1){if(null!==this.model.size)return`calc(${this.model.size} * ${i})`;const e=this.model.width??15,t=this.model.height??15;return`${Math.max(e,t)*i}px`}click(){this.model.trigger_event(new r.ButtonClick)}}t.ClickableIconView=ClickableIconView;class ClickableIcon extends a.Control{static __module__="panel.models.icon";constructor(i){super(i)}static{this.prototype.default_view=ClickableIconView,this.define(({Nullable:i,Ref:e,Float:t,Str:o,Bool:s})=>({active_icon:[o,""],icon:[o,"heart"],size:[i(o),null],value:[s,!1],title:[o,""],tooltip:[i(e(l.Tooltip)),null],tooltip_delay:[t,500]}))}on_click(i){this.on_event(r.ButtonClick,i)}}t.ClickableIcon=ClickableIcon},
|
|
152
152
|
"a668a42a0f": function _(e,s,t,i,l){i();const o=e("tslib"),h=o.__importStar(e("@bokehjs/core/dom")),d=e("@bokehjs/core/layout/grid"),n=e("@bokehjs/models/layouts/alignments"),a=e("@bokehjs/models/layouts/layout_dom"),c=e("@bokehjs/models/widgets/markup"),r=e("@bokehjs/models/widgets/widget"),u=e("3967d78fb5"),p=o.__importDefault(e("6342ac8e26")),v='\n<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-chevron-right"><path stroke="none" d="M0 0h12v12H0z" fill="none"/><path d="M9 6l6 6l-6 6" /></svg>\n',b='\n<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"><path stroke="none" d="M0 0h12v12H0z" fill="none"/><path d="M6 9l6 6l6 -6" /></svg>\n';class CardView extends u.ColumnView{button_el;header_el;visible_child_views=new Map;_updating_child_visibility=new Set;_child_visible_callbacks=new Map;collapsed_style=new h.InlineStyleSheet;connect_signals(){super.connect_signals();const{active_header_background:e,collapsed:s,header_background:t,header_color:i,hide_header:l}=this.model.properties;this.on_change(s,()=>this._collapse()),this.on_change([i,l],()=>this.render()),this.on_change([e,s,t],()=>{const e=this.header_background;null!=e&&(this.child_views[0].el.style.backgroundColor=e,this.header_el.style.backgroundColor=e)});for(const e of this.child_views.slice(1))this._register_child_view(e)}stylesheets(){return[...super.stylesheets(),p.default]}*_stylesheets(){yield*super._stylesheets(),yield this.collapsed_style}get header_background(){let e=this.model.header_background;return!this.model.collapsed&&this.model.active_header_background&&(e=this.model.active_header_background),e}render(){this.empty(),this.model.collapsed&&this.collapsed_style.replace(":host",{height:"fit-content",flex:"none"}),this._update_stylesheets(),this._update_css_classes(),this._apply_styles(),this._apply_visible(),this.class_list.add(...this.css_classes());const{button_css_classes:e,header_color:s,header_tag:t,header_css_classes:i}=this.model,l=this.header_background,o=this.child_views[0];let d;if(this.model.collapsible){this.button_el=h.button({class:i});const s=h.div({class:e});s.innerHTML=this.model.collapsed?v:b,this.button_el.appendChild(s),this.button_el.style.backgroundColor=null!=l?l:"",o.el.style.backgroundColor=null!=l?l:"",this.button_el.appendChild(o.el),this.button_el.addEventListener("click",e=>this._toggle_button(e)),this.button_el.addEventListener("keyup",e=>{if("Space"===e.code)for(const s of e.composedPath())if(s instanceof HTMLInputElement)return void e.preventDefault()}),d=this.button_el}else d=h.create_element(t,{class:i}),d.style.backgroundColor=null!=l?l:"",d.appendChild(o.el);this.header_el=d,this.model.hide_header||(d.style.color=null!=s?s:"",this.shadow_el.appendChild(d),o.render(),o.r_after_render());for(const e of this.child_views.slice(1))this._register_child_view(e),this._apply_child_visible(e),this.shadow_el.appendChild(e.el),e.render(),e.r_after_render()}async update_children(){await this.build_child_views();const e=new Set(this.child_views.slice(1));for(const s of this.visible_child_views.keys())e.has(s)||this._unregister_child_view(s);for(const s of e)this._register_child_view(s);this.render(),this.invalidate_layout()}_update_layout(){super._update_layout(),this.style.append(":host",{flex_direction:this._direction,gap:h.px(this.model.spacing)});const e=new d.Container;let s=0,t=0;for(let i=0;i<this.child_views.length;i++){const l=this.child_views[i];if(!(l instanceof a.LayoutDOMView))continue;const o=0==i,d=l.box_sizing(),n=(()=>{const e=o?d.width_policy:d.height_policy,s=o?d.width:d.height,t=null!=s?h.px(s):"auto";switch(e){case"auto":case"fixed":return`0 0 ${t}`;case"fit":return"1 1 auto";case"min":return"0 1 auto";case"max":return"1 0 0px"}})(),c=(()=>{switch(o?d.height_policy:d.width_policy){case"auto":case"fixed":case"fit":case"min":return o?d.valign:d.halign;case"max":return"stretch"}})();l.parent_style.append(":host",{flex:n,align_self:c}),o?"max"==d.height_policy&&l.parent_style.append(":host",{height:"auto"}):"max"==d.width_policy&&l.parent_style.append(":host",{width:"auto"}),null!=l.layout&&(e.add({r0:s,c0:t,r1:s+1,c1:t+1},l),o?t+=1:s+=1)}0!=e.size?(this.layout=new n.GridAlignmentLayout(e),this.layout.set_sizing()):delete this.layout}_toggle_button(e){const s=new Set,t=e=>{e.model instanceof r.Widget&&!(e.model instanceof c.Markup)&&s.add(e.el);for(const s of e.child_views??[])t(s)};t(this.child_views[0]);const i=e=>e instanceof HTMLInputElement||e instanceof HTMLElement&&(s.has(e)||Array.from(e.classList).some(e=>e.startsWith("bk-panel-models-widgets-")));for(const s of e.composedPath())if(i(s))return;this.model.collapsed=!this.model.collapsed}_collapse(){for(const e of this.child_views.slice(1))this._register_child_view(e),this.model.collapsed?(this.shadow_el.removeChild(e.el),this._set_child_visible(e,!1)):(this.shadow_el.appendChild(e.el),this._apply_child_visible(e),e.r_after_render());this.model.collapsed?this.collapsed_style.replace(":host",{height:"fit-content",flex:"none"}):this.collapsed_style.clear(),this.button_el.children[0].innerHTML=this.model.collapsed?v:b,this.invalidate_layout()}_set_child_visible(e,s){if(e.model.visible!=s){this._updating_child_visibility.add(e);try{e.model.setv({visible:s},{sync:!1})}finally{this._updating_child_visibility.delete(e)}}}_apply_child_visible(e){const s=this.visible_child_views.get(e)??e.model.visible;this.visible_child_views.set(e,s),this._set_child_visible(e,s&&!this.model.collapsed)}_register_child_view(e){if(this.visible_child_views.has(e))return;this.visible_child_views.set(e,e.model.visible);const{visible:s}=e.model.properties,t=()=>{if(this._updating_child_visibility.has(e))return;const s=e.model.visible;this.visible_child_views.set(e,s),this.model.collapsed&&s&&this._set_child_visible(e,!1)};this._child_visible_callbacks.set(e,t),this.on_change(s,t)}_unregister_child_view(e){const s=this._child_visible_callbacks.get(e);null!=s&&(e.model.properties.visible.change.disconnect(s),this._child_visible_callbacks.delete(e)),this.visible_child_views.delete(e),this._updating_child_visibility.delete(e)}_create_element(){return h.create_element(this.model.tag,{class:this.css_classes()})}}t.CardView=CardView;class Card extends u.Column{constructor(e){super(e)}static __module__="panel.models.layout";static{this.prototype.default_view=CardView,this.define(({List:e,Bool:s,Nullable:t,Str:i})=>({active_header_background:[t(i),null],button_css_classes:[e(i),[]],collapsed:[s,!0],collapsible:[s,!0],header_background:[t(i),null],header_color:[t(i),null],header_css_classes:[e(i),[]],header_tag:[i,"div"],hide_header:[s,!1],tag:[i,"div"]}))}}t.Card=Card},
|
|
153
153
|
"3967d78fb5": function _(t,l,e,o,s){o();var i,n=this&&this.__decorate||function(t,l,e,o){var s,i=arguments.length,n=i<3?l:null===o?o=Object.getOwnPropertyDescriptor(l,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,l,e,o);else for(var r=t.length-1;r>=0;r--)(s=t[r])&&(n=(i<3?s(n):i>3?s(l,e,n):s(l,e))||n);return i>3&&n&&Object.defineProperty(l,e,n),n};const r=t("@bokehjs/core/bokeh_events"),c=t("@bokehjs/core/dom"),h=t("@bokehjs/models/layouts/column"),a=t("@bokehjs/models/layouts/layout_dom");class ScrollButtonClick extends r.ModelEvent{static{this.prototype.event_name="scroll_button_click"}}e.ScrollButtonClick=ScrollButtonClick;let d=i=class ScrollToEvent extends r.ModelEvent{model;index;constructor(t,l){super(),this.model=t,this.index=l,this.index=l,this.origin=t}get event_values(){return{model:this.origin,index:this.index}}static from_values(t){const{model:l,index:e}=t;return new i(l,e)}};e.ScrollToEvent=d,e.ScrollToEvent=d=i=n([(0,r.server_event)("scroll_to")],d);const u=["scroll","scroll-horizontal","scroll-vertical","scrollable","scrollable-horizontal","scrollable-vertical"];class ColumnView extends h.ColumnView{_updating=!1;_stylesheet_listener=!1;_initial_scroll_pending=!1;_auto_scroll_pending=!1;scroll_down_button_el;connect_signals(){super.connect_signals();const{children:t,scroll_position:l,scroll_button_threshold:e}=this.model.properties;this.on_change(t,()=>this.trigger_auto_scroll()),this.on_change(l,()=>this.scroll_to_position()),this.on_change(e,()=>this.toggle_scroll_button()),this.model.on_event(d,t=>this.scroll_to_index(t.index))}get is_scroll_container(){return this.model.css_classes.some(t=>u.includes(t))}get distance_from_latest(){return this.el.scrollHeight-this.el.scrollTop-this.el.clientHeight}scroll_to_index(t){if(null===t)return;if(t>=this.model.children.length)return void console.warn(`Invalid scroll index: ${t}`);const l=this.child_views[t];if(!l)return void console.warn(`Child view not found for index: ${t}`);const e=l.el.getBoundingClientRect(),o=this.el.getBoundingClientRect(),s=e.top-o.top+this.el.scrollTop;this.model.scroll_position=Math.round(s)}scroll_to_position(){this._updating||requestAnimationFrame(()=>{this.el.scrollTo({top:this.model.scroll_position,behavior:"instant"}),this.is_scroll_container&&"visible"===getComputedStyle(this.el).overflowY&&(this._initial_scroll_pending=!0)})}scroll_to_latest(t=null){if(null!==t){if(!(this.distance_from_latest<=t))return}requestAnimationFrame(()=>{const t=Math.round(this.el.scrollHeight);this.el.scrollTo({top:t,behavior:"instant"}),this.model.scroll_position=t})}trigger_auto_scroll(){const t=this.model.auto_scroll_limit;this._auto_scroll_pending=0!=t&&this.distance_from_latest<=t}record_scroll_position(){this._updating=!0,this.model.scroll_position=Math.round(this.el.scrollTop),this._updating=!1}toggle_scroll_button(){const t=this.model.scroll_button_threshold;if(!this.scroll_down_button_el||0===t)return;const l=this.distance_from_latest>=t;this.scroll_down_button_el.classList.toggle("visible",l)}_update_layout(){super._update_layout();const t=this.model.css_classes.some(t=>["scroll","scrollable","scrollable-vertical"].includes(t));for(const l of this.child_views)l instanceof a.LayoutDOMView&&t&&l.parent_style.append(":host",{maxHeight:"none"})}render(){super.render(),this.scroll_down_button_el=(0,c.div)({class:"scroll-button"}),this.shadow_el.appendChild(this.scroll_down_button_el),this.el.addEventListener("scroll",()=>{this.record_scroll_position(),this.toggle_scroll_button()}),this.scroll_down_button_el.addEventListener("click",()=>{this.scroll_to_latest(),this.model.trigger_event(new ScrollButtonClick)}),this._stylesheet_listener||(this._stylesheet_listener=!0,this.shadow_el.addEventListener("load",t=>{t.target instanceof HTMLLinkElement&&this._initial_scroll_pending&&this._apply_initial_scroll()},!0))}_apply_initial_scroll(){this.model.scroll_position&&this.scroll_to_position(),this.model.view_latest&&this.scroll_to_latest(),this._initial_scroll_pending=this.is_scroll_container&&"visible"===getComputedStyle(this.el).overflowY}async update_children(){const t=await this.build_child_views(),l=new Set(t),e=Array.from(this.shadow_el.children).flatMap(t=>{const l=this.child_views.find(l=>l.el===t);return void 0===l?[]:[l]});let o=null;for(let t=0;t<e.length&&e[t]===this.child_views[t];t++)o=t;for(let t=0;t<this.child_views.length;t++){const e=this.child_views[t],s=l.has(e),i=e.rendering_target()??this.self_target??this.shadow_el;s?e.render_to(i):(null===o||t>o)&&i.append(e.el)}this.r_after_render(),this._update_children(),this.invalidate_layout(),this._auto_scroll_pending&&(this._auto_scroll_pending=!1,requestAnimationFrame(()=>this.scroll_to_latest()))}after_render(){super.after_render(),this._initial_scroll_pending=!0,requestAnimationFrame(()=>{this._apply_initial_scroll(),this.toggle_scroll_button()})}}e.ColumnView=ColumnView;class Column extends h.Column{constructor(t){super(t)}static __module__="panel.models.layout";static{this.prototype.default_view=ColumnView,this.define(({Int:t,Bool:l,Nullable:e})=>({auto_scroll_limit:[t,0],scroll_button_threshold:[t,0],scroll_index:[e(t),null],scroll_position:[t,0],view_latest:[l,!1]}))}on_click(t){this.on_event(ScrollButtonClick,t)}}e.Column=Column},
|
|
154
154
|
"6342ac8e26": function _(r,e,o,t,a){t(),o.default=":host(.card){border-radius:0.25rem;box-shadow:rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;outline:1px solid rgba(0, 0, 0, 0.125);}:host(.accordion){box-shadow:rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;outline:1px solid rgba(0, 0, 0, 0.125);width:100%;}.card-header{align-items:center;background-color:rgba(0, 0, 0, 0.03);border:unset;border-radius:0.25rem;display:inline-flex;justify-content:start;outline:unset;position:sticky;width:100%;margin-right:0.5em;padding-inline:0.5em;cursor:pointer;}.card-header:hover{box-shadow:0 0 3px rgba(0, 0, 0, 0.3);}.card-header:not(:hover){box-shadow:0 0 3px rgba(0, 0, 0, 0);}.accordion-header{align-items:center;background-color:rgba(0, 0, 0, 0.03);border:unset;outline:1px solid;border-radius:0;display:flex;justify-content:start;position:sticky;width:100%;cursor:pointer;}.card-button{background-color:transparent;margin-left:0em;margin-right:0.25em;height:12px;width:12px;}.card-header-row{position:relative !important;}.card-title{align-items:center;font-size:1.4em;font-weight:bold;overflow-wrap:break-word;}.card-header-row > .bk{overflow-wrap:break-word;text-align:center;}"},
|
|
155
155
|
"138d8a2ed1": function _(t,o,e,i,l){i();const s=t("@bokehjs/models/ui/tooltip"),n=t("@bokehjs/core/build_views"),u=t("@bokehjs/models/widgets/checkbox_button_group");class CheckboxButtonGroupView extends u.CheckboxButtonGroupView{tooltip;*children(){yield*super.children(),null!=this.tooltip&&(yield this.tooltip)}connect_signals(){super.connect_signals();const{tooltip:t}=this.model.properties;this.on_change(t,()=>this.update_tooltip())}async update_tooltip(){null!=this.tooltip&&this.tooltip.remove();const{tooltip:t}=this.model;null!=t&&(this.tooltip=await(0,n.build_view)(t,{parent:this}))}async lazy_initialize(){await super.lazy_initialize();const{tooltip:t}=this.model;null!=t&&(this.tooltip=await(0,n.build_view)(t,{parent:this}))}remove(){this.tooltip?.remove(),super.remove()}render(){super.render();const t=t=>{this.tooltip?.model.setv({visible:t})};let o;this.el.addEventListener("mouseenter",()=>{o=setTimeout(()=>t(!0),this.model.tooltip_delay)}),this.el.addEventListener("mouseleave",()=>{clearTimeout(o),t(!1)})}}e.CheckboxButtonGroupView=CheckboxButtonGroupView;class CheckboxButtonGroup extends u.CheckboxButtonGroup{static __module__="panel.models.widgets";constructor(t){super(t)}static{this.prototype.default_view=CheckboxButtonGroupView,this.define(({Nullable:t,Ref:o,Float:e})=>({tooltip:[t(o(s.Tooltip)),null],tooltip_delay:[e,500]}))}}e.CheckboxButtonGroup=CheckboxButtonGroup},
|
|
156
156
|
"a9ce3554f5": function _(e,t,s,n,a){n();const r=e("2f8fe6797e"),i=e("@bokehjs/core/bokeh_events");class ChatMessageEvent extends i.ModelEvent{value;constructor(e){super(),this.value=e}get event_values(){return{model:this.origin,value:this.value}}static{this.prototype.event_name="chat_message_event"}}s.ChatMessageEvent=ChatMessageEvent;class ChatAreaInputView extends r.TextAreaInputView{connect_signals(){super.connect_signals();const{value_input:e}=this.model.properties;this.on_change(e,()=>this.update_rows())}render(){super.render(),this.el.addEventListener("keydown",e=>{"Enter"===e.key&&(e.shiftKey||e.ctrlKey==this.model.enter_sends?e.ctrlKey&&this.model.enter_sends&&(this.model.value_input+="\n",e.preventDefault()):(this.model.disabled_enter||(this.model.trigger_event(new ChatMessageEvent(this.model.value_input)),this.model.value_input=""),e.preventDefault()))})}}s.ChatAreaInputView=ChatAreaInputView;class ChatAreaInput extends r.TextAreaInput{declare;constructor(e){super(e)}static __module__="panel.models.chatarea_input";static{this.prototype.default_view=ChatAreaInputView,this.define(({Bool:e})=>({disabled_enter:[e,!1],enter_sends:[e,!0]}))}}s.ChatAreaInput=ChatAreaInput},
|
|
157
157
|
"2f8fe6797e": function _(e,t,s,n,a){n();const r=e("@bokehjs/models/widgets/textarea_input");class TextAreaInputView extends r.TextAreaInputView{connect_signals(){super.connect_signals();const{value:e,max_rows:t}=this.model.properties;this.on_change([t,e],()=>this.update_rows())}update_rows(){if(!this.model.auto_grow)return;const e=this.input_el,t=e.value.split("\n"),s=Math.max(t.length,this.model.rows,1);e.rows=Math.min(s,this.model.max_rows||1/0)}render(){super.render(),this.update_rows(),this.el.addEventListener("input",()=>{this.update_rows()})}}s.TextAreaInputView=TextAreaInputView;class TextAreaInput extends r.TextAreaInput{constructor(e){super(e)}static __module__="panel.models.widgets";static{this.prototype.default_view=TextAreaInputView,this.define(({Bool:e,Int:t,Nullable:s})=>({auto_grow:[e,!1],max_rows:[s(t),null]}))}}s.TextAreaInput=TextAreaInput},
|
|
158
|
-
"
|
|
158
|
+
"5f6e6991cc": function _(e,t,s,n,i){n();const o=e("@bokehjs/document"),c=e("@bokehjs/core/view"),r=e("@bokehjs/model"),h=e("@bokehjs/protocol/message"),l=e("@bokehjs/protocol/receiver"),a=e("@bokehjs/core/serialization/buffer"),d=e("@bokehjs/core/util/types"),u=e("@bokehjs/core/util/object");s.comm_settings={debounce:!0};class CommManagerView extends c.View{}s.CommManagerView=CommManagerView;class CommManager extends r.Model{ns;_receiver;_client_comm;_event_buffer;_timeout;_blocked;_reconnect;constructor(e){super(e)}initialize(){super.initialize(),this._receiver=new l.Receiver,this._event_buffer=[],this._blocked=!1,this._reconnect=!1,this._timeout=Date.now(),null!=window.PyViz&&window.PyViz.comm_manager?(this.ns=window.PyViz,this.ns.comm_manager.register_target(this.plot_id,this.comm_id,e=>{for(const t of this.ns.shared_views.get(this.plot_id)??[])if(t!==this)try{t.msg_handler(e)}catch(e){console.error(e)}try{this.msg_handler(e)}catch(e){console.error(e)}}),this._client_comm=this.ns.comm_manager.get_client_comm(this.plot_id,this.client_comm_id,e=>{for(const e of this.ns.shared_views.get(this.plot_id)??[])if(e!==this)try{e._unblock()}catch(e){console.error(e)}this.on_ack(e)}),this._reconnect=!this._client_comm?.active||!1,this._register_view()):console.warn("Could not find comm manager on window.PyViz, ensure the extension is loaded.")}_register_view(){if(null==this.ns)return;null==this.ns.shared_views&&(this.ns.shared_views=new Map);const e=this.ns.shared_views.get(this.plot_id);null==e?this.ns.shared_views.set(this.plot_id,[this]):e.includes(this)||e.push(this)}_unregister_view(){this.document?.remove_on_change(this._document_listener);const e=this.ns?.shared_views?.get(this.plot_id);if(null==e)return;const t=e.filter(e=>e!==this);t.length?this.ns.shared_views.set(this.plot_id,t):this.ns.shared_views.delete(this.plot_id)}_document_listener=e=>this._document_changed(e);_doc_attached(){super._doc_attached(),null!=this.document&&this.document.on_change(this._document_listener),this._register_view()}_doc_detached(){this._unregister_view(),super._doc_detached()}_document_changed(e){e.sync&&(e instanceof o.ModelChangedEvent&&!e.model.properties[e.attr].syncable||(this._event_buffer.push(e),this._reconnect&&this._client_comm?.connected?this.on_ack({metadata:{msg_type:"Ready"}}):s.comm_settings.debounce?(!this._blocked||Date.now()>this._timeout)&&(setTimeout(()=>this.process_events(),this.debounce),this._blocked=!0,this._timeout=Date.now()+this.timeout):this.process_events()))}_extract_buffers(e,t){if((0,d.isArray)(e))for(const s of e)this._extract_buffers(s,t);else if(e instanceof Map)for(const s of e.keys()){const n=e.get(s);this._extract_buffers(n,t)}else{if(e instanceof a.Buffer){const{buffer:s}=e,n=t.length;return t.push(s),{id:n}}if((0,d.isPlainObject)(e))for(const s of(0,u.keys)(e)){const n=this._extract_buffers(e[s],t);null!=n&&(e[s]=n)}}}process_events(){if(null==this.document||null==this._client_comm)return;if(0===this._event_buffer.length)return;const e=this.document.create_json_patch(this._event_buffer);this._event_buffer=[];const t={...h.Message.create("PATCH-DOC",{},e)},s=[];this._extract_buffers(t.content,s),this._client_comm.send(t,{},s);for(const t of this.ns.shared_views.get(this.plot_id)??[])t!==this&&null!=t.document&&t.document.apply_json_patch(e,[],this.id)}disconnect_signals(){super.disconnect_signals(),this._unregister_view()}_unblock(){this._event_buffer.length>0?(this._blocked=!0,this._timeout=Date.now()+this.timeout,this.process_events()):this._blocked=!1}on_ack(e){const t=e.metadata;this._unblock(),"Ready"==t.msg_type&&t.content?console.log("Python callback returned following output:",t.content):"Error"==t.msg_type&&console.warn("Python failed with the following traceback:",t.traceback)}msg_handler(e){const t=e.metadata,s=e.buffers,n=e.content.data,i=this.plot_id;if("Ready"==t.msg_type)t.content?console.log("Python callback returned following output:",t.content):"Error"==t.msg_type&&console.warn("Python failed with the following traceback:",t.traceback);else if(null!=i){let e=null;if(i in this.ns.plot_index&&null!=this.ns.plot_index[i]?e=this.ns.plot_index[i]:void 0!==window.Bokeh&&i in window.Bokeh.index&&(e=window.Bokeh.index[i]),null==e)return;if(n.length)this._receiver.consume(n);else{if(!(null!=s&&s.length>0))return;this._receiver.consume(s[0].buffer)}const t=this._receiver.message;if(null!=t&&Object.keys(t.content).length>0&&null!=this.document){const e=t.content;this.document.apply_json_patch(e,t.buffers)}}}static __module__="panel.models.comm_manager";static{this.prototype.default_view=CommManagerView,this.define(({Int:e,Str:t,Nullable:s})=>({plot_id:[s(t),null],comm_id:[s(t),null],client_comm_id:[s(t),null],timeout:[e,5e3],debounce:[e,50]}))}}s.CommManager=CommManager},
|
|
159
159
|
"519009caed": function _(e,t,s,o,i){o();const l=e("@bokehjs/models/widgets/select");class CustomSelectView extends l.SelectView{connect_signals(){super.connect_signals();const{disabled_options:e}=this.model.properties;this.on_change(e,()=>this._update_disabled_options())}options_el(){const e=super.options_el(),{disabled_options:t}=this.model;return e.forEach(e=>{e instanceof HTMLOptionElement&&t.includes(e.value)&&e.setAttribute("disabled","true")}),e}_update_disabled_options(){for(const e of this.input_el.options)this.model.disabled_options.includes(e.value)?e.setAttribute("disabled","true"):e.removeAttribute("disabled")}}s.CustomSelectView=CustomSelectView;class CustomSelect extends l.Select{constructor(e){super(e)}static __module__="panel.models.widgets";static{this.prototype.default_view=CustomSelectView,this.define(({List:e,Str:t})=>({disabled_options:[e(t),[]]}))}}s.CustomSelect=CustomSelect},
|
|
160
160
|
"8653ba687c": function _(e,t,l,i,o){i();const s=e("@bokehjs/models/widgets/multiselect"),n=e("@bokehjs/core/bokeh_events");class DoubleClickEvent extends n.ModelEvent{option;constructor(e){super(),this.option=e}get event_values(){return{model:this.origin,option:this.option}}static{this.prototype.event_name="dblclick_event"}}l.DoubleClickEvent=DoubleClickEvent;class CustomMultiSelectView extends s.MultiSelectView{render(){super.render();for(const e of this.input_el.children)e.addEventListener("dblclick",e=>{e.target&&this.model.trigger_event(new DoubleClickEvent(e.target.value))})}}l.CustomMultiSelectView=CustomMultiSelectView;class CustomMultiSelect extends s.MultiSelect{constructor(e){super(e)}static __module__="panel.models.widgets";static{this.prototype.default_view=CustomMultiSelectView}}l.CustomMultiSelect=CustomMultiSelect},
|
|
161
|
-
"381057489b": function _(t,e,i,s,l){s();const o=t("tslib"),n=t("@bokehjs/core/dom"),a=t("@bokehjs/core/util/arrayable"),r=t("@bokehjs/core/util/defer"),d=t("@bokehjs/core/util/types"),h=t("@bokehjs/core/bokeh_events"),c=t("@bokehjs/core/dom"),u=t("@bokehjs/core/kinds"),g=t("@bokehjs/model"),m=t("@bokehjs/models/sources/column_data_source"),f=t("99a25e6992"),p=t("254387d0dc"),b=t("f8f420cdc3"),w=t("be689f0377"),y=t("00beb93e38"),v=t("aa07eb54cc"),z=o.__importDefault(t("b0fdc4e99b"));class TableEditEvent extends h.ModelEvent{column;row;value;old;constructor(t,e,i,s){super(),this.column=t,this.row=e,this.value=i,this.old=s}get event_values(){return{model:this.origin,column:this.column,row:this.row,value:this.value,old:this.old}}static{this.prototype.event_name="table-edit"}}i.TableEditEvent=TableEditEvent;class CellClickEvent extends h.ModelEvent{column;row;constructor(t,e){super(),this.column=t,this.row=e}get event_values(){return{model:this.origin,column:this.column,row:this.row}}static{this.prototype.event_name="cell-click"}}i.CellClickEvent=CellClickEvent;class SelectionEvent extends h.ModelEvent{indices;selected;flush;constructor(t,e,i=!1){super(),this.indices=t,this.selected=e,this.flush=i}get event_values(){return{model:this.origin,indices:this.indices,selected:this.selected,flush:this.flush}}static{this.prototype.event_name="selection-change"}}function x(t,e,i){for(const s of i)if(s[t]==e)return s;return null}function S(t,e,i,s=0){const l={};if(0==t.length)return l;let o="";s>0&&(o=i[s-1]);for(const n of t){const t=S(n._children,e,i,s+1);for(const e in t)(0,d.isArray)(t[e])?n[e]=(0,a.sum)(t[e])/t[e].length:n[e]=t[e];for(const t of e.slice(1)){let e="";"string"==typeof o?e=o:t.field in o&&(e=o[t.field]);const i=n[t.field];if(t.field in l){const s=l[t.field];"min"===e?l[t.field]=i<s?i:s:"max"===e?l[t.field]=i>s?i:s:"sum"===e?l[t.field]=i+s:"mean"===e&&((0,d.isArray)(l[t.field])?l[t.field].push(i):l[t.field]=[s,i])}else l[t.field]=i}}return l}function C(t,e,i,s){const l=[],o=e[0].field;for(const s of t){const t=s[i[0]];let n=x(o,t,l);null==n&&(n={_children:[]},n[o]=t,l.push(n));let a=n;for(const t of i.slice(1)){a=x(o,s[t],a._children),null==a&&(a={_children:[]},a[o]=s[t],n._children.push(a));for(const t of e.slice(1))a[t.field]=s[t];n=a}for(const t of e.slice(1))a[t.field]=s[t.field]}const n=[];for(const t of i)t in s?s[t]instanceof Map?n.push(Object.fromEntries(s[t])):n.push(s[t]):n.push("sum");return S(l,e,n),l}i.SelectionEvent=SelectionEvent;const T=function(t,e,i,s,l,o,n){let a;a=0;const r={zone:new window.luxon.IANAZone("UTC")};if(t=Number.isNaN(t)?window.luxon.DateTime.fromISO("invalid"):window.luxon.DateTime.fromMillis(t,r),e=Number.isNaN(e)?window.luxon.DateTime.fromISO("invalid"):window.luxon.DateTime.fromMillis(e,r),t.isValid){if(e.isValid)return t-e;a=1}else a=e.isValid?-1:0;return a*=-1,a},E=function(t,e,i,s){const l=t.getValue(),o={zone:new window.luxon.IANAZone("UTC")};let n;n="NaN"===l||null===l?null:window.luxon.DateTime.fromMillis(l,o).toFormat("yyyy-MM-dd");const a=document.createElement("input");function r(){const t=window.luxon.DateTime.fromFormat(a.value,"yyyy-MM-dd",o).toMillis();t!=n?i(t):s()}return a.setAttribute("type","date"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",a.value=n,e(()=>{a.focus(),a.style.height="100%"}),a.addEventListener("blur",r),a.addEventListener("keydown",t=>{"Enter"==t.key&&setTimeout(r,100),"Escape"==t.key&&setTimeout(s,100)}),a},M=function(t,e,i,s){const l=t.getValue(),o={zone:new window.luxon.IANAZone("UTC")};let n;n="NaN"===l||null===l?null:window.luxon.DateTime.fromMillis(l,o).toFormat("yyyy-MM-dd'T'T");const a=document.createElement("input");function r(){const t=window.luxon.DateTime.fromFormat(a.value,"yyyy-MM-dd'T'T",o).toMillis();t!=n?i(t):s()}return a.setAttribute("type","datetime-local"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",a.value=n,e(()=>{a.focus(),a.style.height="100%"}),a.addEventListener("blur",r),a.addEventListener("keydown",t=>{"Enter"==t.key&&setTimeout(r,100),"Escape"==t.key&&setTimeout(s,100)}),a};function k(t){return!(t instanceof g.Model)}function D(t,e){switch(e.type){case"StringEditor":e.completions.length>0?(t.editor="list",t.editorParams={values:e.completions,autocomplete:!0,listOnEmpty:!0}):t.editor="input";break;case"TextEditor":t.editor="textarea";break;case"IntEditor":case"NumberEditor":t.editor="number",t.editorParams={step:e.step},t.validator="IntEditor"===e.type?"integer":"numeric";break;case"CheckboxEditor":t.editor="tickCross";break;case"DateEditor":t.editor=E;break;case"SelectEditor":t.editor="list",t.editorParams={values:e.options};break;default:t.editor="input"}}const P=function(t,e){const i=t.getRow().getData();let s=e.options;for(const t of e.lookup_order)if(s=i[t]in s?s[i[t]]:[],Array.isArray(s))break;return s||[]};function L(t,e){if(null==t.columns)return t.field===e?t:null;for(const i of t.columns){const t=L(i,e);if(t)return t}}function N(t){if(null==t.columns)return{...t};const e=[];for(const i of t.columns)e.push(N(i));return{...t,columns:e}}class DataTabulatorView extends y.HTMLBoxView{tabulator;columns=new Map;container=null;_tabulator_cell_updating=!1;_pending_old_values=new Map;_updating_page=!1;_updating_expanded=!1;_updating_sort=!1;_updating_page_size=!1;_selection_updating=!1;_selection_pending=!0;_last_selected_row=null;_initializing;_lastVerticalScrollbarTopPosition=0;_lastHorizontalScrollbarLeftPosition=0;_applied_styles=!1;_building=!1;_pending_data=!1;_redrawing=!1;_resize_pending=!1;_resize_flush=null;_restore_scroll=!1;_updating_scroll=!1;_pending_scroll_restores=0;_restored_scroll={top:NaN,left:NaN};_is_scrolling=!1;_automatic_page_size=!1;_last_after_resize_el_width=null;_last_after_resize_el_height=null;_fonts_loaded=null;connect_signals(){super.connect_signals();const{configuration:t,layout:e,columns:i,groupby:s,visible:l,download:o,children:n,expanded:a,cell_styles:r,hidden_columns:d,page_size:h,page:c,max_page:u,frozen_rows:g,movable_columns:m,sorters:p,theme_classes:b}=this.model.properties;this.on_change([t,e,s,m],(0,f.debounce)(()=>{this.invalidate_render()},20,!1)),this.on_change(i,()=>{this.tabulator.setColumns(this.getColumns()),this.setHidden()}),this.on_change(o,()=>{const t=this.model.filename.endsWith(".json")?"json":"csv";this.tabulator.download(t,this.model.filename)}),this.on_change(n,()=>this.renderChildren()),this.on_change(a,()=>{if(null!=this.tabulator){for(const t of this.tabulator.rowManager.getRows())t.cells.length>0&&t.cells[0].layoutElement();for(const t of this.tabulator.rowManager.getRows())if(t.cells.length>0){const e=t.data._index,i=this.model.expanded.includes(e)?"\u25bc":"\u25ba";t.cells[1].element.innerText=i}this.model.embed_content&&!this._updating_expanded&&this.renderChildren()}}),this.on_change(r,()=>{this._applied_styles&&(this.record_scroll(),this._updating_scroll=!0,this.tabulator.redraw(!0),this._updating_scroll=!1),this.restore_scroll(),this.setStyles()}),this.on_change(d,()=>{this.setHidden(),this.tabulator.redraw(!0)}),this.on_change(h,()=>this.setPageSize()),this.on_change(c,()=>{this._updating_page||this.setPage()}),this.on_change(l,()=>this.setVisibility()),this.on_change(u,()=>this.setMaxPage()),this.on_change(g,()=>this.setFrozen()),this.on_change(p,()=>this.setSorters()),this.on_change(b,()=>this.setCSSClasses(this.tabulator.element)),this.on_change(this.model.source.properties.data,()=>{void 0!==this.tabulator&&(this._restore_scroll="horizontal",this._selection_updating=!0,this.record_scroll(),this._updating_scroll=!0,this.setData().then(()=>{this._selection_updating=!1,this.postUpdate(),this.restore_scroll()}))}),this.connect(this.model.source.streaming,()=>this.addData()),this.connect(this.model.source.patching,()=>{const t=this.model.source.selected.indices;this.record_scroll(),this._updating_scroll=!0,this.updateOrAddData(),this._updating_scroll=!1,this.model.source.selected.indices=t,this.restore_scroll()}),this.connect(this.model.source.selected.change,()=>this.setSelection()),this.connect(this.model.source.selected.properties.indices.change,()=>this.setSelection())}get groupBy(){return this.model.groupby.length>0&&(t=>{const e=[];for(const i of this.model.groupby){const s=`${i}: ${t[i]}`;e.push(s)}return e.join(", ")})}get sorters(){const t=[];this.model.sorters.length>0&&t.push({column:"_index",dir:"asc"});for(const e of this.model.sorters.reverse())void 0===e.column&&(e.column=e.field),t.push(e);return t}invalidate_render(){this.tabulator?.destroy(),this.tabulator=null,this.rerender_()}redraw(t=!0,e=!0){this._building||null==this.tabulator||this._redrawing||(this._redrawing=!0,t&&null!=this.tabulator.columnManager.element&&this.tabulator.columnManager.redraw(!0),e&&null!=this.tabulator.rowManager.renderer&&(this.tabulator.rowManager.redraw(!0),this.setStyles()),this._redrawing=!1,this._restore_scroll=!0)}get is_drawing(){return this._building||this._redrawing||!this.has_finished()}after_layout(){super.after_layout(),null!=this.tabulator&&this._initializing&&!this.is_drawing&&(this._initializing=!1,this._selection_pending&&this.setSelection(),this._request_resize_redraw())}after_resize(){if(super.after_resize(),this._is_scrolling||this._initializing||this.is_drawing)return;const t=this.el.clientWidth,e=this.el.clientHeight;null!==this._last_after_resize_el_width&&null!==this._last_after_resize_el_height&&Math.abs(t-this._last_after_resize_el_width)<=3&&Math.abs(e-this._last_after_resize_el_height)<=3||(this._last_after_resize_el_width=t,this._last_after_resize_el_height=e,this._request_resize_redraw())}_request_resize_redraw(){this._resize_pending=!0,null===this._resize_flush&&(this._resize_flush=this._flush_resize_when_root_ready(),this._resize_flush.finally(()=>{this._resize_flush=null,this._resize_pending&&this._request_resize_redraw()}))}async _flush_resize_when_root_ready(){for(;;){if(!this._resize_pending)return;if(await Promise.race([this.root.ready,new Promise(t=>setTimeout(t,250))]),this._resize_pending){if(!(this._is_scrolling||this._initializing||null===this.container||this.is_drawing||this._has_active_editor())&&this.stylesheets_settled)return this._resize_pending=!1,void this._resize_redraw();await(0,r.defer)()}}}_resize_redraw(){if(this._initializing||null===this.container||this._building||this._has_active_editor())return;const t=this.container.clientWidth,e=this.container.clientHeight;t>0&&e>0&&(this.record_scroll(),this._updating_scroll=!0,this.redraw(!0,!0),requestAnimationFrame(()=>{this._initializing=!1,this._selection_pending&&this.setSelection(),this.restore_scroll(),this.recompute_page_size()}))}_has_active_editor(){if(null===this.container)return!1;const t=[...this.shadow_el.querySelectorAll(".tabulator-edit-list")];return null!==this.container.querySelector(".tabulator-editing")||t.some(t=>t instanceof HTMLElement&&null!==t.offsetParent)}stylesheets(){return[...super.stylesheets(),z.default]}setCSSClasses(t){t.className="pnx-tabulator tabulator";for(const e of this.model.theme_classes)t.classList.add(e)}remove(){this.unwatch_fonts(),this._resize_pending=!1,this._last_after_resize_el_width=null,this._last_after_resize_el_height=null,this.tabulator?.destroy(),super.remove()}render(){this.tabulator?.destroy(),super.render(),this._last_after_resize_el_width=null,this._last_after_resize_el_height=null,this._initializing=!0,this._building=!0;const t=(0,c.div)({style:{display:"contents"}}),e=(0,c.div)({style:{width:"100%",height:"100%",visibility:"hidden"}});this.container=e,this.setCSSClasses(e),t.appendChild(e),this.shadow_el.appendChild(t);const i=this.getConfiguration();this.tabulator=new Tabulator(e,i),this.watch_stylesheets(),this.watch_fonts(),this.init_callbacks()}watch_fonts(){this.unwatch_fonts(),this._fonts_loaded=()=>this._request_resize_redraw(),document.fonts.addEventListener("loadingdone",this._fonts_loaded)}unwatch_fonts(){null!==this._fonts_loaded&&(document.fonts.removeEventListener("loadingdone",this._fonts_loaded),this._fonts_loaded=null)}style_redraw(){null!=this.tabulator&&(this._initializing||this._building||this.redraw(),this.setVisibility())}setVisibility(){if(null==this.tabulator)return;const t=!this._building&&this.stylesheets_settled;this.tabulator.element.style.visibility=this.model.visible&&t?"visible":"hidden"}tableInit(){this._building=!0;this.tabulator.modules.ajax.sendRequest=(t,e,i)=>this.requestPage(e.page,e.sort),this.tabulator.modules.page._parseRemoteData=()=>!1}init_callbacks(){this.tabulator.on("tableBuilding",()=>this.tableInit()),this.tabulator.on("tableBuilt",()=>this.tableBuilt()),this.tabulator.on("selectableRowsCheck",t=>{const e=this.model.selectable_rows;return null==e||e.includes(t._row.data._index)}),this.tabulator.on("tooltips",t=>`${t.getColumn().getField()}: ${t.getValue()}`),this.tabulator.on("scrollVertical",(0,f.debounce)(()=>{this.setStyles()},50,!1)),this.tabulator.on("rowSelectionChanged",(t,e,i,s)=>{this.rowSelectionChanged(t,e,i,s)}),this.tabulator.on("rowClick",(t,e)=>this.rowClicked(t,e)),this.tabulator.on("cellEdited",t=>this.cellEdited(t)),this.tabulator.on("dataFiltering",t=>{this.record_scroll(),this.model.filters=t}),this.tabulator.on("dataFiltered",(t,e)=>{this._building||(0===e.length&&this.tabulator.rowManager.renderEmptyScroll(),null!=this.model.pagination&&this.updatePage(this.tabulator.getPage()))}),this.tabulator.on("pageLoaded",t=>{this.updatePage(t)}),this.tabulator.on("renderComplete",()=>{this._building||this.postUpdate()}),this.tabulator.on("dataSorting",t=>{const e=[];for(const i of t)"_index"!==i.field&&e.push({field:i.field,dir:i.dir});"remote"!==this.model.pagination&&(this._updating_sort=!0,this.model.sorters=e.reverse(),this._updating_sort=!1)})}tableBuilt(){this.setSelection(),this.renderChildren(),this.setStyles();const t=this.shadow_el.querySelector(".tabulator-tableholder");let e;t&&t.addEventListener("scroll",()=>{this.record_scroll(),this._is_scrolling=!0,clearTimeout(e),e=setTimeout(()=>{this._is_scrolling=!1},200)}),this.model.pagination&&(this.setMaxPage(),this.tabulator.setPage(this.model.page)),this._initializing=this._building=!1,this.setVisibility(),this._pending_data&&this.setData().then(()=>this.postUpdate()),this._request_resize_redraw()}recompute_page_size(){if(!this.model.pagination||null!==this.model.page_size&&!this._automatic_page_size||this._initializing||!this.tabulator)return;const t=this.shadow_el.querySelector(".tabulator-tableholder"),e=this.shadow_el.querySelector(".tabulator-table");if(null!=this.model.page_size&&this.model.page>=this.model.max_page&&null!=e&&e.children.length<this.model.page_size)return;this._automatic_page_size=!0;const i=this.model.sizing_mode&&(this.model.sizing_mode.includes("height")||this.model.sizing_mode.includes("both"));if(null!=e&&null!=t){const s=t.clientHeight;let l=0,o=null;const n=[];for(let t=0;t<e.children.length;t++){const a=e.children[t].clientHeight;if(n.push(a),l+=a,l>s){o=t,i&&(o-=1);break}}if(0===n.length)return;if(l<s){o=e.children.length;const t=s-l;o+=Math.floor(t/Math.min(...n)),i&&(o-=1)}this._updating_page_size=!0;try{this.model.page_size=Math.max(o||1,1)}finally{this._updating_page_size=!1}}}requestPage(t,e){return new Promise((i,s)=>{try{if(null!=t&&null!=e){this._updating_sort=!0;const i=[];for(const t of e)"_index"!==t.field&&i.push({field:t.field,dir:t.dir});this.model.sorters=i,this._updating_sort=!1,this._updating_page=!0;try{this.model.page=t||1}finally{this._updating_page=!1}}i([])}catch(t){s(t)}})}getLayout(){switch(this.model.layout){case"fit_data":return"fitData";case"fit_data_fill":return"fitDataFill";case"fit_data_stretch":return"fitDataStretch";case"fit_data_table":return"fitDataTable";case"fit_columns":return"fitColumns"}}getConfiguration(){const t="toggle"===this.model.select_mode||NaN,e={...(0,v.transformJsPlaceholders)(this.model.configuration),index:"_index",nestedFieldSeparator:!1,movableColumns:this.model.movable_columns,selectableRows:t,columns:this.getColumns(),initialSort:this.sorters,layout:this.getLayout(),pagination:null!=this.model.pagination,paginationMode:this.model.pagination,paginationSize:this.model.page_size||20,paginationInitialPage:1,popupContainer:this.model.container_popup&&this.container,groupBy:this.groupBy,frozenRows:t=>this.model.frozen_rows.length>0&&this.model.frozen_rows.includes(t._row.data._index),rowFormatter:t=>this._render_row(t,!1)};null!=this.model.max_height&&(e.maxHeight=this.model.max_height),"remote"===this.model.pagination&&(e.ajaxURL="http://panel.pyviz.org",e.sortMode="remote");const i=this.getData();return{...e,data:i}}get_child(t){return this.model.children instanceof Map&&this.model.children.get(t)||null}get child_models(){const t=[];for(const e of this.model.expanded){const i=this.get_child(e);null!=i&&t.push(i)}return t}get row_index(){const t=this.tabulator.getRows(),e=new Map;for(const i of t){const t=i._row?.data._index;null!=t&&e.set(t,i)}return e}renderChildren(){new Promise(async()=>{await this.build_child_views();const t=this.row_index,e=this.model.expanded;for(const i of e){const s=this.get_child(i),l=t.get(i);null!=(null==s?null:this._child_views.get(s))&&this._render_row(l,i===e[e.length-1])}})}_render_row(t,e=!0){const i=t._row?.data._index;if(!this.model.expanded.includes(i))return;const s=this.get_child(i),l=null==s?null:this._child_views.get(s);null!=l&&(0,v.schedule_when)(()=>{const i=t.getElement(),s=getComputedStyle(this.tabulator.element.children[1].children[0]).backgroundColor,o=i.style.paddingLeft?`-${i.style.paddingLeft}`:"0",a=i.children[i.children.length-1];let r;if(null!=a&&"row-content"==a.className){if(r=a,r.children.length&&r.children[0]===l.el)return}else r=(0,c.div)({class:"row-content",style:{background_color:s,margin_left:o,max_width:"100%",overflow_x:"hidden"}}),i.appendChild(r);(0,n.display)(l.el),r.appendChild(l.el),0===l.shadow_el.children.length&&this.rerender_(l),e&&(this._update_children(),this.resize_table())},()=>this.has_finished())}resize_table(){if(null!=this.tabulator.rowManager.renderer)try{this.tabulator.rowManager.adjustTableSize()}catch(t){}this.invalidate_layout()}_expand_render(t){const e=t._cell.row.data._index;return this.model.expanded.indexOf(e)<0?"\u25ba":"\u25bc"}_update_expand(t){const e=t._cell.row.data._index,i=[...this.model.expanded];if(i.includes(e)){const t=i.indexOf(e),s=i.splice(t,1)[0],l=this.get_child(s);if(null!=l){const t=this._child_views.get(l);void 0!==t&&null!=t.el&&(0,n.undisplay)(t.el)}}else i.push(e);if(this._updating_expanded=!0,this.model.expanded=i,this._updating_expanded=!1,!i.includes(e))return;let s=!0;for(const t of this.model.expanded)if(null==this.get_child(t)){s=!1;break}s&&this.renderChildren()}getData(){const t=this.model.source;let e;return e=null===t||0===t.columns().length?[]:(0,w.transform_cds_to_records)(t,!0),this.model.configuration.dataTree&&(e=C(e,this.model.columns,this.model.indexes,this.model.aggregators)),e}getColumns(){this.columns=new Map;const t=(0,v.transformJsPlaceholders)(this.model.configuration?.columns),e=[];if(e.push({field:"_index",frozen:!0,visible:!1}),null!=t)for(const i of t){const t=N(i);if("expand"===i.formatter){const t={hozAlign:"center",cellClick:(t,e)=>{this._update_expand(e)},formatter:t=>this._expand_render(t),width:40,frozen:!0};e.push(t)}else"rowSelection"===t.formatter&&(t.cellClick=(t,e)=>{e.getRow().toggleSelect()}),e.push(t)}for(const i of this.model.columns){let s=null;if(null!=t)for(const t of e)if(s=L(t,i.field),null!=s)break;null==s&&(s={field:i.field}),this.columns.set(i.field,s),null==s.title&&(s.title=i.title),void 0===s.headerTooltip&&(s.headerTooltip=!0),null==s.width&&null!=i.width&&0!=i.width&&(s.width=i.width),null==s.formatter&&null!=i.formatter&&(s.formatter=this._get_formatter(i.formatter)),"timestamp"==s.sorter&&(s.sorter=T),void 0===s.sorter&&(s.sorter="string");const l=i.editor,o=null!=l&&(k(l)?"CellEditor"!==l.type:null!=l.default_view);null!=s.editor?"date"===s.editor?s.editor=E:"datetime"===s.editor?s.editor=M:"nested"===s.editor&&(s.editorParams.valuesLookup=t=>P(t,s.editorParams),s.editor="list"):o&&!k(l)?s.editor=(t,e,s,l)=>{this.renderEditor(i,t,e,s,l)}:o&&D(s,l),s.visible=0!=s.visible&&!this.model.hidden_columns.includes(i.field);const n=s.editable;(0,d.isFunction)(n)?s.editable=t=>this.model.editable&&o&&n(t):(0,d.isBoolean)(n)?s.editable=()=>this.model.editable&&o&&n:s.editable=()=>this.model.editable&&o,s.headerFilter&&(0,d.isBoolean)(s.headerFilter)&&(0,d.isString)(s.editor)&&(s.headerFilter=s.editor,s.headerFilterParams=s.editorParams);for(const t of this.model.sorters)s.field===t.field&&(s.headerSortStartingDir=t.dir);s.cellClick=(t,e)=>{const s=e.getData()._index,l=new CellClickEvent(i.field,s);this.model.trigger_event(l)},null==t&&e.push(s)}for(const t in this.model.buttons){const i={formatter:()=>this.model.buttons[t],hozAlign:"center",cellClick:(e,i)=>{const s=i.getData()._index,l=new CellClickEvent(t,s);this.model.trigger_event(l)}};e.push(i)}return this.model.container_popup&&"fit_data_stretch"!==this.model.layout&&e.push({width:1,maxWidth:1,minWidth:1,resizable:!1,cssClass:"empty",headerSort:!1}),e}_get_formatter(t){if(!k(t))return e=>{const i=e.getRow(),s=(0,c.div)();return s.innerHTML=t.doFormat(i,e,e.getValue(),null,i.getData()),s.children[0]};if("BooleanFormatter"===t.type)return"tickCross";const e=(0,p.cell_formatter)(t);return null!=e?t=>e(t.getValue(),t.getRow().getData()):void 0}renderEditor(t,e,i,s,l){const o=t.editor,n=new o.default_view({column:t,model:o,parent:this,container:e._cell.element});return n.initialize(),n.connect_signals(),i(()=>{n.setValue(e.getValue())}),n.inputEl.addEventListener("input",()=>{const t=n.serializeValue(),i=e.getValue(),o=n.validate();o.valid||l(o.msg),null!=i&&typeof t!=typeof i?l("Mismatching type"):s(n.serializeValue())}),n.inputEl}setData(){if(this._initializing||this._building||!this.tabulator.initialized)return this._pending_data=!0,Promise.resolve(void 0);this._pending_data=!1;const t=this.getData();return null!=this.model.pagination?this.tabulator.rowManager.setData(t,!0,!1):this.tabulator.setData(t)}addData(){const t=this.tabulator.rowManager.getRows(),e=t[t.length-1],i=e?.data._index||0;this._updating_page=!0,this.setData().then(()=>{this.model.follow&&(this.model.pagination&&this.tabulator.setPage(Math.ceil(this.tabulator.rowManager.getDataCount()/(this.model.page_size||20))),e&&this.tabulator.scrollToRow(i,"top",!1)),this._updating_page=!1})}postUpdate(){this.setSelection(),this.setStyles();const t=this._restore_scroll||"horizontal";this.restore_scroll("vertical"!==t,"horizontal"!==t),this._restore_scroll=!1}updateOrAddData(){if(this._tabulator_cell_updating)return;const t=this.tabulator.element.style.minHeight;this.tabulator.element.style.minHeight=`${this.tabulator.element.offsetHeight}px`;const e=(0,w.transform_cds_to_records)(this.model.source,!0);this.tabulator.setData(e).then(()=>{this.tabulator.element.style.minHeight=t})}setFrozen(){for(const t of this.model.frozen_rows)this.tabulator.getRow(t).freeze()}updatePage(t){"local"!==this.model.pagination||this.model.page===t||this._updating_page||(this._updating_page=!0,this.model.page=t,this._updating_page=!1,this.setStyles())}setGroupBy(){this.tabulator.setGroupBy(this.groupBy)}setSorters(){this._updating_sort||this.tabulator.setSort(this.sorters)}setStyles(){const t=this.model.cell_styles.data;if(null!=this.tabulator&&0!=this.tabulator.getDataCount()&&null!=t&&t.size){this._applied_styles=!1;for(const e of t.keys()){const i=t.get(e),s=this.tabulator.getRow(e);if(!s)continue;const l=s._row.cells;for(const t of i.keys()){const e=i.get(t),s=l[t];if(null==s||!e.length)continue;const o=s.element;for(const t of e){let e,i;if((0,d.isArray)(t))[e,i]=t;else{if(!t.includes(":"))continue;[e,i]=t.split(":")}o.style.setProperty(e,i.trimLeft()),this._applied_styles=!0}}}}}setHidden(){for(const t of this.tabulator.getColumns()){const e=t._column;"_index"==e.field||this.model.hidden_columns.includes(e.field)?t.hide():t.show()}}setMaxPage(){this.tabulator.setMaxPage(this.model.max_page),this.tabulator.modules.page.pagesElement&&this.tabulator.modules.page._setPageButtons()}setPage(){this.tabulator.setPage(Math.min(this.model.max_page,this.model.page)),"local"===this.model.pagination&&this.setStyles()}setPageSize(){this._updating_page_size||(this._automatic_page_size=!1),this.tabulator.setPageSize(this.model.page_size),"local"===this.model.pagination&&this.setStyles()}setSelection(){if(this._selection_updating)return;if(null==this.tabulator||this._initializing||!this.tabulator.initialized)return void(this._selection_pending=!0);this._selection_pending=!1;const t=this.model.source.selected.indices,e=this.tabulator.getSelectedData().map(t=>t._index);if(JSON.stringify(t)!=JSON.stringify(e)){this._selection_updating=!0,this.tabulator.deselectRow(),this.tabulator.selectRow(t);for(const e of t){this.tabulator.rowManager.findRow(e)&&this.tabulator.scrollToRow(e,"center",!1).catch(()=>{})}this._selection_updating=!1}}restore_scroll(t=!0,e=!0){if(!t&&!e)return;this._pending_scroll_restores+=1;const i=s=>{requestAnimationFrame(()=>{const l=this.tabulator?.rowManager?.element;if(null==l)return void(this._pending_scroll_restores-=1);const o={behavior:"instant"};e&&(o.top=this._lastVerticalScrollbarTopPosition),t&&(o.left=this._lastHorizontalScrollbarLeftPosition),this._updating_scroll=!0,l.scrollTo(o),this._updating_scroll=!1,e&&(this._restored_scroll.top=l.scrollTop),t&&(this._restored_scroll.left=l.scrollLeft);(null==o.top||Math.abs(l.scrollTop-o.top)<1)&&(null==o.left||Math.abs(l.scrollLeft-o.left)<1)||!(s>0)?this._pending_scroll_restores-=1:i(s-1)})};i(10)}record_scroll(){if(this._updating_scroll)return;const{scrollTop:t,scrollLeft:e}=this.tabulator.rowManager.element,i=this._pending_scroll_restores>0,s=this._restored_scroll;(!i||0!==t&&t!==s.top)&&(this._lastVerticalScrollbarTopPosition=t),(!i||0!==e&&e!==s.left)&&(this._lastHorizontalScrollbarLeftPosition=e)}rowClicked(t,e){if(this._selection_updating||this._initializing||(0,d.isString)(this.model.select_mode)||!1===this.model.select_mode||this.model.configuration.dataTree||"\u25ba"===t.srcElement?.innerText)return;let i=[];const s=this.model.source.selected,l=e._row.data._index;if(t.ctrlKey||t.metaKey)i=[...s.indices];else if(t.shiftKey&&this._last_selected_row){const t=e._row.parent.getDisplayRows(),s=t.indexOf(this._last_selected_row);if(-1!==s){const l=t.indexOf(e._row),o=s>l,[n,a]=o?[l+1,s+1]:[s,l];i=t.slice(n,a).map(t=>t.data._index),o&&(i=i.reverse())}}const o=!(t.ctrlKey||t.metaKey||t.shiftKey),n=i.includes(l),a="remote"===this.model.pagination;if(!n||a?i.push(l):i.splice(i.indexOf(l),1),(0,d.isNumber)(this.model.select_mode))for(;i.length>this.model.select_mode;)i.shift();const r=this._filter_selected(i);a||(this.tabulator.deselectRow(),this.tabulator.selectRow(r)),this._last_selected_row=e._row,this._selection_updating=!0,a||(s.indices=r),this.model.trigger_event(new SelectionEvent(i,!n,o)),this._selection_updating=!1}_filter_selected(t){const e=[];for(const i of t)(null==this.model.selectable_rows||this.model.selectable_rows.indexOf(i)>=0)&&e.push(i);return e}rowSelectionChanged(t,e,i,s){if(!(this._selection_updating||this._initializing||(0,d.isBoolean)(this.model.select_mode)||(0,d.isNumber)(this.model.select_mode)||this.model.configuration.dataTree)){if("remote"===this.model.pagination){const t=i.map(t=>t._row.data._index),e=s.map(t=>t._row.data._index);t.length>0&&(this._selection_updating=!0,this.model.trigger_event(new SelectionEvent(t,!0,!1))),e.length>0&&(this._selection_updating=!0,this.model.trigger_event(new SelectionEvent(e,!1,!1)))}else{const e=t.map(t=>t._index),i=this._filter_selected(e);this._selection_updating=e.length===i.length,this.model.source.selected.indices=i}this._selection_updating=!1}}cellEdited(t){const e=t._cell.column.field,i=this.columns.get(e),s=t.getData()._index,l=t._cell.value,o=`${e}:${s}`;if("numeric"===i.validator&&""===l)return this._pending_old_values.set(o,t._cell.oldValue),void t.setValue(NaN,!0);let n=t._cell.oldValue;this._pending_old_values.has(o)&&(n=this._pending_old_values.get(o),this._pending_old_values.delete(o)),this.model.trigger_event(new TableEditEvent(e,s,l,n)),this._tabulator_cell_updating=!0,b.comm_settings.debounce=!1;try{this.model.source.patch({[e]:[[s,l]]})}finally{b.comm_settings.debounce=!0,this._tabulator_cell_updating=!1}this.tabulator.scrollToRow(s,"top",!1)}}i.DataTabulatorView=DataTabulatorView,i.TableLayout=(0,u.Enum)("fit_data","fit_data_fill","fit_data_stretch","fit_data_table","fit_columns");class TabulatorColumn extends g.Model{constructor(t){super(t)}static __module__="panel.models.tabulator";static{this.define(({Any:t,Float:e,Nullable:i,Str:s})=>({field:[s],title:[i(s),null],width:[e,300],formatter:[i(t),null],editor:[i(t),null]}))}}i.TabulatorColumn=TabulatorColumn;class DataTabulator extends y.HTMLBox{constructor(t){super(t)}static __module__="panel.models.tabulator";static{this.prototype.default_view=DataTabulatorView,this.define(({Any:t,List:e,Bool:s,Nullable:l,Float:o,Ref:n,Str:a})=>({aggregators:[t,{}],buttons:[t,{}],children:[t,new Map],configuration:[t,{}],columns:[e(n(TabulatorColumn)),[]],download:[s,!1],editable:[s,!0],embed_content:[s,!1],expanded:[e(o),[]],filename:[a,"table.csv"],filters:[e(t),[]],follow:[s,!0],frozen_rows:[e(o),[]],groupby:[e(a),[]],hidden_columns:[e(a),[]],indexes:[e(a),[]],layout:[i.TableLayout,"fit_data"],max_page:[o,0],movable_columns:[s,!1],pagination:[l(a),null],page:[o,0],page_size:[l(o),null],select_mode:[t,!0],selectable_rows:[l(e(o)),null],source:[n(m.ColumnDataSource)],sorters:[e(t),[]],cell_styles:[t,{}],theme_classes:[e(a),[]],container_popup:[s,!0]}))}}i.DataTabulator=DataTabulator},
|
|
161
|
+
"ab964e46db": function _(t,e,i,s,l){s();const o=t("tslib"),n=t("@bokehjs/core/dom"),a=t("@bokehjs/core/util/arrayable"),r=t("@bokehjs/core/util/defer"),d=t("@bokehjs/core/util/types"),h=t("@bokehjs/core/bokeh_events"),u=t("@bokehjs/core/dom"),c=t("@bokehjs/core/kinds"),g=t("@bokehjs/model"),m=t("@bokehjs/models/sources/column_data_source"),p=t("@bokehjs/document/events"),f=t("99a25e6992"),b=t("254387d0dc"),w=t("5f6e6991cc"),y=t("ce212d2be6"),v=t("00beb93e38"),z=t("aa07eb54cc"),x=o.__importDefault(t("b0fdc4e99b"));class TableEditEvent extends h.ModelEvent{column;row;value;old;constructor(t,e,i,s){super(),this.column=t,this.row=e,this.value=i,this.old=s}get event_values(){return{model:this.origin,column:this.column,row:this.row,value:this.value,old:this.old}}static{this.prototype.event_name="table-edit"}}i.TableEditEvent=TableEditEvent;class CellClickEvent extends h.ModelEvent{column;row;constructor(t,e){super(),this.column=t,this.row=e}get event_values(){return{model:this.origin,column:this.column,row:this.row}}static{this.prototype.event_name="cell-click"}}i.CellClickEvent=CellClickEvent;class SelectionEvent extends h.ModelEvent{indices;selected;flush;constructor(t,e,i=!1){super(),this.indices=t,this.selected=e,this.flush=i}get event_values(){return{model:this.origin,indices:this.indices,selected:this.selected,flush:this.flush}}static{this.prototype.event_name="selection-change"}}function S(t,e,i){for(const s of i)if(s[t]==e)return s;return null}function C(t,e,i,s=0){const l={};if(0==t.length)return l;let o="";s>0&&(o=i[s-1]);for(const n of t){const t=C(n._children,e,i,s+1);for(const e in t)(0,d.isArray)(t[e])?n[e]=(0,a.sum)(t[e])/t[e].length:n[e]=t[e];for(const t of e.slice(1)){let e="";"string"==typeof o?e=o:t.field in o&&(e=o[t.field]);const i=n[t.field];if(t.field in l){const s=l[t.field];"min"===e?l[t.field]=i<s?i:s:"max"===e?l[t.field]=i>s?i:s:"sum"===e?l[t.field]=i+s:"mean"===e&&((0,d.isArray)(l[t.field])?l[t.field].push(i):l[t.field]=[s,i])}else e&&(l[t.field]=i)}}return l}function M(t,e,i,s){const l=[],o=e[0].field;for(const s of t){const t=s[i[0]];let n=S(o,t,l);null==n&&(n={_children:[]},n[o]=t,l.push(n));let a=n;for(const t of i.slice(1)){a=S(o,s[t],a._children),null==a&&(a={_children:[]},a[o]=s[t],n._children.push(a));for(const t of e.slice(1))a[t.field]=s[t];n=a}for(const t of e.slice(1))a[t.field]=s[t.field]}const n=[];for(const t of i)t in s?s[t]instanceof Map?n.push(Object.fromEntries(s[t])):n.push(s[t]):n.push("");return C(l,e,n),l}i.SelectionEvent=SelectionEvent;const T=function(t,e,i,s,l,o,n){let a;a=0;const r={zone:new window.luxon.IANAZone("UTC")};if(t=Number.isNaN(t)?window.luxon.DateTime.fromISO("invalid"):window.luxon.DateTime.fromMillis(t,r),e=Number.isNaN(e)?window.luxon.DateTime.fromISO("invalid"):window.luxon.DateTime.fromMillis(e,r),t.isValid){if(e.isValid)return t-e;a=1}else a=e.isValid?-1:0;return a*=-1,a},E=function(t,e,i,s){const l=t.getValue(),o={zone:new window.luxon.IANAZone("UTC")};let n;n="NaN"===l||null===l?null:window.luxon.DateTime.fromMillis(l,o).toFormat("yyyy-MM-dd");const a=document.createElement("input");function r(){const t=window.luxon.DateTime.fromFormat(a.value,"yyyy-MM-dd",o).toMillis();t!=n?i(t):s()}return a.setAttribute("type","date"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",a.value=n,e(()=>{a.focus(),a.style.height="100%"}),a.addEventListener("blur",r),a.addEventListener("keydown",t=>{"Enter"==t.key&&setTimeout(r,100),"Escape"==t.key&&setTimeout(s,100)}),a},D=function(t,e,i,s){const l=t.getValue(),o={zone:new window.luxon.IANAZone("UTC")};let n;n="NaN"===l||null===l?null:window.luxon.DateTime.fromMillis(l,o).toFormat("yyyy-MM-dd'T'T");const a=document.createElement("input");function r(){const t=window.luxon.DateTime.fromFormat(a.value,"yyyy-MM-dd'T'T",o).toMillis();t!=n?i(t):s()}return a.setAttribute("type","datetime-local"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",a.value=n,e(()=>{a.focus(),a.style.height="100%"}),a.addEventListener("blur",r),a.addEventListener("keydown",t=>{"Enter"==t.key&&setTimeout(r,100),"Escape"==t.key&&setTimeout(s,100)}),a};function k(t){return!(t instanceof g.Model)}function P(t,e){switch(e.type){case"StringEditor":e.completions.length>0?(t.editor="list",t.editorParams={values:e.completions,autocomplete:!0,listOnEmpty:!0}):t.editor="input";break;case"TextEditor":t.editor="textarea";break;case"IntEditor":case"NumberEditor":t.editor="number",t.editorParams={step:e.step},t.validator="IntEditor"===e.type?"integer":"numeric";break;case"CheckboxEditor":t.editor="tickCross";break;case"DateEditor":t.editor=E;break;case"SelectEditor":t.editor="list",t.editorParams={values:e.options};break;default:t.editor="input"}}const R=function(t,e){const i=t.getRow().getData();let s=e.options;for(const t of e.lookup_order)if(s=i[t]in s?s[i[t]]:[],Array.isArray(s))break;return s||[]};function A(t,e){if(null==t.columns)return t.field===e?t:null;for(const i of t.columns){const t=A(i,e);if(t)return t}}function N(t){if(null==t.columns)return{...t};const e=[];for(const i of t.columns)e.push(N(i));return{...t,columns:e}}const L=new WeakMap;function V(t){let e=L.get(t);return void 0===e&&(e=new Set(t),L.set(t,e)),e}function F(t,e){return null==t?null:t instanceof Map?t.get(e)??null:t[e]??null}class DataTabulatorView extends v.HTMLBoxView{tabulator;columns=new Map;container=null;_tabulator_cell_updating=!1;_pending_old_values=new Map;_updating_page=!1;_updating_expanded=!1;_updating_sort=!1;_updating_page_size=!1;_selection_updating=!1;_selection_pending=!0;_last_selected_row=null;_initializing=!0;_lastVerticalScrollbarTopPosition=0;_lastHorizontalScrollbarLeftPosition=0;_styles_version=0;_styled_cells=new WeakMap;_building=!1;_pending_data=!1;_updating_data=!1;_redrawing=!1;_resized_columns=new Map;_resize_pending=!1;_resize_flush=null;_restore_scroll=!1;_updating_scroll=!1;_pending_scroll_restores=0;_restored_scroll={top:NaN,left:NaN};_is_scrolling=!1;_automatic_page_size=!1;_last_after_resize_el_width=null;_last_after_resize_el_height=null;_fonts_loaded=null;connect_signals(){super.connect_signals();const{configuration:t,layout:e,columns:i,groupby:s,visible:l,download:o,children:n,expanded:a,cell_styles:r,hidden_columns:d,page_size:h,page:u,max_page:c,frozen_rows:g,movable_columns:m,sorters:p,theme_classes:b}=this.model.properties;this.on_change([t,e,s,m],(0,f.debounce)(()=>{this.invalidate_render()},20,!1)),this.on_change(i,()=>{this.tabulator.setColumns(this.getColumns()),this.setHidden()}),this.on_change(o,()=>{const t=this.model.filename.endsWith(".json")?"json":"csv";this.tabulator.download(t,this.model.filename)}),this.on_change(n,()=>this.renderChildren()),this.on_change(a,()=>{if(null==this.tabulator)return;const t=V(this.model.expanded);for(const e of this.tabulator.rowManager.getRows())e.cells.length>1&&(e.cells[0].layoutElement(),e.cells[1].element.innerText=t.has(e.data._index)?"\u25bc":"\u25ba");this.model.embed_content&&!this._updating_expanded&&this.renderChildren()}),this.on_change(r,()=>{this._styles_version+=1,this.setStyles()}),this.on_change(d,()=>{this.setHidden(),this.tabulator.columnManager.redraw(!1)}),this.on_change(h,()=>this.setPageSize()),this.on_change(u,()=>{this._updating_page||this.setPage()}),this.on_change(l,()=>this.setVisibility()),this.on_change(c,()=>this.setMaxPage()),this.on_change(g,()=>this.setFrozen()),this.on_change(p,()=>this.setSorters()),this.on_change(b,()=>this.setCSSClasses(this.tabulator.element)),this.on_change(this.model.source.properties.data,()=>{null!=this.tabulator&&(this._restore_scroll="horizontal",this._selection_updating=!0,this.record_scroll(),this._updating_scroll=!0,this._updating_data=!0,this.setData().finally(()=>{this._updating_data=!1}).then(()=>{this._selection_updating=!1,this.refitColumns(),this.postUpdate(),this.restore_scroll()}))});const w=this.model.document;null!=w?w.on_change(this._on_document_change):this.connect(this.model.source.streaming,()=>this.addData(null,null)),this.connect(this.model.source.patching,t=>this.updateOrAddData(t)),this.connect(this.model.source.selected.change,()=>this.setSelection()),this.connect(this.model.source.selected.properties.indices.change,()=>this.setSelection())}disconnect_signals(){this.model.document?.remove_on_change(this._on_document_change),super.disconnect_signals()}_on_document_change=t=>{t instanceof p.ColumnsStreamedEvent&&t.model===this.model.source&&"data"===t.attr&&this.addData(t.data,t.rollover??null)};get groupBy(){return this.model.groupby.length>0&&(t=>{const e=[];for(const i of this.model.groupby){const s=`${i}: ${t[i]}`;e.push(s)}return e.join(", ")})}get sorters(){const t=[];this.model.sorters.length>0&&t.push({column:"_index",dir:"asc"});for(const e of[...this.model.sorters].reverse())t.push(void 0===e.column?{...e,column:e.field}:e);return t}invalidate_render(){this.tabulator?.destroy(),this.tabulator=null,this._resized_columns.clear(),this.rerender_()}refitColumns(t){if(!this._building&&null!=this.tabulator&&this.model.layout.startsWith("fit_data")){if(null!=t&&"fit_data_stretch"!==this.model.layout){const e=this.tabulator.getColumn(t);return void(null==e||this._resized_columns.has(t)||null!=e.getDefinition().width||e.setWidth(!0))}this.tabulator.columnManager.layoutRefresh(!0);for(const[t,e]of this._resized_columns)this.tabulator.getColumn(t)?.setWidth(e)}}redraw(t=!0,e=!0){this._building||null==this.tabulator||this._redrawing||(this._redrawing=!0,t&&null!=this.tabulator.columnManager.element&&this.tabulator.columnManager.redraw(!0),e&&null!=this.tabulator.rowManager.renderer&&(this.tabulator.rowManager.redraw(!0),this.setStyles()),this._redrawing=!1,this._restore_scroll=!0)}get is_drawing(){return this._building||this._redrawing||!this.has_finished()}after_layout(){super.after_layout(),null!=this.tabulator&&this._initializing&&!this.is_drawing&&(this._initializing=!1,this._selection_pending&&this.setSelection(),this._request_resize_redraw())}after_resize(){if(super.after_resize(),this._is_scrolling||this._initializing||this.is_drawing)return;const t=this.el.clientWidth,e=this.el.clientHeight;null!==this._last_after_resize_el_width&&null!==this._last_after_resize_el_height&&Math.abs(t-this._last_after_resize_el_width)<=3&&Math.abs(e-this._last_after_resize_el_height)<=3||(this._last_after_resize_el_width=t,this._last_after_resize_el_height=e,this._request_resize_redraw())}_request_resize_redraw(){this._resize_pending=!0,null===this._resize_flush&&(this._resize_flush=this._flush_resize_when_root_ready(),this._resize_flush.finally(()=>{this._resize_flush=null,this._resize_pending&&this._request_resize_redraw()}))}async _flush_resize_when_root_ready(){let t=0;for(;;){if(!this._resize_pending)return;if(await Promise.race([this.root.ready,new Promise(t=>setTimeout(t,250))]),this._resize_pending){if(!(this._is_scrolling||this._initializing||null===this.container||this.is_drawing||this._has_active_editor())&&this.stylesheets_settled)return this._resize_pending=!1,void this._resize_redraw();await(t++<10?(0,r.paint)():(0,r.delay)(250))}}}_resize_redraw(){if(this._initializing||null===this.container||this._building||this._has_active_editor())return;const t=this.container.clientWidth,e=this.container.clientHeight;t>0&&e>0&&(this.record_scroll(),this._updating_scroll=!0,this.redraw(!0,!0),this._updating_scroll=!1,this._pending_scroll_restores+=1,requestAnimationFrame(()=>{this._initializing=!1,this._selection_pending&&this.setSelection(),this._pending_scroll_restores-=1,this.restore_scroll(),this.recompute_page_size()}))}_has_active_editor(){if(null===this.container)return!1;const t=[...this.shadow_el.querySelectorAll(".tabulator-edit-list")];return null!==this.container.querySelector(".tabulator-editing")||t.some(t=>t instanceof HTMLElement&&null!==t.offsetParent)}stylesheets(){return[...super.stylesheets(),x.default]}setCSSClasses(t){t.className="pnx-tabulator tabulator";for(const e of this.model.theme_classes)t.classList.add(e)}remove(){this.unwatch_fonts(),this._resize_pending=!1,this._last_after_resize_el_width=null,this._last_after_resize_el_height=null,this.tabulator?.destroy(),super.remove()}render(){this.tabulator?.destroy(),super.render(),this._last_after_resize_el_width=null,this._last_after_resize_el_height=null,this._initializing=!0,this._building=!0;const t=(0,u.div)({style:{display:"contents"}}),e=(0,u.div)({style:{width:"100%",height:"100%",visibility:"hidden"}});this.container=e,this.setCSSClasses(e),t.appendChild(e),this.shadow_el.appendChild(t);const i=this.getConfiguration();this.tabulator=new Tabulator(e,i),this.watch_stylesheets(),this.watch_fonts(),this.init_callbacks()}watch_fonts(){this.unwatch_fonts(),this._fonts_loaded=()=>this._request_resize_redraw(),document.fonts.addEventListener("loadingdone",this._fonts_loaded)}unwatch_fonts(){null!==this._fonts_loaded&&(document.fonts.removeEventListener("loadingdone",this._fonts_loaded),this._fonts_loaded=null)}style_redraw(){null!=this.tabulator&&(this._initializing||this._building||this.redraw(),this.setVisibility())}setVisibility(){if(null==this.tabulator)return;const t=!this._building&&this.stylesheets_settled;this.tabulator.element.style.visibility=this.model.visible&&t?"visible":"hidden"}tableInit(){this._building=!0;this.tabulator.modules.ajax.sendRequest=(t,e,i)=>this.requestPage(e.page,e.sort),this.tabulator.modules.page._parseRemoteData=()=>!1}init_callbacks(){this.tabulator.on("tableBuilding",()=>this.tableInit()),this.tabulator.on("tableBuilt",()=>this.tableBuilt()),this.tabulator.on("selectableRowsCheck",t=>{const e=this.model.selectable_rows;return null==e||V(e).has(t._row.data._index)}),this.tabulator.on("tooltips",t=>`${t.getColumn().getField()}: ${t.getValue()}`),this.tabulator.on("scrollVertical",()=>this.setStyles()),this.tabulator.on("rowSelectionChanged",(t,e,i,s)=>{this.rowSelectionChanged(t,e,i,s)}),this.tabulator.on("rowClick",(t,e)=>this.rowClicked(t,e)),this.tabulator.on("cellEdited",t=>this.cellEdited(t)),this.tabulator.on("columnResized",t=>this._resized_columns.set(t.getField(),t.getWidth())),this.tabulator.on("dataFiltering",t=>{this.record_scroll(),this.model.filters=t}),this.tabulator.on("dataFiltered",(t,e)=>{this._building||(0===e.length&&this.tabulator.rowManager.renderEmptyScroll(),null!=this.model.pagination&&this.updatePage(this.tabulator.getPage()))}),this.tabulator.on("pageLoaded",t=>{this.updatePage(t)}),this.tabulator.on("renderComplete",()=>{this._building||this._updating_data||this.postUpdate()}),this.tabulator.on("dataSorting",t=>{const e=[];for(const i of t)"_index"!==i.field&&e.push({field:i.field,dir:i.dir});"remote"!==this.model.pagination&&(this._updating_sort=!0,this.model.sorters=e.reverse(),this._updating_sort=!1)})}tableBuilt(){this.setSelection(),this.renderChildren(),this.setStyles();const t=this.shadow_el.querySelector(".tabulator-tableholder");let e;t&&t.addEventListener("scroll",()=>{this.record_scroll(),this._is_scrolling=!0,clearTimeout(e),e=setTimeout(()=>{this._is_scrolling=!1},200)}),this.model.pagination&&(this.setMaxPage(),this.tabulator.setPage(this.model.page)),this._initializing=this._building=!1,this.setVisibility(),this._pending_data&&(this._updating_data=!0,this.setData().finally(()=>{this._updating_data=!1}).then(()=>this.postUpdate())),this._request_resize_redraw()}recompute_page_size(){if(!this.model.pagination||null!==this.model.page_size&&!this._automatic_page_size||this._initializing||!this.tabulator)return;const t=this.shadow_el.querySelector(".tabulator-tableholder"),e=this.shadow_el.querySelector(".tabulator-table");if(null!=this.model.page_size&&this.model.page>=this.model.max_page&&null!=e&&e.children.length<this.model.page_size)return;this._automatic_page_size=!0;const i=this.model.sizing_mode&&(this.model.sizing_mode.includes("height")||this.model.sizing_mode.includes("both"));if(null!=e&&null!=t){const s=t.clientHeight;let l=0,o=null;const n=[];for(let t=0;t<e.children.length;t++){const a=e.children[t].clientHeight;if(n.push(a),l+=a,l>s){o=t,i&&(o-=1);break}}if(0===n.length)return;if(l<s){o=e.children.length;const t=s-l;o+=Math.floor(t/Math.min(...n)),i&&(o-=1)}this._updating_page_size=!0;try{this.model.page_size=Math.max(o||1,1)}finally{this._updating_page_size=!1}}}requestPage(t,e){return new Promise((i,s)=>{try{if(null!=t&&null!=e){this._updating_sort=!0;const i=[];for(const t of e)"_index"!==t.field&&i.push({field:t.field,dir:t.dir});this.model.sorters=i,this._updating_sort=!1,this._updating_page=!0;try{this.model.page=t||1}finally{this._updating_page=!1}}i([])}catch(t){s(t)}})}getLayout(){switch(this.model.layout){case"fit_data":return"fitData";case"fit_data_fill":return"fitDataFill";case"fit_data_stretch":return"fitDataStretch";case"fit_data_table":return"fitDataTable";case"fit_columns":return"fitColumns"}}getConfiguration(){const t="toggle"===this.model.select_mode||!1!==this.model.select_mode&&NaN,e={...(0,z.transformJsPlaceholders)(this.model.configuration),index:"_index",nestedFieldSeparator:!1,movableColumns:this.model.movable_columns,selectableRows:t,columns:this.getColumns(),initialSort:this.sorters,layout:this.getLayout(),pagination:null!=this.model.pagination,paginationMode:this.model.pagination,paginationSize:this.model.page_size||20,paginationInitialPage:1,popupContainer:this.model.container_popup&&this.container,groupBy:this.groupBy,frozenRows:t=>this.model.frozen_rows.length>0&&V(this.model.frozen_rows).has(t._row.data._index),rowFormatter:t=>{this._style_row(t),this._render_row(t,!1)}};null!=this.model.max_height&&(e.maxHeight=this.model.max_height),"remote"===this.model.pagination&&(e.ajaxURL="http://panel.pyviz.org",e.sortMode="remote");const i=this.getData();return{...e,data:i}}get_child(t){return this.model.children instanceof Map&&this.model.children.get(t)||null}get child_models(){const t=[];for(const e of this.model.expanded){const i=this.get_child(e);null!=i&&t.push(i)}return t}get row_index(){const t=this.tabulator.getRows(),e=new Map;for(const i of t){const t=i._row?.data._index;null!=t&&e.set(t,i)}return e}renderChildren(){new Promise(async()=>{await this.build_child_views();const t=this.row_index,e=this.model.expanded;for(const i of e){const s=this.get_child(i),l=t.get(i);null!=(null==s?null:this._child_views.get(s))&&this._render_row(l,i===e[e.length-1])}})}_render_row(t,e=!0){const i=t._row?.data._index;if(!V(this.model.expanded).has(i))return;const s=this.get_child(i),l=null==s?null:this._child_views.get(s);null!=l&&(0,z.schedule_when)(()=>{const i=t.getElement(),s=i.style.paddingLeft?`-${i.style.paddingLeft}`:"0",o=i.children[i.children.length-1];let a;if(null!=o&&"row-content"==o.className){if(a=o,a.children.length&&a.children[0]===l.el)return}else{const t=getComputedStyle(this.tabulator.element.children[1].children[0]).backgroundColor;a=(0,u.div)({class:"row-content",style:{background_color:t,margin_left:s,max_width:"100%",overflow_x:"hidden"}}),i.appendChild(a)}(0,n.display)(l.el),a.appendChild(l.el),0===l.shadow_el.children.length&&this.rerender_(l),e&&(this._update_children(),this.resize_table())},()=>this.has_finished())}resize_table(){if(null!=this.tabulator.rowManager.renderer)try{this.tabulator.rowManager.adjustTableSize()}catch(t){}this.invalidate_layout()}_expand_render(t){const e=t._cell.row.data._index;return V(this.model.expanded).has(e)?"\u25bc":"\u25ba"}_update_expand(t){const e=t._cell.row.data._index,i=[...this.model.expanded];if(i.includes(e)){const t=i.indexOf(e),s=i.splice(t,1)[0],l=this.get_child(s);if(null!=l){const t=this._child_views.get(l);void 0!==t&&null!=t.el&&(0,n.undisplay)(t.el)}}else i.push(e);if(this._updating_expanded=!0,this.model.expanded=i,this._updating_expanded=!1,!i.includes(e))return;let s=!0;for(const t of this.model.expanded)if(null==this.get_child(t)){s=!1;break}s&&this.renderChildren()}getData(){const t=this.model.source;let e;return e=null===t||0===t.columns().length?[]:(0,y.transform_cds_to_records)(t,!0),this.model.configuration.dataTree&&(e=M(e,this.model.columns,this.model.indexes,this.model.aggregators)),e}getColumns(){this.columns=new Map;const t=(0,z.transformJsPlaceholders)(this.model.configuration?.columns),e=[];if(e.push({field:"_index",frozen:!0,visible:!1}),null!=t)for(const i of t){const t=N(i);if("expand"===i.formatter){const t={hozAlign:"center",cellClick:(t,e)=>{this._update_expand(e)},formatter:t=>this._expand_render(t),width:40,frozen:!0};e.push(t)}else"rowSelection"===t.formatter&&(t.cellClick=(t,e)=>{e.getRow().toggleSelect()}),e.push(t)}for(const i of this.model.columns){let s=null;if(null!=t)for(const t of e)if(s=A(t,i.field),null!=s)break;null==s&&(s={field:i.field}),this.columns.set(i.field,s),null==s.title&&(s.title=i.title),void 0===s.headerTooltip&&(s.headerTooltip=!0),null==s.width&&null!=i.width&&0!=i.width&&(s.width=i.width),null==s.formatter&&null!=i.formatter&&(s.formatter=this._get_formatter(i.formatter)),"timestamp"==s.sorter&&(s.sorter=T),void 0===s.sorter&&(s.sorter="string");const l=i.editor,o=null!=l&&(k(l)?"CellEditor"!==l.type:null!=l.default_view);null!=s.editor?"date"===s.editor?s.editor=E:"datetime"===s.editor?s.editor=D:"nested"===s.editor&&(s.editorParams.valuesLookup=t=>R(t,s.editorParams),s.editor="list"):o&&!k(l)?s.editor=(t,e,s,l)=>{this.renderEditor(i,t,e,s,l)}:o&&P(s,l),s.visible=0!=s.visible&&!this.model.hidden_columns.includes(i.field);const n=s.editable;(0,d.isFunction)(n)?s.editable=t=>this.model.editable&&o&&n(t):(0,d.isBoolean)(n)?s.editable=()=>this.model.editable&&o&&n:s.editable=()=>this.model.editable&&o,s.headerFilter&&(0,d.isBoolean)(s.headerFilter)&&(0,d.isString)(s.editor)&&(s.headerFilter=s.editor,s.headerFilterParams=s.editorParams);for(const t of this.model.sorters)s.field===t.field&&(s.headerSortStartingDir=t.dir);s.cellClick=(t,e)=>{const s=e.getData()._index,l=new CellClickEvent(i.field,s);this.model.trigger_event(l)},null==t&&e.push(s)}for(const t in this.model.buttons){const i={formatter:()=>this.model.buttons[t],hozAlign:"center",cellClick:(e,i)=>{const s=i.getData()._index,l=new CellClickEvent(t,s);this.model.trigger_event(l)}};e.push(i)}return this.model.container_popup&&"fit_data_stretch"!==this.model.layout&&e.push({width:1,maxWidth:1,minWidth:1,resizable:!1,cssClass:"empty",headerSort:!1}),e}_get_formatter(t){if(!k(t))return e=>{const i=e.getRow(),s=(0,u.div)();return s.innerHTML=t.doFormat(i,e,e.getValue(),null,i.getData()),s.children[0]};if("BooleanFormatter"===t.type)return"tickCross";const e=(0,b.cell_formatter)(t);return null!=e?t=>e(t.getValue(),t.getRow().getData()):void 0}renderEditor(t,e,i,s,l){const o=t.editor,n=new o.default_view({column:t,model:o,parent:this,container:e._cell.element});return n.initialize(),n.connect_signals(),i(()=>{n.setValue(e.getValue())}),n.inputEl.addEventListener("input",()=>{const t=n.serializeValue(),i=e.getValue(),o=n.validate();o.valid||l(o.msg),null!=i&&typeof t!=typeof i?l("Mismatching type"):s(n.serializeValue())}),n.inputEl}setData(){if(this._initializing||this._building||!this.tabulator.initialized)return this._pending_data=!0,Promise.resolve(void 0);this._pending_data=!1;const t=this.getData();return null!=this.model.pagination?this.tabulator.rowManager.setData(t,!0,!1):this.tabulator.setData(t)}get can_update_in_place(){return null!=this.tabulator&&this.tabulator.initialized&&!this._initializing&&!this._building&&!this._pending_data&&!this.model.configuration.dataTree}addData(t,e){if(null==this.tabulator)return;const i=this.tabulator.rowManager.getRows(),s=i[i.length-1],l=s?.data._index||0,o=this.model.source.get_length()??0,n=null==t?null:function(t){const e=t instanceof Map?[...t.values()]:Object.values(t);for(const t of e)return null!=t.shape?t.shape[0]:t.length;return null}(t),a=null!=n&&this.can_update_in_place&&i.length+n===o&&(null==e||o<=e);let r;if(this._updating_page=!0,a){this._updating_data=!0;try{this._append_rows((0,y.transform_cds_to_records)(this.model.source,!0,i.length))}finally{this._updating_data=!1}r=Promise.resolve()}else r=this.setData();r.then(()=>{this.model.follow&&(this.model.pagination&&this.tabulator.setPage(Math.ceil(this.tabulator.rowManager.getDataCount()/(this.model.page_size||20))),s&&this.tabulator.scrollToRow(l,"top",!1)),this._updating_page=!1})}_append_rows(t){const e=this.tabulator.rowManager;let i=null==this.model.pagination?void 0:e.rows[e.rows.length-1];const{setActiveRows:s,refreshActiveData:l}=e;e.setActiveRows=()=>{},e.refreshActiveData=()=>{};try{for(const s of t){const t=e.addRow(s,!1,i,!0);e.dispatch("row-added",t,s,!1,i),void 0!==i&&(i=t)}}finally{e.setActiveRows=s,e.refreshActiveData=l}e.setActiveRows(e.activeRows),e.refreshActiveData(!1,!1,!0),e.regenerateRowPositions(),e.displayRowsCount&&e._clearPlaceholder()}postUpdate(){this.setSelection(),this.setStyles();const t=this._restore_scroll||"horizontal";this.restore_scroll("vertical"!==t,"horizontal"!==t),this._restore_scroll=!1}updateOrAddData(t){if(this._tabulator_cell_updating||null==this.tabulator)return;const e=this.tabulator.rowManager.getRows().length;if(this.can_update_in_place&&!this.tabulator.options.groupBy&&(0,d.isArray)(t)&&t.length>0&&2*t.length<e&&t.every(d.isNumber)){const e=(0,y.transform_cds_rows_to_records)(this.model.source,t,!0);if(e.length===t.length){const t=this.tabulator.getSorters().length>0||this.tabulator.getFilters(!0).length>0;return void this.tabulator.updateData(e).then(()=>{t&&this.tabulator.refreshFilter()}).catch(()=>this.replaceData())}}this.replaceData()}replaceData(){const t=this.model.source.selected.indices;this.record_scroll(),this._updating_scroll=!0;const e=this.tabulator.element.style.minHeight;this.tabulator.element.style.minHeight=`${this.tabulator.element.offsetHeight}px`;const i=this.getData();this.tabulator.setData(i).then(()=>{this.tabulator.element.style.minHeight=e}),this._updating_scroll=!1,this.model.source.selected.indices=t,this.restore_scroll()}setFrozen(){for(const t of this.model.frozen_rows)this.tabulator.getRow(t).freeze()}updatePage(t){"local"!==this.model.pagination||this.model.page===t||this._updating_page||(this._updating_page=!0,this.model.page=t,this._updating_page=!1,this.setStyles())}setGroupBy(){this.tabulator.setGroupBy(this.groupBy)}setSorters(){this._updating_sort||this.tabulator.setSort(this.sorters)}setStyles(){if(null!=this.tabulator&&null!=this.tabulator.rowManager.renderer)for(const t of this.tabulator.rowManager.getVisibleRows(!0,!0))"row"===t.type&&this._style_row(t.getComponent())}_style_row(t){const e=this._styles_version,i=t._row?.data._index,s=null==i?null:F(this.model.cell_styles.data,i);for(const i of t._row?.cells??[]){const t=i.element;if(null==t)continue;const l=this._styled_cells.get(t);if(null!=l&&l.version===e)continue;if(null!=l){for(const e of l.props)t.style.removeProperty(e);this._styled_cells.delete(t)}const o=F(s,i.column.field),n=[];for(const e of o??[]){let i,s;if((0,d.isArray)(e))[i,s]=e;else{if(!e.includes(":"))continue;[i,s]=e.split(":")}t.style.setProperty(i,s.trimLeft()),n.push(i)}this._styled_cells.set(t,{version:e,props:n})}}setHidden(){for(const t of this.tabulator.getColumns()){const e=t._column;"_index"==e.field||this.model.hidden_columns.includes(e.field)?t.hide():t.show()}}setMaxPage(){this.tabulator.setMaxPage(this.model.max_page),this.tabulator.modules.page.pagesElement&&this.tabulator.modules.page._setPageButtons()}setPage(){this.tabulator.setPage(Math.min(this.model.max_page,this.model.page)),"local"===this.model.pagination&&this.setStyles()}setPageSize(){this._updating_page_size||(this._automatic_page_size=!1),this.tabulator.setPageSize(this.model.page_size),"local"===this.model.pagination&&this.setStyles()}setSelection(){if(this._selection_updating)return;if(null==this.tabulator||this._initializing||!this.tabulator.initialized)return void(this._selection_pending=!0);this._selection_pending=!1;const t=this.model.source.selected.indices,e=this.tabulator.getSelectedData().map(t=>t._index);if(JSON.stringify(t)==JSON.stringify(e))return;this._selection_updating=!0,this.tabulator.deselectRow(),this.tabulator.selectRow(t);const i=new Set(this.tabulator.rowManager.getDisplayRows());for(let e=t.length-1;e>=0;e--){const s=this.tabulator.rowManager.findRow(t[e]);if(s&&i.has(s)){this.tabulator.scrollToRow(t[e],"center",!1).catch(()=>{});break}}this._selection_updating=!1}restore_scroll(t=!0,e=!0){if(!t&&!e)return;this._pending_scroll_restores+=1;const i=s=>{requestAnimationFrame(()=>{const l=this.tabulator?.rowManager?.element;if(null==l)return void(this._pending_scroll_restores-=1);const o={behavior:"instant"};e&&(o.top=this._lastVerticalScrollbarTopPosition),t&&(o.left=this._lastHorizontalScrollbarLeftPosition),this._updating_scroll=!0,l.scrollTo(o),this._updating_scroll=!1,e&&(this._restored_scroll.top=l.scrollTop),t&&(this._restored_scroll.left=l.scrollLeft);(null==o.top||Math.abs(l.scrollTop-o.top)<1)&&(null==o.left||Math.abs(l.scrollLeft-o.left)<1)||!(s>0)?this._pending_scroll_restores-=1:i(s-1)})};i(10)}record_scroll(){if(this._updating_scroll)return;const{scrollTop:t,scrollLeft:e}=this.tabulator.rowManager.element,i=this._pending_scroll_restores>0,s=this._restored_scroll;(!i||0!==t&&t!==s.top)&&(this._lastVerticalScrollbarTopPosition=t),(!i||0!==e&&e!==s.left)&&(this._lastHorizontalScrollbarLeftPosition=e)}rowClicked(t,e){if(this._selection_updating||this._initializing||(0,d.isString)(this.model.select_mode)||!1===this.model.select_mode||this.model.configuration.dataTree||"\u25ba"===t.srcElement?.innerText)return;let i=[];const s=this.model.source.selected,l=e._row.data._index;if(t.ctrlKey||t.metaKey)i=[...s.indices];else if(t.shiftKey&&this._last_selected_row){const t=e._row.parent.getDisplayRows(),s=t.indexOf(this._last_selected_row);if(-1!==s){const l=t.indexOf(e._row),o=s>l,[n,a]=o?[l+1,s+1]:[s,l];i=t.slice(n,a).map(t=>t.data._index),o&&(i=i.reverse())}}const o=!(t.ctrlKey||t.metaKey||t.shiftKey),n=i.includes(l),a="remote"===this.model.pagination;if(!n||a?i.push(l):i.splice(i.indexOf(l),1),(0,d.isNumber)(this.model.select_mode))for(;i.length>this.model.select_mode;)i.shift();const r=this._filter_selected(i);a||(this.tabulator.deselectRow(),this.tabulator.selectRow(r)),this._last_selected_row=e._row,this._selection_updating=!0,a||(s.indices=r),this.model.trigger_event(new SelectionEvent(i,!n,o)),this._selection_updating=!1}_filter_selected(t){const e=this.model.selectable_rows;if(null==e)return[...t];const i=V(e);return t.filter(t=>i.has(t))}rowSelectionChanged(t,e,i,s){if(!(this._selection_updating||this._initializing||(0,d.isBoolean)(this.model.select_mode)||(0,d.isNumber)(this.model.select_mode)||this.model.configuration.dataTree)){if("remote"===this.model.pagination){const t=i.map(t=>t._row.data._index),e=s.map(t=>t._row.data._index);t.length>0&&(this._selection_updating=!0,this.model.trigger_event(new SelectionEvent(t,!0,!1))),e.length>0&&(this._selection_updating=!0,this.model.trigger_event(new SelectionEvent(e,!1,!1)))}else{const e=t.map(t=>t._index),i=this._filter_selected(e);this._selection_updating=e.length===i.length,this.model.source.selected.indices=i}this._selection_updating=!1}}cellEdited(t){const e=t._cell.column.field,i=this.columns.get(e),s=t.getData()._index,l=t._cell.value,o=`${e}:${s}`,n=this.model.source.get_column(e);if((Array.isArray(n)||n instanceof Float64Array||n instanceof Float32Array)&&("numeric"===i.validator||"integer"===i.validator)&&""===l)return this._pending_old_values.set(o,t._cell.oldValue),void t.setValue(NaN,!0);let a=t._cell.oldValue;this._pending_old_values.has(o)&&(a=this._pending_old_values.get(o),this._pending_old_values.delete(o)),this.model.trigger_event(new TableEditEvent(e,s,l,a)),this._tabulator_cell_updating=!0,w.comm_settings.debounce=!1;try{this.model.source.patch({[e]:[[s,l]]})}finally{w.comm_settings.debounce=!0,this._tabulator_cell_updating=!1}this.refitColumns(e),this.tabulator.scrollToRow(s,"top",!1)}}i.DataTabulatorView=DataTabulatorView,i.TableLayout=(0,c.Enum)("fit_data","fit_data_fill","fit_data_stretch","fit_data_table","fit_columns");class TabulatorColumn extends g.Model{constructor(t){super(t)}static __module__="panel.models.tabulator";static{this.define(({Any:t,Float:e,Nullable:i,Str:s})=>({field:[s],title:[i(s),null],width:[e,300],formatter:[i(t),null],editor:[i(t),null]}))}}i.TabulatorColumn=TabulatorColumn;class DataTabulator extends v.HTMLBox{constructor(t){super(t)}static __module__="panel.models.tabulator";static{this.prototype.default_view=DataTabulatorView,this.define(({Any:t,List:e,Bool:s,Nullable:l,Float:o,Ref:n,Str:a})=>({aggregators:[t,{}],buttons:[t,{}],children:[t,new Map],configuration:[t,{}],columns:[e(n(TabulatorColumn)),[]],download:[s,!1],editable:[s,!0],embed_content:[s,!1],expanded:[e(o),[]],filename:[a,"table.csv"],filters:[e(t),[]],follow:[s,!0],frozen_rows:[e(o),[]],groupby:[e(a),[]],hidden_columns:[e(a),[]],indexes:[e(a),[]],layout:[i.TableLayout,"fit_data"],max_page:[o,0],movable_columns:[s,!1],pagination:[l(a),null],page:[o,0],page_size:[l(o),null],select_mode:[t,!0],selectable_rows:[l(e(o)),null],source:[n(m.ColumnDataSource)],sorters:[e(t),[]],cell_styles:[t,{}],theme_classes:[e(a),[]],container_popup:[s,!0]}))}}i.DataTabulator=DataTabulator},
|
|
162
162
|
"99a25e6992": function _(n,l,u,t,e){function o(n,l,u){var t,e,o,a,r;function i(){var c=Date.now()-a;c<l&&c>=0?t=setTimeout(i,l-c):(t=null,u||(r=n.apply(o,e),o=e=null))}null==l&&(l=100);var c=function(){o=this,e=arguments,a=Date.now();var c=u&&!t;return t||(t=setTimeout(i,l)),c&&(r=n.apply(o,e),o=e=null),r};return c.clear=function(){t&&(clearTimeout(t),t=null)},c.flush=function(){t&&(r=n.apply(o,e),o=e=null,clearTimeout(t),t=null)},c}o.debounce=o,l.exports=o},
|
|
163
163
|
"254387d0dc": function _(e,t,r,n,a){n(),r.cell_formatter=function(e){switch(e.type){case"StringFormatter":return(t,r)=>g(e,{value:t,data:r});case"ScientificFormatter":return(t,r)=>g(e,{value:p(e,t),data:r});case"NumberFormatter":{const t=new i.NumeralTickFormatter({format:e.format,language:e.language,rounding:e.rounding});return(r,n)=>(Number.isNaN(r)||null==r||(r=t.doFormat([r],{loc:0})[0]),g(e,{value:r,data:n}))}case"DateFormatter":return(t,r)=>g(e,{value:N(e,t),data:r});case"BooleanFormatter":return t=>t?(0,l.i)({class:e.icon}).outerHTML:"";case"HTMLTemplateFormatter":{const t=f._.template(e.template);return(e,r)=>null==e?"":t({...r,value:e})}}return null};const l=e("@bokehjs/core/dom"),o=e("@bokehjs/core/util/color"),u=e("@bokehjs/core/util/string"),s=e("@bokehjs/core/util/templating"),c=e("@bokehjs/core/util/types"),i=e("@bokehjs/models/formatters/numeral_tick_formatter"),m=e("@bokehjs/models/mappers/color_mapper"),f=e("05c45c2a50");function d(e,t){return null==e?null:"value"in e?e.value:"field"in e?t[e.field]:null}function b(e,t){if(null==e)return null;if("value"in e)return null==e.value?null:(0,o.color2css)(e.value);if("field"in e){const r=t[e.field];if(e.transform instanceof m.ColorMapper){const[t,n,a,l]=e.transform.rgba_mapper.v_compute([r]);return(0,o.rgba2css)([t,n,a,l])}return(0,o.color2css)(r)}return null}function g(e,{value:t,data:r}){Number.isNaN(t)?t=e.nan_format:null==t&&(t=e.null_format);const n=(0,l.div)(null==t?"":`${t}`);switch(d(e.font_style,r)){case"italic":n.style.fontStyle="italic";break;case"bold":n.style.fontWeight="bold";break;case"bold italic":n.style.fontStyle="italic",n.style.fontWeight="bold"}const a=d(e.text_align,r);null!=a&&(n.style.textAlign=a);const o=b(e.text_color,r);null!=o&&(n.style.color=o);const u=b(e.background_color,r);return null!=u&&(n.style.backgroundColor=u),n}function p(e,t){const r=Math.abs(t)<=10**e.power_limit_low||Math.abs(t)>=10**e.power_limit_high,n=Math.max(e.precision,1);return Number.isNaN(t)?e.nan_format:null==t?e.null_format:0==t?(0,u.to_fixed)(t,1):r?t.toExponential(n):(0,u.to_fixed)(t,n)}function N(e,t){let r;if(null==t||(0,c.isNumber)(t))r=t;else if((0,c.isString)(t)){const e=Number(t);r=isNaN(e)?function(e){const t=/Z$|[+-]\d\d((:?)\d\d)?$/.test(e);return new Date(t?e:`${e}Z`).getTime()}(t):e}else r=t instanceof Date?t.valueOf():Number(t);return Number.isNaN(r)||-9223372036854776==r?e.nan_format:null==t?e.null_format:(0,s.datetime)(r,function(e){switch(e){case"ATOM":case"W3C":case"RFC-3339":case"ISO-8601":return"%Y-%m-%d";case"COOKIE":return"%a, %d %b %Y";case"RFC-850":return"%A, %d-%b-%y";case"RFC-1123":case"RFC-2822":return"%a, %e %b %Y";case"RSS":case"RFC-822":case"RFC-1036":return"%a, %e %b %y";case"TIMESTAMP":return"@";default:return e}}(e.format))}},
|
|
164
164
|
"05c45c2a50": function _(e,n,t,d,f){var i=e("355ad72c2e"),o=i.template;function r(e,n,t){return o(e,n,t)}r._=i,n.exports=r,"function"==typeof define&&define.amd?define(function(){return r}):"undefined"==typeof window&&"undefined"==typeof navigator||(window.UnderscoreTemplate=r)},
|
|
@@ -166,7 +166,7 @@ function(e){const t={};void 0!==e.detail&&Object.assign(t,{detail:JSON.parse(JSO
|
|
|
166
166
|
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
167
167
|
// Underscore may be freely distributed under the MIT license.
|
|
168
168
|
var u={},c=Array.prototype,o=Object.prototype,l=c.slice,i=o.toString,f=o.hasOwnProperty,s=c.forEach,p=Object.keys,h=Array.isArray,v=function(){},g=v.each=v.forEach=function(r,e,n){if(null!=r)if(s&&r.forEach===s)r.forEach(e,n);else if(r.length===+r.length){for(var t=0,a=r.length;t<a;t++)if(e.call(n,r[t],t,r)===u)return}else{var c=v.keys(r);for(t=0,a=c.length;t<a;t++)if(e.call(n,r[c[t]],c[t],r)===u)return}};v.keys=p||function(r){if(r!==Object(r))throw new TypeError("Invalid object");var e=[];for(var n in r)v.has(r,n)&&e.push(n);return e},v.defaults=function(r){return g(l.call(arguments,1),function(e){if(e)for(var n in e)void 0===r[n]&&(r[n]=e[n])}),r},v.isArray=h||function(r){return"[object Array]"===i.call(r)},v.has=function(r,e){if(!v.isArray(e))return null!=r&&f.call(r,e);for(var n=e.length,t=0;t<n;t++){var a=e[t];if(null==r||!f.call(r,a))return!1;r=r[a]}return!!n};var y={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}},j={escape:new RegExp("["+v.keys(y.escape).join("")+"]","g")};v.each(["escape"],function(r){v[r]=function(e){return null==e?"":(""+e).replace(j[r],function(e){return y[r][e]})}}),v.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var b=/(.)^/,w={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},A=/\\|'|\r|\n|\t|\u2028|\u2029/g;v.template=function(r,e,n){var t;n=v.defaults({},n,v.templateSettings);var a=new RegExp([(n.escape||b).source,(n.interpolate||b).source,(n.evaluate||b).source].join("|")+"|$","g"),u=0,c="__p+='";r.replace(a,function(e,n,t,a,o){return c+=r.slice(u,o).replace(A,function(r){return"\\"+w[r]}),n&&(c+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),t&&(c+="'+\n((__t=("+t+"))==null?'':__t)+\n'"),a&&(c+="';\n"+a+"\n__p+='"),u=o+e.length,e}),c+="';\n",n.variable||(c="with(obj||{}){\n"+c+"}\n"),c="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+c+"return __p;\n";try{t=new Function(n.variable||"obj","_",c)}catch(r){throw r.source=c,r}if(e)return t(e,v);var o=function(r){return t.call(this,r,v)};return o.source="function("+(n.variable||"obj")+"){\n"+c+"}",o},e.exports=v},
|
|
169
|
-
"
|
|
169
|
+
"ce212d2be6": function _(n,t,o,e,s){e(),o.transform_cds_to_records=function(n,t=!1,o=0){const e=l(n,t);if(null===e)return[];const s=[],r=n.get_length()??0;for(let n=o;n<r;n++)s.push(e(n));return s},o.transform_cds_rows_to_records=function(n,t,o=!1){const e=l(n,o);if(null===e)return[];const s=n.get_length()??0,r=[];for(const n of t)n>=0&&n<s&&r.push(e(n));return r},o.dict_to_records=function(n,t=!0){for(let o=0;o<n.index.length;o++){const e={};for(const s of n)(t||"index"!==s)&&(e[s]=n[s][o])}return[]};const r=n("@bokehjs/core/util/types");function l(n,t){const o=n.columns(),e=n.get_length();if(0===o.length||null===e)return null;const s=[];for(const t of o){const o=n.get_array(t),l=null==o[0]||null==o[0].shape?null:o[0].shape;if(null!=l&&l.length>1&&(0,r.isNumber)(l[0])){const n=l[1];s.push([t,t=>o.slice(t*n,t*n+n)])}else if(o.length!=e&&o.length%e===0){const n=o.length/e;s.push([t,t=>o.slice(t*n,t*n+n)])}else s.push([t,n=>o[n]])}return n=>{const o={};for(const[t,e]of s)o[t]=e(n);return t&&(o._index=n),o}}},
|
|
170
170
|
"b0fdc4e99b": function _(t,a,o,l,r){l(),o.panel_models_markup_HTML="bk-panel-models-markup-HTML",o.default=":host(.pn-loading){min-width:40px;min-height:40px;}.pnx-tabulator.tabulator{overflow:visible;}.tabulator-table{max-width:max-content;}.tabulator-table .tabulator-row .row-content .bk-panel-models-markup-HTML{white-space:normal;}.tabulator-table .tabulator-cell.empty{min-width:0px !important;width:0px !important;padding:0px !important;}.tabulator-header .tabulator-col.empty{min-width:0px !important;width:100% !important;border-right:unset !important;}.tabulator-header .tabulator-col.empty .tabulator-col-content{padding:0px !important;}"},
|
|
171
171
|
"7408873be7": function _(e,t,i,s,n){s();const o=e("tslib"),l=o.__importDefault(e("1156ddcec2")),a=e("@bokehjs/models/widgets/input_widget"),r=e("@bokehjs/core/dom"),d=e("@bokehjs/core/enums"),c=e("@bokehjs/core/util/types"),h=o.__importStar(e("@bokehjs/styles/widgets/inputs.css")),m=o.__importDefault(e("@bokehjs/styles/widgets/flatpickr.css"));function p(e){const t=[];for(const i of e)if((0,c.isString)(i))t.push(i);else{const[e,s]=i;t.push({from:e,to:s})}return t}class DatetimePickerView extends a.InputWidgetView{_picker;connect_signals(){super.connect_signals();const{value:e,min_date:t,max_date:i,disabled_dates:s,enabled_dates:n,inline:o,enable_time:l,enable_seconds:a,military_time:r,date_format:d,mode:c}=this.model.properties;this.on_change(e,()=>this.model.value?this._picker?.setDate(this.model.value):this._clear()),this.on_change(t,()=>this._picker?.set("minDate",this.model.min_date)),this.on_change(i,()=>this._picker?.set("maxDate",this.model.max_date)),this.on_change(s,()=>{const{disabled_dates:e}=this.model;this._picker?.set("disable",null!=e?p(e):[])}),this.on_change(n,()=>{const{enabled_dates:e}=this.model;null!=e?this._picker?.set("enable",p(e)):this._picker&&(this._picker.config._enable=void 0,this._picker.redraw(),this._picker.updateValue(!0))}),this.on_change(o,()=>this._picker?.set("inline",this.model.inline)),this.on_change(l,()=>this._picker?.set("enableTime",this.model.enable_time)),this.on_change(a,()=>this._picker?.set("enableSeconds",this.model.enable_seconds)),this.on_change(r,()=>this._picker?.set("time_24hr",this.model.military_time)),this.on_change(c,()=>this._picker?.set("mode",this.model.mode)),this.on_change(d,()=>this._picker?.set("dateFormat",this.model.date_format))}remove(){this._picker?.destroy(),super.remove()}stylesheets(){return[...super.stylesheets(),m.default]}_render_input(){return this.input_el=(0,r.input)({type:"text",class:h.input,disabled:this.model.disabled})}render(){if(null!=this._picker)return;super.render();const e={allowInput:this.model.allow_input,appendTo:this.group_el,positionElement:this.input_el,defaultDate:this.model.value,inline:this.model.inline,position:this._position.bind(this),enableTime:this.model.enable_time,enableSeconds:this.model.enable_seconds,time_24hr:this.model.military_time,dateFormat:this.model.date_format,mode:this.model.mode,onClose:(e,t,i)=>this._on_close(e,t,i)},{min_date:t,max_date:i,disabled_dates:s,enabled_dates:n}=this.model;null!=t&&(e.minDate=t),null!=i&&(e.maxDate=i),null!=s&&(e.disable=p(s)),null!=n&&(e.enable=p(n)),this._picker=(0,l.default)(this.input_el,e),this._picker.maxDateHasTime=!0,this._picker.minDateHasTime=!0}_clear(){this._picker?.clear(),this.model.value=null}_on_close(e,t,i){("range"!=this.model.mode||t.includes("to"))&&(this.model.value=t,this.change_input())}_position(e,t){const i=t??e._positionElement,s=[...e.calendarContainer.children].reduce((e,t)=>e+(0,r.bounding_box)(t).height,0),n=e.calendarContainer.offsetWidth,o=this.model.position.split(" "),l=o[0],a=o.length>1?o[1]:null,d=i.offsetTop,c=i.offsetTop+i.offsetHeight,h=i.offsetLeft,m=i.offsetLeft+i.offsetWidth,p=i.offsetWidth,u=window.innerHeight-c,f="above"===l||"below"!==l&&u<s&&d>s,g=e.config.appendTo?d+(f?-s-2:i.offsetHeight+2):window.scrollY+d+(f?-s-2:i.offsetHeight+2);if(e.calendarContainer.classList.toggle("arrowTop",!f),e.calendarContainer.classList.toggle("arrowBottom",f),e.config.inline)return;let b=window.scrollX+h,k=!1,w=!1;"center"===a?(b-=(n-p)/2,k=!0):"right"===a&&(b-=n-p,w=!0),e.calendarContainer.classList.toggle("arrowLeft",!k&&!w),e.calendarContainer.classList.toggle("arrowCenter",k),e.calendarContainer.classList.toggle("arrowRight",w);const y=window.document.body.offsetWidth-(window.scrollX+m),C=b+n>window.document.body.offsetWidth,x=y+n>window.document.body.offsetWidth;if(e.calendarContainer.classList.toggle("rightMost",C),!e.config.static)if(e.calendarContainer.style.top=`${g}px`,C)if(x){const t=this.shadow_el.styleSheets[0],i=window.document.body.offsetWidth,s=Math.max(0,i/2-n/2),o=".flatpickr-calendar.centerMost:before",l=".flatpickr-calendar.centerMost:after",a=t.cssRules.length,r=`{left:${h}px;right:auto;}`;e.calendarContainer.classList.toggle("rightMost",!1),e.calendarContainer.classList.toggle("centerMost",!0),t.insertRule(`${o},${l}${r}`,a),e.calendarContainer.style.left=`${s}px`,e.calendarContainer.style.right="auto"}else e.calendarContainer.style.left="auto",e.calendarContainer.style.right=`${y}px`;else e.calendarContainer.style.left=`${b}px`,e.calendarContainer.style.right="auto"}}i.DatetimePickerView=DatetimePickerView;class DatetimePicker extends a.InputWidget{constructor(e){super(e)}static __module__="panel.models.datetime_picker";static{this.prototype.default_view=DatetimePickerView,this.define(({Bool:e,Str:t,List:i,Tuple:s,Or:n,Nullable:o})=>{const l=i(n(t,s(t,t)));return{allow_input:[e,!1],value:[o(t),null],min_date:[o(t),null],max_date:[o(t),null],disabled_dates:[o(l),null],enabled_dates:[o(l),null],position:[d.CalendarPosition,"auto"],inline:[e,!1],enable_time:[e,!0],enable_seconds:[e,!0],military_time:[e,!0],date_format:[t,"Y-m-d H:i:S"],mode:[t,"single"]}})}}i.DatetimePicker=DatetimePicker},
|
|
172
172
|
"1156ddcec2": function _(e,t,n,a,i){a();const o=e("tslib");var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},l=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var a=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],r=0,l=o.length;r<l;r++,i++)a[i]=o[r];return a};const c=e("651d495396"),s=o.__importDefault(e("3bfa124fda")),d=e("15458073ce"),u=e("6b6749c6cf"),f=e("1bb8c967d1"),m=e("3d14787c35");e("6f45019dc1");function g(e,t){var n={config:r(r({},c.defaults),h.defaultConfig),l10n:s.default};function a(){var e;return(null===(e=n.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function i(e){return e.bind(n)}function o(){var e=n.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame(function(){if(void 0!==n.calendarContainer&&(n.calendarContainer.style.visibility="hidden",n.calendarContainer.style.display="block"),void 0!==n.daysContainer){var t=(n.days.offsetWidth+1)*e.showMonths;n.daysContainer.style.width=t+"px",n.calendarContainer.style.width=t+(void 0!==n.weekWrapper?n.weekWrapper.offsetWidth:0)+"px",n.calendarContainer.style.removeProperty("visibility"),n.calendarContainer.style.removeProperty("display")}})}function g(e){if(0===n.selectedDates.length){var t=void 0===n.config.minDate||(0,f.compareDates)(new Date,n.config.minDate)>=0?new Date:new Date(n.config.minDate.getTime()),a=(0,f.getDefaultHours)(n.config);t.setHours(a.hours,a.minutes,a.seconds,t.getMilliseconds()),n.selectedDates=[t],n.latestSelectedDateObj=t}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,a=(0,u.getEventTarget)(e),i=a;void 0!==n.amPM&&a===n.amPM&&(n.amPM.textContent=n.l10n.amPM[(0,d.int)(n.amPM.textContent===n.l10n.amPM[0])]);var o=parseFloat(i.getAttribute("min")),r=parseFloat(i.getAttribute("max")),l=parseFloat(i.getAttribute("step")),c=parseInt(i.value,10),s=e.delta||(t?38===e.which?1:-1:0),f=c+l*s;if(void 0!==i.value&&2===i.value.length){var m=i===n.hourElement,g=i===n.minuteElement;f<o?(f=r+f+(0,d.int)(!m)+((0,d.int)(m)&&(0,d.int)(!n.amPM)),g&&E(void 0,-1,n.hourElement)):f>r&&(f=i===n.hourElement?f-r-(0,d.int)(!n.amPM):o,g&&E(void 0,1,n.hourElement)),n.amPM&&m&&(1===l?f+c===23:Math.abs(f-c)>l)&&(n.amPM.textContent=n.l10n.amPM[(0,d.int)(n.amPM.textContent===n.l10n.amPM[0])]),i.value=(0,d.pad)(f)}}(e);var i=n._input.value;p(),se(),n._input.value!==i&&n._debouncedChange()}function p(){if(void 0!==n.hourElement&&void 0!==n.minuteElement){var e,t,a=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(n.minuteElement.value,10)||0)%60,o=void 0!==n.secondElement?(parseInt(n.secondElement.value,10)||0)%60:0;void 0!==n.amPM&&(e=a,t=n.amPM.textContent,a=e%12+12*(0,d.int)(t===n.l10n.amPM[1]));var r=void 0!==n.config.minTime||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&0===(0,f.compareDates)(n.latestSelectedDateObj,n.config.minDate,!0),l=void 0!==n.config.maxTime||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&0===(0,f.compareDates)(n.latestSelectedDateObj,n.config.maxDate,!0);if(void 0!==n.config.maxTime&&void 0!==n.config.minTime&&n.config.minTime>n.config.maxTime){var c=(0,f.calculateSecondsSinceMidnight)(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),s=(0,f.calculateSecondsSinceMidnight)(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),u=(0,f.calculateSecondsSinceMidnight)(a,i,o);if(u>s&&u<c){var m=(0,f.parseSeconds)(c);a=m[0],i=m[1],o=m[2]}}else{if(l){var g=void 0!==n.config.maxTime?n.config.maxTime:n.config.maxDate;(a=Math.min(a,g.getHours()))===g.getHours()&&(i=Math.min(i,g.getMinutes())),i===g.getMinutes()&&(o=Math.min(o,g.getSeconds()))}if(r){var p=void 0!==n.config.minTime?n.config.minTime:n.config.minDate;(a=Math.max(a,p.getHours()))===p.getHours()&&i<p.getMinutes()&&(i=p.getMinutes()),i===p.getMinutes()&&(o=Math.max(o,p.getSeconds()))}}D(a,i,o)}}function v(e){var t=e||n.latestSelectedDateObj;t&&t instanceof Date&&D(t.getHours(),t.getMinutes(),t.getSeconds())}function D(e,t,a){void 0!==n.latestSelectedDateObj&&n.latestSelectedDateObj.setHours(e%24,t,a||0,0),n.hourElement&&n.minuteElement&&!n.isMobile&&(n.hourElement.value=(0,d.pad)(n.config.time_24hr?e:(12+e)%12+12*(0,d.int)(e%12==0)),n.minuteElement.value=(0,d.pad)(t),void 0!==n.amPM&&(n.amPM.textContent=n.l10n.amPM[(0,d.int)(e>=12)]),void 0!==n.secondElement&&(n.secondElement.value=(0,d.pad)(a)))}function C(e){var t=(0,u.getEventTarget)(e),n=parseInt(t.value)+(e.delta||0);(n/1e3>1||"Enter"===e.key&&!/[^\d]/.test(n.toString()))&&R(n)}function b(e,t,a,i){return t instanceof Array?t.forEach(function(t){return b(e,t,a,i)}):e instanceof Array?e.forEach(function(e){return b(e,t,a,i)}):(e.addEventListener(t,a,i),void n._handlers.push({remove:function(){return e.removeEventListener(t,a,i)}}))}function M(){ie("onChange")}function y(e,t){var a=void 0!==e?n.parseDate(e):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate<n.now?n.config.maxDate:n.now),i=n.currentYear,o=n.currentMonth;try{void 0!==a&&(n.currentYear=a.getFullYear(),n.currentMonth=a.getMonth())}catch(e){e.message="Invalid date supplied: "+a,n.config.errorHandler(e)}t&&n.currentYear!==i&&(ie("onYearChange"),N()),!t||n.currentYear===i&&n.currentMonth===o||ie("onMonthChange"),n.redraw()}function w(e){var t=(0,u.getEventTarget)(e);~t.className.indexOf("arrow")&&E(e,t.classList.contains("arrowUp")?1:-1)}function E(e,t,n){var a=e&&(0,u.getEventTarget)(e),i=n||a&&a.parentNode&&a.parentNode.firstChild,o=oe("increment");o.delta=t,i&&i.dispatchEvent(o)}function x(e,t,a,i){var o=W(t,!0),r=(0,u.createElement)("span",e,t.getDate().toString());return r.dateObj=t,r.$i=i,r.setAttribute("aria-label",n.formatDate(t,n.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===(0,f.compareDates)(t,n.now)&&(n.todayDateElem=r,r.classList.add("today"),r.setAttribute("aria-current","date")),o?(r.tabIndex=-1,re(t)&&(r.classList.add("selected"),n.selectedDateElem=r,"range"===n.config.mode&&((0,u.toggleClass)(r,"startRange",n.selectedDates[0]&&0===(0,f.compareDates)(t,n.selectedDates[0],!0)),(0,u.toggleClass)(r,"endRange",n.selectedDates[1]&&0===(0,f.compareDates)(t,n.selectedDates[1],!0)),"nextMonthDay"===e&&r.classList.add("inRange")))):r.classList.add("flatpickr-disabled"),"range"===n.config.mode&&function(e){return!("range"!==n.config.mode||n.selectedDates.length<2)&&((0,f.compareDates)(e,n.selectedDates[0])>=0&&(0,f.compareDates)(e,n.selectedDates[1])<=0)}(t)&&!re(t)&&r.classList.add("inRange"),n.weekNumbers&&1===n.config.showMonths&&"prevMonthDay"!==e&&i%7==6&&n.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+n.config.getWeek(t)+"</span>"),ie("onDayCreate",r),r}function k(e){e.focus(),"range"===n.config.mode&&J(e)}function T(e){for(var t=e>0?0:n.config.showMonths-1,a=e>0?n.config.showMonths:-1,i=t;i!=a;i+=e)for(var o=n.daysContainer.children[i],r=e>0?0:o.children.length-1,l=e>0?o.children.length:-1,c=r;c!=l;c+=e){var s=o.children[c];if(-1===s.className.indexOf("hidden")&&W(s.dateObj))return s}}function I(e,t){var i=a(),o=B(i||document.body),r=void 0!==e?e:o?i:void 0!==n.selectedDateElem&&B(n.selectedDateElem)?n.selectedDateElem:void 0!==n.todayDateElem&&B(n.todayDateElem)?n.todayDateElem:T(t>0?1:-1);void 0===r?n._input.focus():o?function(e,t){for(var a=-1===e.className.indexOf("Month")?e.dateObj.getMonth():n.currentMonth,i=t>0?n.config.showMonths:-1,o=t>0?1:-1,r=a-n.currentMonth;r!=i;r+=o)for(var l=n.daysContainer.children[r],c=a-n.currentMonth===r?e.$i+t:t<0?l.children.length-1:0,s=l.children.length,d=c;d>=0&&d<s&&d!=(t>0?s:-1);d+=o){var u=l.children[d];if(-1===u.className.indexOf("hidden")&&W(u.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return k(u)}n.changeMonth(o),I(T(o),0)}(r,t):k(r)}function S(e,t){for(var a=(new Date(e,t,1).getDay()-n.l10n.firstDayOfWeek+7)%7,i=n.utils.getDaysInMonth((t-1+12)%12,e),o=n.utils.getDaysInMonth(t,e),r=window.document.createDocumentFragment(),l=n.config.showMonths>1,c=l?"prevMonthDay hidden":"prevMonthDay",s=l?"nextMonthDay hidden":"nextMonthDay",d=i+1-a,f=0;d<=i;d++,f++)r.appendChild(x("flatpickr-day "+c,new Date(e,t-1,d),0,f));for(d=1;d<=o;d++,f++)r.appendChild(x("flatpickr-day",new Date(e,t,d),0,f));for(var m=o+1;m<=42-a&&(1===n.config.showMonths||f%7!=0);m++,f++)r.appendChild(x("flatpickr-day "+s,new Date(e,t+1,m%o),0,f));var g=(0,u.createElement)("div","dayContainer");return g.appendChild(r),g}function O(){if(void 0!==n.daysContainer){(0,u.clearNode)(n.daysContainer),n.weekNumbers&&(0,u.clearNode)(n.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<n.config.showMonths;t++){var a=new Date(n.currentYear,n.currentMonth,1);a.setMonth(n.currentMonth+t),e.appendChild(S(a.getFullYear(),a.getMonth()))}n.daysContainer.appendChild(e),n.days=n.daysContainer.firstChild,"range"===n.config.mode&&1===n.selectedDates.length&&J()}}function N(){if(!(n.config.showMonths>1||"dropdown"!==n.config.monthSelectorType)){var e=function(e){return!(void 0!==n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&e<n.config.minDate.getMonth())&&!(void 0!==n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()&&e>n.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var a=(0,u.createElement)("option","flatpickr-monthDropdown-month");a.value=new Date(n.currentYear,t).getMonth().toString(),a.textContent=(0,m.monthToStr)(t,n.config.shorthandCurrentMonth,n.l10n),a.tabIndex=-1,n.currentMonth===t&&(a.selected=!0),n.monthsDropdownContainer.appendChild(a)}}}function A(){var e,t=(0,u.createElement)("div","flatpickr-month"),a=window.document.createDocumentFragment();n.config.showMonths>1||"static"===n.config.monthSelectorType?e=(0,u.createElement)("span","cur-month"):(n.monthsDropdownContainer=(0,u.createElement)("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),b(n.monthsDropdownContainer,"change",function(e){var t=(0,u.getEventTarget)(e),a=parseInt(t.value,10);n.changeMonth(a-n.currentMonth),ie("onMonthChange")}),N(),e=n.monthsDropdownContainer);var i=(0,u.createNumberInput)("cur-year",{tabindex:"-1"}),o=i.getElementsByTagName("input")[0];o.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&o.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(o.setAttribute("max",n.config.maxDate.getFullYear().toString()),o.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var r=(0,u.createElement)("div","flatpickr-current-month");return r.appendChild(e),r.appendChild(i),a.appendChild(r),t.appendChild(a),{container:t,yearElement:o,monthElement:e}}function P(){(0,u.clearNode)(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var e=n.config.showMonths;e--;){var t=A();n.yearElements.push(t.yearElement),n.monthElements.push(t.monthElement),n.monthNav.appendChild(t.container)}n.monthNav.appendChild(n.nextMonthNav)}function Y(){n.weekdayContainer?(0,u.clearNode)(n.weekdayContainer):n.weekdayContainer=(0,u.createElement)("div","flatpickr-weekdays");for(var e=n.config.showMonths;e--;){var t=(0,u.createElement)("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(t)}return F(),n.weekdayContainer}function F(){if(n.weekdayContainer){var e=n.l10n.firstDayOfWeek,t=l(n.l10n.weekdays.shorthand);e>0&&e<t.length&&(t=l(t.splice(e,t.length),t.splice(0,e)));for(var a=n.config.showMonths;a--;)n.weekdayContainer.children[a].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function j(e,t){void 0===t&&(t=!0);var a=t?e:e-n.currentMonth;a<0&&!0===n._hidePrevMonthArrow||a>0&&!0===n._hideNextMonthArrow||(n.currentMonth+=a,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,ie("onYearChange"),N()),O(),ie("onMonthChange"),le())}function L(e){return n.calendarContainer.contains(e)}function H(e){if(n.isOpen&&!n.config.inline){var t=(0,u.getEventTarget)(e),a=L(t),i=!(t===n.input||t===n.altInput||n.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(n.input)||~e.path.indexOf(n.altInput)))&&!a&&!L(e.relatedTarget),o=!n.config.ignoredFocusElements.some(function(e){return e.contains(t)});i&&o&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement&&""!==n.input.value&&void 0!==n.input.value&&g(),n.close(),n.config&&"range"===n.config.mode&&1===n.selectedDates.length&&n.clear(!1))}}function R(e){if(!(!e||n.config.minDate&&e<n.config.minDate.getFullYear()||n.config.maxDate&&e>n.config.maxDate.getFullYear())){var t=e,a=n.currentYear!==t;n.currentYear=t||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),a&&(n.redraw(),ie("onYearChange"),N())}}function W(e,t){var a;void 0===t&&(t=!0);var i=n.parseDate(e,void 0,t);if(n.config.minDate&&i&&(0,f.compareDates)(i,n.config.minDate,void 0!==t?t:!n.minDateHasTime)<0||n.config.maxDate&&i&&(0,f.compareDates)(i,n.config.maxDate,void 0!==t?t:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&0===n.config.disable.length)return!0;if(void 0===i)return!1;for(var o=!!n.config.enable,r=null!==(a=n.config.enable)&&void 0!==a?a:n.config.disable,l=0,c=void 0;l<r.length;l++){if("function"==typeof(c=r[l])&&c(i))return o;if(c instanceof Date&&void 0!==i&&c.getTime()===i.getTime())return o;if("string"==typeof c){var s=n.parseDate(c,void 0,!0);return s&&s.getTime()===i.getTime()?o:!o}if("object"==typeof c&&void 0!==i&&c.from&&c.to&&i.getTime()>=c.from.getTime()&&i.getTime()<=c.to.getTime())return o}return!o}function B(e){return void 0!==n.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&n.daysContainer.contains(e))}function K(e){var t=e.target===n._input,a=n._input.value.trimEnd()!==ce();!t||!a||e.relatedTarget&&L(e.relatedTarget)||n.setDate(n._input.value,!0,e.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function q(t){var i=(0,u.getEventTarget)(t),o=n.config.wrap?e.contains(i):i===n._input,r=n.config.allowInput,l=n.isOpen&&(!r||!o),c=n.config.inline&&o&&!r;if(13===t.keyCode&&o){if(r)return n.setDate(n._input.value,!0,i===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),i.blur();n.open()}else if(L(i)||l||c){var s=!!n.timeContainer&&n.timeContainer.contains(i);switch(t.keyCode){case 13:s?(t.preventDefault(),g(),G()):Z(t);break;case 27:t.preventDefault(),G();break;case 8:case 46:o&&!n.config.allowInput&&(t.preventDefault(),n.clear());break;case 37:case 39:if(s||o)n.hourElement&&n.hourElement.focus();else{t.preventDefault();var d=a();if(void 0!==n.daysContainer&&(!1===r||d&&B(d))){var f=39===t.keyCode?1:-1;t.ctrlKey?(t.stopPropagation(),j(f),I(T(1),0)):I(void 0,f)}}break;case 38:case 40:t.preventDefault();var m=40===t.keyCode?1:-1;n.daysContainer&&void 0!==i.$i||i===n.input||i===n.altInput?t.ctrlKey?(t.stopPropagation(),R(n.currentYear-m),I(T(1),0)):s||I(void 0,7*m):i===n.currentYearElement?R(n.currentYear-m):n.config.enableTime&&(!s&&n.hourElement&&n.hourElement.focus(),g(t),n._debouncedChange());break;case 9:if(s){var h=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter(function(e){return e}),v=h.indexOf(i);if(-1!==v){var D=h[v+(t.shiftKey?-1:1)];t.preventDefault(),(D||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(i)&&t.shiftKey&&(t.preventDefault(),n._input.focus())}}if(void 0!==n.amPM&&i===n.amPM)switch(t.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],p(),se();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],p(),se()}(o||L(i))&&ie("onKeyDown",t)}function J(e,t){if(void 0===t&&(t="flatpickr-day"),1===n.selectedDates.length&&(!e||e.classList.contains(t)&&!e.classList.contains("flatpickr-disabled"))){for(var a=e?e.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),i=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),o=Math.min(a,n.selectedDates[0].getTime()),r=Math.max(a,n.selectedDates[0].getTime()),l=!1,c=0,s=0,d=o;d<r;d+=f.duration.DAY)W(new Date(d),!0)||(l=l||d>o&&d<r,d<i&&(!c||d>c)?c=d:d>i&&(!s||d<s)&&(s=d));Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+"+n.config.showMonths+") > ."+t)).forEach(function(t){var o=t.dateObj.getTime(),r=c>0&&o<c||s>0&&o>s;if(r)return t.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(e){t.classList.remove(e)});l&&!r||(["startRange","inRange","endRange","notAllowed"].forEach(function(e){t.classList.remove(e)}),void 0!==e&&(e.classList.add(a<=n.selectedDates[0].getTime()?"startRange":"endRange"),i<a&&o===i?t.classList.add("startRange"):i>a&&o===i&&t.classList.add("endRange"),o>=c&&(0===s||o<=s)&&(0,f.isBetween)(o,i,a)&&t.classList.add("inRange")))})}}function U(){!n.isOpen||n.config.static||n.config.inline||X()}function $(e){return function(t){var a=n.config["_"+e+"Date"]=n.parseDate(t,n.config.dateFormat),i=n.config["_"+("min"===e?"max":"min")+"Date"];void 0!==a&&(n["min"===e?"minDateHasTime":"maxDateHasTime"]=a.getHours()>0||a.getMinutes()>0||a.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter(function(e){return W(e)}),n.selectedDates.length||"min"!==e||v(a),se()),n.daysContainer&&(z(),void 0!==a?n.currentYearElement[e]=a.getFullYear().toString():n.currentYearElement.removeAttribute(e),n.currentYearElement.disabled=!!i&&void 0!==a&&i.getFullYear()===a.getFullYear())}}function Q(){return n.config.wrap?e.querySelector("[data-input]"):e}function V(){"object"!=typeof n.config.locale&&void 0===h.l10ns[n.config.locale]&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=r(r({},h.l10ns.default),"object"==typeof n.config.locale?n.config.locale:"default"!==n.config.locale?h.l10ns[n.config.locale]:void 0),m.tokenRegex.D="("+n.l10n.weekdays.shorthand.join("|")+")",m.tokenRegex.l="("+n.l10n.weekdays.longhand.join("|")+")",m.tokenRegex.M="("+n.l10n.months.shorthand.join("|")+")",m.tokenRegex.F="("+n.l10n.months.longhand.join("|")+")",m.tokenRegex.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")",void 0===r(r({},t),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===h.defaultConfig.time_24hr&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=(0,f.createDateFormatter)(n),n.parseDate=(0,f.createDateParser)({config:n.config,l10n:n.l10n})}function X(e){if("function"!=typeof n.config.position){if(void 0!==n.calendarContainer){ie("onPreCalendarPosition");var t=e||n._positionElement,a=Array.prototype.reduce.call(n.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),i=n.calendarContainer.offsetWidth,o=n.config.position.split(" "),r=o[0],l=o.length>1?o[1]:null,c=t.getBoundingClientRect(),s=window.innerHeight-c.bottom,d="above"===r||"below"!==r&&s<a&&c.top>a,f=window.pageYOffset+c.top+(d?-a-2:t.offsetHeight+2);if((0,u.toggleClass)(n.calendarContainer,"arrowTop",!d),(0,u.toggleClass)(n.calendarContainer,"arrowBottom",d),!n.config.inline){var m=window.pageXOffset+c.left,g=!1,p=!1;"center"===l?(m-=(i-c.width)/2,g=!0):"right"===l&&(m-=i-c.width,p=!0),(0,u.toggleClass)(n.calendarContainer,"arrowLeft",!g&&!p),(0,u.toggleClass)(n.calendarContainer,"arrowCenter",g),(0,u.toggleClass)(n.calendarContainer,"arrowRight",p);var h=window.document.body.offsetWidth-(window.pageXOffset+c.right),v=m+i>window.document.body.offsetWidth,D=h+i>window.document.body.offsetWidth;if((0,u.toggleClass)(n.calendarContainer,"rightMost",v),!n.config.static)if(n.calendarContainer.style.top=f+"px",v)if(D){var C=function(){for(var e=null,t=0;t<document.styleSheets.length;t++){var n=document.styleSheets[t];if(n.cssRules){try{n.cssRules}catch(e){continue}e=n;break}}return null!=e?e:(a=document.createElement("style"),document.head.appendChild(a),a.sheet);var a}();if(void 0===C)return;var b=window.document.body.offsetWidth,M=Math.max(0,b/2-i/2),y=C.cssRules.length,w="{left:"+c.left+"px;right:auto;}";(0,u.toggleClass)(n.calendarContainer,"rightMost",!1),(0,u.toggleClass)(n.calendarContainer,"centerMost",!0),C.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+w,y),n.calendarContainer.style.left=M+"px",n.calendarContainer.style.right="auto"}else n.calendarContainer.style.left="auto",n.calendarContainer.style.right=h+"px";else n.calendarContainer.style.left=m+"px",n.calendarContainer.style.right="auto"}}}else n.config.position(n,e)}function z(){n.config.noCalendar||n.isMobile||(N(),le(),O())}function G(){n._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(n.close,0):n.close()}function Z(e){e.preventDefault(),e.stopPropagation();var t=(0,u.findParent)((0,u.getEventTarget)(e),function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var a=t,i=n.latestSelectedDateObj=new Date(a.dateObj.getTime()),o=(i.getMonth()<n.currentMonth||i.getMonth()>n.currentMonth+n.config.showMonths-1)&&"range"!==n.config.mode;if(n.selectedDateElem=a,"single"===n.config.mode)n.selectedDates=[i];else if("multiple"===n.config.mode){var r=re(i);r?n.selectedDates.splice(parseInt(r),1):n.selectedDates.push(i)}else"range"===n.config.mode&&(2===n.selectedDates.length&&n.clear(!1,!1),n.latestSelectedDateObj=i,n.selectedDates.push(i),0!==(0,f.compareDates)(i,n.selectedDates[0],!0)&&n.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(p(),o){var l=n.currentYear!==i.getFullYear();n.currentYear=i.getFullYear(),n.currentMonth=i.getMonth(),l&&(ie("onYearChange"),N()),ie("onMonthChange")}if(le(),O(),se(),o||"range"===n.config.mode||1!==n.config.showMonths?void 0!==n.selectedDateElem&&void 0===n.hourElement&&n.selectedDateElem&&n.selectedDateElem.focus():k(a),void 0!==n.hourElement&&void 0!==n.hourElement&&n.hourElement.focus(),n.config.closeOnSelect){var c="single"===n.config.mode&&!n.config.enableTime,s="range"===n.config.mode&&2===n.selectedDates.length&&!n.config.enableTime;(c||s)&&G()}M()}}n.parseDate=(0,f.createDateParser)({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=b,n._setHoursFromDate=v,n._positionCalendar=X,n.changeMonth=j,n.changeYear=R,n.clear=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);n.input.value="",void 0!==n.altInput&&(n.altInput.value="");void 0!==n.mobileInput&&(n.mobileInput.value="");n.selectedDates=[],n.latestSelectedDateObj=void 0,!0===t&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth());if(!0===n.config.enableTime){var a=(0,f.getDefaultHours)(n.config);D(a.hours,a.minutes,a.seconds)}n.redraw(),e&&ie("onChange")},n.close=function(){n.isOpen=!1,n.isMobile||(void 0!==n.calendarContainer&&n.calendarContainer.classList.remove("open"),void 0!==n._input&&n._input.classList.remove("active"));ie("onClose")},n.onMouseOver=J,n._createElement=u.createElement,n.createDay=x,n.destroy=function(){void 0!==n.config&&ie("onDestroy");for(var e=n._handlers.length;e--;)n._handlers[e].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var t=n.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput);n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete n[e]}catch(e){}})},n.isEnabled=W,n.jumpToDate=y,n.updateValue=se,n.open=function(e,t){void 0===t&&(t=n._positionElement);if(!0===n.isMobile){if(e){e.preventDefault();var a=(0,u.getEventTarget)(e);a&&a.blur()}return void 0!==n.mobileInput&&(n.mobileInput.focus(),n.mobileInput.click()),void ie("onOpen")}if(n._input.disabled||n.config.inline)return;var i=n.isOpen;n.isOpen=!0,i||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),ie("onOpen"),X(t));!0===n.config.enableTime&&!0===n.config.noCalendar&&(!1!==n.config.allowInput||void 0!==e&&n.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return n.hourElement.select()},50))},n.redraw=z,n.set=function(e,t){if(null!==e&&"object"==typeof e)for(var a in Object.assign(n.config,e),e)void 0!==ee[a]&&ee[a].forEach(function(e){return e()});else n.config[e]=t,void 0!==ee[e]?ee[e].forEach(function(e){return e()}):c.HOOKS.indexOf(e)>-1&&(n.config[e]=(0,d.arrayify)(t));n.redraw(),se(!0)},n.setDate=function(e,t,a){void 0===t&&(t=!1);void 0===a&&(a=n.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return n.clear(t);te(e,a),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),y(void 0,t),v(),0===n.selectedDates.length&&n.clear(!1);se(t),t&&ie("onChange")},n.toggle=function(e){if(!0===n.isOpen)return n.close();n.open(e)};var ee={locale:[V,F],showMonths:[P,o,Y],minDate:[y],maxDate:[y],positionElement:[ae],clickOpens:[function(){!0===n.config.clickOpens?(b(n._input,"focus",n.open),b(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function te(e,t){var a=[];if(e instanceof Array)a=e.map(function(e){return n.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)a=[n.parseDate(e,t)];else if("string"==typeof e)switch(n.config.mode){case"single":case"time":a=[n.parseDate(e,t)];break;case"multiple":a=e.split(n.config.conjunction).map(function(e){return n.parseDate(e,t)});break;case"range":a=e.split(n.l10n.rangeSeparator).map(function(e){return n.parseDate(e,t)})}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));n.selectedDates=n.config.allowInvalidPreload?a:a.filter(function(e){return e instanceof Date&&W(e,!1)}),"range"===n.config.mode&&n.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function ne(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?n.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:n.parseDate(e.from,void 0),to:n.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function ae(){n._positionElement=n.config.positionElement||n._input}function ie(e,t){if(void 0!==n.config){var a=n.config[e];if(void 0!==a&&a.length>0)for(var i=0;a[i]&&i<a.length;i++)a[i](n.selectedDates,n.input.value,n,t);"onChange"===e&&(n.input.dispatchEvent(oe("change")),n.input.dispatchEvent(oe("input")))}}function oe(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function re(e){for(var t=0;t<n.selectedDates.length;t++){var a=n.selectedDates[t];if(a instanceof Date&&0===(0,f.compareDates)(a,e))return""+t}return!1}function le(){n.config.noCalendar||n.isMobile||!n.monthNav||(n.yearElements.forEach(function(e,t){var a=new Date(n.currentYear,n.currentMonth,1);a.setMonth(n.currentMonth+t),n.config.showMonths>1||"static"===n.config.monthSelectorType?n.monthElements[t].textContent=(0,m.monthToStr)(a.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=a.getMonth().toString(),e.value=a.getFullYear().toString()}),n._hidePrevMonthArrow=void 0!==n.config.minDate&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYear<n.config.minDate.getFullYear()),n._hideNextMonthArrow=void 0!==n.config.maxDate&&(n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth+1>n.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()))}function ce(e){var t=e||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map(function(e){return n.formatDate(e,t)}).filter(function(e,t,a){return"range"!==n.config.mode||n.config.enableTime||a.indexOf(e)===t}).join("range"!==n.config.mode?n.config.conjunction:n.l10n.rangeSeparator)}function se(e){void 0===e&&(e=!0),void 0!==n.mobileInput&&n.mobileFormatStr&&(n.mobileInput.value=void 0!==n.latestSelectedDateObj?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=ce(n.config.dateFormat),void 0!==n.altInput&&(n.altInput.value=ce(n.config.altFormat)),!1!==e&&ie("onValueUpdate")}function de(e){var t=(0,u.getEventTarget)(e),a=n.prevMonthNav.contains(t),i=n.nextMonthNav.contains(t);a||i?j(a?-1:1):n.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):t.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}return function(){n.element=n.input=e,n.isOpen=!1,function(){var a=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],o=r(r({},JSON.parse(JSON.stringify(e.dataset||{}))),t),l={};n.config.parseDate=o.parseDate,n.config.formatDate=o.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(e){n.config._enable=ne(e)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(e){n.config._disable=ne(e)}});var s="time"===o.mode;if(!o.dateFormat&&(o.enableTime||s)){var u=h.defaultConfig.dateFormat||c.defaults.dateFormat;l.dateFormat=o.noCalendar||s?"H:i"+(o.enableSeconds?":S":""):u+" H:i"+(o.enableSeconds?":S":"")}if(o.altInput&&(o.enableTime||s)&&!o.altFormat){var f=h.defaultConfig.altFormat||c.defaults.altFormat;l.altFormat=o.noCalendar||s?"h:i"+(o.enableSeconds?":S K":" K"):f+" h:i"+(o.enableSeconds?":S":"")+" K"}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:$("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:$("max")});var m=function(e){return function(t){n.config["min"===e?"_minTime":"_maxTime"]=n.parseDate(t,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:m("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:m("max")}),"time"===o.mode&&(n.config.noCalendar=!0,n.config.enableTime=!0);Object.assign(n.config,l,o);for(var g=0;g<a.length;g++)n.config[a[g]]=!0===n.config[a[g]]||"true"===n.config[a[g]];c.HOOKS.filter(function(e){return void 0!==n.config[e]}).forEach(function(e){n.config[e]=(0,d.arrayify)(n.config[e]||[]).map(i)}),n.isMobile=!n.config.disableMobile&&!n.config.inline&&"single"===n.config.mode&&!n.config.disable.length&&!n.config.enable&&!n.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(g=0;g<n.config.plugins.length;g++){var p=n.config.plugins[g](n)||{};for(var v in p)c.HOOKS.indexOf(v)>-1?n.config[v]=(0,d.arrayify)(p[v]).map(i).concat(n.config[v]):void 0===o[v]&&(n.config[v]=p[v])}o.altInputClass||(n.config.altInputClass=Q().className+" "+n.config.altInputClass);ie("onParseConfig")}(),V(),function(){if(n.input=Q(),!n.input)return void n.config.errorHandler(new Error("Invalid input element specified"));n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=(0,u.createElement)(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling));n.config.allowInput||n._input.setAttribute("readonly","readonly");ae()}(),function(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var e=n.config.defaultDate||("INPUT"!==n.input.nodeName&&"TEXTAREA"!==n.input.nodeName||!n.input.placeholder||n.input.value!==n.input.placeholder?n.input.value:null);e&&te(e,n.config.dateFormat);n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()<n.now.getTime()?n.config.maxDate:n.now,n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth(),n.selectedDates.length>0&&(n.latestSelectedDateObj=n.selectedDates[0]);void 0!==n.config.minTime&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i"));void 0!==n.config.maxTime&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i"));n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0)}(),n.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=n.currentMonth),void 0===t&&(t=n.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:n.l10n.daysInMonth[e]}},n.isMobile||function(){var e=window.document.createDocumentFragment();if(n.calendarContainer=(0,u.createElement)("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(e.appendChild((n.monthNav=(0,u.createElement)("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=(0,u.createElement)("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=(0,u.createElement)("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,P(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(e){n.__hidePrevMonthArrow!==e&&((0,u.toggleClass)(n.prevMonthNav,"flatpickr-disabled",e),n.__hidePrevMonthArrow=e)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(e){n.__hideNextMonthArrow!==e&&((0,u.toggleClass)(n.nextMonthNav,"flatpickr-disabled",e),n.__hideNextMonthArrow=e)}}),n.currentYearElement=n.yearElements[0],le(),n.monthNav)),n.innerContainer=(0,u.createElement)("div","flatpickr-innerContainer"),n.config.weekNumbers){var t=function(){n.calendarContainer.classList.add("hasWeeks");var e=(0,u.createElement)("div","flatpickr-weekwrapper");e.appendChild((0,u.createElement)("span","flatpickr-weekday",n.l10n.weekAbbreviation));var t=(0,u.createElement)("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),a=t.weekWrapper,i=t.weekNumbers;n.innerContainer.appendChild(a),n.weekNumbers=i,n.weekWrapper=a}n.rContainer=(0,u.createElement)("div","flatpickr-rContainer"),n.rContainer.appendChild(Y()),n.daysContainer||(n.daysContainer=(0,u.createElement)("div","flatpickr-days"),n.daysContainer.tabIndex=-1),O(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),e.appendChild(n.innerContainer)}n.config.enableTime&&e.appendChild(function(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var e=(0,f.getDefaultHours)(n.config);n.timeContainer=(0,u.createElement)("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var t=(0,u.createElement)("span","flatpickr-time-separator",":"),a=(0,u.createNumberInput)("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=a.getElementsByTagName("input")[0];var i=(0,u.createNumberInput)("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});n.minuteElement=i.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=(0,d.pad)(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),n.minuteElement.value=(0,d.pad)(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():e.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(a),n.timeContainer.appendChild(t),n.timeContainer.appendChild(i),n.config.time_24hr&&n.timeContainer.classList.add("time24hr");if(n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var o=(0,u.createNumberInput)("flatpickr-second");n.secondElement=o.getElementsByTagName("input")[0],n.secondElement.value=(0,d.pad)(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():e.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild((0,u.createElement)("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(o)}n.config.time_24hr||(n.amPM=(0,u.createElement)("span","flatpickr-am-pm",n.l10n.amPM[(0,d.int)((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM));return n.timeContainer}());(0,u.toggleClass)(n.calendarContainer,"rangeMode","range"===n.config.mode),(0,u.toggleClass)(n.calendarContainer,"animate",!0===n.config.animate),(0,u.toggleClass)(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(e);var o=void 0!==n.config.appendTo&&void 0!==n.config.appendTo.nodeType;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!o&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):void 0!==n.config.appendTo&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var r=(0,u.createElement)("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(r,n.element),r.appendChild(n.element),n.altInput&&r.appendChild(n.altInput),r.appendChild(n.calendarContainer)}n.config.static||n.config.inline||(void 0!==n.config.appendTo?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}(),function(){n.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+e+"]"),function(t){return b(t,"click",n[e])})});if(n.isMobile)return void function(){var e=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=(0,u.createElement)("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=e,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr));n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d"));n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d"));n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step")));n.input.type="hidden",void 0!==n.altInput&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling)}catch(e){}b(n.mobileInput,"change",function(e){n.setDate((0,u.getEventTarget)(e).value,!1,n.mobileFormatStr),ie("onChange"),ie("onClose")})}();var e=(0,d.debounce)(U,50);n._debouncedChange=(0,d.debounce)(M,300),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&b(n.daysContainer,"mouseover",function(e){"range"===n.config.mode&&J((0,u.getEventTarget)(e))});b(n._input,"keydown",q),void 0!==n.calendarContainer&&b(n.calendarContainer,"keydown",q);n.config.inline||n.config.static||b(window,"resize",e);void 0!==window.ontouchstart?b(window.document,"touchstart",H):b(window.document,"mousedown",H);b(window.document,"focus",H,{capture:!0}),!0===n.config.clickOpens&&(b(n._input,"focus",n.open),b(n._input,"click",n.open));void 0!==n.daysContainer&&(b(n.monthNav,"click",de),b(n.monthNav,["keyup","increment"],C),b(n.daysContainer,"click",Z));if(void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement){var t=function(e){return(0,u.getEventTarget)(e).select()};b(n.timeContainer,["increment"],g),b(n.timeContainer,"blur",g,{capture:!0}),b(n.timeContainer,"click",w),b([n.hourElement,n.minuteElement],["focus","click"],t),void 0!==n.secondElement&&b(n.secondElement,"focus",function(){return n.secondElement&&n.secondElement.select()}),void 0!==n.amPM&&b(n.amPM,"click",function(e){g(e)})}n.config.allowInput&&b(n._input,"blur",K)}(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&v(n.config.noCalendar?n.latestSelectedDateObj:void 0),se(!1)),o();var a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&a&&X(),ie("onReady")}(),n}function p(e,t){for(var n=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),a=[],i=0;i<n.length;i++){var o=n[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=g(o,t||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return p(this,e)},HTMLElement.prototype.flatpickr=function(e){return p([this],e)});var h=function(e,t){return"string"==typeof e?p(window.document.querySelectorAll(e),t):e instanceof Node?p([e],t):p(e,t)};h.defaultConfig={},h.l10ns={en:r({},s.default),default:r({},s.default)},h.localize=function(e){h.l10ns.default=r(r({},h.l10ns.default),e)},h.setDefaults=function(e){h.defaultConfig=r(r({},h.defaultConfig),e)},h.parseDate=(0,f.createDateParser)({}),h.formatDate=(0,f.createDateFormatter)({}),h.compareDates=f.compareDates,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return p(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=h),n.default=h},
|
|
@@ -178,7 +178,7 @@ var u={},c=Array.prototype,o=Object.prototype,l=c.slice,i=o.toString,f=o.hasOwnP
|
|
|
178
178
|
"3d14787c35": function _(t,n,e,o,r){o();const u=t("15458073ce");var a=function(){};e.monthToStr=function(t,n,e){return e.months[n?"shorthand":"longhand"][t]},e.revFormat={D:a,F:function(t,n,e){t.setMonth(e.months.longhand.indexOf(n))},G:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},H:function(t,n){t.setHours(parseFloat(n))},J:function(t,n){t.setDate(parseFloat(n))},K:function(t,n,e){t.setHours(t.getHours()%12+12*(0,u.int)(new RegExp(e.amPM[1],"i").test(n)))},M:function(t,n,e){t.setMonth(e.months.shorthand.indexOf(n))},S:function(t,n){t.setSeconds(parseFloat(n))},U:function(t,n){return new Date(1e3*parseFloat(n))},W:function(t,n,e){var o=parseInt(n),r=new Date(t.getFullYear(),0,2+7*(o-1),0,0,0,0);return r.setDate(r.getDate()-r.getDay()+e.firstDayOfWeek),r},Y:function(t,n){t.setFullYear(parseFloat(n))},Z:function(t,n){return new Date(n)},d:function(t,n){t.setDate(parseFloat(n))},h:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},i:function(t,n){t.setMinutes(parseFloat(n))},j:function(t,n){t.setDate(parseFloat(n))},l:a,m:function(t,n){t.setMonth(parseFloat(n)-1)},n:function(t,n){t.setMonth(parseFloat(n)-1)},s:function(t,n){t.setSeconds(parseFloat(n))},u:function(t,n){return new Date(parseFloat(n))},w:a,y:function(t,n){t.setFullYear(2e3+parseFloat(n))}},e.tokenRegex={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},e.formats={Z:function(t){return t.toISOString()},D:function(t,n,o){return n.weekdays.shorthand[e.formats.w(t,n,o)]},F:function(t,n,o){return(0,e.monthToStr)(e.formats.n(t,n,o)-1,!1,n)},G:function(t,n,o){return(0,u.pad)(e.formats.h(t,n,o))},H:function(t){return(0,u.pad)(t.getHours())},J:function(t,n){return void 0!==n.ordinal?t.getDate()+n.ordinal(t.getDate()):t.getDate()},K:function(t,n){return n.amPM[(0,u.int)(t.getHours()>11)]},M:function(t,n){return(0,e.monthToStr)(t.getMonth(),!0,n)},S:function(t){return(0,u.pad)(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,n,e){return e.getWeek(t)},Y:function(t){return(0,u.pad)(t.getFullYear(),4)},d:function(t){return(0,u.pad)(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return(0,u.pad)(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,n){return n.weekdays.longhand[t.getDay()]},m:function(t){return(0,u.pad)(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}}},
|
|
179
179
|
"6f45019dc1": function _(n,t,o,r,e){"function"!=typeof Object.assign&&(Object.assign=function(n){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var r=function(t){t&&Object.keys(t).forEach(function(o){return n[o]=t[o]})},e=0,c=t;e<c.length;e++){r(c[e])}return n})},
|
|
180
180
|
"47671196f6": function _(e,t,i,r,s){r();const l=e("@bokehjs/core/util/templating"),a=e("@bokehjs/models/widgets/sliders/numerical_slider"),d=e("@bokehjs/core/util/types");class DatetimeSliderView extends a.NumericalSliderView{behaviour="tap";connected=[!0,!1];_calc_to(){const e=super._calc_to();return e.step*=1e3,e}_formatter(e,t){return(0,d.isString)(t)?l.DEFAULT_FORMATTERS.datetime(e,t,{}):t.compute(e)}}i.DatetimeSliderView=DatetimeSliderView;class DatetimeSlider extends a.NumericalSlider{constructor(e){super(e)}static __module__="panel.models.datetime_slider";static{this.prototype.default_view=DatetimeSliderView,this.override({step:60,format:"%d %b %Y %H:%M:%S"})}}i.DatetimeSlider=DatetimeSlider},
|
|
181
|
-
"609f06c18b": function _(require,module,exports,__esModule,__esExport){__esModule();const dom_1=require("@bokehjs/core/dom"),types_1=require("@bokehjs/core/util/types"),layout_dom_1=require("@bokehjs/models/layouts/layout_dom"),column_data_source_1=require("@bokehjs/models/sources/column_data_source"),debounce_1=require("99a25e6992"),data_1=require("
|
|
181
|
+
"609f06c18b": function _(require,module,exports,__esModule,__esExport){__esModule();const dom_1=require("@bokehjs/core/dom"),types_1=require("@bokehjs/core/util/types"),layout_dom_1=require("@bokehjs/models/layouts/layout_dom"),column_data_source_1=require("@bokehjs/models/sources/column_data_source"),debounce_1=require("99a25e6992"),data_1=require("ce212d2be6"),layout_1=require("00beb93e38"),lumagl_1=require("16d69e2b49"),resources_1=require("133ce95cfa"),tooltips_1=require("f8f8ea4284");function extractClasses(){const e={},t=window.deck,o=Object.keys(t).filter(e=>e.charAt(0)===e.charAt(0).toUpperCase());for(const i of o)e[i]=t[i];const i=window.CartoLibrary,r=Object.keys(i.CARTO_LAYERS).filter(e=>e.endsWith("Layer"));for(const t of r)e[t]=i.CARTO_LAYERS[t];return e}function extractFunctions(){const e=window.CartoLibrary,t=Object.keys(e.CARTO_SOURCES).filter(e=>e.toLowerCase().endsWith("source")),o={};for(const i of t)o[i]=e.CARTO_SOURCES[i];return o}class DeckGLPlotView extends layout_dom_1.LayoutDOMView{jsonConverter;deckGL;_connected;_map;_layer_map;_view_cb;_initialized=!1;async lazy_initialize(){await super.lazy_initialize();const e=await(0,resources_1.await_resources)(this.model);null!=e?(0,resources_1.render_resource_error)(this,e,layout_dom_1.LayoutDOMView.prototype.render):null==this.jsonConverter&&this._init_converter()}connect_signals(){super.connect_signals();const{data:e,mapbox_api_key:t,tooltip:o,configuration:i,layers:r,initialViewState:s,data_sources:n}=this.model.properties;this.on_change([t,o,i],()=>this.rerender_()),this.on_change([e,s],()=>this.updateDeck()),this.on_change([r],()=>this._update_layers()),this.on_change([n],()=>this._connect_sources(!0)),this._layer_map={},this._connected=[],this._connect_sources()}remove(){this.deckGL?.finalize(),super.remove()}_update_layers(){this._layer_map={},this._update_data(!0)}_connect_sources(e=!1){for(const e of this.model.data_sources)this._connected.indexOf(e)<0&&(this.on_change(e.properties.data,()=>this._update_data(!0)),this._connected.push(e));this._update_data(e)}initialize(){super.initialize();const e=this.model.throttle.view||200;this._view_cb=(0,debounce_1.debounce)(e=>this._on_viewState_event(e),e,!1),this._init_converter()}_init_converter(){if(window.deck?.JSONConverter){const{CSVLoader:e,Tiles3DLoader:t}=window.loaders;window.loaders.registerLoaders([t,e]);const o={classes:extractClasses(),functions:extractFunctions(),enumerations:{COORDINATE_SYSTEM:window.deck.COORDINATE_SYSTEM,GL:lumagl_1.GL},constants:{Tiles3DLoader:t}};this.jsonConverter=new window.deck.JSONConverter({configuration:o})}}_update_data(e=!0){let t=0;for(const e of this.model.layers){let o;if(t+=1,t-1 in this._layer_map)o=this.model.data_sources[this._layer_map[t-1]];else{if(!(0,types_1.isNumber)(e.data))continue;this._layer_map[t-1]=e.data,o=this.model.data_sources[e.data]}e.data=(0,data_1.transform_cds_to_records)(o)}e&&this.updateDeck()}_on_click_event(e){const t={coordinate:e.coordinate,lngLat:e.coordinate,index:e.index};e.layer&&(t.layer=e.layer.id),this.model.clickState=t}_on_hover_event(e){if(null==e.coordinate)return;const t={coordinate:e.coordinate,lngLat:e.coordinate,index:e.index};e.layer&&(t.layer=e.layer.id),this.model.hoverState=t}_on_viewState_event(e){const t={...e.viewState};delete t.normalize;for(const e in t)e.startsWith("transition")&&delete t[e];const o=new window.deck.WebMercatorViewport(t);t.nw=o.unproject([0,0]),t.se=o.unproject([o.width,o.height]),this.model.viewState=t}get child_models(){return[]}getData(){const e=this.model.throttle.hover||100,t=(0,debounce_1.debounce)(e=>this._on_hover_event(e),e,!1);return{...this.model.data,layers:this.model.layers,initialViewState:this.model.initialViewState,onViewStateChange:e=>this._sync_viewstate(e),onClick:e=>this._on_click_event(e),onHover:t}}_sync_viewstate(e){if(this._map){const{longitude:t,latitude:o,...i}=e.viewState;this._map.jumpTo({center:[t,o],...i})}this._view_cb(e)}rerender_(){this.rerender?this.rerender():(this.render(),this.r_after_render())}updateDeck(){if(!this.deckGL)return void this.rerender_();const e=this.getData();if(window.deck.updateDeck)window.deck.updateDeck(e,this.deckGL);else{const t=this.jsonConverter.convert(e);this.deckGL.setProps(t)}}createDeck({mapboxApiKey,container,jsonInput,tooltip}){let deckgl;try{let configuration;configuration=this.model.configuration?eval(`(${this.model.configuration})`):null,this.jsonConverter.mergeConfiguration(configuration);const props=this.jsonConverter.convert(jsonInput),getTooltip=(0,tooltips_1.makeTooltip)(tooltip,props.layers);null==props.mapStyle?props.map=null:props.mapStyle.includes("carto")?(this._map=new window.maplibregl.Map({container,style:props.mapStyle,interactive:!1}),props.controller=!0,props.map=null,delete props.mapStyle):(props.map=window.mapboxgl,props.mapboxApiAccessToken=mapboxApiKey),deckgl=new window.deck.DeckGL({...props,container,getTooltip,height:"100%",width:"100%"})}catch(e){console.error(e)}return deckgl}render(){super.render();const e=(0,dom_1.div)({class:"deckgl"});(0,layout_1.set_size)(e,this.model,!1);const t=this.model.mapbox_api_key,o=this.model.tooltip,i=this.getData();window.deck.createDeck?this.deckGL=window.deck.createDeck({mapboxApiKey:t,container:e,jsonInput:i,tooltip:o}):this.deckGL=this.createDeck({mapboxApiKey:t,container:e,jsonInput:i,tooltip:o}),this.shadow_el.appendChild(e),this._initialized=!1}resize(){null!=this.deckGL&&(this.deckGL.redraw(!0),this._map&&this._map.resize())}after_layout(){super.after_layout(),this._initialized||this.resize(),this._initialized=!0}after_resize(){super.after_resize(),this.resize()}}exports.DeckGLPlotView=DeckGLPlotView;class DeckGLPlot extends layout_dom_1.LayoutDOM{constructor(e){super(e)}static __module__="panel.models.deckgl";static{this.prototype.default_view=DeckGLPlotView,this.define(({Any:e,List:t,Str:o,Ref:i})=>({data:[e,{}],data_sources:[t(i(column_data_source_1.ColumnDataSource)),[]],clickState:[e,{}],hoverState:[e,{}],initialViewState:[e,{}],layers:[t(e),[]],mapbox_api_key:[o,""],throttle:[e,{}],tooltip:[e,!0],configuration:[o,""],viewState:[e,{}]})),this.override({height:400,width:600}),(0,resources_1.define_external_resources)(this)}initialize(){super.initialize(),(0,resources_1.load_resources)(this)}}exports.DeckGLPlot=DeckGLPlot},
|
|
182
182
|
"16d69e2b49": function _(E,R,T,A,S){
|
|
183
183
|
// SPDX-License-Identifier: MIT
|
|
184
184
|
// Copyright (c) vis.gl contributors
|
|
@@ -214,28 +214,28 @@ const r=t("@bokehjs/core/util/types");let o,s;const c={fontFamily:'"Helvetica Ne
|
|
|
214
214
|
"df5e7d36e5": function _(e,t,s,n,i){n();const h=e("@bokehjs/core/bokeh_events"),o=e("@bokehjs/core/dom"),r=e("e5a0036205"),c=e("00beb93e38"),a=e("aa07eb54cc"),l=["click","dblclick","mousedown","mousemove","mouseup","mouseover","mouseout","globalout","contextmenu"].concat(["highlight","downplay","selectchanged","legendselectchangedEvent","legendselected","legendunselected","legendselectall","legendinverseselect","legendscroll","datazoom","datarangeselected","timelineplaychanged","restore","dataviewchanged","magictypechanged","geoselectchanged","geoselected","geounselected","axisareaselected","brush","brushEnd","rushselected","globalcursortaken","rendered","finished"]);class EChartsEvent extends h.ModelEvent{type;data;query;constructor(e,t,s){super(),this.type=e,this.data=t,this.query=s}get event_values(){return{model:this.origin,type:this.type,data:this.data,query:this.query}}static{this.prototype.event_name="echarts_event"}}s.EChartsEvent=EChartsEvent;class EChartsView extends c.HTMLBoxView{container;_chart;_callbacks=[];connect_signals(){super.connect_signals();const{width:e,height:t,renderer:s,theme:n,event_config:i,js_events:h,data:o}=this.model.properties;this.on_change(o,()=>this._plot()),this.on_change([e,t],()=>this._resize()),this.on_change([n,s],()=>{this.render(),null!=this._chart&&this._chart.resize()}),this.on_change([i,h],()=>this._subscribe())}render(){if(null!=this._chart)try{window.echarts.dispose(this._chart)}catch(e){}super.render(),this.container=(0,o.div)({style:{height:"100%",width:"100%"}}),this.shadow_el.append(this.container),this._init_chart()}_init_chart(){const e={width:this.model.width,height:this.model.height,renderer:this.model.renderer};this._chart=window.echarts.init(this.container,this.model.theme,e),this._plot(),this._subscribe()}remove(){if(super.remove(),null!=this._chart)try{window.echarts.dispose(this._chart)}catch(e){}}after_layout(){super.after_layout(),null!=this._chart&&this._chart.resize()}_plot(){if(null==this._chart)return;const e=(0,a.transformJsPlaceholders)(this.model.data);this._chart.setOption(e,this.model.options)}_resize(){null!=this._chart&&this._chart.resize({width:this.model.width,height:this.model.height})}_subscribe(){if(null!=this._chart){for(const[e,t]of this._callbacks)this._chart.off(e,t);this._callbacks=[];for(const e in this.model.event_config){if(!l.includes(e)){console.warn(`Could not subscribe to unknown Echarts event: ${e}.`);continue}const t=this.model.event_config[e];for(const s of t){const t=t=>{const n={...t};n.event=(0,r.serializeEvent)(t.event?.event);const i=JSON.parse(JSON.stringify(n));this.model.trigger_event(new EChartsEvent(e,i,s))};null!=s?this._chart.on(e,s,t):this._chart.on(e,t),this._callbacks.push([e,t])}}for(const e in this.model.js_events){if(!l.includes(e)){console.warn(`Could not subscribe to unknown Echarts event: ${e}.`);continue}const t=this.model.js_events[e];for(const s of t){const t=e=>{s.callback.execute(this._chart,e)};"query"in s?this._chart.on(e,s.query,t):this._chart.on(e,t),this._callbacks.push([e,t])}}}}}s.EChartsView=EChartsView;class ECharts extends c.HTMLBox{constructor(e){super(e)}static __module__="panel.models.echarts";static{this.prototype.default_view=EChartsView,this.define(({Any:e,Str:t})=>({data:[e,{}],options:[e,{}],event_config:[e,{}],js_events:[e,{}],theme:[t,"default"],renderer:[t,"canvas"]}))}}s.ECharts=ECharts},
|
|
215
215
|
"56255f9c11": function _(e,t,i,s,l){s();var r,n=this&&this.__decorate||function(e,t,i,s){var l,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(n=(r<3?l(n):r>3?l(t,i,n):l(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const o=e("3967d78fb5"),h=e("@bokehjs/core/bokeh_events"),d=e("@bokehjs/core/build_views"),c=e("@bokehjs/models/layouts/column");let a=r=class ScrollLatestEvent extends h.ModelEvent{model;rerender;scroll_limit;constructor(e,t,i){super(),this.model=e,this.rerender=t,this.scroll_limit=i,this.origin=e,this.rerender=t,this.scroll_limit=i}get event_values(){return{model:this.origin,rerender:this.rerender,scroll_limit:this.scroll_limit}}static from_values(e){const{model:t,rerender:i,scroll_limit:s}=e;return new r(t,i,s)}};i.ScrollLatestEvent=a,i.ScrollLatestEvent=a=r=n([(0,h.server_event)("scroll_latest_event")],a);class FeedView extends o.ColumnView{_intersection_observer;_visibility_pending=!1;_visibility_listener=!1;_latest_pending=!1;_last_visible;_rendered=!1;_sync;_reference=null;_reference_view=null;_children_update=null;_latest_scroll_pending=!1;_latest_last=null;initialize(){super.initialize(),this._sync=!0;const e=this.is_scroll_container,t=e?this.el:null;this._intersection_observer=new IntersectionObserver(t=>{if(this._latest_pending||e&&"visible"===getComputedStyle(this.el).overflowY)return void(this._visibility_pending=!0);const i=[...this.model.visible_children],s=this.node_map;for(const e of t){const t=s.get(e.target)?.id;e.isIntersecting?i.includes(t)||i.push(t):i.includes(t)&&i.splice(i.indexOf(t),1)}if(this._sync&&(this.model.visible_children=i),i.length>0){const e=this.child_models.map(e=>e.id),t=i.map(t=>e.indexOf(t));this._last_visible=this.child_views[Math.min(...t)]}else this._last_visible=null},{root:t,threshold:.01})}connect_signals(){super.connect_signals(),this.model.on_event(a,async e=>{e.rerender&&(this._rendered=!1);const t=e.scroll_limit;null!=t&&this.distance_from_latest>t||(e.rerender&&(this._latest_scroll_pending=!0,this._latest_last=null),this._latest_pending=this.is_scroll_container,await this._children_update,this._scroll_to_latest_children())})}get node_map(){const e=new Map;for(const t of this.child_views)e.set(t.el,t.model);return e}async update_children(){const e=this.distance_from_latest<=1,t=this._rebuild_children();this._children_update=t;try{await t}finally{this._children_update===t&&(this._children_update=null)}if(this._latest_scroll_pending){const e=this.child_views.at(-1)?.model.id??null;this._latest_scroll_pending=e!==this._latest_last,this._latest_last=e,this._scroll_to_latest_children()}else e&&this.distance_from_latest>1&&this.scroll_to_latest()}_scroll_to_latest_children(){this._latest_pending&&this._land_latest_scroll()||(this._latest_pending=!1,this._reobserve_children(),this.scroll_to_latest())}async _rebuild_children(){const e=this._last_visible,t=this.el.scrollTop;this._reference_view=e,this._reference=e?.el.offsetTop||0,this._sync=!1;const i=await this.build_child_views(),s=new Set(i),l=i.length,r=this.child_views.length,n=i.every((e,t)=>e===this.child_views[t]),o=i.every((e,t)=>e===this.child_views[r-l+t]),h=!(n||o);if(h)for(const e of this.child_views)e.el.remove();const d=[];for(const e of this.child_views){const t=s.has(e),i=this.shadow_el;h?t?e.render_to(i):i.append(e.el):t&&(e.render(),e.r_after_render(),o?i.append(e.el):n&&d.push(e.el))}n&&this.shadow_el.prepend(...d),this.r_after_render(),this._update_children(),this.invalidate_layout(),this._sync=!0;const c=this._reference_view,a=this._reference||0;n&&null!=c&&this.child_views.includes(c)&&requestAnimationFrame(()=>{const e=c.el.offsetTop-a;0!==e&&this.el.scrollTo({top:t+e,behavior:"smooth"})})}async build_child_views(){const{created:e,removed:t}=await(0,d.build_views)(this._child_views,this.child_models,{parent:this}),i=this.model.visible_children;for(const e of t)i.includes(e.model.id)&&i.splice(i.indexOf(e.model.id),1),this._resize_observer.unobserve(e.el),this._intersection_observer.unobserve(e.el);this.model.visible_children=[...i];for(const t of e)this._resize_observer.observe(t.el,{box:"border-box"}),this._intersection_observer.observe(t.el);return e}_update_layout(){super._update_layout(),this.style.append(":host > div",{max_height:"unset"})}render(){this._rendered=!1,this._latest_pending=this.model.view_latest&&this.is_scroll_container,super.render(),this._visibility_listener||(this._visibility_listener=!0,this.shadow_el.addEventListener("load",e=>{e.target instanceof HTMLLinkElement&&(this._latest_pending?this._land_latest_scroll():this._reobserve_children())},!0))}_reobserve_children(){if(this._visibility_pending&&"visible"!==getComputedStyle(this.el).overflowY){this._visibility_pending=!1;for(const e of this.child_views)this._intersection_observer.unobserve(e.el),this._intersection_observer.observe(e.el)}}trigger_auto_scroll(){}_land_latest_scroll(){return this.el.scrollTo({top:this.el.scrollHeight,behavior:"instant"}),"visible"!==getComputedStyle(this.el).overflowY&&(this._latest_pending=!1,this._reobserve_children(),!0)}after_render(){c.ColumnView.prototype.after_render.call(this),requestAnimationFrame(()=>{this.model.view_latest&&!this._rendered?(this._land_latest_scroll(),this.scroll_to_latest()):this.model.scroll_position&&this.scroll_to_position(),this.toggle_scroll_button(),this._rendered=!0})}}i.FeedView=FeedView;class Feed extends o.Column{constructor(e){super(e)}static __module__="panel.models.feed";static{this.prototype.default_view=FeedView,this.define(({List:e,Str:t})=>({visible_children:[e(t),[]]}))}}i.Feed=Feed},
|
|
216
216
|
"a7746def5a": function _(e,t,i,l,s){l();const o=e("tslib"),n=e("@bokehjs/core/build_views"),a=e("@bokehjs/core/enums"),h=e("@bokehjs/models/widgets/input_widget"),d=e("@bokehjs/models/ui/icons/icon"),r=o.__importStar(e("@bokehjs/styles/buttons.css")),c=r,u=e("@bokehjs/core/dom");class FileDownloadView extends h.InputWidgetView{icon_view;anchor_el;button_el;label_el;_downloadable=!1;_click_listener;_prev_href="";_prev_download="";*children(){yield*super.children(),null!=this.icon_view&&(yield this.icon_view)}*controls(){yield this.anchor_el,yield this.button_el}connect_signals(){super.connect_signals();const{button_type:e,filename:t,_transfers:i,label:l}=this.model.properties;this.on_change(e,()=>this._update_button_style()),this.on_change(t,()=>this._update_download()),this.on_change(i,()=>this._handle_click()),this.on_change(l,()=>this._update_label())}remove(){null!=this.icon_view&&this.icon_view.remove(),super.remove()}async lazy_initialize(){await super.lazy_initialize();const{icon:e}=this.model;null!=e&&(this.icon_view=await(0,n.build_view)(e,{parent:this}))}_render_input(){if(this.anchor_el=document.createElement("a"),this.button_el=(0,u.button)({disabled:this.model.disabled}),null!=this.icon_view){const e=""!=this.model.label?(0,u.nbsp)():(0,u.text)("");this.anchor_el.appendChild(this.icon_view.el),this.anchor_el.appendChild(e),this.icon_view.render()}return this.label_el=document.createTextNode(this.model.label),this.anchor_el.appendChild(this.label_el),this._update_button_style(),this.model.disabled?(this.anchor_el.setAttribute("disabled",""),this._downloadable=!1):(this.anchor_el.removeAttribute("disabled"),this._prev_download&&(this.anchor_el.download=this._prev_download),this._prev_href&&(this.anchor_el.href=this._prev_href),this.anchor_el.download&&this.anchor_el.download&&(this._downloadable=!0)),this.model.embed?this._make_link_downloadable():(this._click_listener=this._increment_clicks.bind(this),this.anchor_el.addEventListener("click",this._click_listener)),this.button_el.appendChild(this.anchor_el),this.input_el=(0,u.input)(),this.button_el}render(){super.render(),this.group_el.style.display="flex",this.group_el.style.alignItems="stretch"}stylesheets(){return[...super.stylesheets(),r.default]}_increment_clicks(){this.model.clicks=this.model.clicks+1}_handle_click(){!this.model.auto&&this._downloadable||this.anchor_el.hasAttribute("disabled")||(this._make_link_downloadable(),!this.model.embed&&this.model.auto&&(this.anchor_el.removeEventListener("click",this._click_listener),this.anchor_el.click(),this.anchor_el.removeAttribute("href"),this.anchor_el.removeAttribute("download"),this.anchor_el.addEventListener("click",this._click_listener)),this._prev_href=this.anchor_el.getAttribute("href"),this._prev_download=this.anchor_el.getAttribute("download"))}_make_link_downloadable(){this._update_href(),this._update_download(),this.anchor_el.download&&this.anchor_el.href&&(this._downloadable=!0)}_update_href(){if(this.model.data){const e=function(e){const t=atob(e.split(",")[1]),i=e.split(",")[0].split(":")[1].split(";")[0],l=new ArrayBuffer(t.length),s=new Uint8Array(l);for(let e=0;e<t.length;e++)s[e]=t.charCodeAt(e);return new Blob([l],{type:i})}(this.model.data);this.anchor_el.href=URL.createObjectURL(e)}}_update_download(){this.model.filename&&(this.anchor_el.download=this.model.filename)}_update_label(){this.label_el.data=this.model.label}_update_button_style(){const e=c[`btn_${this.model.button_type}`];if(this.button_el.hasAttribute("class")){const t=this.anchor_el.classList.item(1);t&&this.button_el.classList.replace(t,e)}else this.button_el.classList.add(c.btn),this.button_el.classList.add(e)}}i.FileDownloadView=FileDownloadView;class FileDownload extends h.InputWidget{constructor(e){super(e)}static __module__="panel.models.widgets";static{this.prototype.default_view=FileDownloadView,this.define(({Bool:e,Int:t,Nullable:i,Ref:l,Str:s})=>({auto:[e,!1],clicks:[t,0],data:[i(s),null],embed:[e,!1],icon:[i(l(d.Icon)),null],label:[s,"Download"],filename:[i(s),null],button_type:[a.ButtonType,"default"],_transfers:[t,0]})),this.override({title:""})}}i.FileDownload=FileDownload},
|
|
217
|
-
"bff8eeed36": function _(e,t,i,a,o){a();const l=e("tslib"),s=e("@bokehjs/core/bokeh_events"),p=e("@bokehjs/core/dom"),n=e("@bokehjs/core/kinds"),r=e("@bokehjs/models/widgets/input_widget"),c=l.__importStar(e("@bokehjs/styles/widgets/inputs.css")),d=l.__importDefault(e("c03dd3c931")),m=e("
|
|
217
|
+
"bff8eeed36": function _(e,t,i,a,o){a();const l=e("tslib"),s=e("@bokehjs/core/bokeh_events"),p=e("@bokehjs/core/dom"),n=e("@bokehjs/core/kinds"),r=e("@bokehjs/models/widgets/input_widget"),c=l.__importStar(e("@bokehjs/styles/widgets/inputs.css")),d=l.__importDefault(e("c03dd3c931")),m=e("133ce95cfa");class UploadEvent extends s.ModelEvent{data;constructor(e){super(),this.data=e}get event_values(){return{model:this.origin,data:this.data}}static{this.prototype.event_name="upload_event"}}i.UploadEvent=UploadEvent;class DeleteEvent extends s.ModelEvent{data;constructor(e){super(),this.data=e}get event_values(){return{model:this.origin,data:this.data}}static{this.prototype.event_name="delete_event"}}i.DeleteEvent=DeleteEvent;const u={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".webp":"image/webp",".bmp":"image/bmp",".ico":"image/x-icon",".tiff":"image/tiff",".tif":"image/tiff",".avif":"image/avif",".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".mkv":"video/x-matroska",".avi":"video/x-msvideo",".wmv":"video/x-ms-wmv",".flv":"video/x-flv",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".oga":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac",".flac":"audio/flac",".txt":"text/plain",".md":"text/markdown",".rtf":"application/rtf",".pdf":"application/pdf",".json":"application/json",".xml":"text/xml",".csv":"text/csv",".tsv":"text/tab-separated-values",".yaml":"text/yaml",".yml":"text/yaml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"text/javascript",".mjs":"text/javascript",".ts":"application/typescript",".jsx":"text/jsx",".tsx":"text/tsx",".wasm":"application/wasm",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsb":"application/vnd.ms-excel.sheet.binary.macroenabled.12",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".odt":"application/vnd.oasis.opendocument.text",".ods":"application/vnd.oasis.opendocument.spreadsheet",".odp":"application/vnd.oasis.opendocument.presentation",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".tgz":"application/gzip",".bz2":"application/x-bzip2",".xz":"application/x-xz",".7z":"application/x-7z-compressed",".rar":"application/vnd.rar",".ttf":"font/ttf",".otf":"font/otf",".woff":"font/woff",".woff2":"font/woff2",".exe":"application/vnd.microsoft.portable-executable",".dll":"application/vnd.microsoft.portable-executable",".bin":"application/octet-stream",".dmg":"application/x-apple-diskimage",".pkg":"application/octet-stream",".deb":"application/vnd.debian.binary-package",".rpm":"application/x-rpm",".parquet":"application/octet-stream",".arrow":"application/octet-stream",".feather":"application/octet-stream",".orc":"application/octet-stream",".npy":"application/octet-stream",".npz":"application/octet-stream",".mat":"application/octet-stream",".h5":"application/octet-stream",".hdf5":"application/octet-stream",".zarr":"application/octet-stream",".rds":"application/octet-stream",".rda":"application/octet-stream",".rdata":"application/octet-stream",".ipynb":"application/json",".pkl":"application/octet-stream",".pickle":"application/octet-stream",".joblib":"application/octet-stream",".onnx":"application/octet-stream",".pt":"application/octet-stream",".pth":"application/octet-stream",".h5model":"application/octet-stream",".shp":"application/octet-stream",".shx":"application/octet-stream",".dbf":"application/octet-stream",".geojson":"application/geo+json",".gpkg":"application/octet-stream",".geotiff":"image/tiff",".asc":"text/plain"};class FileDropperView extends r.InputWidgetView{_file_pond=null;_transfer_in_process=null;extensionsToMimeTypes(e){return e.map(e=>{if(e.includes("/"))return e;if(e.startsWith(".")){const t=e.toLowerCase();return u[t]||e}return e})}async lazy_initialize(){await super.lazy_initialize();const e=await(0,m.await_resources)(this.model);if(null!=e)return void(0,m.render_resource_error)(this,e,r.InputWidgetView.prototype.render);const{previews:t}=this.model;t.includes("image")&&window.FilePond.registerPlugin(window.FilePondPluginImagePreview),t.includes("pdf")&&window.FilePond.registerPlugin(window.FilePondPluginPdfPreview),window.FilePond.registerPlugin(window.FilePondPluginFileValidateType),window.FilePond.registerPlugin(window.FilePondPluginFileValidateSize)}connect_signals(){super.connect_signals();const{disabled:e,layout:t,max_file_size:i,max_files:a,max_total_file_size:o,multiple:l}=this.model.properties;this.on_change([e,i,a,o,l,t],()=>{this._file_pond?.setOptions({acceptedFileTypes:this.extensionsToMimeTypes(this.model.accepted_filetypes),allowMultiple:this.model.multiple,disabled:this.model.disabled,maxFiles:this.model.max_files,maxFileSize:this.model.max_file_size,maxTotalFileSize:this.model.max_total_file_size,stylePanelLayout:this.model.layout})})}remove(){this._file_pond&&this._file_pond.destroy(),super.remove()}stylesheets(){return[...super.stylesheets(),d.default]}_render_input(){const{multiple:e,disabled:t}=this.model;return this.input_el=(0,p.input)({type:"file",class:c.input,multiple:e,disabled:t})}render(){super.render(),this._file_pond=window.FilePond.create(this.input_el,{acceptedFileTypes:this.extensionsToMimeTypes(this.model.accepted_filetypes),allowMultiple:this.model.multiple,credits:!1,disabled:this.model.disabled,maxFiles:this.model.max_files,maxFileSize:this.model.max_file_size,maxTotalFileSize:this.model.max_total_file_size,server:{process:(e,t,i,a,o,l)=>{this._process_upload(t,a,o,l)},fetch:null,revert:(e,t)=>{this.model.trigger_event(new DeleteEvent({name:e})),t()}},stylePanelLayout:this.model.layout})}async _process_upload(e,t,i,a){const o=this.model.chunk_size,l=Math.ceil((e.size+1)/o);let s=!1;return new Promise(async(i,p)=>{for(let t=0;t<l;t++){if(s)return void p(e.name);const i=t*o,n=Math.min(i+o,e.size);this.model.trigger_event(new UploadEvent({chunk:t+1,data:await e.slice(i,n).arrayBuffer(),name:e._relativePath||e.name,total_chunks:l,type:e.type})),a(!0,n,e.size)}t(e.name),i(e.name)}).catch(()=>i("Upload failed.")),{abort:()=>{s=!0}}}}i.FileDropperView=FileDropperView,i.DropperLayout=(0,n.Enum)("integrated","compact","circle");class FileDropper extends r.InputWidget{static __module__="panel.models.file_dropper";constructor(e){super(e)}static{this.prototype.default_view=FileDropperView,this.define(({Any:e,List:t,Bool:a,Int:o,Nullable:l,Str:s})=>({accepted_filetypes:[t(s),[]],chunk_size:[o,1e7],max_file_size:[l(s),null],max_files:[l(o),null],max_total_file_size:[l(s),null],mime_type:[e,{}],multiple:[a,!0],layout:[l(i.DropperLayout),null],previews:[t(s),["image","pdf"]]})),(0,m.define_external_resources)(this)}initialize(){super.initialize(),(0,m.load_resources)(this)}}i.FileDropper=FileDropper},
|
|
218
218
|
"c03dd3c931": function _(o,r,n,l,f){l(),n.input="bk-input",n.default=".bk-input.filepond--root{background-color:var(--panel-surface-color, #f1f1f1);border:unset;}.bk-input.filepond--root .filepond--drop-label{color:var(--panel-on-surface-color, #000);background-color:var(--panel-surface-color, #f1f1f1);}"},
|
|
219
219
|
"fd4c3f6bc4": function _(e,i,t,n,s){n();const o=e("@bokehjs/core/dom"),l=e("00beb93e38"),d=window.Jupyter;class IPyWidgetView extends l.HTMLBoxView{ipyview;ipychildren;manager;initialize(){let e;if(super.initialize(),null!=d&&null!=d.notebook)e=d.notebook.kernel.widget_manager;else{if(null==window.PyViz.widget_manager)return void console.warn("Panel IPyWidget model could not find a WidgetManager");e=window.PyViz.widget_manager}this.manager=e,this.ipychildren=[]}remove(){this.ipyview.remove(),super.remove()}_ipy_stylesheets(){const e=[];for(const i of document.head.children)if(i instanceof HTMLStyleElement){const t=i.textContent;if(null!=t){const i=t.replace(/:root/g,":host");e.push(new o.InlineStyleSheet(i))}}return e}stylesheets(){return[...super.stylesheets(),...this._ipy_stylesheets()]}render(){super.render();const{spec:e,state:i}=this.model.bundle;this.manager.set_state(i).then(async i=>{const t=i.find(i=>i.model_id==e.model_id);if(null==t)return;const n=await this.manager.create_view(t,{el:this.el});if(this.ipyview=n,this.ipychildren=[],n.children_views)for(const e of n.children_views.views)this.ipychildren.push(await e);this.shadow_el.appendChild(this.ipyview.el),this.ipyview.trigger("displayed",this.ipyview);for(const e of this.ipychildren)e.trigger("displayed",e);this.invalidate_layout()})}}t.IPyWidgetView=IPyWidgetView;class IPyWidget extends l.HTMLBox{constructor(e){super(e)}static __module__="panel.models.ipywidget";static{this.prototype.default_view=IPyWidgetView,this.define(({Any:e})=>({bundle:[e,{}]}))}}t.IPyWidget=IPyWidget},
|
|
220
220
|
"19285971d9": function _(e,t,s,r,i){r();const n=e("tslib"),o=e("@bokehjs/core/kinds"),d=e("@bokehjs/models/widgets/markup"),h=n.__importDefault(e("ec9d1ffc2e")),l=e("00beb93e38");class JSONView extends l.PanelMarkupView{connect_signals(){super.connect_signals();const{depth:e,hover_preview:t,text:s,theme:r}=this.model.properties;this.on_change([e,t,s,r],()=>this.rerender_())}render(){super.render();const e=this.model.text.replace(/(\r\n|\n|\r)/gm,"");let t;try{t=window.JSON.parse(e)}catch(e){return void(this.container.innerHTML=`<b>Invalid JSON:</b> ${e}`)}const s={hoverPreviewEnabled:this.model.hover_preview,theme:this.model.theme},r=null==this.model.depth?1/0:this.model.depth,i=new h.default(t,r,s).render(),n="border-radius: 5px; padding: 10px; width: 100%; height: 100%;";"dark"==this.model.theme?i.style.cssText=`background-color: rgb(30, 30, 30);${n}`:i.style.cssText=n,this.container.append(i)}}s.JSONView=JSONView,s.JSONTheme=(0,o.Enum)("dark","light");class JSON extends d.Markup{constructor(e){super(e)}static __module__="panel.models.markup";static{this.prototype.default_view=JSONView,this.define(({List:e,Bool:t,Int:r,Nullable:i,Str:n})=>({css:[e(n),[]],depth:[i(r),1],hover_preview:[t,!1],theme:[s.JSONTheme,"dark"]}))}}s.JSON=JSON},
|
|
221
221
|
"ec9d1ffc2e": function _(t,r,e,n,o){function i(t){return null===t?"null":typeof t}function s(t){return!!t&&"object"==typeof t}function a(t){if(void 0===t)return"";if(null===t)return"Object";if("object"==typeof t&&!t.constructor)return"Object";var r=/function ([^(]*)/.exec(t.constructor.toString());return r&&r.length>1?r[1]:""}function f(t,r,e){return"null"===t||"undefined"===t?t:("string"!==t&&"stringifiable"!==t||(e='"'+e.replace(/"/g,'\\"')+'"'),"function"===t?r.toString().replace(/[\r\n]/g,"").replace(/\{.*\}/,"")+"{\u2026}":e)}function m(t){var r="";return s(t)?(r=a(t),Array.isArray(t)&&(r+="["+t.length+"]")):r=f(i(t),t,t),r}function c(t){return"json-formatter-".concat(t)}function l(t,r,e){var n=document.createElement(t);return r&&n.classList.add(c(r)),void 0!==e&&(e instanceof Node?n.appendChild(e):n.appendChild(document.createTextNode(String(e)))),n}n(),function(t){if(t&&"undefined"!=typeof window){var r=document.createElement("style");r.setAttribute("media","screen"),r.innerHTML=t,document.head.appendChild(r)}}('.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-row,\n.json-formatter-row a,\n.json-formatter-row a:hover {\n color: black;\n text-decoration: none;\n}\n.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-row .json-formatter-string,\n.json-formatter-row .json-formatter-stringifiable {\n color: green;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-row .json-formatter-number {\n color: blue;\n}\n.json-formatter-row .json-formatter-boolean {\n color: red;\n}\n.json-formatter-row .json-formatter-null {\n color: #855a00;\n}\n.json-formatter-row .json-formatter-undefined {\n color: #ca0b69;\n}\n.json-formatter-row .json-formatter-function {\n color: #FF20ED;\n}\n.json-formatter-row .json-formatter-date {\n background-color: rgba(0, 0, 0, 0.05);\n}\n.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: blue;\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-bracket {\n color: blue;\n}\n.json-formatter-row .json-formatter-key {\n color: #00008b;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "\u25ba";\n}\n.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n.json-formatter-dark.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-dark.json-formatter-row,\n.json-formatter-dark.json-formatter-row a,\n.json-formatter-dark.json-formatter-row a:hover {\n color: white;\n text-decoration: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-string,\n.json-formatter-dark.json-formatter-row .json-formatter-stringifiable {\n color: #31f031;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-number {\n color: #66c2ff;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-boolean {\n color: #EC4242;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-null {\n color: #EEC97D;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-undefined {\n color: #ef8fbe;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-function {\n color: #FD48CB;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-date {\n background-color: rgba(255, 255, 255, 0.05);\n}\n.json-formatter-dark.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: #027bff;\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-bracket {\n color: #9494ff;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-key {\n color: #23a0db;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "\u25ba";\n}\n.json-formatter-dark.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-dark.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n');var h=/(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[012])\d:[0-5])\d\s*[ap]m)?$/,d=/\d{2}:\d{2}:\d{2} GMT-\d{4}/,p=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,j=/^https?:\/\//,u=window.requestAnimationFrame||function(t){return t(),0},y={hoverPreviewEnabled:!1,hoverPreviewArrayCount:100,hoverPreviewFieldCount:5,animateOpen:!0,animateClose:!0,theme:null,useToJSON:!0,sortPropertiesBy:null,maxArrayItems:100,exposePath:!1},g=function(){function t(t,r,e,n,o,i,s){void 0===r&&(r=1),void 0===e&&(e=y),void 0===i&&(i=[]),this.json=t,this.open=r,this.config=e,this.key=n,this.displayKey=o,this.path=i,this.arrayRange=s,this._isOpen=null,void 0===this.config.hoverPreviewEnabled&&(this.config.hoverPreviewEnabled=y.hoverPreviewEnabled),void 0===this.config.hoverPreviewArrayCount&&(this.config.hoverPreviewArrayCount=y.hoverPreviewArrayCount),void 0===this.config.hoverPreviewFieldCount&&(this.config.hoverPreviewFieldCount=y.hoverPreviewFieldCount),void 0===this.config.useToJSON&&(this.config.useToJSON=y.useToJSON),void 0===this.config.maxArrayItems&&(this.config.maxArrayItems=y.maxArrayItems),""===this.key&&(this.key='""'),void 0===this.displayKey&&(this.displayKey=this.key)}return Object.defineProperty(t.prototype,"isOpen",{get:function(){return null!==this._isOpen?this._isOpen:this.open>0},set:function(t){this._isOpen=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDate",{get:function(){return this.json instanceof Date||"string"===this.type&&(h.test(this.json)||p.test(this.json)||d.test(this.json))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUrl",{get:function(){return"string"===this.type&&j.test(this.json)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isArray",{get:function(){return Array.isArray(this.json)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLargeArray",{get:function(){return this.isArray&&this.json.length>this.config.maxArrayItems},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isArrayRange",{get:function(){return this.isArray&&void 0!==this.arrayRange&&2==this.arrayRange.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isObject",{get:function(){return s(this.json)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEmptyObject",{get:function(){return!this.keys.length&&!this.isArray},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.isEmptyObject||this.keys&&!this.keys.length&&this.isArray},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useToJSON",{get:function(){return this.config.useToJSON&&"stringifiable"===this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasKey",{get:function(){return void 0!==this.key},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"constructorName",{get:function(){return a(this.json)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.config.useToJSON&&this.json&&this.json.toJSON?"stringifiable":i(this.json)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keys",{get:function(){if(this.isObject){var t=Object.keys(this.json);if(this.isLargeArray){var r=Math.ceil(this.json.length/this.config.maxArrayItems);t=[];for(var e=0;e<r;e++){var n=e*this.config.maxArrayItems,o=Math.min(this.json.length-1,n+(this.config.maxArrayItems-1));t.push("".concat(n," \u2026 ").concat(o))}}return!this.isArray&&this.config.sortPropertiesBy?t.sort(this.config.sortPropertiesBy):t}return[]},enumerable:!1,configurable:!0}),t.prototype.toggleOpen=function(){this.isOpen=!this.isOpen,this.element&&(this.isOpen?this.appendChildren(this.config.animateOpen):this.removeChildren(this.config.animateClose),this.element.classList.toggle(c("open")))},t.prototype.openAtDepth=function(t){void 0===t&&(t=1),t<0||(this.open=t,this.isOpen=0!==t,this.element&&(this.removeChildren(!1),0===t?this.element.classList.remove(c("open")):(this.appendChildren(this.config.animateOpen),this.element.classList.add(c("open")))))},t.prototype.getInlinepreview=function(){var t=this;if(this.isArray)return this.json.length>this.config.hoverPreviewArrayCount?"Array[".concat(this.json.length,"]"):"[".concat(this.json.map(m).join(", "),"]");var r=this.keys,e=r.slice(0,this.config.hoverPreviewFieldCount).map(function(r){return"".concat(r,":").concat(m(t.json[r]))}),n=r.length>=this.config.hoverPreviewFieldCount?"\u2026":"";return"{".concat(e.join(", ")).concat(n,"}")},t.prototype.render=function(){this.element=l("div","row");var t=this.isObject?l("a","toggler-link"):l("span");if(this.isObject&&!this.useToJSON&&t.appendChild(l("span","toggler")),this.isArrayRange?t.appendChild(l("span","range","[".concat(this.displayKey,"]"))):this.hasKey&&(t.appendChild(l("span","key","".concat(this.displayKey,":"))),this.config.exposePath&&(this.element.dataset.path=JSON.stringify(this.path))),this.isObject&&!this.useToJSON){var r=l("span","value"),e=l("span");if(!this.isArrayRange){var n=l("span","constructor-name",this.constructorName);e.appendChild(n)}if(this.isArray&&!this.isArrayRange){var o=l("span");o.appendChild(l("span","bracket","[")),o.appendChild(l("span","number",this.json.length)),o.appendChild(l("span","bracket","]")),e.appendChild(o)}r.appendChild(e),t.appendChild(r)}else{(r=this.isUrl?l("a"):l("span")).classList.add(c(this.type)),this.isDate&&r.classList.add(c("date")),this.isUrl&&(r.classList.add(c("url")),r.setAttribute("href",this.json));var i=f(this.type,this.json,this.useToJSON?this.json.toJSON():this.json);r.appendChild(document.createTextNode(i)),t.appendChild(r)}if(this.isObject&&this.config.hoverPreviewEnabled){var s=l("span","preview-text");s.appendChild(document.createTextNode(this.getInlinepreview())),t.appendChild(s)}var a=l("div","children");return this.isObject&&a.classList.add(c("object")),this.isArray&&a.classList.add(c("array")),this.isEmpty&&a.classList.add(c("empty")),this.config&&this.config.theme&&this.element.classList.add(c(this.config.theme)),this.isOpen&&this.element.classList.add(c("open")),this.element.appendChild(t),this.element.appendChild(a),this.isObject&&this.isOpen&&this.appendChildren(),this.isObject&&!this.useToJSON&&t.addEventListener("click",this.toggleOpen.bind(this)),this.element},t.prototype.appendChildren=function(r){var e=this;void 0===r&&(r=!1);var n=this.element.querySelector("div.".concat(c("children")));if(n&&!this.isEmpty){var o=function(r,o){var i=e.isLargeArray?[o*e.config.maxArrayItems,Math.min(e.json.length-1,o*e.config.maxArrayItems+(e.config.maxArrayItems-1))]:void 0,s=e.isArrayRange?(e.arrayRange[0]+o).toString():r,a=new t(i?e.json.slice(i[0],i[1]+1):e.json[r],e.open-1,e.config,r,s,i?e.path:e.path.concat(s),i);n.appendChild(a.render())};if(r){var i=0,s=function(){var t=e.keys[i];o(t,i),(i+=1)<e.keys.length&&(i>10?s():u(s))};u(s)}else this.keys.forEach(function(t,r){return o(t,r)})}},t.prototype.removeChildren=function(t){void 0===t&&(t=!1);var r=this.element.querySelector("div.".concat(c("children")));if(t){var e=0,n=function(){r&&r.children.length&&(r.removeChild(r.children[0]),(e+=1)>10?n():u(n))};u(n)}else r&&(r.innerHTML="")},t}();e.default=g},
|
|
222
222
|
"372d3e3a52": function _(e,t,s,o,i){o();const n=e("tslib"),d=e("@bokehjs/core/dom"),h=e("@bokehjs/core/bokeh_events"),a=e("00beb93e38"),r=n.__importDefault(e("317a12d360"));class JSONEditEvent extends h.ModelEvent{data;constructor(e){super(),this.data=e}get event_values(){return{model:this.origin,data:this.data}}static{this.prototype.event_name="json_edit"}}s.JSONEditEvent=JSONEditEvent;class JSONEditorView extends a.HTMLBoxView{editor;_menu_context;connect_signals(){super.connect_signals();const{data:e,disabled:t,templates:s,menu:o,mode:i,search:n,schema:d}=this.model.properties;this.on_change([e],()=>this.editor.update(this.model.data)),this.on_change([s],()=>{this.editor.options.templates=this.model.templates}),this.on_change([o],()=>{this.editor.options.mainMenuBar=this.model.menu}),this.on_change([n],()=>{this.editor.options.search=this.model.search}),this.on_change([d],()=>{this.editor.options.schema=this.model.schema}),this.on_change([t,i],()=>{const e=this.model.disabled?"view":this.model.mode;this.editor.setMode(e)})}stylesheets(){const e=super.stylesheets();e.push(r.default);for(const t of this.model.css)e.push(new d.ImportedStyleSheet(t));return e}remove(){this.editor?.destroy(),super.remove()}render(){super.render();const e=this.model.disabled?"view":this.model.mode;this.editor=new window.JSONEditor(this.shadow_el,{mainMenuBar:this.model.menu,mode:e,onChangeJSON:e=>{this.model.trigger_event(new JSONEditEvent(e))},onChangeText:e=>{try{this.model.trigger_event(new JSONEditEvent(JSON.parse(e)))}catch(e){console.warn(e)}},onSelectionChange:(e,t)=>{this.model.selection=[e,t]},search:this.model.search,schema:this.model.schema,templates:this.model.templates}),this.editor.set(this.model.data)}}s.JSONEditorView=JSONEditorView;class JSONEditor extends a.HTMLBox{constructor(e){super(e)}static __module__="panel.models.jsoneditor";static{this.prototype.default_view=JSONEditorView,this.define(({Any:e,List:t,Bool:s,Str:o})=>({css:[t(o),[]],data:[e,{}],mode:[o,"tree"],menu:[s,!0],search:[s,!0],selection:[t(e),[]],schema:[e,null],templates:[t(e),[]]}))}}s.JSONEditor=JSONEditor},
|
|
223
223
|
"317a12d360": function _(o,r,e,d,a){d(),e.default='div.jsoneditor,div.jsoneditor-menu{border-color:var(--panel-border-color, #3883fa);}div.jsoneditor-menu{background-color:var(--panel-primary-color, #3883fa);color:var(--panel-on-primary-color, #ffffff);}div.jsoneditor-tree,div.jsoneditor textarea.jsoneditor-text{background-color:var(--panel-background-color, #ffffff);color:var(--panel-on-background-color, #1a1a1a);}div.jsoneditor-field,div.jsoneditor-value{color:var(--panel-on-background-color, #1a1a1a);}div.jsoneditor-value.jsoneditor-string{color:var(--success-text-color, #006000);}div.jsoneditor-value.jsoneditor-number{color:var(--danger-text-color, #ee422e);}div.jsoneditor-value.jsoneditor-boolean{color:var(--warning-text-color, #ff8c00);}div.jsoneditor-value.jsoneditor-null{color:var(--info-text-color, #004ed0);}div.jsoneditor-value.jsoneditor-url,a.jsoneditor-value.jsoneditor-url{color:var(--success-text-color, #006000);}div.jsoneditor-value.jsoneditor-invalid{color:var(--panel-on-background-color, #1a1a1a);}div.jsoneditor-readonly{color:var(--secondary-text-color, #acacac);}div.jsoneditor td.jsoneditor-separator{color:var(--secondary-text-color, #808080);}div.jsoneditor-field.jsoneditor-empty::after,div.jsoneditor-value.jsoneditor-empty::after{color:var(--panel-border-color, #d3d3d3);}div.jsoneditor-empty{border-color:var(--panel-border-color, #d3d3d3);}table.jsoneditor-search div.jsoneditor-frame{background:var(--panel-surface-color, #f3f3f3);}table.jsoneditor-search input{color:var(--panel-on-surface-color, #1a1d21);}tr.jsoneditor-highlight,tr.jsoneditor-selected{background-color:var(--panel-surface-color, #f3f3f3);}div.jsoneditor-field[contenteditable="true"]:focus,div.jsoneditor-field[contenteditable="true"]:hover,div.jsoneditor-value[contenteditable="true"]:focus,div.jsoneditor-value[contenteditable="true"]:hover,div.jsoneditor-field.jsoneditor-highlight,div.jsoneditor-value.jsoneditor-highlight{background-color:var(--panel-surface-color, #f3f3f3);border-color:var(--panel-border-color, #e0e0e0);}div.jsoneditor-field.jsoneditor-highlight-active,div.jsoneditor-field.jsoneditor-highlight-active:focus,div.jsoneditor-field.jsoneditor-highlight-active:hover,div.jsoneditor-value.jsoneditor-highlight-active,div.jsoneditor-value.jsoneditor-highlight-active:focus,div.jsoneditor-value.jsoneditor-highlight-active:hover{background-color:var(--panel-surface-color, #f3f3f3);border-color:var(--panel-border-color, #e0e0e0);}div.jsoneditor-tree button:focus{background-color:var(--panel-surface-color, #f3f3f3);}div.jsoneditor-navigation-bar{background-color:var(--panel-surface-color, #f3f3f3);color:var(--panel-on-surface-color, #1a1d21);}div.jsoneditor-treepath.show-all{background-color:var(--panel-surface-color, #f3f3f3);}div.jsoneditor-treepath .jsoneditor-treepath-show-all-btn{background-color:var(--panel-surface-color, #f3f3f3);}div.jsoneditor-statusbar{background-color:var(--panel-surface-color, #f3f3f3);color:var(--panel-on-surface-color, #1a1d21);}div.jsoneditor-contextmenu .jsoneditor-menu{background:var(--panel-background-color, #ffffff);border-color:var(--panel-border-color, #d3d3d3);}div.jsoneditor-contextmenu .jsoneditor-separator{border-top-color:var(--panel-border-color, #e5e5e5);}div.jsoneditor-contextmenu .jsoneditor-menu li button{color:var(--panel-on-background-color, #1a1a1a);background-color:var(--panel-background-color, #ffffff);}div.jsoneditor-contextmenu .jsoneditor-menu li button:hover,div.jsoneditor-contextmenu .jsoneditor-menu li button:focus{color:var(--panel-on-surface-color, #1a1d21);background-color:var(--panel-surface-color, #f3f3f3);}div.jsoneditor-contextmenu .jsoneditor-menu li button.jsoneditor-selected,div.jsoneditor-contextmenu .jsoneditor-menu li button.jsoneditor-selected:hover,div.jsoneditor-contextmenu .jsoneditor-menu li button.jsoneditor-selected:focus{color:var(--panel-on-primary-color, #ffffff);background-color:var(--panel-primary-color, #3883fa);}div.jsoneditor-popover{background-color:var(--panel-surface-color, #4c4c4c);color:var(--panel-on-surface-color, #ffffff);}div.jsoneditor-popover.jsoneditor-above::before{border-top-color:var(--panel-surface-color, #4c4c4c);}div.jsoneditor-popover.jsoneditor-below::before{border-bottom-color:var(--panel-surface-color, #4c4c4c);}div.jsoneditor-popover.jsoneditor-left::before{border-left-color:var(--panel-surface-color, #4c4c4c);}div.jsoneditor-popover.jsoneditor-right::before{border-right-color:var(--panel-surface-color, #4c4c4c);}div.jsoneditor .jsoneditor-text-errors{border-top-color:var(--panel-border-color, #ffc700);}div.jsoneditor .jsoneditor-text-errors tr{background-color:var(--panel-surface-color, #ffffab);}div.jsoneditor .jsoneditor-additional-errors{color:var(--secondary-text-color, #808080);background-color:var(--panel-surface-color, #ebebeb);}div.jsoneditor .autocomplete.dropdown{background:var(--panel-background-color, #ffffff);border-color:var(--panel-border-color, #d3d3d3);}div.jsoneditor .autocomplete.dropdown .item{color:var(--panel-on-background-color, #1a1a1a);}div.jsoneditor .autocomplete.dropdown .item.hover{background-color:var(--panel-surface-color, #ebebeb);}div.jsoneditor .autocomplete.hint{color:var(--secondary-text-color, #a1a1a1);}div.jsoneditor-tree div.jsoneditor-show-more{background-color:var(--panel-surface-color, #e5e5e5);}div.jsoneditor-tree div.jsoneditor-show-more a{color:var(--secondary-text-color, #808080);}div.jsoneditor-modal{color:var(--panel-on-background-color, #4d4d4d);}div.jsoneditor-modal .pico-modal-header{background:var(--panel-primary-color, #3883fa);color:var(--panel-on-primary-color, #ffffff);}div.jsoneditor-modal .pico-close{color:var(--panel-on-primary-color, #ffffff);}div.jsoneditor-modal select,div.jsoneditor-modal textarea,div.jsoneditor-modal input,div.jsoneditor-modal input[type="text"],div.jsoneditor-modal input[type="text"]:focus,div.jsoneditor-modal #query{background:var(--panel-background-color, #ffffff);border:1px solid var(--panel-border-color, #d3d3d3);color:var(--panel-on-background-color, #4d4d4d);}div.jsoneditor-modal input[disabled]{background:var(--panel-surface-color, #d3d3d3);color:var(--secondary-text-color, #808080);}div.jsoneditor-modal .jsoneditor-transform-preview{background:var(--panel-surface-color, #f5f5f5);color:var(--panel-on-surface-color, #1a1d21);}div.jsoneditor-modal table td,div.jsoneditor-modal table th{color:var(--panel-on-background-color, #4d4d4d);}div.jsoneditor-modal input[type="button"],div.jsoneditor-modal input[type="submit"]{background:var(--panel-surface-color, #f5f5f5);color:var(--panel-on-surface-color, #1a1d21);}'},
|
|
224
|
-
"052b7b0298": function _(e,t,i,s,n){s();const
|
|
225
|
-
"
|
|
224
|
+
"052b7b0298": function _(e,t,i,s,n){s();const a=e("@bokehjs/models/widgets/markup"),r=e("00beb93e38"),l=e("133ce95cfa");class KaTeXView extends r.PanelMarkupView{connect_signals(){super.connect_signals();const{text:e}=this.model.properties;this.on_change(e,()=>this.render())}render(){super.render(),this.container.innerHTML=this.model.text,window.renderMathInElement&&window.renderMathInElement(this.shadow_el,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1}]})}}i.KaTeXView=KaTeXView;class KaTeX extends a.Markup{constructor(e){super(e)}static __module__="panel.models.katex";static{this.prototype.default_view=KaTeXView,(0,l.define_external_resources)(this)}initialize(){super.initialize(),(0,l.load_resources)(this)}}i.KaTeX=KaTeX},
|
|
225
|
+
"cc871e1a06": function _(e,i,o,t,h){t();const n=e("@bokehjs/core/view"),s=e("@bokehjs/model");class LocationView extends n.View{_hash_listener;_idle_ready=!1;_pending_url=null;_idle_connected=!1;initialize(){super.initialize(),this.model.pathname=window.location.pathname,this.model.search=window.location.search,this.model.hash=window.location.hash,this.model.href=window.location.href,this.model.hostname=window.location.hostname,this.model.protocol=window.location.protocol,this.model.port=window.location.port,this._hash_listener=()=>{this.model.hash=window.location.hash},window.addEventListener("hashchange",this._hash_listener),this._has_finished=!0,this.notify_finished()}connect_signals(){super.connect_signals();const{pathname:e,search:i,hash:o,reload:t}=this.model.properties;this.on_change(e,()=>this.update("pathname")),this.on_change(i,()=>this.update("search")),this.on_change(o,()=>this.update("hash")),this.on_change(t,()=>this.update("reload"))}remove(){super.remove(),window.removeEventListener("hashchange",this._hash_listener)}_ensure_idle_gate(){if(this._idle_connected)return;this._idle_connected=!0;const e=this.model.document;e.is_idle?this._idle_ready=!0:e.idle.connect(()=>{if(this._idle_ready=!0,null!=this._pending_url){const e=this._pending_url;this._pending_url=null,window.history.pushState({},"",e),this.model.href=window.location.href}})}_set_url_gated(e){this._ensure_idle_gate(),this._idle_ready?(window.history.pushState({},"",e),this.model.href=window.location.href):this._pending_url=e}update(e){const i=`${this.model.pathname}${this.model.search}${this.model.hash}`;if("reload"===e){if(!this.model.reload)return;return window.history.pushState({},"",i),this.model.href=window.location.href,void window.location.reload()}this.model.reload?"hash"!==e?window.location.href=i:window.location.hash=this.model.hash:this._set_url_gated(i)}}o.LocationView=LocationView;class Location extends s.Model{static __module__="panel.models.location";constructor(e){super(e)}static{this.prototype.default_view=LocationView,this.define(({Bool:e,Str:i})=>({href:[i,""],hostname:[i,""],pathname:[i,""],protocol:[i,""],port:[i,""],search:[i,""],hash:[i,""],reload:[e,!1]}))}}o.Location=Location},
|
|
226
226
|
"07688254ed": function _(e,t,s,a,n){a();const i=e("@bokehjs/models/widgets/markup"),r=e("00beb93e38");class MathJaxView extends r.PanelMarkupView{connect_signals(){super.connect_signals();const{text:e}=this.model.properties;this.on_change(e,()=>this.rerender_())}render(){super.render();const e=this.model.text,t=this.provider.MathJax.find_tex(e),s=[];let a=0;for(const n of t)s.push(e.slice(a,n.start.n)),s.push(this.provider.MathJax.tex2svg(n.math,{display:n.display}).outerHTML),a=n.end.n;a<e.length&&s.push(e.slice(a)),this.container.innerHTML=s.join("")}}s.MathJaxView=MathJaxView;class MathJax extends i.Markup{constructor(e){super(e)}static __module__="panel.models.mathjax";static{this.prototype.default_view=MathJaxView}}s.MathJax=MathJax},
|
|
227
|
-
"37ed29726e": function _(e,t,o,s,i){s();const l=e("tslib");var n,a=this&&this.__decorate||function(e,t,o,s){var i,l=arguments.length,n=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,s);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(n=(l<3?i(n):l>3?i(t,o,n):i(t,o))||n);return l>3&&n&&Object.defineProperty(t,o,n),n};const d=e("@bokehjs/models/layouts/column"),r=e("@bokehjs/core/dom"),h=e("@bokehjs/core/bokeh_events"),c=e("@bokehjs/models/ui/ui_element"),u=e("@bokehjs/core/util/types"),p=l.__importDefault(e("be4b4352c6")),m=e("
|
|
227
|
+
"37ed29726e": function _(e,t,o,s,i){s();const l=e("tslib");var n,a=this&&this.__decorate||function(e,t,o,s){var i,l=arguments.length,n=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,s);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(n=(l<3?i(n):l>3?i(t,o,n):i(t,o))||n);return l>3&&n&&Object.defineProperty(t,o,n),n};const d=e("@bokehjs/models/layouts/column"),r=e("@bokehjs/core/dom"),h=e("@bokehjs/core/bokeh_events"),c=e("@bokehjs/models/ui/ui_element"),u=e("@bokehjs/core/util/types"),p=l.__importDefault(e("be4b4352c6")),m=e("133ce95cfa");let b=n=class ModalDialogEvent extends h.ModelEvent{model;open;constructor(e,t){super(),this.model=e,this.open=t,this.open=t,this.origin=e}get event_values(){return{open:this.open,origin:this.origin}}static from_values(e){const{open:t,model:o}=e;return new n(o,t)}};o.ModalDialogEvent=b,o.ModalDialogEvent=b=n=a([(0,h.server_event)("modal-dialog-event")],b);class ModalView extends d.ColumnView{modal;close_button;content;async lazy_initialize(){await super.lazy_initialize();const e=await(0,m.await_resources)(this.model);null!=e&&(0,m.render_resource_error)(this,e,c.UIElementView.prototype.render)}connect_signals(){super.connect_signals();const{show_close_button:e}=this.model.properties;this.on_change([e],this.update_close_button),this.model.on_event(b,e=>{e.open?this.modal.show():this.modal.hide()})}render(){c.UIElementView.prototype.render.call(this),this.class_list.add(...this.css_classes()),this.create_modal()}stylesheets(){return[...super.stylesheets(),p.default]}get self_target(){return this.content??this.shadow_el}create_modal(){const e=(0,r.div)({id:"pnx_dialog",class:"dialog-container bk-root",style:{display:"none"}}),t=(0,r.div)({class:"dialog-overlay"});this.model.background_close&&t.setAttribute("data-a11y-dialog-hide","");const{height:o,width:s,min_height:i,min_width:l,max_height:n,max_width:a}=this.model,d=(0,r.div)({id:"pnx_dialog_content",class:"dialog-content",role:"document",style:{height:(0,u.isNumber)(o)?`${o}px`:o,width:(0,u.isNumber)(s)?`${s}px`:s,min_height:(0,u.isNumber)(i)?`${i}px`:i,min_width:(0,u.isNumber)(l)?`${l}px`:l,max_height:(0,u.isNumber)(n)?`${n}px`:n,max_width:(0,u.isNumber)(a)?`${a}px`:a,overflow:"auto"}});this.content=d;for(const e of this.child_views){const t=e.rendering_target()??this.content;e.render_to(t)}this.close_button=(0,r.button)({id:"pnx_dialog_close","data-a11y-dialog-hide":"",class:"pnx-dialog-close",ariaLabel:"Close this dialog window"}),this.close_button.innerHTML="✕",e.append(t),e.append(d),d.append(this.close_button),this.shadow_el.append(e);let h=!1;this.modal=new A11yDialog(e),this.update_close_button(),this.modal.on("show",()=>{this.model.open=!0,e.style.display="",h||(requestAnimationFrame(()=>{this.invalidate_layout(),e.focus()}),h=!0)}),this.modal.on("hide",()=>{this.model.open=!1,e.style.display="none"}),this.model.open&&this.modal.show()}update_close_button(){this.model.show_close_button?this.close_button.style.display="block":this.close_button.style.display="none"}}o.ModalView=ModalView;class Modal extends d.Column{constructor(e){super(e)}static __module__="panel.models.modal";static{this.prototype.default_view=ModalView,this.define(({Bool:e})=>({open:[e,!1],show_close_button:[e,!0],background_close:[e,!0]})),(0,m.define_external_resources)(this)}initialize(){super.initialize(),(0,m.load_resources)(this)}}o.Modal=Modal},
|
|
228
228
|
"be4b4352c6": function _(o,a,e,i,d){i(),e.panel_models_modal_Modal="bk-panel-models-modal-Modal",e.default=":host(.bk-panel-models-modal-Modal){width:0;height:0;}.dialog-container,.dialog-overlay{position:fixed;top:0;right:0;bottom:0;left:0;}.dialog-container{z-index:100002;display:flex;}.dialog-overlay{z-index:100001;background-color:rgba(43, 46, 56, 0.9);}.dialog-content{margin:auto;z-index:100002;position:relative;background-color:white;border-radius:2px;padding:10px;padding-bottom:20px;}@keyframes fade-in{from{opacity:0;}}@keyframes slide-up{from{transform:translateY(10%);}}.dialog-overlay{animation:fade-in 200ms both;}.dialog-content{animation:fade-in 400ms 200ms both, slide-up 400ms 200ms both;}@media (prefers-reduced-motion: reduce){.dialog-overlay,.dialog-content{animation:none;}}.pnx-dialog-close{position:absolute;top:0;right:0;border:0;padding:0;background-color:transparent;font-size:1.5em;width:1.5em;height:1.5em;text-align:center;cursor:pointer;transition:0.15s;border-radius:50%;z-index:100003;}.pnx-dialog-close:hover{background-color:rgba(50, 50, 0, 0.15);}.lm-Widget.p-Widget.lm-TabBar.p-TabBar.lm-DockPanel-tabBar.jp-Activity{z-index:-1;}"},
|
|
229
|
-
"87a65d7fb5": function _(e,t,s,n,i){n();const o=e("@bokehjs/models/widgets/markup"),a=e("00beb93e38"),r=e("
|
|
229
|
+
"87a65d7fb5": function _(e,t,s,n,i){n();const o=e("@bokehjs/models/widgets/markup"),a=e("00beb93e38"),r=e("e40e09e4dd");class PDFView extends a.PanelMarkupView{connect_signals(){super.connect_signals();const{text:e,width:t,height:s,embed:n,start_page:i}=this.model.properties;this.on_change([e,t,s,n,i],()=>{this.update()})}render(){super.render(),this.update()}update(){if(this.model.embed){const e=this.convert_base64_to_blob(),t=URL.createObjectURL(e);this.container.innerHTML=`<embed src="${t}#page=${this.model.start_page}" type="application/pdf" width="100%" height="100%"></embed>`}else{const e=(0,r.html_decode)(this.model.text);this.container.innerHTML=e||""}}convert_base64_to_blob(){const e=atob(this.model.text),t=[];for(let s=0;s<e.length;s+=512){const n=e.slice(s,s+512),i=new Uint8Array(n.length);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);t.push(i)}return new Blob(t,{type:"application/pdf"})}}s.PDFView=PDFView;class PDF extends o.Markup{constructor(e){super(e)}static __module__="panel.models.markup";static{this.prototype.default_view=PDFView,this.define(({Int:e,Bool:t})=>({embed:[t,!1],start_page:[e,1]}))}}s.PDF=PDF},
|
|
230
230
|
"7a00e4d590": function _(e,t,s,i,n){i();const r=e("tslib"),l=e("@bokehjs/core/bokeh_events"),o=e("@bokehjs/core/dom"),c=e("@bokehjs/models/sources/column_data_source"),h=e("00beb93e38"),a=r.__importDefault(e("2e2913ea54")),p={"pro-dark":"Pro Dark",pro:"Pro Light",vaporwave:"Vaporwave",solarized:"Solarized","solarized-dark":"Solarized Dark",monokai:"Monokai"},d={datagrid:"Datagrid",d3_x_bar:"X Bar",d3_y_bar:"Y Bar",d3_xy_line:"X/Y Line",d3_y_line:"Y Line",d3_y_area:"Y Area",d3_y_scatter:"Y Scatter",d3_xy_scatter:"X/Y Scatter",d3_treemap:"Treemap",d3_candlestick:"Candlestick",d3_sunburst:"Sunburst",d3_heatmap:"Heatmap",d3_ohlc:"OHLC"};function m(e){const t={};return Object.keys(e).forEach(s=>{t[e[s]]=s}),t}const g=m(d),u=m(p);class PerspectiveClickEvent extends l.ModelEvent{config;column_names;row;constructor(e,t,s){super(),this.config=e,this.column_names=t,this.row=s}get event_values(){return{model:this.origin,config:this.config,column_names:this.column_names,row:this.row}}static{this.prototype.event_name="perspective-click"}}s.PerspectiveClickEvent=PerspectiveClickEvent;class PerspectiveView extends h.HTMLBoxView{perspective_element;table;worker;_updating=!1;_config_listener=null;_current_config=null;_current_plugin=null;_loaded=!1;_plugin_configs=new Map;connect_signals(){super.connect_signals(),this.connect(this.model.source.properties.data.change,()=>this.setData()),this.connect(this.model.source.streaming,()=>this.stream()),this.connect(this.model.source.patching,()=>this.patch());const{schema:e,columns:t,expressions:s,split_by:i,group_by:n,aggregates:r,filters:l,sort:o,plugin:c,selectable:h,editable:a,theme:m,title:g,settings:u}=this.model.properties,v=e=>()=>{this._updating||e()};this.on_change(e,()=>{this.worker.table(this.model.schema).then(e=>{this.table=e,this.table.update(this.data),this.perspective_element.load(this.table)})}),this.on_change(t,v(()=>{this.perspective_element.restore({columns:this.model.columns})})),this.on_change(s,v(()=>{this.perspective_element.restore({expressions:this.model.expressions})})),this.on_change(i,v(()=>{this.perspective_element.restore({split_by:this.model.split_by})})),this.on_change(n,v(()=>{this.perspective_element.restore({group_by:this.model.group_by})})),this.on_change(r,v(()=>{this.perspective_element.restore({aggregates:this.model.aggregates})})),this.on_change(l,v(()=>{this.perspective_element.restore({filter:this.model.filters})})),this.on_change(u,v(()=>{this.perspective_element.restore({settings:this.model.settings})})),this.on_change(g,v(()=>{this.perspective_element.restore({title:this.model.title})})),this.on_change(o,v(()=>{this.perspective_element.restore({sort:this.model.sort})})),this.on_change(c,v(()=>{this.perspective_element.restore({plugin:d[this.model.plugin],...u})})),this.on_change(h,v(()=>{this.perspective_element.restore({plugin_config:{...this._current_config,selectable:this.model.selectable}})})),this.on_change(a,v(()=>{this.perspective_element.restore({plugin_config:{...this._current_config,editable:this.model.editable}})})),this.on_change(m,v(()=>{this.perspective_element.restore({theme:p[this.model.theme]}).catch(()=>{})}))}disconnect_signals(){null!=this._config_listener&&this.perspective_element.removeEventListener("perspective-config-update",this._config_listener),this._config_listener=null,super.disconnect_signals()}remove(){this.perspective_element&&this.perspective_element.delete(()=>this.worker.terminate()),super.remove()}stylesheets(){return[...super.stylesheets(),a.default]}render(){super.render();const e=(0,o.div)({class:"pnx-perspective-viewer",style:{zIndex:"0"}});this._current_plugin=this.model.plugin,(0,h.set_size)(e,this.model),this.shadow_el.appendChild(e),window.perspective.worker().then(t=>{this.worker=t,t.table(this.model.schema).then(t=>{this.table=t,this.table.update(this.data),e.innerHTML="<perspective-viewer style='height:100%; width:100%;'></perspective-viewer>",this.perspective_element=e.children[0];const s=Object.values(p).filter(e=>e!==this.model.theme),i=[this.model.theme,...s];this.perspective_element.resetThemes(i).catch(()=>{}),this.perspective_element.load(this.table);const n={...this.model.plugin_config,editable:this.model.editable,selectable:this.model.selectable};this.perspective_element.restore({aggregates:this.model.aggregates,columns:this.model.columns,columns_config:this.model.columns_config,expressions:this.model.expressions,filter:this.model.filters,split_by:this.model.split_by,group_by:this.model.group_by,plugin:d[this.model.plugin],plugin_config:n,settings:this.model.settings,sort:this.model.sort,theme:p[this.model.theme],title:this.model.title}).catch(()=>{}),this.perspective_element.save().then(e=>{this._current_config=e}),this._config_listener=()=>this.sync_config(),this.perspective_element.addEventListener("perspective-config-update",this._config_listener),this.perspective_element.addEventListener("perspective-click",e=>{this.model.trigger_event(new PerspectiveClickEvent(e.detail.config,e.detail.column_names,e.detail.row))}),this._loaded=!0})})}sync_config(){return this._updating||this.perspective_element.save().then(e=>{if(e.plugin!==this._current_plugin&&(this._plugin_configs.set(this._current_plugin,{columns:this._current_config.columns,columns_config:this._current_config.columns_config,plugin_config:this._current_config.plugin_config}),this._plugin_configs.has(e.plugin))){const t=this._plugin_configs.get(e.plugin);this.perspective_element.restore(t),e={...e,...t}}this._current_config=e,this._current_plugin=e.plugin;const t={};for(let s in e){let i=e[s];void 0===i||"plugin"==s&&"debug"===i||"version"==s||void 0===this.model.properties.hasOwnProperty(s)||("filter"===s?s="filters":"plugin"===s?i=g[i]:"theme"===s&&(i=u[i]),t[s]=i)}this._updating=!0,this.model.setv(t),this._updating=!1}),!0}get data(){const e={};for(const t of this.model.source.columns()){let s=this.model.source.get_array(t);"datetime"==this.model.schema[t]&&s.includes(-9223372036854776)&&(s=s.map(e=>-9223372036854776===e?null:e)),e[t]=s}return e}setData(){if(this._loaded){for(const e of this.model.source.columns())if(!(e in this.model.schema))return;this.table.replace(this.data)}}stream(){this._loaded&&this.table.replace(this.data)}patch(){this._loaded&&this.table.replace(this.data)}}s.PerspectiveView=PerspectiveView;class Perspective extends h.HTMLBox{constructor(e){super(e)}static __module__="panel.models.perspective";static{this.prototype.default_view=PerspectiveView,this.define(({Any:e,List:t,Bool:s,Ref:i,Nullable:n,Str:r})=>({aggregates:[e,{}],columns:[t(n(r)),[]],columns_config:[e,{}],expressions:[e,{}],split_by:[n(t(r)),null],editable:[s,!0],filters:[n(t(e)),null],group_by:[n(t(r)),null],plugin:[r],plugin_config:[e,{}],selectable:[s,!0],settings:[s,!0],schema:[e,{}],sort:[n(t(t(r))),null],source:[i(c.ColumnDataSource)],theme:[r,"pro"],title:[n(r),null]}))}}s.Perspective=Perspective},
|
|
231
231
|
"2e2913ea54": function _(e,r,t,a,o){a(),t.default="regular-table{padding:0;margin:12px 0 0 12px;scrollbar-color:transparent transparent;scrollbar-width:thin;outline:none;}regular-table:hover{scrollbar-color:rgba(0, 0, 0, 0.3) transparent;}.sub-cell-scroll-enabled regular-table table tbody td,.sub-cell-scroll-enabled regular-table table thead th:not(.rt-group-corner){transform:translate(var(--regular-table--transform-x, 0px));}.sub-cell-scroll-enabled regular-table table tbody{transform:translate(0, var(--regular-table--transform-y, 0px));}.sub-cell-scroll-enabled regular-table table tbody tr:first-child td,.sub-cell-scroll-enabled regular-table table tbody tr:first-child th{clip-path:polygon(0 var(--regular-table--clip-y, 0), 0 200%, 200% 200%, 200% var(--regular-table--clip-y, 0));}.sub-cell-scroll-enabled regular-table table thead th.rt-group-corner{background:var(--plugin--background, white);z-index:1;}.sub-cell-scroll-enabled regular-table table tbody tr td:first-of-type{clip-path:polygon(var(--regular-table--clip-x, 0) 0, var(--regular-table--clip-x, 0) 200%, 200% 200%, 200% 0);}.sub-cell-scroll-enabled regular-table table tbody tr:first-child td:first-of-type{clip-path:polygon(var(--regular-table--clip-x, 0) var(--regular-table--clip-y, 0), var(--regular-table--clip-x, 0) 200%, 200% 200%, 200% var(--regular-table--clip-y, 0));}regular-table{font-family:inherit;}regular-table div[tabindex]{outline:none;}regular-table > div{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;}regular-table th{text-align:center;}regular-table thead tr:not(:last-child) th{overflow:hidden;max-width:0px;}regular-table thead tr:last-child .rt-float,regular-table tbody .rt-float{text-align:right;}regular-table thead .rt-integer,regular-table tbody .rt-integer{text-align:right;}regular-table tbody th{text-align:left;}regular-table span.rt-tree-container{display:flex;align-items:center;height:100%;}regular-table thead .rt-string,regular-table tbody .rt-string,regular-table thead .rt-date,regular-table tbody .rt-date,regular-table thead .rt-datetime,regular-table tbody .rt-datetime{text-align:left;}regular-table thead tr:last-child th{border-bottom:1px solid #eaedef;}regular-table tbody tr:first-child td,regular-table tbody tr:first-child th{border-top:1px solid transparent !important;}regular-table th{position:relative;}regular-table tr th span.rt-tree-group{margin-left:5px;margin-right:15px;border-left:1px solid #eee;height:100%;}regular-table td,regular-table th{white-space:nowrap;font-size:12px;padding-right:5px;padding-left:5px;padding-top:0px;padding-bottom:0px;height:19px;}regular-table tr:hover td{background:#eee;opacity:1;}regular-table tr:hover{color:#333;}regular-table table *{box-sizing:border-box;}regular-table table{position:absolute;overflow:hidden;color:#666;outline:none;}regular-table span.rt-row-header-icon{color:#aaa;padding-right:4px;font-family:var(--button--font-family, 'Material Icons');}regular-table span.rt-column-header-icon{font-size:10px;padding-left:3px;display:inline-block;width:10px;font-family:var(--button--font-family, 'Material Icons');}regular-table span.rt-row-header-icon:hover{color:#1a7da1;text-shadow:0px 0px 3px #1a7da1;}regular-table .rt-selected td{background-color:#eee;}regular-table .rt-cell-clip{overflow:hidden;text-overflow:ellipsis;}regular-table td span.rt-group-name,regular-table th span.rt-group-name{margin-right:-5px;padding-right:5px;padding-left:8px;flex:1;height:100%;}regular-table th span.rt-group-name{text-align:left;}regular-table td th span.rt-group-leaf,regular-table th span.rt-group-leaf{margin-left:16px;height:100%;}regular-table .rt-column-resize{height:100%;width:10px;position:absolute;top:0;right:0;cursor:col-resize;}regular-table a{color:var(--rt-pos-cell--color);}regular-table a:visited{color:var(--active--color);}regular-table::-webkit-scrollbar,regular-table::-webkit-scrollbar-corner{background-color:transparent;height:12px;width:12px;}regular-table::-webkit-scrollbar-thumb{background-clip:content-box;background-color:rgba(0, 0, 0, 0);border-radius:5px;}regular-table::-webkit-scrollbar-thumb:horizontal{border-bottom:2px solid transparent;border-top:2px solid transparent;}regular-table::-webkit-scrollbar-thumb:vertical{border-left:2px solid transparent;border-right:2px solid transparent;}regular-table:hover::-webkit-scrollbar-thumb{background-color:rgba(0, 0, 0, 0.15);}regular-table::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, 0.3);}.psp-header-border:not(.psp-is-top):not(.psp-header-leaf){box-shadow:1px 0px var(--inactive--color, #eaedef);}.psp-header-group{box-shadow:0px 10px 0 -9px var(--inactive--color, #eaedef);}.psp-is-top{box-shadow:5px 4px 0px -4px var(--inactive--color, #eaedef);}.psp-is-top.psp-header-group:not(.psp-header-group-corner){box-shadow:5px 4px 0px -4px var(--inactive--color, #eaedef), 0px 10px 0 -9px var(--inactive--color, #eaedef);}.psp-header-border.psp-header-group:not(.psp-is-top):not(\n .psp-header-group-corner\n ){box-shadow:1px 0px var(--inactive--color, #eaedef), 0px 10px 0 -9px var(--inactive--color, #eaedef);}.psp-header-leaf.psp-header-border{box-shadow:5px -4px 0px -4px var(--inactive--color, #eaedef);}tr:only-child th{box-shadow:none !important;}regular-table tbody tr:hover th.psp-tree-leaf:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover th.psp-tree-label:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover td:not(.psp-row-selected):not(.psp-row-subselected){border-color:var(--rt-hover--border-color, #c5c9d080) !important;background-color:transparent;box-shadow:0px 1px 0px var(--rt-hover--border-color, #c5c9d080), 0px 3px 0px rgba(0, 0, 0, 0.05), 0px 5px 0px rgba(0, 0, 0, 0.01);}regular-table tbody tr:hover + tr th.psp-tree-leaf:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover + tr th.psp-tree-label:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover + tr td:not(.psp-row-selected):not(.psp-row-subselected){border-top-color:transparent;}regular-table tbody tr th:first-child:not(:empty),regular-table tbody tr th:first-child:empty + th:not(:empty),regular-table tbody tr th:first-child:empty ~ th:empty + th:not(:empty),regular-table tbody tr td:first-child{border-left-width:1px;border-left-color:transparent;}regular-table tbody tr th:last-child,regular-table tbody tr td:last-child{border-right-width:1px;border-right-color:transparent;}regular-table tbody tr:hover{color:#161616;}regular-table tbody tr:hover th:first-child:not(:empty),regular-table tbody tr:hover th:first-child:empty + th:not(:empty),regular-table tbody tr:hover th:first-child:empty ~ th:empty + th:not(:empty),regular-table tbody tr:hover td:first-child{border-left-color:var(--rt-hover--border-color, #c5c9d080) !important;}regular-table tbody tr:hover th:last-child,regular-table tbody tr:hover td:last-child{border-right-color:var(--rt-hover--border-color, #c5c9d080) !important;}perspective-viewer[settings] regular-table .psp-header-leaf{height:36px;vertical-align:top;padding-top:2px;}perspective-viewer[settings] regular-table .psp-header-leaf:not(.psp-header-corner):before{font-family:var(--button--font-family, inherit);content:var(--column-style-open-button--content, var(--config-button-icon--content, '\u1f527'));position:absolute;width:calc(100% - 8px);left:5px;bottom:0px;color:var(--inactive--color, #b4b7be);}perspective-viewer[settings] regular-table .psp-header-leaf.psp-menu-enabled:not(.psp-header-corner):before{color:inherit;cursor:pointer;}perspective-viewer[settings] regular-table .psp-header-leaf.psp-menu-open:not(.psp-header-corner){pointer-events:none;}perspective-viewer[settings] regular-table .psp-header-leaf.psp-menu-open:not(.psp-header-corner):before{content:var(--column-style-close-button--content, 'X');}perspective-viewer[settings] regular-table .psp-header-leaf.psp-menu-enabled:hover:before{color:#338dcd;}perspective-viewer[settings] regular-table .psp-header-leaf .rt-column-resize{height:18px;}.psp-row-selected,:hover .psp-row-selected,:hover th.psp-tree-leaf.psp-row-selected,:hover th.psp-tree-label.psp-row-selected{color:white !important;background-color:#ea7319 !important;border-color:#ea7319 !important;}.psp-row-selected.psp-tree-label:not(:hover):before{color:white;}.psp-row-subselected,:hover .psp-row-subselected,:hover th.psp-tree-leaf.psp-row-subselected,:hover th.psp-tree-label.psp-row-subselected{background:rgba(234, 115, 25, 0.2) !important;}.psp-error{color:red;}td:focus{outline:#666;outline-style:dotted;outline-width:1px;}perspective-viewer.dragging regular-table{pointer-events:none;}.psp-header-border:last-child{border-right-width:0px;}.psp-header-sort-desc:after{font-family:var(--button--font-family, inherit);font-size:10px;content:var(--sort-order-desc--content, '\u2193');}.psp-header-sort-asc:after{font-family:var(--button--font-family, inherit);font-size:10px;content:var(--sort-order-asc--content, '\u2191');}.psp-header-sort-col-desc:after{font-family:var(--button--font-family, inherit);font-size:10px;content:var(--sort-order-col-desc--content, '\u2190');}.psp-header-sort-col-asc:after{font-family:var(--button--font-family, inherit);font-size:10px;content:var(--sort-order-col-asc--content, '\u2192');}tbody th:last-of-type{border-right:1px solid #eaedef;overflow:hidden;text-overflow:ellipsis;}tbody th:empty{background-image:linear-gradient(to right, transparent 9px, #eee 10px, transparent 11px);background-repeat:no-repeat;min-width:20px;max-width:20px;pointer-events:none;}.psp-tree-label{max-width:0px;min-width:0px;}.psp-tree-label:before{color:#ccc;font-family:var(--button--font-family, inherit);padding-right:11px;vertical-align:-1px;}.psp-tree-label-expand:before{content:var(--tree-label-expand--content, '+');}.psp-tree-label-collapse:before{content:var(--tree-label-collapse--content, '-');}.psp-tree-label:hover:before{color:#338dcd;text-shadow:0px 0px 5px #338dcd;}regular-table thead tr:last-child th{border-bottom-width:1px;border-bottom-color:var(--inactive--color, #eaedef);}.psp-tree-leaf{padding-left:24px;}.psp-align-right{text-align:right;}.psp-align-left{text-align:left;}.psp-positive:not(:focus){color:var(--rt-pos-cell--color, #338dcd);}.psp-negative:not(:focus){color:var(--rt-neg-cell--color, #ff5942);}regular-table table tbody td{min-width:52px !important;}.psp-is-width-override .rt-column-resize,.rt-column-resize:hover{border:1px dashed #999;border-bottom-width:0px;border-left-width:0px;}.psp-bool-type{font-family:var(--button--font-family, 'Material Icons');}.boolean-editable{cursor:pointer;}regular-table table{user-select:none;color:#161616;border-collapse:separate;}regular-table table th{font-weight:400;}regular-table table td,regular-table table th{border-color:#eaedef;height:23px;}regular-table table .psp-header-group{text-overflow:ellipsis;}regular-table table .psp-header-leaf{border-bottom-width:0px;}regular-table table td,regular-table table th.psp-tree-label,regular-table table th.psp-tree-label,regular-table table th.psp-tree-leaf,regular-table table tbody tr:first-child th{border-style:solid;border-width:0px;border-top-width:1px;}regular-table table tbody th:empty{background-position:0px -10px;}@keyframes pulse_pos{0%{background-color:var(--pulse--background-color-start, rgba(0, 128, 255, 0.5));}100%{background-color:var(--pulse--background-color-end, rgba(0, 128, 255, 0));}}@keyframes pulse_pos2{0%{background-color:var(--pulse--background-color-start, rgba(0, 128, 255, 0.5));}100%{background-color:var(--pulse--background-color-end, rgba(0, 128, 255, 0));}}@keyframes pulse_neg{0%{background-color:var(--pulse--background-color-start, rgba(255, 25, 0, 0.5));}100%{background-color:var(--pulse--background-color-end, rgba(255, 25, 0, 0));}}@keyframes pulse_neg2{0%{background-color:var(--pulse--background-color-start, rgba(255, 25, 0, 0.5));}100%{background-color:var(--pulse--background-color-end, rgba(255, 25, 0, 0));}}"},
|
|
232
|
-
"
|
|
232
|
+
"736be77caa": function _(t,e,o,i,s){i();const n=t("tslib"),l=t("@bokehjs/core/bokeh_events"),r=t("@bokehjs/core/dom"),a=t("@bokehjs/core/util/types"),h=t("@bokehjs/core/util/object"),c=t("@bokehjs/core/util/eq"),d=t("@bokehjs/models/sources/column_data_source"),u=t("99a25e6992"),p=t("00beb93e38"),y=t("aa07eb54cc"),w=n.__importDefault(t("3d56c75186")),m=new Set(["__proto__","prototype","constructor"]);function g(t){return"object"==typeof t&&null!==t}function v(t){return t.every(t=>t.length>0&&!m.has(t))}function P(t,e){let o=t;for(const t of e){if(!g(o)||m.has(t)||!Object.hasOwn(o,t))return null;o=o[t]}return g(o)?o:null}class PlotlyEvent extends l.ModelEvent{data;constructor(t){super(),this.data=t}get event_values(){return{model:this.origin,data:this.data}}static{this.prototype.event_name="plotly_event"}}o.PlotlyEvent=PlotlyEvent;const f=t=>{if("_undefined_"!==t)return Array.isArray(t)?t.map(f):(0,a.isPlainObject)(t)?Object.fromEntries(Object.entries(t).map(([t,e])=>[t,f(e)])):t},b=(t,e,o)=>{const i=Array.isArray(e)?[]:{};if("click"===o||"hover"===o||"selected"===o){const o=[];if(null==e)return null;const s=e.event;let n;void 0!==s&&(i.device_state={alt:s.altKey,ctrl:s.ctrlKey,meta:s.metaKey,shift:s.shiftKey,button:s.button,buttons:s.buttons}),n=e.hasOwnProperty("range")?{type:"box",selector_state:{xrange:e.range.x,yrange:e.range.y}}:e.hasOwnProperty("lassoPoints")?{type:"lasso",selector_state:{xs:e.lassoPoints.x,ys:e.lassoPoints.y}}:null,i.selector=n;const l=t.data;for(let t=0;t<e.points.length;t++){const i=e.points[t],s={};for(const t in i){const e=i[t],o=Array.isArray(e)&&e.every(t=>null===t||"object"!=typeof t);i.hasOwnProperty(t)&&(o||!Array.isArray(e)&&!(0,a.isPlainObject)(e))&&void 0!==e&&(s[t]=e)}null!=i&&(i.hasOwnProperty("curveNumber")&&i.hasOwnProperty("pointNumber")&&l[i.curveNumber].hasOwnProperty("customdata")&&(s.customdata=l[i.curveNumber].customdata[i.pointNumber]),i.hasOwnProperty("pointNumbers")&&(s.pointNumbers=i.pointNumbers)),o[t]=s}i.points=o}else if("relayout"===o||"restyle"===o)for(const t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return e.hasOwnProperty("range")&&(i.range=e.range),e.hasOwnProperty("lassoPoints")&&(i.lassoPoints=e.lassoPoints),(0,y.convertUndefined)(i)};class PlotlyPlotView extends p.HTMLBoxView{_setViewport;_settingViewport=!1;_plotInitialized=!1;_rendered=!1;_reacting=!1;_relayouting=!1;_model_restyles=0;_hoverdata=null;container;_end_relayouting=(0,u.debounce)(()=>{this._relayouting=!1},2e3,!1);_throttled_resize;_frames=null;_plot_promise=null;_plot_scheduled=!1;_new_plot=!1;initialize(){super.initialize(),this._throttled_resize=(0,y.throttle)(()=>this.resize_layout(),25)}connect_signals(){super.connect_signals();const{data:t,data_sources:e,layout:o,relayout:i,restyle:s,viewport_update_policy:n,viewport_update_throttle:l,_render_count:r,frames:a,viewport:h}=this.model.properties;this.on_change([t,e,o,r],()=>{this._schedule_plot()}),this.on_change(a,()=>{this._schedule_plot(!0)}),this.on_change(i,()=>{null!=this.model.relayout&&(window.Plotly.relayout(this.container,this.model.relayout),this.model.relayout=null)}),this.on_change(s,()=>{if(null==this.model.restyle)return;const t=f(this.model.restyle.data);this._model_restyles+=1,window.Plotly.restyle(this.container,t,this.model.restyle.traces).finally(()=>{this._model_restyles-=1}),this.model.restyle=null}),this.on_change(n,()=>{this._updateSetViewportFunction()}),this.on_change(l,()=>{this._updateSetViewportFunction()}),this.on_change(h,()=>{this._updateViewportFromProperty()})}_schedule_plot(t=!1){if(this._new_plot||=t,this._plot_scheduled)return;this._plot_scheduled=!0;const e=()=>{this._plot_scheduled=!1;const t=this._new_plot;this._new_plot=!1,this._plot_promise=this.plot(t)};(this._plot_promise??Promise.resolve()).then(e,e)}stylesheets(){return[...super.stylesheets(),w.default]}remove(){null!=this.container&&window.Plotly.purge(this.container),super.remove()}render(){super.render(),this.container=(0,r.div)(),(0,p.set_size)(this.container,this.model),this._rendered=!1,this.watch_stylesheets(),this._plot_promise=this.plot(!0).then(()=>{this.shadow_el.appendChild(this.container),this._rendered=!0,this.resize_layout(),null!=this.model.relayout&&window.Plotly.relayout(this.container,this.model.relayout)})}_plot_size(){const t=Math.min(this.model.width||this.el.clientWidth,this.model.max_width||1/0),e=Math.min(this.model.height||this.el.clientHeight,this.model.max_height||1/0);return t>0&&e>0?[t,e]:null}style_redraw(){this.resize_layout()}resize_layout(){if(!this._rendered||null==this.container)return;const t=Math.min(this.model.width||this.el.clientWidth,this.model.max_width||1/0),e=Math.min(this.model.height||this.el.clientHeight,this.model.max_height||1/0),{layout:o}=this.container;null!=o&&o.width===t&&o.height===e||window.Plotly.relayout(this.container,{width:t,height:e})}after_layout(){super.after_layout(),this._throttled_resize()}_trace_data(){const t=[];for(let e=0;e<this.model.data.length;e++)t.push(this._get_trace(e,!1));return t}_layout_data(){const t=(0,y.deepCopy)(this.model.layout);if(this._relayouting){const{layout:e}=this.container;Object.keys(e).reduce((e,o)=>{"axis"===o.slice(1,5)&&"range"in e&&(t[o].range=e.range)},{})}const e=this._rendered?this._plot_size():null;return null!=e&&(t.width??=e[0],t.height??=e[1]),t}_install_callbacks(){this.container.on("plotly_relayout",t=>{!0!==t._update_from_property&&(this.model.relayout_data=b(this.container,t,"relayout"),this._updateViewportProperty(),this._end_relayouting())}),this.container.on("plotly_relayouting",()=>{"mouseup"!==this.model.viewport_update_policy&&(this._relayouting=!0,this._updateViewportProperty())}),this.container.on("plotly_restyle",t=>{this._model_restyles>0||(this.model.restyle_data=b(this.container,t,"restyle"),this._updateViewportProperty())}),this.container.on("plotly_click",t=>{const e=b(this.container,t,"click");this.model.trigger_event(new PlotlyEvent({type:"click",data:e}))}),this.container.on("plotly_doubleclick",t=>{const e=b(this.container,t,"click");this.model.trigger_event(new PlotlyEvent({type:"doubleclick",data:e}))}),this.container.on("plotly_hover",t=>{const e=b(this.container,t,"hover");this.model.trigger_event(new PlotlyEvent({type:"hover",data:e})),this._hoverdata=this.container._hoverdata=t.points}),this.container.on("plotly_selected",t=>{if(null==t)return;const e=b(this.container,t,"selected");this.model.trigger_event(new PlotlyEvent({type:"selected",data:e}))}),this.container.on("plotly_clickannotation",t=>{delete t.event,delete t.fullAnnotation,this.model.trigger_event(new PlotlyEvent({type:"clickannotation",data:t}))}),this.container.on("plotly_deselect",()=>{this.model.trigger_event(new PlotlyEvent({type:"selected",data:null}))}),this.container.on("plotly_unhover",()=>{if(this.model.trigger_event(new PlotlyEvent({type:"hover",data:null})),null!=this.container._hoverdata)return;const t=this.container._hoverdata=this._hoverdata;setTimeout(()=>{this.container._hoverdata===t&&delete this.container._hoverdata},0)})}async plot(t=!1){if(!window.Plotly||!this.container)return;const e=this._trace_data(),o=this._layout_data(),{config:i,frames:s}=this.model;this._reacting=!0;try{t||!this._plotInitialized?await window.Plotly.newPlot(this.container,{data:e,layout:o,config:i,frames:s}):s!==this._frames?await window.Plotly.react(this.container,{data:e,layout:o,config:i,frames:s}):await window.Plotly.react(this.container,e,o,i),this._frames=s,this._updateSetViewportFunction(),this._updateViewportProperty(),this._plotInitialized?(t=>{const e=window.getComputedStyle(t).display;return!e||"none"===e})(this.container)||this.resize_layout():this._install_callbacks()}finally{this._reacting=!1}this._plotInitialized=!0}_get_trace(t,e){const o=(0,h.clone)(this.model.data[t]),i=this.model.data_sources[t];for(const t of i.columns()){let s=i.get_array(t)[0];null!=s.shape&&s.shape.length>1&&(s=(0,y.reshape)(s,s.shape));const n=t.split("."),l=n[n.length-1],r=P(o,n.slice(0,-1));r&&l&&v(n)&&!m.has(l)?e&&1==n.length?r[l]=[s]:r[l]=s:console.warn("Attempted prototype pollution detected via Plotly column resolution.")}return o}_updateViewportFromProperty(){if(!window.Plotly||this._settingViewport||this._reacting||!this.model.viewport)return;const t=this.container._fullLayout;Object.keys(this.model.viewport).reduce((e,o)=>{if((0,c.is_equal)((0,y.get)(t,o),e))return!0;{const t=(0,y.deepCopy)(this.model.viewport);return t._update_from_property=!0,this._settingViewport=!0,window.Plotly.relayout(this.el,t).then(()=>{this._settingViewport=!1}),!1}},{})}_updateViewportProperty(){const t=this.container._fullLayout,e={};for(const o in t){if(!t.hasOwnProperty(o))continue;const i=o.slice(0,5);"xaxis"!==i&&"yaxis"!==i||(e[`${o}.range`]=(0,y.deepCopy)(t[o].range))}(0,c.is_equal)(e,this.model.viewport)||this._setViewport(e)}_updateSetViewportFunction(){"continuous"===this.model.viewport_update_policy||"mouseup"===this.model.viewport_update_policy?this._setViewport=t=>{this._settingViewport||(this._settingViewport=!0,this.model.viewport=t,this._settingViewport=!1)}:this._setViewport=(0,y.throttle)(t=>{this._settingViewport||(this._settingViewport=!0,this.model.viewport=t,this._settingViewport=!1)},this.model.viewport_update_throttle)}}o.PlotlyPlotView=PlotlyPlotView;class PlotlyPlot extends p.HTMLBox{constructor(t){super(t)}static __module__="panel.models.plotly";static{this.prototype.default_view=PlotlyPlotView,this.define(({List:t,Any:e,Nullable:o,Float:i,Ref:s,Str:n})=>({data:[t(e),[]],layout:[e,{}],config:[e,{}],frames:[o(t(e)),null],data_sources:[t(s(d.ColumnDataSource)),[]],relayout:[o(e),{}],restyle:[o(e),{}],relayout_data:[e,{}],restyle_data:[t(e),[]],viewport:[e,{}],viewport_update_policy:[n,"mouseup"],viewport_update_throttle:[i,200],_render_count:[i,0]}))}}o.PlotlyPlot=PlotlyPlot},
|
|
233
233
|
"3d56c75186": function _(o,t,l,r,e){r(),l.default=".js-plotly-plot .plotly,.js-plotly-plot .plotly div{direction:ltr;font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;}.js-plotly-plot .plotly input,.js-plotly-plot .plotly button{font-family:'Open Sans', verdana, arial, sans-serif;}.js-plotly-plot .plotly input:focus,.js-plotly-plot .plotly button:focus{outline:none;}.js-plotly-plot .plotly a{text-decoration:none;}.js-plotly-plot .plotly a:hover{text-decoration:none;}.js-plotly-plot .plotly .crisp{shape-rendering:crispEdges;}.js-plotly-plot .plotly .user-select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;}.js-plotly-plot .plotly svg{overflow:hidden;}.js-plotly-plot .plotly svg a{fill:#447adb;}.js-plotly-plot .plotly svg a:hover{fill:#3c6dc5;}.js-plotly-plot .plotly .main-svg{position:absolute;top:0;left:0;pointer-events:none;}.js-plotly-plot .plotly .main-svg .draglayer{pointer-events:all;}.js-plotly-plot .plotly .cursor-default{cursor:default;}.js-plotly-plot .plotly .cursor-pointer{cursor:pointer;}.js-plotly-plot .plotly .cursor-crosshair{cursor:crosshair;}.js-plotly-plot .plotly .cursor-move{cursor:move;}.js-plotly-plot .plotly .cursor-col-resize{cursor:col-resize;}.js-plotly-plot .plotly .cursor-row-resize{cursor:row-resize;}.js-plotly-plot .plotly .cursor-ns-resize{cursor:ns-resize;}.js-plotly-plot .plotly .cursor-ew-resize{cursor:ew-resize;}.js-plotly-plot .plotly .cursor-sw-resize{cursor:sw-resize;}.js-plotly-plot .plotly .cursor-s-resize{cursor:s-resize;}.js-plotly-plot .plotly .cursor-se-resize{cursor:se-resize;}.js-plotly-plot .plotly .cursor-w-resize{cursor:w-resize;}.js-plotly-plot .plotly .cursor-e-resize{cursor:e-resize;}.js-plotly-plot .plotly .cursor-nw-resize{cursor:nw-resize;}.js-plotly-plot .plotly .cursor-n-resize{cursor:n-resize;}.js-plotly-plot .plotly .cursor-ne-resize{cursor:ne-resize;}.js-plotly-plot .plotly .cursor-grab{cursor:-webkit-grab;cursor:grab;}.js-plotly-plot .plotly .modebar{position:absolute;top:2px;right:2px;}.js-plotly-plot .plotly .ease-bg{-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;}.js-plotly-plot .plotly .modebar--hover > :not(.watermark){opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;}.js-plotly-plot .plotly:hover .modebar--hover .modebar-group{opacity:1;}.js-plotly-plot .plotly .modebar-group{float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;}.js-plotly-plot .plotly .modebar-btn{fill:var(--plotly-icon-color);background-color:unset;border:none;position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;}.js-plotly-plot .plotly .modebar-btn.active{fill:var(--plotly-active-icon-color);}.js-plotly-plot .plotly .modebar-btn svg{position:relative;top:2px;}.js-plotly-plot .plotly .modebar.vertical{display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;}.js-plotly-plot .plotly .modebar.vertical svg{top:-1px;}.js-plotly-plot .plotly .modebar.vertical .modebar-group{display:block;float:none;padding-left:0px;padding-bottom:8px;}.js-plotly-plot .plotly .modebar.vertical .modebar-group .modebar-btn{display:block;text-align:center;}.js-plotly-plot .plotly [data-title]{}.js-plotly-plot .plotly [data-title]:before,.js-plotly-plot .plotly [data-title]:after{position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;}.js-plotly-plot .plotly [data-title]:hover:before,.js-plotly-plot .plotly [data-title]:hover:after{display:block;opacity:1;}.js-plotly-plot .plotly [data-title]:before{content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;}.js-plotly-plot .plotly [data-title]:after{content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;}.js-plotly-plot .plotly .vertical [data-title]:before,.js-plotly-plot .plotly .vertical [data-title]:after{top:0%;right:200%;}.js-plotly-plot .plotly .vertical [data-title]:before{border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;}.plotly-notifier{font-family:'Open Sans', verdana, arial, sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;}.plotly-notifier p{margin:0;}.plotly-notifier .notifier-note{min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140, 151, 175, 0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;}.plotly-notifier .notifier-close{color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;}.plotly-notifier .notifier-close:hover{color:#444;text-decoration:none;cursor:pointer;}"},
|
|
234
234
|
"443fb5cf42": function _(s,e,t,o,i){o();const l=s("@bokehjs/core/dom"),r=s("00beb93e38");class ProgressView extends r.HTMLBoxView{progressEl;connect_signals(){super.connect_signals();const{width:s,height:e,height_policy:t,width_policy:o,sizing_mode:i,active:l,bar_color:r,css_classes:h,value:a,max:n}=this.model.properties;this.on_change([s,e,t,o,i],()=>this.rerender_()),this.on_change([l,r,h],()=>this.setCSS()),this.on_change(a,()=>this.setValue()),this.on_change(n,()=>this.setMax())}render(){super.render();const s={...this.model.styles,display:"inline-block"};null!=this.model.height&&(s.height=`${this.model.height}px`),this.progressEl=document.createElement("progress"),this.setValue(),this.setMax(),this.setCSS();for(const e in s)this.progressEl.style.setProperty(e,s[e]);this.shadow_el.appendChild(this.progressEl)}stylesheets(){const s=super.stylesheets();for(const e of this.model.css)s.push(new l.ImportedStyleSheet(e));return s}setCSS(){let s=`${this.model.css_classes.join(" ")} ${this.model.bar_color}`;this.model.active&&(s=`${s} active`),this.progressEl.className=s}setValue(){null==this.model.value?this.progressEl.value=0:this.model.value>=0?this.progressEl.value=this.model.value:this.model.value<0&&this.progressEl.removeAttribute("value")}setMax(){null!=this.model.max&&(this.progressEl.max=this.model.max)}}t.ProgressView=ProgressView;class Progress extends r.HTMLBox{constructor(s){super(s)}static __module__="panel.models.widgets";static{this.prototype.default_view=ProgressView,this.define(({Any:s,List:e,Bool:t,Float:o,Str:i})=>({active:[t,!0],bar_color:[i,"primary"],css:[e(i),[]],max:[o,100],value:[s,null]}))}}t.Progress=Progress},
|
|
235
235
|
"3df70ba3b3": function _(t,e,i,l,o){l();const s=t("@bokehjs/core/dom"),n=t("00beb93e38");class QuillInputView extends n.HTMLBoxView{container;_editor;_editing;_toolbar;quill;connect_signals(){super.connect_signals();const{disabled:t,visible:e,text:i,mode:l,toolbar:o,placeholder:s}=this.model.properties;this.on_change(t,()=>{this.quill.enable(!this.model.disabled)}),this.on_change(e,()=>{this.model.visible&&(this.container.style.visibility="visible")}),this.on_change(i,()=>{this._editing||(this._editing=!0,this.quill.enable(!1),this.quill.setContents([]),this.quill.clipboard.dangerouslyPasteHTML(this.model.text),this.quill.enable(!this.model.disabled),this._editing=!1)}),this.on_change(s,()=>{this.quill.root.setAttribute("data-placeholder",this.model.placeholder)}),this.on_change([l,o],()=>{this.render(),this._layout_toolbar()})}_layout_toolbar(){if(null==this._toolbar)this.el.style.removeProperty("padding-top");else{const t=this._toolbar.getBoundingClientRect().height+1;this.el.style.paddingTop=`${t}px`,this._toolbar.style.marginTop=-t+"px"}}render(){super.render(),this.container=(0,s.div)({style:{visibility:"hidden"}}),this.shadow_el.appendChild(this.container);const t="bubble"===this.model.mode?"bubble":"snow";this.watch_stylesheets(),this.quill=new window.Quill(this.container,{modules:{toolbar:this.model.toolbar},readOnly:!0,placeholder:this.model.placeholder,theme:t});const e=!!document.createElement("div").attachShadow({mode:"open"}).getSelection;this.quill.selection.hasFocus=()=>this.quill.root.getRootNode().activeElement===this.quill.root,this.quill.selection.getNativeRange=()=>{const t=(t=>{try{if(e)return t.getSelection().getRangeAt(0);{const e=window.getSelection();return e.getComposedRanges?e.getComposedRanges(t)[0]:e.getRangeAt(0)}}catch{return null}})(this.quill.root.getRootNode());return t?this.quill.selection.normalizeNative(t):null},this.quill.selection.setNativeRange=(t,e,i=void 0,l=void 0,o=!1)=>{if(i=void 0===i?t:i,l=void 0===l?e:l,o=o||!1,null!=t&&(null==this.quill.selection.root.parentNode||null==t.parentNode||null==i.parentNode))return;const s=document.getSelection();if(null!=s)if(null!=t){this.quill.selection.hasFocus()||this.quill.selection.root.focus();const n=(this.quill.selection.getNativeRange()||{}).native;(null==n||o||t!==n.startContainer||e!==n.startOffset||i!==n.endContainer||l!==n.endOffset)&&("BR"==t.tagName&&(e=Array.prototype.indexOf.call(t.parentNode?.childNodes??[],t),t=t.parentNode),"BR"==i.tagName&&(l=Array.prototype.indexOf(i.parentNode?.childNodes??[],i),i=i.parentNode),s.setBaseAndExtent(t,e,i,l))}else s.removeAllRanges(),this.quill.selection.root.blur(),document.body.focus()},this._editor=this.shadow_el.querySelector(".ql-editor"),this._toolbar=this.shadow_el.querySelector(".ql-toolbar");const i=this.quill.clipboard.convert({html:this.model.text});this.quill.setContents(i),this.quill.on("text-change",()=>{if(this._editing)return;this._editing=!0;const t=this.quill.getSemanticHTML();this.model.text_input=t,this.model.on_keyup&&(this.model.text=t),this._editing=!1}),this.quill.on("selection-change",(t,e,i)=>{if(!this._editing){if(null===t)return this.model.on_keyup||(this._editing=!0,this.model.text=this.quill.getSemanticHTML(),this._editing=!1),void(Object.keys(this.model.selection).length>0&&(this.model.selection={}));if(t.length>0){const e=this.quill.getText(t.index,t.length);this.model.selection={text:e}}else Object.keys(this.model.selection).length>0&&(this.model.selection={})}}),this.quill.root.addEventListener("keydown",t=>{(t.ctrlKey||t.metaKey)&&"Enter"===t.key&&(t.preventDefault(),this.model.on_keyup||(this._editing=!0,this.model.text=this.quill.getSemanticHTML(),this._editing=!1))}),this.model.disabled||this.quill.enable(!this.model.disabled),document.addEventListener("selectionchange",(...t)=>{this.quill.selection.update()})}style_redraw(){this.model.visible&&(this.container.style.visibility="visible");const t=this.quill.clipboard.convert({html:this.model.text});this.quill.setContents(t),this.invalidate_layout()}after_layout(){super.after_layout(),this._layout_toolbar()}}i.QuillInputView=QuillInputView;class QuillInput extends n.HTMLBox{constructor(t){super(t)}static __module__="panel.models.quill";static{this.prototype.default_view=QuillInputView,this.define(({Any:t,Bool:e,Dict:i,Str:l})=>({mode:[l,"toolbar"],on_keyup:[e,!0],placeholder:[l,""],selection:[i(t),{}],text:[l,""],text_input:[l,""],toolbar:[t,null]})),this.override({height:300})}}i.QuillInput=QuillInput},
|
|
236
236
|
"08a22fed1a": function _(t,o,i,e,l){e();const s=t("@bokehjs/models/ui/tooltip"),n=t("@bokehjs/core/build_views"),u=t("@bokehjs/models/widgets/radio_button_group");class RadioButtonGroupView extends u.RadioButtonGroupView{tooltip;*children(){yield*super.children(),null!=this.tooltip&&(yield this.tooltip)}connect_signals(){super.connect_signals();const{tooltip:t}=this.model.properties;this.on_change(t,()=>this.update_tooltip())}async update_tooltip(){null!=this.tooltip&&this.tooltip.remove();const{tooltip:t}=this.model;null!=t&&(this.tooltip=await(0,n.build_view)(t,{parent:this}))}async lazy_initialize(){await super.lazy_initialize();const{tooltip:t}=this.model;null!=t&&(this.tooltip=await(0,n.build_view)(t,{parent:this}))}remove(){this.tooltip?.remove(),super.remove()}render(){super.render();const t=t=>{this.tooltip?.model.setv({visible:t})};let o;this.el.addEventListener("mouseenter",()=>{o=setTimeout(()=>t(!0),this.model.tooltip_delay)}),this.el.addEventListener("mouseleave",()=>{clearTimeout(o),t(!1)})}}i.RadioButtonGroupView=RadioButtonGroupView;class RadioButtonGroup extends u.RadioButtonGroup{static __module__="panel.models.widgets";constructor(t){super(t)}static{this.prototype.default_view=RadioButtonGroupView,this.define(({Nullable:t,Ref:o,Float:i})=>({tooltip:[t(o(s.Tooltip)),null],tooltip_delay:[i,500]}))}}i.RadioButtonGroup=RadioButtonGroup},
|
|
237
|
-
"e74ecd40bb": function _(e,t,s,r,o){r();const n=e("@bokehjs/core/build_views"),i=e("@bokehjs/core/view"),l=e("@bokehjs/core/dom"),d=e("@bokehjs/core/util/array"),a=e("@bokehjs/core/util/assert"),c=e("@bokehjs/core/util/types"),h=e("f3226cbf82");class HostedStyleSheet extends l.InlineStyleSheet{persistent;host_id;constructor(e,t,s=!1,r=""){super(e,t,s),this.persistent=s,this.host_id=r}replace(e,t){e=e.replace(/:host\b/g,`#${this.host_id}`),super.replace(e,t)}prepend(e,t){e=e.replace(/:host\b/g,`#${this.host_id}`),super.prepend(e,t)}append(e,t){e=e.replace(/:host\b/g,`#${this.host_id}`),super.append(e,t)}}async function u(e,t,s){(0,a.assert)(null!=e,"model doesn't implement a view");const r=new e({...s,model:t});return r.initialize(),await r.lazy_initialize(),r}async function m(e,t,s={parent:null},r=e=>e.default_view){const o=(0,d.difference)([...e.keys()],t),n=[];for(const t of o){const s=e.get(t);null!=s&&(e.delete(t),n.push(s))}const i=[],l=t.filter(t=>!e.has(t));for(const t of l){const o=await u(r(t),t,s);e.set(t,o),i.push(o)}for(const e of i)e.connect_signals();return{created:i,removed:n}}s.HostedStyleSheet=HostedStyleSheet;class ReactComponentView extends h.ReactiveESMView{model_getter=h.model_getter;model_setter=h.model_setter;react_root=null;mounted=!1;_force_update_callbacks=[];_mounted_resolve=null;_scheduled_removals=[];_dom_sentinel=null;initialize(){super.initialize(),this.use_shadow_dom||(this.display=new HostedStyleSheet("","display",!1,this.model.id),this.style=new HostedStyleSheet("","style",!1,this.model.id),this.parent_style=new HostedStyleSheet("","parent",!0,this.model.id))}get use_shadow_dom(){return this.model.use_shadow_dom||!(this.parent instanceof ReactComponentView)}render_esm(){if(null===this.model.compiled||null===this.model.render_module||null==this.container)return;this._rendered=!1,this.accessed_properties=[];for(const e of this._lifecycle_handlers.keys())(this._lifecycle_handlers.get(e)||[]).splice(0);this.model.disconnect_watchers(this);const e=new Promise(e=>{this._mounted_resolve=e});this.model.render_module.then(e=>{null!=this.container?this.react_root=Promise.resolve(e.default.render(this)):this._resolve_mounted()}).catch(e=>{throw this._resolve_mounted(),e}),this._await_ready(e)}setup_style_cache(){this.model.root_node?this.style_cache=document.head:(this.style_cache=document.createElement("head"),this.shadow_el.insertBefore(this.style_cache,this.container))}render_error(e){this._resolve_mounted(),super.render_error(e)}_resolve_mounted(){const e=this._mounted_resolve;null!=e&&(this._mounted_resolve=null,e())}on_force_update(e){this._force_update_callbacks.push(e)}force_update(){for(const e of this._force_update_callbacks)e()}remove(){if(this._force_update_callbacks=[],this.mounted=!1,this._resolve_mounted(),this.use_shadow_dom)super.remove(),this.react_root?.then(e=>e?.unmount?.()),this.flush_scheduled_removals();else if(!this.is_destroyed){this._resize_observer.disconnect(),i.View.prototype.remove.call(this),this._applied_stylesheets.forEach(e=>e.uninstall());for(const e of this._lifecycle_handlers.get("remove")||[])e();this._child_callbacks.clear(),this._child_rendered.clear(),this._mounted.clear()}this.react_root=null}get root_view(){let e=this;if(this.use_shadow_dom)return e;for(;e.parent instanceof ReactComponentView;)e=e.parent;return e}_apply_stylesheets(e){const t=e.map(e=>(0,c.isString)(e)?new l.InlineStyleSheet(e):e),s=this.root_view.shadow_el,r=new Set,o=new Set;if(!this.use_shadow_dom){for(const e of s.querySelectorAll("style"))r.add(e.textContent);for(const e of s.querySelectorAll("link"))o.add(e.href)}t.forEach(e=>{if(!this.use_shadow_dom)if(e instanceof l.InlineStyleSheet){if(r.has(e.css))return;r.add(e.css)}else if(e instanceof l.ImportedStyleSheet){const{href:t}=e.el;if(o.has(t))return;o.add(t)}this._applied_stylesheets.push(e),e.install(s)})}render(){this.react_root&&this.react_root.then(e=>e?.unmount?.()),this._force_update_callbacks=[],this.mounted=!1,this._resolve_mounted(),super.render()}r_after_render(){this.model.use_shadow_dom||this._apply_visible(),super.r_after_render(),this.use_shadow_dom&&this._dom_reinserted()&&(this.force_update(),this._mark_dom())}_dom_reinserted(){const e=this._dom_sentinel?.sheet;return null==e||0===e.cssRules.length}_mark_dom(){let e=this._dom_sentinel;null!=e&&e.parentNode===this.shadow_el||(e=document.createElement("style"),this.shadow_el.append(e),this._dom_sentinel=e),e.sheet?.insertRule(":host {}")}_update_layout(){super._update_layout();const e=this._lifecycle_handlers.get("update_layout")||[];for(const t of e)t()}async build_child_views(){const e=this.model.use_shadow_dom?m:n.build_views,{created:t,removed:s}=await e(this._child_views,this.child_models,{parent:this});for(const e of s)this._resize_observer.unobserve(e.el),this.model.use_shadow_dom&&(this._child_rendered.delete(e),t.length?this._scheduled_removals.push(e):e.remove());for(const e of t)this._resize_observer.observe(e.el,{box:"border-box"});return t}async _update_children_pass(){const e=new Set(await this.build_child_views()),t=this._group_new_views(e);for(const e of this.model.children){const s=this._child_callbacks.get(e)||[],r=t.get(e)||[];if(r)for(const e of s)e(r)}this._update_children(),setTimeout(()=>this.flush_scheduled_removals(),0)}flush_scheduled_removals(){const e=this._scheduled_removals;this._scheduled_removals=[];for(const t of e)t.is_destroyed||t.remove()}_on_mounted(){this.invalidate_layout(),this.mounted=!0}has_finished(){return super.has_finished()&&this._rendered}patch_container(e){this.el=this.container=e,this._update_stylesheets(),this.class_list=new l.ClassList(this.container.classList),this._apply_html_attributes()}after_rendered(){const e=this._lifecycle_handlers.get("after_render")||[];for(const t of e)t();if(!this._rendered)for(const e of this._lifecycle_handlers.get("after_layout")||[])e();if(this._rendered=!0,this._mounted_resolve){const e=[];for(const t of this.child_views)e.push(t.ready);e.length>0?Promise.all(e).then(()=>this._resolve_mounted()):this._resolve_mounted()}this.finish()}}s.ReactComponentView=ReactComponentView;const p=["react","react-dom/client","@emotion/cache","@emotion/react"];const f=new WeakMap,v=new WeakMap;let w=0;function y(e){let t=v.get(e);return void 0===t&&(t=w++,v.set(e,t)),t}const b=new WeakMap;function g(e){const t=f.get(e.React);if(null!=t)return t;const{React:s}=e;class Child extends s.PureComponent{render_callback=null;containerRef=s.createRef();constructor(e){super(e),this.state={rendered:null},this._mark_stale()}_mark_stale(){const e=this.view;e&&this.props.parent._child_rendered.set(e,!1)}updateElement(){const e=this.view?.el;e&&this.containerRef.current&&!this.containerRef.current.contains(e)&&(this.containerRef.current.innerHTML="",this.containerRef.current.appendChild(e))}get view(){const e=this.props.model??this.props.parent.model.data[this.props.name];return this.props.parent.get_child_view(e)}get element(){const e=this.view;return null==e?null:e.el}get use_shadow_dom(){return this.view?.model.use_shadow_dom||void 0===this.view?.react_root}_render_nested(e,t){e.patch_container(this.containerRef.current);const s=s=>{e.is_destroyed||(t&&this.props.parent.flush_scheduled_removals(),this.setState({rendered:s.default.render(e)},()=>{e.is_destroyed||(this.props.parent.notify_mount(this.props.name,e.model.id),e.r_after_render(),e.after_rendered())}))},r=e.model.resolved_render_module;null!=r?s(r):e.model.render_module.then(s)}componentDidMount(){const e=this.view;this.render_callback=e=>{const t=this.view;t&&e.includes(t)&&(this.updateElement(),this.use_shadow_dom?(this.props.parent.flush_scheduled_removals(),this.props.parent.render_child(t),this.props.parent._child_rendered.set(t,!0)):this._render_nested(t,!0))},this.props.parent.on_child_render(this.props.name,this.render_callback),null!=e&&(this.props.parent.flush_scheduled_removals(),this.use_shadow_dom?(this.updateElement(),this.props.parent.render_child(e),this.props.parent._child_rendered.set(e,!0),this.props.parent.notify_mount(this.props.name,e.model.id)):this._render_nested(e,!1))}componentWillUnmount(){this.render_callback&&this.props.parent.remove_on_child_render(this.props.name,this.render_callback);const e=this.view?.model.id??this.props.id;null!=e&&this.props.parent.notify_mount(this.props.name,e,!0)}getSnapshotBeforeUpdate(){return this._mark_stale(),null}componentDidUpdate(){this.use_shadow_dom&&this.updateElement()}render(){const e=this.use_shadow_dom?"child-wrapper":function(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}(this.view.model.class_name);return s.createElement("div",{id:this.view?.model.id,className:e,ref:this.containerRef},this.state.rendered)}}class ErrorBoundary extends s.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.view.render_error(e)}render(){return this.state.hasError?s.createElement("div"):s.createElement("div",{className:"error-wrapper"},this.props.children)}}const r={Child,ErrorBoundary,Component:k(s,ErrorBoundary,null,null),emotion_components:new WeakMap};return f.set(s,r),r}function k(e,t,s,r){return class Component extends e.Component{constructor(e){super(e),this._init_cache()}_init_cache(){const{view:e}=this.props;null!=s&&e.use_shadow_dom&&(e.mui_cache=function(e,t){let s=b.get(t);null==s&&(s=new Map,b.set(t,s));const r=s,o=e.insert;return e.insert=(t,s,n,i)=>{const l=`${t}\0${s.name}`,d=r.get(l);if(null==d){const e=[];return o(t,s,{insert:t=>{e.push(t),n.insert(t)}},i),void r.set(l,e)}for(const e of d)n.insert(e);i&&(e.inserted[s.name]=!0)},e}(s({key:"pnl",prepend:!0,container:e.style_cache}),s))}componentDidMount(){const{view:e}=this.props;e.use_shadow_dom&&(e.on_force_update(()=>{this._init_cache(),this.forceUpdate()}),e.after_rendered())}render(){const{view:s}=this.props;let o=e.createElement(s.render_fn,this.props);return s.model.dev&&(o=e.createElement(t,{view:s},o)),null!=r&&o&&(void 0===s.parent?.react_root||s.model.use_shadow_dom)&&(o=e.createElement(r,{value:s.mui_cache},o)),o}}}function R(e,t,s){const{React:r}=t,o=new Proxy(e,{get:(e,t)=>"useMount"===t?t=>r.useEffect(()=>(e.model_proxy.on("lifecycle:mounted",t),()=>e.model_proxy.off("lifecycle:mounted",t)),[]):"useState"===t?t=>{const s=t.split(".");let n=e.model.data;for(let e=0;e<s.length-1;e++){if(!(n&&n.properties&&s[e]in n.properties)){n=null;break}n=n[s[e]]}const i=s[s.length-1];if(null==n||null==n.attributes||!(i in n.attributes))throw ReferenceError(`Could not resolve ${t} on ${e.model.class_name}`);const[l,d]=r.useState(n.attributes[i]);r.useEffect(()=>{const s=()=>{e.model.events.includes(i)?n.attributes[i]&&(d(e=>e+1)||n.setv({[i]:!1})):d(n.attributes[i])};return o.on(t,s,!0),()=>o.off(t,s)},[]);const a=r.useRef(!1);return r.useEffect(()=>{!e.model.events.includes(i)&&a.current?n.setv({[i]:l}):a.current=!0},[l]),[l,d]}:"get_child"===t?t=>{const o=e.model.data,n=o.attributes[t];if(!(0,c.isArray)(n))return r.createElement(s,{parent:e,name:t});const[i,l]=r.useState(()=>n.map(o=>r.createElement(s,{parent:e,name:t,key:o.id,id:o.id,model:o})));return r.useEffect(()=>{const n=()=>{const n=o.attributes[t];l(o=>o.length===n.length&&n.every((e,t)=>e.id===o[t].props.id)?o:n.map(o=>r.createElement(s,{parent:e,name:t,key:o.id,id:o.id,model:o})))};return e.on_child_render(t,n),()=>e.remove_on_child_render(t,n)},[]),i}:(0,h.model_getter)(e,t),set:h.model_setter});return o}function S(e){return null!=e.createCache&&null!=e.CacheProvider}function E(e,t){if(e.is_destroyed)return null;S(t)&&null!=e.container&&e.setup_style_cache();const{React:s,createRoot:r}=t,{Child:o}=g(t),n=function(e){const t=g(e),{createCache:s,CacheProvider:r}=e;if(!S(e))return t.Component;let o=t.emotion_components.get(s);return null==o&&(o=k(e.React,t.ErrorBoundary,s,r),t.emotion_components.set(s,o)),o}(t),i={view:e,model:R(e,t,o),data:e.model.data,el:e.container},l=s.createElement(n,{...i,key:y(e)});if(!e.model.use_shadow_dom&&void 0!==e.parent?.react_root)return l;let d;if(e.model.root_node)d=document.querySelector(e.model.root_node),null==d&&(d=document.createElement("div"),d.id=e.model.root_node.replace("#",""),document.body.append(d));else{if(null==e.container)return e._resolve_mounted(),null;d=e.container}const a=r(d);try{a.render(l)}catch(t){e._resolve_mounted(),e.render_error(t)}return a}class ReactComponent extends h.ReactiveESM{sucrase_transforms=["typescript","jsx"];constructor(e){super(e)}get usesMui(){return!!this.importmap?.imports&&Object.keys(this.importmap?.imports).some(e=>e.startsWith("@mui"))}get _render_cache_key(){if(this.bundle)return`react-${this.usesMui}-${this._module_cache_key}`;const e=this.importmap?.imports??{},t=p.map(t=>e[t]??"").join("|");return`react-${this.usesMui}-${t}`}_render_module(){return this._cached_module(this._render_cache_key,async()=>{let e;if(this.bundle){const t=await this._cached_module(this._module_cache_key,()=>Promise.resolve(null));e=t.default}else e=(await this._import_source((t=this.usesMui,t?'\nimport * as React from "react"\nimport { createRoot } from "react-dom/client"\nimport createCache from "@emotion/cache"\nimport { CacheProvider } from "@emotion/react"\nexport default {React, createRoot, createCache, CacheProvider}':'\nimport * as React from "react"\nimport { createRoot } from "react-dom/client"\nexport default {React, createRoot}'))).default;var t;return{default:{render:t=>E(t,e)}}})}compile(){const e=super.compile();return this.bundle?e:null!==e&&e.includes("React")?`\nimport * as React from "react"\n\n${e}`:e}static __module__="panel.models.esm";static{this.prototype.default_view=ReactComponentView,this.define(({Bool:e,Nullable:t,Str:s})=>({root_node:[t(s),null],use_shadow_dom:[e,!0]})),this.override({render_policy:"manual"})}}s.ReactComponent=ReactComponent},
|
|
238
|
-
"61cc258c24": function _(e,t,n,s,i){s();const o=e("ed32986312"),r=e("691acbd345"),l=e("b3f51db71c"),c=e("@bokehjs/core/dom"),a=e("@bokehjs/core/util/assert"),d=e("@bokehjs/core/util/iterator"),h=e("@bokehjs/core/util/types"),u=e("@bokehjs/core/util/object"),f=e("@bokehjs/model"),p=e("@bokehjs/models/ui/ui_element"),m=e("be689f0377"),v=e("e5a0036205"),$=e("9012c2f5ae"),g=e("00beb93e38"),b=e("aa07eb54cc");function w(e,t,n){const s=new Map;for(const e of n)s.set(`{${e}}`,"(.*)");const i=[];let o=`^${r=e,r.replace(/[-\/\\^$*+?.()|[\]]/g,"\\$&")}$`;var r;let l,c,a;for(const[t,n]of s)if(c=e.indexOf(t),c>-1){for(o=o.replace(t,n),a={index:c,token:t},l=0;l<i.length&&i[l].index<c;l++);l<i.length?i.splice(l,0,a):i.push(a)}o=o.replace(/\{[^{}]+\}/g,".*");const d=new RegExp(o).exec(t);if(null!=d){const e={};for(l=0;l<i.length;l++)e[i[l].token.slice(1,-1)]=d[l+1];return e}return null}function y(e,t){let n=e.getElementById(t);return null==n&&(n=document.getElementById(t)),n}class ReactiveHTMLView extends g.HTMLBoxView{html;container;_changing=!1;_event_listeners=new Map;_mutation_observers=[];_script_fns=new Map;_state={};initialize(){super.initialize(),this.html=(0,$.html_decode)(this.model.html)??this.model.html}_recursive_connect(e,t,n){for(const s of e){const e=0!=n.length?`${n}.${s.attr}`:s.attr,i=s.get_value();null!=i&&(i instanceof f.Model&&this._recursive_connect(i,!0,e),this.on_change(s,()=>{if(t)for(const[e,t]of(0,u.entries)(this.model.children))if(t==s.attr){let t=s.get_value();return(0,h.isArray)(t)||(t=[t]),void this._render_node(e,t)}this._changing||this._update(e)}))}}connect_signals(){super.connect_signals();const{children:e,events:t}=this.model.properties;this.on_change(e,async()=>{this.html=(0,$.html_decode)(this.model.html)??this.model.html,await this.build_child_views(),this.invalidate_render()}),this._recursive_connect(this.model.data,!0,""),this.on_change(t,()=>{this._remove_event_listeners(),this._setup_event_listeners()}),this.connect_scripts()}connect_scripts(){const{id:e}=this.model.data;for(const[t,n]of(0,u.entries)(this.model.scripts)){let s,i=this.model.data;if(t.includes(".")){const e=t.split(".");s=e[e.length-1];for(const t of e.slice(0,-1)){const e=i.property(t).get_value();(0,a.assert)(e instanceof f.Model),i=e}}else s=t;for(const o of n){const n=(0,$.html_decode)(o)??o,r=this._render_script(n,e);if(this._script_fns.set(t,r),!(s in i.properties))continue;const l=i.property(s),c=this.model.event_params.includes(t);this.on_change(l,()=>{this._changing||c&&!i.property(t).get_value()||(this.run_script(t),c&&i.setv({[t]:!1}))})}}}run_script(e,t=!1){const n=this._script_fns.get(e);if(void 0===n)return void(t||console.warn(`Script '${e}' could not be found.`));const s={get_records(e,t){return this.get_records(e,t)}};for(const e of this._script_fns.keys())s[e]=()=>this.run_script(e);return n(this.model,this.model.data,this._state,this,e=>this.run_script(e),s)}get_records(e,t=!0){return(0,m.dict_to_records)(this.model.data.property(e),t)}disconnect_signals(){super.disconnect_signals(),this._remove_event_listeners(),this._remove_mutation_observers()}remove(){this.run_script("remove",!0),super.remove()}get child_models(){const e=[];for(const[t,n]of(0,u.entries)(this.model.children))for(const t of n)(0,h.isString)(t)||e.push(t);return e}_after_layout(){this.run_script("after_layout",!0)}render(){this.empty(),this._update_stylesheets(),this._update_css_classes(),this._apply_styles(),this._apply_visible(),this.container=(0,c.div)({style:{display:"contents"}}),this.shadow_el.append(this.container),this._update(),this._render_children(),this._setup_mutation_observers(),this._setup_event_listeners(),this.run_script("render",!0)}_send_event(e,t,n){const s=(0,b.convertUndefined)((0,v.serializeEvent)(n));s.type=t,this.model.trigger_event(new $.DOMEvent(e,s))}_render_child(e,t){if((0,h.isString)(e))t.innerHTML=(0,$.html_decode)(e)??e;else{const n=this._child_views.get(e);null==n?t.innerHTML="":(t.appendChild(n.el),n.render(),n.r_after_render())}}_render_node(e,t){const{id:n}=this.model.data;if(this.model.looped.includes(e))for(const[s,i]of(0,d.enumerate)(t)){const t=`${e}-${i}-${n}`,o=y(this.shadow_el,t);null!=o?this._render_child(s,o):console.warn(`DOM node '${t}' could not be found. Cannot render children.`)}else{const s=`${e}-${n}`,i=y(this.shadow_el,s);if(null==i)return void console.warn(`DOM node '${s}' could not be found. Cannot render children.`);for(const e of t)this._render_child(e,i)}}_render_children(){for(const[e,t]of(0,u.entries)(this.model.children)){const n=(()=>{if(!(0,h.isString)(t))return t;{const e=this.model.data.property(t).get_value();if((0,h.isString)(e))return[e];if((0,h.isArray)(e))return e;(0,a.unreachable)()}})();this._render_node(e,n)}}_render_html(e,t={}){let n=e.replace(/[`]/g,"\\$&"),s="";const i=[];for(const[e,t]of(0,u.entries)(this.model.callbacks))for(const[o,r]of t){let t;if(n=n.replaceAll(`\${${r}}`,`$--{${r}}`),r.startsWith("script(")){const e=r.replace("('","_").replace("')","").replace('("',"_").replace('")',"").replace("-","_"),s=e.replaceAll("script_","");n=n.replaceAll(r,e),t=`\n const ${e} = (event) => {\n view._state.event = event\n view.run_script("${s}")\n delete view._state.event\n }\n `}else t=`\n const ${r} = (event) => {\n let elname = "${e}"\n if (RegExp("{{.*loop.index.*}}").test(elname)) {\n const pattern = RegExp(elname.replace(/{{(.+?)}}/g, String.fromCharCode(92) + "d+"))\n for (const p of event.path) {\n if (pattern.exec(p.id) != null) {\n elname = p.id.split("-").slice(null, -1).join("-")\n break\n }\n }\n }\n view._send_event(elname, "${o}", event)\n }\n `;i.indexOf(r)>-1||(i.push(r),s+=t)}return n=n.replaceAll("${model.","$-{model.").replaceAll("${","${data.").replaceAll("$-{model.","${model.").replaceAll("$--{","${"),new Function("view, model, data, state, html, useCallback",`${s}return html\`${n}\`;`)(this,this.model,this.model.data,t,l.html,r.useCallback)}_render_script(e,t){const n=[];for(const s of this.model.nodes){const i=s.replace("-","_");if(!e.includes(i))continue;const o=`\n let ${i} = view.shadow_el.getElementById('${s}-${t}')\n if (${i} == null) {\n ${i} = document.getElementById('${s}-${t}')\n }\n if (${i} == null) {\n console.warn("DOM node '${s}' could not be found. Cannot execute callback.")\n return\n }\n `;n.push(o)}return n.push("\n let event = null\n if (state.event !== undefined) {\n event = state.event\n }\n "),n.push(e),new Function("model, data, state, view, script, self",n.join("\n"))}_remove_mutation_observers(){for(const e of this._mutation_observers)e.disconnect();this._mutation_observers=[]}_setup_mutation_observers(){const{id:e}=this.model.data;for(const t of(0,u.keys)(this.model.attrs)){const n=y(this.shadow_el,`${t}-${e}`);if(null==n){console.warn(`DOM node '${t}-${e}' could not be found. Cannot set up MutationObserver.`);continue}const s=new MutationObserver(()=>{this._update_model(n,t)});s.observe(n,{attributes:!0}),this._mutation_observers.push(s)}}_remove_event_listeners(){const{id:e}=this.model.data;for(const[t,n]of this._event_listeners){const s=y(this.shadow_el,`${t}-${e}`);if(null!=s)for(const[e,t]of n)s.removeEventListener(e,t)}this._event_listeners.clear()}_setup_event_listeners(){const{id:e}=this.model.data,t=(0,u.dict)(this.model.attrs);for(const[n,s]of(0,u.entries)(this.model.events)){const i=y(this.shadow_el,`${n}-${e}`);if(null!=i)for(const[e,o]of(0,u.entries)(s)){const s=s=>{this._send_event(n,e,s),t.has(n)&&o&&this._update_model(i,n)};i.addEventListener(e,s);let r=this._event_listeners.get(n);void 0===r&&this._event_listeners.set(n,r=new Map),r.set(e,s)}else console.warn(`DOM node '${n}-${e}' could not be found. Cannot subscribe to DOM events.`)}}_update(e=null){if(null==e||this.html.includes(`\${${e}}`)){const e=this._render_html(this.html);if(null==e)return;try{this._changing=!0,(0,o.render)(e,this.container)}finally{this._changing=!1}}}_update_model(e,t){if(this._changing)return;const n=(0,u.dict)(this.model.attrs).get(t)??[],s={};for(const i of n){const[n,o,r]=i;let l="children"==n?e.innerHTML:e[n];if(1===o.length&&`{${o[0]}}`===r)s[o[0]]=l;else if((0,h.isString)(l))if(l=w(r,l,o),null==l)console.warn(`Could not resolve parameters in ${t} element ${n} attribute value ${l}.`);else for(const[e,i]of(0,u.entries)(l))void 0===i?console.warn(`Could not resolve ${e} in ${t} element ${n} attribute value ${l}.`):s[e]=i}try{this._changing=!0,this.model.data.setv(function(e){const t={};for(const[n,s]of(0,u.entries)(e)){const e=(()=>{if((0,h.isString)(s)){if(!(""===s||"NaN"!==s&&isNaN(Number(s))))return Number(s);if("false"===s||"true"===s)return"true"===s}return s})();t[n]=e}return t}(s))}catch{console.error("Could not serialize",s)}finally{this._changing=!1}}}n.ReactiveHTMLView=ReactiveHTMLView;class ReactiveHTML extends g.HTMLBox{constructor(e){super(e)}static __module__="panel.models.reactive_html";static{this.prototype.default_view=ReactiveHTMLView,this.define(({Bool:e,Str:t,List:n,Dict:s,Tuple:i,Or:o,Ref:r})=>({attrs:[s(n(i(t,n(t),t))),{}],callbacks:[s(n(i(t,t))),{}],children:[s(o(n(o(r(p.UIElement),t)),t)),{}],data:[r(f.Model)],event_params:[n(t),[]],events:[s(s(e)),{}],html:[t,""],looped:[n(t),[]],nodes:[n(t),[]],scripts:[s(n(t)),{}]}))}}n.ReactiveHTML=ReactiveHTML},
|
|
237
|
+
"da0e69965d": function _(e,t,s,r,o){r();const n=e("@bokehjs/core/build_views"),i=e("@bokehjs/core/view"),l=e("@bokehjs/core/dom"),d=e("@bokehjs/core/util/array"),a=e("@bokehjs/core/util/assert"),c=e("@bokehjs/core/util/types"),h=e("8e484b67b0");class HostedStyleSheet extends l.InlineStyleSheet{persistent;host_id;constructor(e,t,s=!1,r=""){super(e,t,s),this.persistent=s,this.host_id=r}replace(e,t){e=e.replace(/:host\b/g,`#${this.host_id}`),super.replace(e,t)}prepend(e,t){e=e.replace(/:host\b/g,`#${this.host_id}`),super.prepend(e,t)}append(e,t){e=e.replace(/:host\b/g,`#${this.host_id}`),super.append(e,t)}}async function u(e,t,s){(0,a.assert)(null!=e,"model doesn't implement a view");const r=new e({...s,model:t});return r.initialize(),await r.lazy_initialize(),r}async function m(e,t,s={parent:null},r=e=>e.default_view){const o=(0,d.difference)([...e.keys()],t),n=[];for(const t of o){const s=e.get(t);null!=s&&(e.delete(t),n.push(s))}const i=[],l=t.filter(t=>!e.has(t));for(const t of l){const o=await u(r(t),t,s);e.set(t,o),i.push(o)}for(const e of i)e.connect_signals();return{created:i,removed:n}}s.HostedStyleSheet=HostedStyleSheet;class ReactComponentView extends h.ReactiveESMView{model_getter=h.model_getter;model_setter=h.model_setter;react_root=null;mounted=!1;_force_update_callbacks=[];_mounted_resolve=null;_scheduled_removals=[];_dom_sentinel=null;initialize(){super.initialize(),this.use_shadow_dom||(this.display=new HostedStyleSheet("","display",!1,this.model.id),this.style=new HostedStyleSheet("","style",!1,this.model.id),this.parent_style=new HostedStyleSheet("","parent",!0,this.model.id))}get use_shadow_dom(){return this.model.use_shadow_dom||!(this.parent instanceof ReactComponentView)}render_esm(){if(this.is_destroyed||null===this.model.compiled||null===this.model.render_module||null==this.container)return;this._rendered=!1,this.accessed_properties=[];for(const e of this._lifecycle_handlers.keys())(this._lifecycle_handlers.get(e)||[]).splice(0);this.model.disconnect_watchers(this);const e=new Promise(e=>{this._mounted_resolve=e});this.model.render_module.then(e=>{null!=this.container?this.react_root=Promise.resolve(e.default.render(this)):this._resolve_mounted()}).catch(e=>{throw this._resolve_mounted(),e}),this._await_ready(e)}setup_style_cache(){this.model.root_node?this.style_cache=document.head:(this.style_cache=document.createElement("head"),this.shadow_el.insertBefore(this.style_cache,this.container))}render_error(e){this._resolve_mounted(),super.render_error(e)}_resolve_mounted(){const e=this._mounted_resolve;null!=e&&(this._mounted_resolve=null,e())}on_force_update(e){this._force_update_callbacks.push(e)}force_update(){for(const e of this._force_update_callbacks)e()}remove(){if(this._force_update_callbacks=[],this.mounted=!1,this._resolve_mounted(),this.use_shadow_dom)super.remove(),this.react_root?.then(e=>e?.unmount?.()),this.flush_scheduled_removals();else if(!this.is_destroyed){this._resize_observer.disconnect(),i.View.prototype.remove.call(this),this._applied_stylesheets.forEach(e=>e.uninstall());for(const e of this._lifecycle_handlers.get("remove")||[])e();this._child_callbacks.clear(),this._child_rendered.clear(),this._mounted.clear()}this.react_root=null}get root_view(){let e=this;if(this.use_shadow_dom)return e;for(;e.parent instanceof ReactComponentView;)e=e.parent;return e}_apply_stylesheets(e){const t=e.map(e=>(0,c.isString)(e)?new l.InlineStyleSheet(e):e),s=this.root_view.shadow_el,r=new Set,o=new Set;if(!this.use_shadow_dom){for(const e of s.querySelectorAll("style"))r.add(e.textContent);for(const e of s.querySelectorAll("link"))o.add(e.href)}t.forEach(e=>{if(!this.use_shadow_dom)if(e instanceof l.InlineStyleSheet){if(r.has(e.css))return;r.add(e.css)}else if(e instanceof l.ImportedStyleSheet){const{href:t}=e.el;if(o.has(t))return;o.add(t)}this._applied_stylesheets.push(e),e.install(s)})}render(){this.react_root&&this.react_root.then(e=>e?.unmount?.()),this._force_update_callbacks=[],this.mounted=!1,this._resolve_mounted(),super.render()}r_after_render(){this.model.use_shadow_dom||this._apply_visible(),super.r_after_render(),this.use_shadow_dom&&this._dom_reinserted()&&(this.force_update(),this._mark_dom())}_dom_reinserted(){const e=this._dom_sentinel?.sheet;return null==e||0===e.cssRules.length}_mark_dom(){let e=this._dom_sentinel;null!=e&&e.parentNode===this.shadow_el||(e=document.createElement("style"),this.shadow_el.append(e),this._dom_sentinel=e),e.sheet?.insertRule(":host {}")}_update_layout(){super._update_layout();const e=this._lifecycle_handlers.get("update_layout")||[];for(const t of e)t()}async build_child_views(){const e=this.model.use_shadow_dom?m:n.build_views,{created:t,removed:s}=await e(this._child_views,this.child_models,{parent:this});for(const e of s)this._resize_observer.unobserve(e.el),this.model.use_shadow_dom&&(this._child_rendered.delete(e),t.length?this._scheduled_removals.push(e):e.remove());for(const e of t)this._resize_observer.observe(e.el,{box:"border-box"});return t}async _update_children_pass(){const e=new Set(await this.build_child_views()),t=this._group_new_views(e);for(const e of this.model.children){const s=this._child_callbacks.get(e)||[],r=t.get(e)||[];if(r)for(const e of s)e(r)}this._update_children(),setTimeout(()=>this.flush_scheduled_removals(),0)}flush_scheduled_removals(){const e=this._scheduled_removals;this._scheduled_removals=[];for(const t of e)t.is_destroyed||t.remove()}_on_mounted(){this.invalidate_layout(),this.mounted=!0}has_finished(){return super.has_finished()&&this._rendered}patch_container(e){this.el=this.container=e,this._update_stylesheets(),this.class_list=new l.ClassList(this.container.classList),this._apply_html_attributes()}after_rendered(){const e=this._lifecycle_handlers.get("after_render")||[];for(const t of e)t();if(!this._rendered)for(const e of this._lifecycle_handlers.get("after_layout")||[])e();if(this._rendered=!0,this._mounted_resolve){const e=[];for(const t of this.child_views)e.push(t.ready);e.length>0?Promise.all(e).then(()=>this._resolve_mounted()):this._resolve_mounted()}this.finish()}}s.ReactComponentView=ReactComponentView;const p=["react","react-dom/client","@emotion/cache","@emotion/react"];const f=new WeakMap,v=new WeakMap;let w=0;function y(e){let t=v.get(e);return void 0===t&&(t=w++,v.set(e,t)),t}const b=new WeakMap;function g(e){const t=f.get(e.React);if(null!=t)return t;const{React:s}=e;class Child extends s.PureComponent{render_callback=null;containerRef=s.createRef();constructor(e){super(e),this.state={rendered:null},this._mark_stale()}_mark_stale(){const e=this.view;e&&this.props.parent._child_rendered.set(e,!1)}updateElement(){const e=this.view?.el;e&&this.containerRef.current&&!this.containerRef.current.contains(e)&&(this.containerRef.current.innerHTML="",this.containerRef.current.appendChild(e))}get view(){const e=this.props.model??this.props.parent.model.data[this.props.name];return this.props.parent.get_child_view(e)}get element(){const e=this.view;return null==e?null:e.el}get use_shadow_dom(){return this.view?.model.use_shadow_dom||void 0===this.view?.react_root}_render_nested(e,t){e.patch_container(this.containerRef.current);const s=s=>{e.is_destroyed||(t&&this.props.parent.flush_scheduled_removals(),this.setState({rendered:s.default.render(e)},()=>{e.is_destroyed||(this.props.parent.notify_mount(this.props.name,e.model.id),e.r_after_render(),e.after_rendered())}))},r=e.model.resolved_render_module;null!=r?s(r):e.model.render_module.then(s)}componentDidMount(){const e=this.view;this.render_callback=e=>{const t=this.view;t&&e.includes(t)&&(this.updateElement(),this.use_shadow_dom?(this.props.parent.flush_scheduled_removals(),this.props.parent.render_child(t),this.props.parent._child_rendered.set(t,!0)):this._render_nested(t,!0))},this.props.parent.on_child_render(this.props.name,this.render_callback),null!=e&&(this.props.parent.flush_scheduled_removals(),this.use_shadow_dom?(this.updateElement(),this.props.parent.render_child(e),this.props.parent._child_rendered.set(e,!0),this.props.parent.notify_mount(this.props.name,e.model.id)):this._render_nested(e,!1))}componentWillUnmount(){this.render_callback&&this.props.parent.remove_on_child_render(this.props.name,this.render_callback);const e=this.view?.model.id??this.props.id;null!=e&&this.props.parent.notify_mount(this.props.name,e,!0)}getSnapshotBeforeUpdate(){return this._mark_stale(),null}componentDidUpdate(){this.use_shadow_dom&&this.updateElement()}render(){const e=this.use_shadow_dom?"child-wrapper":function(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}(this.view.model.class_name);return s.createElement("div",{id:this.view?.model.id,className:e,ref:this.containerRef},this.state.rendered)}}class ErrorBoundary extends s.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.view.render_error(e)}render(){return this.state.hasError?s.createElement("div"):s.createElement("div",{className:"error-wrapper"},this.props.children)}}const r={Child,ErrorBoundary,Component:k(s,ErrorBoundary,null,null),emotion_components:new WeakMap};return f.set(s,r),r}function k(e,t,s,r){return class Component extends e.Component{constructor(e){super(e),this._init_cache()}_init_cache(){const{view:e}=this.props;null!=s&&e.use_shadow_dom&&(e.mui_cache=function(e,t){let s=b.get(t);null==s&&(s=new Map,b.set(t,s));const r=s,o=e.insert;return e.insert=(t,s,n,i)=>{const l=`${t}\0${s.name}`,d=r.get(l);if(null==d){const e=[];return o(t,s,{insert:t=>{e.push(t),n.insert(t)}},i),void r.set(l,e)}for(const e of d)n.insert(e);i&&(e.inserted[s.name]=!0)},e}(s({key:"pnl",prepend:!0,container:e.style_cache}),s))}componentDidMount(){const{view:e}=this.props;e.use_shadow_dom&&(e.on_force_update(()=>{this._init_cache(),this.forceUpdate()}),e.after_rendered())}render(){const{view:s}=this.props;let o=e.createElement(s.render_fn,this.props);return s.model.dev&&(o=e.createElement(t,{view:s},o)),null!=r&&o&&(void 0===s.parent?.react_root||s.model.use_shadow_dom)&&(o=e.createElement(r,{value:s.mui_cache},o)),o}}}function S(e){const t=new Set;return e.filter(e=>!t.has(e.id)&&(t.add(e.id),!0))}function R(e,t){const s=e.property(t);return s.is_unset?void 0:s.get_value()}function C(e,t,s){const{React:r}=t,o=new Proxy(e,{get:(e,t)=>"useMount"===t?t=>r.useEffect(()=>(e.model_proxy.on("lifecycle:mounted",t),()=>e.model_proxy.off("lifecycle:mounted",t)),[]):"useState"===t?t=>{const s=t.split(".");let n=e.model.data;for(let e=0;e<s.length-1;e++){if(!(n&&n.properties&&s[e]in n.properties)){n=null;break}n=n[s[e]]}const i=s[s.length-1];if(null==n||null==n.attributes||!(i in n.attributes))throw ReferenceError(`Could not resolve ${t} on ${e.model.class_name}`);return e.model.events.includes(i)?function(e,t,s,r,o){const[n,i]=e.useState(()=>R(r,o));return e.useEffect(()=>{const e=()=>{R(r,o)&&(i(e=>e+1),r.setv({[o]:!1}))};return t.on(s,e,!0),()=>t.off(s,e)},[r,s]),[n,i]}(r,o,t,n,i):function(e,t,s,r,o){const n=e.useCallback(e=>(t.on(s,e,!0),()=>t.off(s,e)),[r,s]);return[e.useSyncExternalStore(n,()=>R(r,o)),e.useCallback(e=>{const t=R(r,o),s="function"==typeof e?e(t):e;Object.is(s,t)||r.setv({[o]:s})},[r,o])]}(r,o,t,n,i)}:"get_child"===t?t=>{const o=e.model.data,n=o.attributes[t];if(!(0,c.isArray)(n))return r.createElement(s,{parent:e,name:t});const[i,l]=r.useState(()=>S(n).map(o=>r.createElement(s,{parent:e,name:t,key:o.id,id:o.id,model:o})));return r.useEffect(()=>{const n=()=>{const n=S(o.attributes[t]);l(o=>o.length===n.length&&n.every((e,t)=>e.id===o[t].props.id)?o:n.map(o=>r.createElement(s,{parent:e,name:t,key:o.id,id:o.id,model:o})))};return e.on_child_render(t,n),()=>e.remove_on_child_render(t,n)},[]),i}:(0,h.model_getter)(e,t),set:h.model_setter});return o}function E(e){return null!=e.createCache&&null!=e.CacheProvider}function x(e,t){if(e.is_destroyed)return null;E(t)&&null!=e.container&&e.setup_style_cache();const{React:s,createRoot:r}=t,{Child:o}=g(t),n=function(e){const t=g(e),{createCache:s,CacheProvider:r}=e;if(!E(e))return t.Component;let o=t.emotion_components.get(s);return null==o&&(o=k(e.React,t.ErrorBoundary,s,r),t.emotion_components.set(s,o)),o}(t),i={view:e,model:C(e,t,o),data:e.model.data,el:e.container},l=s.createElement(n,{...i,key:y(e)});if(!e.model.use_shadow_dom&&void 0!==e.parent?.react_root)return l;let d;if(e.model.root_node)d=document.querySelector(e.model.root_node),null==d&&(d=document.createElement("div"),d.id=e.model.root_node.replace("#",""),document.body.append(d));else{if(null==e.container)return e._resolve_mounted(),null;d=e.container}const a=r(d);try{a.render(l)}catch(t){e._resolve_mounted(),e.render_error(t)}return a}class ReactComponent extends h.ReactiveESM{sucrase_transforms=["typescript","jsx"];constructor(e){super(e)}get usesMui(){return!!this.importmap?.imports&&Object.keys(this.importmap?.imports).some(e=>e.startsWith("@mui"))}get _render_cache_key(){if(this.bundle)return`react-${this.usesMui}-${this._module_cache_key}`;const e=this.importmap?.imports??{},t=p.map(t=>e[t]??"").join("|");return`react-${this.usesMui}-${t}`}_render_module(){return this._cached_module(this._render_cache_key,async()=>{let e;if(this.bundle){const t=await this._cached_module(this._module_cache_key,()=>Promise.resolve(null));e=t.default}else e=(await this._import_source((t=this.usesMui,t?'\nimport * as React from "react"\nimport { createRoot } from "react-dom/client"\nimport createCache from "@emotion/cache"\nimport { CacheProvider } from "@emotion/react"\nexport default {React, createRoot, createCache, CacheProvider}':'\nimport * as React from "react"\nimport { createRoot } from "react-dom/client"\nexport default {React, createRoot}'))).default;var t;return{default:{render:t=>x(t,e)}}})}compile(){const e=super.compile();return this.bundle?e:null!==e&&e.includes("React")?`\nimport * as React from "react"\n\n${e}`:e}static __module__="panel.models.esm";static{this.prototype.default_view=ReactComponentView,this.define(({Bool:e,Nullable:t,Str:s})=>({root_node:[t(s),null],use_shadow_dom:[e,!0]})),this.override({render_policy:"manual"})}}s.ReactComponent=ReactComponent},
|
|
238
|
+
"44b7d77ba5": function _(e,t,n,s,i){s();const o=e("ed32986312"),r=e("691acbd345"),l=e("b3f51db71c"),c=e("@bokehjs/core/dom"),a=e("@bokehjs/core/util/assert"),d=e("@bokehjs/core/util/iterator"),h=e("@bokehjs/core/util/types"),u=e("@bokehjs/core/util/object"),f=e("@bokehjs/model"),p=e("@bokehjs/models/ui/ui_element"),m=e("ce212d2be6"),v=e("e5a0036205"),g=e("e40e09e4dd"),$=e("00beb93e38"),b=e("aa07eb54cc");function w(e,t,n){const s=new Map;for(const e of n)s.set(`{${e}}`,"(.*)");const i=[];let o=`^${r=e,r.replace(/[-\/\\^$*+?.()|[\]]/g,"\\$&")}$`;var r;let l,c,a;for(const[t,n]of s)if(c=e.indexOf(t),c>-1){for(o=o.replace(t,n),a={index:c,token:t},l=0;l<i.length&&i[l].index<c;l++);l<i.length?i.splice(l,0,a):i.push(a)}o=o.replace(/\{[^{}]+\}/g,".*");const d=new RegExp(o).exec(t);if(null!=d){const e={};for(l=0;l<i.length;l++)e[i[l].token.slice(1,-1)]=d[l+1];return e}return null}function y(e,t){let n=e.getElementById(t);return null==n&&(n=document.getElementById(t)),n}class ReactiveHTMLView extends $.HTMLBoxView{html;container;_changing=!1;_event_listeners=new Map;_mutation_observers=[];_script_fns=new Map;_state={};initialize(){super.initialize(),this.html=(0,g.html_decode)(this.model.html)??this.model.html}_recursive_connect(e,t,n){for(const s of e){const e=0!=n.length?`${n}.${s.attr}`:s.attr,i=s.get_value();null!=i&&(i instanceof f.Model&&this._recursive_connect(i,!0,e),this.on_change(s,()=>{if(t)for(const[e,t]of(0,u.entries)(this.model.children))if(t==s.attr){let t=s.get_value();return(0,h.isArray)(t)||(t=[t]),void this._render_node(e,t)}this._changing||this._update(e)}))}}connect_signals(){super.connect_signals();const{children:e,events:t}=this.model.properties;this.on_change(e,async()=>{this.html=(0,g.html_decode)(this.model.html)??this.model.html,await this.build_child_views(),this.invalidate_render()}),this._recursive_connect(this.model.data,!0,""),this.on_change(t,()=>{this._remove_event_listeners(),this._setup_event_listeners()}),this.connect_scripts()}connect_scripts(){const{id:e}=this.model.data;for(const[t,n]of(0,u.entries)(this.model.scripts)){let s,i=this.model.data;if(t.includes(".")){const e=t.split(".");s=e[e.length-1];for(const t of e.slice(0,-1)){const e=i.property(t).get_value();(0,a.assert)(e instanceof f.Model),i=e}}else s=t;for(const o of n){const n=(0,g.html_decode)(o)??o,r=this._render_script(n,e);if(this._script_fns.set(t,r),!(s in i.properties))continue;const l=i.property(s),c=this.model.event_params.includes(t);this.on_change(l,()=>{this._changing||c&&!i.property(t).get_value()||(this.run_script(t),c&&i.setv({[t]:!1}))})}}}run_script(e,t=!1){const n=this._script_fns.get(e);if(void 0===n)return void(t||console.warn(`Script '${e}' could not be found.`));const s={get_records(e,t){return this.get_records(e,t)}};for(const e of this._script_fns.keys())s[e]=()=>this.run_script(e);return n(this.model,this.model.data,this._state,this,e=>this.run_script(e),s)}get_records(e,t=!0){return(0,m.dict_to_records)(this.model.data.property(e),t)}disconnect_signals(){super.disconnect_signals(),this._remove_event_listeners(),this._remove_mutation_observers()}remove(){this.run_script("remove",!0),super.remove()}get child_models(){const e=[];for(const[t,n]of(0,u.entries)(this.model.children))for(const t of n)(0,h.isString)(t)||e.push(t);return e}_after_layout(){this.run_script("after_layout",!0)}render(){this.empty(),this._update_stylesheets(),this._update_css_classes(),this._apply_styles(),this._apply_visible(),this.container=(0,c.div)({style:{display:"contents"}}),this.shadow_el.append(this.container),this._update(),this._render_children(),this._setup_mutation_observers(),this._setup_event_listeners(),this.run_script("render",!0)}_send_event(e,t,n){const s=(0,b.convertUndefined)((0,v.serializeEvent)(n));s.type=t,this.model.trigger_event(new g.DOMEvent(e,s))}_render_child(e,t){if((0,h.isString)(e))t.innerHTML=e;else{const n=this._child_views.get(e);null==n?t.innerHTML="":(t.appendChild(n.el),n.render(),n.r_after_render())}}_render_node(e,t){const{id:n}=this.model.data;if(this.model.looped.includes(e))for(const[s,i]of(0,d.enumerate)(t)){const t=`${e}-${i}-${n}`,o=y(this.shadow_el,t);null!=o?this._render_child(s,o):console.warn(`DOM node '${t}' could not be found. Cannot render children.`)}else{const s=`${e}-${n}`,i=y(this.shadow_el,s);if(null==i)return void console.warn(`DOM node '${s}' could not be found. Cannot render children.`);for(const e of t)this._render_child(e,i)}}_render_children(){for(const[e,t]of(0,u.entries)(this.model.children)){const n=(()=>{if(!(0,h.isString)(t))return t;{const e=this.model.data.property(t).get_value();if((0,h.isString)(e))return[e];if((0,h.isArray)(e))return e;(0,a.unreachable)()}})();this._render_node(e,n)}}_render_html(e,t={}){let n=e.replace(/[`]/g,"\\$&"),s="";const i=[],o={};for(const[e,t]of(0,u.entries)(this.model.callbacks))for(const[r,l]of t){let t;if(n=n.replaceAll(`\${${l}}`,`$--{${l}}`),l.startsWith("script(")){{const e=l.replace("('","_").replace("')","").replace('("',"_").replace('")',"").replace("-","_"),s=e.replaceAll("script_","");n=n.replaceAll(l,e),t=`\n const ${e} = (event) => {\n view._state.event = event\n view.run_script("${s}")\n delete view._state.event\n }\n `}i.indexOf(l)>-1||(i.push(l),s+=t)}else o[l]=o[l]??[],o[l].push([e,r])}for(const[e,t]of(0,u.entries)(o))s+=`\n const ${e} = (event) => {\n const targets = ${JSON.stringify(t)}\n let [elname, cb] = targets[0]\n // currentTarget is the node the listener is attached to, which\n // differs from the innermost path element for nested nodes.\n const candidates = [event.currentTarget, ...event.composedPath()]\n const typed = targets.filter(([, c]) => c === "on" + event.type)\n const options = typed.length ? typed : targets\n for (const p of candidates) {\n const match = p == null ? null : options.find(([name]) => {\n const pattern = name.replace(/\\{\\{(.+?)\\}\\}/g, String.fromCharCode(92) + "d+")\n return RegExp("^" + pattern + "(-[0-9]+)*-[^-]+$").test(p.id)\n })\n if (match != null) {\n elname = p.id.split("-").slice(null, -1).join("-")\n cb = match[1]\n break\n }\n }\n view._send_event(elname, cb, event)\n }\n `;return n=n.replaceAll("${model.","$-{model.").replaceAll("${","${data.").replaceAll("$-{model.","${model.").replaceAll("$--{","${"),new Function("view, model, data, state, html, useCallback",`${s}return html\`${n}\`;`)(this,this.model,this.model.data,t,l.html,r.useCallback)}_render_script(e,t){const n=[];for(const s of this.model.nodes){const i=s.replace("-","_");if(!e.includes(i))continue;const o=`\n let ${i} = view.shadow_el.getElementById('${s}-${t}')\n if (${i} == null) {\n ${i} = document.getElementById('${s}-${t}')\n }\n if (${i} == null) {\n console.warn("DOM node '${s}' could not be found. Cannot execute callback.")\n return\n }\n `;n.push(o)}return n.push("\n let event = null\n if (state.event !== undefined) {\n event = state.event\n }\n "),n.push(e),new Function("model, data, state, view, script, self",n.join("\n"))}_remove_mutation_observers(){for(const e of this._mutation_observers)e.disconnect();this._mutation_observers=[]}_setup_mutation_observers(){const{id:e}=this.model.data;for(const t of(0,u.keys)(this.model.attrs)){const n=y(this.shadow_el,`${t}-${e}`);if(null==n){console.warn(`DOM node '${t}-${e}' could not be found. Cannot set up MutationObserver.`);continue}const s=new MutationObserver(()=>{this._update_model(n,t)});s.observe(n,{attributes:!0}),this._mutation_observers.push(s)}}_remove_event_listeners(){const{id:e}=this.model.data;for(const[t,n]of this._event_listeners){const s=y(this.shadow_el,`${t}-${e}`);if(null!=s)for(const[e,t]of n)s.removeEventListener(e,t)}this._event_listeners.clear()}_setup_event_listeners(){const{id:e}=this.model.data,t=(0,u.dict)(this.model.attrs);for(const[n,s]of(0,u.entries)(this.model.events)){const i=y(this.shadow_el,`${n}-${e}`);if(null!=i)for(const[e,o]of(0,u.entries)(s)){const s=s=>{this._send_event(n,e,s),t.has(n)&&o&&this._update_model(i,n)};i.addEventListener(e,s);let r=this._event_listeners.get(n);void 0===r&&this._event_listeners.set(n,r=new Map),r.set(e,s)}else console.warn(`DOM node '${n}-${e}' could not be found. Cannot subscribe to DOM events.`)}}_update(e=null){if(null==e||this.html.includes(`\${${e}}`)){const e=this._render_html(this.html);if(null==e)return;try{this._changing=!0,(0,o.render)(e,this.container)}finally{this._changing=!1}}}_update_model(e,t){if(this._changing)return;const n=(0,u.dict)(this.model.attrs).get(t)??[],s={};for(const i of n){const[n,o,r]=i;let l="children"==n?e.innerHTML:e[n];if(1===o.length&&`{${o[0]}}`===r)s[o[0]]=l;else if((0,h.isString)(l))if(l=w(r,l,o),null==l)console.warn(`Could not resolve parameters in ${t} element ${n} attribute value ${l}.`);else for(const[e,i]of(0,u.entries)(l))void 0===i?console.warn(`Could not resolve ${e} in ${t} element ${n} attribute value ${l}.`):s[e]=i}try{this._changing=!0,this.model.data.setv(function(e){const t={};for(const[n,s]of(0,u.entries)(e)){const e=(()=>{if((0,h.isString)(s)){if(!(""===s||"NaN"!==s&&isNaN(Number(s))))return Number(s);if("false"===s||"true"===s)return"true"===s}return s})();t[n]=e}return t}(s))}catch{console.error("Could not serialize",s)}finally{this._changing=!1}}}n.ReactiveHTMLView=ReactiveHTMLView;class ReactiveHTML extends $.HTMLBox{constructor(e){super(e)}static __module__="panel.models.reactive_html";static{this.prototype.default_view=ReactiveHTMLView,this.define(({Bool:e,Str:t,List:n,Dict:s,Tuple:i,Or:o,Ref:r})=>({attrs:[s(n(i(t,n(t),t))),{}],callbacks:[s(n(i(t,t))),{}],children:[s(o(n(o(r(p.UIElement),t)),t)),{}],data:[r(f.Model)],event_params:[n(t),[]],events:[s(s(e)),{}],html:[t,""],looped:[n(t),[]],nodes:[n(t),[]],scripts:[s(n(t)),{}]}))}}n.ReactiveHTML=ReactiveHTML},
|
|
239
239
|
"ed32986312": function _(e,n,t,l,o){l(),t.Component=U,t.Fragment=S,t.cloneElement=function(e,n,t){var l,o,u,i,c=w({},e.props);for(u in e.type&&e.type.defaultProps&&(i=e.type.defaultProps),n)"key"==u?l=n[u]:"ref"==u?o=n[u]:c[u]=void 0===n[u]&&null!=i?i[u]:n[u];return arguments.length>2&&(c.children=arguments.length>3?r.call(arguments,2):t),P(e.type,c,l||e.key,o||e.ref,null)},t.createContext=function(e){function n(e){var t,l;return this.getChildContext||(t=new Set,(l={})[n.__c]=this,this.getChildContext=function(){return l},this.componentWillUnmount=function(){t=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&t.forEach(function(e){e.__e=!0,M(e)})},this.sub=function(e){t.add(e);var n=e.componentWillUnmount;e.componentWillUnmount=function(){t&&t.delete(e),n&&n.call(e)}}),e.children}return n.__c="__cC"+y++,n.__=e,n.Provider=n.__l=(n.Consumer=function(e,n){return e.children(n)}).contextType=n,n},t.createElement=C,t.h=C,t.createRef=function(){return{current:null}},t.hydrate=function e(n,t){J(n,t,e)},t.render=J,t.toChildArray=function e(n,t){return t=t||[],null==n||"boolean"==typeof n||(b(n)?n.some(function(n){e(n,t)}):t.push(n)),t};var r,u,i,c,s,f,p,a,h,d,v,y,m={},g=[],k=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function w(e,n){for(var t in n)e[t]=n[t];return e}function x(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function C(e,n,t){var l,o,u,i={};for(u in n)"key"==u?l=n[u]:"ref"==u?o=n[u]:i[u]=n[u];if(arguments.length>2&&(i.children=arguments.length>3?r.call(arguments,2):t),"function"==typeof e&&null!=e.defaultProps)for(u in e.defaultProps)void 0===i[u]&&(i[u]=e.defaultProps[u]);return P(e,i,l,o,null)}function P(e,n,t,l,o){var r={type:e,props:n,key:t,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++i,__i:-1,__u:0};return null==o&&null!=u.vnode&&u.vnode(r),r}function S(e){return e.children}function U(e,n){this.props=e,this.context=n}function T(e,n){if(null==n)return e.__?T(e.__,e.__i+1):null;for(var t;n<e.__k.length;n++)if(null!=(t=e.__k[n])&&null!=t.__e)return t.__e;return"function"==typeof e.type?T(e):null}function E(e){if(e.__P&&e.__d){var n=e.__v,t=n.__e,l=[],o=[],r=w({},n);r.__v=n.__v+1,u.vnode&&u.vnode(r),$(e.__P,r,n,e.__n,e.__P.namespaceURI,32&n.__u?[t]:null,l,t??T(n),!!(32&n.__u),o),r.__v=n.__v,r.__.__k[r.__i]=r,O(l,r,o),n.__e=n.__=null,r.__e!=t&&D(r)}}function D(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(n){if(null!=n&&null!=n.__e)return e.__e=e.__c.base=n.__e}),D(e)}function M(e){(!e.__d&&(e.__d=!0)&&c.push(e)&&!W.__r++||s!=u.debounceRendering)&&((s=u.debounceRendering)||f)(W)}function W(){for(var e,n=1;c.length;)c.length>n&&c.sort(p),e=c.shift(),n=c.length,E(e);W.__r=0}function F(e,n,t,l,o,r,u,i,c,s,f){var p,a,h,d,v,y,k,b=l&&l.__k||g,w=n.length;for(c=L(t,n,b,c,w),p=0;p<w;p++)null!=(h=t.__k[p])&&(a=-1!=h.__i&&b[h.__i]||m,h.__i=p,y=$(e,h,a,o,r,u,i,c,s,f),d=h.__e,h.ref&&a.ref!=h.ref&&(a.ref&&z(a.ref,null,h),f.push(h.ref,h.__c||d,h)),null==v&&null!=d&&(v=d),(k=!!(4&h.__u))||a.__k===h.__k?c=N(h,c,e,k):"function"==typeof h.type&&void 0!==y?c=y:d&&(c=d.nextSibling),h.__u&=-7);return t.__e=v,c}function L(e,n,t,l,o){var r,u,i,c,s,f=t.length,p=f,a=0;for(e.__k=new Array(o),r=0;r<o;r++)null!=(u=n[r])&&"boolean"!=typeof u&&"function"!=typeof u?("string"==typeof u||"number"==typeof u||"bigint"==typeof u||u.constructor==String?u=e.__k[r]=P(null,u,null,null,null):b(u)?u=e.__k[r]=P(S,{children:u},null,null,null):void 0===u.constructor&&u.__b>0?u=e.__k[r]=P(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):e.__k[r]=u,c=r+a,u.__=e,u.__b=e.__b+1,i=null,-1!=(s=u.__i=A(u,t,c,p))&&(p--,(i=t[s])&&(i.__u|=2)),null==i||null==i.__v?(-1==s&&(o>f?a--:o<f&&a++),"function"!=typeof u.type&&(u.__u|=4)):s!=c&&(s==c-1?a--:s==c+1?a++:(s>c?a--:a++,u.__u|=4))):e.__k[r]=null;if(p)for(r=0;r<f;r++)null!=(i=t[r])&&!(2&i.__u)&&(i.__e==l&&(l=T(i)),q(i,i));return l}function N(e,n,t,l){var o,r;if("function"==typeof e.type){for(o=e.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=e,n=N(o[r],n,t,l));return n}e.__e!=n&&(l&&(n&&e.type&&!n.parentNode&&(n=T(e)),t.insertBefore(e.__e,n||null)),n=e.__e);do{n=n&&n.nextSibling}while(null!=n&&8==n.nodeType);return n}function A(e,n,t,l){var o,r,u,i=e.key,c=e.type,s=n[t],f=null!=s&&!(2&s.__u);if(null===s&&null==i||f&&i==s.key&&c==s.type)return t;if(l>(f?1:0))for(o=t-1,r=t+1;o>=0||r<n.length;)if(null!=(s=n[u=o>=0?o--:r++])&&!(2&s.__u)&&i==s.key&&c==s.type)return u;return-1}function R(e,n,t){"-"==n[0]?e.setProperty(n,t??""):e[n]=null==t?"":"number"!=typeof t||k.test(n)?t:t+"px"}function H(e,n,t,l,o){var r,u;e:if("style"==n)if("string"==typeof t)e.style.cssText=t;else{if("string"==typeof l&&(e.style.cssText=l=""),l)for(n in l)t&&n in t||R(e.style,n,"");if(t)for(n in t)l&&t[n]==l[n]||R(e.style,n,t[n])}else if("o"==n[0]&&"n"==n[1])r=n!=(n=n.replace(a,"$1")),u=n.toLowerCase(),n=u in e||"onFocusOut"==n||"onFocusIn"==n?u.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+r]=t,t?l?t.u=l.u:(t.u=h,e.addEventListener(n,r?v:d,r)):e.removeEventListener(n,r?v:d,r);else{if("http://www.w3.org/2000/svg"==o)n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=n&&"height"!=n&&"href"!=n&&"list"!=n&&"form"!=n&&"tabIndex"!=n&&"download"!=n&&"rowSpan"!=n&&"colSpan"!=n&&"role"!=n&&"popover"!=n&&n in e)try{e[n]=t??"";break e}catch(e){}"function"==typeof t||(null==t||!1===t&&"-"!=n[4]?e.removeAttribute(n):e.setAttribute(n,"popover"==n&&1==t?"":t))}}function I(e){return function(n){if(this.l){var t=this.l[n.type+e];if(null==n.t)n.t=h++;else if(n.t<t.u)return;return t(u.event?u.event(n):n)}}}function $(e,n,t,l,o,r,i,c,s,f){var p,a,h,d,v,y,m,k,C,P,T,E,D,M,W,L=n.type;if(void 0!==n.constructor)return null;128&t.__u&&(s=!!(32&t.__u),r=[c=n.__e=t.__e]),(p=u.__b)&&p(n);e:if("function"==typeof L)try{if(k=n.props,C="prototype"in L&&L.prototype.render,P=(p=L.contextType)&&l[p.__c],T=p?P?P.props.value:p.__:l,t.__c?m=(a=n.__c=t.__c).__=a.__E:(C?n.__c=a=new L(k,T):(n.__c=a=new U(k,T),a.constructor=L,a.render=G),P&&P.sub(a),a.state||(a.state={}),a.__n=l,h=a.__d=!0,a.__h=[],a._sb=[]),C&&null==a.__s&&(a.__s=a.state),C&&null!=L.getDerivedStateFromProps&&(a.__s==a.state&&(a.__s=w({},a.__s)),w(a.__s,L.getDerivedStateFromProps(k,a.__s))),d=a.props,v=a.state,a.__v=n,h)C&&null==L.getDerivedStateFromProps&&null!=a.componentWillMount&&a.componentWillMount(),C&&null!=a.componentDidMount&&a.__h.push(a.componentDidMount);else{if(C&&null==L.getDerivedStateFromProps&&k!==d&&null!=a.componentWillReceiveProps&&a.componentWillReceiveProps(k,T),n.__v==t.__v||!a.__e&&null!=a.shouldComponentUpdate&&!1===a.shouldComponentUpdate(k,a.__s,T)){n.__v!=t.__v&&(a.props=k,a.state=a.__s,a.__d=!1),n.__e=t.__e,n.__k=t.__k,n.__k.some(function(e){e&&(e.__=n)}),g.push.apply(a.__h,a._sb),a._sb=[],a.__h.length&&i.push(a);break e}null!=a.componentWillUpdate&&a.componentWillUpdate(k,a.__s,T),C&&null!=a.componentDidUpdate&&a.__h.push(function(){a.componentDidUpdate(d,v,y)})}if(a.context=T,a.props=k,a.__P=e,a.__e=!1,E=u.__r,D=0,C)a.state=a.__s,a.__d=!1,E&&E(n),p=a.render(a.props,a.state,a.context),g.push.apply(a.__h,a._sb),a._sb=[];else do{a.__d=!1,E&&E(n),p=a.render(a.props,a.state,a.context),a.state=a.__s}while(a.__d&&++D<25);a.state=a.__s,null!=a.getChildContext&&(l=w(w({},l),a.getChildContext())),C&&!h&&null!=a.getSnapshotBeforeUpdate&&(y=a.getSnapshotBeforeUpdate(d,v)),M=null!=p&&p.type===S&&null==p.key?j(p.props.children):p,c=F(e,b(M)?M:[M],n,t,l,o,r,i,c,s,f),a.base=n.__e,n.__u&=-161,a.__h.length&&i.push(a),m&&(a.__E=a.__=null)}catch(e){if(n.__v=null,s||null!=r)if(e.then){for(n.__u|=s?160:128;c&&8==c.nodeType&&c.nextSibling;)c=c.nextSibling;r[r.indexOf(c)]=null,n.__e=c}else{for(W=r.length;W--;)x(r[W]);B(n)}else n.__e=t.__e,n.__k=t.__k,e.then||B(n);u.__e(e,n,t)}else null==r&&n.__v==t.__v?(n.__k=t.__k,n.__e=t.__e):c=n.__e=V(t.__e,n,t,l,o,r,i,s,f);return(p=u.diffed)&&p(n),128&n.__u?void 0:c}function B(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(B))}function O(e,n,t){for(var l=0;l<t.length;l++)z(t[l],t[++l],t[++l]);u.__c&&u.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){u.__e(e,n.__v)}})}function j(e){return"object"!=typeof e||null==e||e.__b>0?e:b(e)?e.map(j):w({},e)}function V(e,n,t,l,o,i,c,s,f){var p,a,h,d,v,y,g,k=t.props||m,w=n.props,C=n.type;if("svg"==C?o="http://www.w3.org/2000/svg":"math"==C?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=i)for(p=0;p<i.length;p++)if((v=i[p])&&"setAttribute"in v==!!C&&(C?v.localName==C:3==v.nodeType)){e=v,i[p]=null;break}if(null==e){if(null==C)return document.createTextNode(w);e=document.createElementNS(o,C,w.is&&w),s&&(u.__m&&u.__m(n,i),s=!1),i=null}if(null==C)k===w||s&&e.data==w||(e.data=w);else{if(i=i&&r.call(e.childNodes),!s&&null!=i)for(k={},p=0;p<e.attributes.length;p++)k[(v=e.attributes[p]).name]=v.value;for(p in k)v=k[p],"dangerouslySetInnerHTML"==p?h=v:"children"==p||p in w||"value"==p&&"defaultValue"in w||"checked"==p&&"defaultChecked"in w||H(e,p,null,v,o);for(p in w)v=w[p],"children"==p?d=v:"dangerouslySetInnerHTML"==p?a=v:"value"==p?y=v:"checked"==p?g=v:s&&"function"!=typeof v||k[p]===v||H(e,p,v,k[p],o);if(a)s||h&&(a.__html==h.__html||a.__html==e.innerHTML)||(e.innerHTML=a.__html),n.__k=[];else if(h&&(e.innerHTML=""),F("template"==n.type?e.content:e,b(d)?d:[d],n,t,l,"foreignObject"==C?"http://www.w3.org/1999/xhtml":o,i,c,i?i[0]:t.__k&&T(t,0),s,f),null!=i)for(p=i.length;p--;)x(i[p]);s||(p="value","progress"==C&&null==y?e.removeAttribute("value"):null!=y&&(y!==e[p]||"progress"==C&&!y||"option"==C&&y!=k[p])&&H(e,p,y,k[p],o),p="checked",null!=g&&g!=e[p]&&H(e,p,g,k[p],o))}return e}function z(e,n,t){try{if("function"==typeof e){var l="function"==typeof e.__u;l&&e.__u(),l&&null==n||(e.__u=e(n))}else e.current=n}catch(e){u.__e(e,t)}}function q(e,n,t){var l,o;if(u.unmount&&u.unmount(e),(l=e.ref)&&(l.current&&l.current!=e.__e||z(l,null,n)),null!=(l=e.__c)){if(l.componentWillUnmount)try{l.componentWillUnmount()}catch(e){u.__e(e,n)}l.base=l.__P=null}if(l=e.__k)for(o=0;o<l.length;o++)l[o]&&q(l[o],n,t||"function"!=typeof e.type);t||x(e.__e),e.__c=e.__=e.__e=void 0}function G(e,n,t){return this.constructor(e,t)}function J(e,n,t){var l,o,i,c;n==document&&(n=document.documentElement),u.__&&u.__(e,n),o=(l="function"==typeof t)?null:t&&t.__k||n.__k,i=[],c=[],$(n,e=(!l&&t||n).__k=C(S,null,[e]),o||m,m,n.namespaceURI,!l&&t?[t]:o?null:n.firstChild?r.call(n.childNodes):null,i,!l&&t?t:o?o.__e:n.firstChild,l,c),O(i,e,c)}r=g.slice,t.options=u={__e:function(e,n,t,l){for(var o,r,u;n=n.__;)if((o=n.__c)&&!o.__)try{if((r=o.constructor)&&null!=r.getDerivedStateFromError&&(o.setState(r.getDerivedStateFromError(e)),u=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,l||{}),u=o.__d),u)return o.__E=o}catch(n){e=n}throw e}},i=0,t.isValidElement=function(e){return null!=e&&void 0===e.constructor},U.prototype.setState=function(e,n){var t;t=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=w({},this.state),"function"==typeof e&&(e=e(w({},t),this.props)),e&&w(t,e),null!=e&&this.__v&&(n&&this._sb.push(n),M(this))},U.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),M(this))},U.prototype.render=S,c=[],f="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,p=function(e,n){return e.__v.__b-n.__v.__b},W.__r=0,a=/(PointerCapture)$|Capture$/i,h=0,d=I(!1),v=I(!0),y=0},
|
|
240
240
|
"691acbd345": function _(n,t,u,e,o){e(),u.useCallback=function(n,t){return s=8,A(function(){return n},t)},u.useContext=function(n){var t=i.context[n.__c],u=N(c++,9);return u.c=n,t?(null==u.__&&(u.__=!0,t.sub(i)),t.props.value):n.__},u.useDebugValue=function(n,t){v.useDebugValue&&v.useDebugValue(t?t(n):n)},u.useEffect=function(n,t){var u=N(c++,3);!v.__s&&E(u.__H,t)&&(u.__=n,u.u=t,i.__H.__h.push(u))},u.useErrorBoundary=function(n){var t=N(c++,10),u=b();return t.__=n,i.componentDidCatch||(i.componentDidCatch=function(n,e){t.__&&t.__(n,e),u[1](n)}),[u[0],function(){u[1](void 0)}]},u.useId=function(){var n=N(c++,11);if(!n.__){for(var t=i.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var u=t.__m||(t.__m=[0,0]);n.__="P"+u[0]+"-"+u[1]++}return n.__},u.useImperativeHandle=function(n,t,u){s=6,C(function(){if("function"==typeof n){var u=n(t());return function(){n(null),u&&"function"==typeof u&&u()}}if(n)return n.current=t(),function(){return n.current=null}},null==u?u:u.concat(n))},u.useLayoutEffect=C,u.useMemo=A,u.useReducer=g,u.useRef=function(n){return s=5,A(function(){return{current:n}},[])},u.useState=b;const r=n("ed32986312");var c,i,f,a,s=0,l=[],v=r.options,h=v.__b,m=v.__r,d=v.diffed,p=v.__c,H=v.unmount,y=v.__;function N(n,t){v.__h&&v.__h(i,n,s||t),s=0;var u=i.__H||(i.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function b(n){return s=1,g(T,n)}function g(n,t,u){var e=N(c++,2);if(e.t=n,!e.__c&&(e.__=[u?u(t):T(void 0,t),function(n){var t=e.__N?e.__N[0]:e.__[0],u=e.t(t,n);t!==u&&(e.__N=[u,e.__[1]],e.__c.setState({}))}],e.__c=i,!i.__f)){var o=function(n,t,u){if(!e.__c.__H)return!0;var o=e.__c.__H.__.filter(function(n){return n.__c});if(o.every(function(n){return!n.__N}))return!r||r.call(this,n,t,u);var c=e.__c.props!==n;return o.some(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(c=!0)}}),r&&r.call(this,n,t,u)||c};i.__f=!0;var r=i.shouldComponentUpdate,f=i.componentWillUpdate;i.componentWillUpdate=function(n,t,u){if(this.__e){var e=r;r=void 0,o(n,t,u),r=e}f&&f.call(this,n,t,u)},i.shouldComponentUpdate=o}return e.__N||e.__}function C(n,t){var u=N(c++,4);!v.__s&&E(u.__H,t)&&(u.__=n,u.u=t,i.__h.push(u))}function A(n,t){var u=N(c++,7);return E(u.__H,t)&&(u.__=n(),u.__H=t,u.__h=n),u.__}function D(){for(var n;n=l.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(q),t.__h.some(U),t.__h=[]}catch(u){t.__h=[],v.__e(u,n.__v)}}}v.__b=function(n){i=null,h&&h(n)},v.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),y&&y(n,t)},v.__r=function(n){m&&m(n),c=0;var t=(i=n.__c).__H;t&&(f===i?(t.__h=[],i.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(q),t.__h.some(U),t.__h=[],c=0)),f=i},v.diffed=function(n){d&&d(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&a===v.requestAnimationFrame||((a=v.requestAnimationFrame)||k)(D)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),f=i=null},v.__c=function(n,t){t.some(function(n){try{n.__h.some(q),n.__h=n.__h.filter(function(n){return!n.__||U(n)})}catch(u){t.some(function(n){n.__h&&(n.__h=[])}),t=[],v.__e(u,n.__v)}}),p&&p(n,t)},v.unmount=function(n){H&&H(n);var t,u=n.__c;u&&u.__H&&(u.__H.__.some(function(n){try{q(n)}catch(n){t=n}}),u.__H=void 0,t&&v.__e(t,u.__v))};var F="function"==typeof requestAnimationFrame;function k(n){var t,u=function(){clearTimeout(e),F&&cancelAnimationFrame(t),setTimeout(n)},e=setTimeout(u,35);F&&(t=requestAnimationFrame(u))}function q(n){var t=i,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),i=t}function U(n){var t=i;n.__c=n.__(),i=t}function E(n,t){return!n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function T(n,t){return"function"==typeof t?t(n):t}},
|
|
241
241
|
"b3f51db71c": function _(e,n,t,d,o){d();const r=e("tslib"),a=e("ed32986312");var f=e("ed32986312");o("h",f.h),o("render",f.render),o("Component",f.Component);var h=r.__importDefault(e("ab33dd3f38")).default.bind(a.h);t.html=h},
|
|
@@ -243,15 +243,15 @@ const r=t("@bokehjs/core/util/types");let o,s;const c={fontFamily:'"Helvetica Ne
|
|
|
243
243
|
"3766e0c917": function _(e,t,s,i,n){i();const l=e("tslib"),o=e("@bokehjs/core/dom"),r=e("@bokehjs/core/util/types"),d=e("@bokehjs/models/widgets/input_widget"),c=l.__importStar(e("@bokehjs/styles/widgets/inputs.css"));class SingleSelectView extends d.InputWidgetView{connect_signals(){super.connect_signals();const{value:e,options:t,disabled_options:s,size:i,disabled:n}=this.model.properties;this.on_change(e,()=>this.render_selection()),this.on_change(t,()=>this.rerender_()),this.on_change(s,()=>this.rerender_()),this.on_change(i,()=>this.rerender_()),this.on_change(n,()=>this.rerender_())}render(){super.render(),this.render_selection()}rerender_(){this.rerender?this.rerender():(this.render(),this.r_after_render())}_render_input(){const e=this.model.options.map(e=>{let t,s;(0,r.isString)(e)?t=s=e:[t,s]=e;const i=this.model.disabled_options.includes(t);return(0,o.option)({value:t,disabled:i},s)});return this.input_el=(0,o.select)({multiple:!1,class:c.input,name:this.model.name,disabled:this.model.disabled},e),this.input_el.style.backgroundImage="none",this.input_el.addEventListener("change",()=>this.change_input()),this.input_el}render_selection(){const e=this.model.value;for(const t of this.input_el.querySelectorAll("option"))t.value===e&&(t.selected=!0);this.input_el.size=this.model.size}change_input(){const e=null!=this.el.querySelector("select:focus");let t=null;for(const e of this.shadow_el.querySelectorAll("option"))if(e.selected){t=e.value;break}this.model.value=t,super.change_input(),e&&this.input_el.focus()}}s.SingleSelectView=SingleSelectView;class SingleSelect extends d.InputWidget{constructor(e){super(e)}static __module__="panel.models.widgets";static{this.prototype.default_view=SingleSelectView,this.define(({Any:e,List:t,Int:s,Nullable:i,Str:n})=>({disabled_options:[t(n),[]],options:[t(e),[]],size:[s,4],value:[i(n),null]}))}}s.SingleSelect=SingleSelect},
|
|
244
244
|
"95fa78f501": function _(t,e,i,n,o){n();const s=t("00beb93e38"),r="Click to START the speech recognition.",{webkitSpeechRecognition:h}=window,{webkitSpeechGrammarList:a}=window;function c(t){return Math.round(100*(t+Number.EPSILON))/100}class SpeechToTextView extends s.HTMLBoxView{recognition;buttonEl;initialize(){super.initialize(),this.recognition=new h,this.recognition.lang=this.model.lang,this.recognition.continuous=this.model.continuous,this.recognition.interimResults=this.model.interim_results,this.recognition.maxAlternatives=this.model.max_alternatives,this.recognition.serviceURI=this.model.service_uri,this.setGrammars(),this.recognition.onresult=t=>{this.model.results=function(t){const e=[];for(const i of t){const t=[],n={is_final:i.isFinal,alternatives:t};for(let e=0;e<i.length;e++){const n={confidence:c(i[e].confidence),transcript:i[e].transcript};t.push(n)}n.alternatives=t,e.push(n)}return e}(t.results)},this.recognition.onerror=t=>{console.error(`SpeechToText Error: ${t}`)},this.recognition.onnomatch=t=>{console.warn(`SpeechToText No Match: ${t}`)},this.recognition.onaudiostart=()=>this.model.audio_started=!0,this.recognition.onaudioend=()=>this.model.audio_started=!1,this.recognition.onsoundstart=()=>this.model.sound_started=!0,this.recognition.onsoundend=()=>this.model.sound_started=!1,this.recognition.onspeechstart=()=>this.model.speech_started=!0,this.recognition.onspeechend=()=>this.model.speech_started=!1,this.recognition.onstart=()=>{this.buttonEl.onclick=()=>{this.recognition.stop()},this.buttonEl.innerHTML=this.iconStarted(),this.buttonEl.setAttribute("title","Click to STOP the speech recognition."),this.model.started=!0},this.recognition.onend=()=>{this.buttonEl.onclick=()=>{this.recognition.start()},this.buttonEl.innerHTML=this.iconNotStarted(),this.buttonEl.setAttribute("title",r),this.model.started=!1},this.buttonEl=function(t){const e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild}(`<button class="bk bk-btn bk-btn-${this.model.button_type}" type="button" title="${r}"></button>`),this.buttonEl.innerHTML=this.iconNotStarted(),this.buttonEl.onclick=()=>this.recognition.start()}iconStarted(){return""!==this.model.button_started?this.model.button_started:'<svg xmlns="http://www.w3.org/2000/svg" height="22px" style="vertical-align: middle;" fill="currentColor" class="bi bi-mic" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M3.5 6.5A.5.5 0 0 1 4 7v1a4 4 0 0 0 8 0V7a.5.5 0 0 1 1 0v1a5 5 0 0 1-4.5 4.975V15h3a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1h3v-2.025A5 5 0 0 1 3 8V7a.5.5 0 0 1 .5-.5z"/>\n <path fill-rule="evenodd" d="M10 8V3a2 2 0 1 0-4 0v5a2 2 0 1 0 4 0zM8 0a3 3 0 0 0-3 3v5a3 3 0 0 0 6 0V3a3 3 0 0 0-3-3z"/>\n</svg>'}iconNotStarted(){return""!==this.model.button_not_started?this.model.button_not_started:'<svg xmlns="http://www.w3.org/2000/svg" height="22px" style="vertical-align: middle;" fill="currentColor" class="bi bi-mic-mute" viewBox="0 0 16 16">\n<path fill-rule="evenodd" d="M12.734 9.613A4.995 4.995 0 0 0 13 8V7a.5.5 0 0 0-1 0v1c0 .274-.027.54-.08.799l.814.814zm-2.522 1.72A4 4 0 0 1 4 8V7a.5.5 0 0 0-1 0v1a5 5 0 0 0 4.5 4.975V15h-3a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1h-3v-2.025a4.973 4.973 0 0 0 2.43-.923l-.718-.719zM11 7.88V3a3 3 0 0 0-5.842-.963l.845.845A2 2 0 0 1 10 3v3.879l1 1zM8.738 9.86l.748.748A3 3 0 0 1 5 8V6.121l1 1V8a2 2 0 0 0 2.738 1.86zm4.908 3.494l-12-12 .708-.708 12 12-.708.707z"/>\n</svg>'}setIcon(){this.model.started?this.buttonEl.innerHTML=this.iconStarted():this.buttonEl.innerHTML=this.iconNotStarted()}connect_signals(){super.connect_signals();const{start:t,stop:e,abort:i,grammars:n,lang:o,continuous:s,interim_results:r,max_alternatives:h,service_uri:a,button_type:c,button_hide:l,button_not_started:d,button_started:u}=this.model.properties;this.on_change(t,()=>{this.model.start=!1,this.recognition.start()}),this.on_change(e,()=>{this.model.stop=!1,this.recognition.stop()}),this.on_change(i,()=>{this.model.abort=!1,this.recognition.abort()}),this.on_change(n,()=>this.setGrammars()),this.on_change(o,()=>this.recognition.lang=this.model.lang),this.on_change(s,()=>this.recognition.continuous=this.model.continuous),this.on_change(r,()=>this.recognition.interimResults=this.model.interim_results),this.on_change(h,()=>this.recognition.maxAlternatives=this.model.max_alternatives),this.on_change(a,()=>this.recognition.serviceURI=this.model.service_uri),this.on_change(c,()=>this.buttonEl.className=`bk bk-btn bk-btn-${this.model.button_type}`),this.on_change(l,()=>this.render()),this.on_change([d,u],()=>this.setIcon())}setGrammars(){this.recognition.grammars=function(t){if(t){const e=new a;for(const i of t)i.src?e.addFromString(i.src,i.weight):i.uri&&e.addFromURI(i.uri,i.weight);return e}return null}(this.model.grammars)}render(){super.render(),this.model.button_hide||this.shadow_el.appendChild(this.buttonEl)}}i.SpeechToTextView=SpeechToTextView;class SpeechToText extends s.HTMLBox{constructor(t){super(t)}static __module__="panel.models.speech_to_text";static{this.prototype.default_view=SpeechToTextView,this.define(({Any:t,List:e,Bool:i,Float:n,Str:o})=>({start:[i,!1],stop:[i,!1],abort:[i,!1],grammars:[e(t),[]],lang:[o,""],continuous:[i,!1],interim_results:[i,!1],max_alternatives:[n,1],service_uri:[o,""],started:[i,!1],audio_started:[i,!1],sound_started:[i,!1],speech_started:[i,!1],button_type:[o,"light"],button_hide:[i,!1],button_not_started:[o,""],button_started:[o,""],results:[e(t),[]]}))}}i.SpeechToText=SpeechToText},
|
|
245
245
|
"188544eb0b": function _(e,t,s,a,i){a();const c=e("@bokehjs/core/view"),o=e("@bokehjs/core/util/array"),n=e("@bokehjs/model"),h=e("@bokehjs/protocol/receiver");class StateView extends c.View{}s.StateView=StateView;class State extends n.Model{_receiver;_cache;constructor(e){super(e),this._receiver=new h.Receiver,this._cache={}}apply_state(e){this._receiver.consume(e.header),this._receiver.consume(e.metadata),this._receiver.consume(e.content),this._receiver.message&&this.document&&this.document.apply_json_patch(this._receiver.message.content)}_receive_json(e,t){const s=JSON.parse(e);this._cache[t]=s;let a=this.state;for(const e of this.values)a=a instanceof Map?a.get(e):a[e];a===t?this.apply_state(s):this._cache[a]&&this.apply_state(this._cache[a])}set_state(e,t){const s=(0,o.copy)(this.values);s[this.widgets[e.id]]=t;let a=this.state;for(const e of s)a=a instanceof Map?a.get(e):a[e];this.values=s,this.json?this._cache[a]?this.apply_state(this._cache[a]):function(e,t){const s=new XMLHttpRequest;s.overrideMimeType("application/json"),s.open("GET",e,!0),s.onreadystatechange=function(){4==s.readyState&&200==s.status&&t(s.responseText)},s.send(null)}(a,e=>this._receive_json(e,a)):this.apply_state(a)}static __module__="panel.models.state";static{this.prototype.default_view=StateView,this.define(({Any:e,Bool:t})=>({json:[t,!1],state:[e,{}],widgets:[e,{}],values:[e,[]]}))}}s.State=State},
|
|
246
|
-
"
|
|
246
|
+
"c5ac7daa0f": function _(t,e,i,s,l){s();const a=t("tslib").__importStar(t("@bokehjs/styles/tabs.css")),n=t("@bokehjs/core/layout/grid"),o=t("@bokehjs/core/enums"),d=t("@bokehjs/models/layouts/alignments"),c=t("@bokehjs/models/layouts/tabs"),h=t("@bokehjs/models/layouts/layout_dom");function r(t){t.style.visibility="hidden",t.style.opacity="0",t.style.pointerEvents="none",t.setAttribute("aria-hidden","true")}class TabsView extends c.TabsView{_children_update=Promise.resolve();update_children(){const t=this._children_update.then(()=>super.update_children());return this._children_update=t.catch(()=>{}),t}connect_signals(){super.connect_signals(),this.on_transitive_change(this.model.properties.tabs,()=>{this._update_headers(),this.update_active()},{signal:t=>t.properties.title.change});let t=this;for(;null!=t;)t.model.type.endsWith("Tabs")&&t.connect(t.model.properties.active.change,()=>this.update_active()),t=t.parent||t._parent}update_active(){super.update_active(),this._update_child_visibility(),this.update_zindex()}_active_child_view(){const t=this.model.tabs[this.model.active];if(null!=t)return this.child_views.find(e=>e.model==t.child)}_update_child_visibility(){const{child_views:t}=this;for(const e of t)null!=e&&r(e.el);const e=this._active_child_view();var i;null!=e&&((i=e.el).style.visibility="",i.style.opacity="",i.style.pointerEvents="auto",i.removeAttribute("aria-hidden"))}get is_visible(){let t=this.parent,e=this;for(;null!=t;){if(t.model.type.endsWith("Tabs")&&t._active_child_view()!==e)return!1;e=t,t=t.parent||t._parent}return!0}render(){super.render(),this.update_zindex()}update_zindex(){const{child_views:t}=this;for(const e of t)null!=e&&null!=e.el&&(e.el.style.zIndex="");if(this.is_visible){const t=this._active_child_view();null!=t&&null!=t.el&&(t.el.style.zIndex="1")}}_after_layout(){h.LayoutDOMView.prototype._after_layout.call(this),this._update_child_visibility()}_update_layout(){h.LayoutDOMView.prototype._update_layout.call(this);const t=this.model.tabs_location;this.class_list.remove([...o.Location].map(t=>a[t])),this.class_list.add(a[t]);const e=new n.Container;for(const t of this.child_views)null!=t&&(t.style.append(":host",{grid_area:"stack"}),t instanceof h.LayoutDOMView&&null!=t.layout&&e.add({r0:0,c0:0,r1:1,c1:1},t));0!=e.size?(this.layout=new d.GridAlignmentLayout(e),this.layout.set_sizing()):delete this.layout}}i.TabsView=TabsView;class Tabs extends c.Tabs{static __module__="panel.models.tabs";static{this.prototype.default_view=TabsView}}i.Tabs=Tabs},
|
|
247
247
|
"4fecff5c68": function _(e,t,i,n,s){n();const r=e("@bokehjs/core/dom"),o=e("@bokehjs/core/bokeh_events"),h=e("00beb93e38");class KeystrokeEvent extends o.ModelEvent{key;constructor(e){super(),this.key=e}get event_values(){return{model:this.origin,key:this.key}}static{this.prototype.event_name="keystroke"}}i.KeystrokeEvent=KeystrokeEvent;class TerminalView extends h.HTMLBoxView{term;webLinksAddon;container;_rendered;connect_signals(){super.connect_signals();const{width:e,height:t,min_height:i,max_height:n,margin:s,sizing_mode:r,output:o,_clears:a}=this.model.properties;this.on_change(o,this.write),this.on_change(a,this.clear),this.on_change([e,t,i,n,s,r],()=>{(0,h.set_size)(this.el,this.model),(0,h.set_size)(this.container,this.model,!1)})}render(){super.render(),this.container=(0,r.div)({class:"terminal-container"}),(0,h.set_size)(this.container,this.model,!1),this.term=this.getNewTerminal(),this.term.onData(e=>{this.handleOnData(e)}),this.webLinksAddon=this.getNewWebLinksAddon(),this.term.loadAddon(this.webLinksAddon),this.term.open(this.container),this.term.onRender(()=>{this._rendered||this.fit()}),this.write(),this.shadow_el.appendChild(this.container)}getNewTerminal(){const e=window;return e.Terminal?new e.Terminal(this.model.options):new e.xtermjs.Terminal(this.model.options)}getNewWebLinksAddon(){return new window.WebLinksAddon.WebLinksAddon}handleOnData(e){this.model.trigger_event(new KeystrokeEvent(e))}write(){const e=this.model.output;if(null==e||!e.length)return;const t=e.replace(/\r?\n/g,"\r\n");this.term.write(t)}clear(){this.term.clear()}fit(){const e=this.container.offsetWidth,t=this.container.offsetHeight,i=this.term._core._renderService,n=i.dimensions.actualCellWidth||9,s=i.dimensions.actualCellHeight||18;if(null==e||null==t||e<=0||t<=0)return;const r=Math.max(2,Math.floor(e/n)),o=Math.max(1,Math.floor(t/s));this.term.rows===o&&this.term.cols===r||this.term.resize(r,o),this.model.ncols=r,this.model.nrows=o,this._rendered=!0}after_layout(){super.after_layout(),null!=this.container&&this.fit()}}i.TerminalView=TerminalView;class Terminal extends h.HTMLBox{constructor(e){super(e)}static __module__="panel.models.terminal";static{this.prototype.default_view=TerminalView,this.define(({Any:e,Int:t,Str:i})=>({_clears:[t,0],options:[e,{}],output:[i,""],ncols:[t,0],nrows:[t,0]}))}}i.Terminal=Terminal},
|
|
248
248
|
"e9d16ed037": function _(e,t,n,s,u){s();const i=e("@bokehjs/models/widgets/text_input"),p=e("@bokehjs/core/bokeh_events");class EnterEvent extends p.ModelEvent{value_input;constructor(e){super(),this.value_input=e}get event_values(){return{model:this.origin,value_input:this.value_input}}static{this.prototype.event_name="enter-pressed"}}n.EnterEvent=EnterEvent;class TextInputView extends i.TextInputView{_keyup(e){if(super._keyup(e),"Enter"==e.key){const{value_input:e}=this.model;this.model.trigger_event(new EnterEvent(e))}}}n.TextInputView=TextInputView;class TextInput extends i.TextInput{constructor(e){super(e)}static __module__="panel.models.widgets";static{this.prototype.default_view=TextInputView,this.define(({})=>({}))}}n.TextInput=TextInput},
|
|
249
249
|
"1fb38b62cd": function _(e,s,i,t,n){t();const h=e("00beb93e38");function o(e){const s=[];for(const i of e){const e={default:i.default,lang:i.lang,local_service:i.localService,name:i.name,voice_uri:i.voiceURI};s.push(e)}return s}class TextToSpeechView extends h.HTMLBoxView{voices;_callback;initialize(){super.initialize(),this.model.paused=speechSynthesis.paused,this.model.pending=speechSynthesis.pending,this.model.speaking=speechSynthesis.speaking,this._callback=window.setInterval(function(){!speechSynthesis.paused&&speechSynthesis.speaking&&window.speechSynthesis.resume()},1e4);const e=()=>{"undefined"!=typeof speechSynthesis&&(this.voices=speechSynthesis.getVoices(),this.voices&&(this.model.voices=o(this.voices)))};e(),"undefined"!=typeof speechSynthesis&&void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=e)}remove(){null!=this._callback&&clearInterval(this._callback),speechSynthesis.cancel(),super.remove()}connect_signals(){super.connect_signals();const{speak:e,pause:s,resume:i,cancel:t}=this.model.properties;this.on_change(e,()=>{this.speak()}),this.on_change(s,()=>{this.model.pause=!1,speechSynthesis.pause()}),this.on_change(i,()=>{this.model.resume=!1,speechSynthesis.resume()}),this.on_change(t,()=>{this.model.cancel=!1,speechSynthesis.cancel()})}speak(){const e=new SpeechSynthesisUtterance(this.model.speak.text);if(e.pitch=this.model.speak.pitch,e.volume=this.model.speak.volume,e.rate=this.model.speak.rate,this.model.voices)for(const s of this.voices)s.name===this.model.speak.voice&&(e.voice=s);e.onpause=()=>this.model.paused=!0,e.onstart=()=>{this.model.speaking=!0,this.model.paused=!1,this.model.pending=speechSynthesis.pending},e.onresume=()=>this.model.paused=!1,e.onend=()=>{this.model.speaking=!1,this.model.paused=!1,this.model.pending=speechSynthesis.pending},speechSynthesis.speak(e),this.model.paused=speechSynthesis.paused,this.model.pending=speechSynthesis.pending}render(){super.render(),this.model.voices||(this.model.voices=o(this.voices)),null!=this.model.speak&&this.model.speak.text&&this.speak()}}i.TextToSpeechView=TextToSpeechView;class TextToSpeech extends h.HTMLBox{constructor(e){super(e)}static __module__="panel.models.text_to_speech";static{this.prototype.default_view=TextToSpeechView,this.define(({Any:e,List:s,Bool:i})=>({paused:[i,!1],pending:[i,!1],speaking:[i,!1],voices:[s(e),[]],cancel:[i,!1],pause:[i,!1],resume:[i,!1],speak:[e,{}]}))}}i.TextToSpeech=TextToSpeech},
|
|
250
250
|
"5e05e2d651": function _(e,t,i,s,c){s();const n=e("@bokehjs/models/widgets/time_picker");class TimePickerView extends n.TimePickerView{_offset_time(e){const t=new Date(e),i=60*t.getTimezoneOffset()*1e3;return t.getTime()+i}_setDate(e){e=this._offset_time(e),this.picker.setDate(e)}get flatpickr_options(){const e=super.flatpickr_options;return null!=e.defaultDate&&(e.defaultDate=this._offset_time(e.defaultDate)),e}connect_signals(){super.connect_signals();const{value:e}=this.model.properties;this.connect(e.change,()=>{const{value:e}=this.model;null!=e&&"number"==typeof e&&this._setDate(e)})}}i.TimePickerView=TimePickerView;class TimePicker extends n.TimePicker{constructor(e){super(e)}static __module__="panel.models.time_picker";static{this.prototype.default_view=TimePickerView,this.define(({})=>({}))}}i.TimePicker=TimePicker},
|
|
251
|
-
"49efbd99ad": function _(e,o,l,
|
|
251
|
+
"49efbd99ad": function _(e,o,c,l,i){l();const s=e("ac804884fa");class ToggleIconView extends s.ClickableIconView{*controls(){}click(){this.model.disabled||(super.click(),this.model.value=!this.model.value)}}c.ToggleIconView=ToggleIconView;class ToggleIcon extends s.ClickableIcon{static __module__="panel.models.icon";constructor(e){super(e)}static{this.prototype.default_view=ToggleIconView,this.define(({})=>({}))}}c.ToggleIcon=ToggleIcon},
|
|
252
252
|
"aad04f1876": function _(e,s,t,i,o){i();const l=e("tslib"),d=e("@bokehjs/models/ui/tooltip"),n=e("@bokehjs/models/layouts/layout_dom"),c=e("@bokehjs/core/dom"),r=l.__importStar(e("@bokehjs/styles/widgets/inputs.css")),p=r,h=l.__importDefault(e("@bokehjs/styles/icons.css"));class TooltipIconView extends n.LayoutDOMView{desc_el;get child_models(){return null==this.model.description?[]:[this.model.description]}connect_signals(){super.connect_signals();const{description:e}=this.model.properties;this.on_change(e,()=>this.update_children())}stylesheets(){return[...super.stylesheets(),r.default,h.default]}render(){super.render();const e=(0,c.div)({class:p.icon});this.desc_el=(0,c.div)({class:p.description},e),this.model.description.target=this.desc_el;let s=!1;const t=t=>{this.model.description.setv({visible:t,closable:s}),e.classList.toggle(p.opaque,t&&s)};this.on_change(this.model.description.properties.visible,()=>{const{visible:e}=this.model.description;e||(s=!1),t(e)}),this.desc_el.addEventListener("mouseenter",()=>{t(!0)}),this.desc_el.addEventListener("mouseleave",()=>{s||t(!1)}),document.addEventListener("mousedown",e=>{const i=e.composedPath(),o=this._child_views.get(this.model.description);void 0!==o&&i.includes(o.el)||(i.includes(this.desc_el)?(s=!s,t(s)):(s=!1,t(!1)))}),window.addEventListener("blur",()=>{s=!1,t(!1)}),this.shadow_el.appendChild((0,c.label)(this.desc_el))}}t.TooltipIconView=TooltipIconView;class TooltipIcon extends n.LayoutDOM{static __module__="panel.models.widgets";constructor(e){super(e)}static{this.prototype.default_view=TooltipIconView,this.define(({Ref:e})=>({description:[e(d.Tooltip),new d.Tooltip]}))}}t.TooltipIcon=TooltipIcon},
|
|
253
253
|
"eb967020e9": function _(t,e,i,l,o){l();const s=t("00beb93e38"),h=t("@bokehjs/core/build_views"),a=t("@bokehjs/models/plots"),n=t("@bokehjs/models/glyphs"),d=t("@bokehjs/core/dom"),r=t("@bokehjs/models/sources/column_data_source"),c=t("@bokehjs/models/formatters");class TrendIndicatorView extends s.HTMLBoxView{containerDiv;textDiv;titleDiv;valueDiv;value2Div;changeDiv;plotDiv;plot;_value_format;_value_change_format;initialize(){super.initialize(),this.containerDiv=(0,d.div)({style:{height:"100%",width:"100%"}}),this.titleDiv=(0,d.div)({style:{font_size:"1em",word_wrap:"break-word"}}),this.valueDiv=(0,d.div)({style:{font_size:"2em"}}),this.value2Div=(0,d.div)({style:{font_size:"1em",opacity:"0.5",display:"inline"}}),this.changeDiv=(0,d.div)({style:{font_size:"1em",opacity:"0.5",display:"inline"}}),this.textDiv=(0,d.div)({},this.titleDiv,this.valueDiv,(0,d.div)({},this.changeDiv,this.value2Div)),this.updateTitle(),this.updateValue(),this.updateValue2(),this.updateValueChange(),this.updateTextFontSize(),this.plotDiv=(0,d.div)({}),this.containerDiv=(0,d.div)({style:{height:"100%",width:"100%"}},this.textDiv,this.plotDiv),this.updateLayout()}connect_signals(){super.connect_signals();const{pos_color:t,neg_color:e,plot_color:i,plot_type:l,width:o,height:s,sizing_mode:h,title:a,value:n,value_change:d,layout:r}=this.model.properties;this.on_change([t,e],()=>this.updateValueChange()),this.on_change([i,l,o,s,h],()=>this.rerender_()),this.on_change(a,()=>this.updateTitle(!0)),this.on_change(n,()=>this.updateValue(!0)),this.on_change(d,()=>this.updateValue2(!0)),this.on_change(r,()=>this.updateLayout())}async render(){super.render(),this.shadow_el.appendChild(this.containerDiv),await this.setPlot()}async setPlot(){this.plot=new a.Plot({background_fill_color:null,border_fill_color:null,outline_line_color:null,min_border:0,sizing_mode:"stretch_both",toolbar_location:null});const t=this.model.source;if("line"===this.model.plot_type){const e=new n.Line({x:{field:this.model.plot_x},y:{field:this.model.plot_y},line_width:4,line_color:this.model.plot_color});this.plot.add_glyph(e,t)}else if("step"===this.model.plot_type){const e=new n.Step({x:{field:this.model.plot_x},y:{field:this.model.plot_y},line_width:3,line_color:this.model.plot_color});this.plot.add_glyph(e,t)}else if("area"===this.model.plot_type){const e=new n.VArea({x:{field:this.model.plot_x},y1:{field:this.model.plot_y},y2:0,fill_color:this.model.plot_color,fill_alpha:.5});this.plot.add_glyph(e,t);const i=new n.Line({x:{field:this.model.plot_x},y:{field:this.model.plot_y},line_width:3,line_color:this.model.plot_color});this.plot.add_glyph(i,t)}else{const e=new n.VBar({x:{field:this.model.plot_x},top:{field:this.model.plot_y},width:.9,line_color:null,fill_color:this.model.plot_color});this.plot.add_glyph(e,t)}const e=await(0,h.build_view)(this.plot);this.plotDiv.innerHTML="",e.render_to(this.plotDiv)}after_layout(){super.after_layout(),this.updateTextFontSize()}updateTextFontSize(){this.updateTextFontSizeColumn()}updateTextFontSizeColumn(){let t=this.containerDiv.clientWidth,e=this.containerDiv.clientHeight;"column"===this.model.layout?e=Math.round(e/2):t=Math.round(t/2);const i=t/this.model.title.length*2,l=t/(2*this._value_format.length)*1.8,o=t/(this._value_change_format.length+1)*2,s=e/6,h=Math.min(i,l,o,s);this.textDiv.style.fontSize=`${Math.trunc(h)}px`,this.textDiv.style.lineHeight="1.3"}updateTitle(t=!1){this.titleDiv.innerText=this.model.title,t&&this.updateTextFontSize()}updateValue(t=!1){this._value_format=this.model.formatter.doFormat([this.model.value],{loc:0})[0],this.valueDiv.innerText=this._value_format,t&&this.updateTextFontSize()}updateValue2(t=!1){this._value_change_format=this.model.change_formatter.doFormat([this.model.value_change],{loc:0})[0],this.value2Div.innerText=this._value_change_format,this.updateValueChange(),t&&this.updateTextFontSize()}updateValueChange(){this.model.value_change>0?(this.changeDiv.innerHTML="▲",this.changeDiv.style.color=this.model.pos_color):this.model.value_change<0?(this.changeDiv.innerHTML="▼",this.changeDiv.style.color=this.model.neg_color):(this.changeDiv.innerHTML=" ",this.changeDiv.style.color="inherit")}updateLayout(){"column"===this.model.layout?(this.containerDiv.style.display="block",this.textDiv.style.height="50%",this.textDiv.style.width="100%",this.plotDiv.style.height="50%",this.plotDiv.style.width="100%"):(this.containerDiv.style.display="flex",this.textDiv.style.height="100%",this.textDiv.style.width="",this.plotDiv.style.height="100%",this.plotDiv.style.width="",this.textDiv.style.flex="1",this.plotDiv.style.flex="1"),this._has_finished&&this.invalidate_layout()}}i.TrendIndicatorView=TrendIndicatorView;class TrendIndicator extends s.HTMLBox{constructor(t){super(t)}static __module__="panel.models.trend";static{this.prototype.default_view=TrendIndicatorView,this.define(({Float:t,Str:e,Ref:i})=>({description:[e,""],formatter:[i(c.TickFormatter),()=>new c.BasicTickFormatter],change_formatter:[i(c.TickFormatter),()=>new c.NumeralTickFormatter],layout:[e,"column"],source:[i(r.ColumnDataSource)],plot_x:[e,"x"],plot_y:[e,"y"],plot_color:[e,"#428bca"],plot_type:[e,"bar"],pos_color:[e,"#5cb85c"],neg_color:[e,"#d9534f"],title:[e,""],value:[t,0],value_change:[t,0]}))}}i.TrendIndicator=TrendIndicator},
|
|
254
|
-
"
|
|
254
|
+
"f71ac626f9": function _(e,t,s,i,a){i();const n=e("@bokehjs/core/dom"),o=e("@bokehjs/core/bokeh_events"),r=e("@bokehjs/core/util/types"),d=e("@bokehjs/models/layouts/layout_dom"),l=e("00beb93e38"),h=e("133ce95cfa"),c=e("99a25e6992");class VegaEvent extends o.ModelEvent{data;constructor(e){super(),this.data=e}get event_values(){return{model:this.origin,data:this.data}}static{this.prototype.event_name="vega_event"}}s.VegaEvent=VegaEvent;class VegaPlotView extends d.LayoutDOMView{vega_view;container;_connected=new Set;_listeners=new Set;_dirty_sources=new Set;_data_update=null;_replot;_replot_pending=!1;_embed_id=0;_resize;_rendered=!1;async lazy_initialize(){await super.lazy_initialize();const e=await(0,h.await_resources)(this.model);null!=e&&(0,h.render_resource_error)(this,e,d.LayoutDOMView.prototype.render)}connect_signals(){super.connect_signals();const{data:e,show_actions:t,theme:s,data_sources:i,events:a}=this.model.properties;this._replot=(0,c.debounce)(()=>this._plot(),20),this.on_change([e,t,s],()=>{this._replot_pending=!0,this._replot()}),this.on_change(i,()=>this._connect_sources()),this.on_change(a,()=>this._add_listeners()),this._connect_sources()}_connect_sources(){for(const e in this.model.data_sources){const t=this.model.data_sources[e];this._connected.has(t)||(this.connect(t.properties.data.change,()=>this._source_changed(e)),this._connected.add(t))}}_source_changed(e){this._dirty_sources.add(e),null==this._data_update&&(this._data_update=Promise.resolve().then(()=>{this._data_update=null,this._update_data()}))}_update_data(){if(0===this._dirty_sources.size||this._replot_pending)return void this._dirty_sources.clear();const e=this.vega_view;if(null==e)return;const t=[...this._dirty_sources];this._dirty_sources.clear();for(const s of t){const t=this.model.data_sources[s];if(null==t)continue;const i=this._fetch_dataset(t),a=this._store_values(s,i);try{e.data(a,i)}catch{return this._replot_pending=!0,void this._replot()}}e.runAsync()}remove(){this._embed_id++,this.vega_view?.finalize(),this.vega_view=null,super.remove()}_dispatch_event(e,t){if("vlPoint"in t&&null!=t.vlPoint.or){const e=[];for(const s of t.vlPoint.or)if(void 0!==s._vgsid_)e.push(s._vgsid_);else for(const t in s)s.hasOwnProperty(t)&&e.push({[t]:s[t]});t=e}this.model.trigger_event(new VegaEvent({type:e,value:t}))}_fetch_dataset(e){const t=[],s=e.columns();for(let i=0;i<e.get_length();i++){const a={};for(const t of s)a[t]=e.data[t][i];t.push(a)}return t}_store_values(e,t){const{data:s}=this.model;if("data"===e&&null!=s.data&&!(0,r.isArray)(s.data))return s.data.values=t,s.data.name??"source_0";if(null!=s.data){const i=(0,r.isArray)(s.data)?s.data:[s.data];for(const s of i)if(s.name===e)return s.values=t,e}return s.datasets=s.datasets??{},s.datasets[e]=t,e}get child_models(){return[]}render(){super.render(),this._rendered=!1,this.container=(0,n.div)(),(0,l.set_size)(this.container,this.model),this._plot(),this.shadow_el.append(this.container)}_plot(){this._replot_pending=!1;if(null==this.model.data||!window.vegaEmbed)return;for(const e in this.model.data_sources)this._store_values(e,this._fetch_dataset(this.model.data_sources[e]));this._dirty_sources.clear();const e={actions:this.model.show_actions,theme:this.model.theme};this.vega_view?.finalize(),this.vega_view=null,this._listeners.clear();const t=++this._embed_id;window.vegaEmbed(this.container,this.model.data,e).then(e=>{t===this._embed_id?(this.vega_view=e.view,this._resize=(0,c.debounce)(()=>this.resize_view(e.view),50),this._add_listeners(),this._update_data()):e.view.finalize()})}_add_listeners(){const e=this.vega_view;if(null!=e)for(const t of this.model.events){if(this._listeners.has(t))continue;this._listeners.add(t);const s=(e,t)=>this._dispatch_event(e,t),i=this.model.throttle[t]||20;e.addSignalListener(t,(0,c.debounce)(s,i,!1))}}after_layout(){super.after_layout(),null!=this.vega_view&&this._resize()}resize_view(e){const t=e._renderer.canvas();if(!this._rendered&&null!==t){for(const t of e._eventListeners)"resize"===t.type&&t.handler(new Event("resize"));this._rendered=!0}}}s.VegaPlotView=VegaPlotView;class VegaPlot extends d.LayoutDOM{constructor(e){super(e)}static __module__="panel.models.vega";static{this.prototype.default_view=VegaPlotView,this.define(({Any:e,List:t,Bool:s,Nullable:i,Str:a})=>({data:[e,{}],data_sources:[e,{}],events:[t(a),[]],show_actions:[s,!1],theme:[i(a),null],throttle:[e,{}]})),(0,h.define_external_resources)(this)}initialize(){super.initialize(),(0,h.load_resources)(this)}}s.VegaPlot=VegaPlot},
|
|
255
255
|
"e8830cc759": function _(e,t,i,s,o){s();const l=e("tslib"),d=e("@bokehjs/core/dom"),h=e("00beb93e38"),u=l.__importDefault(e("dfe21e6f1b"));class VideoView extends h.HTMLBoxView{video_el;_time;_blocked=!1;_setting=!1;initialize(){super.initialize(),this._time=Date.now()}connect_signals(){super.connect_signals();const{loop:e,paused:t,muted:i,autoplay:s,time:o,value:l,volume:d}=this.model.properties;this.on_change(e,()=>this.set_loop()),this.on_change(t,()=>this.set_paused()),this.on_change(i,()=>this.set_muted()),this.on_change(s,()=>this.set_autoplay()),this.on_change(o,()=>this.set_time()),this.on_change(l,()=>this.set_value()),this.on_change(d,()=>this.set_volume())}stylesheets(){return[...super.stylesheets(),u.default]}render(){super.render(),this.video_el=document.createElement("video");const e=document.createElement("div");e.className="pn-video-container",e.style.height="100%",e.style.width="100%";const{sizing_mode:t}=this.model;if(null==t||"fixed"===t){const{width:e,height:t}=this.model;null!=e&&(this.video_el.width=e),null!=t&&(this.video_el.height=t)}const{max_width:i,max_height:s}=this.model;null!=i&&(this.video_el.style.maxWidth=(0,d.px)(i)),null!=s&&(this.video_el.style.maxHeight=(0,d.px)(s)),this.video_el.controls=!0,this.video_el.src=this.model.value,this.video_el.currentTime=this.model.time,this.video_el.loop=this.model.loop,this.video_el.muted=this.model.muted,this.video_el.autoplay=this.model.autoplay,null!=this.model.volume?this.video_el.volume=this.model.volume/100:this.model.volume=100*this.video_el.volume,this.video_el.onpause=()=>this.model.paused=!0,this.video_el.onplay=()=>this.model.paused=!1,this.video_el.ontimeupdate=()=>this.update_time(),this.video_el.onvolumechange=()=>this.update_volume(),e.append(this.video_el),this.shadow_el.append(e),this.model.paused||this.video_el.play()}update_time(){this._setting?this._setting=!1:Date.now()-this._time<this.model.throttle||(this._blocked=!0,this.model.time=this.video_el.currentTime,this._time=Date.now())}update_volume(){this._setting?this._setting=!1:(this._blocked=!0,this.model.volume=100*this.video_el.volume)}set_loop(){this.video_el.loop=this.model.loop}set_muted(){this.video_el.muted=this.model.muted}set_autoplay(){this.video_el.autoplay=this.model.autoplay}set_paused(){const{paused:e}=this.model;!this.video_el.paused&&e&&this.video_el.pause(),this.video_el.paused&&!e&&this.video_el.play()}set_volume(){if(this._blocked)return void(this._blocked=!1);this._setting=!0;const{volume:e}=this.model;null!=e&&(this.video_el.volume=e/100)}set_time(){this._blocked?this._blocked=!1:(this._setting=!0,this.video_el.currentTime=this.model.time)}set_value(){this.video_el.src=this.model.value}}i.VideoView=VideoView;class Video extends h.HTMLBox{constructor(e){super(e)}static __module__="panel.models.widgets";static{this.prototype.default_view=VideoView,this.define(({Bool:e,Int:t,Float:i,Str:s,Nullable:o})=>({loop:[e,!1],paused:[e,!0],muted:[e,!1],autoplay:[e,!1],time:[i,0],throttle:[t,250],value:[s,""],volume:[o(t),null]}))}}i.Video=Video},
|
|
256
256
|
"dfe21e6f1b": function _(i,t,e,f,d){f(),e.default="video{object-fit:fill;width:100%;height:100%;}"},
|
|
257
257
|
"73b5826147": function _(e,t,i,s,o){s();const h=e("00beb93e38");class VideoStreamView extends h.HTMLBoxView{videoEl;canvasEl;constraints={audio:!1,video:!0};timer;initialize(){super.initialize(),null!==this.model.timeout&&this.set_timeout()}connect_signals(){super.connect_signals();const{timeout:e,snapshot:t,paused:i}=this.model.properties;this.on_change(e,()=>this.set_timeout()),this.on_change(t,()=>this.snapshot()),this.on_change(i,()=>this.pause())}pause(){this.model.paused?(null!=this.timer&&(clearInterval(this.timer),this.timer=null),this.videoEl.pause()):this.videoEl.play(),this.set_timeout()}set_timeout(){this.timer&&(clearInterval(this.timer),this.timer=null),null!=this.model.timeout&&this.model.timeout>0&&(this.timer=setInterval(()=>this.snapshot(),this.model.timeout))}snapshot(){this.canvasEl.width=this.videoEl.videoWidth,this.canvasEl.height=this.videoEl.videoHeight;const e=this.canvasEl.getContext("2d");e&&e.drawImage(this.videoEl,0,0,this.canvasEl.width,this.canvasEl.height),this.model.value=this.canvasEl.toDataURL(`image/${this.model.format}`,.95)}remove(){super.remove(),this.timer&&(clearInterval(this.timer),this.timer=null)}render(){super.render(),this.videoEl||(this.videoEl=document.createElement("video"),this.model.sizing_mode&&"fixed"!==this.model.sizing_mode||(this.model.height&&(this.videoEl.height=this.model.height),this.model.width&&(this.videoEl.width=this.model.width)),this.videoEl.style.objectFit="fill",this.videoEl.style.minWidth="100%",this.videoEl.style.minHeight="100%",this.canvasEl=document.createElement("canvas"),this.shadow_el.appendChild(this.videoEl),navigator.mediaDevices.getUserMedia&&navigator.mediaDevices.getUserMedia(this.constraints).then(e=>{this.videoEl.srcObject=e,this.model.paused||this.videoEl.play()}).catch(console.error))}}i.VideoStreamView=VideoStreamView;class VideoStream extends h.HTMLBox{constructor(e){super(e)}static __module__="panel.models.widgets";static{this.prototype.default_view=VideoStreamView,this.define(({Any:e,Bool:t,Int:i,Nullable:s,Str:o})=>({format:[o,"png"],paused:[t,!1],snapshot:[t,!1],timeout:[s(i),null],value:[e]})),this.override({height:240,width:320})}}i.VideoStream=VideoStream},
|
|
@@ -265,4 +265,4 @@ const r=t("@bokehjs/core/util/types");let o,s;const c={fontFamily:'"Helvetica Ne
|
|
|
265
265
|
"2d0f1e4d96": function _(e,t,i,s,n){s();const r=e("d44e946ae8"),o=e("df9946ff52");class VTKVolumePlotView extends r.AbstractVTKView{_controllerWidget;_vtk_image_data;connect_signals(){super.connect_signals();const{data:e,colormap:t,shadow:i,sampling:s,edge_gradient:n,rescale:r,ambient:a,diffuse:l,camera:d,specular:h,specular_power:c,display_volume:g,display_slices:p,slice_i:m,slice_j:u,slice_k:v,render_background:w,interpolation:y,controller_expanded:k,nan_opacity:P}=this.model.properties;this.on_change(e,()=>{this._vtk_image_data=(0,o.data2VTKImageData)(this.model.data),this.invalidate_render()}),this.on_change(t,()=>{this.colormap_selector.value=this.model.colormap;const e=new Event("change");this.colormap_selector.dispatchEvent(e)}),this.on_change(i,()=>{this.shadow_selector.value=this.model.shadow?"1":"0";const e=new Event("change");this.shadow_selector.dispatchEvent(e)}),this.on_change(s,()=>{this.sampling_slider.value=this.model.sampling.toFixed(2);const e=new Event("input");this.sampling_slider.dispatchEvent(e)}),this.on_change(n,()=>{this.edge_gradient_slider.value=this.model.edge_gradient.toFixed(2);const e=new Event("input");this.edge_gradient_slider.dispatchEvent(e)}),this.on_change(r,()=>{this._controllerWidget.setRescaleColorMap(this.model.rescale),this._vtk_renwin.getRenderWindow().render()}),this.on_change(a,()=>{this.volume.getProperty().setAmbient(this.model.ambient),this._vtk_renwin.getRenderWindow().render()}),this.on_change(l,()=>{this.volume.getProperty().setDiffuse(this.model.diffuse),this._vtk_renwin.getRenderWindow().render()}),this.on_change(d,()=>{this._setting_camera||(this._set_camera_state(),this._vtk_renwin.getRenderWindow().render())}),this.on_change(h,()=>{this.volume.getProperty().setSpecular(this.model.specular),this._vtk_renwin.getRenderWindow().render()}),this.on_change(c,()=>{this.volume.getProperty().setSpecularPower(this.model.specular_power),this._vtk_renwin.getRenderWindow().render()}),this.on_change(g,()=>{this._set_volume_visibility(this.model.display_volume),this._vtk_renwin.getRenderWindow().render()}),this.on_change(p,()=>{this._set_slices_visibility(this.model.display_slices),this._vtk_renwin.getRenderWindow().render()}),this.on_change(m,()=>{void 0!==this.image_actor_i&&(this.image_actor_i.getMapper().setISlice(this.model.slice_i),this._vtk_renwin.getRenderWindow().render())}),this.on_change(u,()=>{void 0!==this.image_actor_j&&(this.image_actor_j.getMapper().setJSlice(this.model.slice_j),this._vtk_renwin.getRenderWindow().render())}),this.on_change(v,()=>{void 0!==this.image_actor_k&&(this.image_actor_k.getMapper().setKSlice(this.model.slice_k),this._vtk_renwin.getRenderWindow().render())}),this.on_change(w,()=>{this._vtk_renwin.getRenderer().setBackground(...(0,o.hexToRGB)(this.model.render_background)),this._vtk_renwin.getRenderWindow().render()}),this.on_change(y,()=>{this._set_interpolation(this.model.interpolation),this._vtk_renwin.getRenderWindow().render()}),this.on_change(k,()=>{null!=this._controllerWidget&&this._controllerWidget.setExpanded(this.model.controller_expanded)}),this.on_change(P,()=>{const e=this.image_actor_i.getProperty().getScalarOpacity();e.get(["nodes"]).nodes[0].y=this.model.nan_opacity,e.modified(),this._vtk_renwin.getRenderWindow().render()})}render(){this._vtk_renwin=null,this._orientationWidget=null,this._axes=null,super.render(),this._create_orientation_widget(),this._set_axes(),this._vtk_renwin.getRenderer().resetCamera(),Object.keys(this.model.camera).length>0&&this._set_camera_state(),this._get_camera_state()}invalidate_render(){this._vtk_renwin=null,super.invalidate_render()}init_vtk_renwin(){this._vtk_renwin=o.vtkns.FullScreenRenderWindow.newInstance({rootContainer:this.shadow_el,container:this._vtk_container})}plot(){this._controllerWidget=o.vtkns.VolumeController.newInstance({size:[400,150],rescaleColorMap:this.model.rescale}),this._plot_volume(),this._plot_slices(),this._controllerWidget.setupContent(this._vtk_renwin.getRenderWindow(),this.volume,!0),this._controllerWidget.setContainer(this.el),this._controllerWidget.setExpanded(this.model.controller_expanded),this._connect_js_controls(),this._vtk_renwin.getRenderWindow().getInteractor(),this._vtk_renwin.getRenderWindow().getInteractor().setDesiredUpdateRate(45),this._set_volume_visibility(this.model.display_volume),this._set_slices_visibility(this.model.display_slices),this._vtk_renwin.getRenderer().setBackground(...(0,o.hexToRGB)(this.model.render_background)),this._set_interpolation(this.model.interpolation),this._set_camera_state()}get vtk_image_data(){return this._vtk_image_data||(this._vtk_image_data=(0,o.data2VTKImageData)(this.model.data)),this._vtk_image_data}get volume(){return this._vtk_renwin.getRenderer().getVolumes()[0]}get image_actor_i(){return this._vtk_renwin.getRenderer().getActors()[0]}get image_actor_j(){return this._vtk_renwin.getRenderer().getActors()[1]}get image_actor_k(){return this._vtk_renwin.getRenderer().getActors()[2]}get shadow_selector(){return this.el.querySelector(".js-shadow")}get edge_gradient_slider(){return this.el.querySelector(".js-edge")}get sampling_slider(){return this.el.querySelector(".js-spacing")}get colormap_selector(){return this.el.querySelector(".js-color-preset")}_connect_js_controls(){const{el:e}=this._controllerWidget.get("el");if(void 0!==e){e.querySelector(".js-button").addEventListener("click",()=>this.model.controller_expanded=this._controllerWidget.getExpanded())}this.colormap_selector.addEventListener("change",()=>{this.model.colormap=this.colormap_selector.value}),this.model.colormap?this.model.properties.colormap.change.emit():this.model.colormap=this.colormap_selector.value,this.shadow_selector.addEventListener("change",()=>{this.model.shadow=!!Number(this.shadow_selector.value)}),(this.model.shadow=!!Number(this.shadow_selector.value))&&this.model.properties.shadow.change.emit(),this.sampling_slider.addEventListener("input",()=>{const e=Number(this.sampling_slider.value);Math.abs(this.model.sampling-e)>=.005&&(this.model.sampling=e)}),Math.abs(this.model.sampling-Number(this.shadow_selector.value))>=.005&&this.model.properties.sampling.change.emit(),this.edge_gradient_slider.addEventListener("input",()=>{const e=Number(this.edge_gradient_slider.value);Math.abs(this.model.edge_gradient-e)>=.005&&(this.model.edge_gradient=e)}),Math.abs(this.model.edge_gradient-Number(this.edge_gradient_slider.value))>=.005&&this.model.properties.edge_gradient.change.emit()}_plot_slices(){const e=this._vtk_image_data,t=o.vtkns.ImageSlice.newInstance(),i=o.vtkns.ImageSlice.newInstance(),s=o.vtkns.ImageSlice.newInstance(),n=o.vtkns.ImageMapper.newInstance(),r=o.vtkns.ImageMapper.newInstance(),a=o.vtkns.ImageMapper.newInstance();n.setInputData(e),n.setISlice(this.model.slice_i),t.setMapper(n),r.setInputData(e),r.setJSlice(this.model.slice_j),i.setMapper(r),a.setInputData(e),a.setKSlice(this.model.slice_k),s.setMapper(a);const l=o.vtkns.PiecewiseFunction.newInstance(),d=this.volume.getProperty().getRGBTransferFunction(0),h=this.volume.getMapper().getInputData().getPointData().getScalars().getRange();l.removeAllPoints(),l.addPoint(h[0]-1,this.model.nan_opacity),l.addPoint(h[0],1),l.addPoint(h[1],1);const c=t.getProperty();i.setProperty(c),s.setProperty(c),c.setRGBTransferFunction(d),c.setScalarOpacity(l);const g=this._vtk_renwin.getRenderer();g.addActor(t),g.addActor(i),g.addActor(s)}_plot_volume(){const e=this.vtk_image_data,t=o.vtkns.Volume.newInstance(),i=o.vtkns.VolumeMapper.newInstance();t.setMapper(i),i.setInputData(e);const s=(e.getPointData().getScalars()||e.getPointData().getArrays()[0]).getRange(),n=o.vtkns.ColorTransferFunction.newInstance();if(null!=this.model.colormap){const e=o.vtkns.ColorTransferFunction.vtkColorMaps.getPresetByName(this.model.colormap);n.applyColorMap(e)}n.onModified(()=>this.model.mapper=(0,o.vtkLutToMapper)(n));const r=o.vtkns.PiecewiseFunction.newInstance(),a=.7*Math.sqrt(e.getSpacing().map(e=>e*e).reduce((e,t)=>e+t,0));i.setSampleDistance(a),t.getProperty().setRGBTransferFunction(0,n),t.getProperty().setScalarOpacity(0,r),t.getProperty().setInterpolationTypeToFastLinear(),t.getProperty().setScalarOpacityUnitDistance(0,o.vtkns.BoundingBox.getDiagonalLength(e.getBounds())/Math.max(...e.getDimensions())),t.getProperty().setGradientOpacityMinimumValue(0,0),t.getProperty().setGradientOpacityMaximumValue(0,.05*(s[1]-s[0])),t.getProperty().setShade(this.model.shadow),t.getProperty().setUseGradientOpacity(0,!0),t.getProperty().setGradientOpacityMinimumOpacity(0,0),t.getProperty().setGradientOpacityMaximumOpacity(0,1),t.getProperty().setAmbient(this.model.ambient),t.getProperty().setDiffuse(this.model.diffuse),t.getProperty().setSpecular(this.model.specular),t.getProperty().setSpecularPower(this.model.specular_power),this._vtk_renwin.getRenderer().addVolume(t)}_set_interpolation(e){"fast_linear"==e?(this.volume.getProperty().setInterpolationTypeToFastLinear(),this.image_actor_i.getProperty().setInterpolationTypeToLinear()):"linear"==e?(this.volume.getProperty().setInterpolationTypeToLinear(),this.image_actor_i.getProperty().setInterpolationTypeToLinear()):(this.volume.getProperty().setInterpolationTypeToNearest(),this.image_actor_i.getProperty().setInterpolationTypeToNearest())}_set_slices_visibility(e){this.image_actor_i.setVisibility(e),this.image_actor_j.setVisibility(e),this.image_actor_k.setVisibility(e)}_set_volume_visibility(e){this.volume.setVisibility(e)}}i.VTKVolumePlotView=VTKVolumePlotView;class VTKVolumePlot extends r.AbstractVTKPlot{constructor(e){super(e)}static{this.prototype.default_view=VTKVolumePlotView,this.define(({Any:e,Array:t,Boolean:i,Int:s,Number:n,String:r,Struct:a})=>({ambient:[n,.2],colormap:[r],data:[e],diffuse:[n,.7],display_slices:[i,!1],display_volume:[i,!0],edge_gradient:[n,.2],interpolation:[o.Interpolation,"fast_linear"],mapper:[a({palette:t(r),low:n,high:n}),{palette:[],low:0,high:0}],nan_opacity:[n,1],render_background:[r,"#52576e"],rescale:[i,!1],sampling:[n,.4],shadow:[i,!0],slice_i:[s,0],slice_j:[s,0],slice_k:[s,0],specular:[n,.3],specular_power:[n,8],controller_expanded:[i,!0]})),this.override({height:300,width:300})}}i.VTKVolumePlot=VTKVolumePlot},
|
|
266
266
|
"04077eec70": function _(e,t,n,i,r){i();const s=e("@bokehjs/core/util/object"),o=e("99a25e6992"),c=e("d44e946ae8"),a=e("5e89c7b3eb"),h=e("df9946ff52"),d="panel";class VTKSynchronizedPlotView extends c.AbstractVTKView{_synchronizer_context;_arrays;registerArray;initialize(){super.initialize(),this._renderable=!1,this._synchronizer_context=h.vtkns.SynchronizableRenderWindow.getSynchronizerContext(`${d}-{this.model.id}`)}connect_signals(){super.connect_signals();const{arrays:e,scene:t,one_time_reset:n}=this.model.properties;this.on_change([e,t],(0,o.debounce)(()=>{this._vtk_renwin.delete(),this._vtk_renwin=null,this.invalidate_render()},20)),this.on_change(n,()=>{this._vtk_renwin.getRenderWindow().clearOneTimeUpdaters()})}init_vtk_renwin(){this._vtk_renwin=h.vtkns.FullScreenRenderWindowSynchronized.newInstance({rootContainer:this.el,container:this._vtk_container,synchronizerContext:this._synchronizer_context})}remove(){this._vtk_renwin&&this._vtk_renwin.delete(),super.remove()}plot(){this._vtk_renwin.getRenderWindow().clearOneTimeUpdaters();const e=(0,s.clone)(this.model.scene);this._sync_plot(e,()=>this._on_scene_ready()).then(()=>{this._set_camera_state(),this._get_camera_state()})}_on_scene_ready(){this._renderable=!0,this._camera_callbacks.push(this._vtk_renwin.getRenderer().getActiveCamera().onModified(()=>this._vtk_render())),this._orientationWidget||this._create_orientation_widget(),this._axes||this._set_axes(),this._vtk_renwin.resize(),this._vtk_render()}_sync_plot(e,t){this._renderable=!1,this._unsubscribe_camera_cb(),this._synchronizer_context.setFetchArrayFunction(e=>Promise.resolve(this.model.arrays[e]));const n=this._synchronizer_context.getInstance(this.model.scene.dependencies[0].id);return n&&!this._vtk_renwin.getRenderer()&&this._vtk_renwin.getRenderWindow().addRenderer(n),this._vtk_renwin.getRenderWindow().synchronize(e).then(t)}}n.VTKSynchronizedPlotView=VTKSynchronizedPlotView;class VTKSynchronizedPlot extends c.AbstractVTKPlot{outline;outline_actor;static __module__="panel.models.vtk";constructor(e){super(e),(0,a.initialize_fullscreen_render)(),this.outline=h.vtkns.OutlineFilter.newInstance();const t=h.vtkns.Mapper.newInstance();t.setInputConnection(this.outline.getOutputPort()),this.outline_actor=h.vtkns.Actor.newInstance(),this.outline_actor.setMapper(t)}getActors(e){let t=this.renderer_el.getRenderer().getActors();if(e){const n=this.renderer_el.getSynchronizerContext(d);t=t.filter(t=>{const i=n.getInstanceId(t);return!!i&&i.slice(-16)==e.slice(1,17)})}return t}static{this.prototype.default_view=VTKSynchronizedPlotView,this.define(({Any:e,Array:t,Boolean:n,Bytes:i,Dict:r,String:s})=>({arrays:[r(i),{}],arrays_processed:[t(s),[]],enable_keybindings:[n,!1],one_time_reset:[n,!1],rebuild:[n,!1],scene:[e,{}]})),this.override({height:300,width:300})}}n.VTKSynchronizedPlot=VTKSynchronizedPlot},
|
|
267
267
|
"5e89c7b3eb": function _(e,n,o,t,r){t(),o.initialize_fullscreen_render=function(){const e={newInstance:window.vtk.macro.newInstance((e,n,o={})=>{Object.assign(n,l,o),window.vtk.macro.obj(e,n),window.vtk.macro.get(e,n,["renderWindow","openGLRenderWindow","interactor","rootContainer","container","controlContainer","synchronizerContext"]),function(e,n){n.renderWindow=i.vtkns.SynchronizableRenderWindow.newInstance({synchronizerContext:n.synchronizerContext}),n.openGLRenderWindow=i.vtkns.OpenGLRenderWindow.newInstance(),n.openGLRenderWindow.setContainer(n.container),n.renderWindow.addView(n.openGLRenderWindow),n.interactor=i.vtkns.RenderWindowInteractor.newInstance(),n.interactor.setInteractorStyle(i.vtkns.InteractorStyleTrackballCamera.newInstance()),n.interactor.setView(n.openGLRenderWindow),n.interactor.initialize(),n.interactor.bindEvents(n.container),e.getRenderer=()=>n.renderWindow.getRenderers()[0],e.removeController=()=>{const e=n.controlContainer;e&&e.parentNode.removeChild(e)},e.setControllerVisibility=e=>{n.controllerVisibility=e,n.controlContainer&&(n.controlContainer.style.display=e?"block":"none")},e.toggleControllerVisibility=()=>{e.setControllerVisibility(!n.controllerVisibility)},e.addController=o=>{n.controlContainer=document.createElement("div"),(0,i.applyStyle)(n.controlContainer,n.controlPanelStyle||a),n.rootContainer.appendChild(n.controlContainer),n.controlContainer.innerHTML=o,e.setControllerVisibility(n.controllerVisibility),n.rootContainer.addEventListener("keypress",n=>{"c"===String.fromCharCode(n.charCode)&&e.toggleControllerVisibility()})},e.delete=window.vtk.macro.chain(e.setContainer,n.openGLRenderWindow.delete,e.delete),e.resize=()=>{const e=n.container.getBoundingClientRect(),o=window.devicePixelRatio||1;n.openGLRenderWindow.setSize(Math.floor(e.width*o),Math.floor(e.height*o)),n.resizeCallback&&n.resizeCallback(e),n.renderWindow.render()},e.setResizeCallback=o=>{n.resizeCallback=o,e.resize()},n.listenWindowResize&&window.addEventListener("resize",e.resize);e.resize()}(e,n)})};i.vtkns.FullScreenRenderWindowSynchronized=e};const i=e("df9946ff52"),l={containerStyle:null,controlPanelStyle:null,listenWindowResize:!0,resizeCallback:null,controllerVisibility:!0,synchronizerContextName:"default"},a={position:"absolute",left:"25px",top:"25px",backgroundColor:"white",borderRadius:"5px",listStyle:"none",padding:"5px 10px",margin:"0",display:"block",border:"solid 1px black",maxWidth:"calc(100vw - 70px)",maxHeight:"calc(100vh - 60px)",overflow:"auto"}},
|
|
268
|
-
}, "4e90918c0a", {"index":"4e90918c0a","models/index":"36236053e8","models/ace":"7b034b2ba5","models/layout":"00beb93e38","models/resources":"
|
|
268
|
+
}, "4e90918c0a", {"index":"4e90918c0a","models/index":"36236053e8","models/ace":"7b034b2ba5","models/layout":"00beb93e38","models/resources":"133ce95cfa","models/util":"aa07eb54cc","models/anywidget_component":"f4bc4e23b4","models/reactive_esm":"8e484b67b0","models/event-to-object":"e5a0036205","models/html":"e40e09e4dd","styles/models/html.css":"9b8139e439","styles/models/esm.css":"727a14f76b","models/audio":"fdf76c2b8b","models/browser":"f25f215a58","models/button":"29120fca73","models/button_icon":"7e77f478cb","models/icon":"ac804884fa","models/card":"a668a42a0f","models/column":"3967d78fb5","styles/models/card.css":"6342ac8e26","models/checkbox_button_group":"138d8a2ed1","models/chatarea_input":"a9ce3554f5","models/textarea_input":"2f8fe6797e","models/comm_manager":"5f6e6991cc","models/customselect":"519009caed","models/multiselect":"8653ba687c","models/tabulator":"ab964e46db","models/cell_formatters":"254387d0dc","models/data":"ce212d2be6","styles/models/tabulator.css":"b0fdc4e99b","models/datetime_picker":"7408873be7","models/datetime_slider":"47671196f6","models/deckgl":"609f06c18b","models/lumagl":"16d69e2b49","models/tooltips":"f8f8ea4284","models/discrete_player":"eee856b107","models/player":"ed49986321","models/echarts":"df5e7d36e5","models/feed":"56255f9c11","models/file_download":"a7746def5a","models/file_dropper":"bff8eeed36","styles/models/filedropper.css":"c03dd3c931","models/ipywidget":"fd4c3f6bc4","models/json":"19285971d9","models/jsoneditor":"372d3e3a52","styles/models/jsoneditor.css":"317a12d360","models/katex":"052b7b0298","models/location":"cc871e1a06","models/mathjax":"07688254ed","models/modal":"37ed29726e","styles/models/modal.css":"be4b4352c6","models/pdf":"87a65d7fb5","models/perspective":"7a00e4d590","styles/models/perspective.css":"2e2913ea54","models/plotly":"736be77caa","styles/models/plotly.css":"3d56c75186","models/progress":"443fb5cf42","models/quill":"3df70ba3b3","models/radio_button_group":"08a22fed1a","models/react_component":"da0e69965d","models/reactive_html":"44b7d77ba5","models/singleselect":"3766e0c917","models/speech_to_text":"95fa78f501","models/state":"188544eb0b","models/tabs":"c5ac7daa0f","models/terminal":"4fecff5c68","models/text_input":"e9d16ed037","models/text_to_speech":"1fb38b62cd","models/time_picker":"5e05e2d651","models/toggle_icon":"49efbd99ad","models/tooltip_icon":"aad04f1876","models/trend":"eb967020e9","models/vega":"f71ac626f9","models/video":"e8830cc759","styles/models/video.css":"dfe21e6f1b","models/videostream":"73b5826147","models/vizzu":"e8cb25b7b8","models/vtk/index":"c51f25e2a7","models/vtk/vtkjs":"f0476173e2","models/vtk/vtklayout":"d44e946ae8","models/vtk/util":"df9946ff52","models/vtk/vtkcolorbar":"db98967aab","models/vtk/vtkaxes":"a9b2ad3ad4","models/vtk/vtkvolume":"2d0f1e4d96","models/vtk/vtksynchronized":"04077eec70","models/vtk/panel_fullscreen_renwin_sync":"5e89c7b3eb"}, {});});
|