import{o as e}from"./chunk-CMxvf4Kt.js";import{i as t,o as n}from"./bundle-mjs-NviOedTj.js";import{a as r}from"./card-BIJl8bBv.js";import{Ga as i}from"./settings-DtMTlq96.js";import{Bn as a,n as o}from"./react-BDcLiltL.js";var s=t();function c({open:e,onOpenChange:t,description:n=(0,s.jsx)(s.Fragment,{children:`Load-time tuning. Changes apply on the next load; Reapply reloads the current model.`}),children:c}){return(0,s.jsxs)(`div`,{className:`mt-2 flex flex-col gap-3 border-t border-border/60 pt-4 pb-4`,children:[(0,s.jsxs)(`button`,{type:`button`,onClick:()=>t(!e),"aria-expanded":e,className:`flex items-center gap-2 rounded-lg px-3 py-1.5 text-left transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,s.jsx)(o,{icon:a,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,s.jsx)(`span`,{className:`min-w-0 flex-1 text-ui-13 font-medium leading-[1.25] tracking-nav text-foreground`,children:`Advanced`}),(0,s.jsx)(i,{className:r(`size-4 shrink-0 text-muted-foreground transition-transform`,e&&`rotate-180`)})]}),e&&(0,s.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,s.jsx)(`p`,{className:`text-ui-11 leading-snug text-muted-foreground`,children:n}),c]})]})}var l=e(n(),1);function u(){let[e,t]=(0,l.useState)(null),[n,i]=(0,l.useState)(!1),[a,o]=(0,l.useState)(!1),s=(0,l.useCallback)(e=>{let t=e.scrollTop>0;i(e=>e===t?e:t);let n=e.scrollHeight-e.scrollTop-e.clientHeight>1;o(e=>e===n?e:n)},[]);return(0,l.useEffect)(()=>{if(!e)return;let t=new ResizeObserver(()=>s(e));return t.observe(e),e.firstElementChild&&t.observe(e.firstElementChild),()=>t.disconnect()},[e,s]),{attach:t,onScroll:e=>s(e.currentTarget),className:r(n&&`is-scrolled`,a&&`is-bottom-faded`)}}export{c as n,u as t};