ShiboSoftwareDev/muse-reterminal-e1001-replacement

A four-layer ESP32-S3 e-paper carrier board with USB-C power, AMS1117 3.3V regulation, 24-pin FFC interface, reset/boot and user buttons, status LED, decoupling passives, test points, mounting holes, and ground/power planes.

Version
0.0.1
License
unset
Stars
0

dist/index.cjs

'use strict';

var jsxRuntime = require('react/jsx-runtime');
var react = require('react');
var tscircuit = require('tscircuit');

const pinLabels$4 = {
    pin1: ["pin1"],
    pin2: ["pin2"],
    pin3: ["pin3"],
    pin4: ["pin4"],
    pin5: ["pin5"],
    pin6: ["pin6"],
    pin7: ["pin7"],
    pin8: ["pin8"],
    pin9: ["pin9"],
    pin10: ["pin10"],
    pin11: ["pin11"],
    pin12: ["pin12"],
    pin13: ["pin13"],
    pin14: ["pin14"],
    pin15: ["pin15"],
    pin16: ["pin16"],
    pin17: ["pin17"],
    pin18: ["pin18"],
    pin19: ["pin19"],
    pin20: ["pin20"],
    pin21: ["pin21"],
    pin22: ["pin22"],
    pin23: ["pin23"],
    pin24: ["pin24"],
    pin25: ["pin25"],
    pin26: ["pin26"]
};
const pinAttributes$3 = {
    pin1: { requiresPower: true },
    pin2: { requiresGround: true },
};
const AFC01_S24FCA_00 = (props) => {
    return (jsxRuntime.jsx("chip", { pinLabels: pinLabels$4, pinAttributes: pinAttributes$3, supplierPartNumbers: {
            "jlcpcb": [
                "C262669"
            ]
        }, manufacturerPartNumber: "AFC01-S24FCA-00", footprint: "fpc24_p0.5mm_pw0.3mm_pl1.3mm_mpx14.9mm_mpy2.65mm_mpw2mm_mpl1.6mm", cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C262669.obj?uuid=f4bf300ddc81445bb004d4c904d70ad0",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C262669.step?uuid=f4bf300ddc81445bb004d4c904d70ad0",
            pcbRotationOffset: 0,
            modelOriginPosition: { x: -762000000804619e-19, y: 1.6320396499999106, z: -0.03 },
        }, ...props }));
};

const pinLabels$3 = {
    pin1: ["GND"],
    pin2: ["VOUT1"],
    pin3: ["VIN"],
    pin4: ["VOUT2"]
};
const pinAttributes$2 = {
    pin1: { requiresGround: true },
    pin3: { requiresPower: true }
};
const AMS1117_3_3 = (props) => {
    return (jsxRuntime.jsx("chip", { pinLabels: pinLabels$3, pinAttributes: pinAttributes$2, supplierPartNumbers: {
            "jlcpcb": [
                "C6186"
            ]
        }, manufacturerPartNumber: "AMS1117-3.3", footprint: "sot223_w8.0599mm_p2.3mm_pl2.5mm_pw1.1mm_tabpl2.34mm_tabpw3.6mm_taboffset0.08mm_rounded0_pin1location(rightside,bottom)", cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C6186.obj?uuid=e80246a9471445bfb635be848806a22e",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C6186.step?uuid=e80246a9471445bfb635be848806a22e",
            pcbRotationOffset: 180,
            modelOriginPosition: { x: -0.14002385000003414, y: -12700000070253736e-21, z: -0.049394 },
        }, ...props }));
};

