@tscircuit/runframe 0.0.1199 → 0.0.1200

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.
@@ -5424,7 +5424,7 @@ ${I.type}: ${O}
5424
5424
  50% { opacity: 0.2; }
5425
5425
  100% { opacity: 0.6; }
5426
5426
  }
5427
- `,r.appendChild(b)}})}};o();const s=new MutationObserver(o);return s.observe(r,{childList:!0,subtree:!1,characterData:!1}),()=>{s.disconnect()}},[n,t,e,i])},Vat=["#8B0000","#2F4F4F","#191970","#006400","#FF4500","#800080","#2E8B57","#B8860B","#C71585","#008B8B"],SLn=n=>{const{svgDivRef:e,circuitJson:t,circuitJsonKey:i,showGroups:r}=n;pe.useEffect(()=>{if(e.current&&e.current.querySelectorAll(".schematic-group-overlay").forEach(a=>a.remove()),!e.current||!r||!t||t.length===0)return;const o=setTimeout(()=>{if(!e.current)return;const s=e.current.querySelector("svg");if(!s)return;s.querySelectorAll(".schematic-group-overlay").forEach(c=>c.remove());try{const c=cg(t).source_group?.list().filter(b=>!b.is_subcircuit)||[],l=cg(t).schematic_component?.list()||[],u=new Map;c.forEach(b=>{const w=b;if(w.parent_source_group_id){const E=u.get(w.parent_source_group_id)||[];E.push(b.source_group_id),u.set(w.parent_source_group_id,E)}});const d=b=>{const w=[],E=u.get(b)||[];for(const k of E)w.push(k),w.push(...d(k));return w},h=b=>{const w=c.find(E=>E.source_group_id===b);return w?.parent_source_group_id?1+h(w.parent_source_group_id):0},p=c.length>0&&c.some(b=>b.name&&b.name.trim()!=="");let m=[];if(p){const b=new Map;for(const w of l){const E=cg(t).source_component.get(w.source_component_id);E?.source_group_id&&(b.has(E.source_group_id)||b.set(E.source_group_id,[]),b.get(E.source_group_id).push(w))}c.forEach((w,E)=>{let k=b.get(w.source_group_id)||[];const P=d(w.source_group_id);for(const I of P){const M=b.get(I)||[];k=[...k,...M]}if(k.length>0){const I=h(w.source_group_id),M=d(w.source_group_id).length>0;if(w.name?.startsWith("unnamed_board"))return;m.push({id:w.source_group_id,name:w.name||`Group ${E+1}`,components:k,color:Vat[E%Vat.length],depthLevel:I,hasChildren:M,sourceGroupId:w.source_group_id})}})}const _=s.viewBox.baseVal,g=s.getBoundingClientRect(),x=Math.min(g.width/_.width,g.height/_.height)||1;m.sort((b,w)=>b.depthLevel-w.depthLevel),m.forEach(b=>{if(b.components.length===0)return;const w=ELn(b.components,s);if(!w)return;const E=Math.max(8,Math.min(25,15/Math.max(x,.3))),k=b.hasChildren?E*.6:0,P=E+k,I=Math.max(1,2/Math.max(x,.5)),M=b.depthLevel===0?I:I*.7,N=Math.max(4,8/Math.max(x,.5)),C=b.hasChildren?1.3:1,U=N*C,O=U*.5,H=document.createElementNS("http://www.w3.org/2000/svg","rect");H.setAttribute("class","schematic-group-overlay"),H.setAttribute("x",(w.minX-P).toString()),H.setAttribute("y",(w.minY-P).toString()),H.setAttribute("width",(w.maxX-w.minX+P*2).toString()),H.setAttribute("height",(w.maxY-w.minY+P*2).toString()),H.setAttribute("fill","none"),H.setAttribute("stroke",b.color),H.setAttribute("stroke-width",M.toString()),H.setAttribute("stroke-dasharray",`${U},${O}`),H.setAttribute("opacity","0.8"),H.setAttribute("rx","0"),H.setAttribute("ry","0");const Y=Math.max(6,Math.min(20,14/Math.max(x,.2))),W=b.depthLevel===0||b.depthLevel===1?0:b.depthLevel*.2,K=Y*(1-W),J=Math.max(1,K*.2),se=b.name,de=document.createElementNS("http://www.w3.org/2000/svg","text");de.setAttribute("font-size",K.toString()),de.setAttribute("font-family","Arial, sans-serif"),de.textContent=se,s.appendChild(de);const ve=de.getBBox();s.removeChild(de);const re=ve.width+J*2,ue=K+J*2,me=w.minX-P,Me=w.minY-P-ue,ke=document.createElementNS("http://www.w3.org/2000/svg","rect");ke.setAttribute("class","schematic-group-overlay"),ke.setAttribute("x",me.toString()),ke.setAttribute("y",(Me-ue).toString()),ke.setAttribute("width",re.toString()),ke.setAttribute("height",ue.toString()),ke.setAttribute("fill","transparent"),ke.setAttribute("rx","0"),ke.setAttribute("ry","0");const ze=document.createElementNS("http://www.w3.org/2000/svg","text");ze.setAttribute("class","schematic-group-overlay"),ze.setAttribute("x",(me+J).toString()),ze.setAttribute("y",(Me+ue-J).toString()),ze.setAttribute("fill",b.color),ze.setAttribute("font-size",K.toString()),ze.setAttribute("font-family","Arial, sans-serif"),ze.setAttribute("font-weight",b.depthLevel===0?"600":"500"),ze.setAttribute("stroke",b.color),ze.setAttribute("stroke-width",Math.max(.2,K*.02).toString()),ze.textContent=se,s.appendChild(H),s.appendChild(ke),s.appendChild(ze)})}catch(c){console.error("Error creating group overlays:",c)}},10);return()=>clearTimeout(o)},[e,i,r])};function ELn(n,e){let t=1/0,i=1/0,r=-1/0,o=-1/0;for(const a of n){let c=e.querySelector(`g[data-schematic-component-id="${a.schematic_component_id}"]`);if(c||(c=e.querySelector(`[data-schematic-component-id="${a.schematic_component_id}"]`)),c){const l=c.getBBox();t=Math.min(t,l.x),i=Math.min(i,l.y),r=Math.max(r,l.x+l.width),o=Math.max(o,l.y+l.height)}}return t===1/0?null:{minX:t,minY:i,maxX:r,maxY:o}}var TLn=M0("schematic-viewer"),MLn=()=>{M0.enable("schematic-viewer*")},CLn=TLn,ALn=n=>{const[e,t]=pe.useState(0),[i,r]=pe.useState(0);return pe.useEffect(()=>{if(!n.current)return;const o=()=>{const a=n.current?.getBoundingClientRect();t(a?.width||0),r(a?.height||0)};o();const s=new ResizeObserver(o);return s.observe(n.current),window.addEventListener("resize",o),()=>{s.disconnect(),window.removeEventListener("resize",o)}},[]),{containerWidth:e,containerHeight:i}},PLn=CLn.extend("useComponentDragging"),RLn=({onEditEvent:n,editEvents:e=[],circuitJson:t,cancelDrag:i,svgToScreenProjection:r,realToSvgProjection:o,enabled:s=!1,snapToGrid:a=!1})=>{const[c,l]=pe.useState(null),u=No(o,r),d=pe.useRef(null),h=pe.useRef(null),p=pe.useRef(new Map);pe.useEffect(()=>{e.forEach(I=>{"edit_event_type"in I&&I.edit_event_type==="edit_schematic_component_location"&&!I.in_progress&&p.current.set(I.schematic_component_id,{...I.new_center})})},[e]);const m=pe.useCallback((I,M,N)=>{if(!s)return!1;const C=N.closest('[data-circuit-json-type="schematic_component"]');if(!C)return!1;const U=C.getAttribute("data-schematic-component-id");if(!U)return!1;i&&i();const O=cg(t).schematic_component.get(U);if(!O)return!1;d.current={x:I,y:M};let H;const Y=p.current.get(U);if(Y)H={...Y};else{const K=Hat({editEvents:e,schematic_component_id:U});H={x:O.center.x+K.x,y:O.center.y+K.y},p.current.set(U,{...H})}const W={edit_event_id:Math.random().toString(36).substr(2,9),edit_event_type:"edit_schematic_component_location",schematic_component_id:U,original_center:H,new_center:{...H},in_progress:!0,created_at:Date.now(),_element:C};return h.current=W,l(W),!0},[i,s,t,e]),_=pe.useCallback(I=>{m(I.clientX,I.clientY,I.target)},[m]),g=pe.useCallback(I=>{if(I.touches.length!==1)return;const M=I.touches[0];m(M.clientX,M.clientY,I.target)&&I.preventDefault()},[m]),x=pe.useCallback((I,M)=>{if(!h.current||!d.current)return;const N={x:I-d.current.x,y:M-d.current.y},C={x:N.x/u.a,y:N.y/u.d};let U={x:h.current.original_center.x+C.x,y:h.current.original_center.y+C.y};if(a){const H=Y=>Math.round(Y*10)/10;U={x:H(U.x),y:H(U.y)}}const O={...h.current,new_center:U};h.current=O,l(O)},[u,a]),b=pe.useCallback(I=>x(I.clientX,I.clientY),[x]),w=pe.useCallback(I=>{if(I.touches.length!==1||!h.current)return;I.preventDefault();const M=I.touches[0];x(M.clientX,M.clientY)},[x]),E=pe.useCallback(()=>{if(!h.current)return;const I={...h.current,in_progress:!1};p.current.set(I.schematic_component_id,{...I.new_center}),PLn("endDrag calling onEditEvent with new edit event",{newEditEvent:I}),n&&n(I),h.current=null,d.current=null,l(null)},[n]),k=pe.useCallback(()=>E(),[E]),P=pe.useCallback(()=>E(),[E]);return pe.useEffect(()=>(window.addEventListener("mousemove",b),window.addEventListener("mouseup",k),window.addEventListener("touchmove",w,{passive:!1}),window.addEventListener("touchend",P),()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",k),window.removeEventListener("touchmove",w),window.removeEventListener("touchend",P)}),[b,k,w,P]),{handleMouseDown:_,handleTouchStart:g,isDragging:!!h.current,activeEditEvent:c}},oC={schematicEditIcon:50,schematicGridIcon:49,spiceSimulationIcon:50,viewMenuIcon:48,viewMenu:55,viewMenuBackdrop:54,clickToInteractOverlay:100,schematicComponentHoverOutline:47},ILn=({onClick:n,active:e})=>{const t=i=>{i.preventDefault(),n()};return ce.jsx("div",{onClick:t,onTouchEnd:t,style:{position:"absolute",top:"16px",right:"64px",backgroundColor:e?"#4CAF50":"#fff",color:e?"#fff":"#000",padding:"8px",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:"4px",zIndex:oC.schematicEditIcon},children:ce.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[ce.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),ce.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})})},NLn=({onClick:n,active:e})=>{const t=i=>{i.preventDefault(),n()};return ce.jsx("div",{onClick:t,onTouchEnd:t,style:{position:"absolute",top:"56px",right:"64px",backgroundColor:e?"#4CAF50":"#fff",color:e?"#fff":"#000",padding:"8px",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:"4px",zIndex:oC.schematicGridIcon},children:ce.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:ce.jsx("path",{d:"M3 3h7v7H3zM14 3h7v7h-7zM3 14h7v7H3zM14 14h7v7h-7z"})})})},kLn=({onClick:n,active:e})=>{const t=i=>{i.preventDefault(),n()};return ce.jsx("div",{onClick:t,onTouchEnd:t,style:{position:"absolute",top:"16px",right:"16px",backgroundColor:e?"#4CAF50":"#fff",color:e?"#fff":"#000",padding:"8px",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:"4px",zIndex:oC.viewMenuIcon},children:ce.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[ce.jsx("circle",{cx:"12",cy:"12",r:"1"}),ce.jsx("circle",{cx:"12",cy:"5",r:"1"}),ce.jsx("circle",{cx:"12",cy:"19",r:"1"})]})})},OLn={version:"2.0.45"},LLn=({circuitJson:n,circuitJsonKey:e,isVisible:t,onClose:i,showGroups:r,onToggleGroups:o})=>{const s=pe.useMemo(()=>{if(!n||n.length===0)return!1;try{if((cg(n).source_group?.list()||[]).length>0)return!0;const c=cg(n).schematic_component?.list()||[];if(c.length>1){const l=new Set;for(const u of c){const d=cg(n).source_component.get(u.source_component_id);d?.ftype&&l.add(d.ftype)}return l.size>1}return!1}catch(a){return console.error("Error checking for groups:",a),!1}},[e]);return t?ce.jsxs(ce.Fragment,{children:[ce.jsx("div",{onClick:i,onTouchEnd:a=>{a.preventDefault(),i()},style:{position:"absolute",inset:0,backgroundColor:"transparent",zIndex:oC.viewMenuBackdrop}}),ce.jsxs("div",{style:{position:"absolute",top:"56px",right:"16px",backgroundColor:"#ffffff",color:"#000000",border:"1px solid #ccc",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",minWidth:"200px",zIndex:oC.viewMenu},children:[ce.jsxs("div",{onClick:()=>{s&&o(!r)},onTouchEnd:a=>{a.preventDefault(),s&&o(!r)},style:{padding:"8px 12px",cursor:s?"pointer":"not-allowed",opacity:s?1:.5,fontSize:"13px",color:"#000000",fontFamily:"sans-serif",display:"flex",alignItems:"center",gap:"8px"},onMouseEnter:a=>{s&&(a.currentTarget.style.backgroundColor="#f0f0f0")},onMouseLeave:a=>{s&&(a.currentTarget.style.backgroundColor="transparent")},children:[ce.jsx("div",{style:{width:"16px",height:"16px",border:"2px solid #000",borderRadius:"2px",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",fontWeight:"bold"},children:r&&"✓"}),"View Schematic Groups"]}),!s&&ce.jsx("div",{style:{padding:"8px 12px",fontSize:"11px",color:"#666",fontStyle:"italic"},children:"No groups found in this schematic"}),ce.jsxs("div",{style:{padding:"4px 8px",fontSize:"12px",color:"#999",borderTop:"1px solid #eee",textAlign:"center"},children:["v",String(OLn?.version)]})]})]}):null},DLn=()=>ce.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:ce.jsx("path",{d:"M3 12h2.5l2.5-9 4 18 4-9h5.5"})}),zLn=({onClick:n})=>ce.jsx("div",{onClick:n,style:{position:"absolute",top:"16px",right:"112px",backgroundColor:"#fff",color:"#000",padding:"8px",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:"4px",zIndex:oC.spiceSimulationIcon},children:ce.jsx(DLn,{})});VG.register(Z8n,eLn,I8n,R8n,F8n,q8n,z8n);var XG=["#8884d8","#82ca9d","#ffc658","#ff7300","#387908"],Gat=n=>{if(n===0)return"0s";const e=Math.abs(n);let t="s",i=1;return e<1e-12?(t="fs",i=1e15):e<1e-9?(t="ps",i=1e12):e<1e-6?(t="ns",i=1e9):e<.001?(t="us",i=1e6):e<1&&(t="ms",i=1e3),`${parseFloat((n*i).toPrecision(3))}${t}`},$Ln=({plotData:n,nodes:e,isLoading:t,error:i,hasRun:r})=>{const o=pe.useMemo(()=>{const c=e.some(u=>u.toLowerCase().startsWith("v(")),l=e.some(u=>u.toLowerCase().startsWith("i("));return c&&l?"Value":c?"Voltage (V)":l?"Current (A)":"Value"},[e]);if(t)return ce.jsx("div",{style:{height:"300px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:"Running simulation..."});if(!r)return ce.jsx("div",{style:{height:"300px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:'Click "Run" to start the simulation.'});if(i)return ce.jsxs("div",{style:{height:"300px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"red"},children:["Error: ",i]});if(n.length===0)return ce.jsx("div",{style:{height:"300px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:"No data to plot. Check simulation output or SPICE netlist."});const s={datasets:e.map((c,l)=>({label:c,data:n.map(u=>({x:Number(u.name),y:u[c]})),borderColor:XG[l%XG.length],backgroundColor:XG[l%XG.length],fill:!1,tension:.1}))},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"top",labels:{font:{family:"sans-serif"}}},title:{display:!1},tooltip:{callbacks:{title:c=>{if(c.length>0){const l=c[0];return Gat(l.parsed.x)}return""}}}},scales:{x:{type:"linear",title:{display:!0,text:"Time",font:{family:"sans-serif"}},ticks:{callback:c=>Gat(c),font:{family:"sans-serif"}}},y:{title:{display:!0,text:o,font:{family:"sans-serif"}},ticks:{font:{family:"sans-serif"}}}}};return ce.jsx("div",{style:{position:"relative",height:"300px",width:"100%"},children:ce.jsx(lLn,{options:a,data:s})})},FLn=({spiceString:n,onClose:e,plotData:t,nodes:i,isLoading:r,error:o,simOptions:s,onSimOptionsChange:a,hasRun:c})=>{const[l,u]=pe.useState(String(s.startTime)),[d,h]=pe.useState(String(s.duration));pe.useEffect(()=>{u(String(s.startTime)),h(String(s.duration))},[s.startTime,s.duration]);const p=()=>{a({...s,startTime:Number(l),duration:Number(d)})},m=i.filter(_=>{const g=_.toLowerCase().startsWith("v("),x=_.toLowerCase().startsWith("i(");return!!(s.showVoltage&&g||s.showCurrent&&x)});return ce.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1002,fontFamily:"sans-serif"},children:ce.jsxs("div",{style:{backgroundColor:"white",padding:"24px",borderRadius:"12px",width:"90%",maxWidth:"900px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)"},children:[ce.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px",borderBottom:"1px solid #eee",paddingBottom:"16px"},children:[ce.jsx("h2",{style:{margin:0,fontSize:"22px",fontWeight:600,color:"#333"},children:"SPICE Simulation"}),ce.jsx("button",{onClick:e,style:{background:"none",border:"none",fontSize:"28px",cursor:"pointer",color:"#888",padding:0,lineHeight:1},children:"×"})]}),ce.jsx("div",{children:ce.jsx($Ln,{plotData:t,nodes:m,isLoading:r,error:o,hasRun:c})}),ce.jsxs("div",{style:{marginTop:"16px",padding:"12px",backgroundColor:"#f7f7f7",borderRadius:"6px",display:"flex",flexWrap:"wrap",gap:"24px",alignItems:"center",fontSize:"14px"},children:[ce.jsxs("div",{style:{display:"flex",gap:"16px"},children:[ce.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[ce.jsx("input",{type:"checkbox",checked:s.showVoltage,onChange:_=>a({...s,showVoltage:_.target.checked})}),"Voltage"]}),ce.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[ce.jsx("input",{type:"checkbox",checked:s.showCurrent,onChange:_=>a({...s,showCurrent:_.target.checked})}),"Current"]})]}),ce.jsxs("div",{style:{display:"flex",gap:"16px",alignItems:"center"},children:[ce.jsx("label",{htmlFor:"startTime",children:"Start Time (ms):"}),ce.jsx("input",{id:"startTime",type:"number",value:l,onChange:_=>u(_.target.value),style:{width:"80px",padding:"4px 8px",borderRadius:"4px",border:"1px solid #ccc"}}),ce.jsx("label",{htmlFor:"duration",children:"Duration (ms):"}),ce.jsx("input",{id:"duration",type:"number",value:d,onChange:_=>h(_.target.value),style:{width:"80px",padding:"4px 8px",borderRadius:"4px",border:"1px solid #ccc"}}),ce.jsx("button",{onClick:p,style:{padding:"4px 12px",borderRadius:"4px",border:"1px solid #ccc",backgroundColor:"#f0f0f0",cursor:"pointer"},children:c?"Rerun":"Run"})]})]}),ce.jsxs("div",{style:{marginTop:"24px"},children:[ce.jsx("h3",{style:{marginTop:0,marginBottom:"12px",fontSize:"18px",fontWeight:600,color:"#333"},children:"SPICE Netlist"}),ce.jsx("pre",{style:{backgroundColor:"#fafafa",padding:"16px",borderRadius:"6px",maxHeight:"150px",overflowY:"auto",border:"1px solid #eee",color:"#333",fontSize:"13px",fontFamily:"monospace"},children:n})]})]})})},ULn="dmFyIGU9bnVsbCxzPWFzeW5jKCk9Pihhd2FpdCBpbXBvcnQoImh0dHBzOi8vY2RuLmpzZGVsaXZyLm5ldC9ucG0vZWVjaXJjdWl0LWVuZ2luZUAxLjUuMi8rZXNtIikpLlNpbXVsYXRpb24sYz1hc3luYygpPT57aWYoZSYmZS5pc0luaXRpYWxpemVkKCkpcmV0dXJuO2xldCBpPWF3YWl0IHMoKTtlPW5ldyBpLGF3YWl0IGUuc3RhcnQoKX07c2VsZi5vbm1lc3NhZ2U9YXN5bmMgaT0+e3RyeXtpZihhd2FpdCBjKCksIWUpdGhyb3cgbmV3IEVycm9yKCJTaW11bGF0aW9uIG5vdCBpbml0aWFsaXplZCIpO2xldCB0PWkuZGF0YS5zcGljZVN0cmluZyxhPXQubWF0Y2goL3dyZGF0YVxzKyhcUyspXHMrKC4qKS9pKTtpZihhKXtsZXQgbz1gLnByb2JlICR7YVsyXS50cmltKCkuc3BsaXQoL1xzKy8pLmpvaW4oIiAiKX1gO3Q9dC5yZXBsYWNlKC93cmRhdGEuKi9pLG8pfWVsc2UgaWYoIXQubWF0Y2goL1wucHJvYmUvaSkpdGhyb3cgdC5tYXRjaCgvcGxvdFxzKyguKikvaSk/bmV3IEVycm9yKCJUaGUgJ3Bsb3QnIGNvbW1hbmQgaXMgbm90IHN1cHBvcnRlZCBmb3IgZGF0YSBleHRyYWN0aW9uLiBQbGVhc2UgdXNlICd3cmRhdGEgPGZpbGVuYW1lPiA8dmFyMT4gLi4uJyBvciAnLnByb2JlIDx2YXIxPiAuLi4nIGluc3RlYWQuIik6bmV3IEVycm9yKCJObyAnLnByb2JlJyBvciAnd3JkYXRhJyBjb21tYW5kIGZvdW5kIGluIFNQSUNFIGZpbGUuIFVzZSAnd3JkYXRhIDxmaWxlbmFtZT4gPHZhcjE+IC4uLicgdG8gc3BlY2lmeSBvdXRwdXQuIik7ZS5zZXROZXRMaXN0KHQpO2xldCBuPWF3YWl0IGUucnVuU2ltKCk7c2VsZi5wb3N0TWVzc2FnZSh7dHlwZToicmVzdWx0IixyZXN1bHQ6bn0pfWNhdGNoKHQpe3NlbGYucG9zdE1lc3NhZ2Uoe3R5cGU6ImVycm9yIixlcnJvcjp0Lm1lc3NhZ2V9KX19Owo=",WG=null,BLn=()=>{if(typeof window>"u")return null;if(WG)return WG;try{const n=new Blob([atob(ULn)],{type:"application/javascript"});return WG=URL.createObjectURL(n),WG}catch(n){return console.error("Failed to create blob URL for worker",n),null}},jLn=n=>{const e={};if(n.dataType==="real")n.data.forEach(a=>{e[a.name]=a.values});else if(n.dataType==="complex")n.data.forEach(a=>{e[a.name]=a.values.map(c=>c.real)});else throw new Error("Unsupported data type in simulation result");const t=Object.keys(e).find(a=>a.toLowerCase()==="time"||a.toLowerCase()==="frequency");if(!t)throw new Error("No time or frequency data in simulation result");const i=e[t],r=Object.keys(e).filter(a=>a!==t),o=r;return{plotData:i.map((a,c)=>{const l={name:a.toExponential(2)};return r.forEach(u=>{l[u]=e[u][c]}),l}),nodes:o}},HLn=n=>{const[e,t]=pe.useState([]),[i,r]=pe.useState([]),[o,s]=pe.useState(!0),[a,c]=pe.useState(null);return pe.useEffect(()=>{if(!n){s(!1),t([]),r([]),c(null);return}s(!0),c(null),t([]),r([]);const l=BLn();if(!l){c("Could not create SPICE simulation worker."),s(!1);return}const u=new Worker(l,{type:"module"});return u.onmessage=d=>{if(d.data.type==="result")try{const{plotData:h,nodes:p}=jLn(d.data.result);t(h),r(p)}catch(h){c(h.message||"Failed to parse simulation result"),console.error(h)}else d.data.type==="error"&&c(d.data.error);s(!1)},u.onerror=d=>{c(d.message),s(!1)},u.postMessage({spiceString:n}),()=>{u.terminate()}},[n]),{plotData:e,nodes:i,isLoading:o,error:a}},l1e=n=>{if(n===0)return"0";const e=Math.abs(n),t=i=>i.toPrecision(4);return e>=1?t(n):e>=.001?`${t(n*1e3)}m`:e>=1e-6?`${t(n*1e6)}u`:e>=1e-9?`${t(n*1e9)}n`:e>=1e-12?`${t(n*1e12)}p`:e>=1e-15?`${t(n*1e15)}f`:n.toExponential(3)},VLn=(n,e)=>{const i=yLn(n).toSpiceString(),o=i.split(`
5427
+ `,r.appendChild(b)}})}};o();const s=new MutationObserver(o);return s.observe(r,{childList:!0,subtree:!1,characterData:!1}),()=>{s.disconnect()}},[n,t,e,i])},Vat=["#8B0000","#2F4F4F","#191970","#006400","#FF4500","#800080","#2E8B57","#B8860B","#C71585","#008B8B"],SLn=n=>{const{svgDivRef:e,circuitJson:t,circuitJsonKey:i,showGroups:r}=n;pe.useEffect(()=>{if(e.current&&e.current.querySelectorAll(".schematic-group-overlay").forEach(a=>a.remove()),!e.current||!r||!t||t.length===0)return;const o=setTimeout(()=>{if(!e.current)return;const s=e.current.querySelector("svg");if(!s)return;s.querySelectorAll(".schematic-group-overlay").forEach(c=>c.remove());try{const c=cg(t).source_group?.list().filter(b=>!b.is_subcircuit)||[],l=cg(t).schematic_component?.list()||[],u=new Map;c.forEach(b=>{const w=b;if(w.parent_source_group_id){const E=u.get(w.parent_source_group_id)||[];E.push(b.source_group_id),u.set(w.parent_source_group_id,E)}});const d=b=>{const w=[],E=u.get(b)||[];for(const k of E)w.push(k),w.push(...d(k));return w},h=b=>{const w=c.find(E=>E.source_group_id===b);return w?.parent_source_group_id?1+h(w.parent_source_group_id):0},p=c.length>0&&c.some(b=>b.name&&b.name.trim()!=="");let m=[];if(p){const b=new Map;for(const w of l){const E=cg(t).source_component.get(w.source_component_id);E?.source_group_id&&(b.has(E.source_group_id)||b.set(E.source_group_id,[]),b.get(E.source_group_id).push(w))}c.forEach((w,E)=>{let k=b.get(w.source_group_id)||[];const P=d(w.source_group_id);for(const I of P){const M=b.get(I)||[];k=[...k,...M]}if(k.length>0){const I=h(w.source_group_id),M=d(w.source_group_id).length>0;if(w.name?.startsWith("unnamed_board"))return;m.push({id:w.source_group_id,name:w.name||`Group ${E+1}`,components:k,color:Vat[E%Vat.length],depthLevel:I,hasChildren:M,sourceGroupId:w.source_group_id})}})}const _=s.viewBox.baseVal,g=s.getBoundingClientRect(),x=Math.min(g.width/_.width,g.height/_.height)||1;m.sort((b,w)=>b.depthLevel-w.depthLevel),m.forEach(b=>{if(b.components.length===0)return;const w=ELn(b.components,s);if(!w)return;const E=Math.max(8,Math.min(25,15/Math.max(x,.3))),k=b.hasChildren?E*.6:0,P=E+k,I=Math.max(1,2/Math.max(x,.5)),M=b.depthLevel===0?I:I*.7,N=Math.max(4,8/Math.max(x,.5)),C=b.hasChildren?1.3:1,U=N*C,O=U*.5,H=document.createElementNS("http://www.w3.org/2000/svg","rect");H.setAttribute("class","schematic-group-overlay"),H.setAttribute("x",(w.minX-P).toString()),H.setAttribute("y",(w.minY-P).toString()),H.setAttribute("width",(w.maxX-w.minX+P*2).toString()),H.setAttribute("height",(w.maxY-w.minY+P*2).toString()),H.setAttribute("fill","none"),H.setAttribute("stroke",b.color),H.setAttribute("stroke-width",M.toString()),H.setAttribute("stroke-dasharray",`${U},${O}`),H.setAttribute("opacity","0.8"),H.setAttribute("rx","0"),H.setAttribute("ry","0");const Y=Math.max(6,Math.min(20,14/Math.max(x,.2))),W=b.depthLevel===0||b.depthLevel===1?0:b.depthLevel*.2,K=Y*(1-W),J=Math.max(1,K*.2),se=b.name,de=document.createElementNS("http://www.w3.org/2000/svg","text");de.setAttribute("font-size",K.toString()),de.setAttribute("font-family","Arial, sans-serif"),de.textContent=se,s.appendChild(de);const ve=de.getBBox();s.removeChild(de);const re=ve.width+J*2,ue=K+J*2,me=w.minX-P,Me=w.minY-P-ue,ke=document.createElementNS("http://www.w3.org/2000/svg","rect");ke.setAttribute("class","schematic-group-overlay"),ke.setAttribute("x",me.toString()),ke.setAttribute("y",(Me-ue).toString()),ke.setAttribute("width",re.toString()),ke.setAttribute("height",ue.toString()),ke.setAttribute("fill","transparent"),ke.setAttribute("rx","0"),ke.setAttribute("ry","0");const ze=document.createElementNS("http://www.w3.org/2000/svg","text");ze.setAttribute("class","schematic-group-overlay"),ze.setAttribute("x",(me+J).toString()),ze.setAttribute("y",(Me+ue-J).toString()),ze.setAttribute("fill",b.color),ze.setAttribute("font-size",K.toString()),ze.setAttribute("font-family","Arial, sans-serif"),ze.setAttribute("font-weight",b.depthLevel===0?"600":"500"),ze.setAttribute("stroke",b.color),ze.setAttribute("stroke-width",Math.max(.2,K*.02).toString()),ze.textContent=se,s.appendChild(H),s.appendChild(ke),s.appendChild(ze)})}catch(c){console.error("Error creating group overlays:",c)}},10);return()=>clearTimeout(o)},[e,i,r])};function ELn(n,e){let t=1/0,i=1/0,r=-1/0,o=-1/0;for(const a of n){let c=e.querySelector(`g[data-schematic-component-id="${a.schematic_component_id}"]`);if(c||(c=e.querySelector(`[data-schematic-component-id="${a.schematic_component_id}"]`)),c){const l=c.getBBox();t=Math.min(t,l.x),i=Math.min(i,l.y),r=Math.max(r,l.x+l.width),o=Math.max(o,l.y+l.height)}}return t===1/0?null:{minX:t,minY:i,maxX:r,maxY:o}}var TLn=M0("schematic-viewer"),MLn=()=>{M0.enable("schematic-viewer*")},CLn=TLn,ALn=n=>{const[e,t]=pe.useState(0),[i,r]=pe.useState(0);return pe.useEffect(()=>{if(!n.current)return;const o=()=>{const a=n.current?.getBoundingClientRect();t(a?.width||0),r(a?.height||0)};o();const s=new ResizeObserver(o);return s.observe(n.current),window.addEventListener("resize",o),()=>{s.disconnect(),window.removeEventListener("resize",o)}},[]),{containerWidth:e,containerHeight:i}},PLn=CLn.extend("useComponentDragging"),RLn=({onEditEvent:n,editEvents:e=[],circuitJson:t,cancelDrag:i,svgToScreenProjection:r,realToSvgProjection:o,enabled:s=!1,snapToGrid:a=!1})=>{const[c,l]=pe.useState(null),u=No(o,r),d=pe.useRef(null),h=pe.useRef(null),p=pe.useRef(new Map);pe.useEffect(()=>{e.forEach(I=>{"edit_event_type"in I&&I.edit_event_type==="edit_schematic_component_location"&&!I.in_progress&&p.current.set(I.schematic_component_id,{...I.new_center})})},[e]);const m=pe.useCallback((I,M,N)=>{if(!s)return!1;const C=N.closest('[data-circuit-json-type="schematic_component"]');if(!C)return!1;const U=C.getAttribute("data-schematic-component-id");if(!U)return!1;i&&i();const O=cg(t).schematic_component.get(U);if(!O)return!1;d.current={x:I,y:M};let H;const Y=p.current.get(U);if(Y)H={...Y};else{const K=Hat({editEvents:e,schematic_component_id:U});H={x:O.center.x+K.x,y:O.center.y+K.y},p.current.set(U,{...H})}const W={edit_event_id:Math.random().toString(36).substr(2,9),edit_event_type:"edit_schematic_component_location",schematic_component_id:U,original_center:H,new_center:{...H},in_progress:!0,created_at:Date.now(),_element:C};return h.current=W,l(W),!0},[i,s,t,e]),_=pe.useCallback(I=>{m(I.clientX,I.clientY,I.target)},[m]),g=pe.useCallback(I=>{if(I.touches.length!==1)return;const M=I.touches[0];m(M.clientX,M.clientY,I.target)&&I.preventDefault()},[m]),x=pe.useCallback((I,M)=>{if(!h.current||!d.current)return;const N={x:I-d.current.x,y:M-d.current.y},C={x:N.x/u.a,y:N.y/u.d};let U={x:h.current.original_center.x+C.x,y:h.current.original_center.y+C.y};if(a){const H=Y=>Math.round(Y*10)/10;U={x:H(U.x),y:H(U.y)}}const O={...h.current,new_center:U};h.current=O,l(O)},[u,a]),b=pe.useCallback(I=>x(I.clientX,I.clientY),[x]),w=pe.useCallback(I=>{if(I.touches.length!==1||!h.current)return;I.preventDefault();const M=I.touches[0];x(M.clientX,M.clientY)},[x]),E=pe.useCallback(()=>{if(!h.current)return;const I={...h.current,in_progress:!1};p.current.set(I.schematic_component_id,{...I.new_center}),PLn("endDrag calling onEditEvent with new edit event",{newEditEvent:I}),n&&n(I),h.current=null,d.current=null,l(null)},[n]),k=pe.useCallback(()=>E(),[E]),P=pe.useCallback(()=>E(),[E]);return pe.useEffect(()=>(window.addEventListener("mousemove",b),window.addEventListener("mouseup",k),window.addEventListener("touchmove",w,{passive:!1}),window.addEventListener("touchend",P),()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",k),window.removeEventListener("touchmove",w),window.removeEventListener("touchend",P)}),[b,k,w,P]),{handleMouseDown:_,handleTouchStart:g,isDragging:!!h.current,activeEditEvent:c}},oC={schematicEditIcon:50,schematicGridIcon:49,spiceSimulationIcon:50,viewMenuIcon:48,viewMenu:55,viewMenuBackdrop:54,clickToInteractOverlay:100,schematicComponentHoverOutline:47},ILn=({onClick:n,active:e})=>{const t=i=>{i.preventDefault(),n()};return ce.jsx("div",{onClick:t,onTouchEnd:t,style:{position:"absolute",top:"16px",right:"64px",backgroundColor:e?"#4CAF50":"#fff",color:e?"#fff":"#000",padding:"8px",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:"4px",zIndex:oC.schematicEditIcon},children:ce.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[ce.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),ce.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})})},NLn=({onClick:n,active:e})=>{const t=i=>{i.preventDefault(),n()};return ce.jsx("div",{onClick:t,onTouchEnd:t,style:{position:"absolute",top:"56px",right:"64px",backgroundColor:e?"#4CAF50":"#fff",color:e?"#fff":"#000",padding:"8px",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:"4px",zIndex:oC.schematicGridIcon},children:ce.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:ce.jsx("path",{d:"M3 3h7v7H3zM14 3h7v7h-7zM3 14h7v7H3zM14 14h7v7h-7z"})})})},kLn=({onClick:n,active:e})=>{const t=i=>{i.preventDefault(),n()};return ce.jsx("div",{onClick:t,onTouchEnd:t,style:{position:"absolute",top:"16px",right:"16px",backgroundColor:e?"#4CAF50":"#fff",color:e?"#fff":"#000",padding:"8px",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:"4px",zIndex:oC.viewMenuIcon},children:ce.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[ce.jsx("circle",{cx:"12",cy:"12",r:"1"}),ce.jsx("circle",{cx:"12",cy:"5",r:"1"}),ce.jsx("circle",{cx:"12",cy:"19",r:"1"})]})})},OLn={version:"2.0.46"},LLn=({circuitJson:n,circuitJsonKey:e,isVisible:t,onClose:i,showGroups:r,onToggleGroups:o})=>{const s=pe.useMemo(()=>{if(!n||n.length===0)return!1;try{if((cg(n).source_group?.list()||[]).length>0)return!0;const c=cg(n).schematic_component?.list()||[];if(c.length>1){const l=new Set;for(const u of c){const d=cg(n).source_component.get(u.source_component_id);d?.ftype&&l.add(d.ftype)}return l.size>1}return!1}catch(a){return console.error("Error checking for groups:",a),!1}},[e]);return t?ce.jsxs(ce.Fragment,{children:[ce.jsx("div",{onClick:i,onTouchEnd:a=>{a.preventDefault(),i()},style:{position:"absolute",inset:0,backgroundColor:"transparent",zIndex:oC.viewMenuBackdrop}}),ce.jsxs("div",{style:{position:"absolute",top:"56px",right:"16px",backgroundColor:"#ffffff",color:"#000000",border:"1px solid #ccc",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",minWidth:"200px",zIndex:oC.viewMenu},children:[ce.jsxs("div",{onClick:()=>{s&&o(!r)},onTouchEnd:a=>{a.preventDefault(),s&&o(!r)},style:{padding:"8px 12px",cursor:s?"pointer":"not-allowed",opacity:s?1:.5,fontSize:"13px",color:"#000000",fontFamily:"sans-serif",display:"flex",alignItems:"center",gap:"8px"},onMouseEnter:a=>{s&&(a.currentTarget.style.backgroundColor="#f0f0f0")},onMouseLeave:a=>{s&&(a.currentTarget.style.backgroundColor="transparent")},children:[ce.jsx("div",{style:{width:"16px",height:"16px",border:"2px solid #000",borderRadius:"2px",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",fontWeight:"bold"},children:r&&"✓"}),"View Schematic Groups"]}),!s&&ce.jsx("div",{style:{padding:"8px 12px",fontSize:"11px",color:"#666",fontStyle:"italic"},children:"No groups found in this schematic"}),ce.jsxs("div",{style:{padding:"4px 8px",fontSize:"12px",color:"#999",borderTop:"1px solid #eee",textAlign:"center"},children:["v",String(OLn?.version)]})]})]}):null},DLn=()=>ce.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:ce.jsx("path",{d:"M3 12h2.5l2.5-9 4 18 4-9h5.5"})}),zLn=({onClick:n})=>ce.jsx("div",{onClick:n,style:{position:"absolute",top:"16px",right:"112px",backgroundColor:"#fff",color:"#000",padding:"8px",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:"4px",zIndex:oC.spiceSimulationIcon},children:ce.jsx(DLn,{})});VG.register(Z8n,eLn,I8n,R8n,F8n,q8n,z8n);var XG=["#8884d8","#82ca9d","#ffc658","#ff7300","#387908"],Gat=n=>{if(n===0)return"0s";const e=Math.abs(n);let t="s",i=1;return e<1e-12?(t="fs",i=1e15):e<1e-9?(t="ps",i=1e12):e<1e-6?(t="ns",i=1e9):e<.001?(t="us",i=1e6):e<1&&(t="ms",i=1e3),`${parseFloat((n*i).toPrecision(3))}${t}`},$Ln=({plotData:n,nodes:e,isLoading:t,error:i,hasRun:r})=>{const o=pe.useMemo(()=>{const c=e.some(u=>u.toLowerCase().startsWith("v(")),l=e.some(u=>u.toLowerCase().startsWith("i("));return c&&l?"Value":c?"Voltage (V)":l?"Current (A)":"Value"},[e]);if(t)return ce.jsx("div",{style:{height:"300px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:"Running simulation..."});if(!r)return ce.jsx("div",{style:{height:"300px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:'Click "Run" to start the simulation.'});if(i)return ce.jsxs("div",{style:{height:"300px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"red"},children:["Error: ",i]});if(n.length===0)return ce.jsx("div",{style:{height:"300px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:"No data to plot. Check simulation output or SPICE netlist."});const s={datasets:e.map((c,l)=>({label:c,data:n.map(u=>({x:Number(u.name),y:u[c]})),borderColor:XG[l%XG.length],backgroundColor:XG[l%XG.length],fill:!1,tension:.1}))},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"top",labels:{font:{family:"sans-serif"}}},title:{display:!1},tooltip:{callbacks:{title:c=>{if(c.length>0){const l=c[0];return Gat(l.parsed.x)}return""}}}},scales:{x:{type:"linear",title:{display:!0,text:"Time",font:{family:"sans-serif"}},ticks:{callback:c=>Gat(c),font:{family:"sans-serif"}}},y:{title:{display:!0,text:o,font:{family:"sans-serif"}},ticks:{font:{family:"sans-serif"}}}}};return ce.jsx("div",{style:{position:"relative",height:"300px",width:"100%"},children:ce.jsx(lLn,{options:a,data:s})})},FLn=({spiceString:n,onClose:e,plotData:t,nodes:i,isLoading:r,error:o,simOptions:s,onSimOptionsChange:a,hasRun:c})=>{const[l,u]=pe.useState(String(s.startTime)),[d,h]=pe.useState(String(s.duration));pe.useEffect(()=>{u(String(s.startTime)),h(String(s.duration))},[s.startTime,s.duration]);const p=()=>{a({...s,startTime:Number(l),duration:Number(d)})},m=i.filter(_=>{const g=_.toLowerCase().startsWith("v("),x=_.toLowerCase().startsWith("i(");return!!(s.showVoltage&&g||s.showCurrent&&x)});return ce.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1002,fontFamily:"sans-serif"},children:ce.jsxs("div",{style:{backgroundColor:"white",padding:"24px",borderRadius:"12px",width:"90%",maxWidth:"900px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)"},children:[ce.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px",borderBottom:"1px solid #eee",paddingBottom:"16px"},children:[ce.jsx("h2",{style:{margin:0,fontSize:"22px",fontWeight:600,color:"#333"},children:"SPICE Simulation"}),ce.jsx("button",{onClick:e,style:{background:"none",border:"none",fontSize:"28px",cursor:"pointer",color:"#888",padding:0,lineHeight:1},children:"×"})]}),ce.jsx("div",{children:ce.jsx($Ln,{plotData:t,nodes:m,isLoading:r,error:o,hasRun:c})}),ce.jsxs("div",{style:{marginTop:"16px",padding:"12px",backgroundColor:"#f7f7f7",borderRadius:"6px",display:"flex",flexWrap:"wrap",gap:"24px",alignItems:"center",fontSize:"14px"},children:[ce.jsxs("div",{style:{display:"flex",gap:"16px"},children:[ce.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[ce.jsx("input",{type:"checkbox",checked:s.showVoltage,onChange:_=>a({...s,showVoltage:_.target.checked})}),"Voltage"]}),ce.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[ce.jsx("input",{type:"checkbox",checked:s.showCurrent,onChange:_=>a({...s,showCurrent:_.target.checked})}),"Current"]})]}),ce.jsxs("div",{style:{display:"flex",gap:"16px",alignItems:"center"},children:[ce.jsx("label",{htmlFor:"startTime",children:"Start Time (ms):"}),ce.jsx("input",{id:"startTime",type:"number",value:l,onChange:_=>u(_.target.value),style:{width:"80px",padding:"4px 8px",borderRadius:"4px",border:"1px solid #ccc"}}),ce.jsx("label",{htmlFor:"duration",children:"Duration (ms):"}),ce.jsx("input",{id:"duration",type:"number",value:d,onChange:_=>h(_.target.value),style:{width:"80px",padding:"4px 8px",borderRadius:"4px",border:"1px solid #ccc"}}),ce.jsx("button",{onClick:p,style:{padding:"4px 12px",borderRadius:"4px",border:"1px solid #ccc",backgroundColor:"#f0f0f0",cursor:"pointer"},children:c?"Rerun":"Run"})]})]}),ce.jsxs("div",{style:{marginTop:"24px"},children:[ce.jsx("h3",{style:{marginTop:0,marginBottom:"12px",fontSize:"18px",fontWeight:600,color:"#333"},children:"SPICE Netlist"}),ce.jsx("pre",{style:{backgroundColor:"#fafafa",padding:"16px",borderRadius:"6px",maxHeight:"150px",overflowY:"auto",border:"1px solid #eee",color:"#333",fontSize:"13px",fontFamily:"monospace"},children:n})]})]})})},ULn="dmFyIGU9bnVsbCxzPWFzeW5jKCk9Pihhd2FpdCBpbXBvcnQoImh0dHBzOi8vY2RuLmpzZGVsaXZyLm5ldC9ucG0vZWVjaXJjdWl0LWVuZ2luZUAxLjUuMi8rZXNtIikpLlNpbXVsYXRpb24sYz1hc3luYygpPT57aWYoZSYmZS5pc0luaXRpYWxpemVkKCkpcmV0dXJuO2xldCBpPWF3YWl0IHMoKTtlPW5ldyBpLGF3YWl0IGUuc3RhcnQoKX07c2VsZi5vbm1lc3NhZ2U9YXN5bmMgaT0+e3RyeXtpZihhd2FpdCBjKCksIWUpdGhyb3cgbmV3IEVycm9yKCJTaW11bGF0aW9uIG5vdCBpbml0aWFsaXplZCIpO2xldCB0PWkuZGF0YS5zcGljZVN0cmluZyxhPXQubWF0Y2goL3dyZGF0YVxzKyhcUyspXHMrKC4qKS9pKTtpZihhKXtsZXQgbz1gLnByb2JlICR7YVsyXS50cmltKCkuc3BsaXQoL1xzKy8pLmpvaW4oIiAiKX1gO3Q9dC5yZXBsYWNlKC93cmRhdGEuKi9pLG8pfWVsc2UgaWYoIXQubWF0Y2goL1wucHJvYmUvaSkpdGhyb3cgdC5tYXRjaCgvcGxvdFxzKyguKikvaSk/bmV3IEVycm9yKCJUaGUgJ3Bsb3QnIGNvbW1hbmQgaXMgbm90IHN1cHBvcnRlZCBmb3IgZGF0YSBleHRyYWN0aW9uLiBQbGVhc2UgdXNlICd3cmRhdGEgPGZpbGVuYW1lPiA8dmFyMT4gLi4uJyBvciAnLnByb2JlIDx2YXIxPiAuLi4nIGluc3RlYWQuIik6bmV3IEVycm9yKCJObyAnLnByb2JlJyBvciAnd3JkYXRhJyBjb21tYW5kIGZvdW5kIGluIFNQSUNFIGZpbGUuIFVzZSAnd3JkYXRhIDxmaWxlbmFtZT4gPHZhcjE+IC4uLicgdG8gc3BlY2lmeSBvdXRwdXQuIik7ZS5zZXROZXRMaXN0KHQpO2xldCBuPWF3YWl0IGUucnVuU2ltKCk7c2VsZi5wb3N0TWVzc2FnZSh7dHlwZToicmVzdWx0IixyZXN1bHQ6bn0pfWNhdGNoKHQpe3NlbGYucG9zdE1lc3NhZ2Uoe3R5cGU6ImVycm9yIixlcnJvcjp0Lm1lc3NhZ2V9KX19Owo=",WG=null,BLn=()=>{if(typeof window>"u")return null;if(WG)return WG;try{const n=new Blob([atob(ULn)],{type:"application/javascript"});return WG=URL.createObjectURL(n),WG}catch(n){return console.error("Failed to create blob URL for worker",n),null}},jLn=n=>{const e={};if(n.dataType==="real")n.data.forEach(a=>{e[a.name]=a.values});else if(n.dataType==="complex")n.data.forEach(a=>{e[a.name]=a.values.map(c=>c.real)});else throw new Error("Unsupported data type in simulation result");const t=Object.keys(e).find(a=>a.toLowerCase()==="time"||a.toLowerCase()==="frequency");if(!t)throw new Error("No time or frequency data in simulation result");const i=e[t],r=Object.keys(e).filter(a=>a!==t),o=r;return{plotData:i.map((a,c)=>{const l={name:a.toExponential(2)};return r.forEach(u=>{l[u]=e[u][c]}),l}),nodes:o}},HLn=n=>{const[e,t]=pe.useState([]),[i,r]=pe.useState([]),[o,s]=pe.useState(!0),[a,c]=pe.useState(null);return pe.useEffect(()=>{if(!n){s(!1),t([]),r([]),c(null);return}s(!0),c(null),t([]),r([]);const l=BLn();if(!l){c("Could not create SPICE simulation worker."),s(!1);return}const u=new Worker(l,{type:"module"});return u.onmessage=d=>{if(d.data.type==="result")try{const{plotData:h,nodes:p}=jLn(d.data.result);t(h),r(p)}catch(h){c(h.message||"Failed to parse simulation result"),console.error(h)}else d.data.type==="error"&&c(d.data.error);s(!1)},u.onerror=d=>{c(d.message),s(!1)},u.postMessage({spiceString:n}),()=>{u.terminate()}},[n]),{plotData:e,nodes:i,isLoading:o,error:a}},l1e=n=>{if(n===0)return"0";const e=Math.abs(n),t=i=>i.toPrecision(4);return e>=1?t(n):e>=.001?`${t(n*1e3)}m`:e>=1e-6?`${t(n*1e6)}u`:e>=1e-9?`${t(n*1e9)}n`:e>=1e-12?`${t(n*1e12)}p`:e>=1e-15?`${t(n*1e15)}f`:n.toExponential(3)},VLn=(n,e)=>{const i=yLn(n).toSpiceString(),o=i.split(`
5428
5428
  `).filter(C=>C.trim()!=="").filter(C=>!C.startsWith("*")&&!C.startsWith(".")&&C.trim()!==""),s=new Set,a=new Set,c=new Set;for(const C of o){const U=C.trim().split(/\s+/);if(U.length<3)continue;const O=U[0],H=O[0].toUpperCase();let Y=[];if(["R","C","L","V","I","D"].includes(H))Y=U.slice(1,3),H==="V"&&c.add(O);else if(H==="Q"&&U.length>=4)Y=U.slice(1,4);else if(H==="M"&&U.length>=5)Y=U.slice(1,5);else if(H==="X")Y=U.slice(1,-1);else continue;Y.forEach(W=>s.add(W)),H==="C"&&Y.forEach(W=>a.add(W))}s.delete("0"),a.delete("0");const l=Array.from(a).map(C=>`.ic V(${C})=0`),u=[],d=Array.from(s).map(C=>`V(${C})`);u.push(...d);const h=Array.from(c).map(C=>`I(${C})`);u.push(...h);const p=u.length>0?`.probe ${u.join(" ")}`:"",m=e?.startTime??0,_=e?.duration??20,g=m*.001,x=_*.001,b=g+x,w=x/50,E=`.tran ${l1e(w)} ${l1e(b)} ${l1e(g)} UIC`,k=".end",P=i.split(`
