import{p as b,e as S,a as k}from"./i18n-Dnhn5Rxr.js";import{R as x,ae as P,a1 as f,G as D,w as n,a2 as I,t as M,a as O,T,a3 as g,U as v,W as q,x as y}from"./index-DWyDLubb.js";var z=q('<div class="gradio-bokeh svelte-dz29a8"></div>');function J(w,r){x(r,!1);const i=g();let o=b(r,"value",12),t=b(r,"bokeh_version",12);const s=`bokehDiv-${Math.random().toString(5).substring(2)}`;async function j(e){if(document&&document.getElementById(s)&&(document.getElementById(s).innerHTML=""),window.Bokeh){u();let l=JSON.parse(e);await window.Bokeh.embed.embed_item(l,s)}}const h=`https://cdn.bokeh.org/bokeh/release/bokeh-${t()}.min.js`,B=[`https://cdn.pydata.org/bokeh/release/bokeh-widgets-${t()}.min.js`,`https://cdn.pydata.org/bokeh/release/bokeh-tables-${t()}.min.js`,`https://cdn.pydata.org/bokeh/release/bokeh-gl-${t()}.min.js`,`https://cdn.pydata.org/bokeh/release/bokeh-api-${t()}.min.js`];let d=g(!1);async function E(){await Promise.all(B.map((e,l)=>new Promise(C=>{const a=document.createElement("script");return a.onload=C,a.src=e,document.head.appendChild(a),a}))),y(d,!0)}let p=[];function m(){p=E()}function u(){const e=document.createElement("script");return e.onload=m,e.src=h,document.head.querySelector(`script[src="${h}"]`)?m():document.head.appendChild(e),e}const _=t()?u():null;P(()=>{_ in document.children&&(document.removeChild(_),p.forEach(e=>document.removeChild(e)))}),f(()=>D(o()),()=>{y(i,o()?.plot)}),f(()=>(n(d),n(i)),()=>{n(d)&&j(n(i))}),I();var $={get value(){return o()},set value(e){o(e),v()},get bokeh_version(){return t()},set bokeh_version(e){t(e),v()}};S();var c=z();return k(c,"data-testid","bokeh"),M(()=>k(c,"id",s)),O(w,c),T($)}export{J as default};
