@tscircuit/runframe 0.0.756 → 0.0.758
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/standalone.min.js
CHANGED
|
@@ -647,7 +647,7 @@ Check the render method of %s.`,vn(pn)||"Unknown"));var Ie=Ph(P,q);Ie.payload={e
|
|
|
647
647
|
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
|
|
648
648
|
)`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"},bLe={};function LVt(i,e){return i===I_.falseFunc?I_.falseFunc:t=>e.isTag(t)&&i(t)}function CLe(i,e){const t=e.getSiblings(i);if(t.length<=1)return[];const n=t.indexOf(i);return n<0||n===t.length-1?[]:t.slice(n+1).filter(e.isTag)}function Zle(i){return{xmlMode:!!i.xmlMode,lowerCaseAttributeNames:!!i.lowerCaseAttributeNames,lowerCaseTags:!!i.lowerCaseTags,quirksMode:!!i.quirksMode,cacheResults:!!i.cacheResults,pseudos:i.pseudos,adapter:i.adapter,equals:i.equals}}const Wle=(i,e,t,n,r)=>{const o=r(e,Zle(t),n);return o===I_.trueFunc?i:o===I_.falseFunc?I_.falseFunc:a=>o(a)&&i(a)},$le={is:Wle,matches:Wle,where:Wle,not(i,e,t,n,r){const o=r(e,Zle(t),n);return o===I_.falseFunc?i:o===I_.trueFunc?I_.falseFunc:a=>!o(a)&&i(a)},has(i,e,t,n,r){const{adapter:o}=t,a=Zle(t);a.relativeSelector=!0;const s=e.some(u=>u.some(Xle))?[bLe]:void 0,l=r(e,a,s);if(l===I_.falseFunc)return I_.falseFunc;const c=LVt(l,o);if(s&&l!==I_.trueFunc){const{shouldTestNextSiblings:u=!1}=l;return d=>{if(!i(d))return!1;s[0]=d;const f=o.getChildren(d),p=u?[...f,...CLe(d,o)]:f;return o.existsOne(c,p)}}return u=>i(u)&&o.existsOne(c,o.getChildren(u))}};function FVt(i,e,t,n,r){var o;const{name:a,data:s}=e;if(Array.isArray(s)){if(!(a in $le))throw new Error(`Unknown pseudo-class :${a}(${s})`);return $le[a](i,s,t,n,r)}const l=(o=t.pseudos)===null||o===void 0?void 0:o[a],c=typeof l=="string"?l:PVt[a];if(typeof c=="string"){if(s!=null)throw new Error(`Pseudo ${a} doesn't have any arguments`);const u=ALe(c);return $le.is(i,u,t,n,r)}if(typeof l=="function")return ILe(l,a,s,1),u=>l(u,s)&&i(u);if(a in qle)return qle[a](i,s,t,n);if(a in xLe){const u=xLe[a];return ILe(u,a,s,2),d=>u(d,t,s)&&i(d)}throw new Error(`Unknown pseudo-class :${a}`)}function ece(i,e){const t=e.getParent(i);return t&&e.isTag(t)?t:null}function UVt(i,e,t,n,r){const{adapter:o,equals:a}=t;switch(e.type){case hm.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case hm.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case hm.Attribute:{if(e.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return(!t.xmlMode||t.lowerCaseAttributeNames)&&(e.name=e.name.toLowerCase()),QVt[e.action](i,e,t)}case hm.Pseudo:return FVt(i,e,t,n,r);case hm.Tag:{if(e.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let{name:s}=e;return(!t.xmlMode||t.lowerCaseTags)&&(s=s.toLowerCase()),function(c){return o.getName(c)===s&&i(c)}}case hm.Descendant:{if(t.cacheResults===!1||typeof WeakSet>"u")return function(c){let u=c;for(;u=ece(u,o);)if(i(u))return!0;return!1};const s=new WeakSet;return function(c){let u=c;for(;u=ece(u,o);)if(!s.has(u)){if(o.isTag(u)&&i(u))return!0;s.add(u)}return!1}}case"_flexibleDescendant":return function(l){let c=l;do if(i(c))return!0;while(c=ece(c,o));return!1};case hm.Parent:return function(l){return o.getChildren(l).some(c=>o.isTag(c)&&i(c))};case hm.Child:return function(l){const c=o.getParent(l);return c!=null&&o.isTag(c)&&i(c)};case hm.Sibling:return function(l){const c=o.getSiblings(l);for(let u=0;u<c.length;u++){const d=c[u];if(a(l,d))break;if(o.isTag(d)&&i(d))return!0}return!1};case hm.Adjacent:return o.prevElementSibling?function(l){const c=o.prevElementSibling(l);return c!=null&&i(c)}:function(l){const c=o.getSiblings(l);let u;for(let d=0;d<c.length;d++){const f=c[d];if(a(l,f))break;o.isTag(f)&&(u=f)}return!!u&&i(u)};case hm.Universal:{if(e.namespace!=null&&e.namespace!=="*")throw new Error("Namespaced universal selectors are not yet supported by css-select");return i}}}function OVt(i,e,t){const n=typeof i=="string"?ALe(i):i;return SLe(n,e,t)}function ELe(i){return i.type===hm.Pseudo&&(i.name==="scope"||Array.isArray(i.data)&&i.data.some(e=>e.some(ELe)))}const GVt={type:hm.Descendant},zVt={type:"_flexibleDescendant"},HVt={type:hm.Pseudo,name:"scope",data:null};function YVt(i,{adapter:e},t){const n=!!(t!=null&&t.every(r=>{const o=e.isTag(r)&&e.getParent(r);return r===bLe||o&&e.isTag(o)}));for(const r of i){if(!(r.length>0&&Xle(r[0])&&r[0].type!==hm.Descendant))if(n&&!r.some(ELe))r.unshift(GVt);else continue;r.unshift(HVt)}}function SLe(i,e,t){var n;i.forEach(BVt),t=(n=e.context)!==null&&n!==void 0?n:t;const r=Array.isArray(t),o=t&&(Array.isArray(t)?t:[t]);if(e.relativeSelector!==!1)YVt(i,e,o);else if(i.some(l=>l.length>0&&Xle(l[0])))throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let a=!1;const s=i.map(l=>{if(l.length>=2){const[c,u]=l;c.type!==hm.Pseudo||c.name!=="scope"||(r&&u.type===hm.Descendant?l[1]=zVt:(u.type===hm.Adjacent||u.type===hm.Sibling)&&(a=!0))}return VVt(l,e,o)}).reduce(jVt,I_.falseFunc);return s.shouldTestNextSiblings=a,s}function VVt(i,e,t){var n;return i.reduce((r,o)=>r===I_.falseFunc?I_.falseFunc:UVt(r,o,e,t,SLe),(n=e.rootFunc)!==null&&n!==void 0?n:I_.trueFunc)}function jVt(i,e){return e===I_.falseFunc||i===I_.trueFunc?i:i===I_.falseFunc||e===I_.trueFunc?e:function(n){return i(n)||e(n)}}const wLe=(i,e)=>i===e,KVt={adapter:dLe,equals:wLe};function XVt(i){var e,t,n,r;const o=i??KVt;return(e=o.adapter)!==null&&e!==void 0||(o.adapter=dLe),(t=o.equals)!==null&&t!==void 0||(o.equals=(r=(n=o.adapter)===null||n===void 0?void 0:n.equals)!==null&&r!==void 0?r:wLe),o}function BLe(i){return function(t,n,r){const o=XVt(r);typeof t!="function"&&(t=OVt(t,o,n));const a=qVt(n,o.adapter,t.shouldTestNextSiblings);return i(t,a,o)}}function qVt(i,e,t=!1){return t&&(i=JVt(i,e)),Array.isArray(i)?e.removeSubsets(i):e.getChildren(i)}function JVt(i,e){const t=Array.isArray(i)?i.slice(0):[i],n=t.length;for(let r=0;r<n;r++){const o=CLe(t[r],e);t.push(...o)}return t}const MLe=BLe((i,e,t)=>i===I_.falseFunc||!e||e.length===0?[]:t.adapter.findAll(i,e)),tce=BLe((i,e,t)=>i===I_.falseFunc||!e||e.length===0?null:t.adapter.findOne(i,e));var nce=(i,e={})=>{let t=i._internal_store;if(!t){t={counts:{}},i._internal_store=t;for(const r of i){const o=r.type,a=r[`${o}_id`];if(!a)continue;const s=Number.parseInt(a.split("_").pop());Number.isNaN(s)||(t.counts[o]=Math.max(t.counts[o]??0,s))}}return new Proxy({},{get:(r,o)=>o==="toArray"?()=>i:{get:a=>i.find(s=>s.type===o&&s[`${o}_id`]===a),getUsing:a=>{const s=Object.keys(a);if(s.length!==1)throw new Error("getUsing requires exactly one key, e.g. { pcb_component_id }");const l=s[0],c=l.replace("_id",""),u=i.find(d=>d.type===c&&d[l]===a[l]);return u?i.find(d=>d.type===o&&d[`${o}_id`]===u[`${o}_id`]):null},getWhere:a=>{const s=Object.keys(a);return i.find(l=>l.type===o&&s.every(c=>l[c]===a[c]))},list:a=>{const s=a?Object.keys(a):[];return i.filter(l=>l.type===o&&s.every(c=>l[c]===a[c]))},insert:a=>{var c;(c=t.counts)[o]??(c[o]=-1),t.counts[o]++;const s=t.counts[o],l={type:o,[`${o}_id`]:`${o}_${s}`,...a};return e.validateInserts&&(moe[o]??DG).parse(l),i.push(l),l},delete:a=>{const s=i.find(l=>l[`${o}_id`]===a);s&&i.splice(i.indexOf(s),1)},update:(a,s)=>{const l=i.find(c=>c.type===o&&c[`${o}_id`]===a);if(l)return Object.assign(l,s),l},select:a=>{if(o==="source_component")return i.find(s=>s.type==="source_component"&&s.name===a.replace(/\./g,""));if(o==="pcb_port"||o==="source_port"||o==="schematic_port"){const[s,l]=a.replace(/\./g,"").split(/[\s\>]+/),c=i.find(d=>d.type==="source_component"&&d.name===s);if(!c)return null;const u=i.find(d=>d.type==="source_port"&&d.source_component_id===c.source_component_id&&(d.name===l||(d.port_hints??[]).includes(l)));if(!u)return null;if(o==="source_port")return u;if(o==="pcb_port")return i.find(d=>d.type==="pcb_port"&&d.source_port_id===u.source_port_id);if(o==="schematic_port")return i.find(d=>d.type==="schematic_port"&&d.source_port_id===u.source_port_id)}}}})};nce.unparsed=nce;var AM=nce,gM={exports:{}},ZVt=gM.exports,RLe;function WVt(){return RLe||(RLe=1,(function(){var i,e,t,n,r,o;typeof performance<"u"&&performance!==null&&performance.now?gM.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(gM.exports=function(){return(i()-r)/1e6},e=process.hrtime,i=function(){var a;return a=e(),a[0]*1e9+a[1]},n=i(),o=process.uptime()*1e9,r=n-o):Date.now?(gM.exports=function(){return Date.now()-t},t=Date.now()):(gM.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(ZVt)),gM.exports}WVt();function $Vt([i,e],[t,n],{lineThickness:r=0}={}){return r===0?QLe(i,e,t,n):ejt(i,e,t,n)<=r}function QLe(i,e,t,n){const r=DH(i,e,t),o=DH(i,e,n),a=DH(t,n,i),s=DH(t,n,e);return!!(r!==o&&a!==s||r===0&&NH(i,t,e)||o===0&&NH(i,n,e)||a===0&&NH(t,i,n)||s===0&&NH(t,e,n))}function DH(i,e,t){const n=(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y);return n===0?0:n>0?1:2}function NH(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function ejt(i,e,t,n){if(i.x===e.x&&i.y===e.y)return sQ(i,t,n);if(t.x===n.x&&t.y===n.y)return sQ(t,i,e);if(QLe(i,e,t,n))return 0;const r=[sQ(i,t,n),sQ(e,t,n),sQ(t,i,e),sQ(n,i,e)];return Math.min(...r)}function sQ(i,e,t){const n=(t.x-e.x)**2+(t.y-e.y)**2;if(n===0)return DLe(i,e);let r=((i.x-e.x)*(t.x-e.x)+(i.y-e.y)*(t.y-e.y))/n;r=Math.max(0,Math.min(1,r));const o={x:e.x+r*(t.x-e.x),y:e.y+r*(t.y-e.y)};return DLe(i,o)}function DLe(i,e){const t=i.x-e.x,n=i.y-e.y;return Math.sqrt(t*t+n*n)}function NLe(i){const e=new Map;let t=0;function n(r){for(const[,a]of e)if(a.has(r))return a;const o=new Set;return e.set(`connectivity_net${t++}`,o),o}for(const r of i){let o=null;for(const a of r){if(!o)o=n(a);else if(!o.has(a)){const s=n(a);if(s!==o){for(const l of s)o.add(l);e.delete(Array.from(e.entries()).find(([,l])=>l===s)[0])}}o.add(a)}}return Object.fromEntries(Array.from(e.entries()).map(([r,o])=>[r,Array.from(o)]))}var TH=class{constructor(e){pe(this,"netMap");pe(this,"idToNetMap");this.netMap=e,this.idToNetMap={};for(const[t,n]of Object.entries(e))for(const r of n)this.idToNetMap[r]=t}addConnections(e){for(const t of e){const n=new Set;for(const o of t){const a=this.idToNetMap[o];a&&n.add(a)}let r;if(n.size===0)r=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[r]=[];else if(n.size===1)r=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{r=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(const o of n)if(o!==r){this.netMap[r].push(...this.netMap[o]),this.netMap[o]=this.netMap[r];for(const a of this.netMap[r])this.idToNetMap[a]=r}}for(const o of t)this.netMap[r].includes(o)||this.netMap[r].push(o),this.idToNetMap[o]=r}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;const n=this.getNetConnectedToId(e);if(!n)return!1;const r=this.getNetConnectedToId(t);return r?n===r||r===e||r===e:!1}areAllIdsConnected(e){const t=this.getNetConnectedToId(e[0]);for(const n of e){const r=this.getNetConnectedToId(n);if(r===void 0||r!==t)return!1}return!0}},kH=i=>{var n,r;const e=[];for(const o of i)if(o.type==="source_trace")e.push([o.source_trace_id,...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]].filter(Boolean));else if(o.type==="pcb_port"){const{pcb_port_id:a,source_port_id:s}=o;s&&a&&e.push([s,a])}else if(o.type==="pcb_smtpad"){const{pcb_smtpad_id:a,pcb_port_id:s}=o;s&&a&&e.push([a,s])}else if(o.type==="pcb_plated_hole"){const{pcb_plated_hole_id:a,pcb_port_id:s}=o;s&&a&&e.push([a,s])}else if(o.type==="pcb_trace"){const{pcb_trace_id:a,source_trace_id:s}=o,l=Array.isArray(o.route)?o.route.filter(c=>c&&c.route_type==="wire"):[];if(s&&a&&e.push([a,s]),Array.isArray(l)){const c=(n=l.find(d=>d&&d.start_pcb_port_id))==null?void 0:n.start_pcb_port_id,u=(r=l.find(d=>d&&d.end_pcb_port_id))==null?void 0:r.end_pcb_port_id;c&&a&&u&&e.push([c,a,u])}}else if(o.type==="pcb_via"){const{pcb_via_id:a,pcb_trace_id:s}=o;s&&a&&e.push([a,s])}else if(o.type==="source_component"&&o.internally_connected_source_port_ids)for(const a of o.internally_connected_source_port_ids)e.push(a);const t=NLe(e);return new TH(t)},TLe=class{constructor(e){pe(this,"circuitJson");pe(this,"traceIdToElm");pe(this,"portIdToElm");pe(this,"connMap");this.circuitJson=e||[],this.traceIdToElm=new Map,this.portIdToElm=new Map,e?(this._buildTraceMap(),this._buildPortMap(),this.connMap=this._buildTraceConnectivityMap()):this.connMap=new TH({})}_buildPortMap(){for(const e of this.circuitJson)e.type==="pcb_port"&&this.portIdToElm.set(e.pcb_port_id,e)}_buildTraceMap(){for(const e of this.circuitJson)e.type==="pcb_trace"&&this.traceIdToElm.set(e.pcb_trace_id,e)}_buildTraceConnectivityMap(){const e=[],t=Array.from(this.traceIdToElm.keys());for(let n=0;n<t.length;n++)for(let r=n+1;r<t.length;r++){const o=this.traceIdToElm.get(t[n]),a=this.traceIdToElm.get(t[r]);this._arePcbTracesConnected(o,a)&&e.push([t[n],t[r]])}for(const n of this.portIdToElm.values())for(const r of this.traceIdToElm.values())for(const o of r.route)o.route_type==="wire"&&(o.start_pcb_port_id===n.pcb_port_id?e.push([n.pcb_port_id,r.pcb_trace_id]):o.end_pcb_port_id===n.pcb_port_id&&e.push([r.pcb_trace_id,n.pcb_port_id]));return new TH(NLe(e))}addTrace(e){this.traceIdToElm.set(e.pcb_trace_id,e);const t=[];for(const n of e.route)n.route_type==="wire"&&(n.start_pcb_port_id&&t.push([n.start_pcb_port_id,e.pcb_trace_id]),n.end_pcb_port_id&&t.push([n.end_pcb_port_id,e.pcb_trace_id]));this.connMap.addConnections(t)}_arePcbTracesConnected(e,t){for(let n=0;n<e.route.length-1;n++){const r=e.route[n],o=e.route[n+1];if(r.route_type==="wire"&&o.route_type==="wire")for(let a=0;a<t.route.length-1;a++){const s=t.route[a],l=t.route[a+1];if(s.route_type!=="wire"||l.route_type!=="wire")continue;if($Vt([r,o],[s,l],{lineThickness:(r.width+s.width)/2}))return!0}}return!1}areTracesConnected(e,t){return this.connMap.areIdsConnected(e,t)}getAllTracesConnectedToTrace(e){const t=this.connMap.getNetConnectedToId(e);return t?this.connMap.getIdsConnectedToNet(t).filter(n=>this.traceIdToElm.has(n)).map(n=>this.traceIdToElm.get(n)):[]}getAllTracesConnectedToPort(e){const t=this.connMap.getNetConnectedToId(e);return t?this.connMap.getIdsConnectedToNet(t).filter(n=>this.traceIdToElm.has(n)).map(n=>this.traceIdToElm.get(n)):[]}};function kLe(i){const e=i.width/2,t=i.height/2;return{minX:i.center.x-e,maxX:i.center.x+e,minY:i.center.y-t,maxY:i.center.y+t}}function tjt(i,e){const t=kLe(i),n=kLe(e),r=Math.max(t.minX-n.maxX,n.minX-t.maxX,0),o=Math.max(t.minY-n.maxY,n.minY-t.maxY,0),a={x:0,y:0},s={x:0,y:0};return r===0&&o===0?{distance:0,pointA:i.center,pointB:e.center}:(a.x=lB(i.center.x,n.minX,n.maxX),a.y=lB(i.center.y,n.minY,n.maxY),s.x=lB(e.center.x,t.minX,t.maxX),s.y=lB(e.center.y,t.minY,t.maxY),{distance:Math.hypot(a.x-s.x,a.y-s.y),pointA:a,pointB:s})}function lB(i,e,t){return Math.max(e,Math.min(t,i))}function njt(i,e){let t=Number.POSITIVE_INFINITY,n={x:0,y:0},r={x:0,y:0};for(const o of i)for(const a of e){const{distance:s,pointA:l,pointB:c}=tjt(o,a);s<t&&(t=s,n=l,r=c)}return{pointA:n,pointB:r,distance:t}}var mM=(i,e)=>Math.abs(i.x-e.x)+Math.abs(i.y-e.y),PLe=(i,e)=>{const t=e.x-i.x,n=e.y-i.y;return Math.abs(t)>Math.abs(n)?{dx:Math.sign(t),dy:0}:{dx:0,dy:Math.sign(n)}},LLe=(i,e,t)=>Math.abs(i.x-e.x)*Math.abs(t.dx)+Math.abs(i.y-e.y)*Math.abs(t.dy),FLe=(i,e=.1)=>`${Math.round(i.x/e)},${Math.round(i.y/e)}`,ULe=(i,e)=>Math.abs(i-e)<1e-4,OLe=(i,e,{viaDiameter:t=.5}={})=>{const n=[];for(let r=0;r<i.length-1;r++){const[o,a]=[i[r],i[r+1]],s=r-1>=0?i[r-1]:null,l=ULe(o.y,a.y),c=ULe(o.x,a.x);if(!l&&!c)throw new Error(`getObstaclesFromTrace currently only supports horizontal and vertical traces (not diagonals) Conflicting trace: ${e}, start: (${o.x}, ${o.y}), end: (${a.x}, ${a.y})`);const u={type:"rect",layers:[o.layer],center:{x:(o.x+a.x)/2,y:(o.y+a.y)/2},width:l?Math.abs(o.x-a.x):.1,height:c?Math.abs(o.y-a.y):.1,connectedTo:[e]};if(n.push(u),s&&s.layer===o.layer&&o.layer!==a.layer){const d={type:"rect",layers:[o.layer,a.layer],center:{x:o.x,y:o.y},connectedTo:[e],width:t,height:t};n.push(d)}}return n},GLe=class{constructor(e){pe(this,"obstacles");pe(this,"GRID_STEP",.1);this.obstacles=e.map(t=>({...t,left:t.center.x-t.width/2,right:t.center.x+t.width/2,top:t.center.y+t.height/2,bottom:t.center.y-t.height/2}))}getObstacleAt(e,t,n){n??(n=this.GRID_STEP);for(const r of this.obstacles){const o=r.width/2+n,a=r.height/2+n;if(e>=r.center.x-o&&e<=r.center.x+o&&t>=r.center.y-a&&t<=r.center.y+a)return r}return null}isObstacleAt(e,t,n){return this.getObstacleAt(e,t,n)!==null}getDirectionDistancesToNearestObstacle(e,t){const{GRID_STEP:n}=this,r={left:1/0,top:1/0,bottom:1/0,right:1/0};for(const o of this.obstacles)if(o.type==="rect"){const a=o.center.x-o.width/2-n,s=o.center.x+o.width/2+n,l=o.center.y+o.height/2+n,c=o.center.y-o.height/2-n;t>=c&&t<=l&&e>a&&(r.left=Math.min(r.left,e-s)),t>=c&&t<=l&&e<s&&(r.right=Math.min(r.right,a-e)),e>=a&&e<=s&&t<l&&(r.top=Math.min(r.top,c-t)),e>=a&&e<=s&&t>c&&(r.bottom=Math.min(r.bottom,t-l))}return r}getOrthoDirectionCollisionInfo(e,t,{margin:n=0}={}){const{x:r,y:o}=e,{dx:a,dy:s}=t;let l=1/0,c=null;for(const u of this.obstacles){const d=u.left-n,f=u.right+n,p=u.top+n,A=u.bottom-n;let m=null;a===1&&s===0?o>A&&o<p&&r<u.left&&(m=u.left-r):a===-1&&s===0?o>A&&o<p&&r>u.right&&(m=r-u.right):a===0&&s===1?r>d&&r<f&&o<u.bottom&&(m=u.bottom-o):a===0&&s===-1&&r>d&&r<f&&o>u.top&&(m=o-u.top),m!==null&&m<l&&(l=m,c=u)}return{dx:a,dy:s,wallDistance:l,obstacle:c}}getObstaclesOverlappingRegion(e){const t=[];for(const n of this.obstacles){const{left:r,right:o,top:a,bottom:s}=n;r<=e.maxX&&o>=e.minX&&a<=e.maxY&&s>=e.minY&&t.push(n)}return t}};function ijt(i){if(i.length<4)return i;const e=[{...i[0]}];let t=i[0].layer;for(let n=1;n<i.length;n++){const r={start:i[n-1],end:i[n]},o=i[n].route_type==="via"||i[n-1].route_type==="via";if(i[n].layer!==t||o){e.push({...i[n]}),t=i[n].layer;continue}let a=!1,s=null,l=-1;for(let u=0;u<e.length-1;u++){const d={start:e[u],end:e[u+1]};if(d.start.layer===r.start.layer&&d.start.layer===r.start.layer){const f=rjt(d,r);if(f){a=!0,s={...f,layer:t},l=u;break}}}a&&s&&(e.splice(l+1),e.push(s));const c=e[e.length-1];(c.x!==i[n].x||c.y!==i[n].y)&&e.push(i[n])}return e}function rjt(i,e){if(i.start.x===i.end.x&&e.start.x===e.end.x||i.start.y===i.end.y&&e.start.y===e.end.y)return null;let t;if(i.start.x===i.end.x){const n=i.start.x,r=e.start.y;t={...i.start,x:n,y:r}}else{const n=e.start.x,r=i.start.y;t={...i.start,x:n,y:r}}return zLe(t,i)&&zLe(t,e)?t:null}function zLe(i,e){return i.x>=Math.min(e.start.x,e.end.x)&&i.x<=Math.max(e.start.x,e.end.x)&&i.y>=Math.min(e.start.y,e.end.y)&&i.y<=Math.max(e.start.y,e.end.y)}function ojt(i){const e=[i[0]];for(let t=1;t<i.length-1;t++){const[n,r,o]=[i[t-1],i[t],i[t+1]];e.push(r),!(r.route_type!=="wire"||n.route_type!=="wire"||o.route_type!=="wire")&&n.layer===r.layer&&r.layer!==o.layer&&e.push({route_type:"via",from_layer:r.layer,to_layer:o.layer,x:r.x,y:r.y})}return e.push(i[i.length-1]),e}dI("autorouter:shortenPathWithShortcuts");function ajt(i,e){if(i.length<=2)return i;const t=[i[0]];for(let n=1;n<i.length;n++){const r={start:t[t.length-1],end:i[n]};let o=-1;const a=r.start.x===r.end.x,s=r.start.y===r.end.y;for(let l=n+1;l<i.length;l++){if(l<=o)continue;const c={start:i[l],end:i[l+1]};if(!c.end)continue;const u=c.start.x===c.end.x,d=c.start.y===c.end.y,f=a&&u,p=s&&d;if(p&&f||!(f||p))continue;let m=!1;const _=Math.min(r.start.x,r.end.x),v=Math.max(r.start.x,r.end.x),x=Math.min(c.start.x,c.end.x),I=Math.max(c.start.x,c.end.x),M=Math.min(r.start.y,r.end.y),G=Math.max(r.start.y,r.end.y),k=Math.min(c.start.y,c.end.y),L=Math.max(c.start.y,c.end.y);if(p?m=_<=I&&v>=x:f&&(m=M<=L&&G>=k),!m)continue;const R=[],U=t[t.length-1],D=i[l+2];if(!D)continue;p&&x<v&&D.x===x&&R.push({x,y:r.start.y,layer:r.start.layer}),p&&I>_&&D.x===I&&R.push({x:I,y:r.start.y,layer:r.start.layer}),f&&k<G&&D.y===k&&R.push({x:r.start.x,y:k,layer:r.start.layer}),f&&L>M&&D.y===L&&R.push({x:r.start.x,y:L,layer:r.start.layer});let Z=null;for(const Y of R)if(!(e(U,Y)||e(D,Y))){Z=Y;break}if(Z){t.push(Z),n=l+1,o=l+1;break}}o===-1&&t.push(i[n])}return t[t.length-1]!==i[i.length-1]&&t.push(i[i.length-1]),t}var yM=dI("autorouting-dataset:astar"),HLe=class{constructor(e){pe(this,"openSet",[]);pe(this,"closedSet",new Set);pe(this,"debug",!1);pe(this,"debugSolutions");pe(this,"debugMessage",null);pe(this,"debugTraceCount",0);pe(this,"input");pe(this,"obstacles");pe(this,"allObstacles");pe(this,"startNode");pe(this,"goalPoint");pe(this,"GRID_STEP");pe(this,"OBSTACLE_MARGIN");pe(this,"MAX_ITERATIONS");pe(this,"isRemovePathLoopsEnabled");pe(this,"isShortenPathWithShortcutsEnabled");pe(this,"GREEDY_MULTIPLIER",1.1);pe(this,"iterations",-1);this.input=e.input,this.allObstacles=e.input.obstacles,this.startNode=e.startNode,this.goalPoint=e.goalPoint?{l:0,...e.goalPoint}:void 0,this.GRID_STEP=e.GRID_STEP??.1,this.OBSTACLE_MARGIN=e.OBSTACLE_MARGIN??.15,this.MAX_ITERATIONS=e.MAX_ITERATIONS??100,this.debug=e.debug??yM.enabled,this.isRemovePathLoopsEnabled=e.isRemovePathLoopsEnabled??!1,this.isShortenPathWithShortcutsEnabled=e.isShortenPathWithShortcutsEnabled??!1,this.debug&&(yM.enabled=!0),yM.enabled&&(this.debugSolutions={},this.debugMessage="")}getNeighbors(e){return[]}isSameNode(e,t){return mM(e,t)<this.GRID_STEP}computeG(e,t){return e.g+mM(e,t)}computeH(e){return mM(e,this.goalPoint)}getNodeName(e){return FLe(e,this.GRID_STEP)}solveOneStep(){this.iterations+=1;const{openSet:e,closedSet:t,GRID_STEP:n,goalPoint:r}=this;e.sort((l,c)=>l.f-c.f);const o=e.shift();if(this.computeH(o)<=n*2)return{solved:!0,current:o,newNeighbors:[]};this.closedSet.add(this.getNodeName(o));let s=[];for(const l of this.getNeighbors(o)){if(t.has(this.getNodeName(l)))continue;const c=this.computeG(o,l),u=this.openSet.find(d=>this.isSameNode(d,l));if(!u||c<u.g){const d=this.computeH(l),f=c+d*this.GREEDY_MULTIPLIER,p={...l,g:c,h:d,f,obstacleHit:l.obstacleHit??void 0,manDistFromParent:mM(o,l),nodesInPath:o.nodesInPath+1,parent:o,enterMarginCost:l.enterMarginCost,travelMarginCostFactor:l.travelMarginCostFactor};e.push(p),s.push(p)}}return yM.enabled&&(e.sort((l,c)=>l.f-c.f),this.drawDebugSolution({current:o,newNeighbors:s})),{solved:!1,current:o,newNeighbors:s}}getStartNode(e){return{x:e.pointsToConnect[0].x,y:e.pointsToConnect[0].y,manDistFromParent:0,f:0,g:0,h:0,nodesInPath:0,parent:null}}layerToIndex(e){return 0}indexToLayer(e){return"top"}preprocessConnectionBeforeSolving(e){return e}solveConnection(e){if(e.pointsToConnect.length>2)throw new Error("GeneralizedAstarAutorouter doesn't currently support 2+ points in a connection");e=this.preprocessConnectionBeforeSolving(e);const{pointsToConnect:t}=e;for(this.iterations=0,this.closedSet=new Set,this.startNode=this.getStartNode(e),this.goalPoint={...t[t.length-1],l:this.layerToIndex(t[t.length-1].layer)},this.openSet=[this.startNode];this.iterations<this.MAX_ITERATIONS;){const{solved:n,current:r}=this.solveOneStep();if(n){let o=[],a=r;for(;a;){const s=a.l;o.unshift({x:a.x,y:a.y,layer:s!==void 0?this.indexToLayer(s):t[0].layer}),a=a.parent}return yM.enabled&&(this.debugMessage+=`t${this.debugTraceCount}: ${this.iterations} iterations
|
|
649
649
|
`),this.isRemovePathLoopsEnabled&&(o=ijt(o)),this.isShortenPathWithShortcutsEnabled&&(o=ajt(o,(s,l)=>{if(s.x===l.x&&s.y===l.y)return!1;const c=this.obstacles.getOrthoDirectionCollisionInfo({x:s.x,y:s.y,l:this.layerToIndex(s.layer)??0},{dx:Math.sign(l.x-s.x),dy:Math.sign(l.y-s.y),dl:0},{margin:.05}),u=Math.sqrt((s.x-l.x)**2+(s.y-l.y)**2);return c.wallDistance<u})),{solved:!0,route:o,connectionName:e.name}}if(this.openSet.length===0)break}return yM.enabled&&(this.debugMessage+=`t${this.debugTraceCount}: ${this.iterations} iterations (failed)
|
|
650
|
-
`),{solved:!1,connectionName:e.name}}createObstacleList({dominantLayer:e,connection:t,obstaclesFromTraces:n}){return new GLe(this.allObstacles.filter(r=>!r.connectedTo.includes(t.name)).filter(r=>r.layers.includes(e)).concat(n??[]))}postprocessConnectionSolveResult(e,t){return t}solve(){const e=[],t=[];this.debugTraceCount=0;for(const n of this.input.connections){const r=n.pointsToConnect[0].layer??"top";this.debugTraceCount+=1,this.obstacles=this.createObstacleList({dominantLayer:r,connection:n,obstaclesFromTraces:t});let o=this.solveConnection(n);o=this.postprocessConnectionSolveResult(n,o),e.push(o),yM.enabled&&this.drawDebugTraceObstacles(t),o.solved&&t.push(...OLe(o.route.map(a=>({x:a.x,y:a.y,layer:a.layer??r})),n.name))}return e}solveAndMapToTraces(){return this.solve().flatMap(t=>t.solved?[{type:"pcb_trace",pcb_trace_id:`pcb_trace_for_${t.connectionName}`,route:ojt(t.route.map(n=>({route_type:"wire",x:n.x,y:n.y,width:this.input.minTraceWidth,layer:n.layer})))}]:[])}getDebugGroup(){const e=`t${this.debugTraceCount}_iter[${this.iterations-1}]`;return this.iterations<30||this.iterations<100&&this.iterations%10===0||this.iterations<1e3&&this.iterations%100===0||!this.debugSolutions?e:null}drawDebugTraceObstacles(e){const{debugTraceCount:t,debugSolutions:n}=this;for(const r in n)r.startsWith(`t${t}_`)&&n[r].push(...e.map((o,a)=>({type:"pcb_smtpad",pcb_component_id:"",layer:o.layers[0],width:o.width,shape:"rect",x:o.center.x,y:o.center.y,pcb_smtpad_id:`trace_obstacle_${a}`,height:o.height})))}drawDebugSolution({current:e,newNeighbors:t}){const n=this.getDebugGroup();if(!n)return;const{openSet:r,debugTraceCount:o,debugSolutions:a}=this;a[n]??(a[n]=[]);const s=a[n];s.push({type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:`debug_note_${e.x}_${e.y}`,font:"tscircuit2024",font_size:.25,text:"X"+(e.l!==void 0?e.l:""),pcb_component_id:"",layer:"top",anchor_position:{x:e.x,y:e.y},anchor_alignment:"center"});for(let l=0;l<r.length;l++){const c=r[l];s.push({type:"pcb_fabrication_note_path",pcb_component_id:"",pcb_fabrication_note_path_id:`note_path_${c.x}_${c.y}`,layer:"top",route:[[0,.05],[.05,0],[0,-.05],[-.05,0],[0,.05]].map(([u,d])=>({x:c.x+u,y:c.y+d})),stroke_width:.01}),s.push({type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:`debug_note_${c.x}_${c.y}`,font:"tscircuit2024",font_size:.03,text:l.toString(),pcb_component_id:"",layer:"top",anchor_position:{x:c.x,y:c.y},anchor_alignment:"center"})}if(e.parent){const l=[];let c=e;for(;c;)l.unshift(c),c=c.parent;s.push({type:"pcb_fabrication_note_path",pcb_component_id:"",pcb_fabrication_note_path_id:`note_path_${e.x}_${e.y}`,layer:"top",route:l,stroke_width:.01})}}},sjt=dI("autorouting-dataset:infinite-grid-ijump-astar:get-distance-to-overcome-obstacle");function ice({node:i,travelDir:e,wallDir:t,obstacle:n,obstacles:r,obstaclesInRow:o=0,OBSTACLE_MARGIN:a=.15,SHOULD_DETECT_CONJOINED_OBSTACLES:s=!1,MAX_CONJOINED_OBSTACLES:l=20}){let c;if(e.dx===0?e.dy>0?c=n.center.y+n.height/2-i.y:c=i.y-(n.center.y-n.height/2):e.dx>0?c=n.center.x+n.width/2-i.x:c=i.x-(n.center.x-n.width/2),c+=a,s&&o<l){const u=r.getObstacleAt(i.x+e.dx*c+t.dx*(t.wallDistance+.001),i.y+e.dy*c+t.dy*(t.wallDistance+.001));if(u===n)return c;if(u&&u.type==="rect"){const d=e.dy===0,f=d?n.height:n.width;if((d?u.height:u.width)>f)return sjt("next obstacle on path is bigger, not trying to overcome it"),c;const A=ice({node:{x:i.x+e.dx*c,y:i.y+e.dy*c},travelDir:e,wallDir:t,obstacle:u,obstacles:r,obstaclesInRow:o+1,SHOULD_DETECT_CONJOINED_OBSTACLES:s,MAX_CONJOINED_OBSTACLES:l,OBSTACLE_MARGIN:a});c+=A}}return c}var ljt=class extends HLe{constructor(){super(...arguments);pe(this,"MAX_ITERATIONS",200)}getNeighbors(t){const n=this.obstacles,r=this.goalPoint;let o;t.parent?o=PLe(t.parent,t):o=PLe(t,r);const a=[{dx:0,dy:1},{dx:1,dy:0},{dx:0,dy:-1},{dx:-1,dy:0}].filter(l=>{var c;return l.dx===o.dx*-1&&l.dy===o.dy*-1?!1:!(l.dx===o.dx&&l.dy===o.dy&&((c=t.parent)!=null&&c.obstacleHit))}).map(l=>n.getOrthoDirectionCollisionInfo(t,l,{margin:this.OBSTACLE_MARGIN})).filter(l=>l.wallDistance>=this.OBSTACLE_MARGIN),s=[];for(const l of a){let c=null;t!=null&&t.obstacleHit&&(c=ice({node:t,travelDir:l,wallDir:{...o,wallDistance:this.OBSTACLE_MARGIN},obstacle:t.obstacleHit,obstacles:n,OBSTACLE_MARGIN:this.OBSTACLE_MARGIN,SHOULD_DETECT_CONJOINED_OBSTACLES:!0}));const u=LLe(t,r,l),d=(l.dx===0||Math.sign(r.x-t.x)===l.dx)&&(l.dy===0||Math.sign(r.y-t.y)===l.dy);u<l.wallDistance&&u>0&&d?s.push({...l,travelDistance:u}):c!==null&&c<l.wallDistance?s.push({...l,travelDistance:c}):l.wallDistance!==1/0&&s.push({...l,travelDistance:l.wallDistance-this.OBSTACLE_MARGIN})}return s.filter(l=>!n.isObstacleAt(t.x+l.dx*l.travelDistance,t.y+l.dy*l.travelDistance)).map(l=>({x:t.x+l.dx*l.travelDistance,y:t.y+l.dy*l.travelDistance,obstacleHit:l.obstacle}))}};function cjt(i,e=4){const{center:t,width:n,height:r,rotation:o}=i,a=[],s=o*Math.PI/180,l=Math.cos(s),c=Math.sin(s),u=(o%360+360)%360;if(r<=n?u>=45&&u<135||u>=225&&u<315:u>=135&&u<225||u>=315||u<45){const f=n/e;for(let p=0;p<e;p++){const A=(p-e/2+.5)*f,m=-A*l,_=-A*c,v=f*1.1,x=Math.abs(r*l)+Math.abs(f*c);a.push({center:{x:t.x+m,y:t.y+_},width:v,height:x})}}else{const f=r/e;for(let p=0;p<e;p++){const A=(p-e/2+.5)*f,m=-A*c,_=A*l,v=Math.abs(n*l)+Math.abs(f*c),x=f*1.1;a.push({center:{x:t.x+m,y:t.y+_},width:v,height:x})}}return a}var PH=["top","inner1","inner2","bottom"],YLe=(i,e)=>{const t=r=>e?r.concat(r.map(o=>e==null?void 0:e.getNetConnectedToId(o)).filter(Boolean)):r,n=[];for(const r of i)if(r.type==="pcb_smtpad"){if(r.shape==="circle")n.push({type:"oval",layers:[r.layer],center:{x:r.x,y:r.y},width:r.radius*2,height:r.radius*2,connectedTo:t([r.pcb_smtpad_id])});else if(r.shape==="rect")n.push({type:"rect",layers:[r.layer],center:{x:r.x,y:r.y},width:r.width,height:r.height,connectedTo:t([r.pcb_smtpad_id])});else if(r.shape==="rotated_rect"){const o={center:{x:r.x,y:r.y},width:r.width,height:r.height,rotation:r.ccw_rotation},a=cjt(o);for(const s of a)n.push({type:"rect",layers:[r.layer],center:s.center,width:s.width,height:s.height,connectedTo:t([r.pcb_smtpad_id])})}}else if(r.type==="pcb_keepout")r.shape==="circle"?n.push({type:"oval",layers:r.layers,center:{x:r.center.x,y:r.center.y},width:r.radius*2,height:r.radius*2,connectedTo:[]}):r.shape==="rect"&&n.push({type:"rect",layers:r.layers,center:{x:r.center.x,y:r.center.y},width:r.width,height:r.height,connectedTo:[]});else if(r.type==="pcb_hole")r.hole_shape==="oval"?n.push({type:"oval",center:{x:r.x,y:r.y},width:r.hole_width,height:r.hole_height,connectedTo:[]}):r.hole_shape==="square"?n.push({type:"rect",layers:PH,center:{x:r.x,y:r.y},width:r.hole_diameter,height:r.hole_diameter,connectedTo:[]}):(r.hole_shape==="round"||r.hole_shape==="circle")&&n.push({type:"rect",layers:PH,center:{x:r.x,y:r.y},width:r.hole_diameter,height:r.hole_diameter,connectedTo:[]});else if(r.type==="pcb_plated_hole")r.shape==="circle"?n.push({type:"oval",layers:PH,center:{x:r.x,y:r.y},width:r.outer_diameter,height:r.outer_diameter,connectedTo:t([r.pcb_plated_hole_id])}):(r.shape==="oval"||r.shape==="pill")&&n.push({type:"oval",layers:PH,center:{x:r.x,y:r.y},width:r.outer_width,height:r.outer_height,connectedTo:t([r.pcb_plated_hole_id])});else if(r.type==="pcb_trace"){const o=OLe(r.route.map(a=>({x:a.x,y:a.y,layer:"layer"in a?a.layer:a.from_layer})),r.source_trace_id);n.push(...o)}else r.type==="pcb_via"&&n.push({type:"rect",layers:r.layers,center:{x:r.x,y:r.y},connectedTo:[],width:r.outer_diameter,height:r.outer_diameter});return n};function VLe(i){const{pcbConnMap:e,goalElementId:t}=i;if(!t.startsWith("pcb_port_"))throw new Error(`Currently alternative goal boxes must have a goal id with prefix "pcb_port_" (got ${t})`);const n=e.getAllTracesConnectedToPort(t);return YLe(n).map(r=>({...r,connectedTo:[t]}))}var jLe=i=>{let{connection:e,pcbConnMap:t}=i;if(e.pointsToConnect.length!==2)throw new Error(`Connection must have exactly 2 points for alternative goal boxes (got ${e.pointsToConnect.length})`);const[n,r]=e.pointsToConnect;if(!n.pcb_port_id||!r.pcb_port_id)throw new Error(`Connection points must have pcb_port_id for alternative goal box calculation (got ${n.pcb_port_id} and ${r.pcb_port_id})`);const o=VLe({goalElementId:n.pcb_port_id,pcbConnMap:t}).concat([{center:n,width:.01,height:.01,connectedTo:[n.pcb_port_id],layers:[n.layer],type:"rect"}]),a=VLe({goalElementId:r.pcb_port_id,pcbConnMap:t}).concat([{center:r,width:.01,height:.01,connectedTo:[r.pcb_port_id],layers:[r.layer],type:"rect"}]);if(o.length<=1&&a.length<=1)return{...e,startPoint:n,endPoint:r,goalBoxes:[]};const s=njt(o,a);let l,c,u;return o.length>=a.length?(l={...r,...s.pointB},c={...n,...s.pointA},u=o):(l={...n,...s.pointA},c={...r,...s.pointB},u=a),{startPoint:l,endPoint:c,goalBoxes:u,name:e.name,pointsToConnect:[l,c]}},ujt=(i,e={})=>{const t={minTraceWidth:.1};t.layerCount=e.layerCount??1,t.obstacles=YLe(i,e.connMap),t.connections=[];for(const r of i)if(r.type==="source_trace"){if(i.some(s=>s.type==="pcb_trace"&&s.source_trace_id===r.source_trace_id))continue;let a={name:r.source_trace_id,pointsToConnect:r.connected_source_port_ids.map(s=>{var c;const l=AM(i).pcb_port.getWhere({source_port_id:s});if(!l)throw new Error(`Could not find pcb_port for source_port_id "${s}"`);return{x:l.x,y:l.y,layer:((c=l.layers)==null?void 0:c[0])??"top",pcb_port_id:l.pcb_port_id}})};if(e.optimizeWithGoalBoxes){const s=new TLe(i);a=jLe({connection:a,pcbConnMap:s})}t.connections.push(a),djt(t.obstacles,a.pointsToConnect,a.name)}const n={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(const r of t.obstacles)n.minX=Math.min(n.minX,r.center.x-r.width/2),n.maxX=Math.max(n.maxX,r.center.x+r.width/2),n.minY=Math.min(n.minY,r.center.y-r.height/2),n.maxY=Math.max(n.maxY,r.center.y+r.height/2);for(const r of t.connections)for(const o of r.pointsToConnect)n.minX=Math.min(n.minX,o.x),n.maxX=Math.max(n.maxX,o.x),n.minY=Math.min(n.minY,o.y),n.maxY=Math.max(n.maxY,o.y);return t.bounds=n,t},djt=(i,e,t)=>{for(const n of e)for(const r of i)fjt(n,r)&&r.connectedTo.push(t)};function fjt(i,e){const t=e.width/2,n=e.height/2;if(e.type==="rect")return i.x>=e.center.x-t&&i.x<=e.center.x+t&&i.y>=e.center.y-n&&i.y<=e.center.y+n;if(e.type==="oval"){const r=(i.x-e.center.x)/t,o=(i.y-e.center.y)/n;return r*r+o*o<=1}return!1}function KLe(i,e){const t=e.x>i.x?1:e.x<i.x?-1:0,n=e.y>i.y?1:e.y<i.y?-1:0,r=e.l>i.l?1:e.l<i.l?-1:0;return{dx:t,dy:n,dl:r}}var rce={1:["top"],2:["top","bottom"],4:["top","inner1","inner2","bottom"]},hjt=i=>rce[i];function XLe(i,e){const n=rce[i].indexOf(e);if(n===-1)throw new Error(`Invalid layer for getLayerIndex (for layerCount === ${i}): "${e}"`);return n}function pjt(i,e){const n=rce[i][e];if(!n)throw new Error(`Invalid index for indexToLayer (for layerCount === ${i}): "${e}"`);return n}var Ajt=class extends GLe{constructor(t,n){super([]);pe(this,"obstacles");pe(this,"GRID_STEP",.1);pe(this,"layerCount");this.layerCount=t;const r=hjt(t);this.obstacles=n.flatMap(o=>o.layers.filter(a=>r.includes(a)).map(a=>({...o,left:o.center.x-o.width/2,right:o.center.x+o.width/2,top:o.center.y+o.height/2,bottom:o.center.y-o.height/2,l:XLe(t,a)})))}getObstacleAt(t,n,r,o){o??(o=this.GRID_STEP);for(const a of this.obstacles){if(a.l!==r)continue;const s=a.width/2+o,l=a.height/2+o;if(t>=a.center.x-s&&t<=a.center.x+s&&n>=a.center.y-l&&n<=a.center.y+l)return a}return null}isObstacleAt(t,n,r,o){return this.getObstacleAt(t,n,r,o)!==null}getDirectionDistancesToNearestObstacle3d(t,n,r){const{GRID_STEP:o}=this,a={left:1/0,top:1/0,bottom:1/0,right:1/0};for(const s of this.obstacles)if(s.l===r&&s.type==="rect"){const l=s.center.x-s.width/2-o,c=s.center.x+s.width/2+o,u=s.center.y+s.height/2+o,d=s.center.y-s.height/2-o;n>=d&&n<=u&&t>l&&(a.left=Math.min(a.left,t-c)),n>=d&&n<=u&&t<c&&(a.right=Math.min(a.right,l-t)),t>=l&&t<=c&&n<u&&(a.top=Math.min(a.top,d-n)),t>=l&&t<=c&&n>d&&(a.bottom=Math.min(a.bottom,n-u))}return a}getOrthoDirectionCollisionInfo(t,n,{margin:r=0}={}){const{x:o,y:a,l:s}=t,{dx:l,dy:c,dl:u}=n;let d=1/0,f=null;if(u!==0){const p=s+u;return this.isObstacleAt(o,a,p,r)?(d=1,f=this.getObstacleAt(o,a,p,r)):d=1,{dx:l,dy:c,dl:u,wallDistance:d,obstacle:f}}else{for(const p of this.obstacles){if(p.l!==s)continue;const A=p.left-r,m=p.right+r,_=p.top+r,v=p.bottom-r;let x=null;l===1&&c===0?a>v&&a<_&&o<p.left&&(x=p.left-o):l===-1&&c===0?a>v&&a<_&&o>p.right&&(x=o-p.right):l===0&&c===1?o>A&&o<m&&a<p.bottom&&(x=p.bottom-a):l===0&&c===-1&&o>A&&o<m&&a>p.top&&(x=a-p.top),x!==null&&x<d&&(d=x,f=p)}return{dx:l,dy:c,dl:0,wallDistance:d,obstacle:f}}}getObstaclesOverlappingRegion(t){const n=[];for(const r of this.obstacles){if(r.l!==t.l)continue;const{left:o,right:a,top:s,bottom:l}=r;o<=t.maxX&&a>=t.minX&&s>=t.minY&&l<=t.maxY&&n.push(r)}return n}},qLe=class extends HLe{constructor(t){super(t);pe(this,"MAX_ITERATIONS",500);pe(this,"VIA_COST",4);pe(this,"VIA_DIAMETER",.5);pe(this,"allowLayerChange",!0);pe(this,"layerCount");pe(this,"obstacles");pe(this,"optimizeWithGoalBoxes");pe(this,"connMap");pe(this,"pcbConnMap");pe(this,"GOAL_RUSH_FACTOR",1.1);pe(this,"defaultGoalViaMargin",.5);pe(this,"marginsWithCosts");this.layerCount=t.input.layerCount??2,this.MAX_ITERATIONS=t.MAX_ITERATIONS??this.MAX_ITERATIONS,this.VIA_COST=t.VIA_COST??this.VIA_COST,this.connMap=t.connMap,this.pcbConnMap=t.pcbConnMap??new TLe,this.optimizeWithGoalBoxes=t.optimizeWithGoalBoxes??!1,this.obstacles=null,this.marginsWithCosts=t.marginsWithCosts??[{margin:1,enterCost:0,travelCostFactor:1},{margin:this.OBSTACLE_MARGIN,enterCost:10,travelCostFactor:2}]}get largestMargin(){return this.marginsWithCosts[0].margin}preprocessConnectionBeforeSolving(t){return this.optimizeWithGoalBoxes?jLe({connection:t,pcbConnMap:this.pcbConnMap}):t}postprocessConnectionSolveResult(t,n){if(!n.solved)return n;if(this.optimizeWithGoalBoxes){const r=n.route.map(o=>({x:o.x,y:o.y,route_type:"wire",layer:o.layer,width:this.input.minTraceWidth}));r[0].start_pcb_port_id=t.pointsToConnect[0].pcb_port_id,r[r.length-1].end_pcb_port_id=t.pointsToConnect[1].pcb_port_id,this.pcbConnMap.addTrace({type:"pcb_trace",pcb_trace_id:`postprocess_trace_${Vre(8)}`,route:r})}return n}createObstacleList({dominantLayer:t,connection:n,obstaclesFromTraces:r}){const o=this.connMap?this.connMap.getNetConnectedToId(n.name):n.name;if(!o)throw new Error(`The connection.name "${n.name}" wasn't present in the full connectivity map`);return new Ajt(this.layerCount,this.allObstacles.filter(a=>!a.connectedTo.includes(o)).concat(r??[]))}computeG(t,n){let r=t.g+mM(t,n)*(t.travelMarginCostFactor??1)+(n.enterMarginCost??0);return(n.l??t.l!==-1??-1)&&(r+=this.VIA_COST),r}computeH(t){const n=Math.abs(t.x-this.goalPoint.x),r=Math.abs(t.y-this.goalPoint.y),o=Math.abs(t.l-this.goalPoint.l);return(n+r)**this.GOAL_RUSH_FACTOR+o*this.VIA_COST}getStartNode(t){return{...super.getStartNode(t),l:this.layerToIndex(t.pointsToConnect[0].layer)}}layerToIndex(t){return XLe(this.layerCount,t)}indexToLayer(t){return pjt(this.layerCount,t)}getNodeName(t){return`${FLe(t,this.GRID_STEP)}-${t.l??0}`}hasSpaceForVia(t,n){return t.every(r=>this.obstacles.getObstaclesOverlappingRegion({minX:n.x-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,minY:n.y-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,maxX:n.x+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,maxY:n.y+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,l:r}).length===0)}getNeighborsSurroundingGoal(t){this.obstacles;const n=this.goalPoint,r=[],o=[{dx:1,dy:0,dl:0},{dx:-1,dy:0,dl:0},{dx:0,dy:1,dl:0},{dx:0,dy:-1,dl:0}],a=this.VIA_DIAMETER+this.OBSTACLE_MARGIN+this.defaultGoalViaMargin;for(const s of o){const l={x:t.x+s.dx*a,y:t.y+s.dy*a,l:t.l+s.dl,obstacleHit:null};this.hasSpaceForVia([t.l,n.l],l)&&r.push(l)}return r}getNeighbors(t){const n=this.obstacles,r=this.goalPoint,o=mM(t,r);if(o<=this.OBSTACLE_MARGIN)return this.getNeighborsSurroundingGoal(t);let a;t.parent?a=KLe(t.parent,t):a=KLe(t,r);const s=[{dx:0,dy:1,dl:0},{dx:1,dy:0,dl:0},{dx:0,dy:-1,dl:0},{dx:-1,dy:0,dl:0}],l=o>this.VIA_DIAMETER+this.OBSTACLE_MARGIN,c=mM(t,this.startNode)>this.VIA_DIAMETER+this.OBSTACLE_MARGIN;this.allowLayerChange&&l&&c&&(t.l<this.layerCount-1&&s.push({dx:0,dy:0,dl:1}),t.l>0&&s.push({dx:0,dy:0,dl:-1}));const u=s.filter(f=>{var p;return f.dx===a.dx*-1&&f.dy===a.dy*-1&&f.dl===a.dl*-1?!1:!(f.dx===a.dx&&f.dy===a.dy&&f.dl===a.dl&&((p=t.parent)!=null&&p.obstacleHit))}).map(f=>n.getOrthoDirectionCollisionInfo(t,f,{margin:this.OBSTACLE_MARGIN})).filter(f=>!(f.wallDistance<this.OBSTACLE_MARGIN)),d=[];for(const f of u){const p=f.dx===0&&f.dy===0&&f.dl===1,A=f.dx===0&&f.dy===0&&f.dl===-1;if((p||A)&&![t.l,t.l+f.dl].every(I=>n.getObstaclesOverlappingRegion({minX:t.x-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,minY:t.y-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,maxX:t.x+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,maxY:t.y+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,l:I}).length===0))continue;if(p){t.l<this.layerCount-1&&d.push({...f,travelDistance:0,enterMarginCost:0,travelMarginCostFactor:1});continue}if(A){t.l>0&&d.push({...f,travelDistance:0,enterMarginCost:0,travelMarginCostFactor:1});continue}let m=null;t!=null&&t.obstacleHit&&(m=ice({node:t,travelDir:f,wallDir:{...a,wallDistance:this.OBSTACLE_MARGIN},obstacle:t.obstacleHit,obstacles:n,OBSTACLE_MARGIN:this.OBSTACLE_MARGIN,SHOULD_DETECT_CONJOINED_OBSTACLES:!0}));const _=LLe(t,r,f),v=(f.dx===0||Math.sign(r.x-t.x)===f.dx)&&(f.dy===0||Math.sign(r.y-t.y)===f.dy);if(_<f.wallDistance&&_>0&&v){const x=t.l===r.l;let I=0;!x&&Math.abs(_-o)<this.GRID_STEP&&(I=this.VIA_DIAMETER+this.OBSTACLE_MARGIN+this.defaultGoalViaMargin),d.push({...f,travelDistance:_-I,enterMarginCost:0,travelMarginCostFactor:1})}else if(m!==null&&m<f.wallDistance){for(const{margin:x,enterCost:I,travelCostFactor:M}of this.marginsWithCosts)m-this.OBSTACLE_MARGIN+x*2<f.wallDistance&&d.push({...f,travelDistance:m-this.OBSTACLE_MARGIN+x,enterMarginCost:I,travelMarginCostFactor:M});if(f.wallDistance===1/0)d.push({...f,travelDistance:_,enterMarginCost:0,travelMarginCostFactor:1});else if(f.wallDistance>this.largestMargin)for(const{margin:x,enterCost:I,travelCostFactor:M}of this.marginsWithCosts)f.wallDistance>this.largestMargin+x&&d.push({...f,travelDistance:f.wallDistance-x,enterMarginCost:I,travelMarginCostFactor:M})}else if(f.wallDistance!==1/0)for(const{margin:x,enterCost:I,travelCostFactor:M}of this.marginsWithCosts)f.wallDistance>x&&d.push({...f,travelDistance:f.wallDistance-x,enterMarginCost:I,travelMarginCostFactor:M})}return d.map(f=>({x:t.x+f.dx*f.travelDistance,y:t.y+f.dy*f.travelDistance,l:t.l+f.dl,obstacleHit:f.obstacle,travelMarginCostFactor:f.travelMarginCostFactor,enterMarginCost:f.enterMarginCost}))}};function gjt(i){const e=ujt(i),t=new ljt({input:e});return{solution:t.solveAndMapToTraces(),debugSolutions:t.debugSolutions,debugMessage:t.debugMessage}}var mjt=aa(["up","down","left","right"]);aa(["top-to-bottom","left-to-right","bottom-to-top","right-to-left"]);var $3=ji(ye().or(mn())),JLe=Wt({x:Nr,y:Nr,z:Nr}),yjt=Wt({x:Ul([mn(),ye()]),y:Ul([mn(),ye()]),z:Ul([mn(),ye()])}),oce=Wt({rotationOffset:mn().or(yjt).optional(),positionOffset:JLe.optional(),size:JLe.optional()}),_jt=oce.extend({stlUrl:ye()}),vjt=oce.extend({objUrl:ye(),mtlUrl:ye().optional()}),xjt=oce.extend({jscad:Tm(yv())}),Ijt=Ul([yDe(),ye(),_jt,vjt,xjt]),bjt=YI(i=>!0),Nx=Wt({pcbX:Nr.optional(),pcbY:Nr.optional(),pcbRotation:ZC.optional(),layer:u1.optional(),pcbRelative:ar().optional(),relative:ar().optional()}),LH=Wt({pcbX:Nr.optional(),pcbY:Nr.optional(),pcbRotation:ZC.optional(),schX:Nr.optional(),schY:Nr.optional(),schRotation:ZC.optional(),layer:u1.optional(),footprint:bjt.optional(),relative:ar().optional(),schRelative:ar().optional(),pcbRelative:ar().optional()}),Cjt=Wt({supplierPartNumbers:Tm(MG,ji(ye())).optional()}),Ejt=Wt({providesPower:ar().optional(),requiresPower:ar().optional(),providesGround:ar().optional(),requiresGround:ar().optional(),providesVoltage:Ul([ye(),mn()]).optional(),requiresVoltage:Ul([ye(),mn()]).optional()}),Qb=LH.merge(Cjt).extend({key:yv().optional(),name:ye(),cadModel:Ijt.optional(),children:yv().optional(),symbolName:ye().optional(),doNotPlace:ar().optional(),pinAttributes:Tm(ye(),Ejt).optional()}),Sjt=["pin1","left","anode","pos","pin2","right","cathode","neg"];Nr.or(aa(["2x","3x","4x"]));var cB=aa(["vertical","horizontal","pos_top","pos_bottom","pos_left","pos_right","neg_top","neg_bottom","neg_left","neg_right"]).describe("horizontal means pins go 1->2 rightward and vertical means pins go 1->2 downward (generally, positive on top)"),FH=Wt({pins:ji(Ul([mn(),ye()])),direction:Ul([Yt("top-to-bottom"),Yt("left-to-right"),Yt("bottom-to-top"),Yt("right-to-left")])}),IT=Wt({leftSize:mn().optional().describe("@deprecated, use leftPinCount"),topSize:mn().optional().describe("@deprecated, use topPinCount"),rightSize:mn().optional().describe("@deprecated, use rightPinCount"),bottomSize:mn().optional().describe("@deprecated, use bottomPinCount"),leftPinCount:mn().optional(),rightPinCount:mn().optional(),topPinCount:mn().optional(),bottomPinCount:mn().optional(),leftSide:FH.optional(),rightSide:FH.optional(),topSide:FH.optional(),bottomSide:FH.optional()}),wjt=IT,UH=Tm(Wt({marginLeft:Nr.optional(),marginRight:Nr.optional(),marginTop:Nr.optional(),marginBottom:Nr.optional(),leftMargin:Nr.optional(),rightMargin:Nr.optional(),topMargin:Nr.optional(),bottomMargin:Nr.optional()})),a3=ye().regex(/^[A-Za-z0-9_]+$/),OH=Wt({x:Nr,y:Nr}),bT=Wt({edit_event_id:ye(),in_progress:ar().optional(),created_at:mn()}),Bjt=bT.extend({pcb_edit_event_type:Yt("edit_component_location").describe("deprecated"),edit_event_type:Yt("edit_pcb_component_location"),pcb_component_id:ye(),original_center:Wt({x:mn(),y:mn()}),new_center:Wt({x:mn(),y:mn()})}),Mjt=bT.extend({pcb_edit_event_type:Yt("edit_trace_hint").describe("deprecated"),edit_event_type:Yt("edit_pcb_trace_hint").optional(),pcb_port_id:ye(),pcb_trace_hint_id:ye().optional(),route:ji(Wt({x:mn(),y:mn(),via:ar().optional()}))}),Rjt=bT.extend({edit_event_type:Yt("edit_schematic_component_location"),schematic_component_id:ye(),original_center:Wt({x:mn(),y:mn()}),new_center:Wt({x:mn(),y:mn()})});bT.extend({edit_event_type:Yt("edit_pcb_group_location"),pcb_group_id:ye(),original_center:Wt({x:mn(),y:mn()}),new_center:Wt({x:mn(),y:mn()})}),bT.extend({edit_event_type:Yt("edit_schematic_group_location"),schematic_group_id:ye(),original_center:Wt({x:mn(),y:mn()}),new_center:Wt({x:mn(),y:mn()})}),Ul([Bjt,Mjt,Rjt]);var Qjt=Wt({selector:ye(),relative_to:ye().optional().default("group_center").describe("Can be a selector or 'group_center'"),center:$_}),Djt=Wt({pcb_port_selector:ye(),offsets:ji(v4)}),Njt=Wt({selector:ye(),relative_to:ye().optional().default("group_center").describe("Can be a selector or 'group_center'"),center:$_}),Tjt=Wt({pcb_placements:ji(Qjt).optional(),manual_trace_hints:ji(Djt).optional(),schematic_placements:ji(Njt).optional()}),CT=Wt({layoutMode:aa(["grid","flex","match-adapt","relative","none"]).optional(),position:aa(["absolute","relative"]).optional(),grid:ar().optional(),gridCols:mn().or(ye()).optional(),gridRows:mn().or(ye()).optional(),gridTemplateRows:ye().optional(),gridTemplateColumns:ye().optional(),gridTemplate:ye().optional(),gridGap:mn().or(ye()).optional(),gridRowGap:mn().or(ye()).optional(),gridColumnGap:mn().or(ye()).optional(),flex:ar().or(ye()).optional(),flexDirection:aa(["row","column"]).optional(),alignItems:aa(["start","center","end","stretch"]).optional(),justifyContent:aa(["start","center","end","stretch","space-between","space-around","space-evenly"]).optional(),flexRow:ar().optional(),flexColumn:ar().optional(),gap:mn().or(ye()).optional(),pack:ar().optional().describe("Pack the contents of this group using a packing strategy"),packOrderStrategy:aa(["largest_to_smallest","first_to_last","highest_to_lowest_pin_count"]).optional(),packPlacementStrategy:aa(["shortest_connection_along_outline"]).optional(),padding:On.optional(),paddingLeft:On.optional(),paddingRight:On.optional(),paddingTop:On.optional(),paddingBottom:On.optional(),paddingX:On.optional(),paddingY:On.optional(),width:On.optional(),height:On.optional(),matchAdapt:ar().optional(),matchAdaptTemplate:yv().optional()}),ZLe=Wt({strokeWidth:On.optional(),dashed:ar().optional(),solid:ar().optional()}),kjt=Wt({serverUrl:ye().optional(),inputFormat:aa(["simplified","circuit-json"]).optional(),serverMode:aa(["job","solve-endpoint"]).optional(),serverCacheEnabled:ar().optional(),cache:YI(i=>!0).optional(),traceClearance:On.optional(),groupMode:aa(["sequential-trace","subcircuit"]).optional(),algorithmFn:YI(i=>typeof i=="function"||i===void 0).optional(),preset:aa(["sequential-trace","subcircuit","auto","auto-local","auto-cloud"]).optional(),local:ar().optional()}),WLe=Ul([kjt,Yt("sequential-trace"),Yt("subcircuit"),Yt("auto"),Yt("auto-local"),Yt("auto-cloud")]),$Le=LH.extend({name:ye().optional(),children:yv().optional(),schTitle:ye().optional(),key:yv().optional(),...CT.shape,grid:CT.shape.grid.describe("@deprecated use pcbGrid"),flex:CT.shape.flex.describe("@deprecated use pcbFlex"),pcbGrid:ar().optional(),pcbGridCols:mn().or(ye()).optional(),pcbGridRows:mn().or(ye()).optional(),pcbGridTemplateRows:ye().optional(),pcbGridTemplateColumns:ye().optional(),pcbGridTemplate:ye().optional(),pcbGridGap:mn().or(ye()).optional(),pcbGridRowGap:mn().or(ye()).optional(),pcbGridColumnGap:mn().or(ye()).optional(),pcbFlex:ar().or(ye()).optional(),pcbFlexDirection:aa(["row","column"]).optional(),pcbAlignItems:aa(["start","center","end","stretch"]).optional(),pcbJustifyContent:aa(["start","center","end","stretch","space-between","space-around","space-evenly"]).optional(),pcbFlexRow:ar().optional(),pcbFlexColumn:ar().optional(),pcbGap:mn().or(ye()).optional(),pcbWidth:On.optional(),pcbHeight:On.optional(),schWidth:On.optional(),schHeight:On.optional(),pcbLayout:CT.optional(),schLayout:CT.optional(),cellBorder:ZLe.nullable().optional(),border:ZLe.nullable().optional(),schPadding:On.optional(),schPaddingLeft:On.optional(),schPaddingRight:On.optional(),schPaddingTop:On.optional(),schPaddingBottom:On.optional()}),eFe=YI(i=>"findPart"in i),ace=$Le.extend({manualEdits:Tjt.optional(),schAutoLayoutEnabled:ar().optional(),schTraceAutoLabelEnabled:ar().optional(),routingDisabled:ar().optional(),defaultTraceWidth:On.optional(),minTraceWidth:On.optional(),partsEngine:eFe.optional(),pcbRouteCache:YI(i=>!0).optional(),autorouter:WLe.optional(),square:ar().optional(),emptyArea:ye().optional(),filledArea:ye().optional(),width:Nr.optional(),height:Nr.optional(),outline:ji(OH).optional(),outlineOffsetX:Nr.optional(),outlineOffsetY:Nr.optional()}),Pjt=ace.extend({subcircuit:Yt(!0)}),Ljt=lC("subcircuit",[$Le.extend({subcircuit:Yt(!1).optional()}),Pjt]),tFe=ace.extend({material:aa(["fr4","fr1"]).default("fr4"),layers:Ul([Yt(2),Yt(4)]).default(2)});ace.extend({padding:Nr.optional(),paddingLeft:Nr.optional(),paddingRight:Nr.optional(),paddingTop:Nr.optional(),paddingBottom:Nr.optional()});var Fjt=ye().or(ji(ye()).readonly()).or(ji(ye())),Ujt=YI().pipe(Tm(ye(),Fjt)),Ojt=Tm(a3,a3.or(ji(a3).readonly()).or(ji(a3))),Gjt=Wt({manufacturerPartNumber:ye().optional(),supplierPartNumber:Tm(MG,ji(ye())).optional()}),nFe=Qb.extend({manufacturerPartNumber:ye().optional(),pinLabels:Ojt.optional(),showPinAliases:ar().optional(),pcbPinLabels:Tm(ye(),ye()).optional(),internallyConnectedPins:ji(ji(ye())).optional(),externallyConnectedPins:ji(ji(ye())).optional(),schPinArrangement:IT.optional(),schPortArrangement:IT.optional(),pinCompatibleVariants:ji(Gjt).optional(),schPinStyle:UH.optional(),schPinSpacing:Nr.optional(),schWidth:Nr.optional(),schHeight:Nr.optional(),noSchematicRepresentation:ar().optional(),connections:Ujt.optional()}),sce=ye().or(ji(ye()).readonly()).or(ji(ye())),GH=i=>Tm(aa(i),sce),iFe=Qb.extend({manufacturerPartNumber:ye().optional(),pinLabels:Tm(mn().or(a3),a3.or(ji(a3))).optional(),schPinStyle:UH.optional(),schPinSpacing:Nr.optional(),schWidth:Nr.optional(),schHeight:Nr.optional(),schDirection:aa(["left","right"]).optional(),schPortArrangement:IT.optional(),pcbPinLabels:Tm(ye(),ye()).optional(),pinCount:Ul([Yt(2),Yt(3)]).optional(),internallyConnectedPins:ji(ji(ye())).optional(),connections:YI().pipe(Tm(ye(),sce)).optional()}),zjt=iFe.extend({bridgedPins:ji(ji(ye())).optional(),bridged:ar().optional()});Qb.extend({manufacturerPartNumber:ye().optional(),pinLabels:Tm(mn().or(a3),a3.or(ji(a3))).optional(),schPinStyle:UH.optional(),schPinSpacing:Nr.optional(),schWidth:Nr.optional(),schHeight:Nr.optional(),schDirection:aa(["left","right"]).optional(),schPortArrangement:IT.optional(),internallyConnectedPins:ji(ji(ye())).optional(),standard:aa(["usb_c","m2"]).optional()});var Hjt=Qb.extend({currentRating:Ul([mn(),ye()]),voltageRating:Ul([mn(),ye()]).optional(),schShowRatings:ar().optional(),schOrientation:cB.optional(),connections:Tm(ye(),Ul([ye(),ji(ye()).readonly(),ji(ye())])).optional()}),zH=YI().transform(i=>{if(i!==void 0)return Nr.parse(i)}),Yjt=lC("shape",[Nx.omit({pcbRotation:!0,layer:!0}).extend({name:ye().optional(),connectsTo:ye().or(ji(ye())).optional(),shape:Yt("circle"),holeDiameter:Nr,outerDiameter:Nr,portHints:$3.optional()}),Nx.omit({pcbRotation:!0,layer:!0}).extend({name:ye().optional(),connectsTo:ye().or(ji(ye())).optional(),shape:Yt("oval"),outerWidth:Nr,outerHeight:Nr,holeWidth:zH,holeHeight:zH,innerWidth:Nr.optional().describe("DEPRECATED use holeWidth"),innerHeight:Nr.optional().describe("DEPRECATED use holeHeight"),portHints:$3.optional()}),Nx.omit({layer:!0}).extend({name:ye().optional(),connectsTo:ye().or(ji(ye())).optional(),shape:Yt("pill"),rectPad:ar().optional(),outerWidth:Nr,outerHeight:Nr,holeWidth:zH,holeHeight:zH,innerWidth:Nr.optional().describe("DEPRECATED use holeWidth"),innerHeight:Nr.optional().describe("DEPRECATED use holeHeight"),portHints:$3.optional()}),Nx.omit({pcbRotation:!0,layer:!0}).extend({name:ye().optional(),connectsTo:ye().or(ji(ye())).optional(),shape:Yt("circular_hole_with_rect_pad"),holeDiameter:Nr,rectPadWidth:Nr,rectPadHeight:Nr,holeShape:Yt("circle").optional(),padShape:Yt("rect").optional(),portHints:$3.optional()}),Nx.omit({pcbRotation:!0,layer:!0}).extend({name:ye().optional(),connectsTo:ye().or(ji(ye())).optional(),shape:Yt("pill_hole_with_rect_pad"),holeShape:Yt("pill"),padShape:Yt("rect"),holeWidth:Nr,holeHeight:Nr,rectPadWidth:Nr,rectPadHeight:Nr,portHints:$3.optional()})]).refine(i=>("innerWidth"in i&&i.innerWidth!==void 0&&(i.holeWidth??(i.holeWidth=i.innerWidth)),"innerHeight"in i&&i.innerHeight!==void 0&&(i.holeHeight??(i.holeHeight=i.innerHeight)),i)),Vjt=["pin1","pin2","pos","neg"],jjt=Qb.extend({resistance:WR,pullupFor:ye().optional(),pullupTo:ye().optional(),pulldownFor:ye().optional(),pulldownTo:ye().optional(),schOrientation:cB.optional(),connections:GH(Vjt).optional()}),Kjt=Qb.extend({maxResistance:WR,pinVariant:aa(["two_pin","three_pin"]).optional()}),Xjt=Qb.extend({frequency:wG,loadCapacitance:$R,pinVariant:aa(["two_pin","four_pin"]).optional(),schOrientation:cB.optional()}),qjt=Qb.extend({frequency:wG,loadCapacitance:$R,pinVariant:aa(["no_ground","ground_pin","two_ground_pins"]).optional()});tFe.extend({leftPinCount:mn().optional(),rightPinCount:mn().optional(),topPinCount:mn().optional(),bottomPinCount:mn().optional(),leftPins:ji(ye()).optional(),rightPins:ji(ye()).optional(),topPins:ji(ye()).optional(),bottomPins:ji(ye()).optional(),pinPitch:Nr.optional(),innerHoles:ar().optional()});var Jjt=["pin1","pin2","pos","neg","anode","cathode"],Zjt=Qb.extend({capacitance:$R,maxVoltageRating:hM.optional(),schShowRatings:ar().optional().default(!1),polarized:ar().optional().default(!1),decouplingFor:ye().optional(),decouplingTo:ye().optional(),bypassFor:ye().optional(),bypassTo:ye().optional(),maxDecouplingTraceLength:mn().optional(),schOrientation:cB.optional(),connections:GH(Jjt).optional()});Wt({name:ye(),connectsTo:ye().or(ji(ye())).optional()}),Wt({name:ye().optional(),pcbOnly:ar().optional(),schOnly:ar().optional()});var Wjt=Wt({pcb:Yt(!0).optional(),xDist:Nr,left:ye(),right:ye(),edgeToEdge:Yt(!0).optional(),centerToCenter:Yt(!0).optional()}),$jt=Wt({pcb:Yt(!0).optional(),yDist:Nr,top:ye(),bottom:ye(),edgeToEdge:Yt(!0).optional(),centerToCenter:Yt(!0).optional()}),eKt=Wt({pcb:Yt(!0).optional(),sameY:Yt(!0).optional(),for:ji(ye())}),tKt=Wt({pcb:Yt(!0).optional(),sameX:Yt(!0).optional(),for:ji(ye())}),nKt=Ul([Wjt,$jt,eKt,tKt]),iKt=Nx.omit({layer:!0,pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("rect"),width:Nr,height:Nr}),rKt=Nx.omit({layer:!0,pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("circle"),radius:Nr}),oKt=Nx.omit({layer:!0,pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("polygon"),points:ji(OH)}),aKt=lC("shape",[iKt,rKt,oKt]),sKt=Nx.omit({pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("rect"),width:Nr,height:Nr,portHints:$3.optional()}),lKt=Nx.omit({pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("rotated_rect"),width:Nr,height:Nr,ccwRotation:mn(),portHints:$3.optional()}),cKt=Nx.omit({pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("circle"),radius:Nr,portHints:$3.optional()}),uKt=Nx.omit({pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("pill"),width:Nr,height:Nr,radius:Nr,portHints:$3.optional()}),dKt=Nx.omit({pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("polygon"),points:ji(OH),portHints:$3.optional()}),fKt=lC("shape",[cKt,sKt,lKt,uKt,dKt]),hKt=Nx.omit({pcbRotation:!0}).extend({shape:Yt("rect"),width:Nr,height:Nr}),pKt=Nx.omit({pcbRotation:!0}).extend({shape:Yt("circle"),radius:Nr});Ul([pKt,hKt]);var AKt=Nx.omit({pcbRotation:!0}).extend({name:ye().optional(),diameter:Nr.optional(),radius:Nr.optional()}).transform(i=>({...i,diameter:i.diameter??2*i.radius,radius:i.radius??i.diameter/2})),lce=Ul([ye(),YI(i=>!!i.getPortSelector)]),rFe=Wt({key:ye().optional(),thickness:Nr.optional(),schematicRouteHints:ji(OH).optional(),pcbRouteHints:ji(v4).optional(),schDisplayLabel:ye().optional(),maxLength:Nr.optional()}),gKt=Ul([rFe.extend({path:ji(lce)}),rFe.extend({from:lce,to:lce})]),mKt=Wt({originalLayer:u1.default("top").optional()}),yKt=mn().or(ye().endsWith("mAh")).transform(i=>{if(typeof i=="string"){const e=i.replace("mAh",""),t=Number.parseFloat(e);if(Number.isNaN(t))throw new Error("Invalid capacity");return t}return i}).describe("Battery capacity in mAh"),_Kt=Qb.extend({capacity:yKt.optional(),schOrientation:cB.optional()}),vKt=Qb.extend({pinCount:mn(),pitch:Nr.optional(),schFacingDirection:aa(["up","down","left","right"]).optional(),gender:aa(["male","female","unpopulated"]).optional().default("male"),showSilkscreenPinLabels:ar().optional(),pcbPinLabels:Tm(ye(),ye()).optional(),doubleRow:ar().optional(),rightAngle:ar().optional(),holeDiameter:Nr.optional(),platedDiameter:Nr.optional(),pinLabels:ji(a3).optional(),connections:YI().pipe(Tm(ye(),sce)).optional(),facingDirection:aa(["left","right"]).optional(),schPinArrangement:wjt.optional(),schPinStyle:UH.optional(),schPinSpacing:Nr.optional(),schWidth:Nr.optional(),schHeight:Nr.optional()});Wt({net:ye().optional(),connection:ye().optional(),schX:Nr.optional(),schY:Nr.optional(),schRotation:ZC.optional(),anchorSide:aa(["left","top","right","bottom"]).optional()});var xKt=Wt({net:ye().optional(),connection:ye().optional(),connectsTo:ye().or(ji(ye())).optional(),schX:Nr.optional(),schY:Nr.optional(),schRotation:ZC.optional(),anchorSide:aa(["left","top","right","bottom"]).optional()}),IKt=nFe.extend({}),bKt=["pin1","pin2","pin3","emitter","collector","base","gate","source","drain"],CKt=Qb.extend({type:aa(["npn","pnp","bjt","jfet","mosfet","igbt"]),connections:GH(bKt).optional()}),EKt=Qb.extend({channelType:aa(["n","p"]),mosfetMode:aa(["enhancement","depletion"])}),SKt=Qb.extend({inductance:Kre,maxCurrentRating:Ul([ye(),mn()]).optional(),schOrientation:cB.optional()}),wKt=aa(["anode","cathode","pin1","pin2","pos","neg"]),BKt=ye().or(ji(ye()).readonly()).or(ji(ye())),MKt=Tm(wKt,BKt),RKt=aa(["standard","schottky","zener","avalanche","photo","tvs"]),QKt=Qb.extend({connections:MKt.optional(),variant:RKt.optional().default("standard"),standard:ar().optional(),schottky:ar().optional(),zener:ar().optional(),avalanche:ar().optional(),photo:ar().optional(),tvs:ar().optional(),schOrientation:cB.optional()}).superRefine((i,e)=>{if([i.standard,i.schottky,i.zener,i.avalanche,i.photo,i.tvs].filter(Boolean).length>1)return e.addIssue({code:mc.custom,message:"Exactly one diode variant must be enabled",path:[]}),Pg}).transform(i=>{const e={...i,standard:!1,schottky:!1,zener:!1,avalanche:!1,photo:!1,tvs:!1};if(i.standard)e.standard=!0;else if(i.schottky)e.schottky=!0;else if(i.zener)e.zener=!0;else if(i.photo)e.photo=!0;else if(i.tvs)e.tvs=!0;else switch(i.variant){case"standard":e.standard=!0;break;case"schottky":e.schottky=!0;break;case"zener":e.zener=!0;break;case"avalanche":e.avalanche=!0;break;case"photo":e.photo=!0;break;case"tvs":e.tvs=!0;break;default:e.standard=!0}return e}),DKt=Qb.extend({color:ye().optional(),wavelength:ye().optional(),schDisplayValue:ye().optional(),schOrientation:cB.optional(),connections:GH(Sjt).optional(),laser:ar().optional()}),NKt=Qb.extend({type:aa(["spst","spdt","dpst","dpdt"]).optional(),isNormallyClosed:ar().optional().default(!1),spst:ar().optional(),spdt:ar().optional(),dpst:ar().optional(),dpdt:ar().optional()}).transform(i=>{const e={...i};switch(e.dpdt?e.type="dpdt":e.spst?e.type="spst":e.spdt?e.type="spdt":e.dpst&&(e.type="dpst"),e.type){case"spdt":e.spdt=!0;break;case"spst":e.spst=!0;break;case"dpst":e.dpst=!0;break;case"dpdt":e.dpdt=!0;break}return e}),TKt=Nx.extend({text:ye(),anchorAlignment:aa(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),font:aa(["tscircuit2024"]).optional(),fontSize:On.optional(),color:ye().optional()}),kKt=Nx.omit({pcbX:!0,pcbY:!0,pcbRotation:!0}).extend({route:ji(v4),strokeWidth:On.optional(),color:ye().optional()});Wt({layer:ye().optional(),thickness:Nr.optional(),route:ji(v4)});var PKt=LH.extend({name:ye().optional(),fromLayer:u1,toLayer:u1,holeDiameter:Nr,outerDiameter:Nr,connectsTo:ye().or(ji(ye())).optional()}),LKt=Qb.extend({footprintVariant:aa(["pad","through_hole"]).optional(),padShape:aa(["rect","circle"]).optional().default("circle"),padDiameter:Nr.optional(),holeDiameter:Nr.optional(),width:Nr.optional(),height:Nr.optional()}).refine(i=>i.footprintVariant!=="through_hole"||i.holeDiameter!==void 0,{message:"holeDiameter is required for through_hole testpoints"}),FKt=Nx.omit({pcbRotation:!0,layer:!0}).extend({connection:ye()}),UKt=Ul([Nx.omit({pcbRotation:!0}).extend({shape:Yt("circle"),radius:Nr}),Nx.extend({shape:Yt("rect"),width:Nr,height:Nr})]),OKt=Qb.extend({voltage:hM}),HH=aa(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),GKt=Wt({schX:Nr.optional(),schY:Nr.optional(),width:Nr.optional(),height:Nr.optional(),overlay:ji(ye()).optional(),padding:Nr.optional(),paddingLeft:Nr.optional(),paddingRight:Nr.optional(),paddingTop:Nr.optional(),paddingBottom:Nr.optional(),title:ye().optional(),titleAlignment:HH.default("top_left"),titleColor:ye().optional(),titleFontSize:Nr.optional(),titleInside:ar().default(!1),strokeStyle:aa(["solid","dashed"]).default("solid")}).refine(i=>i.width!==void 0&&i.height!==void 0||Array.isArray(i.overlay)&&i.overlay.length>0,{message:"Must provide either both `width` and `height`, or a non-empty `overlay` array."}).refine(i=>!(i.width!==void 0&&i.height!==void 0&&Array.isArray(i.overlay)&&i.overlay.length>0),{message:"Cannot provide both `width`/`height` and `overlay` at the same time."});Wt({x1:Nr,y1:Nr,x2:Nr,y2:Nr});var zKt=aa(["center","left","right","top","bottom"]),HKt=Wt({schX:Nr.optional(),schY:Nr.optional(),text:ye(),fontSize:mn().default(1),anchor:Ul([zKt.describe("legacy"),HH]).default("center"),color:ye().default("#000000"),schRotation:ZC.default(0)});Wt({points:ji($_),isFilled:ar().optional().default(!1),fillColor:aa(["red","blue"]).optional()});var YKt=Wt({schX:Nr.optional(),schY:Nr.optional(),children:yv().optional(),cellPadding:Nr.optional(),borderWidth:Nr.optional(),anchor:HH.optional(),fontSize:Nr.optional()}),VKt=Wt({children:yv().optional(),height:Nr.optional()}),jKt=Wt({children:ye().optional(),horizontalAlign:aa(["left","center","right"]).optional(),verticalAlign:aa(["top","middle","bottom"]).optional(),fontSize:Nr.optional(),rowSpan:mn().optional(),colSpan:mn().optional(),width:Nr.optional(),text:ye().optional()}),KKt=Nx.extend({text:ye(),anchorAlignment:HH.default("center"),font:aa(["tscircuit2024"]).optional(),fontSize:On.optional()}),XKt=Nx.omit({pcbX:!0,pcbY:!0,pcbRotation:!0}).extend({route:ji(v4),strokeWidth:On.optional()}),qKt=Nx.omit({pcbX:!0,pcbY:!0,pcbRotation:!0}).extend({strokeWidth:Nr,x1:Nr,y1:Nr,x2:Nr,y2:Nr}),JKt=Nx.omit({pcbRotation:!0}).extend({filled:ar().default(!0).optional(),stroke:aa(["dashed","solid","none"]).optional(),strokeWidth:Nr.optional(),width:Nr,height:Nr}),ZKt=Nx.omit({pcbRotation:!0}).extend({isFilled:ar().optional(),isOutline:ar().optional(),strokeWidth:Nr.optional(),radius:Nr}),oFe=Wt({x:Nr,y:Nr,via:ar().optional(),toLayer:u1.optional()}),WKt=Wt({for:ye().optional().describe("Selector for the port you're targeting, not required if you're inside a trace"),order:mn().optional(),offset:v4.or(oFe).optional(),offsets:ji(v4).or(ji(oFe)).optional(),traceWidth:mn().optional()});LH.extend({name:ye(),pinNumber:mn().optional(),aliases:ji(ye()).optional(),direction:mjt});var $Kt=ji(yv()).describe("Circuit JSON"),eXt=_De().args(ye()).returns(vDe(Wt({footprintCircuitJson:ji(yv())}))).describe("A function that takes a path and returns Circuit JSON");Wt({partsEngine:eFe.optional(),autorouter:WLe.optional(),registryApiUrl:ye().optional(),cloudAutorouterUrl:ye().optional(),projectName:ye().optional(),version:ye().optional(),url:ye().optional(),printBoardInformationToSilkscreen:ar().optional(),localCacheEngine:yv().optional(),pcbDisabled:ar().optional(),schematicDisabled:ar().optional(),partsEngineDisabled:ar().optional(),footprintLibraryMap:Tm(ye(),Tm(ye(),Ul([$Kt,eXt]))).optional()});function lQ(){return new tXt}let tXt=class hRt{constructor(){pe(this,"index",{});pe(this,"array",[])}size(){return this.array.length}empty(){return this.array.length===0}itemAt(e){return this.array[e]}contains(e){return this.index[e.id()]!==void 0}find(e){const t=this.index[e.id()];return t===void 0?void 0:this.array[t]}setDefault(e,t){const n=this.index[e.id()];if(n===void 0){const r=new aFe(e,t());return this.index[e.id()]=this.array.length,this.array.push(r),r}else return this.array[n]}insert(e,t){const n=new aFe(e,t),r=this.index[e.id()];return r===void 0?(this.index[e.id()]=this.array.length,this.array.push(n)):this.array[r]=n,n}erase(e){const t=this.index[e.id()];if(t===void 0)return;this.index[e.id()]=void 0;const n=this.array[t],r=this.array.pop();return n!==r&&(this.array[t]=r,this.index[r.first.id()]=t),n}copy(){const e=new hRt;for(let t=0;t<this.array.length;t++){const n=this.array[t].copy();e.array[t]=n,e.index[n.first.id()]=t}return e}},aFe=class pRt{constructor(e,t){pe(this,"first");pe(this,"second");this.first=e,this.second=t}copy(){return new pRt(this.first,this.second)}},cce=class{constructor(e=""){pe(this,"_name");pe(this,"_value",0);pe(this,"_context",null);pe(this,"_id",nXt++);this._name=e}id(){return this._id}name(){return this._name}setName(e){this._name=e}context(){return this._context}setContext(e){this._context=e}value(){return this._value}setValue(e){this._value=e}plus(e){return new o2(this,e)}minus(e){return new o2(this,typeof e=="number"?-e:[-1,e])}multiply(e){return new o2([e,this])}divide(e){return new o2([1/e,this])}toJSON(){return{name:this._name,value:this._value}}toString(){return this._context+"["+this._name+":"+this._value+"]"}},nXt=0,o2=class nG{constructor(){pe(this,"_terms");pe(this,"_constant");let e=iXt(arguments);this._terms=e.terms,this._constant=e.constant}terms(){return this._terms}constant(){return this._constant}value(){let e=this._constant;for(let t=0,n=this._terms.size();t<n;t++){let r=this._terms.itemAt(t);e+=r.first.value()*r.second}return e}plus(e){return new nG(this,e)}minus(e){return new nG(this,typeof e=="number"?-e:[-1,e])}multiply(e){return new nG([e,this])}divide(e){return new nG([1/e,this])}isConstant(){return this._terms.size()==0}toString(){let e=this._terms.array.map(function(t){return t.second+"*"+t.first.toString()}).join(" + ");return!this.isConstant()&&this._constant!==0&&(e+=" + "),e+=this._constant,e}};function iXt(i){let e=0,t=()=>0,n=lQ();for(let r=0,o=i.length;r<o;++r){let a=i[r];if(typeof a=="number")e+=a;else if(a instanceof cce)n.setDefault(a,t).second+=1;else if(a instanceof o2){e+=a.constant();let s=a.terms();for(let l=0,c=s.size();l<c;l++){let u=s.itemAt(l);n.setDefault(u.first,t).second+=u.second}}else if(a instanceof Array){if(a.length!==2)throw new Error("array must have length 2");let s=a[0],l=a[1];if(typeof s!="number")throw new Error("array item 0 must be a number");if(l instanceof cce)n.setDefault(l,t).second+=s;else if(l instanceof o2){e+=l.constant()*s;let c=l.terms();for(let u=0,d=c.size();u<d;u++){let f=c.itemAt(u);n.setDefault(f.first,t).second+=f.second*s}}else throw new Error("array item 1 must be a variable or expression")}else throw new Error("invalid Expression argument: "+a)}return{terms:n,constant:e}}let a2=(L2=class{static create(e,t,n,r=1){let o=0;return o+=Math.max(0,Math.min(1e3,e*r))*1e6,o+=Math.max(0,Math.min(1e3,t*r))*1e3,o+=Math.max(0,Math.min(1e3,n*r)),o}static clip(e){return Math.max(0,Math.min(L2.required,e))}},pe(L2,"required",L2.create(1e3,1e3,1e3)),pe(L2,"strong",L2.create(1,0,0)),pe(L2,"medium",L2.create(0,1,0)),pe(L2,"weak",L2.create(0,0,1)),L2);var j2;(function(i){i[i.Le=0]="Le",i[i.Ge=1]="Ge",i[i.Eq=2]="Eq"})(j2||(j2={}));let uB=class{constructor(e,t,n,r=a2.required){pe(this,"_expression");pe(this,"_operator");pe(this,"_strength");pe(this,"_id",rXt++);this._operator=t,this._strength=a2.clip(r),n===void 0&&e instanceof o2?this._expression=e:this._expression=e.minus(n)}id(){return this._id}expression(){return this._expression}op(){return this._operator}strength(){return this._strength}toString(){return this._expression.toString()+" "+["<=",">=","="][this._operator]+" 0 ("+this._strength.toString()+")"}},rXt=0,oXt=class{constructor(){pe(this,"maxIterations",1e3);pe(this,"_cnMap",aXt());pe(this,"_rowMap",sXt());pe(this,"_varMap",lXt());pe(this,"_editMap",cXt());pe(this,"_infeasibleRows",[]);pe(this,"_objective",new lFe);pe(this,"_artificial",null);pe(this,"_idTick",0)}createConstraint(e,t,n,r=a2.required){let o=new uB(e,t,n,r);return this.addConstraint(o),o}addConstraint(e){if(this._cnMap.find(e)!==void 0)throw new Error("duplicate constraint");let n=this._createRow(e),r=n.row,o=n.tag,a=this._chooseSubject(r,o);if(a.type()===w9.Invalid&&r.allDummies())if(YH(r.constant()))a=o.marker;else throw new Error("unsatisfiable constraint");if(a.type()===w9.Invalid){if(!this._addWithArtificialVariable(r))throw new Error("unsatisfiable constraint")}else r.solveFor(a),this._substitute(a,r),this._rowMap.insert(a,r);this._cnMap.insert(e,o),this._optimize(this._objective)}removeConstraint(e){let t=this._cnMap.erase(e);if(t===void 0)throw new Error("unknown constraint");this._removeConstraintEffects(e,t.second);let n=t.second.marker,r=this._rowMap.erase(n);if(r===void 0){let o=this._getMarkerLeavingSymbol(n);if(o.type()===w9.Invalid)throw new Error("failed to find leaving row");r=this._rowMap.erase(o),r.second.solveForEx(o,n),this._substitute(n,r.second)}this._optimize(this._objective)}hasConstraint(e){return this._cnMap.contains(e)}getConstraints(){return this._cnMap.array.map(({first:e})=>e)}addEditVariable(e,t){if(this._editMap.find(e)!==void 0)throw new Error("duplicate edit variable");if(t=a2.clip(t),t===a2.required)throw new Error("bad required strength");let r=new o2(e),o=new uB(r,j2.Eq,void 0,t);this.addConstraint(o);let s={tag:this._cnMap.find(o).second,constraint:o,constant:0};this._editMap.insert(e,s)}removeEditVariable(e){let t=this._editMap.erase(e);if(t===void 0)throw new Error("unknown edit variable");this.removeConstraint(t.second.constraint)}hasEditVariable(e){return this._editMap.contains(e)}suggestValue(e,t){let n=this._editMap.find(e);if(n===void 0)throw new Error("unknown edit variable");let r=this._rowMap,o=n.second,a=t-o.constant;o.constant=t;let s=o.tag.marker,l=r.find(s);if(l!==void 0){l.second.add(-a)<0&&this._infeasibleRows.push(s),this._dualOptimize();return}let c=o.tag.other;if(l=r.find(c),l!==void 0){l.second.add(a)<0&&this._infeasibleRows.push(c),this._dualOptimize();return}for(let u=0,d=r.size();u<d;++u){let f=r.itemAt(u),p=f.second,A=p.coefficientFor(s);A!==0&&p.add(a*A)<0&&f.first.type()!==w9.External&&this._infeasibleRows.push(f.first)}this._dualOptimize()}updateVariables(){let e=this._varMap,t=this._rowMap;for(let n=0,r=e.size();n<r;++n){let o=e.itemAt(n),a=t.find(o.second);a!==void 0?o.first.setValue(a.second.constant()):o.first.setValue(0)}}_getVarSymbol(e){let t=()=>this._makeSymbol(w9.External);return this._varMap.setDefault(e,t).second}_createRow(e){let t=e.expression(),n=new lFe(t.constant()),r=t.terms();for(let l=0,c=r.size();l<c;++l){let u=r.itemAt(l);if(!YH(u.second)){let d=this._getVarSymbol(u.first),f=this._rowMap.find(d);f!==void 0?n.insertRow(f.second,u.second):n.insertSymbol(d,u.second)}}let o=this._objective,a=e.strength(),s={marker:dB,other:dB};switch(e.op()){case j2.Le:case j2.Ge:{let l=e.op()===j2.Le?1:-1,c=this._makeSymbol(w9.Slack);if(s.marker=c,n.insertSymbol(c,l),a<a2.required){let u=this._makeSymbol(w9.Error);s.other=u,n.insertSymbol(u,-l),o.insertSymbol(u,a)}break}case j2.Eq:{if(a<a2.required){let l=this._makeSymbol(w9.Error),c=this._makeSymbol(w9.Error);s.marker=l,s.other=c,n.insertSymbol(l,-1),n.insertSymbol(c,1),o.insertSymbol(l,a),o.insertSymbol(c,a)}else{let l=this._makeSymbol(w9.Dummy);s.marker=l,n.insertSymbol(l)}break}}return n.constant()<0&&n.reverseSign(),{row:n,tag:s}}_chooseSubject(e,t){let n=e.cells();for(let o=0,a=n.size();o<a;++o){let s=n.itemAt(o);if(s.first.type()===w9.External)return s.first}let r=t.marker.type();return(r===w9.Slack||r===w9.Error)&&e.coefficientFor(t.marker)<0?t.marker:(r=t.other.type(),(r===w9.Slack||r===w9.Error)&&e.coefficientFor(t.other)<0?t.other:dB)}_addWithArtificialVariable(e){let t=this._makeSymbol(w9.Slack);this._rowMap.insert(t,e.copy()),this._artificial=e.copy(),this._optimize(this._artificial);let n=YH(this._artificial.constant());this._artificial=null;let r=this._rowMap.erase(t);if(r!==void 0){let a=r.second;if(a.isConstant())return n;let s=this._anyPivotableSymbol(a);if(s.type()===w9.Invalid)return!1;a.solveForEx(t,s),this._substitute(s,a),this._rowMap.insert(s,a)}let o=this._rowMap;for(let a=0,s=o.size();a<s;++a)o.itemAt(a).second.removeSymbol(t);return this._objective.removeSymbol(t),n}_substitute(e,t){let n=this._rowMap;for(let r=0,o=n.size();r<o;++r){let a=n.itemAt(r);a.second.substitute(e,t),a.second.constant()<0&&a.first.type()!==w9.External&&this._infeasibleRows.push(a.first)}this._objective.substitute(e,t),this._artificial&&this._artificial.substitute(e,t)}_optimize(e){let t=0;for(;t<this.maxIterations;){let n=this._getEnteringSymbol(e);if(n.type()===w9.Invalid)return;let r=this._getLeavingSymbol(n);if(r.type()===w9.Invalid)throw new Error("the objective is unbounded");let o=this._rowMap.erase(r).second;o.solveForEx(r,n),this._substitute(n,o),this._rowMap.insert(n,o),t++}throw new Error("solver iterations exceeded")}_dualOptimize(){let e=this._rowMap,t=this._infeasibleRows;for(;t.length!==0;){let n=t.pop(),r=e.find(n);if(r!==void 0&&r.second.constant()<0){let o=this._getDualEnteringSymbol(r.second);if(o.type()===w9.Invalid)throw new Error("dual optimize failed");let a=r.second;e.erase(n),a.solveForEx(n,o),this._substitute(o,a),e.insert(o,a)}}}_getEnteringSymbol(e){let t=e.cells();for(let n=0,r=t.size();n<r;++n){let o=t.itemAt(n),a=o.first;if(o.second<0&&a.type()!==w9.Dummy)return a}return dB}_getDualEnteringSymbol(e){let t=Number.MAX_VALUE,n=dB,r=e.cells();for(let o=0,a=r.size();o<a;++o){let s=r.itemAt(o),l=s.first,c=s.second;if(c>0&&l.type()!==w9.Dummy){let d=this._objective.coefficientFor(l)/c;d<t&&(t=d,n=l)}}return n}_getLeavingSymbol(e){let t=Number.MAX_VALUE,n=dB,r=this._rowMap;for(let o=0,a=r.size();o<a;++o){let s=r.itemAt(o),l=s.first;if(l.type()!==w9.External){let c=s.second,u=c.coefficientFor(e);if(u<0){let d=-c.constant()/u;d<t&&(t=d,n=l)}}}return n}_getMarkerLeavingSymbol(e){let t=Number.MAX_VALUE,n=t,r=t,o=dB,a=o,s=o,l=o,c=this._rowMap;for(let u=0,d=c.size();u<d;++u){let f=c.itemAt(u),p=f.second,A=p.coefficientFor(e);if(A===0)continue;let m=f.first;if(m.type()===w9.External)l=m;else if(A<0){let _=-p.constant()/A;_<n&&(n=_,a=m)}else{let _=p.constant()/A;_<r&&(r=_,s=m)}}return a!==o?a:s!==o?s:l}_removeConstraintEffects(e,t){t.marker.type()===w9.Error&&this._removeMarkerEffects(t.marker,e.strength()),t.other.type()===w9.Error&&this._removeMarkerEffects(t.other,e.strength())}_removeMarkerEffects(e,t){let n=this._rowMap.find(e);n!==void 0?this._objective.insertRow(n.second,-t):this._objective.insertSymbol(e,-t)}_anyPivotableSymbol(e){let t=e.cells();for(let n=0,r=t.size();n<r;++n){let o=t.itemAt(n),a=o.first.type();if(a===w9.Slack||a===w9.Error)return o.first}return dB}_makeSymbol(e){return new sFe(e,this._idTick++)}};function YH(i){let e=1e-8;return i<0?-i<e:i<e}function aXt(){return lQ()}function sXt(){return lQ()}function lXt(){return lQ()}function cXt(){return lQ()}var w9;(function(i){i[i.Invalid=0]="Invalid",i[i.External=1]="External",i[i.Slack=2]="Slack",i[i.Error=3]="Error",i[i.Dummy=4]="Dummy"})(w9||(w9={}));let sFe=class{constructor(e,t){pe(this,"_id");pe(this,"_type");this._id=t,this._type=e}id(){return this._id}type(){return this._type}},dB=new sFe(w9.Invalid,-1),lFe=class ARt{constructor(e=0){pe(this,"_cellMap",lQ());pe(this,"_constant");this._constant=e}cells(){return this._cellMap}constant(){return this._constant}isConstant(){return this._cellMap.empty()}allDummies(){let e=this._cellMap;for(let t=0,n=e.size();t<n;++t)if(e.itemAt(t).first.type()!==w9.Dummy)return!1;return!0}copy(){let e=new ARt(this._constant);return e._cellMap=this._cellMap.copy(),e}add(e){return this._constant+=e}insertSymbol(e,t=1){let n=this._cellMap.setDefault(e,()=>0);YH(n.second+=t)&&this._cellMap.erase(e)}insertRow(e,t=1){this._constant+=e._constant*t;let n=e._cellMap;for(let r=0,o=n.size();r<o;++r){let a=n.itemAt(r);this.insertSymbol(a.first,a.second*t)}}removeSymbol(e){this._cellMap.erase(e)}reverseSign(){this._constant=-this._constant;let e=this._cellMap;for(let t=0,n=e.size();t<n;++t){let r=e.itemAt(t);r.second=-r.second}}solveFor(e){let t=this._cellMap,r=-1/t.erase(e).second;this._constant*=r;for(let o=0,a=t.size();o<a;++o)t.itemAt(o).second*=r}solveForEx(e,t){this.insertSymbol(e,-1),this.solveFor(t)}coefficientFor(e){let t=this._cellMap.find(e);return t!==void 0?t.second:0}substitute(e,t){let n=this._cellMap.erase(e);n!==void 0&&this.insertRow(t,n.second)}};function uce([i,e],[t,n],{lineThickness:r=0}={}){return r===0?_M(i,e,t,n):uXt(i,e,t,n)<=r}function _M(i,e,t,n){const r=VH(i,e,t),o=VH(i,e,n),a=VH(t,n,i),s=VH(t,n,e);return!!(r!==o&&a!==s||r===0&&jH(i,t,e)||o===0&&jH(i,n,e)||a===0&&jH(t,i,n)||s===0&&jH(t,e,n))}function VH(i,e,t){const n=(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y);return n===0?0:n>0?1:2}function jH(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function uXt(i,e,t,n){if(i.x===e.x&&i.y===e.y)return WC(i,t,n);if(t.x===n.x&&t.y===n.y)return WC(t,i,e);if(_M(i,e,t,n))return 0;const r=[WC(i,t,n),WC(e,t,n),WC(t,i,e),WC(n,i,e)];return Math.min(...r)}function WC(i,e,t){const n=(t.x-e.x)**2+(t.y-e.y)**2;if(n===0)return S4(i,e);let r=((i.x-e.x)*(t.x-e.x)+(i.y-e.y)*(t.y-e.y))/n;r=Math.max(0,Math.min(1,r));const o={x:e.x+r*(t.x-e.x),y:e.y+r*(t.y-e.y)};return S4(i,o)}function S4(i,e){const t=i.x-e.x,n=i.y-e.y;return Math.sqrt(t*t+n*n)}function dXt(i,e,t,n){if(i.x===e.x&&i.y===e.y)return WC(i,t,n);if(t.x===n.x&&t.y===n.y)return WC(t,i,e);if(_M(i,e,t,n))return 0;const r=[WC(i,t,n),WC(e,t,n),WC(t,i,e),WC(n,i,e)];return Math.min(...r)}function fXt(i,e,t){const n={x:t.minX,y:t.minY},r={x:t.maxX,y:t.minY},o={x:t.minX,y:t.maxY},a={x:t.maxX,y:t.maxY};if(_M(i,e,n,r)||_M(i,e,r,a)||_M(i,e,a,o)||_M(i,e,o,n)||i.x>=t.minX&&i.x<=t.maxX&&i.y>=t.minY&&i.y<=t.maxY&&e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY)return 0;const s=[WC(n,i,e),WC(r,i,e),WC(o,i,e),WC(a,i,e)];if(i.x>=t.minX&&i.x<=t.maxX&&i.y>=t.minY&&i.y<=t.maxY||e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY)return 0;if(i.x<t.minX||i.x>t.maxX||i.y<t.minY||i.y>t.maxY){const l=lB(i.x,t.minX,t.maxX),c=lB(i.y,t.minY,t.maxY);s.push(S4(i,{x:l,y:c}))}if(e.x<t.minX||e.x>t.maxX||e.y<t.minY||e.y>t.maxY){const l=lB(e.x,t.minX,t.maxX),c=lB(e.y,t.minY,t.maxY);s.push(S4(e,{x:l,y:c}))}return Math.min(...s)}function hXt(i,e,t){const n={x:t.x,y:t.y};if(i.x===e.x&&i.y===e.y)return Math.max(0,S4(i,n)-t.radius);const r={x:e.x-i.x,y:e.y-i.y},o={x:n.x-i.x,y:n.y-i.y},a=r.x*r.x+r.y*r.y,s=Math.max(0,Math.min(1,(r.x*o.x+r.y*o.y)/a)),l={x:i.x+s*r.x,y:i.y+s*r.y},c=S4(l,n);return Math.max(0,c-t.radius)}var pXt=(i,e)=>{const t={x:e.x-i.x,y:e.y-i.y},n=Math.sqrt(t.x**2+t.y**2);return{x:t.x/n,y:t.y/n}},AXt=i=>{switch(i){case"up":return{x:0,y:1};case"down":return{x:0,y:-1};case"left":return{x:-1,y:0};case"right":return{x:1,y:0}}};const gXt=(i,e,t={})=>{const n=(t==null?void 0:t.overshoot)??.1*Math.max(Math.abs(i.x-e.x),Math.abs(i.y-e.y)),r=[{x:i.x,y:i.y}],o=(i.x+e.x)/2,a=(i.y+e.y)/2,s={x:e.x,y:e.y};switch(e.facingDirection){case"x+":s.x+=n;break;case"x-":s.x-=n;break;case"y+":s.y+=n;break;case"y-":s.y-=n;break}const l=i.facingDirection??"none",c=e.facingDirection??"none",u=d=>{const f=r[r.length-1];(f.x!==d.x||f.y!==d.y)&&r.push(d)};if(l==="none"&&c==="none")u({x:o,y:i.y}),u({x:o,y:e.y});else if(l==="y+"&&c==="x-")u({x:i.x,y:e.y});else if(l==="y-"&&c==="x-")if(i.y>=e.y)u({x:i.x,y:e.y});else{const d=i.y-n;u({x:i.x,y:d}),u({x:o,y:d}),u({x:o,y:e.y}),u({x:s.x,y:e.y})}else if(l==="x-"&&c==="x+")i.x>e.x?(u({x:o,y:i.y}),u({x:o,y:e.y})):(u({x:i.x-n,y:i.y}),u({x:i.x-n,y:a}),u({x:s.x,y:a}),u({x:s.x,y:e.y}));else if(l==="y+"&&c==="y+"){const d=Math.max(i.y+n,s.y);u({x:i.x,y:d}),u({x:e.x,y:d})}else if(l==="y-"&&c==="x+")if(i.x>e.x&&i.y>=e.y)u({x:i.x,y:e.y}),u({x:e.x,y:e.y});else{const d=i.y-n;u({x:i.x,y:d}),u({x:s.x,y:d}),u({x:s.x,y:e.y})}else if(l==="y+"&&c==="x+")if(i.x>e.x&&i.y<e.y)u({x:i.x,y:e.y}),u({x:e.x,y:e.y});else{const d=i.y+n;u({x:i.x,y:d}),u({x:s.x,y:d}),u({x:s.x,y:e.y})}else if(l==="x+"&&c==="y+")if(i.x>e.x&&i.y<e.y)u({x:i.x,y:e.y}),u({x:e.x,y:e.y});else if(i.x<e.x&&i.y>e.y)u({x:e.x,y:i.y});else if(i.x===e.x)u({x:i.x+n,y:i.y}),u({x:i.x+n,y:a}),u({x:e.x,y:a});else if(i.x<e.x)u({x:o,y:i.y}),u({x:o,y:s.y}),u({x:e.x,y:s.y});else{const d=i.x+n;u({x:d,y:i.y}),u({x:d,y:s.y}),u({x:e.x,y:s.y})}else if(l==="y-"&&c==="y-"){const d=Math.min(i.y-n,s.y);u({x:i.x,y:d}),u({x:e.x,y:d})}else if(l==="x+"&&c==="x+"){const d=Math.max(i.x+n,s.x);u({x:d,y:i.y}),u({x:d,y:e.y})}else if(l==="x-"&&c==="x-"){const d=Math.min(i.x-n,s.x);u({x:d,y:i.y}),u({x:d,y:e.y})}else if(l==="x-"&&c==="y+")i.x>e.x?u({x:e.x,y:i.y}):(u({x:i.x-n,y:i.y}),u({x:i.x-n,y:s.y}),u({x:e.x,y:s.y}));else if(l==="x-"&&c==="y-")if(i.x>e.x&&i.y<=e.y)u({x:e.x,y:i.y});else{const d=i.x-n;u({x:d,y:i.y}),u({x:d,y:s.y}),u({x:s.x,y:s.y})}else if(l==="x+"&&c==="y-")i.x===e.x?(u({x:i.x+n,y:i.y}),u({x:i.x+n,y:a}),u({x:e.x,y:a})):i.x<e.x&&i.y<e.y?u({x:e.x,y:i.y}):(u({x:i.x+n,y:i.y}),u({x:i.x+n,y:s.y}),u({x:e.x,y:s.y}));else if(l==="y-"&&c==="y+")if(i.y>=e.y)u({x:i.x,y:a}),u({x:e.x,y:a});else{const d=i.y-n;u({x:i.x,y:d}),u({x:o,y:d}),u({x:o,y:s.y}),u({x:e.x,y:s.y})}else if(l==="y+"&&c==="y-")if(i.y<=e.y)u({x:i.x,y:a}),u({x:e.x,y:a});else{const d=i.y+n;u({x:i.x,y:d}),u({x:o,y:d}),u({x:o,y:s.y}),u({x:e.x,y:s.y})}else l.startsWith("x")?u({x:i.x+(l==="x+"?n:-n),y:i.y}):l.startsWith("y")&&u({x:i.x,y:i.y+(l==="y+"?n:-n)}),u({x:o,y:r[r.length-1].y}),u({x:o,y:s.y}),u({x:s.x,y:s.y});return u({x:e.x,y:e.y}),r};function fB(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var dce={exports:{}},cFe;function mXt(){return cFe||(cFe=1,function(i,e){(function(t){i.exports=t()})(function(){return function t(n,r,o){function a(c,u){if(!r[c]){if(!n[c]){var d=typeof fB=="function"&&fB;if(!u&&d)return d(c,!0);if(s)return s(c,!0);throw new Error("Cannot find module '"+c+"'")}u=r[c]={exports:{}},n[c][0].call(u.exports,function(f){var p=n[c][1][f];return a(p||f)},u,u.exports,t,n,r,o)}return r[c].exports}for(var s=typeof fB=="function"&&fB,l=0;l<o.length;l++)a(o[l]);return a}({1:[function(t,n,r){(function(o,a,s,l,c,u,d,f,p){var A=t("crypto");function m(k,L){L=x(k,L);var R;return(R=L.algorithm!=="passthrough"?A.createHash(L.algorithm):new G).write===void 0&&(R.write=R.update,R.end=R.update),M(L,R).dispatch(k),R.update||R.end(""),R.digest?R.digest(L.encoding==="buffer"?void 0:L.encoding):(k=R.read(),L.encoding!=="buffer"?k.toString(L.encoding):k)}(r=n.exports=m).sha1=function(k){return m(k)},r.keys=function(k){return m(k,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(k){return m(k,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(k){return m(k,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var _=A.getHashes?A.getHashes().slice():["sha1","md5"],v=(_.push("passthrough"),["buffer","hex","binary","base64"]);function x(k,L){var R={};if(R.algorithm=(L=L||{}).algorithm||"sha1",R.encoding=L.encoding||"hex",R.excludeValues=!!L.excludeValues,R.algorithm=R.algorithm.toLowerCase(),R.encoding=R.encoding.toLowerCase(),R.ignoreUnknown=L.ignoreUnknown===!0,R.respectType=L.respectType!==!1,R.respectFunctionNames=L.respectFunctionNames!==!1,R.respectFunctionProperties=L.respectFunctionProperties!==!1,R.unorderedArrays=L.unorderedArrays===!0,R.unorderedSets=L.unorderedSets!==!1,R.unorderedObjects=L.unorderedObjects!==!1,R.replacer=L.replacer||void 0,R.excludeKeys=L.excludeKeys||void 0,k===void 0)throw new Error("Object argument required.");for(var U=0;U<_.length;++U)_[U].toLowerCase()===R.algorithm.toLowerCase()&&(R.algorithm=_[U]);if(_.indexOf(R.algorithm)===-1)throw new Error('Algorithm "'+R.algorithm+'" not supported. supported values: '+_.join(", "));if(v.indexOf(R.encoding)===-1&&R.algorithm!=="passthrough")throw new Error('Encoding "'+R.encoding+'" not supported. supported values: '+v.join(", "));return R}function I(k){if(typeof k=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(k))!=null}function M(k,L,R){R=R||[];function U(D){return L.update?L.update(D,"utf8"):L.write(D,"utf8")}return{dispatch:function(D){return this["_"+((D=k.replacer?k.replacer(D):D)===null?"null":typeof D)](D)},_object:function(D){var Z,Y=Object.prototype.toString.call(D),W=/\[object (.*)\]/i.exec(Y);if(W=(W=W?W[1]:"unknown:["+Y+"]").toLowerCase(),0<=(Y=R.indexOf(D)))return this.dispatch("[CIRCULAR:"+Y+"]");if(R.push(D),s!==void 0&&s.isBuffer&&s.isBuffer(D))return U("buffer:"),U(D);if(W==="object"||W==="function"||W==="asyncfunction")return Y=Object.keys(D),k.unorderedObjects&&(Y=Y.sort()),k.respectType===!1||I(D)||Y.splice(0,0,"prototype","__proto__","constructor"),k.excludeKeys&&(Y=Y.filter(function(ce){return!k.excludeKeys(ce)})),U("object:"+Y.length+":"),Z=this,Y.forEach(function(ce){Z.dispatch(ce),U(":"),k.excludeValues||Z.dispatch(D[ce]),U(",")});if(!this["_"+W]){if(k.ignoreUnknown)return U("["+W+"]");throw new Error('Unknown object type "'+W+'"')}this["_"+W](D)},_array:function(D,ce){ce=ce!==void 0?ce:k.unorderedArrays!==!1;var Y=this;if(U("array:"+D.length+":"),!ce||D.length<=1)return D.forEach(function(he){return Y.dispatch(he)});var W=[],ce=D.map(function(he){var ae=new G,ve=R.slice();return M(k,ae,ve).dispatch(he),W=W.concat(ve.slice(R.length)),ae.read().toString()});return R=R.concat(W),ce.sort(),this._array(ce,!1)},_date:function(D){return U("date:"+D.toJSON())},_symbol:function(D){return U("symbol:"+D.toString())},_error:function(D){return U("error:"+D.toString())},_boolean:function(D){return U("bool:"+D.toString())},_string:function(D){U("string:"+D.length+":"),U(D.toString())},_function:function(D){U("fn:"),I(D)?this.dispatch("[native]"):this.dispatch(D.toString()),k.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(D.name)),k.respectFunctionProperties&&this._object(D)},_number:function(D){return U("number:"+D.toString())},_xml:function(D){return U("xml:"+D.toString())},_null:function(){return U("Null")},_undefined:function(){return U("Undefined")},_regexp:function(D){return U("regex:"+D.toString())},_uint8array:function(D){return U("uint8array:"),this.dispatch(Array.prototype.slice.call(D))},_uint8clampedarray:function(D){return U("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(D))},_int8array:function(D){return U("int8array:"),this.dispatch(Array.prototype.slice.call(D))},_uint16array:function(D){return U("uint16array:"),this.dispatch(Array.prototype.slice.call(D))},_int16array:function(D){return U("int16array:"),this.dispatch(Array.prototype.slice.call(D))},_uint32array:function(D){return U("uint32array:"),this.dispatch(Array.prototype.slice.call(D))},_int32array:function(D){return U("int32array:"),this.dispatch(Array.prototype.slice.call(D))},_float32array:function(D){return U("float32array:"),this.dispatch(Array.prototype.slice.call(D))},_float64array:function(D){return U("float64array:"),this.dispatch(Array.prototype.slice.call(D))},_arraybuffer:function(D){return U("arraybuffer:"),this.dispatch(new Uint8Array(D))},_url:function(D){return U("url:"+D.toString())},_map:function(D){return U("map:"),D=Array.from(D),this._array(D,k.unorderedSets!==!1)},_set:function(D){return U("set:"),D=Array.from(D),this._array(D,k.unorderedSets!==!1)},_file:function(D){return U("file:"),this.dispatch([D.name,D.size,D.type,D.lastModfied])},_blob:function(){if(k.ignoreUnknown)return U("[blob]");throw Error(`Hashing Blob objects is currently not supported
|
|
650
|
+
`),{solved:!1,connectionName:e.name}}createObstacleList({dominantLayer:e,connection:t,obstaclesFromTraces:n}){return new GLe(this.allObstacles.filter(r=>!r.connectedTo.includes(t.name)).filter(r=>r.layers.includes(e)).concat(n??[]))}postprocessConnectionSolveResult(e,t){return t}solve(){const e=[],t=[];this.debugTraceCount=0;for(const n of this.input.connections){const r=n.pointsToConnect[0].layer??"top";this.debugTraceCount+=1,this.obstacles=this.createObstacleList({dominantLayer:r,connection:n,obstaclesFromTraces:t});let o=this.solveConnection(n);o=this.postprocessConnectionSolveResult(n,o),e.push(o),yM.enabled&&this.drawDebugTraceObstacles(t),o.solved&&t.push(...OLe(o.route.map(a=>({x:a.x,y:a.y,layer:a.layer??r})),n.name))}return e}solveAndMapToTraces(){return this.solve().flatMap(t=>t.solved?[{type:"pcb_trace",pcb_trace_id:`pcb_trace_for_${t.connectionName}`,route:ojt(t.route.map(n=>({route_type:"wire",x:n.x,y:n.y,width:this.input.minTraceWidth,layer:n.layer})))}]:[])}getDebugGroup(){const e=`t${this.debugTraceCount}_iter[${this.iterations-1}]`;return this.iterations<30||this.iterations<100&&this.iterations%10===0||this.iterations<1e3&&this.iterations%100===0||!this.debugSolutions?e:null}drawDebugTraceObstacles(e){const{debugTraceCount:t,debugSolutions:n}=this;for(const r in n)r.startsWith(`t${t}_`)&&n[r].push(...e.map((o,a)=>({type:"pcb_smtpad",pcb_component_id:"",layer:o.layers[0],width:o.width,shape:"rect",x:o.center.x,y:o.center.y,pcb_smtpad_id:`trace_obstacle_${a}`,height:o.height})))}drawDebugSolution({current:e,newNeighbors:t}){const n=this.getDebugGroup();if(!n)return;const{openSet:r,debugTraceCount:o,debugSolutions:a}=this;a[n]??(a[n]=[]);const s=a[n];s.push({type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:`debug_note_${e.x}_${e.y}`,font:"tscircuit2024",font_size:.25,text:"X"+(e.l!==void 0?e.l:""),pcb_component_id:"",layer:"top",anchor_position:{x:e.x,y:e.y},anchor_alignment:"center"});for(let l=0;l<r.length;l++){const c=r[l];s.push({type:"pcb_fabrication_note_path",pcb_component_id:"",pcb_fabrication_note_path_id:`note_path_${c.x}_${c.y}`,layer:"top",route:[[0,.05],[.05,0],[0,-.05],[-.05,0],[0,.05]].map(([u,d])=>({x:c.x+u,y:c.y+d})),stroke_width:.01}),s.push({type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:`debug_note_${c.x}_${c.y}`,font:"tscircuit2024",font_size:.03,text:l.toString(),pcb_component_id:"",layer:"top",anchor_position:{x:c.x,y:c.y},anchor_alignment:"center"})}if(e.parent){const l=[];let c=e;for(;c;)l.unshift(c),c=c.parent;s.push({type:"pcb_fabrication_note_path",pcb_component_id:"",pcb_fabrication_note_path_id:`note_path_${e.x}_${e.y}`,layer:"top",route:l,stroke_width:.01})}}},sjt=dI("autorouting-dataset:infinite-grid-ijump-astar:get-distance-to-overcome-obstacle");function ice({node:i,travelDir:e,wallDir:t,obstacle:n,obstacles:r,obstaclesInRow:o=0,OBSTACLE_MARGIN:a=.15,SHOULD_DETECT_CONJOINED_OBSTACLES:s=!1,MAX_CONJOINED_OBSTACLES:l=20}){let c;if(e.dx===0?e.dy>0?c=n.center.y+n.height/2-i.y:c=i.y-(n.center.y-n.height/2):e.dx>0?c=n.center.x+n.width/2-i.x:c=i.x-(n.center.x-n.width/2),c+=a,s&&o<l){const u=r.getObstacleAt(i.x+e.dx*c+t.dx*(t.wallDistance+.001),i.y+e.dy*c+t.dy*(t.wallDistance+.001));if(u===n)return c;if(u&&u.type==="rect"){const d=e.dy===0,f=d?n.height:n.width;if((d?u.height:u.width)>f)return sjt("next obstacle on path is bigger, not trying to overcome it"),c;const A=ice({node:{x:i.x+e.dx*c,y:i.y+e.dy*c},travelDir:e,wallDir:t,obstacle:u,obstacles:r,obstaclesInRow:o+1,SHOULD_DETECT_CONJOINED_OBSTACLES:s,MAX_CONJOINED_OBSTACLES:l,OBSTACLE_MARGIN:a});c+=A}}return c}var ljt=class extends HLe{constructor(){super(...arguments);pe(this,"MAX_ITERATIONS",200)}getNeighbors(t){const n=this.obstacles,r=this.goalPoint;let o;t.parent?o=PLe(t.parent,t):o=PLe(t,r);const a=[{dx:0,dy:1},{dx:1,dy:0},{dx:0,dy:-1},{dx:-1,dy:0}].filter(l=>{var c;return l.dx===o.dx*-1&&l.dy===o.dy*-1?!1:!(l.dx===o.dx&&l.dy===o.dy&&((c=t.parent)!=null&&c.obstacleHit))}).map(l=>n.getOrthoDirectionCollisionInfo(t,l,{margin:this.OBSTACLE_MARGIN})).filter(l=>l.wallDistance>=this.OBSTACLE_MARGIN),s=[];for(const l of a){let c=null;t!=null&&t.obstacleHit&&(c=ice({node:t,travelDir:l,wallDir:{...o,wallDistance:this.OBSTACLE_MARGIN},obstacle:t.obstacleHit,obstacles:n,OBSTACLE_MARGIN:this.OBSTACLE_MARGIN,SHOULD_DETECT_CONJOINED_OBSTACLES:!0}));const u=LLe(t,r,l),d=(l.dx===0||Math.sign(r.x-t.x)===l.dx)&&(l.dy===0||Math.sign(r.y-t.y)===l.dy);u<l.wallDistance&&u>0&&d?s.push({...l,travelDistance:u}):c!==null&&c<l.wallDistance?s.push({...l,travelDistance:c}):l.wallDistance!==1/0&&s.push({...l,travelDistance:l.wallDistance-this.OBSTACLE_MARGIN})}return s.filter(l=>!n.isObstacleAt(t.x+l.dx*l.travelDistance,t.y+l.dy*l.travelDistance)).map(l=>({x:t.x+l.dx*l.travelDistance,y:t.y+l.dy*l.travelDistance,obstacleHit:l.obstacle}))}};function cjt(i,e=4){const{center:t,width:n,height:r,rotation:o}=i,a=[],s=o*Math.PI/180,l=Math.cos(s),c=Math.sin(s),u=(o%360+360)%360;if(r<=n?u>=45&&u<135||u>=225&&u<315:u>=135&&u<225||u>=315||u<45){const f=n/e;for(let p=0;p<e;p++){const A=(p-e/2+.5)*f,m=-A*l,_=-A*c,v=f*1.1,x=Math.abs(r*l)+Math.abs(f*c);a.push({center:{x:t.x+m,y:t.y+_},width:v,height:x})}}else{const f=r/e;for(let p=0;p<e;p++){const A=(p-e/2+.5)*f,m=-A*c,_=A*l,v=Math.abs(n*l)+Math.abs(f*c),x=f*1.1;a.push({center:{x:t.x+m,y:t.y+_},width:v,height:x})}}return a}var PH=["top","inner1","inner2","bottom"],YLe=(i,e)=>{const t=r=>e?r.concat(r.map(o=>e==null?void 0:e.getNetConnectedToId(o)).filter(Boolean)):r,n=[];for(const r of i)if(r.type==="pcb_smtpad"){if(r.shape==="circle")n.push({type:"oval",layers:[r.layer],center:{x:r.x,y:r.y},width:r.radius*2,height:r.radius*2,connectedTo:t([r.pcb_smtpad_id])});else if(r.shape==="rect")n.push({type:"rect",layers:[r.layer],center:{x:r.x,y:r.y},width:r.width,height:r.height,connectedTo:t([r.pcb_smtpad_id])});else if(r.shape==="rotated_rect"){const o={center:{x:r.x,y:r.y},width:r.width,height:r.height,rotation:r.ccw_rotation},a=cjt(o);for(const s of a)n.push({type:"rect",layers:[r.layer],center:s.center,width:s.width,height:s.height,connectedTo:t([r.pcb_smtpad_id])})}}else if(r.type==="pcb_keepout")r.shape==="circle"?n.push({type:"oval",layers:r.layers,center:{x:r.center.x,y:r.center.y},width:r.radius*2,height:r.radius*2,connectedTo:[]}):r.shape==="rect"&&n.push({type:"rect",layers:r.layers,center:{x:r.center.x,y:r.center.y},width:r.width,height:r.height,connectedTo:[]});else if(r.type==="pcb_hole")r.hole_shape==="oval"?n.push({type:"oval",center:{x:r.x,y:r.y},width:r.hole_width,height:r.hole_height,connectedTo:[]}):r.hole_shape==="square"?n.push({type:"rect",layers:PH,center:{x:r.x,y:r.y},width:r.hole_diameter,height:r.hole_diameter,connectedTo:[]}):(r.hole_shape==="round"||r.hole_shape==="circle")&&n.push({type:"rect",layers:PH,center:{x:r.x,y:r.y},width:r.hole_diameter,height:r.hole_diameter,connectedTo:[]});else if(r.type==="pcb_plated_hole")r.shape==="circle"?n.push({type:"oval",layers:PH,center:{x:r.x,y:r.y},width:r.outer_diameter,height:r.outer_diameter,connectedTo:t([r.pcb_plated_hole_id])}):(r.shape==="oval"||r.shape==="pill")&&n.push({type:"oval",layers:PH,center:{x:r.x,y:r.y},width:r.outer_width,height:r.outer_height,connectedTo:t([r.pcb_plated_hole_id])});else if(r.type==="pcb_trace"){const o=OLe(r.route.map(a=>({x:a.x,y:a.y,layer:"layer"in a?a.layer:a.from_layer})),r.source_trace_id);n.push(...o)}else r.type==="pcb_via"&&n.push({type:"rect",layers:r.layers,center:{x:r.x,y:r.y},connectedTo:[],width:r.outer_diameter,height:r.outer_diameter});return n};function VLe(i){const{pcbConnMap:e,goalElementId:t}=i;if(!t.startsWith("pcb_port_"))throw new Error(`Currently alternative goal boxes must have a goal id with prefix "pcb_port_" (got ${t})`);const n=e.getAllTracesConnectedToPort(t);return YLe(n).map(r=>({...r,connectedTo:[t]}))}var jLe=i=>{let{connection:e,pcbConnMap:t}=i;if(e.pointsToConnect.length!==2)throw new Error(`Connection must have exactly 2 points for alternative goal boxes (got ${e.pointsToConnect.length})`);const[n,r]=e.pointsToConnect;if(!n.pcb_port_id||!r.pcb_port_id)throw new Error(`Connection points must have pcb_port_id for alternative goal box calculation (got ${n.pcb_port_id} and ${r.pcb_port_id})`);const o=VLe({goalElementId:n.pcb_port_id,pcbConnMap:t}).concat([{center:n,width:.01,height:.01,connectedTo:[n.pcb_port_id],layers:[n.layer],type:"rect"}]),a=VLe({goalElementId:r.pcb_port_id,pcbConnMap:t}).concat([{center:r,width:.01,height:.01,connectedTo:[r.pcb_port_id],layers:[r.layer],type:"rect"}]);if(o.length<=1&&a.length<=1)return{...e,startPoint:n,endPoint:r,goalBoxes:[]};const s=njt(o,a);let l,c,u;return o.length>=a.length?(l={...r,...s.pointB},c={...n,...s.pointA},u=o):(l={...n,...s.pointA},c={...r,...s.pointB},u=a),{startPoint:l,endPoint:c,goalBoxes:u,name:e.name,pointsToConnect:[l,c]}},ujt=(i,e={})=>{const t={minTraceWidth:.1};t.layerCount=e.layerCount??1,t.obstacles=YLe(i,e.connMap),t.connections=[];for(const r of i)if(r.type==="source_trace"){if(i.some(s=>s.type==="pcb_trace"&&s.source_trace_id===r.source_trace_id))continue;let a={name:r.source_trace_id,pointsToConnect:r.connected_source_port_ids.map(s=>{var c;const l=AM(i).pcb_port.getWhere({source_port_id:s});if(!l)throw new Error(`Could not find pcb_port for source_port_id "${s}"`);return{x:l.x,y:l.y,layer:((c=l.layers)==null?void 0:c[0])??"top",pcb_port_id:l.pcb_port_id}})};if(e.optimizeWithGoalBoxes){const s=new TLe(i);a=jLe({connection:a,pcbConnMap:s})}t.connections.push(a),djt(t.obstacles,a.pointsToConnect,a.name)}const n={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(const r of t.obstacles)n.minX=Math.min(n.minX,r.center.x-r.width/2),n.maxX=Math.max(n.maxX,r.center.x+r.width/2),n.minY=Math.min(n.minY,r.center.y-r.height/2),n.maxY=Math.max(n.maxY,r.center.y+r.height/2);for(const r of t.connections)for(const o of r.pointsToConnect)n.minX=Math.min(n.minX,o.x),n.maxX=Math.max(n.maxX,o.x),n.minY=Math.min(n.minY,o.y),n.maxY=Math.max(n.maxY,o.y);return t.bounds=n,t},djt=(i,e,t)=>{for(const n of e)for(const r of i)fjt(n,r)&&r.connectedTo.push(t)};function fjt(i,e){const t=e.width/2,n=e.height/2;if(e.type==="rect")return i.x>=e.center.x-t&&i.x<=e.center.x+t&&i.y>=e.center.y-n&&i.y<=e.center.y+n;if(e.type==="oval"){const r=(i.x-e.center.x)/t,o=(i.y-e.center.y)/n;return r*r+o*o<=1}return!1}function KLe(i,e){const t=e.x>i.x?1:e.x<i.x?-1:0,n=e.y>i.y?1:e.y<i.y?-1:0,r=e.l>i.l?1:e.l<i.l?-1:0;return{dx:t,dy:n,dl:r}}var rce={1:["top"],2:["top","bottom"],4:["top","inner1","inner2","bottom"]},hjt=i=>rce[i];function XLe(i,e){const n=rce[i].indexOf(e);if(n===-1)throw new Error(`Invalid layer for getLayerIndex (for layerCount === ${i}): "${e}"`);return n}function pjt(i,e){const n=rce[i][e];if(!n)throw new Error(`Invalid index for indexToLayer (for layerCount === ${i}): "${e}"`);return n}var Ajt=class extends GLe{constructor(t,n){super([]);pe(this,"obstacles");pe(this,"GRID_STEP",.1);pe(this,"layerCount");this.layerCount=t;const r=hjt(t);this.obstacles=n.flatMap(o=>o.layers.filter(a=>r.includes(a)).map(a=>({...o,left:o.center.x-o.width/2,right:o.center.x+o.width/2,top:o.center.y+o.height/2,bottom:o.center.y-o.height/2,l:XLe(t,a)})))}getObstacleAt(t,n,r,o){o??(o=this.GRID_STEP);for(const a of this.obstacles){if(a.l!==r)continue;const s=a.width/2+o,l=a.height/2+o;if(t>=a.center.x-s&&t<=a.center.x+s&&n>=a.center.y-l&&n<=a.center.y+l)return a}return null}isObstacleAt(t,n,r,o){return this.getObstacleAt(t,n,r,o)!==null}getDirectionDistancesToNearestObstacle3d(t,n,r){const{GRID_STEP:o}=this,a={left:1/0,top:1/0,bottom:1/0,right:1/0};for(const s of this.obstacles)if(s.l===r&&s.type==="rect"){const l=s.center.x-s.width/2-o,c=s.center.x+s.width/2+o,u=s.center.y+s.height/2+o,d=s.center.y-s.height/2-o;n>=d&&n<=u&&t>l&&(a.left=Math.min(a.left,t-c)),n>=d&&n<=u&&t<c&&(a.right=Math.min(a.right,l-t)),t>=l&&t<=c&&n<u&&(a.top=Math.min(a.top,d-n)),t>=l&&t<=c&&n>d&&(a.bottom=Math.min(a.bottom,n-u))}return a}getOrthoDirectionCollisionInfo(t,n,{margin:r=0}={}){const{x:o,y:a,l:s}=t,{dx:l,dy:c,dl:u}=n;let d=1/0,f=null;if(u!==0){const p=s+u;return this.isObstacleAt(o,a,p,r)?(d=1,f=this.getObstacleAt(o,a,p,r)):d=1,{dx:l,dy:c,dl:u,wallDistance:d,obstacle:f}}else{for(const p of this.obstacles){if(p.l!==s)continue;const A=p.left-r,m=p.right+r,_=p.top+r,v=p.bottom-r;let x=null;l===1&&c===0?a>v&&a<_&&o<p.left&&(x=p.left-o):l===-1&&c===0?a>v&&a<_&&o>p.right&&(x=o-p.right):l===0&&c===1?o>A&&o<m&&a<p.bottom&&(x=p.bottom-a):l===0&&c===-1&&o>A&&o<m&&a>p.top&&(x=a-p.top),x!==null&&x<d&&(d=x,f=p)}return{dx:l,dy:c,dl:0,wallDistance:d,obstacle:f}}}getObstaclesOverlappingRegion(t){const n=[];for(const r of this.obstacles){if(r.l!==t.l)continue;const{left:o,right:a,top:s,bottom:l}=r;o<=t.maxX&&a>=t.minX&&s>=t.minY&&l<=t.maxY&&n.push(r)}return n}},qLe=class extends HLe{constructor(t){super(t);pe(this,"MAX_ITERATIONS",500);pe(this,"VIA_COST",4);pe(this,"VIA_DIAMETER",.5);pe(this,"allowLayerChange",!0);pe(this,"layerCount");pe(this,"obstacles");pe(this,"optimizeWithGoalBoxes");pe(this,"connMap");pe(this,"pcbConnMap");pe(this,"GOAL_RUSH_FACTOR",1.1);pe(this,"defaultGoalViaMargin",.5);pe(this,"marginsWithCosts");this.layerCount=t.input.layerCount??2,this.MAX_ITERATIONS=t.MAX_ITERATIONS??this.MAX_ITERATIONS,this.VIA_COST=t.VIA_COST??this.VIA_COST,this.connMap=t.connMap,this.pcbConnMap=t.pcbConnMap??new TLe,this.optimizeWithGoalBoxes=t.optimizeWithGoalBoxes??!1,this.obstacles=null,this.marginsWithCosts=t.marginsWithCosts??[{margin:1,enterCost:0,travelCostFactor:1},{margin:this.OBSTACLE_MARGIN,enterCost:10,travelCostFactor:2}]}get largestMargin(){return this.marginsWithCosts[0].margin}preprocessConnectionBeforeSolving(t){return this.optimizeWithGoalBoxes?jLe({connection:t,pcbConnMap:this.pcbConnMap}):t}postprocessConnectionSolveResult(t,n){if(!n.solved)return n;if(this.optimizeWithGoalBoxes){const r=n.route.map(o=>({x:o.x,y:o.y,route_type:"wire",layer:o.layer,width:this.input.minTraceWidth}));r[0].start_pcb_port_id=t.pointsToConnect[0].pcb_port_id,r[r.length-1].end_pcb_port_id=t.pointsToConnect[1].pcb_port_id,this.pcbConnMap.addTrace({type:"pcb_trace",pcb_trace_id:`postprocess_trace_${Vre(8)}`,route:r})}return n}createObstacleList({dominantLayer:t,connection:n,obstaclesFromTraces:r}){const o=this.connMap?this.connMap.getNetConnectedToId(n.name):n.name;if(!o)throw new Error(`The connection.name "${n.name}" wasn't present in the full connectivity map`);return new Ajt(this.layerCount,this.allObstacles.filter(a=>!a.connectedTo.includes(o)).concat(r??[]))}computeG(t,n){let r=t.g+mM(t,n)*(t.travelMarginCostFactor??1)+(n.enterMarginCost??0);return(n.l??t.l!==-1??-1)&&(r+=this.VIA_COST),r}computeH(t){const n=Math.abs(t.x-this.goalPoint.x),r=Math.abs(t.y-this.goalPoint.y),o=Math.abs(t.l-this.goalPoint.l);return(n+r)**this.GOAL_RUSH_FACTOR+o*this.VIA_COST}getStartNode(t){return{...super.getStartNode(t),l:this.layerToIndex(t.pointsToConnect[0].layer)}}layerToIndex(t){return XLe(this.layerCount,t)}indexToLayer(t){return pjt(this.layerCount,t)}getNodeName(t){return`${FLe(t,this.GRID_STEP)}-${t.l??0}`}hasSpaceForVia(t,n){return t.every(r=>this.obstacles.getObstaclesOverlappingRegion({minX:n.x-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,minY:n.y-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,maxX:n.x+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,maxY:n.y+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,l:r}).length===0)}getNeighborsSurroundingGoal(t){this.obstacles;const n=this.goalPoint,r=[],o=[{dx:1,dy:0,dl:0},{dx:-1,dy:0,dl:0},{dx:0,dy:1,dl:0},{dx:0,dy:-1,dl:0}],a=this.VIA_DIAMETER+this.OBSTACLE_MARGIN+this.defaultGoalViaMargin;for(const s of o){const l={x:t.x+s.dx*a,y:t.y+s.dy*a,l:t.l+s.dl,obstacleHit:null};this.hasSpaceForVia([t.l,n.l],l)&&r.push(l)}return r}getNeighbors(t){const n=this.obstacles,r=this.goalPoint,o=mM(t,r);if(o<=this.OBSTACLE_MARGIN)return this.getNeighborsSurroundingGoal(t);let a;t.parent?a=KLe(t.parent,t):a=KLe(t,r);const s=[{dx:0,dy:1,dl:0},{dx:1,dy:0,dl:0},{dx:0,dy:-1,dl:0},{dx:-1,dy:0,dl:0}],l=o>this.VIA_DIAMETER+this.OBSTACLE_MARGIN,c=mM(t,this.startNode)>this.VIA_DIAMETER+this.OBSTACLE_MARGIN;this.allowLayerChange&&l&&c&&(t.l<this.layerCount-1&&s.push({dx:0,dy:0,dl:1}),t.l>0&&s.push({dx:0,dy:0,dl:-1}));const u=s.filter(f=>{var p;return f.dx===a.dx*-1&&f.dy===a.dy*-1&&f.dl===a.dl*-1?!1:!(f.dx===a.dx&&f.dy===a.dy&&f.dl===a.dl&&((p=t.parent)!=null&&p.obstacleHit))}).map(f=>n.getOrthoDirectionCollisionInfo(t,f,{margin:this.OBSTACLE_MARGIN})).filter(f=>!(f.wallDistance<this.OBSTACLE_MARGIN)),d=[];for(const f of u){const p=f.dx===0&&f.dy===0&&f.dl===1,A=f.dx===0&&f.dy===0&&f.dl===-1;if((p||A)&&![t.l,t.l+f.dl].every(I=>n.getObstaclesOverlappingRegion({minX:t.x-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,minY:t.y-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,maxX:t.x+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,maxY:t.y+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,l:I}).length===0))continue;if(p){t.l<this.layerCount-1&&d.push({...f,travelDistance:0,enterMarginCost:0,travelMarginCostFactor:1});continue}if(A){t.l>0&&d.push({...f,travelDistance:0,enterMarginCost:0,travelMarginCostFactor:1});continue}let m=null;t!=null&&t.obstacleHit&&(m=ice({node:t,travelDir:f,wallDir:{...a,wallDistance:this.OBSTACLE_MARGIN},obstacle:t.obstacleHit,obstacles:n,OBSTACLE_MARGIN:this.OBSTACLE_MARGIN,SHOULD_DETECT_CONJOINED_OBSTACLES:!0}));const _=LLe(t,r,f),v=(f.dx===0||Math.sign(r.x-t.x)===f.dx)&&(f.dy===0||Math.sign(r.y-t.y)===f.dy);if(_<f.wallDistance&&_>0&&v){const x=t.l===r.l;let I=0;!x&&Math.abs(_-o)<this.GRID_STEP&&(I=this.VIA_DIAMETER+this.OBSTACLE_MARGIN+this.defaultGoalViaMargin),d.push({...f,travelDistance:_-I,enterMarginCost:0,travelMarginCostFactor:1})}else if(m!==null&&m<f.wallDistance){for(const{margin:x,enterCost:I,travelCostFactor:M}of this.marginsWithCosts)m-this.OBSTACLE_MARGIN+x*2<f.wallDistance&&d.push({...f,travelDistance:m-this.OBSTACLE_MARGIN+x,enterMarginCost:I,travelMarginCostFactor:M});if(f.wallDistance===1/0)d.push({...f,travelDistance:_,enterMarginCost:0,travelMarginCostFactor:1});else if(f.wallDistance>this.largestMargin)for(const{margin:x,enterCost:I,travelCostFactor:M}of this.marginsWithCosts)f.wallDistance>this.largestMargin+x&&d.push({...f,travelDistance:f.wallDistance-x,enterMarginCost:I,travelMarginCostFactor:M})}else if(f.wallDistance!==1/0)for(const{margin:x,enterCost:I,travelCostFactor:M}of this.marginsWithCosts)f.wallDistance>x&&d.push({...f,travelDistance:f.wallDistance-x,enterMarginCost:I,travelMarginCostFactor:M})}return d.map(f=>({x:t.x+f.dx*f.travelDistance,y:t.y+f.dy*f.travelDistance,l:t.l+f.dl,obstacleHit:f.obstacle,travelMarginCostFactor:f.travelMarginCostFactor,enterMarginCost:f.enterMarginCost}))}};function gjt(i){const e=ujt(i),t=new ljt({input:e});return{solution:t.solveAndMapToTraces(),debugSolutions:t.debugSolutions,debugMessage:t.debugMessage}}var mjt=aa(["up","down","left","right"]);aa(["top-to-bottom","left-to-right","bottom-to-top","right-to-left"]);var $3=ji(ye().or(mn())),JLe=Wt({x:Nr,y:Nr,z:Nr}),yjt=Wt({x:Ul([mn(),ye()]),y:Ul([mn(),ye()]),z:Ul([mn(),ye()])}),oce=Wt({rotationOffset:mn().or(yjt).optional(),positionOffset:JLe.optional(),size:JLe.optional()}),_jt=oce.extend({stlUrl:ye()}),vjt=oce.extend({objUrl:ye(),mtlUrl:ye().optional()}),xjt=oce.extend({jscad:Tm(yv())}),Ijt=Ul([yDe(),ye(),_jt,vjt,xjt]),bjt=YI(i=>!0),Nx=Wt({pcbX:Nr.optional(),pcbY:Nr.optional(),pcbRotation:ZC.optional(),layer:u1.optional(),pcbRelative:ar().optional(),relative:ar().optional()}),LH=Wt({pcbX:Nr.optional(),pcbY:Nr.optional(),pcbRotation:ZC.optional(),schX:Nr.optional(),schY:Nr.optional(),schRotation:ZC.optional(),layer:u1.optional(),footprint:bjt.optional(),relative:ar().optional(),schRelative:ar().optional(),pcbRelative:ar().optional()}),Cjt=Wt({supplierPartNumbers:Tm(MG,ji(ye())).optional()}),Ejt=Wt({providesPower:ar().optional(),requiresPower:ar().optional(),providesGround:ar().optional(),requiresGround:ar().optional(),providesVoltage:Ul([ye(),mn()]).optional(),requiresVoltage:Ul([ye(),mn()]).optional()}),Qb=LH.merge(Cjt).extend({key:yv().optional(),name:ye(),cadModel:Ijt.optional(),children:yv().optional(),symbolName:ye().optional(),doNotPlace:ar().optional(),pinAttributes:Tm(ye(),Ejt).optional()}),Sjt=["pin1","left","anode","pos","pin2","right","cathode","neg"];Nr.or(aa(["2x","3x","4x"]));var cB=aa(["vertical","horizontal","pos_top","pos_bottom","pos_left","pos_right","neg_top","neg_bottom","neg_left","neg_right"]).describe("horizontal means pins go 1->2 rightward and vertical means pins go 1->2 downward (generally, positive on top)"),FH=Wt({pins:ji(Ul([mn(),ye()])),direction:Ul([Yt("top-to-bottom"),Yt("left-to-right"),Yt("bottom-to-top"),Yt("right-to-left")])}),IT=Wt({leftSize:mn().optional().describe("@deprecated, use leftPinCount"),topSize:mn().optional().describe("@deprecated, use topPinCount"),rightSize:mn().optional().describe("@deprecated, use rightPinCount"),bottomSize:mn().optional().describe("@deprecated, use bottomPinCount"),leftPinCount:mn().optional(),rightPinCount:mn().optional(),topPinCount:mn().optional(),bottomPinCount:mn().optional(),leftSide:FH.optional(),rightSide:FH.optional(),topSide:FH.optional(),bottomSide:FH.optional()}),wjt=IT,UH=Tm(Wt({marginLeft:Nr.optional(),marginRight:Nr.optional(),marginTop:Nr.optional(),marginBottom:Nr.optional(),leftMargin:Nr.optional(),rightMargin:Nr.optional(),topMargin:Nr.optional(),bottomMargin:Nr.optional()})),a3=ye().regex(/^[A-Za-z0-9_]+$/),OH=Wt({x:Nr,y:Nr}),bT=Wt({edit_event_id:ye(),in_progress:ar().optional(),created_at:mn()}),Bjt=bT.extend({pcb_edit_event_type:Yt("edit_component_location").describe("deprecated"),edit_event_type:Yt("edit_pcb_component_location"),pcb_component_id:ye(),original_center:Wt({x:mn(),y:mn()}),new_center:Wt({x:mn(),y:mn()})}),Mjt=bT.extend({pcb_edit_event_type:Yt("edit_trace_hint").describe("deprecated"),edit_event_type:Yt("edit_pcb_trace_hint").optional(),pcb_port_id:ye(),pcb_trace_hint_id:ye().optional(),route:ji(Wt({x:mn(),y:mn(),via:ar().optional()}))}),Rjt=bT.extend({edit_event_type:Yt("edit_schematic_component_location"),schematic_component_id:ye(),original_center:Wt({x:mn(),y:mn()}),new_center:Wt({x:mn(),y:mn()})});bT.extend({edit_event_type:Yt("edit_pcb_group_location"),pcb_group_id:ye(),original_center:Wt({x:mn(),y:mn()}),new_center:Wt({x:mn(),y:mn()})}),bT.extend({edit_event_type:Yt("edit_schematic_group_location"),schematic_group_id:ye(),original_center:Wt({x:mn(),y:mn()}),new_center:Wt({x:mn(),y:mn()})}),Ul([Bjt,Mjt,Rjt]);var Qjt=Wt({selector:ye(),relative_to:ye().optional().default("group_center").describe("Can be a selector or 'group_center'"),center:$_}),Djt=Wt({pcb_port_selector:ye(),offsets:ji(v4)}),Njt=Wt({selector:ye(),relative_to:ye().optional().default("group_center").describe("Can be a selector or 'group_center'"),center:$_}),Tjt=Wt({pcb_placements:ji(Qjt).optional(),manual_trace_hints:ji(Djt).optional(),schematic_placements:ji(Njt).optional()}),CT=Wt({layoutMode:aa(["grid","flex","match-adapt","relative","none"]).optional(),position:aa(["absolute","relative"]).optional(),grid:ar().optional(),gridCols:mn().or(ye()).optional(),gridRows:mn().or(ye()).optional(),gridTemplateRows:ye().optional(),gridTemplateColumns:ye().optional(),gridTemplate:ye().optional(),gridGap:mn().or(ye()).optional(),gridRowGap:mn().or(ye()).optional(),gridColumnGap:mn().or(ye()).optional(),flex:ar().or(ye()).optional(),flexDirection:aa(["row","column"]).optional(),alignItems:aa(["start","center","end","stretch"]).optional(),justifyContent:aa(["start","center","end","stretch","space-between","space-around","space-evenly"]).optional(),flexRow:ar().optional(),flexColumn:ar().optional(),gap:mn().or(ye()).optional(),pack:ar().optional().describe("Pack the contents of this group using a packing strategy"),packOrderStrategy:aa(["largest_to_smallest","first_to_last","highest_to_lowest_pin_count"]).optional(),packPlacementStrategy:aa(["shortest_connection_along_outline"]).optional(),padding:On.optional(),paddingLeft:On.optional(),paddingRight:On.optional(),paddingTop:On.optional(),paddingBottom:On.optional(),paddingX:On.optional(),paddingY:On.optional(),width:On.optional(),height:On.optional(),matchAdapt:ar().optional(),matchAdaptTemplate:yv().optional()}),ZLe=Wt({strokeWidth:On.optional(),dashed:ar().optional(),solid:ar().optional()}),kjt=Wt({serverUrl:ye().optional(),inputFormat:aa(["simplified","circuit-json"]).optional(),serverMode:aa(["job","solve-endpoint"]).optional(),serverCacheEnabled:ar().optional(),cache:YI(i=>!0).optional(),traceClearance:On.optional(),groupMode:aa(["sequential-trace","subcircuit"]).optional(),algorithmFn:YI(i=>typeof i=="function"||i===void 0).optional(),preset:aa(["sequential-trace","subcircuit","auto","auto-local","auto-cloud"]).optional(),local:ar().optional()}),WLe=Ul([kjt,Yt("sequential-trace"),Yt("subcircuit"),Yt("auto"),Yt("auto-local"),Yt("auto-cloud")]),$Le=LH.extend({name:ye().optional(),children:yv().optional(),schTitle:ye().optional(),key:yv().optional(),...CT.shape,grid:CT.shape.grid.describe("@deprecated use pcbGrid"),flex:CT.shape.flex.describe("@deprecated use pcbFlex"),pcbGrid:ar().optional(),pcbGridCols:mn().or(ye()).optional(),pcbGridRows:mn().or(ye()).optional(),pcbGridTemplateRows:ye().optional(),pcbGridTemplateColumns:ye().optional(),pcbGridTemplate:ye().optional(),pcbGridGap:mn().or(ye()).optional(),pcbGridRowGap:mn().or(ye()).optional(),pcbGridColumnGap:mn().or(ye()).optional(),pcbFlex:ar().or(ye()).optional(),pcbFlexGap:mn().or(ye()).optional(),pcbFlexDirection:aa(["row","column"]).optional(),pcbAlignItems:aa(["start","center","end","stretch"]).optional(),pcbJustifyContent:aa(["start","center","end","stretch","space-between","space-around","space-evenly"]).optional(),pcbFlexRow:ar().optional(),pcbFlexColumn:ar().optional(),pcbGap:mn().or(ye()).optional(),pcbPack:ar().optional(),pcbWidth:On.optional(),pcbHeight:On.optional(),schWidth:On.optional(),schHeight:On.optional(),pcbLayout:CT.optional(),schLayout:CT.optional(),cellBorder:ZLe.nullable().optional(),border:ZLe.nullable().optional(),schPadding:On.optional(),schPaddingLeft:On.optional(),schPaddingRight:On.optional(),schPaddingTop:On.optional(),schPaddingBottom:On.optional()}),eFe=YI(i=>"findPart"in i),ace=$Le.extend({manualEdits:Tjt.optional(),schAutoLayoutEnabled:ar().optional(),schTraceAutoLabelEnabled:ar().optional(),routingDisabled:ar().optional(),defaultTraceWidth:On.optional(),minTraceWidth:On.optional(),partsEngine:eFe.optional(),pcbRouteCache:YI(i=>!0).optional(),autorouter:WLe.optional(),square:ar().optional(),emptyArea:ye().optional(),filledArea:ye().optional(),width:Nr.optional(),height:Nr.optional(),outline:ji(OH).optional(),outlineOffsetX:Nr.optional(),outlineOffsetY:Nr.optional()}),Pjt=ace.extend({subcircuit:Yt(!0)}),Ljt=lC("subcircuit",[$Le.extend({subcircuit:Yt(!1).optional()}),Pjt]),tFe=ace.extend({material:aa(["fr4","fr1"]).default("fr4"),layers:Ul([Yt(2),Yt(4)]).default(2)});ace.extend({padding:Nr.optional(),paddingLeft:Nr.optional(),paddingRight:Nr.optional(),paddingTop:Nr.optional(),paddingBottom:Nr.optional()});var Fjt=ye().or(ji(ye()).readonly()).or(ji(ye())),Ujt=YI().pipe(Tm(ye(),Fjt)),Ojt=Tm(a3,a3.or(ji(a3).readonly()).or(ji(a3))),Gjt=Wt({manufacturerPartNumber:ye().optional(),supplierPartNumber:Tm(MG,ji(ye())).optional()}),nFe=Qb.extend({manufacturerPartNumber:ye().optional(),pinLabels:Ojt.optional(),showPinAliases:ar().optional(),pcbPinLabels:Tm(ye(),ye()).optional(),internallyConnectedPins:ji(ji(ye())).optional(),externallyConnectedPins:ji(ji(ye())).optional(),schPinArrangement:IT.optional(),schPortArrangement:IT.optional(),pinCompatibleVariants:ji(Gjt).optional(),schPinStyle:UH.optional(),schPinSpacing:Nr.optional(),schWidth:Nr.optional(),schHeight:Nr.optional(),noSchematicRepresentation:ar().optional(),connections:Ujt.optional()}),sce=ye().or(ji(ye()).readonly()).or(ji(ye())),GH=i=>Tm(aa(i),sce),iFe=Qb.extend({manufacturerPartNumber:ye().optional(),pinLabels:Tm(mn().or(a3),a3.or(ji(a3))).optional(),schPinStyle:UH.optional(),schPinSpacing:Nr.optional(),schWidth:Nr.optional(),schHeight:Nr.optional(),schDirection:aa(["left","right"]).optional(),schPortArrangement:IT.optional(),pcbPinLabels:Tm(ye(),ye()).optional(),pinCount:Ul([Yt(2),Yt(3)]).optional(),internallyConnectedPins:ji(ji(ye())).optional(),connections:YI().pipe(Tm(ye(),sce)).optional()}),zjt=iFe.extend({bridgedPins:ji(ji(ye())).optional(),bridged:ar().optional()});Qb.extend({manufacturerPartNumber:ye().optional(),pinLabels:Tm(mn().or(a3),a3.or(ji(a3))).optional(),schPinStyle:UH.optional(),schPinSpacing:Nr.optional(),schWidth:Nr.optional(),schHeight:Nr.optional(),schDirection:aa(["left","right"]).optional(),schPortArrangement:IT.optional(),internallyConnectedPins:ji(ji(ye())).optional(),standard:aa(["usb_c","m2"]).optional()});var Hjt=Qb.extend({currentRating:Ul([mn(),ye()]),voltageRating:Ul([mn(),ye()]).optional(),schShowRatings:ar().optional(),schOrientation:cB.optional(),connections:Tm(ye(),Ul([ye(),ji(ye()).readonly(),ji(ye())])).optional()}),zH=YI().transform(i=>{if(i!==void 0)return Nr.parse(i)}),Yjt=lC("shape",[Nx.omit({pcbRotation:!0,layer:!0}).extend({name:ye().optional(),connectsTo:ye().or(ji(ye())).optional(),shape:Yt("circle"),holeDiameter:Nr,outerDiameter:Nr,portHints:$3.optional()}),Nx.omit({pcbRotation:!0,layer:!0}).extend({name:ye().optional(),connectsTo:ye().or(ji(ye())).optional(),shape:Yt("oval"),outerWidth:Nr,outerHeight:Nr,holeWidth:zH,holeHeight:zH,innerWidth:Nr.optional().describe("DEPRECATED use holeWidth"),innerHeight:Nr.optional().describe("DEPRECATED use holeHeight"),portHints:$3.optional()}),Nx.omit({layer:!0}).extend({name:ye().optional(),connectsTo:ye().or(ji(ye())).optional(),shape:Yt("pill"),rectPad:ar().optional(),outerWidth:Nr,outerHeight:Nr,holeWidth:zH,holeHeight:zH,innerWidth:Nr.optional().describe("DEPRECATED use holeWidth"),innerHeight:Nr.optional().describe("DEPRECATED use holeHeight"),portHints:$3.optional()}),Nx.omit({pcbRotation:!0,layer:!0}).extend({name:ye().optional(),connectsTo:ye().or(ji(ye())).optional(),shape:Yt("circular_hole_with_rect_pad"),holeDiameter:Nr,rectPadWidth:Nr,rectPadHeight:Nr,holeShape:Yt("circle").optional(),padShape:Yt("rect").optional(),portHints:$3.optional()}),Nx.omit({pcbRotation:!0,layer:!0}).extend({name:ye().optional(),connectsTo:ye().or(ji(ye())).optional(),shape:Yt("pill_hole_with_rect_pad"),holeShape:Yt("pill"),padShape:Yt("rect"),holeWidth:Nr,holeHeight:Nr,rectPadWidth:Nr,rectPadHeight:Nr,portHints:$3.optional()})]).refine(i=>("innerWidth"in i&&i.innerWidth!==void 0&&(i.holeWidth??(i.holeWidth=i.innerWidth)),"innerHeight"in i&&i.innerHeight!==void 0&&(i.holeHeight??(i.holeHeight=i.innerHeight)),i)),Vjt=["pin1","pin2","pos","neg"],jjt=Qb.extend({resistance:WR,pullupFor:ye().optional(),pullupTo:ye().optional(),pulldownFor:ye().optional(),pulldownTo:ye().optional(),schOrientation:cB.optional(),connections:GH(Vjt).optional()}),Kjt=Qb.extend({maxResistance:WR,pinVariant:aa(["two_pin","three_pin"]).optional()}),Xjt=Qb.extend({frequency:wG,loadCapacitance:$R,pinVariant:aa(["two_pin","four_pin"]).optional(),schOrientation:cB.optional()}),qjt=Qb.extend({frequency:wG,loadCapacitance:$R,pinVariant:aa(["no_ground","ground_pin","two_ground_pins"]).optional()});tFe.extend({leftPinCount:mn().optional(),rightPinCount:mn().optional(),topPinCount:mn().optional(),bottomPinCount:mn().optional(),leftPins:ji(ye()).optional(),rightPins:ji(ye()).optional(),topPins:ji(ye()).optional(),bottomPins:ji(ye()).optional(),pinPitch:Nr.optional(),innerHoles:ar().optional()});var Jjt=["pin1","pin2","pos","neg","anode","cathode"],Zjt=Qb.extend({capacitance:$R,maxVoltageRating:hM.optional(),schShowRatings:ar().optional().default(!1),polarized:ar().optional().default(!1),decouplingFor:ye().optional(),decouplingTo:ye().optional(),bypassFor:ye().optional(),bypassTo:ye().optional(),maxDecouplingTraceLength:mn().optional(),schOrientation:cB.optional(),connections:GH(Jjt).optional()});Wt({name:ye(),connectsTo:ye().or(ji(ye())).optional()}),Wt({name:ye().optional(),pcbOnly:ar().optional(),schOnly:ar().optional()});var Wjt=Wt({pcb:Yt(!0).optional(),xDist:Nr,left:ye(),right:ye(),edgeToEdge:Yt(!0).optional(),centerToCenter:Yt(!0).optional()}),$jt=Wt({pcb:Yt(!0).optional(),yDist:Nr,top:ye(),bottom:ye(),edgeToEdge:Yt(!0).optional(),centerToCenter:Yt(!0).optional()}),eKt=Wt({pcb:Yt(!0).optional(),sameY:Yt(!0).optional(),for:ji(ye())}),tKt=Wt({pcb:Yt(!0).optional(),sameX:Yt(!0).optional(),for:ji(ye())}),nKt=Ul([Wjt,$jt,eKt,tKt]),iKt=Nx.omit({layer:!0,pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("rect"),width:Nr,height:Nr}),rKt=Nx.omit({layer:!0,pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("circle"),radius:Nr}),oKt=Nx.omit({layer:!0,pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("polygon"),points:ji(OH)}),aKt=lC("shape",[iKt,rKt,oKt]),sKt=Nx.omit({pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("rect"),width:Nr,height:Nr,portHints:$3.optional()}),lKt=Nx.omit({pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("rotated_rect"),width:Nr,height:Nr,ccwRotation:mn(),portHints:$3.optional()}),cKt=Nx.omit({pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("circle"),radius:Nr,portHints:$3.optional()}),uKt=Nx.omit({pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("pill"),width:Nr,height:Nr,radius:Nr,portHints:$3.optional()}),dKt=Nx.omit({pcbRotation:!0}).extend({name:ye().optional(),shape:Yt("polygon"),points:ji(OH),portHints:$3.optional()}),fKt=lC("shape",[cKt,sKt,lKt,uKt,dKt]),hKt=Nx.omit({pcbRotation:!0}).extend({shape:Yt("rect"),width:Nr,height:Nr}),pKt=Nx.omit({pcbRotation:!0}).extend({shape:Yt("circle"),radius:Nr});Ul([pKt,hKt]);var AKt=Nx.omit({pcbRotation:!0}).extend({name:ye().optional(),diameter:Nr.optional(),radius:Nr.optional()}).transform(i=>({...i,diameter:i.diameter??2*i.radius,radius:i.radius??i.diameter/2})),lce=Ul([ye(),YI(i=>!!i.getPortSelector)]),rFe=Wt({key:ye().optional(),thickness:Nr.optional(),schematicRouteHints:ji(OH).optional(),pcbRouteHints:ji(v4).optional(),schDisplayLabel:ye().optional(),maxLength:Nr.optional()}),gKt=Ul([rFe.extend({path:ji(lce)}),rFe.extend({from:lce,to:lce})]),mKt=Wt({originalLayer:u1.default("top").optional()}),yKt=mn().or(ye().endsWith("mAh")).transform(i=>{if(typeof i=="string"){const e=i.replace("mAh",""),t=Number.parseFloat(e);if(Number.isNaN(t))throw new Error("Invalid capacity");return t}return i}).describe("Battery capacity in mAh"),_Kt=Qb.extend({capacity:yKt.optional(),schOrientation:cB.optional()}),vKt=Qb.extend({pinCount:mn(),pitch:Nr.optional(),schFacingDirection:aa(["up","down","left","right"]).optional(),gender:aa(["male","female","unpopulated"]).optional().default("male"),showSilkscreenPinLabels:ar().optional(),pcbPinLabels:Tm(ye(),ye()).optional(),doubleRow:ar().optional(),rightAngle:ar().optional(),holeDiameter:Nr.optional(),platedDiameter:Nr.optional(),pinLabels:ji(a3).optional(),connections:YI().pipe(Tm(ye(),sce)).optional(),facingDirection:aa(["left","right"]).optional(),schPinArrangement:wjt.optional(),schPinStyle:UH.optional(),schPinSpacing:Nr.optional(),schWidth:Nr.optional(),schHeight:Nr.optional()});Wt({net:ye().optional(),connection:ye().optional(),schX:Nr.optional(),schY:Nr.optional(),schRotation:ZC.optional(),anchorSide:aa(["left","top","right","bottom"]).optional()});var xKt=Wt({net:ye().optional(),connection:ye().optional(),connectsTo:ye().or(ji(ye())).optional(),schX:Nr.optional(),schY:Nr.optional(),schRotation:ZC.optional(),anchorSide:aa(["left","top","right","bottom"]).optional()}),IKt=nFe.extend({}),bKt=["pin1","pin2","pin3","emitter","collector","base","gate","source","drain"],CKt=Qb.extend({type:aa(["npn","pnp","bjt","jfet","mosfet","igbt"]),connections:GH(bKt).optional()}),EKt=Qb.extend({channelType:aa(["n","p"]),mosfetMode:aa(["enhancement","depletion"])}),SKt=Qb.extend({inductance:Kre,maxCurrentRating:Ul([ye(),mn()]).optional(),schOrientation:cB.optional()}),wKt=aa(["anode","cathode","pin1","pin2","pos","neg"]),BKt=ye().or(ji(ye()).readonly()).or(ji(ye())),MKt=Tm(wKt,BKt),RKt=aa(["standard","schottky","zener","avalanche","photo","tvs"]),QKt=Qb.extend({connections:MKt.optional(),variant:RKt.optional().default("standard"),standard:ar().optional(),schottky:ar().optional(),zener:ar().optional(),avalanche:ar().optional(),photo:ar().optional(),tvs:ar().optional(),schOrientation:cB.optional()}).superRefine((i,e)=>{if([i.standard,i.schottky,i.zener,i.avalanche,i.photo,i.tvs].filter(Boolean).length>1)return e.addIssue({code:mc.custom,message:"Exactly one diode variant must be enabled",path:[]}),Pg}).transform(i=>{const e={...i,standard:!1,schottky:!1,zener:!1,avalanche:!1,photo:!1,tvs:!1};if(i.standard)e.standard=!0;else if(i.schottky)e.schottky=!0;else if(i.zener)e.zener=!0;else if(i.photo)e.photo=!0;else if(i.tvs)e.tvs=!0;else switch(i.variant){case"standard":e.standard=!0;break;case"schottky":e.schottky=!0;break;case"zener":e.zener=!0;break;case"avalanche":e.avalanche=!0;break;case"photo":e.photo=!0;break;case"tvs":e.tvs=!0;break;default:e.standard=!0}return e}),DKt=Qb.extend({color:ye().optional(),wavelength:ye().optional(),schDisplayValue:ye().optional(),schOrientation:cB.optional(),connections:GH(Sjt).optional(),laser:ar().optional()}),NKt=Qb.extend({type:aa(["spst","spdt","dpst","dpdt"]).optional(),isNormallyClosed:ar().optional().default(!1),spst:ar().optional(),spdt:ar().optional(),dpst:ar().optional(),dpdt:ar().optional()}).transform(i=>{const e={...i};switch(e.dpdt?e.type="dpdt":e.spst?e.type="spst":e.spdt?e.type="spdt":e.dpst&&(e.type="dpst"),e.type){case"spdt":e.spdt=!0;break;case"spst":e.spst=!0;break;case"dpst":e.dpst=!0;break;case"dpdt":e.dpdt=!0;break}return e}),TKt=Nx.extend({text:ye(),anchorAlignment:aa(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),font:aa(["tscircuit2024"]).optional(),fontSize:On.optional(),color:ye().optional()}),kKt=Nx.omit({pcbX:!0,pcbY:!0,pcbRotation:!0}).extend({route:ji(v4),strokeWidth:On.optional(),color:ye().optional()});Wt({layer:ye().optional(),thickness:Nr.optional(),route:ji(v4)});var PKt=LH.extend({name:ye().optional(),fromLayer:u1,toLayer:u1,holeDiameter:Nr,outerDiameter:Nr,connectsTo:ye().or(ji(ye())).optional()}),LKt=Qb.extend({footprintVariant:aa(["pad","through_hole"]).optional(),padShape:aa(["rect","circle"]).optional().default("circle"),padDiameter:Nr.optional(),holeDiameter:Nr.optional(),width:Nr.optional(),height:Nr.optional()}).refine(i=>i.footprintVariant!=="through_hole"||i.holeDiameter!==void 0,{message:"holeDiameter is required for through_hole testpoints"}),FKt=Nx.omit({pcbRotation:!0,layer:!0}).extend({connection:ye()}),UKt=Ul([Nx.omit({pcbRotation:!0}).extend({shape:Yt("circle"),radius:Nr}),Nx.extend({shape:Yt("rect"),width:Nr,height:Nr})]),OKt=Qb.extend({voltage:hM}),HH=aa(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),GKt=Wt({schX:Nr.optional(),schY:Nr.optional(),width:Nr.optional(),height:Nr.optional(),overlay:ji(ye()).optional(),padding:Nr.optional(),paddingLeft:Nr.optional(),paddingRight:Nr.optional(),paddingTop:Nr.optional(),paddingBottom:Nr.optional(),title:ye().optional(),titleAlignment:HH.default("top_left"),titleColor:ye().optional(),titleFontSize:Nr.optional(),titleInside:ar().default(!1),strokeStyle:aa(["solid","dashed"]).default("solid")}).refine(i=>i.width!==void 0&&i.height!==void 0||Array.isArray(i.overlay)&&i.overlay.length>0,{message:"Must provide either both `width` and `height`, or a non-empty `overlay` array."}).refine(i=>!(i.width!==void 0&&i.height!==void 0&&Array.isArray(i.overlay)&&i.overlay.length>0),{message:"Cannot provide both `width`/`height` and `overlay` at the same time."});Wt({x1:Nr,y1:Nr,x2:Nr,y2:Nr});var zKt=aa(["center","left","right","top","bottom"]),HKt=Wt({schX:Nr.optional(),schY:Nr.optional(),text:ye(),fontSize:mn().default(1),anchor:Ul([zKt.describe("legacy"),HH]).default("center"),color:ye().default("#000000"),schRotation:ZC.default(0)});Wt({points:ji($_),isFilled:ar().optional().default(!1),fillColor:aa(["red","blue"]).optional()});var YKt=Wt({schX:Nr.optional(),schY:Nr.optional(),children:yv().optional(),cellPadding:Nr.optional(),borderWidth:Nr.optional(),anchor:HH.optional(),fontSize:Nr.optional()}),VKt=Wt({children:yv().optional(),height:Nr.optional()}),jKt=Wt({children:ye().optional(),horizontalAlign:aa(["left","center","right"]).optional(),verticalAlign:aa(["top","middle","bottom"]).optional(),fontSize:Nr.optional(),rowSpan:mn().optional(),colSpan:mn().optional(),width:Nr.optional(),text:ye().optional()}),KKt=Nx.extend({text:ye(),anchorAlignment:HH.default("center"),font:aa(["tscircuit2024"]).optional(),fontSize:On.optional()}),XKt=Nx.omit({pcbX:!0,pcbY:!0,pcbRotation:!0}).extend({route:ji(v4),strokeWidth:On.optional()}),qKt=Nx.omit({pcbX:!0,pcbY:!0,pcbRotation:!0}).extend({strokeWidth:Nr,x1:Nr,y1:Nr,x2:Nr,y2:Nr}),JKt=Nx.omit({pcbRotation:!0}).extend({filled:ar().default(!0).optional(),stroke:aa(["dashed","solid","none"]).optional(),strokeWidth:Nr.optional(),width:Nr,height:Nr}),ZKt=Nx.omit({pcbRotation:!0}).extend({isFilled:ar().optional(),isOutline:ar().optional(),strokeWidth:Nr.optional(),radius:Nr}),oFe=Wt({x:Nr,y:Nr,via:ar().optional(),toLayer:u1.optional()}),WKt=Wt({for:ye().optional().describe("Selector for the port you're targeting, not required if you're inside a trace"),order:mn().optional(),offset:v4.or(oFe).optional(),offsets:ji(v4).or(ji(oFe)).optional(),traceWidth:mn().optional()});LH.extend({name:ye(),pinNumber:mn().optional(),aliases:ji(ye()).optional(),direction:mjt});var $Kt=ji(yv()).describe("Circuit JSON"),eXt=_De().args(ye()).returns(vDe(Wt({footprintCircuitJson:ji(yv())}))).describe("A function that takes a path and returns Circuit JSON");Wt({partsEngine:eFe.optional(),autorouter:WLe.optional(),registryApiUrl:ye().optional(),cloudAutorouterUrl:ye().optional(),projectName:ye().optional(),version:ye().optional(),url:ye().optional(),printBoardInformationToSilkscreen:ar().optional(),localCacheEngine:yv().optional(),pcbDisabled:ar().optional(),schematicDisabled:ar().optional(),partsEngineDisabled:ar().optional(),footprintLibraryMap:Tm(ye(),Tm(ye(),Ul([$Kt,eXt]))).optional()});function lQ(){return new tXt}let tXt=class hRt{constructor(){pe(this,"index",{});pe(this,"array",[])}size(){return this.array.length}empty(){return this.array.length===0}itemAt(e){return this.array[e]}contains(e){return this.index[e.id()]!==void 0}find(e){const t=this.index[e.id()];return t===void 0?void 0:this.array[t]}setDefault(e,t){const n=this.index[e.id()];if(n===void 0){const r=new aFe(e,t());return this.index[e.id()]=this.array.length,this.array.push(r),r}else return this.array[n]}insert(e,t){const n=new aFe(e,t),r=this.index[e.id()];return r===void 0?(this.index[e.id()]=this.array.length,this.array.push(n)):this.array[r]=n,n}erase(e){const t=this.index[e.id()];if(t===void 0)return;this.index[e.id()]=void 0;const n=this.array[t],r=this.array.pop();return n!==r&&(this.array[t]=r,this.index[r.first.id()]=t),n}copy(){const e=new hRt;for(let t=0;t<this.array.length;t++){const n=this.array[t].copy();e.array[t]=n,e.index[n.first.id()]=t}return e}},aFe=class pRt{constructor(e,t){pe(this,"first");pe(this,"second");this.first=e,this.second=t}copy(){return new pRt(this.first,this.second)}},cce=class{constructor(e=""){pe(this,"_name");pe(this,"_value",0);pe(this,"_context",null);pe(this,"_id",nXt++);this._name=e}id(){return this._id}name(){return this._name}setName(e){this._name=e}context(){return this._context}setContext(e){this._context=e}value(){return this._value}setValue(e){this._value=e}plus(e){return new o2(this,e)}minus(e){return new o2(this,typeof e=="number"?-e:[-1,e])}multiply(e){return new o2([e,this])}divide(e){return new o2([1/e,this])}toJSON(){return{name:this._name,value:this._value}}toString(){return this._context+"["+this._name+":"+this._value+"]"}},nXt=0,o2=class nG{constructor(){pe(this,"_terms");pe(this,"_constant");let e=iXt(arguments);this._terms=e.terms,this._constant=e.constant}terms(){return this._terms}constant(){return this._constant}value(){let e=this._constant;for(let t=0,n=this._terms.size();t<n;t++){let r=this._terms.itemAt(t);e+=r.first.value()*r.second}return e}plus(e){return new nG(this,e)}minus(e){return new nG(this,typeof e=="number"?-e:[-1,e])}multiply(e){return new nG([e,this])}divide(e){return new nG([1/e,this])}isConstant(){return this._terms.size()==0}toString(){let e=this._terms.array.map(function(t){return t.second+"*"+t.first.toString()}).join(" + ");return!this.isConstant()&&this._constant!==0&&(e+=" + "),e+=this._constant,e}};function iXt(i){let e=0,t=()=>0,n=lQ();for(let r=0,o=i.length;r<o;++r){let a=i[r];if(typeof a=="number")e+=a;else if(a instanceof cce)n.setDefault(a,t).second+=1;else if(a instanceof o2){e+=a.constant();let s=a.terms();for(let l=0,c=s.size();l<c;l++){let u=s.itemAt(l);n.setDefault(u.first,t).second+=u.second}}else if(a instanceof Array){if(a.length!==2)throw new Error("array must have length 2");let s=a[0],l=a[1];if(typeof s!="number")throw new Error("array item 0 must be a number");if(l instanceof cce)n.setDefault(l,t).second+=s;else if(l instanceof o2){e+=l.constant()*s;let c=l.terms();for(let u=0,d=c.size();u<d;u++){let f=c.itemAt(u);n.setDefault(f.first,t).second+=f.second*s}}else throw new Error("array item 1 must be a variable or expression")}else throw new Error("invalid Expression argument: "+a)}return{terms:n,constant:e}}let a2=(L2=class{static create(e,t,n,r=1){let o=0;return o+=Math.max(0,Math.min(1e3,e*r))*1e6,o+=Math.max(0,Math.min(1e3,t*r))*1e3,o+=Math.max(0,Math.min(1e3,n*r)),o}static clip(e){return Math.max(0,Math.min(L2.required,e))}},pe(L2,"required",L2.create(1e3,1e3,1e3)),pe(L2,"strong",L2.create(1,0,0)),pe(L2,"medium",L2.create(0,1,0)),pe(L2,"weak",L2.create(0,0,1)),L2);var j2;(function(i){i[i.Le=0]="Le",i[i.Ge=1]="Ge",i[i.Eq=2]="Eq"})(j2||(j2={}));let uB=class{constructor(e,t,n,r=a2.required){pe(this,"_expression");pe(this,"_operator");pe(this,"_strength");pe(this,"_id",rXt++);this._operator=t,this._strength=a2.clip(r),n===void 0&&e instanceof o2?this._expression=e:this._expression=e.minus(n)}id(){return this._id}expression(){return this._expression}op(){return this._operator}strength(){return this._strength}toString(){return this._expression.toString()+" "+["<=",">=","="][this._operator]+" 0 ("+this._strength.toString()+")"}},rXt=0,oXt=class{constructor(){pe(this,"maxIterations",1e3);pe(this,"_cnMap",aXt());pe(this,"_rowMap",sXt());pe(this,"_varMap",lXt());pe(this,"_editMap",cXt());pe(this,"_infeasibleRows",[]);pe(this,"_objective",new lFe);pe(this,"_artificial",null);pe(this,"_idTick",0)}createConstraint(e,t,n,r=a2.required){let o=new uB(e,t,n,r);return this.addConstraint(o),o}addConstraint(e){if(this._cnMap.find(e)!==void 0)throw new Error("duplicate constraint");let n=this._createRow(e),r=n.row,o=n.tag,a=this._chooseSubject(r,o);if(a.type()===w9.Invalid&&r.allDummies())if(YH(r.constant()))a=o.marker;else throw new Error("unsatisfiable constraint");if(a.type()===w9.Invalid){if(!this._addWithArtificialVariable(r))throw new Error("unsatisfiable constraint")}else r.solveFor(a),this._substitute(a,r),this._rowMap.insert(a,r);this._cnMap.insert(e,o),this._optimize(this._objective)}removeConstraint(e){let t=this._cnMap.erase(e);if(t===void 0)throw new Error("unknown constraint");this._removeConstraintEffects(e,t.second);let n=t.second.marker,r=this._rowMap.erase(n);if(r===void 0){let o=this._getMarkerLeavingSymbol(n);if(o.type()===w9.Invalid)throw new Error("failed to find leaving row");r=this._rowMap.erase(o),r.second.solveForEx(o,n),this._substitute(n,r.second)}this._optimize(this._objective)}hasConstraint(e){return this._cnMap.contains(e)}getConstraints(){return this._cnMap.array.map(({first:e})=>e)}addEditVariable(e,t){if(this._editMap.find(e)!==void 0)throw new Error("duplicate edit variable");if(t=a2.clip(t),t===a2.required)throw new Error("bad required strength");let r=new o2(e),o=new uB(r,j2.Eq,void 0,t);this.addConstraint(o);let s={tag:this._cnMap.find(o).second,constraint:o,constant:0};this._editMap.insert(e,s)}removeEditVariable(e){let t=this._editMap.erase(e);if(t===void 0)throw new Error("unknown edit variable");this.removeConstraint(t.second.constraint)}hasEditVariable(e){return this._editMap.contains(e)}suggestValue(e,t){let n=this._editMap.find(e);if(n===void 0)throw new Error("unknown edit variable");let r=this._rowMap,o=n.second,a=t-o.constant;o.constant=t;let s=o.tag.marker,l=r.find(s);if(l!==void 0){l.second.add(-a)<0&&this._infeasibleRows.push(s),this._dualOptimize();return}let c=o.tag.other;if(l=r.find(c),l!==void 0){l.second.add(a)<0&&this._infeasibleRows.push(c),this._dualOptimize();return}for(let u=0,d=r.size();u<d;++u){let f=r.itemAt(u),p=f.second,A=p.coefficientFor(s);A!==0&&p.add(a*A)<0&&f.first.type()!==w9.External&&this._infeasibleRows.push(f.first)}this._dualOptimize()}updateVariables(){let e=this._varMap,t=this._rowMap;for(let n=0,r=e.size();n<r;++n){let o=e.itemAt(n),a=t.find(o.second);a!==void 0?o.first.setValue(a.second.constant()):o.first.setValue(0)}}_getVarSymbol(e){let t=()=>this._makeSymbol(w9.External);return this._varMap.setDefault(e,t).second}_createRow(e){let t=e.expression(),n=new lFe(t.constant()),r=t.terms();for(let l=0,c=r.size();l<c;++l){let u=r.itemAt(l);if(!YH(u.second)){let d=this._getVarSymbol(u.first),f=this._rowMap.find(d);f!==void 0?n.insertRow(f.second,u.second):n.insertSymbol(d,u.second)}}let o=this._objective,a=e.strength(),s={marker:dB,other:dB};switch(e.op()){case j2.Le:case j2.Ge:{let l=e.op()===j2.Le?1:-1,c=this._makeSymbol(w9.Slack);if(s.marker=c,n.insertSymbol(c,l),a<a2.required){let u=this._makeSymbol(w9.Error);s.other=u,n.insertSymbol(u,-l),o.insertSymbol(u,a)}break}case j2.Eq:{if(a<a2.required){let l=this._makeSymbol(w9.Error),c=this._makeSymbol(w9.Error);s.marker=l,s.other=c,n.insertSymbol(l,-1),n.insertSymbol(c,1),o.insertSymbol(l,a),o.insertSymbol(c,a)}else{let l=this._makeSymbol(w9.Dummy);s.marker=l,n.insertSymbol(l)}break}}return n.constant()<0&&n.reverseSign(),{row:n,tag:s}}_chooseSubject(e,t){let n=e.cells();for(let o=0,a=n.size();o<a;++o){let s=n.itemAt(o);if(s.first.type()===w9.External)return s.first}let r=t.marker.type();return(r===w9.Slack||r===w9.Error)&&e.coefficientFor(t.marker)<0?t.marker:(r=t.other.type(),(r===w9.Slack||r===w9.Error)&&e.coefficientFor(t.other)<0?t.other:dB)}_addWithArtificialVariable(e){let t=this._makeSymbol(w9.Slack);this._rowMap.insert(t,e.copy()),this._artificial=e.copy(),this._optimize(this._artificial);let n=YH(this._artificial.constant());this._artificial=null;let r=this._rowMap.erase(t);if(r!==void 0){let a=r.second;if(a.isConstant())return n;let s=this._anyPivotableSymbol(a);if(s.type()===w9.Invalid)return!1;a.solveForEx(t,s),this._substitute(s,a),this._rowMap.insert(s,a)}let o=this._rowMap;for(let a=0,s=o.size();a<s;++a)o.itemAt(a).second.removeSymbol(t);return this._objective.removeSymbol(t),n}_substitute(e,t){let n=this._rowMap;for(let r=0,o=n.size();r<o;++r){let a=n.itemAt(r);a.second.substitute(e,t),a.second.constant()<0&&a.first.type()!==w9.External&&this._infeasibleRows.push(a.first)}this._objective.substitute(e,t),this._artificial&&this._artificial.substitute(e,t)}_optimize(e){let t=0;for(;t<this.maxIterations;){let n=this._getEnteringSymbol(e);if(n.type()===w9.Invalid)return;let r=this._getLeavingSymbol(n);if(r.type()===w9.Invalid)throw new Error("the objective is unbounded");let o=this._rowMap.erase(r).second;o.solveForEx(r,n),this._substitute(n,o),this._rowMap.insert(n,o),t++}throw new Error("solver iterations exceeded")}_dualOptimize(){let e=this._rowMap,t=this._infeasibleRows;for(;t.length!==0;){let n=t.pop(),r=e.find(n);if(r!==void 0&&r.second.constant()<0){let o=this._getDualEnteringSymbol(r.second);if(o.type()===w9.Invalid)throw new Error("dual optimize failed");let a=r.second;e.erase(n),a.solveForEx(n,o),this._substitute(o,a),e.insert(o,a)}}}_getEnteringSymbol(e){let t=e.cells();for(let n=0,r=t.size();n<r;++n){let o=t.itemAt(n),a=o.first;if(o.second<0&&a.type()!==w9.Dummy)return a}return dB}_getDualEnteringSymbol(e){let t=Number.MAX_VALUE,n=dB,r=e.cells();for(let o=0,a=r.size();o<a;++o){let s=r.itemAt(o),l=s.first,c=s.second;if(c>0&&l.type()!==w9.Dummy){let d=this._objective.coefficientFor(l)/c;d<t&&(t=d,n=l)}}return n}_getLeavingSymbol(e){let t=Number.MAX_VALUE,n=dB,r=this._rowMap;for(let o=0,a=r.size();o<a;++o){let s=r.itemAt(o),l=s.first;if(l.type()!==w9.External){let c=s.second,u=c.coefficientFor(e);if(u<0){let d=-c.constant()/u;d<t&&(t=d,n=l)}}}return n}_getMarkerLeavingSymbol(e){let t=Number.MAX_VALUE,n=t,r=t,o=dB,a=o,s=o,l=o,c=this._rowMap;for(let u=0,d=c.size();u<d;++u){let f=c.itemAt(u),p=f.second,A=p.coefficientFor(e);if(A===0)continue;let m=f.first;if(m.type()===w9.External)l=m;else if(A<0){let _=-p.constant()/A;_<n&&(n=_,a=m)}else{let _=p.constant()/A;_<r&&(r=_,s=m)}}return a!==o?a:s!==o?s:l}_removeConstraintEffects(e,t){t.marker.type()===w9.Error&&this._removeMarkerEffects(t.marker,e.strength()),t.other.type()===w9.Error&&this._removeMarkerEffects(t.other,e.strength())}_removeMarkerEffects(e,t){let n=this._rowMap.find(e);n!==void 0?this._objective.insertRow(n.second,-t):this._objective.insertSymbol(e,-t)}_anyPivotableSymbol(e){let t=e.cells();for(let n=0,r=t.size();n<r;++n){let o=t.itemAt(n),a=o.first.type();if(a===w9.Slack||a===w9.Error)return o.first}return dB}_makeSymbol(e){return new sFe(e,this._idTick++)}};function YH(i){let e=1e-8;return i<0?-i<e:i<e}function aXt(){return lQ()}function sXt(){return lQ()}function lXt(){return lQ()}function cXt(){return lQ()}var w9;(function(i){i[i.Invalid=0]="Invalid",i[i.External=1]="External",i[i.Slack=2]="Slack",i[i.Error=3]="Error",i[i.Dummy=4]="Dummy"})(w9||(w9={}));let sFe=class{constructor(e,t){pe(this,"_id");pe(this,"_type");this._id=t,this._type=e}id(){return this._id}type(){return this._type}},dB=new sFe(w9.Invalid,-1),lFe=class ARt{constructor(e=0){pe(this,"_cellMap",lQ());pe(this,"_constant");this._constant=e}cells(){return this._cellMap}constant(){return this._constant}isConstant(){return this._cellMap.empty()}allDummies(){let e=this._cellMap;for(let t=0,n=e.size();t<n;++t)if(e.itemAt(t).first.type()!==w9.Dummy)return!1;return!0}copy(){let e=new ARt(this._constant);return e._cellMap=this._cellMap.copy(),e}add(e){return this._constant+=e}insertSymbol(e,t=1){let n=this._cellMap.setDefault(e,()=>0);YH(n.second+=t)&&this._cellMap.erase(e)}insertRow(e,t=1){this._constant+=e._constant*t;let n=e._cellMap;for(let r=0,o=n.size();r<o;++r){let a=n.itemAt(r);this.insertSymbol(a.first,a.second*t)}}removeSymbol(e){this._cellMap.erase(e)}reverseSign(){this._constant=-this._constant;let e=this._cellMap;for(let t=0,n=e.size();t<n;++t){let r=e.itemAt(t);r.second=-r.second}}solveFor(e){let t=this._cellMap,r=-1/t.erase(e).second;this._constant*=r;for(let o=0,a=t.size();o<a;++o)t.itemAt(o).second*=r}solveForEx(e,t){this.insertSymbol(e,-1),this.solveFor(t)}coefficientFor(e){let t=this._cellMap.find(e);return t!==void 0?t.second:0}substitute(e,t){let n=this._cellMap.erase(e);n!==void 0&&this.insertRow(t,n.second)}};function uce([i,e],[t,n],{lineThickness:r=0}={}){return r===0?_M(i,e,t,n):uXt(i,e,t,n)<=r}function _M(i,e,t,n){const r=VH(i,e,t),o=VH(i,e,n),a=VH(t,n,i),s=VH(t,n,e);return!!(r!==o&&a!==s||r===0&&jH(i,t,e)||o===0&&jH(i,n,e)||a===0&&jH(t,i,n)||s===0&&jH(t,e,n))}function VH(i,e,t){const n=(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y);return n===0?0:n>0?1:2}function jH(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function uXt(i,e,t,n){if(i.x===e.x&&i.y===e.y)return WC(i,t,n);if(t.x===n.x&&t.y===n.y)return WC(t,i,e);if(_M(i,e,t,n))return 0;const r=[WC(i,t,n),WC(e,t,n),WC(t,i,e),WC(n,i,e)];return Math.min(...r)}function WC(i,e,t){const n=(t.x-e.x)**2+(t.y-e.y)**2;if(n===0)return S4(i,e);let r=((i.x-e.x)*(t.x-e.x)+(i.y-e.y)*(t.y-e.y))/n;r=Math.max(0,Math.min(1,r));const o={x:e.x+r*(t.x-e.x),y:e.y+r*(t.y-e.y)};return S4(i,o)}function S4(i,e){const t=i.x-e.x,n=i.y-e.y;return Math.sqrt(t*t+n*n)}function dXt(i,e,t,n){if(i.x===e.x&&i.y===e.y)return WC(i,t,n);if(t.x===n.x&&t.y===n.y)return WC(t,i,e);if(_M(i,e,t,n))return 0;const r=[WC(i,t,n),WC(e,t,n),WC(t,i,e),WC(n,i,e)];return Math.min(...r)}function fXt(i,e,t){const n={x:t.minX,y:t.minY},r={x:t.maxX,y:t.minY},o={x:t.minX,y:t.maxY},a={x:t.maxX,y:t.maxY};if(_M(i,e,n,r)||_M(i,e,r,a)||_M(i,e,a,o)||_M(i,e,o,n)||i.x>=t.minX&&i.x<=t.maxX&&i.y>=t.minY&&i.y<=t.maxY&&e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY)return 0;const s=[WC(n,i,e),WC(r,i,e),WC(o,i,e),WC(a,i,e)];if(i.x>=t.minX&&i.x<=t.maxX&&i.y>=t.minY&&i.y<=t.maxY||e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY)return 0;if(i.x<t.minX||i.x>t.maxX||i.y<t.minY||i.y>t.maxY){const l=lB(i.x,t.minX,t.maxX),c=lB(i.y,t.minY,t.maxY);s.push(S4(i,{x:l,y:c}))}if(e.x<t.minX||e.x>t.maxX||e.y<t.minY||e.y>t.maxY){const l=lB(e.x,t.minX,t.maxX),c=lB(e.y,t.minY,t.maxY);s.push(S4(e,{x:l,y:c}))}return Math.min(...s)}function hXt(i,e,t){const n={x:t.x,y:t.y};if(i.x===e.x&&i.y===e.y)return Math.max(0,S4(i,n)-t.radius);const r={x:e.x-i.x,y:e.y-i.y},o={x:n.x-i.x,y:n.y-i.y},a=r.x*r.x+r.y*r.y,s=Math.max(0,Math.min(1,(r.x*o.x+r.y*o.y)/a)),l={x:i.x+s*r.x,y:i.y+s*r.y},c=S4(l,n);return Math.max(0,c-t.radius)}var pXt=(i,e)=>{const t={x:e.x-i.x,y:e.y-i.y},n=Math.sqrt(t.x**2+t.y**2);return{x:t.x/n,y:t.y/n}},AXt=i=>{switch(i){case"up":return{x:0,y:1};case"down":return{x:0,y:-1};case"left":return{x:-1,y:0};case"right":return{x:1,y:0}}};const gXt=(i,e,t={})=>{const n=(t==null?void 0:t.overshoot)??.1*Math.max(Math.abs(i.x-e.x),Math.abs(i.y-e.y)),r=[{x:i.x,y:i.y}],o=(i.x+e.x)/2,a=(i.y+e.y)/2,s={x:e.x,y:e.y};switch(e.facingDirection){case"x+":s.x+=n;break;case"x-":s.x-=n;break;case"y+":s.y+=n;break;case"y-":s.y-=n;break}const l=i.facingDirection??"none",c=e.facingDirection??"none",u=d=>{const f=r[r.length-1];(f.x!==d.x||f.y!==d.y)&&r.push(d)};if(l==="none"&&c==="none")u({x:o,y:i.y}),u({x:o,y:e.y});else if(l==="y+"&&c==="x-")u({x:i.x,y:e.y});else if(l==="y-"&&c==="x-")if(i.y>=e.y)u({x:i.x,y:e.y});else{const d=i.y-n;u({x:i.x,y:d}),u({x:o,y:d}),u({x:o,y:e.y}),u({x:s.x,y:e.y})}else if(l==="x-"&&c==="x+")i.x>e.x?(u({x:o,y:i.y}),u({x:o,y:e.y})):(u({x:i.x-n,y:i.y}),u({x:i.x-n,y:a}),u({x:s.x,y:a}),u({x:s.x,y:e.y}));else if(l==="y+"&&c==="y+"){const d=Math.max(i.y+n,s.y);u({x:i.x,y:d}),u({x:e.x,y:d})}else if(l==="y-"&&c==="x+")if(i.x>e.x&&i.y>=e.y)u({x:i.x,y:e.y}),u({x:e.x,y:e.y});else{const d=i.y-n;u({x:i.x,y:d}),u({x:s.x,y:d}),u({x:s.x,y:e.y})}else if(l==="y+"&&c==="x+")if(i.x>e.x&&i.y<e.y)u({x:i.x,y:e.y}),u({x:e.x,y:e.y});else{const d=i.y+n;u({x:i.x,y:d}),u({x:s.x,y:d}),u({x:s.x,y:e.y})}else if(l==="x+"&&c==="y+")if(i.x>e.x&&i.y<e.y)u({x:i.x,y:e.y}),u({x:e.x,y:e.y});else if(i.x<e.x&&i.y>e.y)u({x:e.x,y:i.y});else if(i.x===e.x)u({x:i.x+n,y:i.y}),u({x:i.x+n,y:a}),u({x:e.x,y:a});else if(i.x<e.x)u({x:o,y:i.y}),u({x:o,y:s.y}),u({x:e.x,y:s.y});else{const d=i.x+n;u({x:d,y:i.y}),u({x:d,y:s.y}),u({x:e.x,y:s.y})}else if(l==="y-"&&c==="y-"){const d=Math.min(i.y-n,s.y);u({x:i.x,y:d}),u({x:e.x,y:d})}else if(l==="x+"&&c==="x+"){const d=Math.max(i.x+n,s.x);u({x:d,y:i.y}),u({x:d,y:e.y})}else if(l==="x-"&&c==="x-"){const d=Math.min(i.x-n,s.x);u({x:d,y:i.y}),u({x:d,y:e.y})}else if(l==="x-"&&c==="y+")i.x>e.x?u({x:e.x,y:i.y}):(u({x:i.x-n,y:i.y}),u({x:i.x-n,y:s.y}),u({x:e.x,y:s.y}));else if(l==="x-"&&c==="y-")if(i.x>e.x&&i.y<=e.y)u({x:e.x,y:i.y});else{const d=i.x-n;u({x:d,y:i.y}),u({x:d,y:s.y}),u({x:s.x,y:s.y})}else if(l==="x+"&&c==="y-")i.x===e.x?(u({x:i.x+n,y:i.y}),u({x:i.x+n,y:a}),u({x:e.x,y:a})):i.x<e.x&&i.y<e.y?u({x:e.x,y:i.y}):(u({x:i.x+n,y:i.y}),u({x:i.x+n,y:s.y}),u({x:e.x,y:s.y}));else if(l==="y-"&&c==="y+")if(i.y>=e.y)u({x:i.x,y:a}),u({x:e.x,y:a});else{const d=i.y-n;u({x:i.x,y:d}),u({x:o,y:d}),u({x:o,y:s.y}),u({x:e.x,y:s.y})}else if(l==="y+"&&c==="y-")if(i.y<=e.y)u({x:i.x,y:a}),u({x:e.x,y:a});else{const d=i.y+n;u({x:i.x,y:d}),u({x:o,y:d}),u({x:o,y:s.y}),u({x:e.x,y:s.y})}else l.startsWith("x")?u({x:i.x+(l==="x+"?n:-n),y:i.y}):l.startsWith("y")&&u({x:i.x,y:i.y+(l==="y+"?n:-n)}),u({x:o,y:r[r.length-1].y}),u({x:o,y:s.y}),u({x:s.x,y:s.y});return u({x:e.x,y:e.y}),r};function fB(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var dce={exports:{}},cFe;function mXt(){return cFe||(cFe=1,function(i,e){(function(t){i.exports=t()})(function(){return function t(n,r,o){function a(c,u){if(!r[c]){if(!n[c]){var d=typeof fB=="function"&&fB;if(!u&&d)return d(c,!0);if(s)return s(c,!0);throw new Error("Cannot find module '"+c+"'")}u=r[c]={exports:{}},n[c][0].call(u.exports,function(f){var p=n[c][1][f];return a(p||f)},u,u.exports,t,n,r,o)}return r[c].exports}for(var s=typeof fB=="function"&&fB,l=0;l<o.length;l++)a(o[l]);return a}({1:[function(t,n,r){(function(o,a,s,l,c,u,d,f,p){var A=t("crypto");function m(k,L){L=x(k,L);var R;return(R=L.algorithm!=="passthrough"?A.createHash(L.algorithm):new G).write===void 0&&(R.write=R.update,R.end=R.update),M(L,R).dispatch(k),R.update||R.end(""),R.digest?R.digest(L.encoding==="buffer"?void 0:L.encoding):(k=R.read(),L.encoding!=="buffer"?k.toString(L.encoding):k)}(r=n.exports=m).sha1=function(k){return m(k)},r.keys=function(k){return m(k,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(k){return m(k,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(k){return m(k,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var _=A.getHashes?A.getHashes().slice():["sha1","md5"],v=(_.push("passthrough"),["buffer","hex","binary","base64"]);function x(k,L){var R={};if(R.algorithm=(L=L||{}).algorithm||"sha1",R.encoding=L.encoding||"hex",R.excludeValues=!!L.excludeValues,R.algorithm=R.algorithm.toLowerCase(),R.encoding=R.encoding.toLowerCase(),R.ignoreUnknown=L.ignoreUnknown===!0,R.respectType=L.respectType!==!1,R.respectFunctionNames=L.respectFunctionNames!==!1,R.respectFunctionProperties=L.respectFunctionProperties!==!1,R.unorderedArrays=L.unorderedArrays===!0,R.unorderedSets=L.unorderedSets!==!1,R.unorderedObjects=L.unorderedObjects!==!1,R.replacer=L.replacer||void 0,R.excludeKeys=L.excludeKeys||void 0,k===void 0)throw new Error("Object argument required.");for(var U=0;U<_.length;++U)_[U].toLowerCase()===R.algorithm.toLowerCase()&&(R.algorithm=_[U]);if(_.indexOf(R.algorithm)===-1)throw new Error('Algorithm "'+R.algorithm+'" not supported. supported values: '+_.join(", "));if(v.indexOf(R.encoding)===-1&&R.algorithm!=="passthrough")throw new Error('Encoding "'+R.encoding+'" not supported. supported values: '+v.join(", "));return R}function I(k){if(typeof k=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(k))!=null}function M(k,L,R){R=R||[];function U(D){return L.update?L.update(D,"utf8"):L.write(D,"utf8")}return{dispatch:function(D){return this["_"+((D=k.replacer?k.replacer(D):D)===null?"null":typeof D)](D)},_object:function(D){var Z,Y=Object.prototype.toString.call(D),W=/\[object (.*)\]/i.exec(Y);if(W=(W=W?W[1]:"unknown:["+Y+"]").toLowerCase(),0<=(Y=R.indexOf(D)))return this.dispatch("[CIRCULAR:"+Y+"]");if(R.push(D),s!==void 0&&s.isBuffer&&s.isBuffer(D))return U("buffer:"),U(D);if(W==="object"||W==="function"||W==="asyncfunction")return Y=Object.keys(D),k.unorderedObjects&&(Y=Y.sort()),k.respectType===!1||I(D)||Y.splice(0,0,"prototype","__proto__","constructor"),k.excludeKeys&&(Y=Y.filter(function(ce){return!k.excludeKeys(ce)})),U("object:"+Y.length+":"),Z=this,Y.forEach(function(ce){Z.dispatch(ce),U(":"),k.excludeValues||Z.dispatch(D[ce]),U(",")});if(!this["_"+W]){if(k.ignoreUnknown)return U("["+W+"]");throw new Error('Unknown object type "'+W+'"')}this["_"+W](D)},_array:function(D,ce){ce=ce!==void 0?ce:k.unorderedArrays!==!1;var Y=this;if(U("array:"+D.length+":"),!ce||D.length<=1)return D.forEach(function(he){return Y.dispatch(he)});var W=[],ce=D.map(function(he){var ae=new G,ve=R.slice();return M(k,ae,ve).dispatch(he),W=W.concat(ve.slice(R.length)),ae.read().toString()});return R=R.concat(W),ce.sort(),this._array(ce,!1)},_date:function(D){return U("date:"+D.toJSON())},_symbol:function(D){return U("symbol:"+D.toString())},_error:function(D){return U("error:"+D.toString())},_boolean:function(D){return U("bool:"+D.toString())},_string:function(D){U("string:"+D.length+":"),U(D.toString())},_function:function(D){U("fn:"),I(D)?this.dispatch("[native]"):this.dispatch(D.toString()),k.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(D.name)),k.respectFunctionProperties&&this._object(D)},_number:function(D){return U("number:"+D.toString())},_xml:function(D){return U("xml:"+D.toString())},_null:function(){return U("Null")},_undefined:function(){return U("Undefined")},_regexp:function(D){return U("regex:"+D.toString())},_uint8array:function(D){return U("uint8array:"),this.dispatch(Array.prototype.slice.call(D))},_uint8clampedarray:function(D){return U("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(D))},_int8array:function(D){return U("int8array:"),this.dispatch(Array.prototype.slice.call(D))},_uint16array:function(D){return U("uint16array:"),this.dispatch(Array.prototype.slice.call(D))},_int16array:function(D){return U("int16array:"),this.dispatch(Array.prototype.slice.call(D))},_uint32array:function(D){return U("uint32array:"),this.dispatch(Array.prototype.slice.call(D))},_int32array:function(D){return U("int32array:"),this.dispatch(Array.prototype.slice.call(D))},_float32array:function(D){return U("float32array:"),this.dispatch(Array.prototype.slice.call(D))},_float64array:function(D){return U("float64array:"),this.dispatch(Array.prototype.slice.call(D))},_arraybuffer:function(D){return U("arraybuffer:"),this.dispatch(new Uint8Array(D))},_url:function(D){return U("url:"+D.toString())},_map:function(D){return U("map:"),D=Array.from(D),this._array(D,k.unorderedSets!==!1)},_set:function(D){return U("set:"),D=Array.from(D),this._array(D,k.unorderedSets!==!1)},_file:function(D){return U("file:"),this.dispatch([D.name,D.size,D.type,D.lastModfied])},_blob:function(){if(k.ignoreUnknown)return U("[blob]");throw Error(`Hashing Blob objects is currently not supported
|
|
651
651
|
(see https://github.com/puleos/object-hash/issues/26)
|
|
652
652
|
Use "options.replacer" or "options.ignoreUnknown"
|
|
653
653
|
`)},_domwindow:function(){return U("domwindow")},_bigint:function(D){return U("bigint:"+D.toString())},_process:function(){return U("process")},_timer:function(){return U("timer")},_pipe:function(){return U("pipe")},_tcp:function(){return U("tcp")},_udp:function(){return U("udp")},_tty:function(){return U("tty")},_statwatcher:function(){return U("statwatcher")},_securecontext:function(){return U("securecontext")},_connection:function(){return U("connection")},_zlib:function(){return U("zlib")},_context:function(){return U("context")},_nodescript:function(){return U("nodescript")},_httpparser:function(){return U("httpparser")},_dataview:function(){return U("dataview")},_signal:function(){return U("signal")},_fsevent:function(){return U("fsevent")},_tlswrap:function(){return U("tlswrap")}}}function G(){return{buf:"",write:function(k){this.buf+=k},end:function(k){this.buf+=k},read:function(){return this.buf}}}r.writeToStream=function(k,L,R){return R===void 0&&(R=L,L={}),M(L=x(k,L),R).dispatch(k)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(t,n,r){(function(o,a,s,l,c,u,d,f,p){(function(A){var m=typeof Uint8Array<"u"?Uint8Array:Array,_=43,v=47,x=48,I=97,M=65,G=45,k=95;function L(R){return R=R.charCodeAt(0),R===_||R===G?62:R===v||R===k?63:R<x?-1:R<x+10?R-x+26+26:R<M+26?R-M:R<I+26?R-I+26:void 0}A.toByteArray=function(R){var U,D;if(0<R.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var Z=R.length,Z=R.charAt(Z-2)==="="?2:R.charAt(Z-1)==="="?1:0,Y=new m(3*R.length/4-Z),W=0<Z?R.length-4:R.length,ce=0;function he(ae){Y[ce++]=ae}for(U=0;U<W;U+=4,0)he((16711680&(D=L(R.charAt(U))<<18|L(R.charAt(U+1))<<12|L(R.charAt(U+2))<<6|L(R.charAt(U+3))))>>16),he((65280&D)>>8),he(255&D);return Z==2?he(255&(D=L(R.charAt(U))<<2|L(R.charAt(U+1))>>4)):Z==1&&(he((D=L(R.charAt(U))<<10|L(R.charAt(U+1))<<4|L(R.charAt(U+2))>>2)>>8&255),he(255&D)),Y},A.fromByteArray=function(R){var U,D,Z,Y,W=R.length%3,ce="";function he(ae){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(ae)}for(U=0,Z=R.length-W;U<Z;U+=3)D=(R[U]<<16)+(R[U+1]<<8)+R[U+2],ce+=he((Y=D)>>18&63)+he(Y>>12&63)+he(Y>>6&63)+he(63&Y);switch(W){case 1:ce=(ce+=he((D=R[R.length-1])>>2))+he(D<<4&63)+"==";break;case 2:ce=(ce=(ce+=he((D=(R[R.length-2]<<8)+R[R.length-1])>>10))+he(D>>4&63))+he(D<<2&63)+"="}return ce}})(r===void 0?this.base64js={}:r)}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(t,n,r){(function(o,a,_,l,c,u,d,f,p){var A=t("base64-js"),m=t("ieee754");function _(Qe,Ke,Je){if(!(this instanceof _))return new _(Qe,Ke,Je);var yt,Mt,It,ot,Lt=typeof Qe;if(Ke==="base64"&&Lt=="string")for(Qe=(ot=Qe).trim?ot.trim():ot.replace(/^\s+|\s+$/g,"");Qe.length%4!=0;)Qe+="=";if(Lt=="number")yt=ge(Qe);else if(Lt=="string")yt=_.byteLength(Qe,Ke);else{if(Lt!="object")throw new Error("First argument needs to be a number, array or string.");yt=ge(Qe.length)}if(_._useTypedArrays?Mt=_._augment(new Uint8Array(yt)):((Mt=this).length=yt,Mt._isBuffer=!0),_._useTypedArrays&&typeof Qe.byteLength=="number")Mt._set(Qe);else if(Me(ot=Qe)||_.isBuffer(ot)||ot&&typeof ot=="object"&&typeof ot.length=="number")for(It=0;It<yt;It++)_.isBuffer(Qe)?Mt[It]=Qe.readUInt8(It):Mt[It]=Qe[It];else if(Lt=="string")Mt.write(Qe,0,Ke);else if(Lt=="number"&&!_._useTypedArrays&&!Je)for(It=0;It<yt;It++)Mt[It]=0;return Mt}function v(Qe,Ke,Je,yt){return _._charsWritten=ze(function(Mt){for(var It=[],ot=0;ot<Mt.length;ot++)It.push(255&Mt.charCodeAt(ot));return It}(Ke),Qe,Je,yt)}function x(Qe,Ke,Je,yt){return _._charsWritten=ze(function(Mt){for(var It,ot,Lt=[],Nt=0;Nt<Mt.length;Nt++)ot=Mt.charCodeAt(Nt),It=ot>>8,ot=ot%256,Lt.push(ot),Lt.push(It);return Lt}(Ke),Qe,Je,yt)}function I(Qe,Ke,Je){var yt="";Je=Math.min(Qe.length,Je);for(var Mt=Ke;Mt<Je;Mt++)yt+=String.fromCharCode(Qe[Mt]);return yt}function M(Qe,Ke,Je,It){It||(mt(typeof Je=="boolean","missing or invalid endian"),mt(Ke!=null,"missing offset"),mt(Ke+1<Qe.length,"Trying to read beyond buffer length"));var Mt,It=Qe.length;if(!(It<=Ke))return Je?(Mt=Qe[Ke],Ke+1<It&&(Mt|=Qe[Ke+1]<<8)):(Mt=Qe[Ke]<<8,Ke+1<It&&(Mt|=Qe[Ke+1])),Mt}function G(Qe,Ke,Je,It){It||(mt(typeof Je=="boolean","missing or invalid endian"),mt(Ke!=null,"missing offset"),mt(Ke+3<Qe.length,"Trying to read beyond buffer length"));var Mt,It=Qe.length;if(!(It<=Ke))return Je?(Ke+2<It&&(Mt=Qe[Ke+2]<<16),Ke+1<It&&(Mt|=Qe[Ke+1]<<8),Mt|=Qe[Ke],Ke+3<It&&(Mt+=Qe[Ke+3]<<24>>>0)):(Ke+1<It&&(Mt=Qe[Ke+1]<<16),Ke+2<It&&(Mt|=Qe[Ke+2]<<8),Ke+3<It&&(Mt|=Qe[Ke+3]),Mt+=Qe[Ke]<<24>>>0),Mt}function k(Qe,Ke,Je,yt){if(yt||(mt(typeof Je=="boolean","missing or invalid endian"),mt(Ke!=null,"missing offset"),mt(Ke+1<Qe.length,"Trying to read beyond buffer length")),!(Qe.length<=Ke))return yt=M(Qe,Ke,Je,!0),32768&yt?-1*(65535-yt+1):yt}function L(Qe,Ke,Je,yt){if(yt||(mt(typeof Je=="boolean","missing or invalid endian"),mt(Ke!=null,"missing offset"),mt(Ke+3<Qe.length,"Trying to read beyond buffer length")),!(Qe.length<=Ke))return yt=G(Qe,Ke,Je,!0),2147483648&yt?-1*(4294967295-yt+1):yt}function R(Qe,Ke,Je,yt){return yt||(mt(typeof Je=="boolean","missing or invalid endian"),mt(Ke+3<Qe.length,"Trying to read beyond buffer length")),m.read(Qe,Ke,Je,23,4)}function U(Qe,Ke,Je,yt){return yt||(mt(typeof Je=="boolean","missing or invalid endian"),mt(Ke+7<Qe.length,"Trying to read beyond buffer length")),m.read(Qe,Ke,Je,52,8)}function D(Qe,Ke,Je,yt,Mt){if(Mt||(mt(Ke!=null,"missing value"),mt(typeof yt=="boolean","missing or invalid endian"),mt(Je!=null,"missing offset"),mt(Je+1<Qe.length,"trying to write beyond buffer length"),st(Ke,65535)),Mt=Qe.length,!(Mt<=Je))for(var It=0,ot=Math.min(Mt-Je,2);It<ot;It++)Qe[Je+It]=(Ke&255<<8*(yt?It:1-It))>>>8*(yt?It:1-It)}function Z(Qe,Ke,Je,yt,Mt){if(Mt||(mt(Ke!=null,"missing value"),mt(typeof yt=="boolean","missing or invalid endian"),mt(Je!=null,"missing offset"),mt(Je+3<Qe.length,"trying to write beyond buffer length"),st(Ke,4294967295)),Mt=Qe.length,!(Mt<=Je))for(var It=0,ot=Math.min(Mt-Je,4);It<ot;It++)Qe[Je+It]=Ke>>>8*(yt?It:3-It)&255}function Y(Qe,Ke,Je,yt,Mt){Mt||(mt(Ke!=null,"missing value"),mt(typeof yt=="boolean","missing or invalid endian"),mt(Je!=null,"missing offset"),mt(Je+1<Qe.length,"Trying to write beyond buffer length"),At(Ke,32767,-32768)),Qe.length<=Je||D(Qe,0<=Ke?Ke:65535+Ke+1,Je,yt,Mt)}function W(Qe,Ke,Je,yt,Mt){Mt||(mt(Ke!=null,"missing value"),mt(typeof yt=="boolean","missing or invalid endian"),mt(Je!=null,"missing offset"),mt(Je+3<Qe.length,"Trying to write beyond buffer length"),At(Ke,2147483647,-2147483648)),Qe.length<=Je||Z(Qe,0<=Ke?Ke:4294967295+Ke+1,Je,yt,Mt)}function ce(Qe,Ke,Je,yt,Mt){Mt||(mt(Ke!=null,"missing value"),mt(typeof yt=="boolean","missing or invalid endian"),mt(Je!=null,"missing offset"),mt(Je+3<Qe.length,"Trying to write beyond buffer length"),kt(Ke,34028234663852886e22,-34028234663852886e22)),Qe.length<=Je||m.write(Qe,Ke,Je,yt,23,4)}function he(Qe,Ke,Je,yt,Mt){Mt||(mt(Ke!=null,"missing value"),mt(typeof yt=="boolean","missing or invalid endian"),mt(Je!=null,"missing offset"),mt(Je+7<Qe.length,"Trying to write beyond buffer length"),kt(Ke,17976931348623157e292,-17976931348623157e292)),Qe.length<=Je||m.write(Qe,Ke,Je,yt,52,8)}r.Buffer=_,r.SlowBuffer=_,r.INSPECT_MAX_BYTES=50,_.poolSize=8192,_._useTypedArrays=function(){try{var Qe=new ArrayBuffer(0),Ke=new Uint8Array(Qe);return Ke.foo=function(){return 42},Ke.foo()===42&&typeof Ke.subarray=="function"}catch{return!1}}(),_.isEncoding=function(Qe){switch(String(Qe).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},_.isBuffer=function(Qe){return!(Qe==null||!Qe._isBuffer)},_.byteLength=function(Qe,Ke){var Je;switch(Qe+="",Ke||"utf8"){case"hex":Je=Qe.length/2;break;case"utf8":case"utf-8":Je=Ne(Qe).length;break;case"ascii":case"binary":case"raw":Je=Qe.length;break;case"base64":Je=Be(Qe).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":Je=2*Qe.length;break;default:throw new Error("Unknown encoding")}return Je},_.concat=function(Qe,Ke){if(mt(Me(Qe),`Usage: Buffer.concat(list, [totalLength])
|
|
@@ -14101,7 +14101,7 @@ ${r.stack}`),n.complete=!0,"root"in this&&this.root&&this.root.emit("asyncEffect
|
|
|
14101
14101
|
* Copyright (c) 2013-2015, 2017, Jon Schlinkert.
|
|
14102
14102
|
* Released under the MIT License.
|
|
14103
14103
|
*)
|
|
14104
|
-
*/const dci=({containerClassName:i,...e})=>{const t=_t.useRef(null),[n,r]=_t.useState(620);return _t.useLayoutEffect(()=>{const o=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;r(Math.min(Math.max(s,620),l))}};o();const a=new ResizeObserver(o);return t.current&&a.observe(t.current),window.addEventListener("resize",o),()=>{a.disconnect(),window.removeEventListener("resize",o)}},[]),lt.jsx("div",{ref:t,className:i||"rf-w-full rf-h-full",children:lt.jsx(uci,{...e,height:n})})},fci='*,: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.17 | 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-10{z-index:10}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.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-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-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-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-\\[300px\\]{max-height:300px}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.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-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-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-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-\\[148px\\]{min-width:148px}.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-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-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-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}.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}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.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-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/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-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-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-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-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-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-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-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-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-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-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-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,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-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-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-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-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/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-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\\/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-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-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-inline{display:inline}.sm\\:rf-hidden{display:none}.sm\\:rf-w-auto{width: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-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-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}',hci=()=>{_t.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=fci,document.head.appendChild(e)},[])},pci=i=>{_t.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i])},NIt=i=>`hsl(${l2.indexOf(i)*137.5%360}, 70%, 50%)`,Aci=({phaseTimings:i})=>{if(!i)return null;const e=Object.values(i).reduce((t,n)=>t+n,0);return lt.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[lt.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:l2.map(t=>{const n=i[t]||0,r=n/e*100;return lt.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:NIt(t)},children:lt.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,": ",n.toFixed(1),"ms"]})},t)})}),lt.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},gci=({renderLog:i})=>{const[e,t]=_t.useState("chronological");if(!i)return lt.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const n=Object.entries((i==null?void 0:i.phaseTimings)??{});e==="chronological"?n.sort((o,a)=>l2.indexOf(o[0])-l2.indexOf(a[0])):n.sort((o,a)=>a[1]-o[1]);const r=n.reduce((o,[a,s])=>o+s,0);return lt.jsxs("div",{className:"rf-bg-white",children:[lt.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[lt.jsx("div",{children:"Render Logs"}),lt.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[lt.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),lt.jsxs("select",{value:e,onChange:o=>t(o.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[lt.jsx("option",{value:"chronological",children:"Phase Order"}),lt.jsx("option",{value:"longest",children:"Duration"})]})]})]}),lt.jsx(Aci,{phaseTimings:i.phaseTimings}),lt.jsxs("table",{className:"rf-w-full rf-text-xs",children:[lt.jsx("thead",{children:lt.jsxs("tr",{children:[lt.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),lt.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),lt.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),lt.jsx("tbody",{children:n.map(([o,a])=>lt.jsxs("tr",{children:[lt.jsx("td",{className:"rf-p-2",children:l2.indexOf(o)}),lt.jsx("td",{className:"rf-p-2",children:o}),lt.jsx("td",{className:"rf-p-2",children:lt.jsx("div",{className:"rf-w-8",children:lt.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:NIt(o),width:`${a/r*100}%`}})})}),lt.jsx("td",{className:"rf-p-2",children:lt.jsxs("div",{className:"rf-flex w-full",children:[lt.jsxs("span",{className:"rf-flex-grow",children:[a,"ms"]}),lt.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(a/r*100).toFixed(1),"%"]})]})})]},o))})]})]})},TIt=({errorMessage:i,errorStack:e,circuitJsonErrors:t})=>{_t.useEffect(()=>{if(i){const n=new Error(i);e&&(n.stack=e);try{PV.captureException(n)}catch{}}},[i,e]),_t.useEffect(()=>{if(t&&t.length>0)for(const n of t){const r=new Error(n.message||"Circuit JSON Error");n.stack&&(r.stack=n.stack);try{PV.captureException(r,{error_type:n.type})}catch{}}},[t])},mci="0.0.755",GSe=JGe()(ZGe(i=>({lastRunEvalVersion:void 0,setLastRunEvalVersion:e=>{i({lastRunEvalVersion:e})}}),{name:"runframe-runner-store"})),yci=["assembly","bom","circuit_json","errors","render_log"],_ci=({code:i,fsMap:e,onRunClicked:t=void 0,errorMessage:n,errorStack:r,circuitJson:o,autoroutingGraphics:a,showRightHeaderContent:s=!0,showCodeTab:l=!1,codeTabContent:c,showJsonTab:u=!0,showRenderLogTab:d=!0,onActiveTabChange:f,renderLog:p,showImportAndFormatButtons:A=!0,className:m,headerClassName:_,leftHeaderContent:v,readOnly:x,isStreaming:I,autoroutingLog:M,onReportAutoroutingLog:G,isRunningCode:k,hasCodeChangedSinceLastRun:L,onEditEvent:R,editEvents:U,defaultActiveTab:D,defaultTab:Z,availableTabs:Y,autoRotate3dViewerDisabled:W,showSchematicDebugGrid:ce=!1,showToggleFullScreen:he=!0,defaultToFullScreen:ae=!1,activeEffectName:ve})=>{var Ke;hci();const ge=GSe(Je=>Je.lastRunEvalVersion),Me=_t.useMemo(()=>o?o.filter(Je=>Je&&"error_type"in Je||Je.type.includes("error")):null,[o]),De=_t.useMemo(()=>o?o.filter(Je=>Je&&"warning_type"in Je||Je.type.includes("warning")):null,[o]);TIt({errorMessage:n,errorStack:r,circuitJsonErrors:Me});const[Ne,Be]=_t.useState(D??Z??(Y==null?void 0:Y[0])??"pcb"),[ze,et]=_t.useState(null),[st,At]=_t.useState(ae);pci(st);const kt=_t.useCallback(Je=>{Be(Je),f==null||f(Je)},[f]),mt=()=>{At(!st)};_t.useEffect(()=>{n&&(Ne!=="errors"&&et(Ne),kt("errors"))},[n]),_t.useEffect(()=>{(Ne==="code"||Ne==="errors")&&o&&!n&&kt(ze??D??Z??(Y==null?void 0:Y[0])??"pcb")},[o]);const Qe=_t.useCallback(Je=>{window.TSCIRCUIT_3D_OBJECT_REF=Je===null?void 0:Je},[]);return lt.jsx("div",{className:$A("flex flex-col relative rf-overflow-x-hidden rf-h-full",m),children:lt.jsx("div",{className:$A("rf-md:sticky rf-md:top-2 rf-h-full",st&&"rf-fixed rf-top-0 rf-left-0 rf-w-full rf-h-full rf-bg-white rf-overflow-hidden"),children:lt.jsxs(L0e,{value:Ne,onValueChange:kt,className:"rf-flex-grow rf-flex rf-flex-col rf-h-full",children:[lt.jsxs("div",{className:$A("rf-flex rf-items-center rf-gap-2 rf-p-2 rf-pb-0",_),children:[v,v&<.jsx("div",{className:"rf-flex-grow"}),!v&&k&<.jsx(q6,{className:"rf-w-4 rf-h-4 rf-animate-spin"}),!v&<.jsx("div",{className:"rf-flex-grow"}),p&&p.progress!==1&&!n&<.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2",children:[ve?lt.jsx("div",{className:"rf-text-xs rf-text-gray-500",children:ve}):p.lastRenderEvent&<.jsx("div",{className:"rf-text-xs rf-text-gray-500",children:((Ke=p.lastRenderEvent)==null?void 0:Ke.phase)??""}),lt.jsx("div",{className:"rf-w-4 rf-h-4 rf-bg-blue-500 rf-opacity-50 rf-rounded-full rf-text-white",children:lt.jsx(q6,{className:"rf-w-4 rf-h-4 rf-animate-spin"})}),lt.jsxs("div",{className:"rf-text-xs rf-font-bold rf-text-gray-700 rf-tabular-nums",children:[((p.progress??0)*100).toFixed(1),"%"]})]}),s&<.jsxs(FV,{children:[l&<.jsx(yS,{value:"code",children:"Code"}),!Y||Y.includes("pcb")?lt.jsxs(yS,{value:"pcb",className:"rf-whitespace-nowrap",children:[o&<.jsx("span",{className:$A("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",L?"rf-bg-gray-500":"rf-bg-blue-500")}),"PCB"]}):null,!Y||Y.includes("schematic")?lt.jsxs(yS,{value:"schematic",className:"rf-whitespace-nowrap",children:[o&<.jsx("span",{className:$A("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",L?"rf-bg-gray-500":"rf-bg-blue-500")}),"Schematic"]}):null,!Y||Y.includes("cad")?lt.jsxs(yS,{value:"cad",children:[o&<.jsx("span",{className:$A("inline-flex items-center justify-center w-2 h-2 mr-1 text-xs font-bold text-white rounded-full",L?"rf-bg-gray-500":"rf-bg-blue-500")}),"3D"]}):null,!["pcb","cad","schematic"].includes(Ne)&<.jsx(yS,{value:Ne,children:rVe(Ne)}),lt.jsxs(Tbe,{children:[lt.jsx(kbe,{asChild:!0,children:lt.jsxs("div",{className:"rf-whitespace-nowrap rf-p-2 rf-mr-1 rf-cursor-pointer rf-relative",children:[lt.jsx(H6n,{className:"rf-w-4 rf-h-4"}),(Me&&Me.length>0||n)&<.jsx("span",{className:"rf-inline-flex rf-absolute rf-top-[6px] rf-right-[4px] rf-items-center rf-justify-center rf-w-1 rf-h-1 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full"})]})}),lt.jsxs(_J,{className:"rf-*:text-xs",children:[yci.filter(Je=>!Y||Y.includes(Je)).map(Je=>lt.jsxs(s5,{onSelect:()=>kt(Je),children:[Ne!==Je&<.jsx(dft,{className:"rf-w-3 rf-h-3 rf-opacity-30"}),Ne===Je&<.jsx(Kq,{className:"rf-w-3 rf-h-3"}),lt.jsx("div",{className:"rf-pr-2",children:rVe(Je)}),Je==="errors"&&(Me&&Me.length>0||n)&<.jsx("span",{className:"rf-inline-flex rf-items-center rf-justify-center rf-w-3 rf-h-3 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full",children:n?1:Me==null?void 0:Me.length})]},Je)),lt.jsx(s5,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:lt.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/runframe@",mci.split(".").map((Je,yt)=>yt===2?parseInt(Je)+1:Je).join(".")]})}),ge&<.jsx(s5,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:lt.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/eval@",ge]})})]})]})]}),he&<.jsx(yI,{onClick:mt,variant:"ghost",children:st?lt.jsx(K6n,{size:16}):lt.jsx(V6n,{size:16})})]}),l&<.jsx(M5,{value:"code",className:"rf-flex-grow rf-overflow-hidden",children:lt.jsx("div",{className:"rf-h-full",children:c})}),(!Y||Y.includes("pcb"))&<.jsx(M5,{value:"pcb",children:lt.jsx("div",{className:$A("rf-overflow-hidden",st?"rf-h-[calc(100vh-52px)]":"rf-h-full"),children:lt.jsx(l7,{fallbackRender:({error:Je})=>lt.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:lt.jsxs("div",{className:"rf-p-4",children:[lt.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading PCB viewer"}),lt.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Je==null?void 0:Je.message)||"An unknown error occurred"})]})}),children:o?lt.jsx(dci,{focusOnHover:!1,circuitJson:o,debugGraphics:a,containerClassName:$A("rf-h-full rf-w-full",st?"rf-min-h-[calc(100vh-240px)]":"rf-min-h-[620px]"),onEditEventsChanged:Je=>{if(R)for(const yt of Je)R(yt)}}):lt.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("assembly"))&<.jsx(M5,{value:"assembly",children:lt.jsx("div",{className:$A("rf-overflow-auto",st?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:lt.jsx(l7,{fallback:lt.jsx("div",{children:"Error loading Assembly"}),children:o?lt.jsx(pTn,{circuitJson:o,containerStyle:{height:"100%"},editingEnabled:!0,debugGrid:!0}):lt.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("schematic"))&<.jsx(M5,{value:"schematic",children:lt.jsx("div",{className:$A("rf-overflow-auto rf-bg-white",st?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:lt.jsx(l7,{fallbackRender:({error:Je})=>lt.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:lt.jsxs("div",{className:"rf-p-4",children:[lt.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Schematic"}),lt.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Je==null?void 0:Je.message)||"An unknown error occurred"})]})}),children:o?lt.jsx(dTn,{circuitJson:o,containerStyle:{height:"100%"},editingEnabled:!0,onEditEvent:Je=>{R==null||R(Je)},debugGrid:ce}):lt.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("cad"))&<.jsx(M5,{value:"cad",children:lt.jsx("div",{className:$A("rf-overflow-auto",st?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:lt.jsx(l7,{FallbackComponent:R6n,children:o?lt.jsx(B6n,{ref:Qe,circuitJson:o,autoRotateDisabled:W}):lt.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("bom"))&<.jsx(M5,{value:"bom",children:lt.jsx("div",{className:$A("rf-overflow-auto",st?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:lt.jsx(l7,{fallbackRender:({error:Je})=>lt.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:lt.jsxs("div",{className:"rf-p-4",children:[lt.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Bill of Materials"}),lt.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Je==null?void 0:Je.message)||"An unknown error occurred"})]})}),children:o?lt.jsx(_Tn,{circuitJson:o}):lt.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("circuit_json"))&<.jsx(M5,{value:"circuit_json",children:lt.jsx("div",{className:$A("rf-overflow-auto",st?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:lt.jsx(l7,{fallback:lt.jsx("div",{children:"Error loading JSON viewer"}),children:o?lt.jsx(mTn,{elements:o}):lt.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("errors"))&<.jsx(M5,{value:"errors",children:lt.jsx("div",{className:$A("rf-overflow-auto",st?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:n||Me&&Me.length>0||o?lt.jsx(k7n,{code:i,fsMap:e,circuitJsonErrors:Me,circuitJsonWarnings:De,errorMessage:n,errorStack:r,circuitJson:o,evalVersion:ge,autoroutingLog:M,onReportAutoroutingLog:G}):lt.jsx($6,{onRunClicked:t})})}),d&&(!Y||Y.includes("render_log"))&<.jsx(M5,{value:"render_log",children:lt.jsx(gci,{renderLog:p})})]})})})};var fee="Dialog",[kIt,PIt]=cS(fee),[vci,N3]=kIt(fee),LIt=i=>{const{__scopeDialog:e,children:t,open:n,defaultOpen:r,onOpenChange:o,modal:a=!0}=i,s=_t.useRef(null),l=_t.useRef(null),[c,u]=QM({prop:n,defaultProp:r??!1,onChange:o,caller:fee});return lt.jsx(vci,{scope:e,triggerRef:s,contentRef:l,contentId:eE(),titleId:eE(),descriptionId:eE(),open:c,onOpenChange:u,onOpenToggle:_t.useCallback(()=>u(d=>!d),[u]),modal:a,children:t})};LIt.displayName=fee;var FIt="DialogTrigger",UIt=_t.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(FIt,t),o=fI(e,r.triggerRef);return lt.jsx(d1.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":YSe(r.open),...n,ref:o,onClick:Lg(i.onClick,r.onOpenToggle)})});UIt.displayName=FIt;var zSe="DialogPortal",[xci,OIt]=kIt(zSe,{forceMount:void 0}),GIt=i=>{const{__scopeDialog:e,forceMount:t,children:n,container:r}=i,o=N3(zSe,e);return lt.jsx(xci,{scope:e,forceMount:t,children:_t.Children.map(n,a=>lt.jsx(E5,{present:t||o.open,children:lt.jsx(aJ,{asChild:!0,container:r,children:a})}))})};GIt.displayName=zSe;var hee="DialogOverlay",zIt=_t.forwardRef((i,e)=>{const t=OIt(hee,i.__scopeDialog),{forceMount:n=t.forceMount,...r}=i,o=N3(hee,i.__scopeDialog);return o.modal?lt.jsx(E5,{present:n||o.open,children:lt.jsx(bci,{...r,ref:e})}):null});zIt.displayName=hee;var Ici=RM("DialogOverlay.RemoveScroll"),bci=_t.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(hee,t);return lt.jsx(pJ,{as:Ici,allowPinchZoom:!0,shards:[r.contentRef],children:lt.jsx(d1.div,{"data-state":YSe(r.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),xR="DialogContent",HIt=_t.forwardRef((i,e)=>{const t=OIt(xR,i.__scopeDialog),{forceMount:n=t.forceMount,...r}=i,o=N3(xR,i.__scopeDialog);return lt.jsx(E5,{present:n||o.open,children:o.modal?lt.jsx(Cci,{...r,ref:e}):lt.jsx(Eci,{...r,ref:e})})});HIt.displayName=xR;var Cci=_t.forwardRef((i,e)=>{const t=N3(xR,i.__scopeDialog),n=_t.useRef(null),r=fI(e,t.contentRef,n);return _t.useEffect(()=>{const o=n.current;if(o)return vbe(o)},[]),lt.jsx(YIt,{...i,ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Lg(i.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=t.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Lg(i.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Lg(i.onFocusOutside,o=>o.preventDefault())})}),Eci=_t.forwardRef((i,e)=>{const t=N3(xR,i.__scopeDialog),n=_t.useRef(!1),r=_t.useRef(!1);return lt.jsx(YIt,{...i,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=i.onCloseAutoFocus)==null||a.call(i,o),o.defaultPrevented||(n.current||(s=t.triggerRef.current)==null||s.focus(),o.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:o=>{var l,c;(l=i.onInteractOutside)==null||l.call(i,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=o.target;((c=t.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&r.current&&o.preventDefault()}})}),YIt=_t.forwardRef((i,e)=>{const{__scopeDialog:t,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:o,...a}=i,s=N3(xR,t),l=_t.useRef(null),c=fI(e,l);return ebe(),lt.jsxs(lt.Fragment,{children:[lt.jsx(qq,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:o,children:lt.jsx(Xq,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":YSe(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),lt.jsxs(lt.Fragment,{children:[lt.jsx(wci,{titleId:s.titleId}),lt.jsx(Mci,{contentRef:l,descriptionId:s.descriptionId})]})]})}),HSe="DialogTitle",VIt=_t.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(HSe,t);return lt.jsx(d1.h2,{id:r.titleId,...n,ref:e})});VIt.displayName=HSe;var jIt="DialogDescription",KIt=_t.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(jIt,t);return lt.jsx(d1.p,{id:r.descriptionId,...n,ref:e})});KIt.displayName=jIt;var XIt="DialogClose",qIt=_t.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(XIt,t);return lt.jsx(d1.button,{type:"button",...n,ref:e,onClick:Lg(i.onClick,()=>r.onOpenChange(!1))})});qIt.displayName=XIt;function YSe(i){return i?"open":"closed"}var JIt="DialogTitleWarning",[Sci,ZIt]=Unn(JIt,{contentName:xR,titleName:HSe,docsSlug:"dialog"}),wci=({titleId:i})=>{const e=ZIt(JIt),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
14104
|
+
*/const dci=({containerClassName:i,...e})=>{const t=_t.useRef(null),[n,r]=_t.useState(620);return _t.useLayoutEffect(()=>{const o=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;r(Math.min(Math.max(s,620),l))}};o();const a=new ResizeObserver(o);return t.current&&a.observe(t.current),window.addEventListener("resize",o),()=>{a.disconnect(),window.removeEventListener("resize",o)}},[]),lt.jsx("div",{ref:t,className:i||"rf-w-full rf-h-full",children:lt.jsx(uci,{...e,height:n})})},fci='*,: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.17 | 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-10{z-index:10}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.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-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-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-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-\\[300px\\]{max-height:300px}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.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-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-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-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-\\[148px\\]{min-width:148px}.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-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-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-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}.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}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.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-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/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-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-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-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-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-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-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-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-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-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-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-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,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-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-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-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-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/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-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\\/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-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-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-inline{display:inline}.sm\\:rf-hidden{display:none}.sm\\:rf-w-auto{width: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-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-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}',hci=()=>{_t.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=fci,document.head.appendChild(e)},[])},pci=i=>{_t.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i])},NIt=i=>`hsl(${l2.indexOf(i)*137.5%360}, 70%, 50%)`,Aci=({phaseTimings:i})=>{if(!i)return null;const e=Object.values(i).reduce((t,n)=>t+n,0);return lt.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[lt.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:l2.map(t=>{const n=i[t]||0,r=n/e*100;return lt.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:NIt(t)},children:lt.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,": ",n.toFixed(1),"ms"]})},t)})}),lt.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},gci=({renderLog:i})=>{const[e,t]=_t.useState("chronological");if(!i)return lt.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const n=Object.entries((i==null?void 0:i.phaseTimings)??{});e==="chronological"?n.sort((o,a)=>l2.indexOf(o[0])-l2.indexOf(a[0])):n.sort((o,a)=>a[1]-o[1]);const r=n.reduce((o,[a,s])=>o+s,0);return lt.jsxs("div",{className:"rf-bg-white",children:[lt.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[lt.jsx("div",{children:"Render Logs"}),lt.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[lt.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),lt.jsxs("select",{value:e,onChange:o=>t(o.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[lt.jsx("option",{value:"chronological",children:"Phase Order"}),lt.jsx("option",{value:"longest",children:"Duration"})]})]})]}),lt.jsx(Aci,{phaseTimings:i.phaseTimings}),lt.jsxs("table",{className:"rf-w-full rf-text-xs",children:[lt.jsx("thead",{children:lt.jsxs("tr",{children:[lt.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),lt.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),lt.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),lt.jsx("tbody",{children:n.map(([o,a])=>lt.jsxs("tr",{children:[lt.jsx("td",{className:"rf-p-2",children:l2.indexOf(o)}),lt.jsx("td",{className:"rf-p-2",children:o}),lt.jsx("td",{className:"rf-p-2",children:lt.jsx("div",{className:"rf-w-8",children:lt.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:NIt(o),width:`${a/r*100}%`}})})}),lt.jsx("td",{className:"rf-p-2",children:lt.jsxs("div",{className:"rf-flex w-full",children:[lt.jsxs("span",{className:"rf-flex-grow",children:[a,"ms"]}),lt.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(a/r*100).toFixed(1),"%"]})]})})]},o))})]})]})},TIt=({errorMessage:i,errorStack:e,circuitJsonErrors:t})=>{_t.useEffect(()=>{if(i){const n=new Error(i);e&&(n.stack=e);try{PV.captureException(n)}catch{}}},[i,e]),_t.useEffect(()=>{if(t&&t.length>0)for(const n of t){const r=new Error(n.message||"Circuit JSON Error");n.stack&&(r.stack=n.stack);try{PV.captureException(r,{error_type:n.type})}catch{}}},[t])},mci="0.0.757",GSe=JGe()(ZGe(i=>({lastRunEvalVersion:void 0,setLastRunEvalVersion:e=>{i({lastRunEvalVersion:e})}}),{name:"runframe-runner-store"})),yci=["assembly","bom","circuit_json","errors","render_log"],_ci=({code:i,fsMap:e,onRunClicked:t=void 0,errorMessage:n,errorStack:r,circuitJson:o,autoroutingGraphics:a,showRightHeaderContent:s=!0,showCodeTab:l=!1,codeTabContent:c,showJsonTab:u=!0,showRenderLogTab:d=!0,onActiveTabChange:f,renderLog:p,showImportAndFormatButtons:A=!0,className:m,headerClassName:_,leftHeaderContent:v,readOnly:x,isStreaming:I,autoroutingLog:M,onReportAutoroutingLog:G,isRunningCode:k,hasCodeChangedSinceLastRun:L,onEditEvent:R,editEvents:U,defaultActiveTab:D,defaultTab:Z,availableTabs:Y,autoRotate3dViewerDisabled:W,showSchematicDebugGrid:ce=!1,showToggleFullScreen:he=!0,defaultToFullScreen:ae=!1,activeEffectName:ve})=>{var Ke;hci();const ge=GSe(Je=>Je.lastRunEvalVersion),Me=_t.useMemo(()=>o?o.filter(Je=>Je&&"error_type"in Je||Je.type.includes("error")):null,[o]),De=_t.useMemo(()=>o?o.filter(Je=>Je&&"warning_type"in Je||Je.type.includes("warning")):null,[o]);TIt({errorMessage:n,errorStack:r,circuitJsonErrors:Me});const[Ne,Be]=_t.useState(D??Z??(Y==null?void 0:Y[0])??"pcb"),[ze,et]=_t.useState(null),[st,At]=_t.useState(ae);pci(st);const kt=_t.useCallback(Je=>{Be(Je),f==null||f(Je)},[f]),mt=()=>{At(!st)};_t.useEffect(()=>{n&&(Ne!=="errors"&&et(Ne),kt("errors"))},[n]),_t.useEffect(()=>{(Ne==="code"||Ne==="errors")&&o&&!n&&kt(ze??D??Z??(Y==null?void 0:Y[0])??"pcb")},[o]);const Qe=_t.useCallback(Je=>{window.TSCIRCUIT_3D_OBJECT_REF=Je===null?void 0:Je},[]);return lt.jsx("div",{className:$A("flex flex-col relative rf-overflow-x-hidden rf-h-full",m),children:lt.jsx("div",{className:$A("rf-md:sticky rf-md:top-2 rf-h-full",st&&"rf-fixed rf-top-0 rf-left-0 rf-w-full rf-h-full rf-bg-white rf-overflow-hidden"),children:lt.jsxs(L0e,{value:Ne,onValueChange:kt,className:"rf-flex-grow rf-flex rf-flex-col rf-h-full",children:[lt.jsxs("div",{className:$A("rf-flex rf-items-center rf-gap-2 rf-p-2 rf-pb-0",_),children:[v,v&<.jsx("div",{className:"rf-flex-grow"}),!v&&k&<.jsx(q6,{className:"rf-w-4 rf-h-4 rf-animate-spin"}),!v&<.jsx("div",{className:"rf-flex-grow"}),p&&p.progress!==1&&!n&<.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2",children:[ve?lt.jsx("div",{className:"rf-text-xs rf-text-gray-500",children:ve}):p.lastRenderEvent&<.jsx("div",{className:"rf-text-xs rf-text-gray-500",children:((Ke=p.lastRenderEvent)==null?void 0:Ke.phase)??""}),lt.jsx("div",{className:"rf-w-4 rf-h-4 rf-bg-blue-500 rf-opacity-50 rf-rounded-full rf-text-white",children:lt.jsx(q6,{className:"rf-w-4 rf-h-4 rf-animate-spin"})}),lt.jsxs("div",{className:"rf-text-xs rf-font-bold rf-text-gray-700 rf-tabular-nums",children:[((p.progress??0)*100).toFixed(1),"%"]})]}),s&<.jsxs(FV,{children:[l&<.jsx(yS,{value:"code",children:"Code"}),!Y||Y.includes("pcb")?lt.jsxs(yS,{value:"pcb",className:"rf-whitespace-nowrap",children:[o&<.jsx("span",{className:$A("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",L?"rf-bg-gray-500":"rf-bg-blue-500")}),"PCB"]}):null,!Y||Y.includes("schematic")?lt.jsxs(yS,{value:"schematic",className:"rf-whitespace-nowrap",children:[o&<.jsx("span",{className:$A("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",L?"rf-bg-gray-500":"rf-bg-blue-500")}),"Schematic"]}):null,!Y||Y.includes("cad")?lt.jsxs(yS,{value:"cad",children:[o&<.jsx("span",{className:$A("inline-flex items-center justify-center w-2 h-2 mr-1 text-xs font-bold text-white rounded-full",L?"rf-bg-gray-500":"rf-bg-blue-500")}),"3D"]}):null,!["pcb","cad","schematic"].includes(Ne)&<.jsx(yS,{value:Ne,children:rVe(Ne)}),lt.jsxs(Tbe,{children:[lt.jsx(kbe,{asChild:!0,children:lt.jsxs("div",{className:"rf-whitespace-nowrap rf-p-2 rf-mr-1 rf-cursor-pointer rf-relative",children:[lt.jsx(H6n,{className:"rf-w-4 rf-h-4"}),(Me&&Me.length>0||n)&<.jsx("span",{className:"rf-inline-flex rf-absolute rf-top-[6px] rf-right-[4px] rf-items-center rf-justify-center rf-w-1 rf-h-1 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full"})]})}),lt.jsxs(_J,{className:"rf-*:text-xs",children:[yci.filter(Je=>!Y||Y.includes(Je)).map(Je=>lt.jsxs(s5,{onSelect:()=>kt(Je),children:[Ne!==Je&<.jsx(dft,{className:"rf-w-3 rf-h-3 rf-opacity-30"}),Ne===Je&<.jsx(Kq,{className:"rf-w-3 rf-h-3"}),lt.jsx("div",{className:"rf-pr-2",children:rVe(Je)}),Je==="errors"&&(Me&&Me.length>0||n)&<.jsx("span",{className:"rf-inline-flex rf-items-center rf-justify-center rf-w-3 rf-h-3 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full",children:n?1:Me==null?void 0:Me.length})]},Je)),lt.jsx(s5,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:lt.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/runframe@",mci.split(".").map((Je,yt)=>yt===2?parseInt(Je)+1:Je).join(".")]})}),ge&<.jsx(s5,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:lt.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/eval@",ge]})})]})]})]}),he&<.jsx(yI,{onClick:mt,variant:"ghost",children:st?lt.jsx(K6n,{size:16}):lt.jsx(V6n,{size:16})})]}),l&<.jsx(M5,{value:"code",className:"rf-flex-grow rf-overflow-hidden",children:lt.jsx("div",{className:"rf-h-full",children:c})}),(!Y||Y.includes("pcb"))&<.jsx(M5,{value:"pcb",children:lt.jsx("div",{className:$A("rf-overflow-hidden",st?"rf-h-[calc(100vh-52px)]":"rf-h-full"),children:lt.jsx(l7,{fallbackRender:({error:Je})=>lt.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:lt.jsxs("div",{className:"rf-p-4",children:[lt.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading PCB viewer"}),lt.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Je==null?void 0:Je.message)||"An unknown error occurred"})]})}),children:o?lt.jsx(dci,{focusOnHover:!1,circuitJson:o,debugGraphics:a,containerClassName:$A("rf-h-full rf-w-full",st?"rf-min-h-[calc(100vh-240px)]":"rf-min-h-[620px]"),onEditEventsChanged:Je=>{if(R)for(const yt of Je)R(yt)}}):lt.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("assembly"))&<.jsx(M5,{value:"assembly",children:lt.jsx("div",{className:$A("rf-overflow-auto",st?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:lt.jsx(l7,{fallback:lt.jsx("div",{children:"Error loading Assembly"}),children:o?lt.jsx(pTn,{circuitJson:o,containerStyle:{height:"100%"},editingEnabled:!0,debugGrid:!0}):lt.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("schematic"))&<.jsx(M5,{value:"schematic",children:lt.jsx("div",{className:$A("rf-overflow-auto rf-bg-white",st?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:lt.jsx(l7,{fallbackRender:({error:Je})=>lt.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:lt.jsxs("div",{className:"rf-p-4",children:[lt.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Schematic"}),lt.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Je==null?void 0:Je.message)||"An unknown error occurred"})]})}),children:o?lt.jsx(dTn,{circuitJson:o,containerStyle:{height:"100%"},editingEnabled:!0,onEditEvent:Je=>{R==null||R(Je)},debugGrid:ce}):lt.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("cad"))&<.jsx(M5,{value:"cad",children:lt.jsx("div",{className:$A("rf-overflow-auto",st?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:lt.jsx(l7,{FallbackComponent:R6n,children:o?lt.jsx(B6n,{ref:Qe,circuitJson:o,autoRotateDisabled:W}):lt.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("bom"))&<.jsx(M5,{value:"bom",children:lt.jsx("div",{className:$A("rf-overflow-auto",st?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:lt.jsx(l7,{fallbackRender:({error:Je})=>lt.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:lt.jsxs("div",{className:"rf-p-4",children:[lt.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Bill of Materials"}),lt.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Je==null?void 0:Je.message)||"An unknown error occurred"})]})}),children:o?lt.jsx(_Tn,{circuitJson:o}):lt.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("circuit_json"))&<.jsx(M5,{value:"circuit_json",children:lt.jsx("div",{className:$A("rf-overflow-auto",st?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:lt.jsx(l7,{fallback:lt.jsx("div",{children:"Error loading JSON viewer"}),children:o?lt.jsx(mTn,{elements:o}):lt.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("errors"))&<.jsx(M5,{value:"errors",children:lt.jsx("div",{className:$A("rf-overflow-auto",st?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:n||Me&&Me.length>0||o?lt.jsx(k7n,{code:i,fsMap:e,circuitJsonErrors:Me,circuitJsonWarnings:De,errorMessage:n,errorStack:r,circuitJson:o,evalVersion:ge,autoroutingLog:M,onReportAutoroutingLog:G}):lt.jsx($6,{onRunClicked:t})})}),d&&(!Y||Y.includes("render_log"))&<.jsx(M5,{value:"render_log",children:lt.jsx(gci,{renderLog:p})})]})})})};var fee="Dialog",[kIt,PIt]=cS(fee),[vci,N3]=kIt(fee),LIt=i=>{const{__scopeDialog:e,children:t,open:n,defaultOpen:r,onOpenChange:o,modal:a=!0}=i,s=_t.useRef(null),l=_t.useRef(null),[c,u]=QM({prop:n,defaultProp:r??!1,onChange:o,caller:fee});return lt.jsx(vci,{scope:e,triggerRef:s,contentRef:l,contentId:eE(),titleId:eE(),descriptionId:eE(),open:c,onOpenChange:u,onOpenToggle:_t.useCallback(()=>u(d=>!d),[u]),modal:a,children:t})};LIt.displayName=fee;var FIt="DialogTrigger",UIt=_t.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(FIt,t),o=fI(e,r.triggerRef);return lt.jsx(d1.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":YSe(r.open),...n,ref:o,onClick:Lg(i.onClick,r.onOpenToggle)})});UIt.displayName=FIt;var zSe="DialogPortal",[xci,OIt]=kIt(zSe,{forceMount:void 0}),GIt=i=>{const{__scopeDialog:e,forceMount:t,children:n,container:r}=i,o=N3(zSe,e);return lt.jsx(xci,{scope:e,forceMount:t,children:_t.Children.map(n,a=>lt.jsx(E5,{present:t||o.open,children:lt.jsx(aJ,{asChild:!0,container:r,children:a})}))})};GIt.displayName=zSe;var hee="DialogOverlay",zIt=_t.forwardRef((i,e)=>{const t=OIt(hee,i.__scopeDialog),{forceMount:n=t.forceMount,...r}=i,o=N3(hee,i.__scopeDialog);return o.modal?lt.jsx(E5,{present:n||o.open,children:lt.jsx(bci,{...r,ref:e})}):null});zIt.displayName=hee;var Ici=RM("DialogOverlay.RemoveScroll"),bci=_t.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(hee,t);return lt.jsx(pJ,{as:Ici,allowPinchZoom:!0,shards:[r.contentRef],children:lt.jsx(d1.div,{"data-state":YSe(r.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),xR="DialogContent",HIt=_t.forwardRef((i,e)=>{const t=OIt(xR,i.__scopeDialog),{forceMount:n=t.forceMount,...r}=i,o=N3(xR,i.__scopeDialog);return lt.jsx(E5,{present:n||o.open,children:o.modal?lt.jsx(Cci,{...r,ref:e}):lt.jsx(Eci,{...r,ref:e})})});HIt.displayName=xR;var Cci=_t.forwardRef((i,e)=>{const t=N3(xR,i.__scopeDialog),n=_t.useRef(null),r=fI(e,t.contentRef,n);return _t.useEffect(()=>{const o=n.current;if(o)return vbe(o)},[]),lt.jsx(YIt,{...i,ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Lg(i.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=t.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Lg(i.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Lg(i.onFocusOutside,o=>o.preventDefault())})}),Eci=_t.forwardRef((i,e)=>{const t=N3(xR,i.__scopeDialog),n=_t.useRef(!1),r=_t.useRef(!1);return lt.jsx(YIt,{...i,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=i.onCloseAutoFocus)==null||a.call(i,o),o.defaultPrevented||(n.current||(s=t.triggerRef.current)==null||s.focus(),o.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:o=>{var l,c;(l=i.onInteractOutside)==null||l.call(i,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=o.target;((c=t.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&r.current&&o.preventDefault()}})}),YIt=_t.forwardRef((i,e)=>{const{__scopeDialog:t,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:o,...a}=i,s=N3(xR,t),l=_t.useRef(null),c=fI(e,l);return ebe(),lt.jsxs(lt.Fragment,{children:[lt.jsx(qq,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:o,children:lt.jsx(Xq,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":YSe(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),lt.jsxs(lt.Fragment,{children:[lt.jsx(wci,{titleId:s.titleId}),lt.jsx(Mci,{contentRef:l,descriptionId:s.descriptionId})]})]})}),HSe="DialogTitle",VIt=_t.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(HSe,t);return lt.jsx(d1.h2,{id:r.titleId,...n,ref:e})});VIt.displayName=HSe;var jIt="DialogDescription",KIt=_t.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(jIt,t);return lt.jsx(d1.p,{id:r.descriptionId,...n,ref:e})});KIt.displayName=jIt;var XIt="DialogClose",qIt=_t.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(XIt,t);return lt.jsx(d1.button,{type:"button",...n,ref:e,onClick:Lg(i.onClick,()=>r.onOpenChange(!1))})});qIt.displayName=XIt;function YSe(i){return i?"open":"closed"}var JIt="DialogTitleWarning",[Sci,ZIt]=Unn(JIt,{contentName:xR,titleName:HSe,docsSlug:"dialog"}),wci=({titleId:i})=>{const e=ZIt(JIt),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
14105
14105
|
|
|
14106
14106
|
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
14107
14107
|
|