5429
5429
  `);let I=-1;for(let C=P.length-1;C>=0;C--)if(P[C].trim().toLowerCase().startsWith(k)){I=C;break}const M=[...l,p,E].filter(Boolean);let N;if(I!==-1){const C=P.slice(0,I),U=P.slice(I);N=[...C,...M,...U]}else N=[...P,...M,k];return N.join(`
5430
5430
  `)},GLn=(n,e)=>{if(typeof window>"u")return e;try{const t=localStorage.getItem(n);return t!==null?JSON.parse(t):e}catch{return e}},YLn=(n,e)=>{if(!(typeof window>"u"))try{localStorage.setItem(n,JSON.stringify(e))}catch{}},u1e=pe.createContext(null),qLn=5,XLn=(n,e)=>!n&&!e?!0:!n||!e?!1:n.minX===e.minX&&n.maxX===e.maxX&&n.minY===e.minY&&n.maxY===e.maxY,WLn=({children:n})=>{if(pe.useContext(u1e))return ce.jsx(ce.Fragment,{children:n});const t=pe.useRef({pointer:null,boundingBoxes:new Map,hoveringIds:new Set,subscribers:new Set,mouseDownPosition:null}),i=pe.useCallback(()=>{for(const d of t.current.subscribers)d()},[]),r=pe.useCallback(()=>{const d=t.current.pointer,h=new Set;if(d)for(const[m,_]of t.current.boundingBoxes){const g=_.bounds;g&&d.x>=g.minX&&d.x<=g.maxX&&d.y>=g.minY&&d.y<=g.maxY&&h.add(m)}const p=t.current.hoveringIds;h.size===p.size&&[...h].every(m=>p.has(m))||(t.current.hoveringIds=h,i())},[i]),o=pe.useCallback((d,h)=>{t.current.boundingBoxes.set(d,h),r()},[r]),s=pe.useCallback((d,h)=>{const p=t.current.boundingBoxes.get(d);p&&XLn(p.bounds,h.bounds)&&p.onClick===h.onClick||(t.current.boundingBoxes.set(d,h),r())},[r]),a=pe.useCallback(d=>{t.current.boundingBoxes.delete(d)&&r()},[r]),c=pe.useCallback(d=>(t.current.subscribers.add(d),()=>{t.current.subscribers.delete(d)}),[]),l=pe.useCallback(d=>t.current.hoveringIds.has(d),[]);pe.useEffect(()=>{const d=_=>{const{clientX:g,clientY:x}=_,b=t.current.pointer;b&&b.x===g&&b.y===x||(t.current.pointer={x:g,y:x},r())},h=()=>{t.current.pointer!==null&&(t.current.pointer=null,t.current.mouseDownPosition=null,r())},p=_=>{t.current.mouseDownPosition={x:_.clientX,y:_.clientY}},m=_=>{const{clientX:g,clientY:x}=_,b=t.current.mouseDownPosition;if(b&&Math.sqrt(Math.pow(g-b.x,2)+Math.pow(x-b.y,2))>qLn){t.current.mouseDownPosition=null;return}t.current.mouseDownPosition=null;for(const w of t.current.boundingBoxes.values()){const E=w.bounds;E&&g>=E.minX&&g<=E.maxX&&x>=E.minY&&x<=E.maxY&&w.onClick?.(_)}};return window.addEventListener("pointermove",d,{passive:!0}),window.addEventListener("pointerdown",d,{passive:!0}),window.addEventListener("pointerup",d,{passive:!0}),window.addEventListener("pointerleave",h),window.addEventListener("pointercancel",h),window.addEventListener("blur",h),window.addEventListener("mousedown",p,{passive:!0}),window.addEventListener("click",m,{passive:!0}),()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerdown",d),window.removeEventListener("pointerup",d),window.removeEventListener("pointerleave",h),window.removeEventListener("pointercancel",h),window.removeEventListener("blur",h),window.removeEventListener("mousedown",p),window.removeEventListener("click",m)}},[r]);const u=pe.useMemo(()=>({registerBoundingBox:o,updateBoundingBox:s,unregisterBoundingBox:a,subscribe:c,isHovering:l}),[o,s,a,c,l]);return ce.jsx(u1e.Provider,{value:u,children:n})},KLn=n=>{const e=pe.useContext(u1e);if(!e)throw new Error("useMouseEventsOverBoundingBox must be used within a MouseTracker");const t=pe.useId(),i=pe.useRef(n);i.current=n;const r=pe.useMemo(()=>s=>{i.current.onClick?.(s)},[]);return pe.useEffect(()=>(e.registerBoundingBox(t,{bounds:i.current.bounds,onClick:i.current.onClick?r:void 0}),()=>{e.unregisterBoundingBox(t)}),[e,r,t]),pe.useEffect(()=>{e.updateBoundingBox(t,{bounds:i.current.bounds,onClick:i.current.onClick?r:void 0})},[e,r,t,n.bounds?.minX,n.bounds?.maxX,n.bounds?.minY,n.bounds?.maxY,n.onClick]),{hovering:pe.useSyncExternalStore(e.subscribe,()=>e.isHovering(t),()=>!1)}},ZLn=(n,e)=>!n&&!e?!0:!n||!e?!1:Math.abs(n.bounds.minX-e.bounds.minX)<.5&&Math.abs(n.bounds.maxX-e.bounds.maxX)<.5&&Math.abs(n.bounds.minY-e.bounds.minY)<.5&&Math.abs(n.bounds.maxY-e.bounds.maxY)<.5&&Math.abs(n.rect.left-e.rect.left)<.5&&Math.abs(n.rect.top-e.rect.top)<.5&&Math.abs(n.rect.width-e.rect.width)<.5&&Math.abs(n.rect.height-e.rect.height)<.5,QLn=({componentId:n,svgDivRef:e,containerRef:t,onComponentClick:i,onHoverChange:r,showOutline:o,circuitJsonKey:s})=>{const[a,c]=pe.useState(null),l=pe.useRef(null),u=pe.useCallback(()=>{l.current=null;const g=e.current,x=t.current;if(!g||!x){c(P=>P&&null);return}const b=g.querySelector(`[data-schematic-component-id="${n}"]`);if(!b){c(P=>P&&null);return}const w=b.getBoundingClientRect(),E=x.getBoundingClientRect(),k={bounds:{minX:w.left,maxX:w.right,minY:w.top,maxY:w.bottom},rect:{left:w.left-E.left,top:w.top-E.top,width:w.width,height:w.height}};c(P=>ZLn(P,k)?P:k)},[n,t,e]),d=pe.useCallback(()=>{l.current===null&&(l.current=window.requestAnimationFrame(u))},[u]);pe.useEffect(()=>{d()},[d,s]),pe.useEffect(()=>{d();const g=e.current,x=t.current;if(!g||!x)return;const b=typeof ResizeObserver<"u"?new ResizeObserver(()=>{d()}):null;b?.observe(x),b?.observe(g);const w=typeof MutationObserver<"u"?new MutationObserver(()=>{d()}):null;return w?.observe(g,{attributes:!0,attributeFilter:["style","transform"],subtree:!0,childList:!0}),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{b?.disconnect(),w?.disconnect(),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d),l.current!==null&&(cancelAnimationFrame(l.current),l.current=null)}},[d,e,t]);const h=pe.useCallback(g=>{i&&i(n,g)},[n,i]),p=a?.bounds??null,{hovering:m}=KLn({bounds:p,onClick:i?h:void 0});if(pe.useEffect(()=>{r&&r(n,m)},[m,n,r]),!a||!m||!o)return null;const _=a.rect;return ce.jsx("div",{style:{position:"absolute",left:_.left,top:_.top,width:_.width,height:_.height,border:"1.5px solid rgba(51, 153, 255, 0.9)",pointerEvents:"none",zIndex:oC.schematicComponentHoverOutline}})},JLn=({circuitJson:n,containerStyle:e,editEvents:t=[],onEditEvent:i,defaultEditMode:r=!1,debugGrid:o=!1,editingEnabled:s=!1,debug:a=!1,clickToInteractEnabled:c=!1,colorOverrides:l,spiceSimulationEnabled:u=!1,disableGroups:d=!1,onSchematicComponentClicked:h})=>{a&&MLn();const[p,m]=pe.useState(!1),[_,g]=pe.useState({showVoltage:!0,showCurrent:!1,startTime:0,duration:20}),x=yt=>`${yt?.length||0}_${yt?.editCount||0}`,b=pe.useMemo(()=>x(n),[n]),w=pe.useMemo(()=>{if(!u)return null;try{return VLn(n,_)}catch(yt){return console.error("Failed to generate SPICE string",yt),null}},[b,u,_.startTime,_.duration]),[E,k]=pe.useState(!1);pe.useEffect(()=>{k(!1)},[b]);const{plotData:P,nodes:I,isLoading:M,error:N}=HLn(E?w:null),[C,U]=pe.useState(r),[O,H]=pe.useState(!0),[Y,W]=pe.useState(!c),[K,J]=pe.useState(!1),[se,de]=pe.useState(()=>d?!1:GLn("schematic_viewer_show_groups",!1)),[ve,re]=pe.useState(!1),ue=pe.useRef(new Set),me=pe.useCallback((yt,At)=>{At?ue.current.add(yt):ue.current.delete(yt),re(ue.current.size>0)},[]),Me=pe.useRef(null),ke=pe.useRef(null),ze=pe.useMemo(()=>{try{return cg(n).schematic_component?.list()?.map(yt=>yt.schematic_component_id)??[]}catch(yt){return console.error("Failed to derive schematic component ids",yt),[]}},[b,n]),Be=yt=>{const At=yt.touches[0];ke.current={x:At.clientX,y:At.clientY}},Re=yt=>{const At=yt.changedTouches[0],vt=ke.current;if(!vt)return;const Bt=Math.abs(At.clientX-vt.x),Kt=Math.abs(At.clientY-vt.y);Bt<10&&Kt<10&&(yt.preventDefault(),W(!0)),ke.current=null},[oe,Ee]=pe.useState([]),be=pe.useRef(n);pe.useEffect(()=>{const yt=x(n),At=x(be.current);yt!==At&&(Ee([]),be.current=n)},[n]);const{ref:Ge,cancelDrag:nt,transform:ct}=Rxe({onSetTransform(yt){Me.current&&(Me.current.style.transform=ow(yt))},enabled:Y&&!p}),{containerWidth:Te,containerHeight:Qe}=ALn(Ge),Xe=pe.useMemo(()=>!Te||!Qe?"":Cxe(n,{width:Te,height:Qe||720,grid:o?{cellSize:1,labelCells:!0}:void 0,colorOverrides:l}),[b,Te,Qe]),Ve=pe.useMemo(()=>Xe.match(/<svg[^>]*style="[^"]*background-color:\s*([^;\"]+)/i)?.[1]??"transparent",[Xe]),et=pe.useMemo(()=>{if(!Xe)return Bh();const yt=Xe.match(/data-real-to-screen-transform="([^"]+)"/)?.[1];try{return e$(yt)}catch(At){return console.error(At),Bh()}},[Xe]),Le=yt=>{Ee(At=>[...At,yt]),i&&i(yt)},Ne=pe.useMemo(()=>[...t,...oe],[t,oe]),{handleMouseDown:qe,handleTouchStart:Oe,isDragging:We,activeEditEvent:tt}=RLn({onEditEvent:Le,cancelDrag:nt,realToSvgProjection:et,svgToScreenProjection:ct,circuitJson:n,editEvents:Ne,enabled:C&&Y&&!p,snapToGrid:O});vLn({svgDivRef:Me,editEvents:Ne,realToSvgProjection:et,svgToScreenProjection:ct,activeEditEvent:tt}),wLn({svgDivRef:Me,circuitJson:n,activeEditEvent:tt,editEvents:Ne}),SLn({svgDivRef:Me,circuitJson:n,circuitJsonKey:b,showGroups:se&&!d});const mt=pe.useRef(Oe);pe.useEffect(()=>{mt.current=Oe},[Oe]);const bt=pe.useMemo(()=>ce.jsx("div",{ref:Me,style:{pointerEvents:c?Y?"auto":"none":"auto",transformOrigin:"0 0"},className:h?"schematic-component-clickable":void 0,onTouchStart:yt=>{C&&Y&&!p&&mt.current(yt)},dangerouslySetInnerHTML:{__html:Xe}}),[Xe,Y,c,C,p]);return ce.jsxs(WLn,{children:[h&&ce.jsx("style",{children:".schematic-component-clickable [data-schematic-component-id]:hover { cursor: pointer !important; }"}),ce.jsxs("div",{ref:Ge,style:{position:"relative",backgroundColor:Ve,overflow:"hidden",cursor:p?"auto":We?"grabbing":c&&!Y||ve&&h?"pointer":"grab",minHeight:"300px",...e},onWheelCapture:yt=>{p&&yt.stopPropagation()},onMouseDown:yt=>{if(c&&!Y){yt.preventDefault(),yt.stopPropagation();return}qe(yt)},onMouseDownCapture:yt=>{if(c&&!Y){yt.preventDefault(),yt.stopPropagation();return}},onTouchStart:yt=>{p||Be(yt)},onTouchEnd:yt=>{p||Re(yt)},children:[!Y&&c&&ce.jsx("div",{onClick:yt=>{yt.preventDefault(),yt.stopPropagation(),W(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:oC.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"all",touchAction:"pan-x pan-y pinch-zoom"},children:ce.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0)?"Touch to Interact":"Click to Interact"})}),ce.jsx(kLn,{active:K,onClick:()=>J(!K)}),s&&ce.jsx(ILn,{active:C,onClick:()=>U(!C)}),s&&C&&ce.jsx(NLn,{active:O,onClick:()=>H(!O)}),ce.jsx(LLn,{circuitJson:n,circuitJsonKey:b,isVisible:K,onClose:()=>J(!1),showGroups:se,onToggleGroups:yt=>{d||(de(yt),YLn("schematic_viewer_show_groups",yt))}}),u&&ce.jsx(zLn,{onClick:()=>m(!0)}),p&&ce.jsx(FLn,{spiceString:w,onClose:()=>m(!1),plotData:P,nodes:I,isLoading:M,error:N,simOptions:_,onSimOptionsChange:yt=>{k(!0),g(yt)},hasRun:E}),h&&ze.map(yt=>ce.jsx(QLn,{componentId:yt,svgDivRef:Me,containerRef:Ge,showOutline:!0,circuitJsonKey:b,onHoverChange:me,onComponentClick:(At,vt)=>{h?.({schematicComponentId:At,event:vt})}},yt)),bt]})]})},Yat=n=>{const[e,t]=pe.useState(0),[i,r]=pe.useState(0);return pe.useEffect(()=>{if(!n.current)return;const o=()=>{const a=n.current?.getBoundingClientRect();t(a?.width||0),r(a?.height||0)};o();const s=new ResizeObserver(o);return s.observe(n.current),window.addEventListener("resize",o),()=>{s.disconnect(),window.removeEventListener("resize",o)}},[]),{containerWidth:e,containerHeight:i}};M0("assembly-viewer");var qat=()=>{M0.enable("assembly-viewer*")},eDn=({circuitJson:n,containerStyle:e,debugGrid:t=!1,debug:i=!1})=>{i&&qat();const r=pe.useRef(null),{ref:o}=Rxe({onSetTransform(u){r.current&&(r.current.style.transform=ow(u))}}),{containerWidth:s,containerHeight:a}=Yat(o),c=pe.useMemo(()=>!s||!a?"":wot(n,{width:s,height:a||720}),[n,s,a]);pe.useMemo(()=>{if(!c)return Bh();const u=c.match(/data-real-to-screen-transform="([^"]+)"/)?.[1];try{return e$(u)}catch(d){return console.error(d),Bh()}},[c]);const l=pe.useMemo(()=>ce.jsx("div",{ref:r,style:{pointerEvents:"auto",transformOrigin:"0 0"},dangerouslySetInnerHTML:{__html:c}}),[c]);return ce.jsx("div",{ref:o,style:{position:"relative",backgroundColor:"#FFFFFF",overflow:"hidden",minHeight:"300px",...e},children:l})},tDn=({circuitJson:n,containerStyle:e,debugGrid:t=!1,debug:i=!1})=>{i&&qat();const r=pe.useRef(null),{ref:o}=Rxe({onSetTransform(u){r.current&&(r.current.style.transform=ow(u))}}),{containerWidth:s,containerHeight:a}=Yat(o),c=pe.useMemo(()=>!s||!a?"":Txe(n,{width:s,height:a||720}),[n,s,a]);pe.useMemo(()=>{if(!c)return Bh();const u=c.match(/data-real-to-screen-transform="([^"]+)"/)?.[1];try{return e$(u)}catch(d){return console.error(d),Bh()}},[c]);const l=pe.useMemo(()=>ce.jsx("div",{ref:r,style:{pointerEvents:"auto",transformOrigin:"0 0"},dangerouslySetInnerHTML:{__html:c}}),[c]);return ce.jsx("div",{ref:o,style:{position:"relative",backgroundColor:"#FFFFFF",overflow:"hidden",minHeight:"300px",...e},children:l})};const Xat=["Initialize a tscircuit project using [tsci init](https://github.com/tscircuit/cli) before adding components.","Define reusable modules with cached routes using [<subcircuit />](https://docs.tscircuit.com/elements/subcircuit)","Run `tsci dev` on the command line to preview your boards before export",'Use units like mm or mils consistently across your designs (e.g. pcbX="10mm")',"Quickly set footprints with the [footprint prop](https://docs.tscircuit.com/footprints/footprinter-strings)","Check out the guide on [ordering prototypes](https://docs.tscircuit.com/building-electronics/ordering-prototypes)","Use [net labels](https://docs.tscircuit.com/elements/net) and [group elements](https://docs.tscircuit.com/elements/group) to organize complex schematics.","You can manually drag components on the PCB and Schematic using [manual edits](https://docs.tscircuit.com/guides/manual-edits)","Every tscircuit module can export to [Circuit JSON](https://github.com/tscircuit/circuit-json), Gerbers, Pick'n'Place CSV files, Bill of Materials CSV and more","You can import components from [JLCPCB](https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-jlcpcb) or [KiCad](https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-kicad)","Any module you push to the [registry](https://tscircuit.com/trending) will have [simple image urls](https://docs.tscircuit.com/web-apis/image-generation-api) you can use display images on a website","The default [Parts Engine](https://docs.tscircuit.com/guides/platform-configuration) will automatically find parts from common vendors for your BOM",'[Pin selectors](https://docs.tscircuit.com/guides/using-sel-references) are similar to CSS selectors, ".R1 > .pin1" means "connect to the first pin of the component R1"',"You can use the [sel](https://docs.tscircuit.com/guides/using-sel-references) object to select pins in a type-safe way","Publish modules via the [registry](https://tscircuit.com/trending) for working with a team or sharing your work","[Explore tutorials](https://docs.tscircuit.com/category/tutorials) for real-world circuit design examples.","Upload your Circuit JSON to [circuitjson.com](https://circuitjson.com) for a quick preview.","You can display Circuit JSON in 3D, PCB or Schematic mode with the [<CircuitJsonPreview />](https://docs.tscircuit.com/guides/running-tscircuit/displaying-circuit-json-on-a-webpage#react-display-all-available-previews-with-circuitjsonpreview-) React component","Use a [<group />](https://docs.tscircuit.com/elements/group) element to move multiple components at once in a schematic or PCB layout.","Check out the [GitHub Discussions page](https://github.com/tscircuit/tscircuit/discussions) to upvote features","You can customize the autorouter using the [autorouter prop](https://docs.tscircuit.com/elements/board#setting-the-autorouter)","Use the [<constraint />](https://docs.tscircuit.com/footprints/constraint) element to enforce geometric relationships in PCB designs.","Join the [Discord server](https://tscircuit.com/join) to discuss issues and get help directly from the community."],nDn=(()=>{let n=Xat[Math.floor(Math.random()*Xat.length)];return n=n.replace(/</g,"&lt;"),n=n.replace(/>/g,"&gt;"),n=n.replace(new RegExp('(?<!href=")(?<!\\()(?<!\\]\\()(https?:\\/\\/[^\\s\\)\\]]+)',"g"),(e,t)=>`<a class="rf-text-blue-500 rf-underline" href="${e}" target="_blank">${e}</a>`),n=n.replace(/\[([^\]]+)\]\((https?:\/\/[^\)]+)\)/g,'<a class="rf-text-blue-500 rf-underline" href="$2" target="_blank">$1</a>'),n})(),sC=({onRunClicked:n})=>ce.jsxs("div",{className:"rf-flex rf-flex-col rf-items-center rf-justify-center rf-h-full rf-bg-gray-50 rf-text-gray-500 rf-p-4",children:[ce.jsx(w4n,{className:"rf-size-14 rf-mb-4"}),ce.jsxs("p",{className:"rf-text-md rf-break-words rf-max-w-xl rf-text-center",children:["Tip: ",ce.jsx("span",{dangerouslySetInnerHTML:{__html:nDn}})]}),n&&ce.jsxs(H_,{className:"rf-mt-4 rf-bg-blue-600 rf-hover:bg-blue-500",onClick:n,children:["Run Code",ce.jsx(T4n,{className:"rf-w-3 rf-h-3 rf-ml-2"})]})]}),KG=({text:n,onClick:e})=>ce.jsx("span",{className:"rf-cursor-pointer rf-underline rf-text-blue-600 rf-mx-2",onClick:e,children:n}),ZG=n=>ce.jsxs("div",{className:"rf-leading-5",children:[ce.jsx("div",{className:"rf-py-2 rf-font-bold",children:n.column.name}),ce.jsx("div",{children:n.field?.()??ce.jsx("input",{type:"text",className:"rf-border rf-rounded rf-p-1 rf-w-full",onChange:e=>{n.onTextChange?.(e.target.value)}})})]}),iDn=({open:n,children:e,title:t,onClose:i})=>n?ce.jsx("div",{className:"rf-fixed rf-inset-0 rf-bg-black rf-bg-opacity-50 rf-flex rf-justify-center rf-items-center rf-z-50",onClick:i,children:ce.jsxs("div",{className:"rf-bg-white rf-p-5 rf-rounded-lg rf-relative rf-w-11/12 rf-max-w-2xl",onClick:r=>{r.preventDefault(),r.stopPropagation()},children:[ce.jsx("h2",{className:"rf-mt-0 rf-text-md rf-pb-4",children:t}),ce.jsx("button",{type:"button",className:"rf-absolute rf-top-2 rf-right-4 rf-text-2xl rf-font-bold",onClick:i,children:"×"}),e]})}):null,rDn=({elements:n})=>{const[e,t]=pe.useState({open:!1}),[i,r]=pe.useReducer((u,d)=>({...u,...d}),{}),o=[...new Set(n.map(u=>u.type))],s=n.map(u=>{const d=u[`${u.type}_id`],h=Object.fromEntries(Object.entries(u).filter(([m])=>!(m===`${u.type}_id`||!m.endsWith("_id")))),p=Object.fromEntries(Object.entries(u).filter(([m])=>!m.endsWith("_id")));return{primary_id:d,other_ids:h,...p,_og_elm:u}}),a=s.map(u=>{let d="";const h=p=>{const m=Object.keys(p.other_ids).find(x=>x.startsWith("source_"));if(!m)return`.${p.name}`;const _=m.slice(0,-3),g=s.find(x=>x.type===_&&x.primary_id===p.other_ids[m]);return g?"name"in g?`${h(g)} > .${p.name}`:`#${g.primary_id} > .${p.name}`:`??? > .${p.name}`};return"name"in u&&(d=h(u)),{...u,selector_path:d}}),c=[{key:"primary_id",name:"primary_id",renderCell:u=>ce.jsxs("div",{className:"rf-flex rf-items-center",children:[ce.jsx(KG,{text:u.primary_id,onClick:()=>r({focused_id:u.primary_id,id_search:void 0,selector_search:void 0})}),ce.jsx("span",{className:"rf-flex-grow"}),ce.jsx(KG,{text:"(JSON)",onClick:()=>t({open:!0,element:u._og_elm,title:u.primary_id})})]}),renderHeaderCell:u=>ce.jsx(ZG,{column:u,onTextChange:d=>r({id_search:d}),field:i.focused_id?()=>ce.jsxs("div",{children:["Focus:"," ",ce.jsx("span",{className:"rf-underline",children:i.focused_id}),ce.jsx(KG,{text:"(unfocus)",onClick:()=>r({focused_id:void 0})})]}):void 0})},{key:"type",name:"type",renderHeaderCell:u=>ce.jsx(ZG,{column:u,field:()=>ce.jsxs("select",{onChange:d=>r({component_type_filter:d.target.value}),className:"rf-border rf-rounded rf-p-1 rf-w-full",children:[ce.jsx("option",{value:"any",children:"any"},"any"),ce.jsx("option",{value:"source",children:"source"},"source"),ce.jsx("option",{value:"source/pcb",children:"source/pcb"},"source/pcb"),ce.jsx("option",{value:"source/schematic",children:"source/schematic"},"source/schematic"),o.map(d=>ce.jsx("option",{value:d,children:d},d))]})})},{key:"name",name:"name",renderHeaderCell:u=>ce.jsx(ZG,{column:u,onTextChange:d=>r({name_search:d})})},{key:"selector_path",name:"selector_path",renderHeaderCell:u=>ce.jsx(ZG,{column:u,onTextChange:d=>r({selector_search:d})})},{key:"other_ids",name:"other_ids",renderCell:u=>ce.jsx("div",{className:"rf-space-x-2",children:Object.entries(u.other_ids).map(([d,h])=>ce.jsx(KG,{text:h,onClick:()=>r({focused_id:h})},h))})}],l=a.filter(u=>i.name_search?u.name?.toLowerCase()?.includes(i.name_search.toLowerCase()):!0).filter(u=>!i.component_type_filter||i.component_type_filter==="any"?!0:i.component_type_filter==="source"?u.type.startsWith("source_"):i.component_type_filter==="source/pcb"?u.type.startsWith("source_")||u.type.startsWith("pcb_"):i.component_type_filter==="source/schematic"?u.type.startsWith("source_")||u.type.startsWith("schematic_"):u.type?.includes(i.component_type_filter)).filter(u=>i.selector_search?i.selector_search.split(" ").filter(h=>h.length>0).every(h=>u.selector_path?.includes(h)):!0).filter(u=>i.id_search?u.primary_id?.includes(i.id_search):!0).filter(u=>!!(!i.focused_id||u.primary_id===i.focused_id||Object.values(u.other_ids).includes(i.focused_id)));return ce.jsxs("div",{className:"rf-font-mono rf-text-xs rf-bg-white",children:[ce.jsx("div",{className:"rf-overflow-x-auto",children:ce.jsxs("table",{className:"rf-table-auto rf-w-full rf-text-left",children:[ce.jsx("thead",{children:ce.jsx("tr",{children:c.map(u=>ce.jsx("th",{className:"rf-px-4 rf-py-2 rf-border-b",children:u.renderHeaderCell?u.renderHeaderCell(u):u.name},u.key))})}),ce.jsx("tbody",{children:l.map((u,d)=>ce.jsx("tr",{className:"rf-hover:bg-gray-100",children:c.map(h=>ce.jsx("td",{className:"rf-px-4 rf-py-2 rf-border-b",children:h.renderCell?h.renderCell(u):u[h.key]},h.key))},d))})]})}),ce.jsx(iDn,{open:e.open,onClose:()=>t({open:!1}),title:e.open?e.title:"",children:ce.jsx("div",{className:"rf-bg-gray-800 rf-p-3 rf-text-white rf-rounded",children:ce.jsx("pre",{className:"rf-whitespace-pre-wrap",children:e.open?JSON.stringify(e.element,null,2):""})})})]})},oDn=(n,e)=>n==="jlcpcb"?ce.jsx("a",{className:"rf-underline rf-text-blue-500",target:"_blank",rel:"noreferrer",href:`https://jlcpcb.com/partdetail/${e}`,children:e}):e,sDn=({circuitJson:n})=>{const e=n.filter(i=>i.type==="source_component"),t=new Set;for(const i of e)if(i.supplier_part_numbers)for(const r of Object.keys(i.supplier_part_numbers))t.add(r);return ce.jsx("div",{className:"rf-overflow-x-auto",children:ce.jsxs("table",{className:"rf-w-full rf-text-left rf-text-sm",children:[ce.jsx("thead",{children:ce.jsxs("tr",{className:"rf-border-b",children:[ce.jsx("th",{className:"rf-p-2",children:"Name"}),Array.from(t).map(i=>ce.jsx("th",{className:"rf-p-2 rf-capitalize",children:i},i))]})}),ce.jsx("tbody",{children:e.map(i=>ce.jsxs("tr",{className:"rf-border-b",children:[ce.jsx("td",{className:"rf-p-2",children:i.name}),Array.from(t).map(r=>ce.jsx("td",{className:"rf-p-2",children:oDn(r,i.supplier_part_numbers?.[r]?.[0]||"")},r))]},i.source_component_id))})]})})},d1e=pe.forwardRef(({className:n,type:e,...t},i)=>ce.jsx("input",{type:e,className:Ha("rf-flex rf-h-9 rf-w-full rf-rounded-md rf-border rf-border-zinc-200 rf-bg-white rf-px-3 rf-py-1 rf-text-sm rf-shadow-sm rf-transition-colors file:rf-border-0 file:rf-bg-transparent file:rf-text-sm file:rf-font-medium placeholder:rf-text-zinc-500 focus-visible:rf-outline-none focus-visible:rf-ring-1 focus-visible:rf-ring-zinc-950 disabled:rf-cursor-not-allowed disabled:rf-opacity-50 dark:rf-border-zinc-800 dark:rf-bg-zinc-950 dark:rf-placeholder-zinc-400 dark:focus-visible:rf-ring-zinc-300",n),ref:i,...t}));d1e.displayName="Input";var Wat={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1e3,Hz:1}},g:{baseUnit:"g",variants:{kg:1e3,g:1}},Ω:{baseUnit:"Ω",variants:{mΩ:.001,Ω:1,kΩ:1e3,KΩ:1e3,kohm:1e3,MΩ:1e6,GΩ:1e9,TΩ:1e12}},V:{baseUnit:"V",variants:{mV:.001,V:1,kV:1e3,KV:1e3,MV:1e6,GV:1e9,TV:1e12}},A:{baseUnit:"A",variants:{µA:1e-6,mA:.001,ma:.001,A:1,kA:1e3,MA:1e6}},F:{baseUnit:"F",variants:{pF:1e-12,nF:1e-9,µF:1e-6,uF:1e-6,mF:.001,F:1}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1e3,L:1e3}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:1e-12,ps:1e-9,ns:1e-6,us:.001,µs:.001,ms:1,s:1e3}},mm:{baseUnit:"mm",variants:{nm:1e-6,µm:.001,um:.001,mm:1,cm:10,dm:100,m:1e3,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:.0254}}},h1e=new Set;for(const[n,e]of Object.entries(Wat)){h1e.add(n);for(const t of Object.keys(e.variants))h1e.add(t)}function aDn(n){for(const[e,t]of Object.entries(Wat))if(n in t.variants)return{baseUnit:t.baseUnit,conversionFactor:t.variants[n]};return{baseUnit:n,conversionFactor:1}}var Kat={tera:1e12,T:1e12,giga:1e9,G:1e9,mega:1e6,M:1e6,kilo:1e3,k:1e3,deci:.1,d:.1,centi:.01,c:.01,milli:.001,m:.001,micro:1e-6,u:1e-6,µ:1e-6,nano:1e-9,n:1e-9,pico:1e-12,p:1e-12};function eE(n){if(n==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof n=="string"&&n.match(/^-?[\d\.]+$/))return{value:Number.parseFloat(n),parsedUnit:null,unitOfValue:null};if(typeof n=="number")return{value:n,parsedUnit:null,unitOfValue:null};if(typeof n=="object"&&"x"in n&&"y"in n){const{parsedUnit:a,unitOfValue:c}=eE(n.x),l=eE(n.x),u=eE(n.y);return l.value===null||u.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:a,unitOfValue:c,value:{x:l.value,y:u.value}}}const t=n.toString().split("").reverse().join("").match(/[^\d\s]+/)?.[0];if(!t)throw new Error(`Could not determine unit: "${n}"`);const i=t.split("").reverse().join(""),r=n.slice(0,-i.length);if(i in Kat&&!h1e.has(i)){const a=Kat[i];return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*a}}const{baseUnit:o,conversionFactor:s}=aDn(i);return{parsedUnit:i,unitOfValue:o,value:s*Number.parseFloat(r)}}var QG=R().or(Pe()).transform(n=>eE(n).value),p1e=R().or(Pe()).transform(n=>eE(n).value).transform(n=>Number.parseFloat(n.toPrecision(12))),Zat=R().or(Pe()).transform(n=>eE(n).value),L4=R().or(Pe()).transform(n=>eE(n).value),os=R().or(Pe()).transform(n=>eE(n).value),JG=R().or(Pe()).transform(n=>eE(n).value),di=os,cDn=R().or(Pe()).transform(n=>eE(n).value),_L=R().or(Pe()).transform(n=>eE(n).value),lDn=_L,D4=_L,Qat=R().datetime(),fw=R().or(Pe()).transform(n=>typeof n=="number"?n:n.endsWith("deg")?Number.parseFloat(n.split("deg")[0]):n.endsWith("rad")?Number.parseFloat(n.split("rad")[0])*180/Math.PI:Number.parseFloat(n)),Jat=Pe().or(R().endsWith("mAh")).transform(n=>{if(typeof n=="string"){const e=n.replace("mAh",""),t=Number.parseFloat(e);if(Number.isNaN(t))throw new Error("Invalid capacity");return t}return n}).describe("Battery capacity in mAh"),xs=Se({x:di,y:di}),uDn=xs,yL=Se({x:di,y:di,z:di}),dDn=yL,f1e=Se({width:Pe(),height:Pe()}),hDn=n=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";return Array.from({length:n},()=>e[Math.floor(Math.random()*e.length)]).join("")},Ki=n=>R().optional().default(()=>`${n}_${hDn(10)}`),gL=Xt(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),ect=Xt(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),Zg=Se({type:fe("source_component"),ftype:R().optional(),source_component_id:R(),name:R(),manufacturer_part_number:R().optional(),supplier_part_numbers:rs(ect,ut(R())).optional(),display_value:R().optional(),are_pins_interchangeable:Je().optional(),internally_connected_source_port_ids:ut(ut(R())).optional(),source_group_id:R().optional(),subcircuit_id:R().optional()}),m1e=Zg.extend({ftype:fe("simple_capacitor"),capacitance:p1e,max_voltage_rating:L4.optional(),display_capacitance:R().optional(),max_decoupling_trace_length:di.optional()}),_1e=Zg.extend({ftype:fe("simple_resistor"),resistance:QG,display_resistance:R().optional()}),eY=Zg.extend({ftype:fe("simple_diode")}),y1e=eY.extend({ftype:fe("simple_led"),color:R().optional(),wavelength:R().optional()}),tct=Zg.extend({ftype:fe("simple_ground")}),g1e=Zg.extend({ftype:fe("simple_chip")}),x1e=Zg.extend({ftype:fe("simple_power_source"),voltage:L4}),pDn=Zg.extend({ftype:fe("simple_fuse"),current_rating_amps:Pe().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:Pe().describe("Voltage rating in volts, e.g. ±5V would be 5")}),b1e=Zg.extend({ftype:fe("simple_battery"),capacity:Jat}),v1e=Zg.extend({ftype:fe("simple_inductor"),inductance:Zat,max_current_rating:Pe().optional()}),w1e=Zg.extend({ftype:fe("simple_push_button")}),S1e=Zg.extend({ftype:fe("simple_potentiometer"),max_resistance:QG}),nct=Zg.extend({ftype:fe("simple_crystal"),frequency:Pe().describe("Frequency in Hz"),load_capacitance:Pe().optional().describe("Load capacitance in pF")}),E1e=Zg.extend({ftype:fe("simple_pin_header"),pin_count:Pe(),gender:Xt(["male","female"]).optional().default("male")}),T1e=Zg.extend({ftype:fe("simple_pinout")}),M1e=Zg.extend({ftype:fe("simple_resonator"),load_capacitance:p1e,equivalent_series_resistance:QG.optional(),frequency:JG}),C1e=Zg.extend({ftype:fe("simple_transistor"),transistor_type:Xt(["npn","pnp"])}),A1e=Zg.extend({ftype:fe("simple_test_point"),footprint_variant:Xt(["pad","through_hole"]).optional(),pad_shape:Xt(["rect","circle"]).optional(),pad_diameter:Bn([Pe(),R()]).optional(),hole_diameter:Bn([Pe(),R()]).optional(),width:Bn([Pe(),R()]).optional(),height:Bn([Pe(),R()]).optional()}),P1e=Zg.extend({ftype:fe("simple_mosfet"),channel_type:Xt(["n","p"]),mosfet_mode:Xt(["enhancement","depletion"])}),R1e=Zg.extend({ftype:fe("simple_switch")}),I1e=Se({type:fe("source_project_metadata"),name:R().optional(),software_used_string:R().optional(),project_url:R().optional(),created_at:Qat.optional()}),ict=Se({type:fe("source_missing_property_error"),source_missing_property_error_id:Ki("source_missing_property_error"),source_component_id:R(),property_name:R(),subcircuit_id:R().optional(),error_type:fe("source_missing_property_error").default("source_missing_property_error"),message:R()}).describe("The source code is missing a property"),rct=Se({type:fe("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:Ki("source_failed_to_create_component_error"),error_type:fe("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:R().optional(),subcircuit_id:R().optional(),parent_source_component_id:R().optional(),message:R(),pcb_center:Se({x:Pe().optional(),y:Pe().optional()}).optional(),schematic_center:Se({x:Pe().optional(),y:Pe().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),N1e=Se({type:fe("source_trace_not_connected_error"),source_trace_not_connected_error_id:Ki("source_trace_not_connected_error"),error_type:fe("source_trace_not_connected_error").default("source_trace_not_connected_error"),message:R(),subcircuit_id:R().optional(),source_group_id:R().optional(),source_trace_id:R().optional(),connected_source_port_ids:ut(R()).optional(),selectors_not_found:ut(R()).optional()}).describe("Occurs when a source trace selector does not match any ports"),oct=Se({type:fe("source_property_ignored_warning"),source_property_ignored_warning_id:Ki("source_property_ignored_warning"),source_component_id:R(),property_name:R(),subcircuit_id:R().optional(),error_type:fe("source_property_ignored_warning").default("source_property_ignored_warning"),message:R()}).describe("The source property was ignored"),k1e=Se({type:fe("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:Ki("source_pin_missing_trace_warning"),warning_type:fe("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:R(),source_component_id:R(),source_port_id:R(),subcircuit_id:R().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),sct=Bn([_1e,m1e,eY,y1e,tct,g1e,x1e,b1e,v1e,w1e,S1e,nct,E1e,T1e,M1e,R1e,C1e,A1e,P1e,pDn,I1e,ict,rct,N1e,oct,k1e]),act=Se({type:fe("source_port"),pin_number:Pe().optional(),port_hints:ut(R()).optional(),name:R(),source_port_id:R(),source_component_id:R().optional(),source_group_id:R().optional(),subcircuit_id:R().optional(),subcircuit_connectivity_map_key:R().optional()}),cct=Se({type:fe("source_trace"),source_trace_id:R(),connected_source_port_ids:ut(R()),connected_source_net_ids:ut(R()),subcircuit_id:R().optional(),subcircuit_connectivity_map_key:R().optional(),max_length:Pe().optional(),min_trace_thickness:Pe().optional(),display_name:R().optional()}),lct=Se({type:fe("source_group"),source_group_id:R(),subcircuit_id:R().optional(),parent_subcircuit_id:R().optional(),parent_source_group_id:R().optional(),is_subcircuit:Je().optional(),show_as_schematic_box:Je().optional(),name:R().optional(),was_automatically_named:Je().optional()}),uct=Se({type:fe("source_net"),source_net_id:R(),name:R(),member_source_group_ids:ut(R()),is_power:Je().optional(),is_ground:Je().optional(),is_digital_signal:Je().optional(),is_analog_signal:Je().optional(),is_positive_voltage_source:Je().optional(),trace_width:Pe().optional(),subcircuit_id:R().optional(),subcircuit_connectivity_map_key:R().optional()}),dct=Se({type:fe("source_board"),source_board_id:R(),source_group_id:R(),title:R().optional()}).describe("Defines a board in the source domain"),hct=Se({type:fe("source_pcb_ground_plane"),source_pcb_ground_plane_id:R(),source_group_id:R(),source_net_id:R(),subcircuit_id:R().optional()}).describe("Defines a ground plane in the source domain"),pct=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],O1e=Xt(pct),bd=O1e.or(Se({name:O1e})).transform(n=>typeof n=="string"?n:n.name),tE=Xt(["top","bottom"]),fct=Se({type:fe("source_manually_placed_via"),source_manually_placed_via_id:R(),source_group_id:R(),source_net_id:R(),subcircuit_id:R().optional(),source_trace_id:R().optional()}).describe("Defines a via that is manually placed in the source domain"),mct=Se({type:fe("unknown_error_finding_part"),unknown_error_finding_part_id:Ki("unknown_error_finding_part"),error_type:fe("unknown_error_finding_part").default("unknown_error_finding_part"),message:R(),source_component_id:R().optional(),subcircuit_id:R().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),_ct=Se({type:fe("schematic_box"),schematic_component_id:R().optional(),width:di,height:di,is_dashed:Je().default(!1),x:di,y:di,subcircuit_id:R().optional()}).describe("Draws a box on the schematic"),yct=Se({type:fe("schematic_path"),schematic_component_id:R(),fill_color:Xt(["red","blue"]).optional(),is_filled:Je().optional(),points:ut(xs),subcircuit_id:R().optional()}),gct=rs(Se({left_margin:os.optional(),right_margin:os.optional(),top_margin:os.optional(),bottom_margin:os.optional()})),xct=Se({left_size:Pe(),right_size:Pe(),top_size:Pe().optional(),bottom_size:Pe().optional()}),bct=Se({left_side:Se({pins:ut(Pe()),direction:Xt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:Se({pins:ut(Pe()),direction:Xt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:Se({pins:ut(Pe()),direction:Xt(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:Se({pins:ut(Pe()),direction:Xt(["left-to-right","right-to-left"]).optional()}).optional()}),vct=Bn([xct,bct]),wct=Se({type:fe("schematic_component"),size:f1e,center:xs,source_component_id:R().optional(),schematic_component_id:R(),pin_spacing:os.optional(),pin_styles:gct.optional(),box_width:os.optional(),symbol_name:R().optional(),port_arrangement:vct.optional(),port_labels:rs(R()).optional(),symbol_display_value:R().optional(),subcircuit_id:R().optional(),schematic_group_id:R().optional(),is_schematic_group:Je().optional(),source_group_id:R().optional(),is_box_with_pins:Je().optional().default(!0)}),Sct=Se({type:fe("schematic_line"),schematic_line_id:Ki("schematic_line"),schematic_component_id:R(),x1:di,y1:di,x2:di,y2:di,stroke_width:di.nullable().optional(),color:R().default("#000000"),is_dashed:Je().default(!1),subcircuit_id:R().optional()}).describe("Draws a styled line on the schematic"),Ect=Se({type:fe("schematic_rect"),schematic_rect_id:Ki("schematic_rect"),schematic_component_id:R(),center:xs,width:di,height:di,rotation:fw.default(0),stroke_width:di.nullable().optional(),color:R().default("#000000"),is_filled:Je().default(!1),fill_color:R().optional(),is_dashed:Je().default(!1),subcircuit_id:R().optional()}).describe("Draws a styled rectangle on the schematic"),Tct=Se({type:fe("schematic_circle"),schematic_circle_id:Ki("schematic_circle"),schematic_component_id:R(),center:xs,radius:di,stroke_width:di.nullable().optional(),color:R().default("#000000"),is_filled:Je().default(!1),fill_color:R().optional(),is_dashed:Je().default(!1),subcircuit_id:R().optional()}).describe("Draws a styled circle on the schematic"),Mct=Se({type:fe("schematic_arc"),schematic_arc_id:Ki("schematic_arc"),schematic_component_id:R(),center:xs,radius:di,start_angle_degrees:fw,end_angle_degrees:fw,direction:Xt(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:di.nullable().optional(),color:R().default("#000000"),is_dashed:Je().default(!1),subcircuit_id:R().optional()}).describe("Draws a styled arc on the schematic"),Cct=Se({type:fe("schematic_trace"),schematic_trace_id:R(),source_trace_id:R().optional(),junctions:ut(Se({x:Pe(),y:Pe()})),edges:ut(Se({from:Se({x:Pe(),y:Pe()}),to:Se({x:Pe(),y:Pe()}),is_crossing:Je().optional(),from_schematic_port_id:R().optional(),to_schematic_port_id:R().optional()})),subcircuit_id:R().optional(),subcircuit_connectivity_map_key:R().optional()}),fDn=Xt(["center","left","right","top","bottom"]),Act=Se({type:fe("schematic_text"),schematic_component_id:R().optional(),schematic_text_id:R(),text:R(),font_size:Pe().default(.18),position:Se({x:di,y:di}),rotation:Pe().default(0),anchor:Bn([fDn.describe("legacy"),gL]).default("center"),color:R().default("#000000"),subcircuit_id:R().optional()}),Pct=Se({type:fe("schematic_port"),schematic_port_id:R(),source_port_id:R(),schematic_component_id:R().optional(),center:xs,facing_direction:Xt(["up","down","left","right"]).optional(),distance_from_component_edge:Pe().optional(),side_of_component:Xt(["top","bottom","left","right"]).optional(),true_ccw_index:Pe().optional(),pin_number:Pe().optional(),display_pin_label:R().optional(),subcircuit_id:R().optional(),is_connected:Je().optional(),has_input_arrow:Je().optional(),has_output_arrow:Je().optional()}).describe("Defines a port on a schematic component"),Rct=Se({type:fe("schematic_net_label"),schematic_net_label_id:Ki("schematic_net_label"),schematic_trace_id:R().optional(),source_trace_id:R().optional(),source_net_id:R(),center:xs,anchor_position:xs.optional(),anchor_side:Xt(["top","bottom","left","right"]),text:R(),symbol_name:R().optional(),is_movable:Je().optional(),subcircuit_id:R().optional()}),Ict=Se({type:fe("schematic_error"),schematic_error_id:R(),error_type:fe("schematic_port_not_found").default("schematic_port_not_found"),message:R(),subcircuit_id:R().optional()}).describe("Defines a schematic error on the schematic"),Nct=Se({type:fe("schematic_layout_error"),schematic_layout_error_id:Ki("schematic_layout_error"),error_type:fe("schematic_layout_error").default("schematic_layout_error"),message:R(),source_group_id:R(),schematic_group_id:R(),subcircuit_id:R().optional()}).describe("Error emitted when schematic layout fails for a group"),tY=Se({type:fe("schematic_debug_object"),label:R().optional(),subcircuit_id:R().optional()}),kct=tY.extend({shape:fe("rect"),center:xs,size:f1e}),Oct=tY.extend({shape:fe("line"),start:xs,end:xs}),Lct=tY.extend({shape:fe("point"),center:xs}),Dct=_m("shape",[kct,Oct,Lct]),zct=Se({type:fe("schematic_voltage_probe"),schematic_voltage_probe_id:R(),position:xs,schematic_trace_id:R(),voltage:L4.optional(),subcircuit_id:R().optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),$ct=Se({type:fe("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:Ki("schematic_manual_edit_conflict_warning"),warning_type:fe("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:R(),schematic_component_id:R(),schematic_group_id:R().optional(),subcircuit_id:R().optional(),source_component_id:R()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),Fct=Se({type:fe("schematic_group"),schematic_group_id:Ki("schematic_group"),source_group_id:R(),is_subcircuit:Je().optional(),subcircuit_id:R().optional(),width:os,height:os,center:xs,schematic_component_ids:ut(R()),show_as_schematic_box:Je().optional(),name:R().optional(),description:R().optional()}).describe("Defines a group of components on the schematic"),Uct=Se({type:fe("schematic_table"),schematic_table_id:Ki("schematic_table"),anchor_position:xs,column_widths:ut(di),row_heights:ut(di),cell_padding:di.optional(),border_width:di.optional(),subcircuit_id:R().optional(),schematic_component_id:R().optional(),anchor:gL.optional()}).describe("Defines a table on the schematic"),Bct=Se({type:fe("schematic_table_cell"),schematic_table_cell_id:Ki("schematic_table_cell"),schematic_table_id:R(),start_row_index:Pe(),end_row_index:Pe(),start_column_index:Pe(),end_column_index:Pe(),text:R().optional(),center:xs,width:di,height:di,horizontal_align:Xt(["left","center","right"]).optional(),vertical_align:Xt(["top","middle","bottom"]).optional(),font_size:di.optional(),subcircuit_id:R().optional()}).describe("Defines a cell within a schematic_table"),jct=Se({x:di,y:di,bulge:Pe().optional()}),L1e=Se({vertices:ut(jct)}),Hct=Se({outer_ring:L1e,inner_rings:ut(L1e).default([])}),Vct=Se({x:di,y:di,via:Je().optional(),via_to_layer:bd.optional()}),mDn=ut(Vct),Gct=Se({x:di,y:di,via:Je().optional(),to_layer:bd.optional(),trace_width:di.optional()}),Yct=Se({type:fe("pcb_component"),pcb_component_id:Ki("pcb_component"),source_component_id:R(),center:xs,layer:bd,rotation:fw,width:os,height:os,do_not_place:Je().optional(),subcircuit_id:R().optional(),pcb_group_id:R().optional(),obstructs_within_bounds:Je().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),qct=Se({type:fe("pcb_hole"),pcb_hole_id:Ki("pcb_hole"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),hole_shape:Xt(["circle","square"]),hole_diameter:Pe(),x:di,y:di}),_Dn=qct.describe("Defines a circular or square hole on the PCB"),Xct=Se({type:fe("pcb_hole"),pcb_hole_id:Ki("pcb_hole"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),hole_shape:fe("oval"),hole_width:Pe(),hole_height:Pe(),x:di,y:di}),yDn=Xct.describe("Defines an oval hole on the PCB"),Wct=Se({type:fe("pcb_hole"),pcb_hole_id:Ki("pcb_hole"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),hole_shape:fe("pill"),hole_width:Pe(),hole_height:Pe(),x:di,y:di}),gDn=Wct.describe("Defines a pill-shaped hole on the PCB"),Kct=Se({type:fe("pcb_hole"),pcb_hole_id:Ki("pcb_hole"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),hole_shape:fe("rotated_pill"),hole_width:Pe(),hole_height:Pe(),x:di,y:di,ccw_rotation:fw}),xDn=Kct.describe("Defines a rotated pill-shaped hole on the PCB"),Zct=qct.or(Xct).or(Wct).or(Kct),bDn=Se({type:fe("pcb_plated_hole"),shape:fe("circle"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),outer_diameter:Pe(),hole_diameter:Pe(),x:di,y:di,layers:ut(bd),port_hints:ut(R()).optional(),pcb_component_id:R().optional(),pcb_port_id:R().optional(),pcb_plated_hole_id:Ki("pcb_plated_hole")}),vDn=Se({type:fe("pcb_plated_hole"),shape:Xt(["oval","pill"]),pcb_group_id:R().optional(),subcircuit_id:R().optional(),outer_width:Pe(),outer_height:Pe(),hole_width:Pe(),hole_height:Pe(),x:di,y:di,ccw_rotation:fw,layers:ut(bd),port_hints:ut(R()).optional(),pcb_component_id:R().optional(),pcb_port_id:R().optional(),pcb_plated_hole_id:Ki("pcb_plated_hole")}),wDn=Se({type:fe("pcb_plated_hole"),shape:fe("circular_hole_with_rect_pad"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),hole_shape:fe("circle"),pad_shape:fe("rect"),hole_diameter:Pe(),rect_pad_width:Pe(),rect_pad_height:Pe(),rect_border_radius:Pe().optional(),hole_offset_x:di.default(0),hole_offset_y:di.default(0),x:di,y:di,layers:ut(bd),port_hints:ut(R()).optional(),pcb_component_id:R().optional(),pcb_port_id:R().optional(),pcb_plated_hole_id:Ki("pcb_plated_hole")}),SDn=Se({type:fe("pcb_plated_hole"),shape:fe("pill_hole_with_rect_pad"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),hole_shape:fe("pill"),pad_shape:fe("rect"),hole_width:Pe(),hole_height:Pe(),rect_pad_width:Pe(),rect_pad_height:Pe(),rect_border_radius:Pe().optional(),hole_offset_x:di.default(0),hole_offset_y:di.default(0),x:di,y:di,layers:ut(bd),port_hints:ut(R()).optional(),pcb_component_id:R().optional(),pcb_port_id:R().optional(),pcb_plated_hole_id:Ki("pcb_plated_hole")}),EDn=Se({type:fe("pcb_plated_hole"),shape:fe("rotated_pill_hole_with_rect_pad"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),hole_shape:fe("rotated_pill"),pad_shape:fe("rect"),hole_width:Pe(),hole_height:Pe(),hole_ccw_rotation:fw,rect_pad_width:Pe(),rect_pad_height:Pe(),rect_border_radius:Pe().optional(),rect_ccw_rotation:fw,hole_offset_x:di.default(0),hole_offset_y:di.default(0),x:di,y:di,layers:ut(bd),port_hints:ut(R()).optional(),pcb_component_id:R().optional(),pcb_port_id:R().optional(),pcb_plated_hole_id:Ki("pcb_plated_hole")}),Qct=Bn([bDn,vDn,wDn,SDn,EDn]),Jct=Se({type:fe("pcb_port"),pcb_port_id:Ki("pcb_port"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),source_port_id:R(),pcb_component_id:R().optional(),x:di,y:di,layers:ut(bd),is_board_pinout:Je().optional()}).describe("Defines a port on the PCB"),TDn=Se({type:fe("pcb_smtpad"),shape:fe("circle"),pcb_smtpad_id:Ki("pcb_smtpad"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),x:di,y:di,radius:Pe(),layer:bd,port_hints:ut(R()).optional(),pcb_component_id:R().optional(),pcb_port_id:R().optional(),is_covered_with_solder_mask:Je().optional()}),MDn=Se({type:fe("pcb_smtpad"),shape:fe("rect"),pcb_smtpad_id:Ki("pcb_smtpad"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),x:di,y:di,width:Pe(),height:Pe(),rect_border_radius:Pe().optional(),corner_radius:Pe().optional(),layer:bd,port_hints:ut(R()).optional(),pcb_component_id:R().optional(),pcb_port_id:R().optional(),is_covered_with_solder_mask:Je().optional()}),CDn=Se({type:fe("pcb_smtpad"),shape:fe("rotated_rect"),pcb_smtpad_id:Ki("pcb_smtpad"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),x:di,y:di,width:Pe(),height:Pe(),rect_border_radius:Pe().optional(),corner_radius:Pe().optional(),ccw_rotation:fw,layer:bd,port_hints:ut(R()).optional(),pcb_component_id:R().optional(),pcb_port_id:R().optional(),is_covered_with_solder_mask:Je().optional()}),elt=Se({type:fe("pcb_smtpad"),shape:fe("pill"),pcb_smtpad_id:Ki("pcb_smtpad"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),x:di,y:di,width:Pe(),height:Pe(),radius:Pe(),layer:bd,port_hints:ut(R()).optional(),pcb_component_id:R().optional(),pcb_port_id:R().optional(),is_covered_with_solder_mask:Je().optional()}),ADn=Se({type:fe("pcb_smtpad"),shape:fe("rotated_pill"),pcb_smtpad_id:Ki("pcb_smtpad"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),x:di,y:di,width:Pe(),height:Pe(),radius:Pe(),ccw_rotation:fw,layer:bd,port_hints:ut(R()).optional(),pcb_component_id:R().optional(),pcb_port_id:R().optional(),is_covered_with_solder_mask:Je().optional()}),PDn=Se({type:fe("pcb_smtpad"),shape:fe("polygon"),pcb_smtpad_id:Ki("pcb_smtpad"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),points:ut(xs),layer:bd,port_hints:ut(R()).optional(),pcb_component_id:R().optional(),pcb_port_id:R().optional(),is_covered_with_solder_mask:Je().optional()}),tlt=_m("shape",[TDn,MDn,CDn,ADn,elt,PDn]).describe("Defines an SMT pad on the PCB"),RDn=Se({type:fe("pcb_solder_paste"),shape:fe("circle"),pcb_solder_paste_id:Ki("pcb_solder_paste"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),x:di,y:di,radius:Pe(),layer:bd,pcb_component_id:R().optional(),pcb_smtpad_id:R().optional()}),IDn=Se({type:fe("pcb_solder_paste"),shape:fe("rect"),pcb_solder_paste_id:Ki("pcb_solder_paste"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),x:di,y:di,width:Pe(),height:Pe(),layer:bd,pcb_component_id:R().optional(),pcb_smtpad_id:R().optional()}),NDn=Se({type:fe("pcb_solder_paste"),shape:fe("pill"),pcb_solder_paste_id:Ki("pcb_solder_paste"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),x:di,y:di,width:Pe(),height:Pe(),radius:Pe(),layer:bd,pcb_component_id:R().optional(),pcb_smtpad_id:R().optional()}),kDn=Se({type:fe("pcb_solder_paste"),shape:fe("rotated_rect"),pcb_solder_paste_id:Ki("pcb_solder_paste"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),x:di,y:di,width:Pe(),height:Pe(),ccw_rotation:di,layer:bd,pcb_component_id:R().optional(),pcb_smtpad_id:R().optional()}),ODn=Se({type:fe("pcb_solder_paste"),shape:fe("oval"),pcb_solder_paste_id:Ki("pcb_solder_paste"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),x:di,y:di,width:Pe(),height:Pe(),layer:bd,pcb_component_id:R().optional(),pcb_smtpad_id:R().optional()}),nlt=Bn([RDn,IDn,NDn,kDn,ODn]).describe("Defines solderpaste on the PCB"),ilt=Se({type:fe("pcb_text"),pcb_text_id:Ki("pcb_text"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),text:R(),center:xs,layer:bd,width:os,height:os,lines:Pe(),align:Xt(["bottom-left"])}).describe("Defines text on the PCB"),rlt=Se({route_type:fe("wire"),x:di,y:di,width:di,start_pcb_port_id:R().optional(),end_pcb_port_id:R().optional(),layer:bd}),olt=Se({route_type:fe("via"),x:di,y:di,hole_diameter:di.optional(),outer_diameter:di.optional(),from_layer:R(),to_layer:R()}),slt=Bn([rlt,olt]),alt=Se({type:fe("pcb_trace"),source_trace_id:R().optional(),pcb_component_id:R().optional(),pcb_trace_id:Ki("pcb_trace"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),route_thickness_mode:Xt(["constant","interpolated"]).default("constant").optional(),route_order_index:Pe().optional(),should_round_corners:Je().optional(),trace_length:Pe().optional(),highlight_color:R().optional(),route:ut(slt)}).describe("Defines a trace on the PCB"),clt=Se({type:fe("pcb_trace_error"),pcb_trace_error_id:Ki("pcb_trace_error"),error_type:fe("pcb_trace_error").default("pcb_trace_error"),message:R(),center:xs.optional(),pcb_trace_id:R(),source_trace_id:R(),pcb_component_ids:ut(R()),pcb_port_ids:ut(R()),subcircuit_id:R().optional()}).describe("Defines a trace error on the PCB"),llt=Se({type:fe("pcb_trace_missing_error"),pcb_trace_missing_error_id:Ki("pcb_trace_missing_error"),error_type:fe("pcb_trace_missing_error").default("pcb_trace_missing_error"),message:R(),center:xs.optional(),source_trace_id:R(),pcb_component_ids:ut(R()),pcb_port_ids:ut(R()),subcircuit_id:R().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),ult=Se({type:fe("pcb_port_not_matched_error"),pcb_error_id:Ki("pcb_error"),error_type:fe("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),message:R(),pcb_component_ids:ut(R()),subcircuit_id:R().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),dlt=Se({type:fe("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:Ki("pcb_port_not_connected_error"),error_type:fe("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),message:R(),pcb_port_ids:ut(R()),pcb_component_ids:ut(R()),subcircuit_id:R().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),hlt=Se({type:fe("pcb_net"),pcb_net_id:Ki("pcb_net"),source_net_id:R().optional(),highlight_color:R().optional()}).describe("Defines a net on the PCB"),plt=Se({type:fe("pcb_via"),pcb_via_id:Ki("pcb_via"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),x:di,y:di,outer_diameter:di.default("0.6mm"),hole_diameter:di.default("0.25mm"),from_layer:bd.optional(),to_layer:bd.optional(),layers:ut(bd),pcb_trace_id:R().optional()}).describe("Defines a via on the PCB"),flt=Se({type:fe("pcb_board"),pcb_board_id:Ki("pcb_board"),pcb_panel_id:R().optional(),is_subcircuit:Je().optional(),subcircuit_id:R().optional(),width:os,height:os,center:xs,thickness:os.optional().default(1.4),num_layers:Pe().optional().default(4),outline:ut(xs).optional(),material:Xt(["fr4","fr1"]).default("fr4")}).describe("Defines the board outline of the PCB"),mlt=Se({type:fe("pcb_panel"),pcb_panel_id:Ki("pcb_panel"),width:os,height:os,covered_with_solder_mask:Je().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),_lt=Se({type:fe("pcb_placement_error"),pcb_placement_error_id:Ki("pcb_placement_error"),error_type:fe("pcb_placement_error").default("pcb_placement_error"),message:R(),subcircuit_id:R().optional()}).describe("Defines a placement error on the PCB"),ylt=Se({type:fe("pcb_trace_hint"),pcb_trace_hint_id:Ki("pcb_trace_hint"),pcb_port_id:R(),pcb_component_id:R(),route:ut(Gct),subcircuit_id:R().optional()}).describe("A hint that can be used during generation of a PCB trace"),glt=Se({type:fe("pcb_silkscreen_line"),pcb_silkscreen_line_id:Ki("pcb_silkscreen_line"),pcb_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),stroke_width:di.default("0.1mm"),x1:di,y1:di,x2:di,y2:di,layer:tE}).describe("Defines a silkscreen line on the PCB"),xlt=Se({type:fe("pcb_silkscreen_path"),pcb_silkscreen_path_id:Ki("pcb_silkscreen_path"),pcb_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),layer:tE,route:ut(xs),stroke_width:os}).describe("Defines a silkscreen path on the PCB"),blt=Se({type:fe("pcb_silkscreen_text"),pcb_silkscreen_text_id:Ki("pcb_silkscreen_text"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),font:fe("tscircuit2024").default("tscircuit2024"),font_size:di.default("0.2mm"),pcb_component_id:R(),text:R(),is_knockout:Je().default(!1).optional(),knockout_padding:Se({left:os,top:os,bottom:os,right:os}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:Pe().optional(),layer:bd,is_mirrored:Je().default(!1).optional(),anchor_position:xs.default({x:0,y:0}),anchor_alignment:gL.default("center")}).describe("Defines silkscreen text on the PCB"),vlt=Se({type:fe("pcb_copper_text"),pcb_copper_text_id:Ki("pcb_copper_text"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),font:fe("tscircuit2024").default("tscircuit2024"),font_size:di.default("0.2mm"),pcb_component_id:R(),text:R(),is_knockout:Je().default(!1).optional(),knockout_padding:Se({left:os,top:os,bottom:os,right:os}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:Pe().optional(),layer:bd,is_mirrored:Je().default(!1).optional(),anchor_position:xs.default({x:0,y:0}),anchor_alignment:gL.default("center")}).describe("Defines copper text on the PCB"),wlt=Se({type:fe("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:Ki("pcb_silkscreen_rect"),pcb_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),center:xs,width:os,height:os,layer:bd,stroke_width:os.default("1mm"),is_filled:Je().default(!0).optional(),has_stroke:Je().optional(),is_stroke_dashed:Je().optional()}).describe("Defines a silkscreen rect on the PCB"),Slt=Se({type:fe("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:Ki("pcb_silkscreen_circle"),pcb_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),center:xs,radius:os,layer:tE,stroke_width:os.default("1mm")}).describe("Defines a silkscreen circle on the PCB"),Elt=Se({type:fe("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:Ki("pcb_silkscreen_oval"),pcb_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),center:xs,radius_x:di,radius_y:di,layer:tE}).describe("Defines a silkscreen oval on the PCB"),Tlt=Se({type:fe("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:Ki("pcb_fabrication_note_text"),subcircuit_id:R().optional(),pcb_group_id:R().optional(),font:fe("tscircuit2024").default("tscircuit2024"),font_size:di.default("1mm"),pcb_component_id:R(),text:R(),layer:tE,anchor_position:xs.default({x:0,y:0}),anchor_alignment:Xt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:R().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),Mlt=Se({type:fe("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:Ki("pcb_fabrication_note_path"),pcb_component_id:R(),subcircuit_id:R().optional(),layer:bd,route:ut(xs),stroke_width:os,color:R().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),Clt=Se({type:fe("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:Ki("pcb_fabrication_note_rect"),pcb_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),center:xs,width:os,height:os,layer:tE,stroke_width:os.default("0.1mm"),is_filled:Je().optional(),has_stroke:Je().optional(),is_stroke_dashed:Je().optional(),color:R().optional()}).describe("Defines a fabrication note rectangle on the PCB"),Alt=Se({type:fe("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:Ki("pcb_fabrication_note_dimension"),pcb_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),layer:tE,from:xs,to:xs,text:R().optional(),text_ccw_rotation:Pe().optional(),offset:os.optional(),offset_distance:os.optional(),offset_direction:Se({x:Pe(),y:Pe()}).optional(),font:fe("tscircuit2024").default("tscircuit2024"),font_size:os.default("1mm"),color:R().optional(),arrow_size:os.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),Plt=Se({type:fe("pcb_note_text"),pcb_note_text_id:Ki("pcb_note_text"),pcb_component_id:R().optional(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),name:R().optional(),font:fe("tscircuit2024").default("tscircuit2024"),font_size:di.default("1mm"),text:R().optional(),anchor_position:xs.default({x:0,y:0}),anchor_alignment:Xt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:R().optional()}).describe("Defines a documentation note in text on the PCB"),Rlt=Se({type:fe("pcb_note_rect"),pcb_note_rect_id:Ki("pcb_note_rect"),pcb_component_id:R().optional(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),name:R().optional(),text:R().optional(),center:xs,width:os,height:os,stroke_width:os.default("0.1mm"),is_filled:Je().optional(),has_stroke:Je().optional(),is_stroke_dashed:Je().optional(),color:R().optional()}).describe("Defines a rectangular documentation note on the PCB"),Ilt=Se({type:fe("pcb_note_path"),pcb_note_path_id:Ki("pcb_note_path"),pcb_component_id:R().optional(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),name:R().optional(),text:R().optional(),route:ut(xs),stroke_width:os.default("0.1mm"),color:R().optional()}).describe("Defines a polyline documentation note on the PCB"),Nlt=Se({type:fe("pcb_note_line"),pcb_note_line_id:Ki("pcb_note_line"),pcb_component_id:R().optional(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),name:R().optional(),text:R().optional(),x1:di,y1:di,x2:di,y2:di,stroke_width:di.default("0.1mm"),color:R().optional(),is_dashed:Je().optional()}).describe("Defines a straight documentation note line on the PCB"),klt=Se({type:fe("pcb_note_dimension"),pcb_note_dimension_id:Ki("pcb_note_dimension"),pcb_component_id:R().optional(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),name:R().optional(),from:xs,to:xs,text:R().optional(),text_ccw_rotation:Pe().optional(),offset_distance:os.optional(),offset_direction:Se({x:Pe(),y:Pe()}).optional(),font:fe("tscircuit2024").default("tscircuit2024"),font_size:os.default("1mm"),color:R().optional(),arrow_size:os.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),Olt=Se({type:fe("pcb_footprint_overlap_error"),pcb_error_id:Ki("pcb_error"),error_type:fe("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),message:R(),pcb_smtpad_ids:ut(R()).optional(),pcb_plated_hole_ids:ut(R()).optional(),pcb_hole_ids:ut(R()).optional(),pcb_keepout_ids:ut(R()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),Llt=Se({type:fe("pcb_keepout"),shape:fe("rect"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),center:xs,width:di,height:di,pcb_keepout_id:R(),layers:ut(R()),description:R().optional()}).or(Se({type:fe("pcb_keepout"),shape:fe("circle"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),center:xs,radius:di,pcb_keepout_id:R(),layers:ut(R()),description:R().optional()})),D1e=Se({type:fe("pcb_cutout"),pcb_cutout_id:Ki("pcb_cutout"),pcb_group_id:R().optional(),subcircuit_id:R().optional()}),Dlt=D1e.extend({shape:fe("rect"),center:xs,width:os,height:os,rotation:fw.optional()}),zlt=D1e.extend({shape:fe("circle"),center:xs,radius:os}),$lt=D1e.extend({shape:fe("polygon"),points:ut(xs)}),Flt=_m("shape",[Dlt,zlt,$lt]).describe("Defines a cutout on the PCB, removing board material."),Ult=Se({type:fe("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:Ki("pcb_missing_footprint_error"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),error_type:fe("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:R(),message:R()}).describe("Defines a missing footprint error on the PCB"),Blt=Se({type:fe("external_footprint_load_error"),external_footprint_load_error_id:Ki("external_footprint_load_error"),pcb_component_id:R(),source_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),footprinter_string:R().optional(),error_type:fe("external_footprint_load_error").default("external_footprint_load_error"),message:R()}).describe("Defines an error when an external footprint fails to load"),jlt=Se({type:fe("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:Ki("circuit_json_footprint_load_error"),pcb_component_id:R(),source_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),error_type:fe("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),message:R(),circuit_json:ut(fl()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),Hlt=Se({type:fe("pcb_group"),pcb_group_id:Ki("pcb_group"),source_group_id:R(),is_subcircuit:Je().optional(),subcircuit_id:R().optional(),width:os.optional(),height:os.optional(),center:xs,outline:ut(xs).optional(),anchor_position:xs.optional(),anchor_alignment:Xt(["center","top_left","top_right","bottom_left","bottom_right"]).optional(),pcb_component_ids:ut(R()),name:R().optional(),description:R().optional(),layout_mode:R().optional(),autorouter_configuration:Se({trace_clearance:os}).optional(),autorouter_used_string:R().optional()}).describe("Defines a group of components on the PCB"),Vlt=Se({type:fe("pcb_autorouting_error"),pcb_error_id:Ki("pcb_autorouting_error"),error_type:fe("pcb_autorouting_error").default("pcb_autorouting_error"),message:R(),subcircuit_id:R().optional()}).describe("The autorouting has failed to route a portion of the board"),Glt=Se({type:fe("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:Ki("pcb_manual_edit_conflict_warning"),warning_type:fe("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:R(),pcb_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),source_component_id:R()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),Ylt=Se({type:fe("pcb_breakout_point"),pcb_breakout_point_id:Ki("pcb_breakout_point"),pcb_group_id:R(),subcircuit_id:R().optional(),source_trace_id:R().optional(),source_port_id:R().optional(),source_net_id:R().optional(),x:di,y:di}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),qlt=Se({type:fe("pcb_ground_plane"),pcb_ground_plane_id:Ki("pcb_ground_plane"),source_pcb_ground_plane_id:R(),source_net_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional()}).describe("Defines a ground plane on the PCB"),Xlt=Se({type:fe("pcb_ground_plane_region"),pcb_ground_plane_region_id:Ki("pcb_ground_plane_region"),pcb_ground_plane_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),layer:bd,points:ut(xs)}).describe("Defines a polygon region of a ground plane"),Wlt=Se({type:fe("pcb_thermal_spoke"),pcb_thermal_spoke_id:Ki("pcb_thermal_spoke"),pcb_ground_plane_id:R(),shape:R(),spoke_count:Pe(),spoke_thickness:di,spoke_inner_diameter:di,spoke_outer_diameter:di,pcb_plated_hole_id:R().optional(),subcircuit_id:R().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),z1e=Se({type:fe("pcb_copper_pour"),pcb_copper_pour_id:Ki("pcb_copper_pour"),pcb_group_id:R().optional(),subcircuit_id:R().optional(),layer:bd,source_net_id:R().optional()}),Klt=z1e.extend({shape:fe("rect"),center:xs,width:os,height:os,rotation:fw.optional()}),Zlt=z1e.extend({shape:fe("brep"),brep_shape:Hct}),Qlt=z1e.extend({shape:fe("polygon"),points:ut(xs)}),Jlt=_m("shape",[Klt,Zlt,Qlt]).describe("Defines a copper pour on the PCB."),eut=Se({type:fe("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:Ki("pcb_component_outside_board_error"),error_type:fe("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),message:R(),pcb_component_id:R(),pcb_board_id:R(),component_center:xs,component_bounds:Se({min_x:Pe(),max_x:Pe(),min_y:Pe(),max_y:Pe()}),subcircuit_id:R().optional(),source_component_id:R().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),tut=Se({type:fe("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:Ki("pcb_component_invalid_layer_error"),error_type:fe("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),message:R(),pcb_component_id:R().optional(),source_component_id:R(),layer:bd,subcircuit_id:R().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),nut=Se({type:fe("pcb_via_clearance_error"),pcb_error_id:Ki("pcb_error"),error_type:fe("pcb_via_clearance_error").default("pcb_via_clearance_error"),message:R(),pcb_via_ids:ut(R()).min(2),minimum_clearance:di.optional(),actual_clearance:di.optional(),pcb_center:Se({x:Pe().optional(),y:Pe().optional()}).optional(),subcircuit_id:R().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),iut=Se({type:fe("pcb_courtyard_rect"),pcb_courtyard_rect_id:Ki("pcb_courtyard_rect"),pcb_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),center:xs,width:os,height:os,layer:tE,color:R().optional()}).describe("Defines a courtyard rectangle on the PCB"),rut=Se({type:fe("pcb_courtyard_outline"),pcb_courtyard_outline_id:Ki("pcb_courtyard_outline"),pcb_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),layer:tE,outline:ut(xs).min(2),stroke_width:os.default("0.1mm"),is_closed:Je().optional(),is_stroke_dashed:Je().optional(),color:R().optional()}).describe("Defines a courtyard outline on the PCB"),out=Se({type:fe("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:Ki("pcb_courtyard_polygon"),pcb_component_id:R(),pcb_group_id:R().optional(),subcircuit_id:R().optional(),layer:tE,points:ut(xs).min(3),color:R().optional()}).describe("Defines a courtyard polygon on the PCB"),sut=Se({type:fe("cad_component"),cad_component_id:R(),pcb_component_id:R(),source_component_id:R(),position:yL,rotation:yL.optional(),size:yL.optional(),layer:bd.optional(),subcircuit_id:R().optional(),footprinter_string:R().optional(),model_obj_url:R().optional(),model_stl_url:R().optional(),model_3mf_url:R().optional(),model_gltf_url:R().optional(),model_glb_url:R().optional(),model_step_url:R().optional(),model_wrl_url:R().optional(),model_unit_to_mm_scale_factor:Pe().optional(),model_jscad:fl().optional()}).describe("Defines a component on the PCB"),aut=Xt(["sinewave","square","triangle","sawtooth"]),LDn=Bn([R(),Pe()]).transform(n=>typeof n=="string"?n.endsWith("%")?parseFloat(n.slice(0,-1))/100:parseFloat(n):n).pipe(Pe().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),cut=Se({type:fe("simulation_voltage_source"),simulation_voltage_source_id:Ki("simulation_voltage_source"),is_dc_source:fe(!0).optional().default(!0),positive_source_port_id:R().optional(),negative_source_port_id:R().optional(),positive_source_net_id:R().optional(),negative_source_net_id:R().optional(),voltage:L4}).describe("Defines a DC voltage source for simulation"),lut=Se({type:fe("simulation_voltage_source"),simulation_voltage_source_id:Ki("simulation_voltage_source"),is_dc_source:fe(!1),terminal1_source_port_id:R().optional(),terminal2_source_port_id:R().optional(),terminal1_source_net_id:R().optional(),terminal2_source_net_id:R().optional(),voltage:L4.optional(),frequency:JG.optional(),peak_to_peak_voltage:L4.optional(),wave_shape:aut.optional(),phase:fw.optional(),duty_cycle:LDn.optional()}).describe("Defines an AC voltage source for simulation"),uut=Bn([cut,lut]).describe("Defines a voltage source for simulation"),dut=Bn([fe("spice_dc_sweep"),fe("spice_dc_operating_point"),fe("spice_transient_analysis"),fe("spice_ac_analysis")]),hut=Se({type:fe("simulation_experiment"),simulation_experiment_id:Ki("simulation_experiment"),name:R(),experiment_type:dut,time_per_step:_L.optional(),start_time_ms:D4.optional(),end_time_ms:D4.optional()}).describe("Defines a simulation experiment configuration"),put=Se({type:fe("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:Ki("simulation_transient_voltage_graph"),simulation_experiment_id:R(),timestamps_ms:ut(Pe()).optional(),voltage_levels:ut(Pe()),schematic_voltage_probe_id:R().optional(),simulation_voltage_probe_id:R().optional(),subcircuit_connectivity_map_key:R().optional(),time_per_step:_L,start_time_ms:D4,end_time_ms:D4,name:R().optional()}).describe("Stores voltage measurements over time for a simulation"),fut=Se({type:fe("simulation_switch"),simulation_switch_id:Ki("simulation_switch"),source_component_id:R().optional(),closes_at:D4.optional(),opens_at:D4.optional(),starts_closed:Je().optional(),switching_frequency:JG.optional()}).describe("Defines a switch for simulation timing control"),mut=Se({type:fe("simulation_voltage_probe"),simulation_voltage_probe_id:Ki("simulation_voltage_probe"),source_port_id:R().optional(),source_net_id:R().optional(),name:R().optional(),subcircuit_id:R().optional()}).describe("Defines a voltage probe for simulation, connected to a port or a net").refine(n=>!!n.source_port_id!=!!n.source_net_id,{message:"Exactly one of source_port_id or source_net_id must be provided to simulation_voltage_probe"}),_ut=Bn([cct,act,sct,uct,lct,g1e,m1e,eY,y1e,_1e,x1e,b1e,v1e,E1e,T1e,M1e,R1e,C1e,A1e,P1e,S1e,w1e,hct,fct,dct,I1e,N1e,k1e,mct,Yct,Zct,Ult,Blt,jlt,Glt,Qct,Llt,Jct,hlt,ilt,alt,plt,tlt,nlt,flt,mlt,Hlt,ylt,glt,xlt,blt,vlt,wlt,Slt,Elt,clt,llt,_lt,ult,dlt,nut,Mlt,Tlt,Clt,Alt,Plt,Rlt,Ilt,Nlt,klt,Vlt,Olt,Ylt,Flt,qlt,Xlt,Wlt,Jlt,eut,tut,iut,rut,out,_ct,Act,Sct,Ect,Tct,Mct,wct,Pct,Cct,yct,Ict,Nct,Rct,Dct,zct,$ct,Fct,Uct,Bct,sut,uut,hut,put,fut,mut]),$1e=_ut;const yut=Object.freeze(Object.defineProperty({__proto__:null,all_layers:pct,any_circuit_element:_ut,any_soup_element:$1e,any_source_component:sct,battery_capacity:Jat,brep_shape:Hct,cad_component:sut,capacitance:p1e,circuit_json_footprint_load_error:jlt,current:cDn,distance:di,duration_ms:_L,experiment_type:dut,external_footprint_load_error:Blt,frequency:JG,getZodPrefixedIdWithDefault:Ki,inductance:Zat,layer_ref:bd,layer_string:O1e,length:os,ms:D4,ninePointAnchor:gL,pcb_autorouting_error:Vlt,pcb_board:flt,pcb_breakout_point:Ylt,pcb_component:Yct,pcb_component_invalid_layer_error:tut,pcb_component_outside_board_error:eut,pcb_copper_pour:Jlt,pcb_copper_pour_brep:Zlt,pcb_copper_pour_polygon:Qlt,pcb_copper_pour_rect:Klt,pcb_copper_text:vlt,pcb_courtyard_outline:rut,pcb_courtyard_polygon:out,pcb_courtyard_rect:iut,pcb_cutout:Flt,pcb_cutout_circle:zlt,pcb_cutout_polygon:$lt,pcb_cutout_rect:Dlt,pcb_fabrication_note_dimension:Alt,pcb_fabrication_note_path:Mlt,pcb_fabrication_note_rect:Clt,pcb_fabrication_note_text:Tlt,pcb_footprint_overlap_error:Olt,pcb_ground_plane:qlt,pcb_ground_plane_region:Xlt,pcb_group:Hlt,pcb_hole:Zct,pcb_hole_circle_or_square_shape:_Dn,pcb_hole_oval_shape:yDn,pcb_hole_pill_shape:gDn,pcb_hole_rotated_pill_shape:xDn,pcb_keepout:Llt,pcb_manual_edit_conflict_warning:Glt,pcb_missing_footprint_error:Ult,pcb_net:hlt,pcb_note_dimension:klt,pcb_note_line:Nlt,pcb_note_path:Ilt,pcb_note_rect:Rlt,pcb_note_text:Plt,pcb_panel:mlt,pcb_placement_error:_lt,pcb_plated_hole:Qct,pcb_port:Jct,pcb_port_not_connected_error:dlt,pcb_port_not_matched_error:ult,pcb_route_hint:Vct,pcb_route_hints:mDn,pcb_silkscreen_circle:Slt,pcb_silkscreen_line:glt,pcb_silkscreen_oval:Elt,pcb_silkscreen_path:xlt,pcb_silkscreen_rect:wlt,pcb_silkscreen_text:blt,pcb_smtpad:tlt,pcb_smtpad_pill:elt,pcb_solder_paste:nlt,pcb_text:ilt,pcb_thermal_spoke:Wlt,pcb_trace:alt,pcb_trace_error:clt,pcb_trace_hint:ylt,pcb_trace_missing_error:llt,pcb_trace_route_point:slt,pcb_trace_route_point_via:olt,pcb_trace_route_point_wire:rlt,pcb_via:plt,pcb_via_clearance_error:nut,point:xs,point3:yL,point_with_bulge:jct,port_arrangement:vct,position:uDn,position3:dDn,resistance:QG,ring:L1e,rotation:fw,route_hint_point:Gct,schematic_arc:Mct,schematic_box:_ct,schematic_circle:Tct,schematic_component:wct,schematic_component_port_arrangement_by_sides:bct,schematic_component_port_arrangement_by_size:xct,schematic_debug_line:Oct,schematic_debug_object:Dct,schematic_debug_object_base:tY,schematic_debug_point:Lct,schematic_debug_rect:kct,schematic_error:Ict,schematic_group:Fct,schematic_layout_error:Nct,schematic_line:Sct,schematic_manual_edit_conflict_warning:$ct,schematic_net_label:Rct,schematic_path:yct,schematic_pin_styles:gct,schematic_port:Pct,schematic_rect:Ect,schematic_table:Uct,schematic_table_cell:Bct,schematic_text:Act,schematic_trace:Cct,schematic_voltage_probe:zct,simulation_ac_voltage_source:lut,simulation_dc_voltage_source:cut,simulation_experiment:hut,simulation_switch:fut,simulation_transient_voltage_graph:put,simulation_voltage_probe:mut,simulation_voltage_source:uut,size:f1e,source_board:dct,source_component_base:Zg,source_failed_to_create_component_error:rct,source_group:lct,source_manually_placed_via:fct,source_missing_property_error:ict,source_net:uct,source_pcb_ground_plane:hct,source_pin_missing_trace_warning:k1e,source_port:act,source_project_metadata:I1e,source_property_ignored_warning:oct,source_simple_battery:b1e,source_simple_capacitor:m1e,source_simple_chip:g1e,source_simple_crystal:nct,source_simple_diode:eY,source_simple_ground:tct,source_simple_inductor:v1e,source_simple_led:y1e,source_simple_mosfet:P1e,source_simple_pin_header:E1e,source_simple_pinout:T1e,source_simple_potentiometer:S1e,source_simple_power_source:x1e,source_simple_push_button:w1e,source_simple_resistor:_1e,source_simple_resonator:M1e,source_simple_switch:R1e,source_simple_test_point:A1e,source_simple_transistor:C1e,source_trace:cct,source_trace_not_connected_error:N1e,supplier_name:ect,time:lDn,timestamp:Qat,unknown_error_finding_part:mct,visible_layer:tE,voltage:L4,wave_shape:aut},Symbol.toStringTag,{value:"Module"})),DDn={},gut=n=>{let e;const t=new Set,i=(u,d)=>{const h=typeof u=="function"?u(e):u;if(!Object.is(h,e)){const p=e;e=d??(typeof h!="object"||h===null)?h:Object.assign({},e,h),t.forEach(m=>m(e,p))}},r=()=>e,c={setState:i,getState:r,getInitialState:()=>l,subscribe:u=>(t.add(u),()=>t.delete(u)),destroy:()=>{(DDn?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},l=e=n(i,r,c);return c},xut=n=>n?gut(n):gut;var nY={exports:{}},F1e={},iY={exports:{}},U1e={};/**
