import"./svelte/svelte_internal_flags_async.js";import*as e from"./svelte/svelte_internal_client.js";import"./i18n-BldJSFLV.js";import{G as B}from"./utils.svelte-Ceck75cM.js";import{onMount as P}from"./svelte/svelte_svelte.js";import{S}from"./StreamingBar-b2qVLPYU.js";import{B as k}from"./Index.svelte_svelte_type_style_lang-Bv_DpXXD.js";import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_store.js";import"./index-Ds2meNS5.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";import"./IconButtonWrapper-Cljb5D-5.js";import"./MarkdownCode-C2b9iIxl.js";import"./prism-python-CpYAgONt.js";var C=e.from_html('<div><button class="toggle-button svelte-1uruprb" aria-label="Toggle Sidebar"><div class="chevron svelte-1uruprb"><span class="chevron-left svelte-1uruprb"></span></div></button> <div class="sidebar-content svelte-1uruprb"><!></div></div>');function R(f,r){e.push(r,!0);let c=e.prop(r,"open",15,!0),t=e.prop(r,"position",11,"left"),u=e.prop(r,"elem_classes",19,()=>[]),m=e.prop(r,"elem_id",3,""),h=e.prop(r,"onexpand",3,()=>{}),g=e.prop(r,"oncollapse",3,()=>{}),n=e.state(!1),o=e.state(!1),s,v=e.state(0),b=e.derived(()=>typeof r.width=="number"?`${r.width}px`:r.width),a=e.state(!1);function p(){if(!s.closest(".wrap"))return;const l=s.closest(".wrap")?.getBoundingClientRect();if(!l)return;const d=s.getBoundingClientRect(),_=t()==="left"?l.left:window.innerWidth-l.right;e.set(v,Math.max(0,d.width-_+30),!0)}P(()=>{s.closest(".wrap")?.classList.add("sidebar-parent"),p(),window.addEventListener("resize",p),(()=>{document.documentElement.style.setProperty("--overlap-amount",`${e.get(v)}px`)})(),e.set(n,!0);const d=window.matchMedia("(prefers-reduced-motion: reduce)");e.set(a,d.matches,!0);const _=M=>{e.set(a,M.matches,!0)};return d.addEventListener("change",_),()=>{window.removeEventListener("resize",p),d.removeEventListener("change",_)}}),e.user_effect(()=>{e.get(n)&&e.set(o,c(),!0)});let E=e.derived(()=>u()?.join(" ")||"");var i=C();let w;var x=e.child(i);x.__click=()=>{e.set(o,!e.get(o)),c(e.get(o)),e.get(o)?h()?.():g()?.()};var y=e.sibling(x,2),L=e.child(y);e.slot(L,r,"default",{},null),e.reset(y),e.reset(i),e.bind_this(i,l=>s=l,()=>s),e.template_effect(()=>{w=e.set_class(i,1,`sidebar ${e.get(E)??""}`,"svelte-1uruprb",w,{open:e.get(o),right:t()==="right","reduce-motion":e.get(a)}),e.set_attribute(i,"id",m()),e.set_style(i,`width: ${e.get(b)??""}; ${t()??""}: calc(${e.get(b)??""} * -1)`)}),e.append(f,i),e.pop()}e.delegate(["click"]);var z=e.from_html("<!> <!>",1);function oe(f,r){e.push(r,!0);const c=e.rest_props(r,["$$slots","$$events","$$legacy"]),t=new B(c);var u=z(),m=e.first_child(u);S(m,e.spread_props({get autoscroll(){return t.shared.autoscroll},get i18n(){return t.i18n}},()=>t.shared.loading_status));var h=e.sibling(m,2);{var g=n=>{R(n,{get width(){return t.props.width},onexpand:()=>t.dispatch("expand"),oncollapse:()=>t.dispatch("collapse"),get elem_classes(){return t.shared.elem_classes},get elem_id(){return t.shared.elem_id},get open(){return t.props.open},set open(o){t.props.open=o},get position(){return t.props.position},set position(o){t.props.position=o},children:(o,s)=>{k(o,{children:(v,b)=>{var a=e.comment(),p=e.first_child(a);e.slot(p,r,"default",{},null),e.append(v,a)},$$slots:{default:!0}})},$$slots:{default:!0}})};e.if(h,n=>{t.shared.visible&&n(g)})}e.append(f,u),e.pop()}export{oe as default};