const pinLabels$2 = {
    pin1: ["GND1"],
    pin2: ["3V3"],
    pin3: ["EN"],
    pin4: ["IO4"],
    pin5: ["IO5"],
    pin6: ["IO6"],
    pin7: ["IO7"],
    pin8: ["IO15"],
    pin9: ["IO16"],
    pin10: ["IO17"],
    pin11: ["IO18"],
    pin12: ["IO8"],
    pin13: ["IO19"],
    pin14: ["IO20"],
    pin15: ["IO3"],
    pin16: ["IO46"],
    pin17: ["IO9"],
    pin18: ["IO10"],
    pin19: ["IO11"],
    pin20: ["IO12"],
    pin21: ["IO13"],
    pin22: ["IO14"],
    pin23: ["IO21"],
    pin24: ["IO47"],
    pin25: ["IO48"],
    pin26: ["IO45"],
    pin27: ["IO0"],
    pin28: ["IO35"],
    pin29: ["IO36"],
    pin30: ["IO37"],
    pin31: ["IO38"],
    pin32: ["IO39"],
    pin33: ["IO40"],
    pin34: ["IO41"],
    pin35: ["IO42"],
    pin36: ["RXD0"],
    pin37: ["TXD0"],
    pin38: ["IO2"],
    pin39: ["IO1"],
    pin40: ["GND2"],
    pin41: ["GND3"]
};
const pinAttributes$1 = {
    pin1: { requiresGround: true },
    pin2: { requiresPower: true },
    pin40: { requiresGround: true },
    pin41: { requiresGround: true }
};
const ESP32_S3_WROOM_1_N16R8 = (props) => {
    return (jsxRuntime.jsx("chip", { pinLabels: pinLabels$2, pinAttributes: pinAttributes$1, supplierPartNumbers: {
            "jlcpcb": [
                "C2913202"
            ]
        }, manufacturerPartNumber: "ESP32-S3-WROOM-1-N16R8", footprint: jsxRuntime.jsxs("footprint", { children: [jsxRuntime.jsx("smtpad", { portHints: ["pin1"], pcbX: "-8.750046mm", pcbY: "9.0449527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin2"], pcbX: "-8.750046mm", pcbY: "7.7749527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin3"], pcbX: "-8.750046mm", pcbY: "6.5049527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin4"], pcbX: "-8.750046mm", pcbY: "5.2349527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin5"], pcbX: "-8.750046mm", pcbY: "3.9649527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin6"], pcbX: "-8.750046mm", pcbY: "2.6949527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin7"], pcbX: "-8.750046mm", pcbY: "1.4249527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin8"], pcbX: "-8.750046mm", pcbY: "0.1549527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin9"], pcbX: "-8.750046mm", pcbY: "-1.1150473mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin10"], pcbX: "-8.750046mm", pcbY: "-2.3850473mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin11"], pcbX: "-8.750046mm", pcbY: "-3.6550473mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin12"], pcbX: "-8.750046mm", pcbY: "-4.9250473mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin13"], pcbX: "-8.750046mm", pcbY: "-6.1950473mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin14"], pcbX: "-8.750046mm", pcbY: "-7.4650473mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin15"], pcbX: "-6.985mm", pcbY: "-8.7449533mm", width: "0.8999982mm", height: "1.499997mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin16"], pcbX: "-5.715mm", pcbY: "-8.7449533mm", width: "0.8999982mm", height: "1.499997mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin17"], pcbX: "-4.445mm", pcbY: "-8.7449533mm", width: "0.8999982mm", height: "1.499997mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin18"], pcbX: "-3.175mm", pcbY: "-8.7449533mm", width: "0.8999982mm", height: "1.499997mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin19"], pcbX: "-1.905mm", pcbY: "-8.7449533mm", width: "0.8999982mm", height: "1.499997mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin20"], pcbX: "-0.635mm", pcbY: "-8.7449533mm", width: "0.8999982mm", height: "1.499997mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin21"], pcbX: "0.635mm", pcbY: "-8.7449533mm", width: "0.8999982mm", height: "1.499997mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin22"], pcbX: "1.905mm", pcbY: "-8.7449533mm", width: "0.8999982mm", height: "1.499997mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin23"], pcbX: "3.175mm", pcbY: "-8.7449533mm", width: "0.8999982mm", height: "1.499997mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin24"], pcbX: "4.445mm", pcbY: "-8.7449533mm", width: "0.8999982mm", height: "1.499997mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin25"], pcbX: "5.715mm", pcbY: "-8.7449533mm", width: "0.8999982mm", height: "1.499997mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin26"], pcbX: "6.985mm", pcbY: "-8.7149813mm", width: "0.8999982mm", height: "1.499997mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin27"], pcbX: "8.750046mm", pcbY: "-7.4650473mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin28"], pcbX: "8.750046mm", pcbY: "-6.1950473mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin29"], pcbX: "8.750046mm", pcbY: "-4.9250473mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin30"], pcbX: "8.750046mm", pcbY: "-3.6550473mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin31"], pcbX: "8.750046mm", pcbY: "-2.3850473mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin32"], pcbX: "8.750046mm", pcbY: "-1.1150473mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin33"], pcbX: "8.750046mm", pcbY: "0.1549527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin34"], pcbX: "8.750046mm", pcbY: "1.4249527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin35"], pcbX: "8.750046mm", pcbY: "2.6949527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin36"], pcbX: "8.750046mm", pcbY: "3.9649527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin37"], pcbX: "8.750046mm", pcbY: "5.2349527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin38"], pcbX: "8.750046mm", pcbY: "6.5049527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin39"], pcbX: "8.750046mm", pcbY: "7.7749527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin40"], pcbX: "8.750046mm", pcbY: "9.0449527mm", width: "1.499997mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin41"], pcbX: "-0.100076mm", pcbY: "-0.0751713mm", width: "0.8999982mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin41"], pcbX: "-1.500124mm", pcbY: "-0.0751713mm", width: "0.8999982mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin41"], pcbX: "-2.900172mm", pcbY: "-0.0751713mm", width: "0.8999982mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin41"], pcbX: "-2.900172mm", pcbY: "2.7249247mm", width: "0.8999982mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin41"], pcbX: "-1.500124mm", pcbY: "2.7249247mm", width: "0.8999982mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin41"], pcbX: "-0.100076mm", pcbY: "2.7249247mm", width: "0.8999982mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin41"], pcbX: "-0.100076mm", pcbY: "1.3248767mm", width: "0.8999982mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin41"], pcbX: "-2.900172mm", pcbY: "1.3248767mm", width: "0.8999982mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin41"], pcbX: "-1.500124mm", pcbY: "1.3248767mm", width: "0.8999982mm", height: "0.8999982mm", shape: "rect" }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": 7.297165999999947, "y": 10.505351100000212 }, { "x": 7.297165999999947, "y": 15.38994890000015 }, { "x": 5.061966000000098, "y": 15.38994890000015 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": 5.265165999999795, "y": 10.505351100000212 }, { "x": 5.265165999999795, "y": 15.38994890000015 }, { "x": 2.4129999999998972, "y": 15.38994890000015 }, { "x": 2.4129999999998972, "y": 13.230948900000158 }, { "x": -0.1270000000000664, "y": 13.230948900000158 }, { "x": -0.1270000000000664, "y": 15.38994890000015 }, { "x": -2.66700000000003, "y": 15.38994890000015 }, { "x": -2.66700000000003, "y": 13.230948900000158 }, { "x": -4.953000000000088, "y": 13.230948900000158 }, { "x": -4.953000000000088, "y": 15.38994890000015 }, { "x": -7.239000000000033, "y": 15.38994890000015 }, { "x": -7.239000000000033, "y": 11.706948900000157 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -9.000007400000186, "y": 10.505351100000212 }, { "x": 9.016999999999939, "y": 10.505351100000212 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": 9.016999999999939, "y": 9.726104500000133 }, { "x": 9.016999999999939, "y": 16.53294890000018 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": 7.666151799999966, "y": -8.994051099999865 }, { "x": 9.016999999999939, "y": -8.994051099999865 }, { "x": 9.016999999999939, "y": -8.14619909999999 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -9.000007400000186, "y": -8.14619909999999 }, { "x": -9.000007400000186, "y": -8.994051099999865 }, { "x": -7.66615180000008, "y": -8.994051099999865 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -9.000007400000186, "y": 16.544963100000018 }, { "x": -9.000007400000186, "y": 9.726104500000133 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": 9.000007400000072, "y": 16.544963100000018 }, { "x": -9.000007400000186, "y": 16.544963100000018 }] }), jsxRuntime.jsx("silkscreentext", { text: "{NAME}", pcbX: "-0mm", pcbY: "17.5633527mm", anchorAlignment: "center", fontSize: "1mm" }), jsxRuntime.jsx("fabricationnotepath", { route: [{ "x": -7.239000000000033, "y": 15.516948900000102 }, { "x": -7.2555862000001525, "y": 15.5158567000002 }, { "x": -7.2718675999999505, "y": 15.51263090000009 }, { "x": -7.287590200000068, "y": 15.507271500000115 }, { "x": -7.302500000000009, "y": 15.499930900000095 }, { "x": -7.316317600000048, "y": 15.490710700000136 }, { "x": -7.328814400000056, "y": 15.479763300000059 }, { "x": -7.339761800000019, "y": 15.467266500000164 }, { "x": -7.348982000000092, "y": 15.453448900000126 }, { "x": -7.356322599999999, "y": 15.438539100000071 }, { "x": -7.361682000000087, "y": 15.422816500000181 }, { "x": -7.364907800000083, "y": 15.406535100000042 }, { "x": -7.366000000000099, "y": 15.38994890000015 }, { "x": -7.366000000000099, "y": 11.706948900000043 }, { "x": -7.364907800000083, "y": 11.69036270000015 }, { "x": -7.361682000000087, "y": 11.674081300000012 }, { "x": -7.356322599999999, "y": 11.658358700000122 }, { "x": -7.348982000000092, "y": 11.643448900000067 }, { "x": -7.339761800000019, "y": 11.629631300000142 }, { "x": -7.328814400000056, "y": 11.617134500000134 }, { "x": -7.316317600000048, "y": 11.606187100000056 }, { "x": -7.302500000000009, "y": 11.596966900000098 }, { "x": -7.287590200000068, "y": 11.589626300000077 }, { "x": -7.2718675999999505, "y": 11.584266900000102 }, { "x": -7.2555862000001525, "y": 11.581041099999993 }, { "x": -7.239000000000033, "y": 11.57994890000009 }, { "x": -7.222413799999913, "y": 11.581041099999993 }, { "x": -7.206132400000229, "y": 11.584266900000102 }, { "x": -7.190409799999998, "y": 11.589626300000077 }, { "x": -7.175500000000056, "y": 11.596966900000098 }, { "x": -7.161682400000018, "y": 11.606187100000056 }, { "x": -7.14918560000001, "y": 11.617134500000134 }, { "x": -7.13823820000016, "y": 11.629631300000142 }, { "x": -7.129017999999974, "y": 11.643448900000067 }, { "x": -7.121677400000067, "y": 11.658358700000122 }, { "x": -7.116317999999978, "y": 11.674081300000012 }, { "x": -7.113092199999983, "y": 11.69036270000015 }, { "x": -7.11200000000008, "y": 11.706948900000043 }, { "x": -7.11200000000008, "y": 15.262948900000083 }, { "x": -5.080000000000041, "y": 15.262948900000083 }, { "x": -5.080000000000041, "y": 13.230948900000044 }, { "x": -5.078907800000138, "y": 13.214362700000152 }, { "x": -5.075682000000143, "y": 13.198081300000013 }, { "x": -5.070322600000054, "y": 13.182358700000123 }, { "x": -5.062982000000034, "y": 13.167448900000068 }, { "x": -5.053761799999961, "y": 13.153631300000143 }, { "x": -5.0428143999999975, "y": 13.141134500000135 }, { "x": -5.030317600000103, "y": 13.130187100000057 }, { "x": -5.016500000000065, "y": 13.120966900000099 }, { "x": -5.00159020000001, "y": 13.113626300000078 }, { "x": -4.985867599999892, "y": 13.108266900000103 }, { "x": -4.969586200000208, "y": 13.105041099999994 }, { "x": -4.953000000000088, "y": 13.103948900000091 }, { "x": -2.66700000000003, "y": 13.103948900000091 }, { "x": -2.6504137999999102, "y": 13.105041099999994 }, { "x": -2.634132400000226, "y": 13.108266900000103 }, { "x": -2.618409799999995, "y": 13.113626300000078 }, { "x": -2.6035000000000537, "y": 13.120966900000099 }, { "x": -2.589682400000015, "y": 13.130187100000057 }, { "x": -2.577185600000007, "y": 13.141134500000135 }, { "x": -2.566238200000157, "y": 13.153631300000143 }, { "x": -2.557017999999971, "y": 13.167448900000068 }, { "x": -2.549677400000064, "y": 13.182358700000123 }, { "x": -2.5443179999999757, "y": 13.198081300000013 }, { "x": -2.54109219999998, "y": 13.214362700000152 }, { "x": -2.5400000000000773, "y": 13.230948900000044 }, { "x": -2.5400000000000773, "y": 15.262948900000083 }, { "x": -0.2540000000000191, "y": 15.262948900000083 }, { "x": -0.2540000000000191, "y": 13.230948900000044 }, { "x": -0.25290780000011637, "y": 13.214362700000152 }, { "x": -0.24968200000012075, "y": 13.198081300000013 }, { "x": -0.24432260000003225, "y": 13.182358700000123 }, { "x": -0.23698200000012548, "y": 13.167448900000068 }, { "x": -0.22776179999993929, "y": 13.153631300000143 }, { "x": -0.21681440000008934, "y": 13.141134500000135 }, { "x": -0.20431760000008126, "y": 13.130187100000057 }, { "x": -0.19050000000004275, "y": 13.120966900000099 }, { "x": -0.1755902000001015, "y": 13.113626300000078 }, { "x": -0.15986759999987044, "y": 13.108266900000103 }, { "x": -0.14358620000018618, "y": 13.105041099999994 }, { "x": -0.1270000000000664, "y": 13.103948900000091 }, { "x": 2.4129999999998972, "y": 13.103948900000091 }, { "x": 2.429586200000017, "y": 13.105041099999994 }, { "x": 2.445867599999815, "y": 13.108266900000103 }, { "x": 2.4615901999999323, "y": 13.113626300000078 }, { "x": 2.4764999999998736, "y": 13.120966900000099 }, { "x": 2.490317599999912, "y": 13.130187100000057 }, { "x": 2.50281439999992, "y": 13.141134500000135 }, { "x": 2.51376179999977, "y": 13.153631300000143 }, { "x": 2.52298200000007, "y": 13.167448900000068 }, { "x": 2.5303225999999768, "y": 13.182358700000123 }, { "x": 2.5356820000000653, "y": 13.198081300000013 }, { "x": 2.538907799999947, "y": 13.214362700000152 }, { "x": 2.53999999999985, "y": 13.230948900000044 }, { "x": 2.53999999999985, "y": 15.262948900000083 }, { "x": 5.06196599999987, "y": 15.262948900000083 }, { "x": 5.138166000000069, "y": 15.262948900000083 }, { "x": 5.138166000000069, "y": 10.505351100000098 }, { "x": 5.139258199999972, "y": 10.488764900000092 }, { "x": 5.142483999999854, "y": 10.472483500000067 }, { "x": 5.1478433999999424, "y": 10.456760900000177 }, { "x": 5.155183999999849, "y": 10.441851100000122 }, { "x": 5.164404200000149, "y": 10.428033500000083 }, { "x": 5.175351599999999, "y": 10.415536700000189 }, { "x": 5.187848400000007, "y": 10.404589300000112 }, { "x": 5.201666000000046, "y": 10.395369100000153 }, { "x": 5.216575799999987, "y": 10.388028500000132 }, { "x": 5.232298399999877, "y": 10.382669100000044 }, { "x": 5.248579799999902, "y": 10.379443300000162 }, { "x": 5.265166000000022, "y": 10.378351100000032 }, { "x": 5.281752199999914, "y": 10.379443300000162 }, { "x": 5.29803359999994, "y": 10.382669100000044 }, { "x": 5.313756200000057, "y": 10.388028500000132 }, { "x": 5.328665999999998, "y": 10.395369100000153 }, { "x": 5.3424835999998095, "y": 10.404589300000112 }, { "x": 5.354980400000045, "y": 10.415536700000189 }, { "x": 5.365927799999895, "y": 10.428033500000083 }, { "x": 5.37514799999974, "y": 10.441851100000122 }, { "x": 5.382488599999874, "y": 10.456760900000177 }, { "x": 5.387847999999963, "y": 10.472483500000067 }, { "x": 5.391073800000072, "y": 10.488764900000092 }, { "x": 5.392165999999975, "y": 10.505351100000098 }, { "x": 5.392165999999975, "y": 15.262948900000083 }, { "x": 7.170165999999995, "y": 15.262948900000083 }, { "x": 7.170165999999995, "y": 10.505351100000098 }, { "x": 7.171258199999897, "y": 10.488764900000092 }, { "x": 7.174484000000007, "y": 10.472483500000067 }, { "x": 7.179843400000095, "y": 10.456760900000177 }, { "x": 7.187184000000002, "y": 10.441851100000122 }, { "x": 7.1964042000000745, "y": 10.428033500000083 }, { "x": 7.2073515999999245, "y": 10.415536700000189 }, { "x": 7.2198483999999326, "y": 10.404589300000112 }, { "x": 7.233665999999971, "y": 10.395369100000153 }, { "x": 7.248575799999912, "y": 10.388028500000132 }, { "x": 7.26429840000003, "y": 10.382669100000044 }, { "x": 7.280579800000055, "y": 10.379443300000162 }, { "x": 7.297165999999947, "y": 10.378351100000032 }, { "x": 7.31375219999984, "y": 10.379443300000162 }, { "x": 7.3300336000000925, "y": 10.382669100000044 }, { "x": 7.3457561999999825, "y": 10.388028500000132 }, { "x": 7.360665999999924, "y": 10.395369100000153 }, { "x": 7.374483599999735, "y": 10.404589300000112 }, { "x": 7.38698039999997, "y": 10.415536700000189 }, { "x": 7.39792779999982, "y": 10.428033500000083 }, { "x": 7.407147999999893, "y": 10.441851100000122 }, { "x": 7.414488600000027, "y": 10.456760900000177 }, { "x": 7.4198480000001155, "y": 10.472483500000067 }, { "x": 7.423073799999997, "y": 10.488764900000092 }, { "x": 7.4241659999999, "y": 10.505351100000098 }, { "x": 7.4241659999999, "y": 15.38994890000015 }, { "x": 7.423073799999997, "y": 15.406535100000042 }, { "x": 7.4198480000001155, "y": 15.422816500000181 }, { "x": 7.414488600000027, "y": 15.438539100000071 }, { "x": 7.407147999999893, "y": 15.453448900000126 }, { "x": 7.39792779999982, "y": 15.467266500000164 }, { "x": 7.38698039999997, "y": 15.479763300000059 }, { "x": 7.374483599999735, "y": 15.490710700000136 }, { "x": 7.360665999999924, "y": 15.499930900000095 }, { "x": 7.3457561999999825, "y": 15.507271500000115 }, { "x": 7.3300336000000925, "y": 15.51263090000009 }, { "x": 7.31375219999984, "y": 15.5158567000002 }, { "x": 7.297165999999947, "y": 15.516948900000102 }, { "x": 5.265166000000022, "y": 15.516948900000102 }, { "x": 5.06196599999987, "y": 15.516948900000102 }, { "x": 2.4129999999998972, "y": 15.516948900000102 }, { "x": 2.3964137999997774, "y": 15.5158567000002 }, { "x": 2.380132400000207, "y": 15.51263090000009 }, { "x": 2.364409799999862, "y": 15.507271500000115 }, { "x": 2.349499999999921, "y": 15.499930900000095 }, { "x": 2.3356823999998824, "y": 15.490710700000136 }, { "x": 2.3231855999998743, "y": 15.479763300000059 }, { "x": 2.3122382000000243, "y": 15.467266500000164 }, { "x": 2.303017999999952, "y": 15.453448900000126 }, { "x": 2.295677400000045, "y": 15.438539100000071 }, { "x": 2.2903179999999566, "y": 15.422816500000181 }, { "x": 2.2870921999998473, "y": 15.406535100000042 }, { "x": 2.2859999999999445, "y": 15.38994890000015 }, { "x": 2.2859999999999445, "y": 13.35794890000011 }, { "x": 0, "y": 13.35794890000011 }, { "x": 0, "y": 15.38994890000015 }, { "x": -0.001092200000016419, "y": 15.406535100000042 }, { "x": -0.0043180000000120344, "y": 15.422816500000181 }, { "x": -0.009677400000100533, "y": 15.438539100000071 }, { "x": -0.017018000000007305, "y": 15.453448900000126 }, { "x": -0.026238200000079814, "y": 15.467266500000164 }, { "x": -0.03718560000004345, "y": 15.479763300000059 }, { "x": -0.04968240000005153, "y": 15.490710700000136 }, { "x": -0.06350000000009004, "y": 15.499930900000095 }, { "x": -0.07840980000003128, "y": 15.507271500000115 }, { "x": -0.09413240000014866, "y": 15.51263090000009 }, { "x": -0.1104137999999466, "y": 15.5158567000002 }, { "x": -0.1270000000000664, "y": 15.516948900000102 }, { "x": -2.66700000000003, "y": 15.516948900000102 }, { "x": -2.68358620000015, "y": 15.5158567000002 }, { "x": -2.6998675999999477, "y": 15.51263090000009 }, { "x": -2.715590200000065, "y": 15.507271500000115 }, { "x": -2.7305000000000064, "y": 15.499930900000095 }, { "x": -2.744317600000045, "y": 15.490710700000136 }, { "x": -2.756814400000053, "y": 15.479763300000059 }, { "x": -2.7677618000000166, "y": 15.467266500000164 }, { "x": -2.776982000000089, "y": 15.453448900000126 }, { "x": -2.784322599999996, "y": 15.438539100000071 }, { "x": -2.7896820000000844, "y": 15.422816500000181 }, { "x": -2.79290780000008, "y": 15.406535100000042 }, { "x": -2.7940000000000964, "y": 15.38994890000015 }, { "x": -2.7940000000000964, "y": 13.35794890000011 }, { "x": -4.826000000000022, "y": 13.35794890000011 }, { "x": -4.826000000000022, "y": 15.38994890000015 }, { "x": -4.827092200000038, "y": 15.406535100000042 }, { "x": -4.830318000000034, "y": 15.422816500000181 }, { "x": -4.835677400000122, "y": 15.438539100000071 }, { "x": -4.843018000000029, "y": 15.453448900000126 }, { "x": -4.852238200000102, "y": 15.467266500000164 }, { "x": -4.863185600000065, "y": 15.479763300000059 }, { "x": -4.87568239999996, "y": 15.490710700000136 }, { "x": -4.889499999999998, "y": 15.499930900000095 }, { "x": -4.904409800000053, "y": 15.507271500000115 }, { "x": -4.9201324000001705, "y": 15.51263090000009 }, { "x": -4.936413799999855, "y": 15.5158567000002 }, { "x": -4.953000000000088, "y": 15.516948900000102 }, { "x": -7.239000000000033, "y": 15.516948900000102 }], strokeWidth: "0.254mm" }), jsxRuntime.jsx("courtyardoutline", { outline: [{ "x": -9.7496000000001, "y": 16.813352699999996 }, { "x": 9.749599999999987, "y": 16.813352699999996 }, { "x": 9.749599999999987, "y": -9.74704729999985 }, { "x": -9.7496000000001, "y": -9.74704729999985 }, { "x": -9.7496000000001, "y": 16.813352699999996 }] })] }), cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C2913202.obj?uuid=ff306e3ed51d4ebc94ebabcd1b4d8906",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C2913202.step?uuid=ff306e3ed51d4ebc94ebabcd1b4d8906",
            pcbRotationOffset: 0,
            modelOriginPosition: { x: 0, y: -3.8004924000000644, z: -0.01 },
        }, ...props }));
};

const pinLabels$1 = {
    pin1: ["A"],
    pin2: ["B"],
    pin3: ["C"],
    pin4: ["D"]
};
const TS_1187A_B_A_B = (props) => {
    const { name = "SW1", ...restProps } = props;
    return (jsxRuntime.jsx("pushbutton", { name: name, pinLabels: pinLabels$1, supplierPartNumbers: {
            "jlcpcb": [
                "C318884"
            ]
        }, manufacturerPartNumber: "TS-1187A-B-A-B", footprint: "smdpushbutton4_px6mm_py3.7mm_pw1mm_ph0.75mm", cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C318884.obj?uuid=91b67c1735f643ffb2e7226c23dd3492",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C318884.step?uuid=91b67c1735f643ffb2e7226c23dd3492",
            pcbRotationOffset: 0,
            modelOriginPosition: { x: 0.000012700000070253736, y: 0.0004999999999999449, z: -0.05 },
        }, ...restProps }));
};

const pinLabels = {
    pin7: ["EH"],
    pin8: ["B12", "GND1"],
    pin9: ["B9", "VBUS1"],
    pin10: ["A5", "CC1"],
    pin11: ["B5", "CC2"],
    pin12: ["A9", "VBUS2"],
    pin13: ["A12", "GND2"]
};
const pinAttributes = {
    pin8: { requiresGround: true },
    pin9: { requiresPower: true },
    pin12: { requiresPower: true },
    pin13: { requiresGround: true },
};
const TYPE_C_6P = (props) => {
    return (jsxRuntime.jsx("chip", { pinLabels: pinLabels, pinAttributes: pinAttributes, supplierPartNumbers: {
            "jlcpcb": [
                "C456012"
            ]
        }, manufacturerPartNumber: "TYPE-C 6P", footprint: jsxRuntime.jsxs("footprint", { children: [jsxRuntime.jsx("platedhole", { portHints: ["pin7"], pcbX: "4.319905mm", pcbY: "-2.3000144mm", holeWidth: "0.5999988mm", holeHeight: "1.3999972mm", outerWidth: "1.0999978mm", outerHeight: "1.8999962mm", shape: "pill" }), jsxRuntime.jsx("platedhole", { portHints: ["pin7"], pcbX: "-4.319905mm", pcbY: "-2.3000144mm", holeWidth: "0.5999988mm", holeHeight: "1.3999972mm", outerWidth: "1.0999978mm", outerHeight: "1.8999962mm", shape: "pill" }), jsxRuntime.jsx("platedhole", { portHints: ["pin7"], pcbX: "4.319905mm", pcbY: "1.5000796mm", holeWidth: "0.5999988mm", holeHeight: "1.3999972mm", outerWidth: "1.0999978mm", outerHeight: "1.8999962mm", shape: "pill" }), jsxRuntime.jsx("platedhole", { portHints: ["pin7"], pcbX: "-4.319905mm", pcbY: "1.5000796mm", holeWidth: "0.5999988mm", holeHeight: "1.3999972mm", outerWidth: "1.0999978mm", outerHeight: "1.8999962mm", shape: "pill" }), jsxRuntime.jsx("smtpad", { portHints: ["pin8"], pcbX: "-2.699893mm", pcbY: "1.7500156mm", width: "0.7999984mm", height: "1.1999976mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin9"], pcbX: "-1.499997mm", pcbY: "1.7500156mm", width: "0.6999986mm", height: "1.1999976mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin10"], pcbX: "-0.499999mm", pcbY: "1.7500156mm", width: "0.6999986mm", height: "1.1999976mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin11"], pcbX: "0.499999mm", pcbY: "1.7500156mm", width: "0.6999986mm", height: "1.1999976mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin12"], pcbX: "1.499997mm", pcbY: "1.7500156mm", width: "0.6999986mm", height: "1.1999976mm", shape: "rect" }), jsxRuntime.jsx("smtpad", { portHints: ["pin13"], pcbX: "2.699893mm", pcbY: "1.7500156mm", width: "0.7999984mm", height: "1.1999976mm", shape: "rect" }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": 3.3291271999999026, "y": 1.9000279999999066 }, { "x": 3.540759999999864, "y": 1.9000279999999066 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -3.540760000000091, "y": 1.9000279999999066 }, { "x": -3.32912720000013, "y": 1.9000279999999066 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -4.499991000000136, "y": 0.3000311999999212 }, { "x": -4.499991000000136, "y": 0.34211899999991147 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -4.499991000000136, "y": 0.3000311999999212 }, { "x": -4.499991000000136, "y": -1.1422823999999991 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": 4.499990999999909, "y": -1.099965999999995 }, { "x": 4.499990999999909, "y": 0.35011999999994714 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -4.5007530000000315, "y": -3.5011804000000666 }, { "x": -4.5007530000000315, "y": -3.4783204000001433 }, { "x": -4.5007530000000315, "y": -4.900720399999955 }, { "x": 4.501006999999959, "y": -4.900720399999955 }, { "x": 4.501006999999959, "y": -3.5011804000000666 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -0.4000246000000516, "y": 0.5000307999999904 }, { "x": -0.4000246000000516, "y": 0.7000304000000597 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": 0.9999725999999782, "y": 0.10003159999996569 }, { "x": 0.9999725999999782, "y": 0.5000307999999904 }, { "x": 0.39997379999988425, "y": 0.5000307999999904 }, { "x": 0.39997379999988425, "y": 0.7000304000000597 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -1.0000234000000319, "y": 0.10003159999996569 }, { "x": -1.0000234000000319, "y": 0.5000307999999904 }, { "x": -0.4000246000000516, "y": 0.5000307999999904 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -1.0100310000000263, "y": 0.10003159999996569 }, { "x": 1.0099801999999727, "y": 0.10003159999996569 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -2.817672800000082, "y": -3.7332093999999643 }, { "x": -2.3198328000000856, "y": -1.2313094000001001 }, { "x": -1.0193528000000924, "y": -1.2313094000001001 }, { "x": -0.5189728000000287, "y": -3.7332093999999643 }, { "x": -1.0142728000000716, "y": -3.7332093999999643 }, { "x": -1.4130528000000595, "y": -1.6326294000000416 }, { "x": -1.9413728000000674, "y": -1.6326294000000416 }, { "x": -2.3426928000001226, "y": -3.7332093999999643 }, { "x": -2.817672800000082, "y": -3.7332093999999643 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -2.517952800000103, "y": -2.4327294000000848 }, { "x": -2.119172800000115, "y": -2.4327294000000848 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": -1.2185904000000392, "y": -2.4324245999999903 }, { "x": -0.8185912000000144, "y": -2.4324245999999903 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": 2.0581873999999516, "y": -2.427344600000083 }, { "x": 2.4581865999999764, "y": -2.427344600000083 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": 0.758824999999888, "y": -2.42764939999995 }, { "x": 1.1576049999998759, "y": -2.42764939999995 }] }), jsxRuntime.jsx("silkscreenpath", { route: [{ "x": 0.4591050000000223, "y": -3.7281293999999434 }, { "x": 0.9569449999999051, "y": -1.2262294000000793 }, { "x": 2.257425000000012, "y": -1.2262294000000793 }, { "x": 2.757804999999962, "y": -3.7281293999999434 }, { "x": 2.262504999999919, "y": -3.7281293999999434 }, { "x": 1.8637249999999312, "y": -1.627549399999907 }, { "x": 1.3354049999999233, "y": -1.627549399999907 }, { "x": 0.9340849999999818, "y": -3.7281293999999434 }, { "x": 0.4591050000000223, "y": -3.7281293999999434 }] }), jsxRuntime.jsx("silkscreentext", { text: "{NAME}", pcbX: "0.002667mm", pcbY: "3.4424196mm", anchorAlignment: "center", fontSize: "1mm" }), jsxRuntime.jsx("fabricationnotepath", { route: [{ "x": -2.999994000000015, "y": -3.899960399999941 }, { "x": -2.999994000000015, "y": -0.39996740000003683 }, { "x": -2.4999950000000126, "y": -0.39996740000003683 }, { "x": -2.4999950000000126, "y": -3.899960399999941 }, { "x": -2.999994000000015, "y": -3.899960399999941 }], strokeWidth: "0.254mm" }), jsxRuntime.jsx("fabricationnotepath", { route: [{ "x": 2.9999939999999015, "y": -3.899960399999941 }, { "x": 2.9999939999999015, "y": -0.39996740000003683 }, { "x": 2.499994999999899, "y": -0.39996740000003683 }, { "x": 2.499994999999899, "y": -3.899960399999941 }, { "x": 2.9999939999999015, "y": -3.899960399999941 }], strokeWidth: "0.254mm" }), jsxRuntime.jsx("fabricationnotepath", { route: [{ "x": -2.4999950000000126, "y": -0.39996740000003683 }, { "x": 2.499994999999899, "y": -0.39996740000003683 }, { "x": 2.499994999999899, "y": -0.899966400000153 }, { "x": -2.4999950000000126, "y": -0.899966400000153 }, { "x": -2.4999950000000126, "y": -0.39996740000003683 }], strokeWidth: "0.254mm" }), jsxRuntime.jsx("fabricationnotepath", { route: [{ "x": -0.4999990000001162, "y": -4.399959400000057 }, { "x": 0.4999990000000025, "y": -4.399959400000057 }, { "x": -11368683772161603e-29, "y": -4.8999584000000596 }, { "x": -0.4999990000001162, "y": -4.399959400000057 }], strokeWidth: "0.254mm" }), jsxRuntime.jsx("fabricationnotepath", { route: [{ "x": -11368683772161603e-29, "y": -4.399959400000057 }, { "x": -0.09999980000009145, "y": -4.399959400000057 }, { "x": -0.09999980000009145, "y": -2.399963400000047 }, { "x": 0.09999979999997777, "y": -2.399963400000047 }, { "x": 0.09999979999997777, "y": -4.399959400000057 }, { "x": -11368683772161603e-29, "y": -4.399959400000057 }], strokeWidth: "0.254mm" }), jsxRuntime.jsx("courtyardoutline", { outline: [{ "x": -5.111433000000034, "y": 2.69241959999988 }, { "x": 5.116766999999982, "y": 2.69241959999988 }, { "x": 5.116766999999982, "y": -5.198980400000096 }, { "x": -5.111433000000034, "y": -5.198980400000096 }, { "x": -5.111433000000034, "y": 2.69241959999988 }] })] }), cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C456012.obj?uuid=a8c86ef7d632469a8c796c24a9574b1e",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C456012.step?uuid=a8c86ef7d632469a8c796c24a9574b1e",
            pcbRotationOffset: 180,
            modelOriginPosition: { x: -12700000070253736e-21, y: -2.2999397999999927, z: 0.059997999999999996 },
        }, ...props }));
};