@@ -5629,7 +5629,7 @@ $1`).replace(/>(\s*)(?=<!--\s*\/)/g,"> ")}}});function Edt(n,e,t){if(!e||!t)retu
5629
5629
  * Copyright (c) 2013-2015, 2017, Jon Schlinkert.
5630
5630
  * Released under the MIT License.
5631
5631
  *)
5632
- */const nFn=({containerClassName:n,...e})=>{const t=pe.useRef(null),[i,r]=pe.useState(620);return pe.useLayoutEffect(()=>{const o=()=>{if(t.current){const a=t.current.clientHeight,c=window.innerHeight;r(Math.min(Math.max(a,620),c))}};o();const s=new ResizeObserver(o);return t.current&&s.observe(t.current),window.addEventListener("resize",o),()=>{s.disconnect(),window.removeEventListener("resize",o)}},[]),ce.jsx("div",{ref:t,className:n||"rf-w-full rf-h-full",children:ce.jsx(tFn,{...e,height:i})})},iFn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-1{right:.25rem}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.\\!rf-z-\\[101\\]{z-index:101!important}.\\!rf-z-\\[200\\]{z-index:200!important}.rf-z-10{z-index:10}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.rf-z-\\[101\\]{z-index:101}.rf-order-1{order:1}.rf-order-2{order:2}.rf-order-3{order:3}.rf-m-1{margin:.25rem}.rf-m-6{margin:1.5rem}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-4{margin-left:1rem;margin-right:1rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mr-4{margin-right:1rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline-block{display:inline-block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-20{height:5rem}.rf-h-24{height:6rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-7{height:1.75rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-auto{height:auto}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[200px\\]{max-height:200px}.rf-max-h-\\[300px\\]{max-height:300px}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[70vh\\]{max-height:70vh}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[100px\\]{min-height:100px}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[300px\\]{min-height:300px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-20{width:5rem}.rf-w-24{width:6rem}.rf-w-28{width:7rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-40{width:10rem}.rf-w-48{width:12rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-80{width:20rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-w-screen{width:100vw}.rf-min-w-0{min-width:0}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-32{min-width:8rem}.rf-min-w-80{min-width:20rem}.rf-min-w-96{min-width:24rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[600px\\]{min-width:600px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-64{max-width:16rem}.rf-max-w-96{max-width:24rem}.rf-max-w-\\[1000px\\]{max-width:1000px}.rf-max-w-\\[150px\\]{max-width:150px}.rf-max-w-\\[200px\\]{max-width:200px}.rf-max-w-\\[40\\%\\]{max-width:40%}.rf-max-w-\\[600px\\]{max-width:600px}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-none{max-width:none}.rf-max-w-xl{max-width:36rem}.rf-max-w-xs{max-width:20rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.rf-origin-\\[--radix-popover-content-transform-origin\\]{transform-origin:var(--radix-popover-content-transform-origin)}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf--translate-x-1\\/2{--tw-translate-x:-50%}.rf--translate-x-1\\/2,.rf--translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-y-1{--tw-translate-y:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-items-stretch{align-items:stretch}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.\\!rf-overflow-hidden{overflow:hidden!important}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rf-whitespace-normal{white-space:normal}.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-break-all{word-break:break-all}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-2{border-width:2px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-none{border-style:none}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-300{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.rf-border-blue-400{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-green-400{--tw-border-opacity:1;border-color:rgb(74 222 128/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-400{--tw-border-opacity:1;border-color:rgb(248 113 113/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-amber-50{--tw-bg-opacity:1;background-color:rgb(255 251 235/var(--tw-bg-opacity,1))}.rf-bg-amber-50\\/30{background-color:rgba(255,251,235,.3)}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-50\\/30{background-color:rgba(239,246,255,.3)}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-slate-50{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.rf-bg-transparent{background-color:transparent}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-amber-500{fill:#f59e0b}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.rf-object-cover{-o-object-fit:cover;object-fit:cover}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-py-6{padding-bottom:1.5rem;padding-top:1.5rem}.rf-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-1{padding-bottom:.25rem}.rf-pb-2{padding-bottom:.5rem}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-0{padding-top:0}.rf-pt-2{padding-top:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.\\!rf-font-normal{font-weight:400!important}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-uppercase{text-transform:uppercase}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.rf-tracking-widest{letter-spacing:.1em}.rf-text-amber-500{--tw-text-opacity:1;color:rgb(245 158 11/var(--tw-text-opacity,1))}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.rf-text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.rf-text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.rf-text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-600{--tw-text-opacity:1;color:rgb(202 138 4/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-100{opacity:1}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-opacity-70{opacity:.7}.rf-opacity-75{opacity:.75}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:rf-border-blue-500:hover{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-slate-200:hover{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-slate-800:hover{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity,1))}.hover\\:rf-text-slate-900:hover{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group:hover .group-hover\\:rf-opacity-100,.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\=true\\]\\:rf-pointer-events-none[data-disabled=true],.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[selected\\=true\\]\\:rf-bg-zinc-100[data-selected=true]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[selected\\=true\\]\\:rf-text-zinc-900[data-selected=true]{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\=true\\]\\:rf-opacity-50[data-disabled=true],.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-gray-700:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.dark\\:rf-bg-gray-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-gray-500:is(.rf-dark *){--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-bg-zinc-800[data-selected=true]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-text-zinc-50[data-selected=true]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-order-1{order:1}.sm\\:rf-order-2{order:2}.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-block{display:block}.sm\\:rf-inline{display:inline}.sm\\:rf-grid{display:grid}.sm\\:rf-hidden{display:none}.sm\\:rf-w-auto{width:auto}.sm\\:rf-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\\:rf-grid-cols-\\[1fr_auto\\]{grid-template-columns:1fr auto}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-items-center{align-items:center}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-gap-3{gap:.75rem}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-justify-self-end{justify-self:end}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-px-4{padding-left:1rem;padding-right:1rem}.sm\\:rf-text-left{text-align:left}.sm\\:rf-text-right{text-align:right}.sm\\:rf-text-sm{font-size:.875rem;line-height:1.25rem}.sm\\:rf-text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-py-1\\.5 [cmdk-group-heading]{padding-bottom:.375rem;padding-top:.375rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-font-medium [cmdk-group-heading]{font-weight:500}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-500 [cmdk-group-heading]{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.dark\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-400 [cmdk-group-heading]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:rf-pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\\[\\&_\\[cmdk-group\\]\\]\\:rf-px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\\[\\&_\\[cmdk-input\\]\\]\\:rf-h-12 [cmdk-input]{height:3rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-py-3 [cmdk-item]{padding-bottom:.75rem;padding-top:.75rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-h-5 [cmdk-item] svg{height:1.25rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-w-5 [cmdk-item] svg{width:1.25rem}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',Hdt=()=>{pe.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=iFn,document.head.appendChild(e)},[])},rFn=n=>{pe.useEffect(()=>(n?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[n])},Vdt=n=>`hsl(${KS.indexOf(n)*137.5%360}, 70%, 50%)`,oFn=({phaseTimings:n})=>{if(!n)return null;const e=Object.values(n).reduce((t,i)=>t+i,0);return ce.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[ce.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:KS.map(t=>{const i=n[t]||0,r=i/e*100;return ce.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:Vdt(t)},children:ce.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",i.toFixed(1),"ms"]})},t)})}),ce.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},sFn=n=>{if(n instanceof Blob)return n;if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)},aFn=({renderLog:n,onRerunWithDebug:e})=>{const[t,i]=pe.useState("chronological"),[r,o]=pe.useState(""),s=[{value:"",label:"None"},{value:"DEBUG=Group_doInitialSchematicTraceRender",label:"DEBUG=Group_doInitialSchematicTraceRender"},{value:"DEBUG=Group_doInitialSchematicLayoutMatchpack",label:"DEBUG=Group_doInitialSchematicLayoutMatchpack"},{value:"DEBUG=Group_doInitialPcbLayoutPack",label:"DEBUG=Group_doInitialPcbLayoutPack"}];if(!n)return ce.jsxs("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:[ce.jsx("div",{className:"rf-mb-4",children:"No render log, make sure this tab is open when you render"}),e&&ce.jsxs("div",{className:"rf-flex rf-gap-2 rf-items-center",children:[ce.jsx("select",{value:r,onChange:l=>o(l.target.value),className:"rf-px-3 rf-py-1 rf-border rf-rounded rf-text-xs rf-bg-white",children:s.map(l=>ce.jsx("option",{value:l.value,children:l.label},l.value))}),ce.jsx(H_,{onClick:()=>e(r),size:"sm",className:"rf-text-xs",children:"Rerun Render with Debug"})]})]});const a=Object.entries(n?.phaseTimings??{});t==="chronological"?a.sort((l,u)=>KS.indexOf(l[0])-KS.indexOf(u[0])):a.sort((l,u)=>u[1]-l[1]);const c=a.reduce((l,[u,d])=>l+d,0);return ce.jsxs("div",{className:"rf-bg-white",children:[ce.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center rf-mb-4",children:[ce.jsx("div",{children:"Render Logs"}),ce.jsxs("div",{className:"rf-flex rf-gap-4 rf-items-center",children:[e&&ce.jsxs("div",{className:"rf-flex rf-gap-2 rf-items-center",children:[ce.jsx("select",{value:r,onChange:l=>o(l.target.value),className:"rf-px-3 rf-py-1 rf-border rf-rounded rf-text-xs rf-bg-white",children:s.map(l=>ce.jsx("option",{value:l.value,children:l.label},l.value))}),ce.jsx(H_,{onClick:()=>e(r),size:"sm",className:"rf-text-xs",children:"Rerun Render with Debug"})]}),ce.jsx("div",{className:"rf-flex rf-gap-2 rf-items-center",children:ce.jsxs("select",{onChange:l=>{if(l.target.value){const u=n?.debugOutputs?.find(d=>d.name===l.target.value);if(u){const d=sFn(u.content),h=d instanceof Blob?d:new Blob([d],{type:"text/plain"}),p=URL.createObjectURL(h),m=document.createElement("a");m.href=p,m.download=`debug-${u.name}.txt`,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(p)}l.target.value=""}},disabled:!n?.debugOutputs||n.debugOutputs.length===0,className:"rf-px-3 rf-py-1 rf-border rf-rounded rf-text-xs rf-bg-white disabled:rf-opacity-50 disabled:rf-cursor-not-allowed",children:[ce.jsx("option",{value:"",children:"Download Debug Output"}),n?.debugOutputs?.map(l=>ce.jsx("option",{value:l.name,children:l.name},l.name))]})}),ce.jsxs("div",{className:"rf-flex rf-text-xs rf-items-center",children:[ce.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),ce.jsxs("select",{value:t,onChange:l=>i(l.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[ce.jsx("option",{value:"chronological",children:"Phase Order"}),ce.jsx("option",{value:"longest",children:"Duration"})]})]})]})]}),ce.jsx(oFn,{phaseTimings:n.phaseTimings}),ce.jsxs("table",{className:"rf-w-full rf-text-xs",children:[ce.jsx("thead",{children:ce.jsxs("tr",{children:[ce.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),ce.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),ce.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),ce.jsx("tbody",{children:a.map(([l,u])=>ce.jsxs("tr",{children:[ce.jsx("td",{className:"rf-p-2",children:KS.indexOf(l)}),ce.jsx("td",{className:"rf-p-2",children:l}),ce.jsx("td",{className:"rf-p-2",children:ce.jsx("div",{className:"rf-w-8",children:ce.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:Vdt(l),width:`${u/c*100}%`}})})}),ce.jsx("td",{className:"rf-p-2",children:ce.jsxs("div",{className:"rf-flex w-full",children:[ce.jsxs("span",{className:"rf-flex-grow",children:[u,"ms"]}),ce.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(u/c*100).toFixed(1),"%"]})]})})]},l))})]})]})},Gdt=({errorMessage:n,errorStack:e,circuitJsonErrors:t})=>{pe.useEffect(()=>{if(n){const i=new Error(n);e&&(i.stack=e);try{Lz.captureException(i)}catch{}}},[n,e]),pe.useEffect(()=>{if(t&&t.length>0)for(const i of t){const r=new Error(i.message||"Circuit JSON Error");i.stack&&(r.stack=i.stack);try{Lz.captureException(r,{error_type:i.type})}catch{}}},[t])},Ydt="0.0.1198",cFn={version:Ydt};function lFn(n,e){const[t,i]=pe.useState(()=>{try{const r=window.localStorage.getItem(n);return r?JSON.parse(r):e}catch(r){return console.error("Error reading from localStorage:",r),e}});return pe.useEffect(()=>{try{window.localStorage.setItem(n,JSON.stringify(t))}catch(r){console.error("Error writing to localStorage:",r)}},[n,t]),[t,i]}const ybe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},gbe=new Map,RY=n=>{const e=gbe.get(n);return e?Object.fromEntries(Object.entries(e.stores).map(([t,i])=>[t,i.getState()])):{}},uFn=(n,e,t)=>{if(n===void 0)return{type:"untracked",connection:e.connect(t)};const i=gbe.get(t.name);if(i)return{type:"tracked",store:n,...i};const r={connection:e.connect(t),stores:{}};return gbe.set(t.name,r),{type:"tracked",store:n,...r}},qdt=(n,e={})=>(t,i,r)=>{const{enabled:o,anonymousActionType:s,store:a,...c}=e;let l;try{l=(o??(ybe?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return(ybe?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),n(t,i,r);const{connection:u,...d}=uFn(a,l,c);let h=!0;r.setState=(_,g,x)=>{const b=t(_,g);if(!h)return b;const w=x===void 0?{type:s||"anonymous"}:typeof x=="string"?{type:x}:x;return a===void 0?(u?.send(w,i()),b):(u?.send({...w,type:`${a}/${w.type}`},{...RY(c.name),[a]:r.getState()}),b)};const p=(..._)=>{const g=h;h=!1,t(..._),h=g},m=n(r.setState,i,r);if(d.type==="untracked"?u?.init(m):(d.stores[d.store]=r,u?.init(Object.fromEntries(Object.entries(d.stores).map(([_,g])=>[_,_===d.store?m:g.getState()])))),r.dispatchFromDevtools&&typeof r.dispatch=="function"){let _=!1;const g=r.dispatch;r.dispatch=(...x)=>{(ybe?"production":void 0)!=="production"&&x[0].type==="__setState"&&!_&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),_=!0),g(...x)}}return u.subscribe(_=>{var g;switch(_.type){case"ACTION":if(typeof _.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return xbe(_.payload,x=>{if(x.type==="__setState"){if(a===void 0){p(x.state);return}Object.keys(x.state).length!==1&&console.error(`
5632
+ */const nFn=({containerClassName:n,...e})=>{const t=pe.useRef(null),[i,r]=pe.useState(620);return pe.useLayoutEffect(()=>{const o=()=>{if(t.current){const a=t.current.clientHeight,c=window.innerHeight;r(Math.min(Math.max(a,620),c))}};o();const s=new ResizeObserver(o);return t.current&&s.observe(t.current),window.addEventListener("resize",o),()=>{s.disconnect(),window.removeEventListener("resize",o)}},[]),ce.jsx("div",{ref:t,className:n||"rf-w-full rf-h-full",children:ce.jsx(tFn,{...e,height:i})})},iFn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-1{right:.25rem}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.\\!rf-z-\\[101\\]{z-index:101!important}.\\!rf-z-\\[200\\]{z-index:200!important}.rf-z-10{z-index:10}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.rf-z-\\[101\\]{z-index:101}.rf-order-1{order:1}.rf-order-2{order:2}.rf-order-3{order:3}.rf-m-1{margin:.25rem}.rf-m-6{margin:1.5rem}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-4{margin-left:1rem;margin-right:1rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mr-4{margin-right:1rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline-block{display:inline-block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-20{height:5rem}.rf-h-24{height:6rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-7{height:1.75rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-auto{height:auto}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[200px\\]{max-height:200px}.rf-max-h-\\[300px\\]{max-height:300px}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[70vh\\]{max-height:70vh}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[100px\\]{min-height:100px}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[300px\\]{min-height:300px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-20{width:5rem}.rf-w-24{width:6rem}.rf-w-28{width:7rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-40{width:10rem}.rf-w-48{width:12rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-80{width:20rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-w-screen{width:100vw}.rf-min-w-0{min-width:0}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-32{min-width:8rem}.rf-min-w-80{min-width:20rem}.rf-min-w-96{min-width:24rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[600px\\]{min-width:600px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-64{max-width:16rem}.rf-max-w-96{max-width:24rem}.rf-max-w-\\[1000px\\]{max-width:1000px}.rf-max-w-\\[150px\\]{max-width:150px}.rf-max-w-\\[200px\\]{max-width:200px}.rf-max-w-\\[40\\%\\]{max-width:40%}.rf-max-w-\\[600px\\]{max-width:600px}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-none{max-width:none}.rf-max-w-xl{max-width:36rem}.rf-max-w-xs{max-width:20rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.rf-origin-\\[--radix-popover-content-transform-origin\\]{transform-origin:var(--radix-popover-content-transform-origin)}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf--translate-x-1\\/2{--tw-translate-x:-50%}.rf--translate-x-1\\/2,.rf--translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-y-1{--tw-translate-y:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-items-stretch{align-items:stretch}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.\\!rf-overflow-hidden{overflow:hidden!important}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rf-whitespace-normal{white-space:normal}.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-break-all{word-break:break-all}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-2{border-width:2px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-none{border-style:none}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-300{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.rf-border-blue-400{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-green-400{--tw-border-opacity:1;border-color:rgb(74 222 128/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-400{--tw-border-opacity:1;border-color:rgb(248 113 113/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-amber-50{--tw-bg-opacity:1;background-color:rgb(255 251 235/var(--tw-bg-opacity,1))}.rf-bg-amber-50\\/30{background-color:rgba(255,251,235,.3)}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-50\\/30{background-color:rgba(239,246,255,.3)}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-slate-50{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.rf-bg-transparent{background-color:transparent}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-amber-500{fill:#f59e0b}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.rf-object-cover{-o-object-fit:cover;object-fit:cover}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-py-6{padding-bottom:1.5rem;padding-top:1.5rem}.rf-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-1{padding-bottom:.25rem}.rf-pb-2{padding-bottom:.5rem}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-0{padding-top:0}.rf-pt-2{padding-top:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.\\!rf-font-normal{font-weight:400!important}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-uppercase{text-transform:uppercase}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.rf-tracking-widest{letter-spacing:.1em}.rf-text-amber-500{--tw-text-opacity:1;color:rgb(245 158 11/var(--tw-text-opacity,1))}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.rf-text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.rf-text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.rf-text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-600{--tw-text-opacity:1;color:rgb(202 138 4/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-100{opacity:1}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-opacity-70{opacity:.7}.rf-opacity-75{opacity:.75}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:rf-border-blue-500:hover{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-slate-200:hover{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-slate-800:hover{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity,1))}.hover\\:rf-text-slate-900:hover{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group:hover .group-hover\\:rf-opacity-100,.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\=true\\]\\:rf-pointer-events-none[data-disabled=true],.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[selected\\=true\\]\\:rf-bg-zinc-100[data-selected=true]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[selected\\=true\\]\\:rf-text-zinc-900[data-selected=true]{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\=true\\]\\:rf-opacity-50[data-disabled=true],.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-gray-700:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.dark\\:rf-bg-gray-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-gray-500:is(.rf-dark *){--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-bg-zinc-800[data-selected=true]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-text-zinc-50[data-selected=true]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-order-1{order:1}.sm\\:rf-order-2{order:2}.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-block{display:block}.sm\\:rf-inline{display:inline}.sm\\:rf-grid{display:grid}.sm\\:rf-hidden{display:none}.sm\\:rf-w-auto{width:auto}.sm\\:rf-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\\:rf-grid-cols-\\[1fr_auto\\]{grid-template-columns:1fr auto}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-items-center{align-items:center}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-gap-3{gap:.75rem}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-justify-self-end{justify-self:end}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-px-4{padding-left:1rem;padding-right:1rem}.sm\\:rf-text-left{text-align:left}.sm\\:rf-text-right{text-align:right}.sm\\:rf-text-sm{font-size:.875rem;line-height:1.25rem}.sm\\:rf-text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-py-1\\.5 [cmdk-group-heading]{padding-bottom:.375rem;padding-top:.375rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-font-medium [cmdk-group-heading]{font-weight:500}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-500 [cmdk-group-heading]{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.dark\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-400 [cmdk-group-heading]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:rf-pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\\[\\&_\\[cmdk-group\\]\\]\\:rf-px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\\[\\&_\\[cmdk-input\\]\\]\\:rf-h-12 [cmdk-input]{height:3rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-py-3 [cmdk-item]{padding-bottom:.75rem;padding-top:.75rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-h-5 [cmdk-item] svg{height:1.25rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-w-5 [cmdk-item] svg{width:1.25rem}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',Hdt=()=>{pe.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=iFn,document.head.appendChild(e)},[])},rFn=n=>{pe.useEffect(()=>(n?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[n])},Vdt=n=>`hsl(${KS.indexOf(n)*137.5%360}, 70%, 50%)`,oFn=({phaseTimings:n})=>{if(!n)return null;const e=Object.values(n).reduce((t,i)=>t+i,0);return ce.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[ce.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:KS.map(t=>{const i=n[t]||0,r=i/e*100;return ce.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:Vdt(t)},children:ce.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",i.toFixed(1),"ms"]})},t)})}),ce.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},sFn=n=>{if(n instanceof Blob)return n;if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)},aFn=({renderLog:n,onRerunWithDebug:e})=>{const[t,i]=pe.useState("chronological"),[r,o]=pe.useState(""),s=[{value:"",label:"None"},{value:"DEBUG=Group_doInitialSchematicTraceRender",label:"DEBUG=Group_doInitialSchematicTraceRender"},{value:"DEBUG=Group_doInitialSchematicLayoutMatchpack",label:"DEBUG=Group_doInitialSchematicLayoutMatchpack"},{value:"DEBUG=Group_doInitialPcbLayoutPack",label:"DEBUG=Group_doInitialPcbLayoutPack"}];if(!n)return ce.jsxs("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:[ce.jsx("div",{className:"rf-mb-4",children:"No render log, make sure this tab is open when you render"}),e&&ce.jsxs("div",{className:"rf-flex rf-gap-2 rf-items-center",children:[ce.jsx("select",{value:r,onChange:l=>o(l.target.value),className:"rf-px-3 rf-py-1 rf-border rf-rounded rf-text-xs rf-bg-white",children:s.map(l=>ce.jsx("option",{value:l.value,children:l.label},l.value))}),ce.jsx(H_,{onClick:()=>e(r),size:"sm",className:"rf-text-xs",children:"Rerun Render with Debug"})]})]});const a=Object.entries(n?.phaseTimings??{});t==="chronological"?a.sort((l,u)=>KS.indexOf(l[0])-KS.indexOf(u[0])):a.sort((l,u)=>u[1]-l[1]);const c=a.reduce((l,[u,d])=>l+d,0);return ce.jsxs("div",{className:"rf-bg-white",children:[ce.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center rf-mb-4",children:[ce.jsx("div",{children:"Render Logs"}),ce.jsxs("div",{className:"rf-flex rf-gap-4 rf-items-center",children:[e&&ce.jsxs("div",{className:"rf-flex rf-gap-2 rf-items-center",children:[ce.jsx("select",{value:r,onChange:l=>o(l.target.value),className:"rf-px-3 rf-py-1 rf-border rf-rounded rf-text-xs rf-bg-white",children:s.map(l=>ce.jsx("option",{value:l.value,children:l.label},l.value))}),ce.jsx(H_,{onClick:()=>e(r),size:"sm",className:"rf-text-xs",children:"Rerun Render with Debug"})]}),ce.jsx("div",{className:"rf-flex rf-gap-2 rf-items-center",children:ce.jsxs("select",{onChange:l=>{if(l.target.value){const u=n?.debugOutputs?.find(d=>d.name===l.target.value);if(u){const d=sFn(u.content),h=d instanceof Blob?d:new Blob([d],{type:"text/plain"}),p=URL.createObjectURL(h),m=document.createElement("a");m.href=p,m.download=`debug-${u.name}.txt`,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(p)}l.target.value=""}},disabled:!n?.debugOutputs||n.debugOutputs.length===0,className:"rf-px-3 rf-py-1 rf-border rf-rounded rf-text-xs rf-bg-white disabled:rf-opacity-50 disabled:rf-cursor-not-allowed",children:[ce.jsx("option",{value:"",children:"Download Debug Output"}),n?.debugOutputs?.map(l=>ce.jsx("option",{value:l.name,children:l.name},l.name))]})}),ce.jsxs("div",{className:"rf-flex rf-text-xs rf-items-center",children:[ce.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),ce.jsxs("select",{value:t,onChange:l=>i(l.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[ce.jsx("option",{value:"chronological",children:"Phase Order"}),ce.jsx("option",{value:"longest",children:"Duration"})]})]})]})]}),ce.jsx(oFn,{phaseTimings:n.phaseTimings}),ce.jsxs("table",{className:"rf-w-full rf-text-xs",children:[ce.jsx("thead",{children:ce.jsxs("tr",{children:[ce.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),ce.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),ce.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),ce.jsx("tbody",{children:a.map(([l,u])=>ce.jsxs("tr",{children:[ce.jsx("td",{className:"rf-p-2",children:KS.indexOf(l)}),ce.jsx("td",{className:"rf-p-2",children:l}),ce.jsx("td",{className:"rf-p-2",children:ce.jsx("div",{className:"rf-w-8",children:ce.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:Vdt(l),width:`${u/c*100}%`}})})}),ce.jsx("td",{className:"rf-p-2",children:ce.jsxs("div",{className:"rf-flex w-full",children:[ce.jsxs("span",{className:"rf-flex-grow",children:[u,"ms"]}),ce.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(u/c*100).toFixed(1),"%"]})]})})]},l))})]})]})},Gdt=({errorMessage:n,errorStack:e,circuitJsonErrors:t})=>{pe.useEffect(()=>{if(n){const i=new Error(n);e&&(i.stack=e);try{Lz.captureException(i)}catch{}}},[n,e]),pe.useEffect(()=>{if(t&&t.length>0)for(const i of t){const r=new Error(i.message||"Circuit JSON Error");i.stack&&(r.stack=i.stack);try{Lz.captureException(r,{error_type:i.type})}catch{}}},[t])},Ydt="0.0.1199",cFn={version:Ydt};function lFn(n,e){const[t,i]=pe.useState(()=>{try{const r=window.localStorage.getItem(n);return r?JSON.parse(r):e}catch(r){return console.error("Error reading from localStorage:",r),e}});return pe.useEffect(()=>{try{window.localStorage.setItem(n,JSON.stringify(t))}catch(r){console.error("Error writing to localStorage:",r)}},[n,t]),[t,i]}const ybe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},gbe=new Map,RY=n=>{const e=gbe.get(n);return e?Object.fromEntries(Object.entries(e.stores).map(([t,i])=>[t,i.getState()])):{}},uFn=(n,e,t)=>{if(n===void 0)return{type:"untracked",connection:e.connect(t)};const i=gbe.get(t.name);if(i)return{type:"tracked",store:n,...i};const r={connection:e.connect(t),stores:{}};return gbe.set(t.name,r),{type:"tracked",store:n,...r}},qdt=(n,e={})=>(t,i,r)=>{const{enabled:o,anonymousActionType:s,store:a,...c}=e;let l;try{l=(o??(ybe?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return(ybe?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),n(t,i,r);const{connection:u,...d}=uFn(a,l,c);let h=!0;r.setState=(_,g,x)=>{const b=t(_,g);if(!h)return b;const w=x===void 0?{type:s||"anonymous"}:typeof x=="string"?{type:x}:x;return a===void 0?(u?.send(w,i()),b):(u?.send({...w,type:`${a}/${w.type}`},{...RY(c.name),[a]:r.getState()}),b)};const p=(..._)=>{const g=h;h=!1,t(..._),h=g},m=n(r.setState,i,r);if(d.type==="untracked"?u?.init(m):(d.stores[d.store]=r,u?.init(Object.fromEntries(Object.entries(d.stores).map(([_,g])=>[_,_===d.store?m:g.getState()])))),r.dispatchFromDevtools&&typeof r.dispatch=="function"){let _=!1;const g=r.dispatch;r.dispatch=(...x)=>{(ybe?"production":void 0)!=="production"&&x[0].type==="__setState"&&!_&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),_=!0),g(...x)}}return u.subscribe(_=>{var g;switch(_.type){case"ACTION":if(typeof _.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return xbe(_.payload,x=>{if(x.type==="__setState"){if(a===void 0){p(x.state);return}Object.keys(x.state).length!==1&&console.error(`
5633
5633
  [zustand devtools middleware] Unsupported __setState action format.
5634
5634
  When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
5635
5635
  and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }