@tscircuit/pcb-viewer 1.11.395 → 1.11.397

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/index.js CHANGED
@@ -2643,7 +2643,7 @@ var ToastContainer = () => {
2643
2643
  };
2644
2644
 
2645
2645
  // src/PCBViewer.tsx
2646
- import { useCallback as useCallback12, useEffect as useEffect19, useMemo as useMemo9, useRef as useRef16, useState as useState13 } from "react";
2646
+ import { useCallback as useCallback12, useEffect as useEffect19, useMemo as useMemo10, useRef as useRef16, useState as useState13 } from "react";
2647
2647
 
2648
2648
  // node_modules/react-use/esm/useMountedState.js
2649
2649
  import { useCallback as useCallback2, useEffect as useEffect2, useRef } from "react";
@@ -4447,7 +4447,7 @@ var animateTransform = ({
4447
4447
  };
4448
4448
 
4449
4449
  // src/components/CanvasElementsRenderer.tsx
4450
- import { useCallback as useCallback11, useEffect as useEffect18, useMemo as useMemo8, useRef as useRef15, useState as useState12 } from "react";
4450
+ import { useCallback as useCallback11, useEffect as useEffect18, useMemo as useMemo9, useRef as useRef15, useState as useState12 } from "react";
4451
4451
 
4452
4452
  // src/lib/Drawer.ts
4453
4453
  import colorParser from "color";
@@ -5622,7 +5622,8 @@ var filterTraceByLayers = (trace, targetLayers) => {
5622
5622
  const wireCount = filteredRoute.filter(
5623
5623
  (segment) => segment.route_type === "wire"
5624
5624
  ).length;
5625
- if (wireCount < 2) return null;
5625
+ const hasVia = filteredRoute.some((segment) => segment.route_type === "via");
5626
+ if (wireCount < 2 && !hasVia) return null;
5626
5627
  return {
5627
5628
  ...trace,
5628
5629
  route: filteredRoute
@@ -5640,7 +5641,7 @@ var showTraceSegmentsInsideHiddenCopperPours = (trace) => ({
5640
5641
  };
5641
5642
  })
5642
5643
  });
5643
- var getTraceClipContextElements = (elements, showCopperPours) => showCopperPours ? elements : [];
5644
+ var getTraceClipContextElements = (elements, showCopperPours) => showCopperPours ? elements : elements.filter((element) => element.type !== "pcb_copper_pour");
5644
5645
  var getHighlightedTraceElementIds = ({
5645
5646
  primitives
5646
5647
  }) => {
@@ -6275,6 +6276,7 @@ function drawSoldermaskElementsForLayer({
6275
6276
  hoverDrawer.realToCanvasMat = realToCanvasMat;
6276
6277
  hoverDrawer.drawElements(hoveredElements, {
6277
6278
  layers,
6279
+ clipContextElements: elements,
6278
6280
  drawSoldermask: true,
6279
6281
  drawSoldermaskTop,
6280
6282
  drawSoldermaskBottom,
@@ -6336,7 +6338,13 @@ function drawPcbViaElementsForLayer({
6336
6338
  if (nonHighlightedElements.length > 0) {
6337
6339
  const drawer = new CircuitToCanvasDrawer16(canvas);
6338
6340
  drawer.realToCanvasMat = realToCanvasMat;
6339
- drawer.drawElements(nonHighlightedElements, { layers, drawSoldermask });
6341
+ drawer.drawElements(nonHighlightedElements, {
6342
+ layers,
6343
+ drawSoldermask,
6344
+ drawSoldermaskTop: layers.includes("top_copper"),
6345
+ drawSoldermaskBottom: layers.includes("bottom_copper"),
6346
+ clipContextElements: elements
6347
+ });
6340
6348
  }
6341
6349
  if (highlightedElements.length > 0) {
6342
6350
  const highlightDrawer = new CircuitToCanvasDrawer16(canvas);
@@ -6344,7 +6352,10 @@ function drawPcbViaElementsForLayer({
6344
6352
  highlightDrawer.realToCanvasMat = realToCanvasMat;
6345
6353
  highlightDrawer.drawElements(highlightedElements, {
6346
6354
  layers,
6347
- drawSoldermask
6355
+ drawSoldermask,
6356
+ drawSoldermaskTop: layers.includes("top_copper"),
6357
+ drawSoldermaskBottom: layers.includes("bottom_copper"),
6358
+ clipContextElements: elements
6348
6359
  });
6349
6360
  }
6350
6361
  }
@@ -7578,7 +7589,7 @@ var DebugGraphicsOverlay = ({
7578
7589
  };
7579
7590
 
7580
7591
  // src/components/DimensionOverlay.tsx
7581
- import { useCallback as useCallback6, useEffect as useEffect7, useMemo as useMemo4, useRef as useRef5, useState as useState4 } from "react";
7592
+ import { useCallback as useCallback6, useEffect as useEffect7, useMemo as useMemo5, useRef as useRef5, useState as useState4 } from "react";
7582
7593
  import { applyToPoint as applyToPoint10, identity as identity3, inverse as inverse3 } from "transformation-matrix";
7583
7594
 
7584
7595
  // src/lib/util/get-primitive-bounding-box.ts
@@ -7953,10 +7964,55 @@ var getPrimitiveSnapPoints = (primitive) => {
7953
7964
  }
7954
7965
  };
7955
7966
 
7967
+ // src/components/DimensionSnapGuides.tsx
7968
+ import { memo, useMemo as useMemo4 } from "react";
7969
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
7970
+ var markerPath = ({ screenPoint: { x, y } }) => `M${x - 2.5},${y - 2.5}l5,5m0,-5l-5,5`;
7971
+ var DimensionSnapGuides = memo(function DimensionSnapGuides2({
7972
+ points,
7973
+ startId,
7974
+ endId
7975
+ }) {
7976
+ const { path, pointsById } = useMemo4(
7977
+ () => ({
7978
+ path: points.map(markerPath).join(""),
7979
+ pointsById: new Map(points.map((point) => [point.id, point]))
7980
+ }),
7981
+ [points]
7982
+ );
7983
+ const activePath = [.../* @__PURE__ */ new Set([startId, endId])].flatMap((id) => {
7984
+ const point = id === null ? void 0 : pointsById.get(id);
7985
+ return point ? [markerPath(point)] : [];
7986
+ }).join("");
7987
+ return /* @__PURE__ */ jsxs3(
7988
+ "svg",
7989
+ {
7990
+ "aria-hidden": "true",
7991
+ width: "100%",
7992
+ height: "100%",
7993
+ style: {
7994
+ position: "absolute",
7995
+ left: 0,
7996
+ top: 0,
7997
+ overflow: "visible",
7998
+ pointerEvents: "none",
7999
+ zIndex: zIndexMap.dimensionOverlay
8000
+ },
8001
+ fill: "none",
8002
+ strokeWidth: 1,
8003
+ children: [
8004
+ /* @__PURE__ */ jsx5("path", { d: path, stroke: "white" }),
8005
+ /* @__PURE__ */ jsx5("path", { d: activePath, stroke: "#66ccff" })
8006
+ ]
8007
+ }
8008
+ );
8009
+ });
8010
+
7956
8011
  // src/components/DimensionOverlay.tsx
7957
- import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
8012
+ import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
7958
8013
  var SNAP_THRESHOLD_PX = 16;
7959
- var SNAP_MARKER_SIZE = 5;
8014
+ var EMPTY_PRIMITIVES = [];
8015
+ var DEFAULT_TRANSFORM = identity3();
7960
8016
  var shouldExcludePrimitiveFromSnapping = (primitive) => {
7961
8017
  if (primitive.pcb_drawing_type === "text") return true;
7962
8018
  const element = primitive._element;
@@ -7977,11 +8033,11 @@ var DimensionOverlay = ({
7977
8033
  children,
7978
8034
  transform,
7979
8035
  focusOnHover = false,
7980
- primitives = [],
8036
+ primitives = EMPTY_PRIMITIVES,
7981
8037
  onBoundsSelected,
7982
8038
  cancelPanDrag
7983
8039
  }) => {
7984
- if (!transform) transform = identity3();
8040
+ if (!transform) transform = DEFAULT_TRANSFORM;
7985
8041
  const [dimensionToolVisible, setDimensionToolVisible] = useState4(false);
7986
8042
  const [dimensionToolStretching, setDimensionToolStretching] = useState4(false);
7987
8043
  const [measureToolArmed, setMeasureToolArmed] = useState4(false);
@@ -8013,7 +8069,7 @@ var DimensionOverlay = ({
8013
8069
  const containerRef = useRef5(null);
8014
8070
  const container = containerRef.current;
8015
8071
  const containerBounds = container?.getBoundingClientRect();
8016
- const elementBoundingBoxes = useMemo4(() => {
8072
+ const elementBoundingBoxes = useMemo5(() => {
8017
8073
  const boundingBoxes = /* @__PURE__ */ new Map();
8018
8074
  for (const primitive of primitives) {
8019
8075
  if (!primitive._element) continue;
@@ -8031,7 +8087,7 @@ var DimensionOverlay = ({
8031
8087
  }
8032
8088
  return boundingBoxes;
8033
8089
  }, [primitives]);
8034
- const primitiveSnappingPoints = useMemo4(() => {
8090
+ const primitiveSnappingPoints = useMemo5(() => {
8035
8091
  const snapPoints = [];
8036
8092
  for (const primitive of primitives) {
8037
8093
  if (!primitive._element) continue;
@@ -8048,7 +8104,7 @@ var DimensionOverlay = ({
8048
8104
  }
8049
8105
  return snapPoints;
8050
8106
  }, [primitives]);
8051
- const snappingPoints = useMemo4(() => {
8107
+ const snappingPoints = useMemo5(() => {
8052
8108
  const points = [];
8053
8109
  elementBoundingBoxes.forEach((bounds, element) => {
8054
8110
  if (!bounds) return;
@@ -8083,7 +8139,7 @@ var DimensionOverlay = ({
8083
8139
  });
8084
8140
  return points;
8085
8141
  }, [elementBoundingBoxes, primitiveSnappingPoints]);
8086
- const snappingPointsWithScreen = useMemo4(() => {
8142
+ const snappingPointsWithScreen = useMemo5(() => {
8087
8143
  return snappingPoints.map((snap, index) => ({
8088
8144
  ...snap,
8089
8145
  id: `${index}-${snap.anchor}`,
@@ -8235,7 +8291,7 @@ var DimensionOverlay = ({
8235
8291
  flipX: arrowScreenBounds.flipX,
8236
8292
  flipY: arrowScreenBounds.flipY
8237
8293
  });
8238
- return /* @__PURE__ */ jsxs3(
8294
+ return /* @__PURE__ */ jsxs4(
8239
8295
  "div",
8240
8296
  {
8241
8297
  ref: containerRef,
@@ -8320,8 +8376,8 @@ var DimensionOverlay = ({
8320
8376
  },
8321
8377
  children: [
8322
8378
  children,
8323
- boundsToolVisible && /* @__PURE__ */ jsxs3(Fragment, { children: [
8324
- /* @__PURE__ */ jsx5(
8379
+ boundsToolVisible && /* @__PURE__ */ jsxs4(Fragment, { children: [
8380
+ /* @__PURE__ */ jsx6(
8325
8381
  "svg",
8326
8382
  {
8327
8383
  style: {
@@ -8334,7 +8390,7 @@ var DimensionOverlay = ({
8334
8390
  },
8335
8391
  width: containerBounds.width,
8336
8392
  height: containerBounds.height,
8337
- children: /* @__PURE__ */ jsx5(
8393
+ children: /* @__PURE__ */ jsx6(
8338
8394
  "rect",
8339
8395
  {
8340
8396
  x: boundsScreenRect.left,
@@ -8349,7 +8405,7 @@ var DimensionOverlay = ({
8349
8405
  )
8350
8406
  }
8351
8407
  ),
8352
- /* @__PURE__ */ jsxs3(
8408
+ /* @__PURE__ */ jsxs4(
8353
8409
  "div",
8354
8410
  {
8355
8411
  style: {
@@ -8370,7 +8426,7 @@ var DimensionOverlay = ({
8370
8426
  ", minY:",
8371
8427
  " ",
8372
8428
  selectedBounds.minY.toFixed(2),
8373
- /* @__PURE__ */ jsx5("br", {}),
8429
+ /* @__PURE__ */ jsx6("br", {}),
8374
8430
  "maxX: ",
8375
8431
  selectedBounds.maxX.toFixed(2),
8376
8432
  ", maxY:",
@@ -8380,8 +8436,8 @@ var DimensionOverlay = ({
8380
8436
  }
8381
8437
  )
8382
8438
  ] }),
8383
- dimensionToolVisible && /* @__PURE__ */ jsxs3(Fragment, { children: [
8384
- diagonalLabel.show && /* @__PURE__ */ jsx5(
8439
+ dimensionToolVisible && /* @__PURE__ */ jsxs4(Fragment, { children: [
8440
+ diagonalLabel.show && /* @__PURE__ */ jsx6(
8385
8441
  "div",
8386
8442
  {
8387
8443
  style: {
@@ -8399,7 +8455,7 @@ var DimensionOverlay = ({
8399
8455
  children: diagonalLabel.distance.toFixed(2)
8400
8456
  }
8401
8457
  ),
8402
- /* @__PURE__ */ jsx5(
8458
+ /* @__PURE__ */ jsx6(
8403
8459
  "div",
8404
8460
  {
8405
8461
  style: {
@@ -8419,7 +8475,7 @@ var DimensionOverlay = ({
8419
8475
  children: Math.abs(dStart.x - dEnd.x).toFixed(2)
8420
8476
  }
8421
8477
  ),
8422
- /* @__PURE__ */ jsx5(
8478
+ /* @__PURE__ */ jsx6(
8423
8479
  "div",
8424
8480
  {
8425
8481
  style: {
@@ -8437,7 +8493,7 @@ var DimensionOverlay = ({
8437
8493
  fontFamily: "sans-serif",
8438
8494
  zIndex: zIndexMap.dimensionOverlay
8439
8495
  },
8440
- children: /* @__PURE__ */ jsx5(
8496
+ children: /* @__PURE__ */ jsx6(
8441
8497
  "div",
8442
8498
  {
8443
8499
  style: {
@@ -8449,7 +8505,7 @@ var DimensionOverlay = ({
8449
8505
  )
8450
8506
  }
8451
8507
  ),
8452
- /* @__PURE__ */ jsxs3(
8508
+ /* @__PURE__ */ jsxs4(
8453
8509
  "svg",
8454
8510
  {
8455
8511
  style: {
@@ -8463,7 +8519,7 @@ var DimensionOverlay = ({
8463
8519
  width: containerBounds.width,
8464
8520
  height: containerBounds.height,
8465
8521
  children: [
8466
- /* @__PURE__ */ jsx5("defs", { children: /* @__PURE__ */ jsx5(
8522
+ /* @__PURE__ */ jsx6("defs", { children: /* @__PURE__ */ jsx6(
8467
8523
  "marker",
8468
8524
  {
8469
8525
  id: "head",
@@ -8472,10 +8528,10 @@ var DimensionOverlay = ({
8472
8528
  markerHeight: "4",
8473
8529
  refX: "2",
8474
8530
  refY: "2",
8475
- children: /* @__PURE__ */ jsx5("path", { d: "M0,0 V4 L2,2 Z", fill: "red" })
8531
+ children: /* @__PURE__ */ jsx6("path", { d: "M0,0 V4 L2,2 Z", fill: "red" })
8476
8532
  }
8477
8533
  ) }),
8478
- /* @__PURE__ */ jsx5(
8534
+ /* @__PURE__ */ jsx6(
8479
8535
  "line",
8480
8536
  {
8481
8537
  x1: screenDStart.x,
@@ -8488,7 +8544,7 @@ var DimensionOverlay = ({
8488
8544
  stroke: "red"
8489
8545
  }
8490
8546
  ),
8491
- /* @__PURE__ */ jsx5(
8547
+ /* @__PURE__ */ jsx6(
8492
8548
  "line",
8493
8549
  {
8494
8550
  x1: screenDStart.x,
@@ -8501,7 +8557,7 @@ var DimensionOverlay = ({
8501
8557
  stroke: "red"
8502
8558
  }
8503
8559
  ),
8504
- /* @__PURE__ */ jsx5(
8560
+ /* @__PURE__ */ jsx6(
8505
8561
  "line",
8506
8562
  {
8507
8563
  x1: screenDEnd.x,
@@ -8517,50 +8573,15 @@ var DimensionOverlay = ({
8517
8573
  ]
8518
8574
  }
8519
8575
  ),
8520
- dimensionToolStretching && snappingPointsWithScreen.map((snap) => {
8521
- const isActive = snap.id === activeSnapIds.start || snap.id === activeSnapIds.end;
8522
- const half = SNAP_MARKER_SIZE / 2;
8523
- return /* @__PURE__ */ jsxs3(
8524
- "svg",
8525
- {
8526
- width: SNAP_MARKER_SIZE,
8527
- height: SNAP_MARKER_SIZE,
8528
- style: {
8529
- position: "absolute",
8530
- left: snap.screenPoint.x - half,
8531
- top: snap.screenPoint.y - half,
8532
- pointerEvents: "none",
8533
- zIndex: zIndexMap.dimensionOverlay
8534
- },
8535
- children: [
8536
- /* @__PURE__ */ jsx5(
8537
- "line",
8538
- {
8539
- x1: 0,
8540
- y1: 0,
8541
- x2: SNAP_MARKER_SIZE,
8542
- y2: SNAP_MARKER_SIZE,
8543
- stroke: isActive ? "#66ccff" : "white",
8544
- strokeWidth: 1
8545
- }
8546
- ),
8547
- /* @__PURE__ */ jsx5(
8548
- "line",
8549
- {
8550
- x1: SNAP_MARKER_SIZE,
8551
- y1: 0,
8552
- x2: 0,
8553
- y2: SNAP_MARKER_SIZE,
8554
- stroke: isActive ? "#66ccff" : "white",
8555
- strokeWidth: 1
8556
- }
8557
- )
8558
- ]
8559
- },
8560
- snap.id
8561
- );
8562
- }),
8563
- /* @__PURE__ */ jsxs3(
8576
+ dimensionToolStretching && /* @__PURE__ */ jsx6(
8577
+ DimensionSnapGuides,
8578
+ {
8579
+ points: snappingPointsWithScreen,
8580
+ startId: activeSnapIds.start,
8581
+ endId: activeSnapIds.end
8582
+ }
8583
+ ),
8584
+ /* @__PURE__ */ jsxs4(
8564
8585
  "div",
8565
8586
  {
8566
8587
  style: {
@@ -8578,13 +8599,13 @@ var DimensionOverlay = ({
8578
8599
  ",",
8579
8600
  dStart.y.toFixed(2),
8580
8601
  ")",
8581
- /* @__PURE__ */ jsx5("br", {}),
8602
+ /* @__PURE__ */ jsx6("br", {}),
8582
8603
  "(",
8583
8604
  dEnd.x.toFixed(2),
8584
8605
  ",",
8585
8606
  dEnd.y.toFixed(2),
8586
8607
  ")",
8587
- /* @__PURE__ */ jsx5("br", {}),
8608
+ /* @__PURE__ */ jsx6("br", {}),
8588
8609
  "dist:",
8589
8610
  " ",
8590
8611
  Math.sqrt(
@@ -8602,7 +8623,7 @@ var DimensionOverlay = ({
8602
8623
  // src/components/EditPlacementOverlay.tsx
8603
8624
  import { useRef as useRef6, useState as useState5 } from "react";
8604
8625
  import { applyToPoint as applyToPoint11, identity as identity4, inverse as inverse4 } from "transformation-matrix";
8605
- import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
8626
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
8606
8627
  var isInsideOf = (pcb_component, point, padding = 0) => {
8607
8628
  const halfWidth = pcb_component.width / 2;
8608
8629
  const halfHeight = pcb_component.height / 2;
@@ -8632,7 +8653,7 @@ var EditPlacementOverlay = ({
8632
8653
  const in_move_footprint_mode = useGlobalStore((s) => s.in_move_footprint_mode);
8633
8654
  const setIsMovingComponent = useGlobalStore((s) => s.setIsMovingComponent);
8634
8655
  const disabled = disabledProp || !in_move_footprint_mode;
8635
- return /* @__PURE__ */ jsxs4(
8656
+ return /* @__PURE__ */ jsxs5(
8636
8657
  "div",
8637
8658
  {
8638
8659
  ref: containerRef,
@@ -8718,7 +8739,7 @@ var EditPlacementOverlay = ({
8718
8739
  !disabled && soup.filter((e) => e.type === "pcb_component").map((e) => {
8719
8740
  if (!e?.center) return null;
8720
8741
  const projectedCenter = applyToPoint11(transform, e.center);
8721
- return /* @__PURE__ */ jsx6(
8742
+ return /* @__PURE__ */ jsx7(
8722
8743
  "div",
8723
8744
  {
8724
8745
  style: {
@@ -8781,10 +8802,10 @@ var getPopupPosition = (errorCenter, containerRef) => {
8781
8802
  };
8782
8803
 
8783
8804
  // src/components/FocusMarkerSVG.tsx
8784
- import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
8805
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
8785
8806
  var FocusMarkerSVG = ({
8786
8807
  center
8787
- }) => /* @__PURE__ */ jsxs5(
8808
+ }) => /* @__PURE__ */ jsxs6(
8788
8809
  "svg",
8789
8810
  {
8790
8811
  style: {
@@ -8798,7 +8819,7 @@ var FocusMarkerSVG = ({
8798
8819
  width: "100%",
8799
8820
  height: "100%",
8800
8821
  children: [
8801
- /* @__PURE__ */ jsx7(
8822
+ /* @__PURE__ */ jsx8(
8802
8823
  "circle",
8803
8824
  {
8804
8825
  cx: center.x,
@@ -8810,8 +8831,8 @@ var FocusMarkerSVG = ({
8810
8831
  opacity: 0.95
8811
8832
  }
8812
8833
  ),
8813
- /* @__PURE__ */ jsx7("circle", { cx: center.x, cy: center.y, r: 4.5, fill: "#ff6b6b", opacity: 0.95 }),
8814
- /* @__PURE__ */ jsx7(
8834
+ /* @__PURE__ */ jsx8("circle", { cx: center.x, cy: center.y, r: 4.5, fill: "#ff6b6b", opacity: 0.95 }),
8835
+ /* @__PURE__ */ jsx8(
8815
8836
  "line",
8816
8837
  {
8817
8838
  x1: center.x - 18,
@@ -8822,7 +8843,7 @@ var FocusMarkerSVG = ({
8822
8843
  strokeWidth: 2
8823
8844
  }
8824
8845
  ),
8825
- /* @__PURE__ */ jsx7(
8846
+ /* @__PURE__ */ jsx8(
8826
8847
  "line",
8827
8848
  {
8828
8849
  x1: center.x + 8,
@@ -8833,7 +8854,7 @@ var FocusMarkerSVG = ({
8833
8854
  strokeWidth: 2
8834
8855
  }
8835
8856
  ),
8836
- /* @__PURE__ */ jsx7(
8857
+ /* @__PURE__ */ jsx8(
8837
8858
  "line",
8838
8859
  {
8839
8860
  x1: center.x,
@@ -8844,7 +8865,7 @@ var FocusMarkerSVG = ({
8844
8865
  strokeWidth: 2
8845
8866
  }
8846
8867
  ),
8847
- /* @__PURE__ */ jsx7(
8868
+ /* @__PURE__ */ jsx8(
8848
8869
  "line",
8849
8870
  {
8850
8871
  x1: center.x,
@@ -8860,11 +8881,11 @@ var FocusMarkerSVG = ({
8860
8881
  );
8861
8882
 
8862
8883
  // src/components/ErrorOverlay.tsx
8863
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
8884
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
8864
8885
  var ErrorMarkerSVG = ({
8865
8886
  errorCenter,
8866
8887
  isHighlighted = false
8867
- }) => /* @__PURE__ */ jsx8(
8888
+ }) => /* @__PURE__ */ jsx9(
8868
8889
  "svg",
8869
8890
  {
8870
8891
  style: {
@@ -8877,7 +8898,7 @@ var ErrorMarkerSVG = ({
8877
8898
  },
8878
8899
  width: "100%",
8879
8900
  height: "100%",
8880
- children: /* @__PURE__ */ jsx8(
8901
+ children: /* @__PURE__ */ jsx9(
8881
8902
  "rect",
8882
8903
  {
8883
8904
  x: errorCenter.x - 7,
@@ -8921,7 +8942,7 @@ var ErrorOverlay = ({
8921
8942
  );
8922
8943
  const activeErrorId = focusedErrorId ?? hoveredErrorId;
8923
8944
  if (!elements) {
8924
- return /* @__PURE__ */ jsx8("div", { style: { position: "relative" }, ref: containerRef, children });
8945
+ return /* @__PURE__ */ jsx9("div", { style: { position: "relative" }, ref: containerRef, children });
8925
8946
  }
8926
8947
  const traceErrors = elements.filter(
8927
8948
  (el) => el.type === "pcb_trace_error" && !el.message?.includes("Multiple components found with name")
@@ -8954,7 +8975,7 @@ var ErrorOverlay = ({
8954
8975
  focusedErrorElement
8955
8976
  );
8956
8977
  }
8957
- return /* @__PURE__ */ jsxs6("div", { style: { position: "relative" }, ref: containerRef, children: [
8978
+ return /* @__PURE__ */ jsxs7("div", { style: { position: "relative" }, ref: containerRef, children: [
8958
8979
  children,
8959
8980
  traceErrors.map((el, index) => {
8960
8981
  const errorId = getErrorId(el, index);
@@ -8963,15 +8984,15 @@ var ErrorOverlay = ({
8963
8984
  const errorCenter = getScreenErrorCenter(el);
8964
8985
  if (!errorCenter) return null;
8965
8986
  const popupPosition = getPopupPosition(errorCenter, containerRef);
8966
- return /* @__PURE__ */ jsxs6(Fragment2, { children: [
8967
- /* @__PURE__ */ jsx8(
8987
+ return /* @__PURE__ */ jsxs7(Fragment2, { children: [
8988
+ /* @__PURE__ */ jsx9(
8968
8989
  ErrorMarkerSVG,
8969
8990
  {
8970
8991
  errorCenter,
8971
8992
  isHighlighted
8972
8993
  }
8973
8994
  ),
8974
- /* @__PURE__ */ jsx8(
8995
+ /* @__PURE__ */ jsx9(
8975
8996
  "div",
8976
8997
  {
8977
8998
  style: {
@@ -9006,7 +9027,7 @@ var ErrorOverlay = ({
9006
9027
  }
9007
9028
  }
9008
9029
  ),
9009
- /* @__PURE__ */ jsx8(
9030
+ /* @__PURE__ */ jsx9(
9010
9031
  "div",
9011
9032
  {
9012
9033
  style: {
@@ -9024,7 +9045,7 @@ var ErrorOverlay = ({
9024
9045
  pointerEvents: "none",
9025
9046
  transform: popupPosition.transform
9026
9047
  },
9027
- children: /* @__PURE__ */ jsx8(
9048
+ children: /* @__PURE__ */ jsx9(
9028
9049
  "div",
9029
9050
  {
9030
9051
  className: `error-message ${errorMessageStyles}`,
@@ -9049,15 +9070,15 @@ var ErrorOverlay = ({
9049
9070
  { x: errorCenter.x, y: errorCenter.y },
9050
9071
  containerRef
9051
9072
  );
9052
- return /* @__PURE__ */ jsxs6(Fragment2, { children: [
9053
- /* @__PURE__ */ jsx8(
9073
+ return /* @__PURE__ */ jsxs7(Fragment2, { children: [
9074
+ /* @__PURE__ */ jsx9(
9054
9075
  ErrorMarkerSVG,
9055
9076
  {
9056
9077
  errorCenter,
9057
9078
  isHighlighted
9058
9079
  }
9059
9080
  ),
9060
- /* @__PURE__ */ jsx8(
9081
+ /* @__PURE__ */ jsx9(
9061
9082
  "div",
9062
9083
  {
9063
9084
  style: {
@@ -9092,7 +9113,7 @@ var ErrorOverlay = ({
9092
9113
  }
9093
9114
  }
9094
9115
  ),
9095
- /* @__PURE__ */ jsx8(
9116
+ /* @__PURE__ */ jsx9(
9096
9117
  "div",
9097
9118
  {
9098
9119
  style: {
@@ -9110,7 +9131,7 @@ var ErrorOverlay = ({
9110
9131
  pointerEvents: "none",
9111
9132
  transform: popupPosition.transform
9112
9133
  },
9113
- children: /* @__PURE__ */ jsx8(
9134
+ children: /* @__PURE__ */ jsx9(
9114
9135
  "div",
9115
9136
  {
9116
9137
  className: `error-message ${errorMessageStyles}`,
@@ -9159,8 +9180,8 @@ var ErrorOverlay = ({
9159
9180
  Math.min(maxRadius, baseRadius * scale7)
9160
9181
  );
9161
9182
  const popupPosition = getPopupPosition(screenCenter, containerRef);
9162
- return /* @__PURE__ */ jsxs6(Fragment2, { children: [
9163
- /* @__PURE__ */ jsx8(
9183
+ return /* @__PURE__ */ jsxs7(Fragment2, { children: [
9184
+ /* @__PURE__ */ jsx9(
9164
9185
  "svg",
9165
9186
  {
9166
9187
  style: {
@@ -9173,13 +9194,13 @@ var ErrorOverlay = ({
9173
9194
  },
9174
9195
  width: "100%",
9175
9196
  height: "100%",
9176
- children: isHighlighted ? /* @__PURE__ */ jsx8(
9197
+ children: isHighlighted ? /* @__PURE__ */ jsx9(
9177
9198
  "polygon",
9178
9199
  {
9179
9200
  points: `${screenCenter.x},${screenCenter.y - scaledRadius * 1.25} ${screenCenter.x + scaledRadius},${screenCenter.y} ${screenCenter.x},${screenCenter.y + scaledRadius * 1.25} ${screenCenter.x - scaledRadius},${screenCenter.y}`,
9180
9201
  fill: "#ff4444"
9181
9202
  }
9182
- ) : /* @__PURE__ */ jsx8(
9203
+ ) : /* @__PURE__ */ jsx9(
9183
9204
  "circle",
9184
9205
  {
9185
9206
  cx: screenCenter.x,
@@ -9193,7 +9214,7 @@ var ErrorOverlay = ({
9193
9214
  )
9194
9215
  }
9195
9216
  ),
9196
- /* @__PURE__ */ jsx8(
9217
+ /* @__PURE__ */ jsx9(
9197
9218
  "div",
9198
9219
  {
9199
9220
  style: {
@@ -9228,7 +9249,7 @@ var ErrorOverlay = ({
9228
9249
  }
9229
9250
  }
9230
9251
  ),
9231
- /* @__PURE__ */ jsx8(
9252
+ /* @__PURE__ */ jsx9(
9232
9253
  "div",
9233
9254
  {
9234
9255
  style: {
@@ -9246,7 +9267,7 @@ var ErrorOverlay = ({
9246
9267
  pointerEvents: "none",
9247
9268
  transform: popupPosition.transform
9248
9269
  },
9249
- children: /* @__PURE__ */ jsx8(
9270
+ children: /* @__PURE__ */ jsx9(
9250
9271
  "div",
9251
9272
  {
9252
9273
  className: `error-message ${errorMessageStyles}`,
@@ -9262,7 +9283,7 @@ var ErrorOverlay = ({
9262
9283
  ] }, `${errorId}_${compIndex}`);
9263
9284
  });
9264
9285
  }),
9265
- focusScreenCenter && /* @__PURE__ */ jsx8(FocusMarkerSVG, { center: focusScreenCenter })
9286
+ focusScreenCenter && /* @__PURE__ */ jsx9(FocusMarkerSVG, { center: focusScreenCenter })
9266
9287
  ] });
9267
9288
  };
9268
9289
 
@@ -9277,7 +9298,7 @@ function ifSetsMatchExactly(set1, set2) {
9277
9298
  }
9278
9299
 
9279
9300
  // src/components/MouseElementTracker.tsx
9280
- import { useEffect as useEffect10, useMemo as useMemo5, useState as useState7 } from "react";
9301
+ import { useEffect as useEffect10, useMemo as useMemo6, useState as useState7 } from "react";
9281
9302
  import { applyToPoint as applyToPoint15, inverse as inverse5 } from "transformation-matrix";
9282
9303
 
9283
9304
  // src/components/AnchorOffsetOverlay/common/guards.ts
@@ -9313,7 +9334,7 @@ var COLORS = {
9313
9334
  };
9314
9335
 
9315
9336
  // src/components/AnchorOffsetOverlay/AnchorOffsetOverlay.tsx
9316
- import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
9337
+ import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
9317
9338
  var AnchorOffsetOverlay = ({
9318
9339
  targets,
9319
9340
  transform,
@@ -9336,7 +9357,7 @@ var AnchorOffsetOverlay = ({
9336
9357
  anchorScreens.set(target.anchor_id, screenPoint);
9337
9358
  }
9338
9359
  });
9339
- return /* @__PURE__ */ jsx9(
9360
+ return /* @__PURE__ */ jsx10(
9340
9361
  "div",
9341
9362
  {
9342
9363
  style: {
@@ -9349,7 +9370,7 @@ var AnchorOffsetOverlay = ({
9349
9370
  pointerEvents: "none",
9350
9371
  zIndex: zIndexMap.dimensionOverlay
9351
9372
  },
9352
- children: /* @__PURE__ */ jsxs7(
9373
+ children: /* @__PURE__ */ jsxs8(
9353
9374
  "svg",
9354
9375
  {
9355
9376
  style: {
@@ -9379,8 +9400,8 @@ var AnchorOffsetOverlay = ({
9379
9400
  const shouldShowYLabel = yLineLength > VISUAL_CONFIG.MIN_LINE_LENGTH_FOR_LABEL;
9380
9401
  const xLabelText = `${target.display_offset_x ?? offsetX.toFixed(2)}mm`;
9381
9402
  const yLabelText = `${target.display_offset_y ?? offsetY.toFixed(2)}mm`;
9382
- return /* @__PURE__ */ jsxs7("g", { children: [
9383
- /* @__PURE__ */ jsx9(
9403
+ return /* @__PURE__ */ jsxs8("g", { children: [
9404
+ /* @__PURE__ */ jsx10(
9384
9405
  "line",
9385
9406
  {
9386
9407
  x1: anchorMarkerScreen.x,
@@ -9392,7 +9413,7 @@ var AnchorOffsetOverlay = ({
9392
9413
  strokeDasharray: VISUAL_CONFIG.LINE_DASH_PATTERN
9393
9414
  }
9394
9415
  ),
9395
- /* @__PURE__ */ jsx9(
9416
+ /* @__PURE__ */ jsx10(
9396
9417
  "line",
9397
9418
  {
9398
9419
  x1: targetScreen.x,
@@ -9404,7 +9425,7 @@ var AnchorOffsetOverlay = ({
9404
9425
  strokeDasharray: VISUAL_CONFIG.LINE_DASH_PATTERN
9405
9426
  }
9406
9427
  ),
9407
- target.type === "component" || target.type === "board" ? /* @__PURE__ */ jsx9(
9428
+ target.type === "component" || target.type === "board" ? /* @__PURE__ */ jsx10(
9408
9429
  "circle",
9409
9430
  {
9410
9431
  cx: targetScreen.x,
@@ -9416,8 +9437,8 @@ var AnchorOffsetOverlay = ({
9416
9437
  }
9417
9438
  ) : (
9418
9439
  // assumes "group"
9419
- /* @__PURE__ */ jsxs7(Fragment3, { children: [
9420
- /* @__PURE__ */ jsx9(
9440
+ /* @__PURE__ */ jsxs8(Fragment3, { children: [
9441
+ /* @__PURE__ */ jsx10(
9421
9442
  "line",
9422
9443
  {
9423
9444
  x1: targetScreen.x - VISUAL_CONFIG.ANCHOR_MARKER_SIZE,
@@ -9428,7 +9449,7 @@ var AnchorOffsetOverlay = ({
9428
9449
  strokeWidth: VISUAL_CONFIG.ANCHOR_MARKER_STROKE_WIDTH
9429
9450
  }
9430
9451
  ),
9431
- /* @__PURE__ */ jsx9(
9452
+ /* @__PURE__ */ jsx10(
9432
9453
  "line",
9433
9454
  {
9434
9455
  x1: targetScreen.x,
@@ -9441,7 +9462,7 @@ var AnchorOffsetOverlay = ({
9441
9462
  )
9442
9463
  ] })
9443
9464
  ),
9444
- shouldShowXLabel && /* @__PURE__ */ jsx9(
9465
+ shouldShowXLabel && /* @__PURE__ */ jsx10(
9445
9466
  "foreignObject",
9446
9467
  {
9447
9468
  x: Math.min(anchorMarkerScreen.x, targetScreen.x),
@@ -9449,10 +9470,10 @@ var AnchorOffsetOverlay = ({
9449
9470
  width: Math.abs(targetScreen.x - anchorMarkerScreen.x),
9450
9471
  height: 20,
9451
9472
  style: { overflow: "visible" },
9452
- children: /* @__PURE__ */ jsx9("div", { style: { ...labelStyle, textAlign: "center" }, children: xLabelText })
9473
+ children: /* @__PURE__ */ jsx10("div", { style: { ...labelStyle, textAlign: "center" }, children: xLabelText })
9453
9474
  }
9454
9475
  ),
9455
- shouldShowYLabel && /* @__PURE__ */ jsx9(
9476
+ shouldShowYLabel && /* @__PURE__ */ jsx10(
9456
9477
  "foreignObject",
9457
9478
  {
9458
9479
  x: targetScreen.x + yLabelOffset,
@@ -9460,7 +9481,7 @@ var AnchorOffsetOverlay = ({
9460
9481
  width: VISUAL_CONFIG.Y_LABEL_MIN_WIDTH,
9461
9482
  height: Math.abs(targetScreen.y - anchorMarkerScreen.y),
9462
9483
  style: { overflow: "visible" },
9463
- children: /* @__PURE__ */ jsx9(
9484
+ children: /* @__PURE__ */ jsx10(
9464
9485
  "div",
9465
9486
  {
9466
9487
  style: {
@@ -9479,8 +9500,8 @@ var AnchorOffsetOverlay = ({
9479
9500
  )
9480
9501
  ] }, target.id);
9481
9502
  }),
9482
- Array.from(anchorScreens.entries()).map(([anchorId, anchorScreen]) => /* @__PURE__ */ jsxs7("g", { children: [
9483
- /* @__PURE__ */ jsx9(
9503
+ Array.from(anchorScreens.entries()).map(([anchorId, anchorScreen]) => /* @__PURE__ */ jsxs8("g", { children: [
9504
+ /* @__PURE__ */ jsx10(
9484
9505
  "line",
9485
9506
  {
9486
9507
  x1: anchorScreen.x - VISUAL_CONFIG.ANCHOR_MARKER_SIZE,
@@ -9491,7 +9512,7 @@ var AnchorOffsetOverlay = ({
9491
9512
  strokeWidth: VISUAL_CONFIG.ANCHOR_MARKER_STROKE_WIDTH
9492
9513
  }
9493
9514
  ),
9494
- /* @__PURE__ */ jsx9(
9515
+ /* @__PURE__ */ jsx10(
9495
9516
  "line",
9496
9517
  {
9497
9518
  x1: anchorScreen.x,
@@ -9511,7 +9532,7 @@ var AnchorOffsetOverlay = ({
9511
9532
  };
9512
9533
 
9513
9534
  // src/components/AnchorOffsetOverlay/BoardAnchorOffsetOverlay.tsx
9514
- import { jsx as jsx10 } from "react/jsx-runtime";
9535
+ import { jsx as jsx11 } from "react/jsx-runtime";
9515
9536
  var BoardAnchorOffsetOverlay = ({
9516
9537
  elements,
9517
9538
  highlightedPrimitives,
@@ -9598,7 +9619,7 @@ var BoardAnchorOffsetOverlay = ({
9598
9619
  display_offset_y: target.group.display_offset_y
9599
9620
  };
9600
9621
  }).filter((t) => Boolean(t));
9601
- return /* @__PURE__ */ jsx10(
9622
+ return /* @__PURE__ */ jsx11(
9602
9623
  AnchorOffsetOverlay,
9603
9624
  {
9604
9625
  targets: sharedTargets,
@@ -9610,7 +9631,7 @@ var BoardAnchorOffsetOverlay = ({
9610
9631
  };
9611
9632
 
9612
9633
  // src/components/AnchorOffsetOverlay/GroupAnchorOffsetOverlay.tsx
9613
- import { jsx as jsx11 } from "react/jsx-runtime";
9634
+ import { jsx as jsx12 } from "react/jsx-runtime";
9614
9635
  var GroupAnchorOffsetOverlay = ({
9615
9636
  elements,
9616
9637
  highlightedPrimitives,
@@ -9726,7 +9747,7 @@ var GroupAnchorOffsetOverlay = ({
9726
9747
  display_offset_y: target.group.display_offset_y
9727
9748
  };
9728
9749
  }).filter((t) => Boolean(t));
9729
- return /* @__PURE__ */ jsx11(
9750
+ return /* @__PURE__ */ jsx12(
9730
9751
  AnchorOffsetOverlay,
9731
9752
  {
9732
9753
  targets: sharedTargets,
@@ -9739,7 +9760,7 @@ var GroupAnchorOffsetOverlay = ({
9739
9760
 
9740
9761
  // src/components/AnchorOffsetOverlay/ComponentBoundingBoxOverlay.tsx
9741
9762
  import { applyToPoint as applyToPoint14 } from "transformation-matrix";
9742
- import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
9763
+ import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
9743
9764
  var calculateComponentBoundingBox = (component, elements) => {
9744
9765
  const componentId = component.pcb_component_id;
9745
9766
  const padsAndHoles = elements.filter(
@@ -9782,7 +9803,7 @@ var ComponentBoundingBoxOverlay = ({
9782
9803
  renderData.push({ component, bbox, group });
9783
9804
  }
9784
9805
  if (renderData.length === 0) return null;
9785
- return /* @__PURE__ */ jsx12(
9806
+ return /* @__PURE__ */ jsx13(
9786
9807
  "div",
9787
9808
  {
9788
9809
  style: {
@@ -9795,7 +9816,7 @@ var ComponentBoundingBoxOverlay = ({
9795
9816
  pointerEvents: "none",
9796
9817
  zIndex: zIndexMap.dimensionOverlay
9797
9818
  },
9798
- children: /* @__PURE__ */ jsx12(
9819
+ children: /* @__PURE__ */ jsx13(
9799
9820
  "svg",
9800
9821
  {
9801
9822
  style: { position: "absolute", left: 0, top: 0, pointerEvents: "none" },
@@ -9821,8 +9842,8 @@ var ComponentBoundingBoxOverlay = ({
9821
9842
  y: (bbox.minY + bbox.maxY) / 2
9822
9843
  };
9823
9844
  const componentCenterScreen = applyToPoint14(transform, componentCenter);
9824
- return /* @__PURE__ */ jsxs8("g", { children: [
9825
- /* @__PURE__ */ jsx12(
9845
+ return /* @__PURE__ */ jsxs9("g", { children: [
9846
+ /* @__PURE__ */ jsx13(
9826
9847
  "rect",
9827
9848
  {
9828
9849
  x: screenBbox.x,
@@ -9835,7 +9856,7 @@ var ComponentBoundingBoxOverlay = ({
9835
9856
  strokeDasharray: "4,4"
9836
9857
  }
9837
9858
  ),
9838
- /* @__PURE__ */ jsx12(
9859
+ /* @__PURE__ */ jsx13(
9839
9860
  "line",
9840
9861
  {
9841
9862
  x1: componentCenterScreen.x - 6,
@@ -9846,7 +9867,7 @@ var ComponentBoundingBoxOverlay = ({
9846
9867
  strokeWidth: 1.5
9847
9868
  }
9848
9869
  ),
9849
- /* @__PURE__ */ jsx12(
9870
+ /* @__PURE__ */ jsx13(
9850
9871
  "line",
9851
9872
  {
9852
9873
  x1: componentCenterScreen.x,
@@ -9857,7 +9878,7 @@ var ComponentBoundingBoxOverlay = ({
9857
9878
  strokeWidth: 1.5
9858
9879
  }
9859
9880
  ),
9860
- /* @__PURE__ */ jsx12(
9881
+ /* @__PURE__ */ jsx13(
9861
9882
  "circle",
9862
9883
  {
9863
9884
  cx: componentCenterScreen.x,
@@ -9877,7 +9898,7 @@ var ComponentBoundingBoxOverlay = ({
9877
9898
  };
9878
9899
 
9879
9900
  // src/components/AnchorOffsetOverlay/PanelAnchorOffsetOverlay.tsx
9880
- import { jsx as jsx13 } from "react/jsx-runtime";
9901
+ import { jsx as jsx14 } from "react/jsx-runtime";
9881
9902
  var PanelAnchorOffsetOverlay = ({
9882
9903
  elements,
9883
9904
  highlightedPrimitives,
@@ -9926,7 +9947,7 @@ var PanelAnchorOffsetOverlay = ({
9926
9947
  display_offset_y: target.board.display_offset_y
9927
9948
  };
9928
9949
  }).filter((t) => Boolean(t));
9929
- return /* @__PURE__ */ jsx13(
9950
+ return /* @__PURE__ */ jsx14(
9930
9951
  AnchorOffsetOverlay,
9931
9952
  {
9932
9953
  targets: sharedTargets,
@@ -10016,7 +10037,7 @@ function filterTracesIfMultiple(filterTraces) {
10016
10037
 
10017
10038
  // src/components/ElementOverlayBox.tsx
10018
10039
  import { useEffect as useEffect9, useState as useState6 } from "react";
10019
- import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
10040
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
10020
10041
  var containerStyle = {
10021
10042
  position: "absolute",
10022
10043
  left: 0,
@@ -10107,7 +10128,7 @@ var HighlightedPrimitiveBoxWithText = ({
10107
10128
  const traceTextContext = { primitiveElement, elements };
10108
10129
  const overlayInfo = getTraceOverlayInfo(traceTextContext);
10109
10130
  if (!overlayInfo) return null;
10110
- return /* @__PURE__ */ jsx14(
10131
+ return /* @__PURE__ */ jsx15(
10111
10132
  "div",
10112
10133
  {
10113
10134
  style: {
@@ -10118,7 +10139,7 @@ var HighlightedPrimitiveBoxWithText = ({
10118
10139
  color: color8,
10119
10140
  pointerEvents: "none"
10120
10141
  },
10121
- children: /* @__PURE__ */ jsxs9(
10142
+ children: /* @__PURE__ */ jsxs10(
10122
10143
  "div",
10123
10144
  {
10124
10145
  style: {
@@ -10135,8 +10156,8 @@ var HighlightedPrimitiveBoxWithText = ({
10135
10156
  whiteSpace: "nowrap"
10136
10157
  },
10137
10158
  children: [
10138
- overlayInfo.text && /* @__PURE__ */ jsx14("div", { children: overlayInfo.text }),
10139
- overlayInfo.name && /* @__PURE__ */ jsx14(
10159
+ overlayInfo.text && /* @__PURE__ */ jsx15("div", { children: overlayInfo.text }),
10160
+ overlayInfo.name && /* @__PURE__ */ jsx15(
10140
10161
  "div",
10141
10162
  {
10142
10163
  style: {
@@ -10155,7 +10176,7 @@ var HighlightedPrimitiveBoxWithText = ({
10155
10176
  if (label.trim().length === 0) {
10156
10177
  return null;
10157
10178
  }
10158
- return /* @__PURE__ */ jsx14(
10179
+ return /* @__PURE__ */ jsx15(
10159
10180
  "div",
10160
10181
  {
10161
10182
  style: {
@@ -10169,7 +10190,7 @@ var HighlightedPrimitiveBoxWithText = ({
10169
10190
  transform: `rotate(${-rotation}deg)`,
10170
10191
  transformOrigin: "center center"
10171
10192
  },
10172
- children: /* @__PURE__ */ jsx14(
10193
+ children: /* @__PURE__ */ jsx15(
10173
10194
  "div",
10174
10195
  {
10175
10196
  style: {
@@ -10185,7 +10206,7 @@ var HighlightedPrimitiveBoxWithText = ({
10185
10206
  opacity: finalState ? 1 : si === 0 ? 1 : 0,
10186
10207
  transition: "width 0.2s, height 0.2s, margin-left 0.2s, margin-top 0.2s, opacity 0.2s"
10187
10208
  },
10188
- children: /* @__PURE__ */ jsx14(
10209
+ children: /* @__PURE__ */ jsx15(
10189
10210
  "div",
10190
10211
  {
10191
10212
  style: {
@@ -10233,7 +10254,7 @@ var ElementOverlayBox = ({
10233
10254
  is_showing_multiple_traces_length,
10234
10255
  elements
10235
10256
  });
10236
- return /* @__PURE__ */ jsx14("div", { style: containerStyle, children: !is_moving_component && primitives.map((primitive) => /* @__PURE__ */ jsx14(
10257
+ return /* @__PURE__ */ jsx15("div", { style: containerStyle, children: !is_moving_component && primitives.map((primitive) => /* @__PURE__ */ jsx15(
10237
10258
  HighlightedPrimitiveBoxWithText,
10238
10259
  {
10239
10260
  primitive,
@@ -10245,7 +10266,7 @@ var ElementOverlayBox = ({
10245
10266
  };
10246
10267
 
10247
10268
  // src/components/MouseElementTracker.tsx
10248
- import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
10269
+ import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
10249
10270
  var getPolygonBoundingBox = (points) => {
10250
10271
  if (points.length === 0) return null;
10251
10272
  let minX = points[0].x;
@@ -10368,7 +10389,7 @@ var MouseElementTracker = ({
10368
10389
  setMousedPrimitives([]);
10369
10390
  onMouseHoverOverPrimitives([]);
10370
10391
  }, [selectedLayer, onMouseHoverOverPrimitives]);
10371
- const highlightedPrimitives = useMemo5(() => {
10392
+ const highlightedPrimitives = useMemo6(() => {
10372
10393
  const highlightedPrimitives2 = [];
10373
10394
  for (const primitive of mousedPrimitives) {
10374
10395
  if (primitive._element?.type === "pcb_via") continue;
@@ -10448,7 +10469,7 @@ var MouseElementTracker = ({
10448
10469
  setMousedPrimitives(newMousedPrimitives);
10449
10470
  onMouseHoverOverPrimitives(newMousedPrimitives);
10450
10471
  };
10451
- return /* @__PURE__ */ jsxs10(
10472
+ return /* @__PURE__ */ jsxs11(
10452
10473
  "div",
10453
10474
  {
10454
10475
  ref: containerRef,
@@ -10472,7 +10493,7 @@ var MouseElementTracker = ({
10472
10493
  },
10473
10494
  children: [
10474
10495
  children,
10475
- /* @__PURE__ */ jsx15(
10496
+ /* @__PURE__ */ jsx16(
10476
10497
  ElementOverlayBox,
10477
10498
  {
10478
10499
  elements,
@@ -10480,8 +10501,8 @@ var MouseElementTracker = ({
10480
10501
  highlightedPrimitives
10481
10502
  }
10482
10503
  ),
10483
- transform && /* @__PURE__ */ jsxs10(Fragment4, { children: [
10484
- /* @__PURE__ */ jsx15(
10504
+ transform && /* @__PURE__ */ jsxs11(Fragment4, { children: [
10505
+ /* @__PURE__ */ jsx16(
10485
10506
  BoardAnchorOffsetOverlay,
10486
10507
  {
10487
10508
  elements,
@@ -10491,7 +10512,7 @@ var MouseElementTracker = ({
10491
10512
  containerHeight: height
10492
10513
  }
10493
10514
  ),
10494
- /* @__PURE__ */ jsx15(
10515
+ /* @__PURE__ */ jsx16(
10495
10516
  GroupAnchorOffsetOverlay,
10496
10517
  {
10497
10518
  elements,
@@ -10501,7 +10522,7 @@ var MouseElementTracker = ({
10501
10522
  containerHeight: height
10502
10523
  }
10503
10524
  ),
10504
- /* @__PURE__ */ jsx15(
10525
+ /* @__PURE__ */ jsx16(
10505
10526
  ComponentBoundingBoxOverlay,
10506
10527
  {
10507
10528
  elements,
@@ -10511,7 +10532,7 @@ var MouseElementTracker = ({
10511
10532
  containerHeight: height
10512
10533
  }
10513
10534
  ),
10514
- /* @__PURE__ */ jsx15(
10535
+ /* @__PURE__ */ jsx16(
10515
10536
  PanelAnchorOffsetOverlay,
10516
10537
  {
10517
10538
  elements,
@@ -10531,7 +10552,7 @@ var MouseElementTracker = ({
10531
10552
  import { applyToPoint as applyToPoint16 } from "transformation-matrix";
10532
10553
  import { identity as identity6 } from "transformation-matrix";
10533
10554
  import { useRef as useRef8, useEffect as useEffect11 } from "react";
10534
- import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
10555
+ import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
10535
10556
  var GROUP_COLORS = [
10536
10557
  "rgb(255, 100, 100)",
10537
10558
  "rgb(100, 255, 100)",
@@ -10767,14 +10788,14 @@ var PcbGroupOverlay = ({
10767
10788
  is_showing_group_anchor_offsets,
10768
10789
  hoveredComponentIds
10769
10790
  ]);
10770
- return /* @__PURE__ */ jsxs11(
10791
+ return /* @__PURE__ */ jsxs12(
10771
10792
  "div",
10772
10793
  {
10773
10794
  ref: containerRef,
10774
10795
  style: { position: "relative", width: "100%", height: "100%" },
10775
10796
  children: [
10776
10797
  children,
10777
- /* @__PURE__ */ jsx16(
10798
+ /* @__PURE__ */ jsx17(
10778
10799
  "canvas",
10779
10800
  {
10780
10801
  ref: canvasRef,
@@ -10795,15 +10816,15 @@ var PcbGroupOverlay = ({
10795
10816
 
10796
10817
  // src/components/RatsNestOverlay.tsx
10797
10818
  import { applyToPoint as applyToPoint17, identity as identity7 } from "transformation-matrix";
10798
- import { useMemo as useMemo6 } from "react";
10799
- import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
10819
+ import { useMemo as useMemo7 } from "react";
10820
+ import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
10800
10821
  var RatsNestOverlay = ({ transform, soup, children }) => {
10801
10822
  const isShowingRatsNest = useGlobalStore((s) => s.is_showing_rats_nest);
10802
- const { netMap, idToNetMap } = useMemo6(
10823
+ const { netMap, idToNetMap } = useMemo7(
10803
10824
  () => getFullConnectivityMapFromCircuitJson(soup || []),
10804
10825
  [soup]
10805
10826
  );
10806
- const ratsNestLines = useMemo6(() => {
10827
+ const ratsNestLines = useMemo7(() => {
10807
10828
  if (!soup || !isShowingRatsNest) return [];
10808
10829
  const getElementPosition = (id) => {
10809
10830
  const element = su(soup)[id.replace(/_\d+$/, "")].get(id);
@@ -10859,9 +10880,9 @@ var RatsNestOverlay = ({ transform, soup, children }) => {
10859
10880
  }, [soup, netMap, idToNetMap, isShowingRatsNest]);
10860
10881
  if (!soup || !isShowingRatsNest) return children;
10861
10882
  if (!transform) transform = identity7();
10862
- return /* @__PURE__ */ jsxs12("div", { style: { position: "relative" }, children: [
10883
+ return /* @__PURE__ */ jsxs13("div", { style: { position: "relative" }, children: [
10863
10884
  children,
10864
- /* @__PURE__ */ jsx17(
10885
+ /* @__PURE__ */ jsx18(
10865
10886
  "svg",
10866
10887
  {
10867
10888
  style: {
@@ -10877,7 +10898,7 @@ var RatsNestOverlay = ({ transform, soup, children }) => {
10877
10898
  children: ratsNestLines.map(({ key, startPoint, endPoint, isInNet }) => {
10878
10899
  const transformedStart = applyToPoint17(transform, startPoint);
10879
10900
  const transformedEnd = applyToPoint17(transform, endPoint);
10880
- return /* @__PURE__ */ jsx17(
10901
+ return /* @__PURE__ */ jsx18(
10881
10902
  "line",
10882
10903
  {
10883
10904
  x1: transformedStart.x,
@@ -10909,7 +10930,7 @@ import { css as css3 } from "@emotion/css";
10909
10930
  // package.json
10910
10931
  var package_default = {
10911
10932
  name: "@tscircuit/pcb-viewer",
10912
- version: "1.11.394",
10933
+ version: "1.11.396",
10913
10934
  main: "dist/index.js",
10914
10935
  type: "module",
10915
10936
  repository: {
@@ -10967,8 +10988,8 @@ var package_default = {
10967
10988
  "@tscircuit/alphabet": "^0.0.25",
10968
10989
  "@tscircuit/math-utils": "^0.0.36",
10969
10990
  "@vitejs/plugin-react": "^5.0.2",
10970
- "circuit-json": "^0.0.469",
10971
- "circuit-to-canvas": "0.0.124",
10991
+ "circuit-json": "^0.0.492",
10992
+ "circuit-to-canvas": "0.0.128",
10972
10993
  color: "^4.2.3",
10973
10994
  "react-supergrid": "^1.0.10",
10974
10995
  "react-toastify": "^10.0.5",
@@ -11071,7 +11092,7 @@ var useMobileTouch = (onClick, options = { stopPropagation: true }) => {
11071
11092
  var import_react_dom = __toESM(require_react_dom(), 1);
11072
11093
  import { css as css2 } from "@emotion/css";
11073
11094
  import { useEffect as useEffect14, useRef as useRef11, useState as useState9 } from "react";
11074
- import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
11095
+ import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
11075
11096
  var menuStyle = css2`
11076
11097
  background: #222;
11077
11098
  color: #eee;
@@ -11134,7 +11155,7 @@ var VisibilityContextMenu = ({
11134
11155
  };
11135
11156
  }, [onClose]);
11136
11157
  return (0, import_react_dom.createPortal)(
11137
- /* @__PURE__ */ jsx18(
11158
+ /* @__PURE__ */ jsx19(
11138
11159
  "div",
11139
11160
  {
11140
11161
  ref,
@@ -11193,13 +11214,13 @@ var VisibilityContextMenu = ({
11193
11214
  maxHeight: window.innerHeight - 8,
11194
11215
  ...stacked ? { overflowY: "auto" } : {}
11195
11216
  },
11196
- children: /* @__PURE__ */ jsxs13(
11217
+ children: /* @__PURE__ */ jsxs14(
11197
11218
  "div",
11198
11219
  {
11199
11220
  style: { position: "relative" },
11200
11221
  onMouseEnter: () => setVisibilityOpen(true),
11201
11222
  children: [
11202
- /* @__PURE__ */ jsx18(
11223
+ /* @__PURE__ */ jsx19(
11203
11224
  "button",
11204
11225
  {
11205
11226
  type: "button",
@@ -11211,20 +11232,20 @@ var VisibilityContextMenu = ({
11211
11232
  children: "Visibility \u25B8"
11212
11233
  }
11213
11234
  ),
11214
- visibilityOpen && /* @__PURE__ */ jsx18(
11235
+ visibilityOpen && /* @__PURE__ */ jsx19(
11215
11236
  "div",
11216
11237
  {
11217
11238
  role: "menu",
11218
11239
  "aria-label": "Visibility",
11219
11240
  className: menuStyle,
11220
11241
  style: submenuStyle,
11221
- children: /* @__PURE__ */ jsxs13(
11242
+ children: /* @__PURE__ */ jsxs14(
11222
11243
  "div",
11223
11244
  {
11224
11245
  style: { position: "relative" },
11225
11246
  onMouseEnter: () => setOpacityOpen(true),
11226
11247
  children: [
11227
- /* @__PURE__ */ jsx18(
11248
+ /* @__PURE__ */ jsx19(
11228
11249
  "button",
11229
11250
  {
11230
11251
  type: "button",
@@ -11236,7 +11257,7 @@ var VisibilityContextMenu = ({
11236
11257
  children: "Hidden Layer Visibility \u25B8"
11237
11258
  }
11238
11259
  ),
11239
- opacityOpen && /* @__PURE__ */ jsx18(
11260
+ opacityOpen && /* @__PURE__ */ jsx19(
11240
11261
  "div",
11241
11262
  {
11242
11263
  role: "menu",
@@ -11246,7 +11267,7 @@ var VisibilityContextMenu = ({
11246
11267
  minWidth: 80,
11247
11268
  ...submenuStyle
11248
11269
  },
11249
- children: [0, 0.1, 0.2, 0.4, 0.6, 0.8, 1].map((value) => /* @__PURE__ */ jsxs13(
11270
+ children: [0, 0.1, 0.2, 0.4, 0.6, 0.8, 1].map((value) => /* @__PURE__ */ jsxs14(
11250
11271
  "button",
11251
11272
  {
11252
11273
  type: "button",
@@ -11258,7 +11279,7 @@ var VisibilityContextMenu = ({
11258
11279
  onClose();
11259
11280
  },
11260
11281
  children: [
11261
- /* @__PURE__ */ jsx18(
11282
+ /* @__PURE__ */ jsx19(
11262
11283
  "span",
11263
11284
  {
11264
11285
  "aria-hidden": "true",
@@ -11288,7 +11309,7 @@ var VisibilityContextMenu = ({
11288
11309
  };
11289
11310
 
11290
11311
  // src/components/ToolbarButton.tsx
11291
- import { jsx as jsx19 } from "react/jsx-runtime";
11312
+ import { jsx as jsx20 } from "react/jsx-runtime";
11292
11313
  var ToolbarButton = ({
11293
11314
  children,
11294
11315
  isSmallScreen,
@@ -11296,7 +11317,7 @@ var ToolbarButton = ({
11296
11317
  ...props
11297
11318
  }) => {
11298
11319
  const { style: touchStyle, ...touchHandlers } = useMobileTouch(onClick);
11299
- return /* @__PURE__ */ jsx19(
11320
+ return /* @__PURE__ */ jsx20(
11300
11321
  "div",
11301
11322
  {
11302
11323
  ...props,
@@ -11324,7 +11345,7 @@ var ToolbarButton = ({
11324
11345
  };
11325
11346
 
11326
11347
  // src/components/ToolbarErrorDropdown.tsx
11327
- import { useCallback as useCallback9, useMemo as useMemo7, useState as useState10 } from "react";
11348
+ import { useCallback as useCallback9, useMemo as useMemo8, useState as useState10 } from "react";
11328
11349
 
11329
11350
  // src/lib/util/group-errors-by-type.ts
11330
11351
  var groupErrorsByType = (errors) => {
@@ -11404,7 +11425,7 @@ var useToolbarErrorFocus = ({
11404
11425
  };
11405
11426
 
11406
11427
  // src/components/ToolbarErrorDropdown.tsx
11407
- import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
11428
+ import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
11408
11429
  var CopyErrorButton = ({
11409
11430
  errorId,
11410
11431
  errorMessage,
@@ -11414,7 +11435,7 @@ var CopyErrorButton = ({
11414
11435
  const { style: touchStyle, ...touchHandlers } = useMobileTouch(
11415
11436
  () => onCopy(errorMessage, errorId)
11416
11437
  );
11417
- return /* @__PURE__ */ jsx20(
11438
+ return /* @__PURE__ */ jsx21(
11418
11439
  "button",
11419
11440
  {
11420
11441
  type: "button",
@@ -11434,7 +11455,7 @@ var CopyErrorButton = ({
11434
11455
  ...touchStyle
11435
11456
  },
11436
11457
  ...touchHandlers,
11437
- children: copiedErrorId === errorId ? /* @__PURE__ */ jsx20("span", { style: { color: "#4caf50", fontSize: 12 }, children: "Copied!" }) : /* @__PURE__ */ jsx20("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx20("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" }) })
11458
+ children: copiedErrorId === errorId ? /* @__PURE__ */ jsx21("span", { style: { color: "#4caf50", fontSize: 12 }, children: "Copied!" }) : /* @__PURE__ */ jsx21("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx21("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" }) })
11438
11459
  }
11439
11460
  );
11440
11461
  };
@@ -11460,14 +11481,14 @@ var ToolbarErrorDropdown = ({
11460
11481
  setHoveredErrorId,
11461
11482
  setFocusedErrorId
11462
11483
  });
11463
- const errorElements = useMemo7(
11484
+ const errorElements = useMemo8(
11464
11485
  () => elements?.filter(
11465
11486
  (el) => el.type.includes("error")
11466
11487
  ) ?? [],
11467
11488
  [elements]
11468
11489
  );
11469
11490
  const errorCount = errorElements.length;
11470
- const groupedErrorElements = useMemo7(
11491
+ const groupedErrorElements = useMemo8(
11471
11492
  () => groupErrorsByType(errorElements),
11472
11493
  [errorElements]
11473
11494
  );
@@ -11493,20 +11514,20 @@ var ToolbarErrorDropdown = ({
11493
11514
  return next;
11494
11515
  });
11495
11516
  }, []);
11496
- return /* @__PURE__ */ jsxs14("div", { style: { position: "relative" }, children: [
11497
- /* @__PURE__ */ jsx20(
11517
+ return /* @__PURE__ */ jsxs15("div", { style: { position: "relative" }, children: [
11518
+ /* @__PURE__ */ jsx21(
11498
11519
  ToolbarButton,
11499
11520
  {
11500
11521
  isSmallScreen,
11501
11522
  style: errorCount > 0 ? { color: "red" } : void 0,
11502
11523
  onClick: onToggle,
11503
- children: /* @__PURE__ */ jsxs14("div", { children: [
11524
+ children: /* @__PURE__ */ jsxs15("div", { children: [
11504
11525
  errorCount,
11505
11526
  " errors"
11506
11527
  ] })
11507
11528
  }
11508
11529
  ),
11509
- isOpen && errorCount > 0 && /* @__PURE__ */ jsx20(
11530
+ isOpen && errorCount > 0 && /* @__PURE__ */ jsx21(
11510
11531
  "div",
11511
11532
  {
11512
11533
  style: {
@@ -11526,14 +11547,14 @@ var ToolbarErrorDropdown = ({
11526
11547
  },
11527
11548
  children: groupedErrorElements.map(({ errorType, errors }, groupIndex) => {
11528
11549
  const isGroupCollapsed = collapsedErrorGroups.has(errorType);
11529
- return /* @__PURE__ */ jsxs14(
11550
+ return /* @__PURE__ */ jsxs15(
11530
11551
  "div",
11531
11552
  {
11532
11553
  style: {
11533
11554
  borderBottom: groupIndex < groupedErrorElements.length - 1 ? "1px solid #444" : "none"
11534
11555
  },
11535
11556
  children: [
11536
- /* @__PURE__ */ jsxs14(
11557
+ /* @__PURE__ */ jsxs15(
11537
11558
  "div",
11538
11559
  {
11539
11560
  style: {
@@ -11570,7 +11591,7 @@ var ToolbarErrorDropdown = ({
11570
11591
  toggleErrorGroup(errorType);
11571
11592
  },
11572
11593
  children: [
11573
- /* @__PURE__ */ jsxs14(
11594
+ /* @__PURE__ */ jsxs15(
11574
11595
  "div",
11575
11596
  {
11576
11597
  style: {
@@ -11580,7 +11601,7 @@ var ToolbarErrorDropdown = ({
11580
11601
  color: "#ff6b6b"
11581
11602
  },
11582
11603
  children: [
11583
- /* @__PURE__ */ jsx20(
11604
+ /* @__PURE__ */ jsx21(
11584
11605
  "div",
11585
11606
  {
11586
11607
  style: {
@@ -11593,7 +11614,7 @@ var ToolbarErrorDropdown = ({
11593
11614
  children: "\u203A"
11594
11615
  }
11595
11616
  ),
11596
- /* @__PURE__ */ jsx20(
11617
+ /* @__PURE__ */ jsx21(
11597
11618
  "div",
11598
11619
  {
11599
11620
  style: {
@@ -11606,7 +11627,7 @@ var ToolbarErrorDropdown = ({
11606
11627
  ]
11607
11628
  }
11608
11629
  ),
11609
- /* @__PURE__ */ jsx20(
11630
+ /* @__PURE__ */ jsx21(
11610
11631
  "div",
11611
11632
  {
11612
11633
  style: {
@@ -11624,14 +11645,14 @@ var ToolbarErrorDropdown = ({
11624
11645
  !isGroupCollapsed && errors.map(({ error, index, errorId }) => {
11625
11646
  const isExpanded = expandedErrorIds.has(errorId);
11626
11647
  const errorMessage = error.message ?? "No error message";
11627
- return /* @__PURE__ */ jsxs14(
11648
+ return /* @__PURE__ */ jsxs15(
11628
11649
  "div",
11629
11650
  {
11630
11651
  style: {
11631
11652
  borderTop: "1px solid #3a3a3a"
11632
11653
  },
11633
11654
  children: [
11634
- /* @__PURE__ */ jsxs14(
11655
+ /* @__PURE__ */ jsxs15(
11635
11656
  "div",
11636
11657
  {
11637
11658
  style: {
@@ -11670,7 +11691,7 @@ var ToolbarErrorDropdown = ({
11670
11691
  handleErrorSelect(errorId);
11671
11692
  },
11672
11693
  children: [
11673
- /* @__PURE__ */ jsx20(
11694
+ /* @__PURE__ */ jsx21(
11674
11695
  "div",
11675
11696
  {
11676
11697
  style: {
@@ -11686,7 +11707,7 @@ var ToolbarErrorDropdown = ({
11686
11707
  children: errorMessage
11687
11708
  }
11688
11709
  ),
11689
- /* @__PURE__ */ jsx20(
11710
+ /* @__PURE__ */ jsx21(
11690
11711
  "button",
11691
11712
  {
11692
11713
  type: "button",
@@ -11718,7 +11739,7 @@ var ToolbarErrorDropdown = ({
11718
11739
  ]
11719
11740
  }
11720
11741
  ),
11721
- isExpanded && /* @__PURE__ */ jsxs14(
11742
+ isExpanded && /* @__PURE__ */ jsxs15(
11722
11743
  "div",
11723
11744
  {
11724
11745
  "data-error-id": index,
@@ -11730,7 +11751,7 @@ var ToolbarErrorDropdown = ({
11730
11751
  position: "relative"
11731
11752
  },
11732
11753
  children: [
11733
- /* @__PURE__ */ jsx20(
11754
+ /* @__PURE__ */ jsx21(
11734
11755
  "div",
11735
11756
  {
11736
11757
  style: {
@@ -11748,7 +11769,7 @@ var ToolbarErrorDropdown = ({
11748
11769
  children: errorMessage
11749
11770
  }
11750
11771
  ),
11751
- /* @__PURE__ */ jsx20(
11772
+ /* @__PURE__ */ jsx21(
11752
11773
  CopyErrorButton,
11753
11774
  {
11754
11775
  errorId,
@@ -11780,10 +11801,10 @@ var ToolbarErrorDropdown = ({
11780
11801
  };
11781
11802
 
11782
11803
  // src/components/ToolbarOverlay.tsx
11783
- import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
11804
+ import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
11784
11805
  var LayerButton = ({ name, selected, onClick }) => {
11785
11806
  const { style: touchStyle, ...touchHandlers } = useMobileTouch(onClick);
11786
- return /* @__PURE__ */ jsxs15(
11807
+ return /* @__PURE__ */ jsxs16(
11787
11808
  "div",
11788
11809
  {
11789
11810
  className: css3`
@@ -11800,8 +11821,8 @@ var LayerButton = ({ name, selected, onClick }) => {
11800
11821
  ...touchHandlers,
11801
11822
  style: touchStyle,
11802
11823
  children: [
11803
- /* @__PURE__ */ jsx21("span", { style: { marginRight: 2, opacity: selected ? 1 : 0 }, children: "\u2022" }),
11804
- /* @__PURE__ */ jsx21(
11824
+ /* @__PURE__ */ jsx22("span", { style: { marginRight: 2, opacity: selected ? 1 : 0 }, children: "\u2022" }),
11825
+ /* @__PURE__ */ jsx22(
11805
11826
  "span",
11806
11827
  {
11807
11828
  style: {
@@ -11822,7 +11843,7 @@ var CheckboxMenuItem = ({
11822
11843
  onClick
11823
11844
  }) => {
11824
11845
  const { style: touchStyle, ...touchHandlers } = useMobileTouch(onClick);
11825
- return /* @__PURE__ */ jsxs15(
11846
+ return /* @__PURE__ */ jsxs16(
11826
11847
  "div",
11827
11848
  {
11828
11849
  className: css3`
@@ -11842,16 +11863,16 @@ var CheckboxMenuItem = ({
11842
11863
  ...touchHandlers,
11843
11864
  style: touchStyle,
11844
11865
  children: [
11845
- /* @__PURE__ */ jsx21("input", { type: "checkbox", checked, onChange: () => {
11866
+ /* @__PURE__ */ jsx22("input", { type: "checkbox", checked, onChange: () => {
11846
11867
  }, readOnly: true }),
11847
- /* @__PURE__ */ jsx21("span", { style: { color: "#eee" }, children: label })
11868
+ /* @__PURE__ */ jsx22("span", { style: { color: "#eee" }, children: label })
11848
11869
  ]
11849
11870
  }
11850
11871
  );
11851
11872
  };
11852
11873
  var RadioMenuItem = ({ label, checked, onClick }) => {
11853
11874
  const { style: touchStyle, ...touchHandlers } = useMobileTouch(onClick);
11854
- return /* @__PURE__ */ jsxs15(
11875
+ return /* @__PURE__ */ jsxs16(
11855
11876
  "div",
11856
11877
  {
11857
11878
  className: css3`
@@ -11871,9 +11892,9 @@ var RadioMenuItem = ({ label, checked, onClick }) => {
11871
11892
  ...touchHandlers,
11872
11893
  style: touchStyle,
11873
11894
  children: [
11874
- /* @__PURE__ */ jsx21("input", { type: "radio", checked, onChange: () => {
11895
+ /* @__PURE__ */ jsx22("input", { type: "radio", checked, onChange: () => {
11875
11896
  }, readOnly: true }),
11876
- /* @__PURE__ */ jsx21("span", { style: { color: "#eee" }, children: label })
11897
+ /* @__PURE__ */ jsx22("span", { style: { color: "#eee" }, children: label })
11877
11898
  ]
11878
11899
  }
11879
11900
  );
@@ -12073,7 +12094,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12073
12094
  },
12074
12095
  []
12075
12096
  );
12076
- return /* @__PURE__ */ jsxs15(
12097
+ return /* @__PURE__ */ jsxs16(
12077
12098
  "div",
12078
12099
  {
12079
12100
  ref: hotkeyBoundaryRef,
@@ -12088,14 +12109,14 @@ var ToolbarOverlay = ({ children, elements }) => {
12088
12109
  onMouseMove: handleMouseMove,
12089
12110
  children: [
12090
12111
  children,
12091
- contextMenuPosition && /* @__PURE__ */ jsx21(
12112
+ contextMenuPosition && /* @__PURE__ */ jsx22(
12092
12113
  VisibilityContextMenu,
12093
12114
  {
12094
12115
  position: contextMenuPosition,
12095
12116
  onClose: closeContextMenu
12096
12117
  }
12097
12118
  ),
12098
- /* @__PURE__ */ jsxs15(
12119
+ /* @__PURE__ */ jsxs16(
12099
12120
  "div",
12100
12121
  {
12101
12122
  style: {
@@ -12116,7 +12137,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12116
12137
  ]
12117
12138
  }
12118
12139
  ),
12119
- /* @__PURE__ */ jsxs15(
12140
+ /* @__PURE__ */ jsxs16(
12120
12141
  "div",
12121
12142
  {
12122
12143
  "data-toolbar-overlay": true,
@@ -12147,7 +12168,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12147
12168
  fontFamily: "sans-serif"
12148
12169
  },
12149
12170
  children: [
12150
- /* @__PURE__ */ jsxs15(
12171
+ /* @__PURE__ */ jsxs16(
12151
12172
  ToolbarButton,
12152
12173
  {
12153
12174
  isSmallScreen,
@@ -12158,10 +12179,10 @@ var ToolbarOverlay = ({ children, elements }) => {
12158
12179
  }
12159
12180
  },
12160
12181
  children: [
12161
- /* @__PURE__ */ jsxs15("div", { children: [
12182
+ /* @__PURE__ */ jsxs16("div", { children: [
12162
12183
  "layer:",
12163
12184
  " ",
12164
- /* @__PURE__ */ jsx21(
12185
+ /* @__PURE__ */ jsx22(
12165
12186
  "span",
12166
12187
  {
12167
12188
  style: {
@@ -12173,7 +12194,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12173
12194
  }
12174
12195
  )
12175
12196
  ] }),
12176
- isLayerMenuOpen && /* @__PURE__ */ jsx21("div", { style: { marginTop: 4, minWidth: 120 }, children: processedLayers.map((layer) => /* @__PURE__ */ jsx21(
12197
+ isLayerMenuOpen && /* @__PURE__ */ jsx22("div", { style: { marginTop: 4, minWidth: 120 }, children: processedLayers.map((layer) => /* @__PURE__ */ jsx22(
12177
12198
  LayerButton,
12178
12199
  {
12179
12200
  name: layer,
@@ -12187,7 +12208,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12187
12208
  ]
12188
12209
  }
12189
12210
  ),
12190
- /* @__PURE__ */ jsx21(
12211
+ /* @__PURE__ */ jsx22(
12191
12212
  ToolbarErrorDropdown,
12192
12213
  {
12193
12214
  elements,
@@ -12199,43 +12220,43 @@ var ToolbarOverlay = ({ children, elements }) => {
12199
12220
  setFocusedErrorId
12200
12221
  }
12201
12222
  ),
12202
- /* @__PURE__ */ jsx21(
12223
+ /* @__PURE__ */ jsx22(
12203
12224
  ToolbarButton,
12204
12225
  {
12205
12226
  isSmallScreen,
12206
12227
  style: {},
12207
12228
  onClick: handleRatsNestToggle,
12208
- children: /* @__PURE__ */ jsxs15("div", { children: [
12229
+ children: /* @__PURE__ */ jsxs16("div", { children: [
12209
12230
  viewSettings.is_showing_rats_nest ? "\u2716 " : "",
12210
12231
  "Rats Nest"
12211
12232
  ] })
12212
12233
  }
12213
12234
  ),
12214
- /* @__PURE__ */ jsx21(
12235
+ /* @__PURE__ */ jsx22(
12215
12236
  ToolbarButton,
12216
12237
  {
12217
12238
  isSmallScreen,
12218
12239
  style: measureToolArmed ? { backgroundColor: "#444" } : {},
12219
12240
  onClick: handleMeasureToolClick,
12220
- children: /* @__PURE__ */ jsx21("div", { children: "\u{1F4CF}" })
12241
+ children: /* @__PURE__ */ jsx22("div", { children: "\u{1F4CF}" })
12221
12242
  }
12222
12243
  ),
12223
- /* @__PURE__ */ jsx21(
12244
+ /* @__PURE__ */ jsx22(
12224
12245
  ToolbarButton,
12225
12246
  {
12226
12247
  isSmallScreen,
12227
12248
  style: boundsToolArmed ? { backgroundColor: "#444" } : {},
12228
12249
  onClick: handleBoundsToolClick,
12229
- children: /* @__PURE__ */ jsx21("div", { children: "Bounds" })
12250
+ children: /* @__PURE__ */ jsx22("div", { children: "Bounds" })
12230
12251
  }
12231
12252
  ),
12232
- /* @__PURE__ */ jsx21(
12253
+ /* @__PURE__ */ jsx22(
12233
12254
  ToolbarButton,
12234
12255
  {
12235
12256
  isSmallScreen,
12236
12257
  onClick: handleViewMenuToggle,
12237
- children: /* @__PURE__ */ jsxs15("div", { children: [
12238
- /* @__PURE__ */ jsxs15(
12258
+ children: /* @__PURE__ */ jsxs16("div", { children: [
12259
+ /* @__PURE__ */ jsxs16(
12239
12260
  "div",
12240
12261
  {
12241
12262
  style: {
@@ -12245,7 +12266,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12245
12266
  },
12246
12267
  children: [
12247
12268
  "View",
12248
- /* @__PURE__ */ jsx21(
12269
+ /* @__PURE__ */ jsx22(
12249
12270
  "span",
12250
12271
  {
12251
12272
  style: {
@@ -12260,8 +12281,8 @@ var ToolbarOverlay = ({ children, elements }) => {
12260
12281
  ]
12261
12282
  }
12262
12283
  ),
12263
- isViewMenuOpen && /* @__PURE__ */ jsxs15("div", { style: { marginTop: 4, minWidth: 120 }, children: [
12264
- /* @__PURE__ */ jsx21(
12284
+ isViewMenuOpen && /* @__PURE__ */ jsxs16("div", { style: { marginTop: 4, minWidth: 120 }, children: [
12285
+ /* @__PURE__ */ jsx22(
12265
12286
  CheckboxMenuItem,
12266
12287
  {
12267
12288
  label: "Show All Trace Lengths",
@@ -12273,7 +12294,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12273
12294
  }
12274
12295
  }
12275
12296
  ),
12276
- /* @__PURE__ */ jsx21(
12297
+ /* @__PURE__ */ jsx22(
12277
12298
  CheckboxMenuItem,
12278
12299
  {
12279
12300
  label: "Show Autorouting Animation",
@@ -12285,7 +12306,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12285
12306
  }
12286
12307
  }
12287
12308
  ),
12288
- /* @__PURE__ */ jsx21(
12309
+ /* @__PURE__ */ jsx22(
12289
12310
  CheckboxMenuItem,
12290
12311
  {
12291
12312
  label: "Show DRC Errors",
@@ -12295,7 +12316,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12295
12316
  }
12296
12317
  }
12297
12318
  ),
12298
- /* @__PURE__ */ jsx21(
12319
+ /* @__PURE__ */ jsx22(
12299
12320
  CheckboxMenuItem,
12300
12321
  {
12301
12322
  label: "Show DRC Warnings",
@@ -12307,7 +12328,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12307
12328
  }
12308
12329
  }
12309
12330
  ),
12310
- /* @__PURE__ */ jsx21(
12331
+ /* @__PURE__ */ jsx22(
12311
12332
  CheckboxMenuItem,
12312
12333
  {
12313
12334
  label: "Show Copper Pours",
@@ -12319,7 +12340,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12319
12340
  }
12320
12341
  }
12321
12342
  ),
12322
- /* @__PURE__ */ jsx21(
12343
+ /* @__PURE__ */ jsx22(
12323
12344
  CheckboxMenuItem,
12324
12345
  {
12325
12346
  label: "Show Courtyards",
@@ -12329,7 +12350,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12329
12350
  }
12330
12351
  }
12331
12352
  ),
12332
- /* @__PURE__ */ jsx21(
12353
+ /* @__PURE__ */ jsx22(
12333
12354
  CheckboxMenuItem,
12334
12355
  {
12335
12356
  label: "Show Solder Mask",
@@ -12339,7 +12360,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12339
12360
  }
12340
12361
  }
12341
12362
  ),
12342
- /* @__PURE__ */ jsx21(
12363
+ /* @__PURE__ */ jsx22(
12343
12364
  CheckboxMenuItem,
12344
12365
  {
12345
12366
  label: "Show Silkscreen",
@@ -12349,7 +12370,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12349
12370
  }
12350
12371
  }
12351
12372
  ),
12352
- /* @__PURE__ */ jsx21(
12373
+ /* @__PURE__ */ jsx22(
12353
12374
  CheckboxMenuItem,
12354
12375
  {
12355
12376
  label: "Show Fabrication Notes",
@@ -12361,7 +12382,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12361
12382
  }
12362
12383
  }
12363
12384
  ),
12364
- /* @__PURE__ */ jsx21(
12385
+ /* @__PURE__ */ jsx22(
12365
12386
  CheckboxMenuItem,
12366
12387
  {
12367
12388
  label: "Show PCB Notes",
@@ -12371,7 +12392,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12371
12392
  }
12372
12393
  }
12373
12394
  ),
12374
- /* @__PURE__ */ jsx21(
12395
+ /* @__PURE__ */ jsx22(
12375
12396
  CheckboxMenuItem,
12376
12397
  {
12377
12398
  label: "Show Group Anchor Offsets",
@@ -12383,7 +12404,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12383
12404
  }
12384
12405
  }
12385
12406
  ),
12386
- /* @__PURE__ */ jsx21(
12407
+ /* @__PURE__ */ jsx22(
12387
12408
  CheckboxMenuItem,
12388
12409
  {
12389
12410
  label: "Show PCB Groups",
@@ -12393,8 +12414,8 @@ var ToolbarOverlay = ({ children, elements }) => {
12393
12414
  }
12394
12415
  }
12395
12416
  ),
12396
- viewSettings.is_showing_pcb_groups && /* @__PURE__ */ jsxs15("div", { style: { marginLeft: 16 }, children: [
12397
- /* @__PURE__ */ jsx21(
12417
+ viewSettings.is_showing_pcb_groups && /* @__PURE__ */ jsxs16("div", { style: { marginLeft: 16 }, children: [
12418
+ /* @__PURE__ */ jsx22(
12398
12419
  RadioMenuItem,
12399
12420
  {
12400
12421
  label: "Show All Groups",
@@ -12404,7 +12425,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12404
12425
  }
12405
12426
  }
12406
12427
  ),
12407
- /* @__PURE__ */ jsx21(
12428
+ /* @__PURE__ */ jsx22(
12408
12429
  RadioMenuItem,
12409
12430
  {
12410
12431
  label: "Show Named Groups",
@@ -12441,7 +12462,7 @@ var getPcbWarningHighlightLabel = (warning) => {
12441
12462
  };
12442
12463
 
12443
12464
  // src/components/WarningGraphicsOverlay.tsx
12444
- import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
12465
+ import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
12445
12466
  var WarningGraphicsOverlay = ({
12446
12467
  children,
12447
12468
  transform = identity8(),
@@ -12503,7 +12524,7 @@ var WarningGraphicsOverlay = ({
12503
12524
  });
12504
12525
  }, [elements, transform, width, height, isShowingDrcWarnings]);
12505
12526
  if (!isShowingDrcWarnings) {
12506
- return /* @__PURE__ */ jsx22(
12527
+ return /* @__PURE__ */ jsx23(
12507
12528
  "div",
12508
12529
  {
12509
12530
  ref: containerRef,
@@ -12512,14 +12533,14 @@ var WarningGraphicsOverlay = ({
12512
12533
  }
12513
12534
  );
12514
12535
  }
12515
- return /* @__PURE__ */ jsxs16(
12536
+ return /* @__PURE__ */ jsxs17(
12516
12537
  "div",
12517
12538
  {
12518
12539
  ref: containerRef,
12519
12540
  style: { position: "relative", width: "100%", height: "100%" },
12520
12541
  children: [
12521
12542
  children,
12522
- /* @__PURE__ */ jsx22(
12543
+ /* @__PURE__ */ jsx23(
12523
12544
  "canvas",
12524
12545
  {
12525
12546
  ref: canvasRef,
@@ -12538,7 +12559,7 @@ var WarningGraphicsOverlay = ({
12538
12559
  };
12539
12560
 
12540
12561
  // src/components/CanvasElementsRenderer.tsx
12541
- import { jsx as jsx23 } from "react/jsx-runtime";
12562
+ import { jsx as jsx24 } from "react/jsx-runtime";
12542
12563
  var CanvasElementsRenderer = (props) => {
12543
12564
  const { transform, elements } = props;
12544
12565
  const {
@@ -12553,11 +12574,11 @@ var CanvasElementsRenderer = (props) => {
12553
12574
  selectedLayer: state.selected_layer
12554
12575
  }));
12555
12576
  const activeErrorId = focusedErrorId ?? hoveredErrorId;
12556
- const elementsToRender = useMemo8(
12577
+ const elementsToRender = useMemo9(
12557
12578
  () => isShowingCopperPours ? elements : elements.filter((elm) => elm.type !== "pcb_copper_pour"),
12558
12579
  [elements, isShowingCopperPours]
12559
12580
  );
12560
- const [primitivesWithoutInteractionMetadata, connectivityMap] = useMemo8(() => {
12581
+ const [primitivesWithoutInteractionMetadata, connectivityMap] = useMemo9(() => {
12561
12582
  const primitivesWithoutInteractionMetadata2 = elementsToRender.flatMap(
12562
12583
  (elm) => convertElementToPrimitives(elm, props.elements)
12563
12584
  );
@@ -12573,11 +12594,11 @@ var CanvasElementsRenderer = (props) => {
12573
12594
  const [hoveredComponentIds, setHoveredComponentIds] = useState12([]);
12574
12595
  const currentTransformRef = useRef15(transform ?? null);
12575
12596
  const zoomAnimationFrameRef = useRef15(null);
12576
- const elementIndexes = useMemo8(
12597
+ const elementIndexes = useMemo9(
12577
12598
  () => buildErrorPreviewElementIndexes(elements),
12578
12599
  [elements]
12579
12600
  );
12580
- const errorRelatedIds = useMemo8(() => {
12601
+ const errorRelatedIds = useMemo9(() => {
12581
12602
  if (!activeErrorId) return [];
12582
12603
  const errorElements = elements.filter(
12583
12604
  (el) => el.type.includes("error")
@@ -12636,7 +12657,7 @@ var CanvasElementsRenderer = (props) => {
12636
12657
  props.setTransform,
12637
12658
  props.width
12638
12659
  ]);
12639
- const primitives = useMemo8(() => {
12660
+ const primitives = useMemo9(() => {
12640
12661
  const combinedPrimitiveIds = [
12641
12662
  ...hoverState.primitiveIdsInMousedOverNet,
12642
12663
  ...errorRelatedIds
@@ -12680,7 +12701,7 @@ var CanvasElementsRenderer = (props) => {
12680
12701
  },
12681
12702
  [connectivityMap]
12682
12703
  );
12683
- return /* @__PURE__ */ jsx23(
12704
+ return /* @__PURE__ */ jsx24(
12684
12705
  MouseElementTracker,
12685
12706
  {
12686
12707
  elements: elementsToRender,
@@ -12688,7 +12709,7 @@ var CanvasElementsRenderer = (props) => {
12688
12709
  primitives: primitivesWithoutInteractionMetadata,
12689
12710
  selectedLayer,
12690
12711
  onMouseHoverOverPrimitives: onMouseOverPrimitives,
12691
- children: /* @__PURE__ */ jsx23(
12712
+ children: /* @__PURE__ */ jsx24(
12692
12713
  EditPlacementOverlay,
12693
12714
  {
12694
12715
  disabled: !props.allowEditing,
@@ -12697,7 +12718,7 @@ var CanvasElementsRenderer = (props) => {
12697
12718
  cancelPanDrag: props.cancelPanDrag,
12698
12719
  onCreateEditEvent: props.onCreateEditEvent,
12699
12720
  onModifyEditEvent: props.onModifyEditEvent,
12700
- children: /* @__PURE__ */ jsx23(
12721
+ children: /* @__PURE__ */ jsx24(
12701
12722
  DimensionOverlay,
12702
12723
  {
12703
12724
  transform,
@@ -12705,23 +12726,23 @@ var CanvasElementsRenderer = (props) => {
12705
12726
  primitives: primitivesWithoutInteractionMetadata,
12706
12727
  onBoundsSelected: props.onBoundsSelected,
12707
12728
  cancelPanDrag: props.cancelPanDrag,
12708
- children: /* @__PURE__ */ jsx23(ToolbarOverlay, { elements, children: /* @__PURE__ */ jsx23(ErrorOverlay, { transform, elements, children: /* @__PURE__ */ jsx23(RatsNestOverlay, { transform, soup: elements, children: /* @__PURE__ */ jsx23(
12729
+ children: /* @__PURE__ */ jsx24(ToolbarOverlay, { elements, children: /* @__PURE__ */ jsx24(ErrorOverlay, { transform, elements, children: /* @__PURE__ */ jsx24(RatsNestOverlay, { transform, soup: elements, children: /* @__PURE__ */ jsx24(
12709
12730
  PcbGroupOverlay,
12710
12731
  {
12711
12732
  transform,
12712
12733
  elements,
12713
12734
  hoveredComponentIds,
12714
- children: /* @__PURE__ */ jsx23(
12735
+ children: /* @__PURE__ */ jsx24(
12715
12736
  DebugGraphicsOverlay,
12716
12737
  {
12717
12738
  transform,
12718
12739
  debugGraphics: props.debugGraphics,
12719
- children: /* @__PURE__ */ jsx23(
12740
+ children: /* @__PURE__ */ jsx24(
12720
12741
  WarningGraphicsOverlay,
12721
12742
  {
12722
12743
  transform,
12723
12744
  elements,
12724
- children: /* @__PURE__ */ jsx23(
12745
+ children: /* @__PURE__ */ jsx24(
12725
12746
  CanvasPrimitiveRenderer,
12726
12747
  {
12727
12748
  transform,
@@ -12776,6 +12797,16 @@ var calculateCircuitJsonKey = (circuitJson) => {
12776
12797
  if (element.type === "pcb_trace") {
12777
12798
  const routeLength = (element.route ?? []).length;
12778
12799
  signature += `:${routeLength}`;
12800
+ for (const point of element.route ?? []) {
12801
+ if (point.route_type !== "via") continue;
12802
+ signature += `:${point.tented_on_top}:${point.tented_on_bottom}`;
12803
+ }
12804
+ }
12805
+ if (element.type === "pcb_board") {
12806
+ signature += `:${element.default_via_tented_on_top}:${element.default_via_tented_on_bottom}`;
12807
+ }
12808
+ if (element.type === "pcb_via") {
12809
+ signature += `:${element.tented_on_top}:${element.tented_on_bottom}`;
12779
12810
  }
12780
12811
  elementSignatures.push(signature);
12781
12812
  }
@@ -12801,7 +12832,7 @@ var calculateBoardSizeKey = (circuitJson) => {
12801
12832
  };
12802
12833
 
12803
12834
  // src/PCBViewer.tsx
12804
- import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
12835
+ import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
12805
12836
  var defaultTransform = compose8(translate12(400, 300), scale6(40, -40));
12806
12837
  var PCBViewer = ({
12807
12838
  circuitJson,
@@ -12843,7 +12874,7 @@ var PCBViewer = ({
12843
12874
  editEvents = editEventsProp ?? editEvents;
12844
12875
  const initialRenderCompleted = useRef16(false);
12845
12876
  const touchStartRef = useRef16(null);
12846
- const circuitJsonKey = useMemo9(
12877
+ const circuitJsonKey = useMemo10(
12847
12878
  () => calculateCircuitJsonKey(circuitJson),
12848
12879
  [circuitJson]
12849
12880
  );
@@ -12882,12 +12913,12 @@ var PCBViewer = ({
12882
12913
  resetTransform();
12883
12914
  }
12884
12915
  }, [boardSizeKey]);
12885
- const pcbElmsPreEdit = useMemo9(() => {
12916
+ const pcbElmsPreEdit = useMemo10(() => {
12886
12917
  return circuitJson?.filter(
12887
12918
  (e) => e.type.startsWith("pcb_") || e.type.startsWith("source_")
12888
12919
  ) ?? [];
12889
12920
  }, [circuitJsonKey]);
12890
- const elements = useMemo9(() => {
12921
+ const elements = useMemo10(() => {
12891
12922
  return applyEditEvents({
12892
12923
  circuitJson: pcbElmsPreEdit,
12893
12924
  editEvents
@@ -12904,27 +12935,27 @@ var PCBViewer = ({
12904
12935
  setEditEvents(newEditEvents);
12905
12936
  onEditEventsChanged?.(newEditEvents);
12906
12937
  };
12907
- const mergedInitialState = useMemo9(
12938
+ const mergedInitialState = useMemo10(
12908
12939
  () => ({
12909
12940
  ...initialState,
12910
12941
  ...disablePcbGroups && { is_showing_pcb_groups: false }
12911
12942
  }),
12912
12943
  [initialState, disablePcbGroups]
12913
12944
  );
12914
- return /* @__PURE__ */ jsxs17(
12945
+ return /* @__PURE__ */ jsxs18(
12915
12946
  "div",
12916
12947
  {
12917
12948
  ref: transformRef,
12918
12949
  style: { position: "relative" },
12919
12950
  onContextMenu: (event) => event.preventDefault(),
12920
12951
  children: [
12921
- /* @__PURE__ */ jsx24("div", { ref, children: /* @__PURE__ */ jsxs17(
12952
+ /* @__PURE__ */ jsx25("div", { ref, children: /* @__PURE__ */ jsxs18(
12922
12953
  ContextProviders,
12923
12954
  {
12924
12955
  initialState: mergedInitialState,
12925
12956
  disablePcbGroups,
12926
12957
  children: [
12927
- /* @__PURE__ */ jsx24(
12958
+ /* @__PURE__ */ jsx25(
12928
12959
  CanvasElementsRenderer,
12929
12960
  {
12930
12961
  transform,
@@ -12951,11 +12982,11 @@ var PCBViewer = ({
12951
12982
  },
12952
12983
  refDimensions.width
12953
12984
  ),
12954
- /* @__PURE__ */ jsx24(ToastContainer, {})
12985
+ /* @__PURE__ */ jsx25(ToastContainer, {})
12955
12986
  ]
12956
12987
  }
12957
12988
  ) }),
12958
- clickToInteractEnabled && !isInteractionEnabled && /* @__PURE__ */ jsx24(
12989
+ clickToInteractEnabled && !isInteractionEnabled && /* @__PURE__ */ jsx25(
12959
12990
  "div",
12960
12991
  {
12961
12992
  onClick: () => {
@@ -12992,7 +13023,7 @@ var PCBViewer = ({
12992
13023
  justifyContent: "center",
12993
13024
  touchAction: "pan-x pan-y pinch-zoom"
12994
13025
  },
12995
- children: /* @__PURE__ */ jsx24(
13026
+ children: /* @__PURE__ */ jsx25(
12996
13027
  "div",
12997
13028
  {
12998
13029
  style: {