/**
 * Run tscircuit's multilayer router and normalize every generated through-via
 * to the fabrication requirement: 0.30 mm finished drill, 0.45 mm land.
 */
const interfaceFanoutPositions = Array.from({ length: 10 }, (_, index) => ({
    x: index % 2 === 0 ? -12.2 : -11,
    y: 4.75 - index * 0.5,
}));
function normalizeVias(traces) {
    return traces.map((trace) => ({
        ...trace,
        route: trace.route
            // A plated fanout hole already spans all four copper layers. Some
            // router solutions add a second via almost concentrically; remove that
            // redundant transition before DRC evaluates the route.
            .filter((point) => point.route_type !== "via" ||
            !interfaceFanoutPositions.some(({ x, y }) => Math.hypot(point.x - x, point.y - y) < 0.4))
            .map((point) => point.route_type === "via"
            ? {
                ...point,
                via_diameter: 0.45,
                via_hole_diameter: 0.3,
            }
            : point),
    }));
}
class JlcFourLayerAutorouter {
    constructor(input) {
        this.isRouting = false;
        this.cycleCount = 0;
        this.handlers = {
            complete: [],
            error: [],
            progress: [],
        };
        this.input = input;
        this.solver = new tscircuit.SOLVERS.AutoroutingPipelineSolver7_MultiGraph(input, {});
    }
    emitError(caught) {
        const error = caught instanceof Error ? caught : new Error(String(caught));
        for (const handler of this.handlers.error) {
            handler({ type: "error", error });
        }
    }
    async runCycle() {
        if (!this.isRouting)
            return;
        try {
            if (this.solver.failed) {
                this.isRouting = false;
                this.emitError(this.solver.error ?? "Routing failed");
                return;
            }
            if (this.solver.solved) {
                this.isRouting = false;
                const traces = normalizeVias(this.solver.getOutputSimpleRouteJson().traces ?? []);
                for (const handler of this.handlers.complete) {
                    handler({ type: "complete", traces });
                }
                return;
            }
            const startedAt = Date.now();
            const startIterations = this.solver.iterations;
            while (Date.now() - startedAt < 250 &&
                !this.solver.failed &&
                !this.solver.solved) {
                if (typeof this.solver.stepAsync === "function") {
                    await this.solver.stepAsync();
                }
                else {
                    this.solver.step();
                }
            }
            this.cycleCount += 1;
            const elapsed = Math.max(Date.now() - startedAt, 1);
            for (const handler of this.handlers.progress) {
                handler({
                    type: "progress",
                    steps: this.cycleCount,
                    progress: this.solver.progress,
                    phase: this.solver.getCurrentPhase(),
                    iterationsPerSecond: ((this.solver.iterations - startIterations) / elapsed) * 1000,
                    debugGraphics: this.solver.preview?.(),
                });
            }
            this.timer = setTimeout(() => void this.runCycle(), 0);
        }
        catch (error) {
            this.isRouting = false;
            this.emitError(error);
        }
    }
    start() {
        if (this.isRouting)
            return;
        this.isRouting = true;
        void this.runCycle();
    }
    stop() {
        this.isRouting = false;
        this.solver.stop?.();
        if (this.timer)
            clearTimeout(this.timer);
        this.timer = undefined;
    }
    on(event, callback) {
        this.handlers[event].push(callback);
    }
    solveSync() {
        this.solver.solve();
        if (this.solver.failed) {
            throw new Error(this.solver.error ?? "Routing failed");
        }
        return normalizeVias(this.solver.getOutputSimpleRouteJson().traces ?? []);
    }
}
const createJlcFourLayerAutorouter = async (input) => new JlcFourLayerAutorouter(input);

const resistorParts = {
    r1k: {
        value: "1k",
        lcsc: "C21190",
        mpn: "0603WAF1001T5E",
    },
    r5k1: {
        value: "5.1k",
        lcsc: "C23186",
        mpn: "0603WAF5101T5E",
    },
    r10k: {
        value: "10k",
        lcsc: "C2906982",
        mpn: "FRC0603F1002TS",
    },
};
const capacitorParts = {
    c100n: {
        value: "100nF",
        lcsc: "C14663",
        mpn: "CC0603KRX7R9BB104",
        footprint: "0603",
    },
    c1u: {
        value: "1uF",
        lcsc: "C15849",
        mpn: "CL10A105KB8NNNC",
        footprint: "0603",
    },
    c10u: {
        value: "10uF",
        lcsc: "C15850",
        mpn: "CL21A106KAYNNNE",
        footprint: "0805",
    },
};
const interfaceNames = {
    status: [],
    "spi-display": [
        "SPI_SCLK",
        "SPI_MOSI",
        "DISPLAY_CS",
        "DISPLAY_DC",
        "DISPLAY_RST",
        "BACKLIGHT_PWM",
        "TOUCH_SDA",
        "TOUCH_SCL",
    ],
    epaper: [
        "EPD_SCLK",
        "EPD_MOSI",
        "EPD_CS",
        "EPD_DC",
        "EPD_RST",
        "EPD_BUSY",
        "FRONTLIGHT_PWM",
        "I2C_SDA",
    ],
    voice: [
        "I2S_BCLK",
        "I2S_LRCLK",
        "I2S_DOUT",
        "I2S_DIN",
        "AUDIO_SDA",
        "AUDIO_SCL",
        "AMP_ENABLE_PTT",
        "ROTARY_AB",
    ],
    watch: [
        "SPI_SCLK",
        "SPI_MOSI",
        "DISPLAY_CS",
        "DISPLAY_DC",
        "DISPLAY_RST",
        "BACKLIGHT_PWM",
        "TOUCH_SDA",
        "TOUCH_SCL",
    ],
};
const gpioConnections = {
    IO4: "net.IFACE_1",
    IO5: "net.IFACE_2",
    IO6: "net.IFACE_3",
    IO7: "net.IFACE_4",
    IO15: "net.IFACE_5",
    IO16: "net.IFACE_6",
    IO17: "net.IFACE_7",
    IO18: "net.IFACE_8",
};
const interfaceFanoutPinLabels = {
    pin1: ["pin1"],
    pin2: ["pin2"],
    pin3: ["pin3"],
    pin4: ["pin4"],
    pin5: ["pin5"],
    pin6: ["pin6"],
    pin7: ["pin7"],
    pin8: ["pin8"],
    pin9: ["pin9"],
    pin10: ["pin10"],
};
const interfaceFanoutRoutes = [
    { pin: "pin1", y: 4.75, destination: ".U1 > .3V3" },
    { pin: "pin2", y: 4.25, destination: ".U1 > .GND1" },
    { pin: "pin3", y: 3.75, destination: ".U1 > .IO4" },
    { pin: "pin4", y: 3.25, destination: ".U1 > .IO5" },
    { pin: "pin5", y: 2.75, destination: ".U1 > .IO6" },
    { pin: "pin6", y: 2.25, destination: ".U1 > .IO7" },
    { pin: "pin7", y: 1.75, destination: ".U1 > .IO15" },
    { pin: "pin8", y: 1.25, destination: ".U1 > .IO16" },
    { pin: "pin9", y: 0.75, destination: ".U1 > .IO17" },
    { pin: "pin10", y: 0.25, destination: ".U1 > .IO18" },
];
function MuseGadgetBoard({ variant }) {
    const { width, height } = variant;
    const left = -width / 2;
    const right = width / 2;
    const top = height / 2;
    const bottom = -height / 2;
    const espX = 4;
    const espY = top - 16.85;
    const usbX = left + 4.8;
    const ffcX = -15;
    const hasInterface = variant.interfaceKind !== "status";
    const statusLedX = hasInterface ? -5 : left + 15;
    const statusResistorX = hasInterface ? -8 : left + 10.5;
    const statusY = hasInterface ? bottom + 8 : 1;
    const ifaceNames = interfaceNames[variant.interfaceKind];
    const resistors = [
        { name: "R_CC1", part: "r5k1", a: "USB_CC1", b: "GND", pcbX: left + 10.5, pcbY: -4, rotation: 90, schX: -11, schY: 7.5 },
        { name: "R_CC2", part: "r5k1", a: "USB_CC2", b: "GND", pcbX: left + 12.2, pcbY: -4, rotation: 90, schX: -8, schY: 7.5 },
        { name: "R_EN", part: "r10k", a: "VCC3V3", b: "ESP_EN", pcbX: hasInterface ? -7.5 : -8.5, pcbY: hasInterface ? espY + 4.9 : 4.5, rotation: hasInterface ? 90 : 0, schX: 5, schY: 8 },
        { name: "R_BOOT", part: "r10k", a: "VCC3V3", b: "ESP_GPIO0", pcbX: right - 12.5, pcbY: -10.5, rotation: 90, schX: 8, schY: 5 },
        { name: "R_LED", part: "r1k", a: "VCC3V3", b: "STATUS_LED_A", pcbX: statusResistorX, pcbY: statusY, rotation: 0, schX: -3, schY: -6 },
    ];
    if (variant.userButtons >= 1) {
        resistors.push({ name: "R_USER1", part: "r10k", a: "VCC3V3", b: "USER1", pcbX: right - 8.5, pcbY: 3.0, rotation: 90, schX: 8, schY: 1 });
    }
    if (variant.userButtons >= 2) {
        resistors.push({ name: "R_USER2", part: "r10k", a: "VCC3V3", b: "USER2", pcbX: right - 13, pcbY: 15.0, rotation: 90, schX: 8, schY: -2 });
    }
    const capacitors = [
        { name: "C_LDO_IN", part: "c10u", a: "VBUS5V", b: "GND", pcbX: left + 5.5, pcbY: top - 14.0, rotation: 90, schX: -8, schY: 3 },
        { name: "C_LDO_OUT", part: "c10u", a: "VCC3V3", b: "GND", pcbX: left + 15, pcbY: top - 6.0, rotation: 90, schX: -4, schY: 3 },
        { name: "C_ESP_BULK", part: "c10u", a: "VCC3V3", b: "GND", pcbX: hasInterface ? -7.5 : -8.5, pcbY: hasInterface ? espY + 8.3 : 8.0, rotation: hasInterface ? 90 : 0, schX: 1, schY: 3 },
        { name: "C_ESP_HF", part: "c100n", a: "VCC3V3", b: "GND", pcbX: hasInterface ? -10.7 : -8.5, pcbY: hasInterface ? espY + 8.3 : 6.3, rotation: hasInterface ? 90 : 0, schX: 4, schY: 3 },
        { name: "C_EN", part: "c1u", a: "ESP_EN", b: "GND", pcbX: hasInterface ? -10.7 : -8.5, pcbY: hasInterface ? espY + 4.9 : 2.8, rotation: hasInterface ? 90 : 0, schX: 7, schY: 8 },
    ];
    return (jsxRuntime.jsxs("board", { name: variant.boardName, title: variant.title, width: `${width}mm`, height: `${height}mm`, layers: 4, autorouter: {
            local: true,
            groupMode: "subcircuit",
            algorithmFn: createJlcFourLayerAutorouter,
        }, autorouterEffortLevel: "2x", schTraceAutoLabelEnabled: true, minTraceWidth: "0.15mm", minViaHoleDiameter: "0.3mm", minViaPadDiameter: "0.45mm", minBoardEdgeClearance: "0.25mm", children: [jsxRuntime.jsxs("schematicsheet", { name: "SYSTEM", displayName: `${variant.title} — system`, sheetIndex: 0, children: [jsxRuntime.jsx("schematicsection", { name: "POWER", displayName: "USB-C POWER + 3.3 V REGULATOR" }), jsxRuntime.jsx("schematicsection", { name: "MCU", displayName: "ESP32-S3 + CONTROLS" }), hasInterface && jsxRuntime.jsx("schematicsection", { name: "INTERFACE", displayName: `${variant.role.toUpperCase()} — 24-PIN INTERFACE` })] }), jsxRuntime.jsx("copperpour", { name: "GND_PLANE", layer: "inner1", connectsTo: "net.GND", unbroken: true, clearance: "0.2mm", outline: [
                    { x: left + 0.3, y: bottom + 0.3 },
                    { x: right - 0.3, y: bottom + 0.3 },
                    { x: right - 0.3, y: top - 8 },
                    { x: left + 0.3, y: top - 8 },
                ] }), jsxRuntime.jsx("copperpour", { name: "VCC3V3_PLANE", layer: "inner2", connectsTo: "net.VCC3V3", unbroken: true, clearance: "0.2mm", outline: [
                    { x: left + 0.3, y: bottom + 0.3 },
                    { x: right - 0.3, y: bottom + 0.3 },
                    { x: right - 0.3, y: top - 8 },
                    { x: left + 0.3, y: top - 8 },
                ] }), [
                [left + 2.8, top - 2.8],
                [right - 2.8, top - 2.8],
                [left + 2.8, bottom + 2.8],
                [right - 2.8, bottom + 2.8],
            ].map(([x, y], index) => (jsxRuntime.jsxs(react.Fragment, { children: [jsxRuntime.jsx("hole", { name: `H${index + 1}`, pcbX: x, pcbY: y, diameter: "2.2mm" }), jsxRuntime.jsx("keepout", { shape: "circle", layers: ["top", "inner1", "inner2", "bottom"], radius: "2mm", pcbX: x, pcbY: y })] }, `mount-${index + 1}`))), jsxRuntime.jsx(TYPE_C_6P, { name: "U_USB", displayName: "USB-C 5 V POWER", layer: "top", pcbX: usbX, pcbY: -1, pcbRotation: -90, schX: -12, schY: 6, schSheetName: "SYSTEM", schSectionName: "POWER", connections: {
                    EH: "net.GND",
                    GND1: "net.GND",
                    GND2: "net.GND",
                    VBUS1: "net.VBUS5V",
                    VBUS2: "net.VBUS5V",
                    CC1: "net.USB_CC1",
                    CC2: "net.USB_CC2",
                } }), jsxRuntime.jsx(AMS1117_3_3, { name: "U_3V3", displayName: "AMS1117-3.3", layer: "top", pcbX: left + 10, pcbY: top - 6, pcbRotation: 90, schX: -6, schY: 6, schSheetName: "SYSTEM", schSectionName: "POWER", connections: { GND: "net.GND", VIN: "net.VBUS5V", VOUT1: "net.VCC3V3", VOUT2: "net.VCC3V3" } }), jsxRuntime.jsx(ESP32_S3_WROOM_1_N16R8, { name: "U1", displayName: "ESP32-S3-WROOM-1-N16R8", layer: "top", pcbX: espX, pcbY: espY, pcbRotation: 0, schX: 3, schY: 6, schHeight: 4.2, schSheetName: "SYSTEM", schSectionName: "MCU", connections: {
                    GND1: "net.GND",
                    GND2: "net.GND",
                    GND3: "net.GND",
                    "3V3": "net.VCC3V3",
                    EN: "net.ESP_EN",
                    IO0: "net.ESP_GPIO0",
                    IO21: "net.STATUS_LED_K",
                    ...(variant.userButtons >= 1 ? { IO47: "net.USER1" } : {}),
                    ...(variant.userButtons >= 2 ? { IO48: "net.USER2" } : {}),
                    RXD0: "net.UART_RX",
                    TXD0: "net.UART_TX",
                    ...(hasInterface ? gpioConnections : {}),
                } }), jsxRuntime.jsx(TS_1187A_B_A_B, { name: "SW_RESET", displayName: "RESET", layer: "top", pcbX: right - 5.2, pcbY: -5.5, schX: 8, schY: 8, schSheetName: "SYSTEM", schSectionName: "MCU", connections: { A: "net.ESP_EN", C: "net.ESP_EN", B: "net.GND", D: "net.GND" } }), jsxRuntime.jsx(TS_1187A_B_A_B, { name: "SW_BOOT", displayName: "BOOT", layer: "top", pcbX: right - 5.2, pcbY: -12.5, schX: 8, schY: 5, schSheetName: "SYSTEM", schSectionName: "MCU", connections: { A: "net.ESP_GPIO0", C: "net.ESP_GPIO0", B: "net.GND", D: "net.GND" } }), variant.userButtons >= 1 && (jsxRuntime.jsx(TS_1187A_B_A_B, { name: "SW_USER1", displayName: variant.interfaceKind === "voice" || variant.interfaceKind === "watch" ? "PUSH TO TALK" : "USER 1", layer: "top", pcbX: right - 5.2, pcbY: 8.5, schX: 8, schY: 1, schSheetName: "SYSTEM", schSectionName: "MCU", connections: { A: "net.USER1", C: "net.USER1", B: "net.GND", D: "net.GND" } })), variant.userButtons >= 2 && (jsxRuntime.jsx(TS_1187A_B_A_B, { name: "SW_USER2", displayName: "USER 2", layer: "bottom", pcbX: right - 5.2, pcbY: 8.5, schX: 8, schY: -2, schSheetName: "SYSTEM", schSectionName: "MCU", connections: { A: "net.USER2", C: "net.USER2", B: "net.GND", D: "net.GND" } })), jsxRuntime.jsx("led", { name: "D_STATUS", displayName: "STATUS RED", color: "red", footprint: "0603", supplierPartNumbers: { jlcpcb: ["C2286"] }, manufacturerPartNumber: "KT-0603R", layer: "top", pcbX: statusLedX, pcbY: statusY, schX: 0, schY: -6, schSheetName: "SYSTEM", schSectionName: "MCU", connections: { anode: "net.STATUS_LED_A", cathode: "net.STATUS_LED_K" } }), resistors.map(({ part, a, b, rotation = 0, ...props }) => {
                const p = resistorParts[part];
                return (jsxRuntime.jsx("resistor", { resistance: p.value, footprint: "0603", supplierPartNumbers: { jlcpcb: [p.lcsc] }, manufacturerPartNumber: p.mpn, layer: "top", pcbRotation: rotation, schSheetName: "SYSTEM", schSectionName: props.name.startsWith("R_CC") ? "POWER" : "MCU", connections: { pin1: `net.${a}`, pin2: `net.${b}` }, ...props }, props.name));
            }), capacitors.map(({ part, a, b, rotation = 0, ...props }) => {
                const p = capacitorParts[part];
                return (jsxRuntime.jsx("capacitor", { capacitance: p.value, footprint: p.footprint, supplierPartNumbers: { jlcpcb: [p.lcsc] }, manufacturerPartNumber: p.mpn, layer: "top", pcbRotation: rotation, schSheetName: "SYSTEM", schSectionName: props.name.startsWith("C_LDO") ? "POWER" : "MCU", connections: { pin1: `net.${a}`, pin2: `net.${b}` }, ...props }, props.name));
            }), hasInterface && (jsxRuntime.jsxs(react.Fragment, { children: [jsxRuntime.jsx(AFC01_S24FCA_00, { name: "U_INTERFACE", displayName: `${variant.role} FFC`, layer: "top", pcbX: ffcX, pcbY: -1, pcbRotation: -90, schX: -1, schY: -5, schHeight: 3.2, schSheetName: "SYSTEM", schSectionName: "INTERFACE" }), jsxRuntime.jsx("chip", { name: "INTERFACE_FANOUT", displayName: "FFC fanout vias (DNP)", doNotPlace: true, pcbX: 0, pcbY: 0, schX: 3, schY: -5, schSheetName: "SYSTEM", schSectionName: "INTERFACE", pinLabels: interfaceFanoutPinLabels, pinAttributes: {
                            pin1: { requiresPower: true },
                            pin2: { requiresGround: true },
                        }, footprint: jsxRuntime.jsx("footprint", { children: interfaceFanoutRoutes.map(({ pin, y }, index) => (jsxRuntime.jsx(react.Fragment, { children: jsxRuntime.jsx("platedhole", { portHints: [pin], shape: "circle", holeDiameter: "0.3mm", outerDiameter: "0.45mm", pcbX: index % 2 === 0 ? -12.2 : -11, pcbY: y }) }, `interface-fanout-via-${pin}`))) }) }), interfaceFanoutRoutes.map(({ pin, destination }) => (jsxRuntime.jsxs(react.Fragment, { children: [jsxRuntime.jsx("trace", { name: `TRACE_INTERFACE_${pin}_ESCAPE`, from: `.U_INTERFACE > .${pin}`, to: `.INTERFACE_FANOUT > .${pin}`, thickness: "0.15mm", pcbPath: [`.INTERFACE_FANOUT > .${pin}`] }), jsxRuntime.jsx("trace", { name: `TRACE_INTERFACE_${pin}_RUN`, from: `.INTERFACE_FANOUT > .${pin}`, to: destination, thickness: "0.15mm" })] }, `interface-fanout-${pin}`)))] })), [
                ["TP_TX", "UART_TX", hasInterface ? right - 20 : left + 7, bottom + 7],
                ["TP_RX", "UART_RX", hasInterface ? right - 16 : left + 11, bottom + 7],
                ["TP_3V3", "VCC3V3", hasInterface ? right - 12 : left + 15, bottom + 7],
                ["TP_GND", "GND", hasInterface ? right - 8 : left + 19, bottom + 7],
            ].map(([name, net, x, y]) => (jsxRuntime.jsx("testpoint", { name: String(name), footprintVariant: "pad", padShape: "circle", padDiameter: "1.3mm", layer: "bottom", pcbX: Number(x), pcbY: Number(y), schX: -9 + Number(x) * 0.01, schY: -7, schSheetName: "SYSTEM", schSectionName: "MCU", connections: { pin1: `net.${net}` } }, String(name)))), [
                [espX - 2.20015, espY + 0.62485],
                [espX - 0.8001, espY + 0.62485],
                [espX - 2.20015, espY + 2.0249],
                [espX - 0.8001, espY + 2.0249],
            ].map(([x, y], index) => (jsxRuntime.jsx(react.Fragment, { children: jsxRuntime.jsx("via", { name: `VIA_ESP_GND_${index + 1}`, connectsTo: "net.GND", fromLayer: "top", toLayer: "bottom", pcbX: x, pcbY: y, outerDiameter: "0.45mm", holeDiameter: "0.3mm" }) }, `epad-via-${index}`))), jsxRuntime.jsx("via", { name: "VIA_GND_USB", connectsTo: "net.GND", fromLayer: "top", toLayer: "bottom", pcbX: left + 9, pcbY: -5, outerDiameter: "0.45mm", holeDiameter: "0.3mm" }), jsxRuntime.jsx("via", { name: "VIA_GND_LDO", connectsTo: "net.GND", fromLayer: "top", toLayer: "bottom", pcbX: left + 10, pcbY: top - 12, outerDiameter: "0.45mm", holeDiameter: "0.3mm" }), ifaceNames.map((label, index) => (jsxRuntime.jsx(react.Fragment, { children: jsxRuntime.jsx("silkscreentext", { text: `${index + 3}:${label}`, layer: "bottom", pcbX: left + 7 + (index % 2) * 13, pcbY: top - 4 - Math.floor(index / 2) * 2, fontSize: "0.65mm", anchorAlignment: "center_left" }) }, label))), jsxRuntime.jsx("silkscreentext", { text: variant.boardName, layer: "bottom", pcbX: 0, pcbY: bottom + 2.2, fontSize: "0.8mm", anchorAlignment: "center" }), jsxRuntime.jsx("silkscreentext", { text: "4L | VIA 0.30/0.45 mm", layer: "bottom", pcbX: 0, pcbY: bottom + 3.5, fontSize: "0.6mm", anchorAlignment: "center" })] }));
}

const variants = [
    { slug: "esp32-c5-devkit-replacement", boardName: "MUSE_DEVKIT", title: "Muse DevKit replacement", role: "Status RGB and BOOT control", width: 46, height: 42, userButtons: 0, interfaceKind: "status" },
    { slug: "ideaspark-1p9-replacement", boardName: "MUSE_IDEASPARK_1P9", title: "Muse 1.9 inch display carrier", role: "SPI display and image endpoint", width: 70, height: 55, userButtons: 1, interfaceKind: "spi-display" },
    { slug: "sensecap-indicator-replacement", boardName: "MUSE_INDICATOR", title: "Muse 4 inch indicator carrier", role: "SPI display, touch and sensor endpoint", width: 90, height: 70, userButtons: 1, interfaceKind: "spi-display" },
    { slug: "reterminal-e1001-replacement", boardName: "MUSE_EPAPER", title: "Muse e-paper carrier", role: "7.5 inch e-paper control interface", width: 100, height: 70, userButtons: 1, interfaceKind: "epaper" },
    { slug: "home-assistant-voice-replacement", boardName: "MUSE_VOICE", title: "Muse voice carrier", role: "I2S audio, PTT and rotary-control interface", width: 85, height: 65, userButtons: 1, interfaceKind: "voice" },
    { slug: "waveshare-s3-amoled-1p75-replacement", boardName: "MUSE_ROUND_AMOLED", title: "Muse round AMOLED carrier", role: "Round AMOLED, touch and push-to-talk", width: 72, height: 60, userButtons: 1, interfaceKind: "watch" },
    { slug: "aipi-lite-replacement", boardName: "MUSE_AIPI_LITE", title: "Muse AIPI Lite carrier", role: "Display and two-button menu", width: 75, height: 58, userButtons: 2, interfaceKind: "spi-display" },
    { slug: "waveshare-c6-amoled-1p8-replacement", boardName: "MUSE_AMOLED_1P8", title: "Muse 1.8 inch AMOLED carrier", role: "AMOLED, touch, PTT and text replies", width: 72, height: 60, userButtons: 1, interfaceKind: "watch" },
    { slug: "sensecap-watcher-replacement", boardName: "MUSE_WATCHER", title: "Muse Watcher carrier", role: "Display, touch, image and PTT interface", width: 90, height: 65, userButtons: 1, interfaceKind: "watch" },
    { slug: "m5stack-sticks3-replacement", boardName: "MUSE_STICKS3", title: "Muse StickS3-format carrier", role: "Compact display and two-button menu", width: 72, height: 50, userButtons: 2, interfaceKind: "watch" },
    { slug: "m5stack-stickc-plus2-replacement", boardName: "MUSE_STICKC_PLUS2", title: "Muse StickC Plus2-format carrier", role: "Compact display and two-button menu", width: 72, height: 50, userButtons: 2, interfaceKind: "watch" }
];
const variantBySlug = Object.fromEntries(variants.map((variant) => [variant.slug, variant]));

var index_circuit = () => jsxRuntime.jsx(MuseGadgetBoard, { variant: variantBySlug["reterminal-e1001-replacement"] });

module.exports = index_circuit;