easyeda 0.0.127 → 0.0.128

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.
@@ -16,19 +16,24 @@ __export(dist_exports, {
16
16
  capacitance: () => capacitance,
17
17
  current: () => current,
18
18
  distance: () => distance,
19
+ frequency: () => frequency,
19
20
  getZodPrefixedIdWithDefault: () => getZodPrefixedIdWithDefault,
20
21
  inductance: () => inductance,
21
22
  layer_ref: () => layer_ref,
22
23
  layer_string: () => layer_string,
23
24
  length: () => length,
25
+ pcb_autorouting_error: () => pcb_autorouting_error,
24
26
  pcb_board: () => pcb_board,
25
27
  pcb_component: () => pcb_component,
26
28
  pcb_fabrication_note_path: () => pcb_fabrication_note_path,
27
29
  pcb_fabrication_note_text: () => pcb_fabrication_note_text,
30
+ pcb_group: () => pcb_group,
28
31
  pcb_hole: () => pcb_hole,
29
32
  pcb_hole_circle_or_square_shape: () => pcb_hole_circle_or_square_shape,
30
33
  pcb_hole_oval_shape: () => pcb_hole_oval_shape,
31
34
  pcb_keepout: () => pcb_keepout,
35
+ pcb_manual_edit_conflict_error: () => pcb_manual_edit_conflict_error,
36
+ pcb_missing_footprint_error: () => pcb_missing_footprint_error,
32
37
  pcb_placement_error: () => pcb_placement_error,
33
38
  pcb_plated_hole: () => pcb_plated_hole,
34
39
  pcb_port: () => pcb_port,
@@ -42,6 +47,7 @@ __export(dist_exports, {
42
47
  pcb_silkscreen_rect: () => pcb_silkscreen_rect,
43
48
  pcb_silkscreen_text: () => pcb_silkscreen_text,
44
49
  pcb_smtpad: () => pcb_smtpad,
50
+ pcb_smtpad_pill: () => pcb_smtpad_pill,
45
51
  pcb_solder_paste: () => pcb_solder_paste,
46
52
  pcb_text: () => pcb_text,
47
53
  pcb_trace: () => pcb_trace,
@@ -53,6 +59,7 @@ __export(dist_exports, {
53
59
  pcb_via: () => pcb_via,
54
60
  point: () => point,
55
61
  point3: () => point3,
62
+ port_arrangement: () => port_arrangement,
56
63
  position: () => position,
57
64
  position3: () => position3,
58
65
  resistance: () => resistance,
@@ -60,6 +67,8 @@ __export(dist_exports, {
60
67
  route_hint_point: () => route_hint_point,
61
68
  schematic_box: () => schematic_box,
62
69
  schematic_component: () => schematic_component,
70
+ schematic_component_port_arrangement_by_sides: () => schematic_component_port_arrangement_by_sides,
71
+ schematic_component_port_arrangement_by_size: () => schematic_component_port_arrangement_by_size,
63
72
  schematic_debug_line: () => schematic_debug_line,
64
73
  schematic_debug_object: () => schematic_debug_object,
65
74
  schematic_debug_object_base: () => schematic_debug_object_base,
@@ -73,21 +82,31 @@ __export(dist_exports, {
73
82
  schematic_port: () => schematic_port,
74
83
  schematic_text: () => schematic_text,
75
84
  schematic_trace: () => schematic_trace,
85
+ schematic_voltage_probe: () => schematic_voltage_probe,
76
86
  size: () => size,
77
87
  source_component_base: () => source_component_base,
78
88
  source_group: () => source_group,
79
89
  source_led: () => source_led,
80
90
  source_net: () => source_net,
81
91
  source_port: () => source_port,
92
+ source_project_metadata: () => source_project_metadata,
82
93
  source_simple_battery: () => source_simple_battery,
83
94
  source_simple_bug: () => source_simple_bug,
84
95
  source_simple_capacitor: () => source_simple_capacitor,
85
96
  source_simple_chip: () => source_simple_chip,
97
+ source_simple_crystal: () => source_simple_crystal,
86
98
  source_simple_diode: () => source_simple_diode,
87
99
  source_simple_ground: () => source_simple_ground,
88
100
  source_simple_inductor: () => source_simple_inductor,
101
+ source_simple_mosfet: () => source_simple_mosfet,
102
+ source_simple_pin_header: () => source_simple_pin_header,
103
+ source_simple_potentiometer: () => source_simple_potentiometer,
89
104
  source_simple_power_source: () => source_simple_power_source,
105
+ source_simple_push_button: () => source_simple_push_button,
90
106
  source_simple_resistor: () => source_simple_resistor,
107
+ source_simple_resonator: () => source_simple_resonator,
108
+ source_simple_switch: () => source_simple_switch,
109
+ source_simple_transistor: () => source_simple_transistor,
91
110
  source_trace: () => source_trace,
92
111
  supplier_name: () => supplier_name,
93
112
  time: () => time,
@@ -141,9 +160,10 @@ import { z as z12 } from "zod";
141
160
  import { z as z13 } from "zod";
142
161
  import { z as z14 } from "zod";
143
162
  import { z as z15 } from "zod";
163
+ import { z as z27 } from "zod";
144
164
  import { z as z16 } from "zod";
145
- import { z as z18 } from "zod";
146
165
  import { z as z17 } from "zod";
166
+ import { z as z18 } from "zod";
147
167
  import { z as z19 } from "zod";
148
168
  import { z as z20 } from "zod";
149
169
  import { z as z21 } from "zod";
@@ -152,7 +172,6 @@ import { z as z23 } from "zod";
152
172
  import { z as z24 } from "zod";
153
173
  import { z as z25 } from "zod";
154
174
  import { z as z26 } from "zod";
155
- import { z as z27 } from "zod";
156
175
  import { z as z28 } from "zod";
157
176
  import { z as z29 } from "zod";
158
177
  import { z as z30 } from "zod";
@@ -186,6 +205,20 @@ import { z as z57 } from "zod";
186
205
  import { z as z58 } from "zod";
187
206
  import { z as z59 } from "zod";
188
207
  import { z as z60 } from "zod";
208
+ import { z as z61 } from "zod";
209
+ import { z as z62 } from "zod";
210
+ import { z as z63 } from "zod";
211
+ import { z as z64 } from "zod";
212
+ import { z as z65 } from "zod";
213
+ import { z as z66 } from "zod";
214
+ import { z as z67 } from "zod";
215
+ import { z as z68 } from "zod";
216
+ import { z as z69 } from "zod";
217
+ import { z as z70 } from "zod";
218
+ import { z as z71 } from "zod";
219
+ import { z as z72 } from "zod";
220
+ import { z as z73 } from "zod";
221
+ import { z as z74 } from "zod";
189
222
  var unitMappings = {
190
223
  Hz: {
191
224
  baseUnit: "Hz",
@@ -208,6 +241,8 @@ var unitMappings = {
208
241
  m\u03A9: 1e-3,
209
242
  \u03A9: 1,
210
243
  k\u03A9: 1e3,
244
+ K\u03A9: 1e3,
245
+ kohm: 1e3,
211
246
  M\u03A9: 1e6,
212
247
  G\u03A9: 1e9,
213
248
  T\u03A9: 1e12
@@ -219,6 +254,7 @@ var unitMappings = {
219
254
  mV: 1e-3,
220
255
  V: 1,
221
256
  kV: 1e3,
257
+ KV: 1e3,
222
258
  MV: 1e6,
223
259
  GV: 1e9,
224
260
  TV: 1e12
@@ -241,6 +277,7 @@ var unitMappings = {
241
277
  pF: 1e-12,
242
278
  nF: 1e-9,
243
279
  \u00B5F: 1e-6,
280
+ uF: 1e-6,
244
281
  mF: 1e-3,
245
282
  F: 1
246
283
  }
@@ -287,6 +324,13 @@ var unitMappings = {
287
324
  }
288
325
  }
289
326
  };
327
+ var unitMappingAndVariantSuffixes = /* @__PURE__ */ new Set();
328
+ for (const [baseUnit, info] of Object.entries(unitMappings)) {
329
+ unitMappingAndVariantSuffixes.add(baseUnit);
330
+ for (const variant of Object.keys(info.variants)) {
331
+ unitMappingAndVariantSuffixes.add(variant);
332
+ }
333
+ }
290
334
  function getBaseTscircuitUnit(unit) {
291
335
  for (const [baseUnit, info] of Object.entries(unitMappings)) {
292
336
  if (unit in info.variants) {
@@ -301,10 +345,33 @@ function getBaseTscircuitUnit(unit) {
301
345
  conversionFactor: 1
302
346
  };
303
347
  }
348
+ var si_prefix_multiplier = {
349
+ tera: 1e12,
350
+ T: 1e12,
351
+ giga: 1e9,
352
+ G: 1e9,
353
+ mega: 1e6,
354
+ M: 1e6,
355
+ kilo: 1e3,
356
+ k: 1e3,
357
+ deci: 0.1,
358
+ d: 0.1,
359
+ centi: 0.01,
360
+ c: 0.01,
361
+ milli: 1e-3,
362
+ m: 1e-3,
363
+ micro: 1e-6,
364
+ u: 1e-6,
365
+ \u00B5: 1e-6,
366
+ nano: 1e-9,
367
+ n: 1e-9,
368
+ pico: 1e-12,
369
+ p: 1e-12
370
+ };
304
371
  var parseAndConvertSiUnit = (v) => {
305
372
  if (typeof v === "undefined")
306
373
  return { parsedUnit: null, unitOfValue: null, value: null };
307
- if (typeof v === "string" && v.match(/^[\d\.]+$/))
374
+ if (typeof v === "string" && v.match(/^-?[\d\.]+$/))
308
375
  return {
309
376
  value: Number.parseFloat(v),
310
377
  parsedUnit: null,
@@ -323,24 +390,36 @@ var parseAndConvertSiUnit = (v) => {
323
390
  }
324
391
  };
325
392
  }
326
- const unit_reversed = v.split("").reverse().join("").match(/[a-zA-Z]+/)?.[0];
393
+ const reversed_input_string = v.toString().split("").reverse().join("");
394
+ const unit_reversed = reversed_input_string.match(/[^\d\s]+/)?.[0];
327
395
  if (!unit_reversed) {
328
396
  throw new Error(`Could not determine unit: "${v}"`);
329
397
  }
330
398
  const unit = unit_reversed.split("").reverse().join("");
331
- const value = v.slice(0, -unit.length);
399
+ const numberPart = v.slice(0, -unit.length);
400
+ if (unit in si_prefix_multiplier && !unitMappingAndVariantSuffixes.has(unit)) {
401
+ const siMultiplier = si_prefix_multiplier[unit];
402
+ return {
403
+ parsedUnit: null,
404
+ unitOfValue: null,
405
+ value: Number.parseFloat(numberPart) * siMultiplier
406
+ };
407
+ }
332
408
  const { baseUnit, conversionFactor } = getBaseTscircuitUnit(unit);
333
409
  return {
334
410
  parsedUnit: unit,
335
411
  unitOfValue: baseUnit,
336
- value: conversionFactor * Number.parseFloat(value)
412
+ value: conversionFactor * Number.parseFloat(numberPart)
337
413
  };
338
414
  };
339
415
  var resistance = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
340
- var capacitance = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
416
+ var capacitance = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value).transform((value) => {
417
+ return Number.parseFloat(value.toPrecision(12));
418
+ });
341
419
  var inductance = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
342
420
  var voltage = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
343
421
  var length = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
422
+ var frequency = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
344
423
  var distance = length;
345
424
  var current = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
346
425
  var time = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v).value);
@@ -391,6 +470,12 @@ var supplier_name = z6.enum([
391
470
  "mouser",
392
471
  "lcsc"
393
472
  ]);
473
+ var expectTypesMatch = (shouldBe) => {
474
+ };
475
+ expectTypesMatch("extra props b");
476
+ expectTypesMatch("missing props b");
477
+ expectTypesMatch(true);
478
+ expectTypesMatch("mismatched prop types: a");
394
479
  var source_component_base = z7.object({
395
480
  type: z7.literal("source_component"),
396
481
  ftype: z7.string().optional(),
@@ -400,42 +485,104 @@ var source_component_base = z7.object({
400
485
  supplier_part_numbers: z7.record(supplier_name, z7.array(z7.string())).optional(),
401
486
  display_value: z7.string().optional()
402
487
  });
488
+ expectTypesMatch(true);
403
489
  var source_simple_capacitor = source_component_base.extend({
404
490
  ftype: z8.literal("simple_capacitor"),
405
- capacitance
491
+ capacitance,
492
+ max_voltage_rating: voltage.optional(),
493
+ display_capacitance: z8.string().optional(),
494
+ max_decoupling_trace_length: distance.optional()
406
495
  });
496
+ expectTypesMatch(true);
407
497
  var source_simple_resistor = source_component_base.extend({
408
498
  ftype: z9.literal("simple_resistor"),
409
- resistance
499
+ resistance,
500
+ display_resistance: z9.string().optional()
410
501
  });
502
+ expectTypesMatch(true);
411
503
  var source_simple_diode = source_component_base.extend({
412
504
  ftype: z10.literal("simple_diode")
413
505
  });
506
+ expectTypesMatch(true);
414
507
  var source_simple_ground = source_component_base.extend({
415
508
  ftype: z11.literal("simple_ground")
416
509
  });
510
+ expectTypesMatch(true);
417
511
  var source_simple_bug = source_component_base.extend({
418
512
  ftype: z12.literal("simple_bug")
419
513
  }).describe("@deprecated");
420
514
  var source_simple_chip = source_component_base.extend({
421
515
  ftype: z13.literal("simple_chip")
422
516
  });
423
- var source_simple_inductor = source_component_base.extend({
424
- ftype: z14.literal("simple_inductor"),
425
- inductance
426
- });
517
+ expectTypesMatch(true);
427
518
  var source_led = source_simple_diode.extend({
428
- ftype: z15.literal("led")
519
+ ftype: z14.literal("led")
429
520
  });
521
+ expectTypesMatch(true);
430
522
  var source_simple_power_source = source_component_base.extend({
431
- ftype: z16.literal("simple_power_source"),
523
+ ftype: z15.literal("simple_power_source"),
432
524
  voltage
433
525
  });
526
+ expectTypesMatch(true);
434
527
  var source_simple_battery = source_component_base.extend({
435
- ftype: z17.literal("simple_battery"),
528
+ ftype: z16.literal("simple_battery"),
436
529
  capacity: battery_capacity
437
530
  });
438
- var any_source_component = z18.union([
531
+ expectTypesMatch(true);
532
+ var source_simple_inductor = source_component_base.extend({
533
+ ftype: z17.literal("simple_inductor"),
534
+ inductance
535
+ });
536
+ expectTypesMatch(true);
537
+ var source_simple_push_button = source_component_base.extend({
538
+ ftype: z18.literal("simple_push_button")
539
+ });
540
+ expectTypesMatch(true);
541
+ var source_simple_potentiometer = source_component_base.extend({
542
+ ftype: z19.literal("simple_potentiometer"),
543
+ max_resistance: resistance
544
+ });
545
+ var source_simple_crystal = source_component_base.extend({
546
+ ftype: z20.literal("simple_crystal"),
547
+ frequency: z20.number().describe("Frequency in Hz"),
548
+ load_capacitance: z20.number().optional().describe("Load capacitance in pF")
549
+ });
550
+ expectTypesMatch(true);
551
+ var source_simple_pin_header = source_component_base.extend({
552
+ ftype: z21.literal("simple_pin_header"),
553
+ pin_count: z21.number(),
554
+ gender: z21.enum(["male", "female"]).optional().default("male")
555
+ });
556
+ var source_simple_resonator = source_component_base.extend({
557
+ ftype: z22.literal("simple_resonator"),
558
+ load_capacitance: capacitance,
559
+ equivalent_series_resistance: resistance.optional(),
560
+ frequency
561
+ });
562
+ expectTypesMatch(true);
563
+ var source_simple_transistor = source_component_base.extend({
564
+ ftype: z23.literal("simple_transistor"),
565
+ transistor_type: z23.enum(["npn", "pnp"])
566
+ });
567
+ expectTypesMatch(true);
568
+ var source_simple_mosfet = source_component_base.extend({
569
+ ftype: z24.literal("simple_mosfet"),
570
+ channel_type: z24.enum(["n", "p"]),
571
+ mosfet_mode: z24.enum(["enhancement", "depletion"])
572
+ });
573
+ expectTypesMatch(true);
574
+ var source_simple_switch = source_component_base.extend({
575
+ ftype: z25.literal("simple_switch")
576
+ });
577
+ expectTypesMatch(true);
578
+ var source_project_metadata = z26.object({
579
+ type: z26.literal("source_project_metadata"),
580
+ name: z26.string().optional(),
581
+ software_used_string: z26.string().optional(),
582
+ created_at: z26.string().datetime().optional()
583
+ });
584
+ expectTypesMatch(true);
585
+ var any_source_component = z27.union([
439
586
  source_simple_resistor,
440
587
  source_simple_capacitor,
441
588
  source_simple_diode,
@@ -445,189 +592,246 @@ var any_source_component = z18.union([
445
592
  source_led,
446
593
  source_simple_power_source,
447
594
  source_simple_battery,
448
- source_simple_inductor
595
+ source_simple_inductor,
596
+ source_simple_push_button,
597
+ source_simple_potentiometer,
598
+ source_simple_crystal,
599
+ source_simple_pin_header,
600
+ source_simple_resonator,
601
+ source_simple_switch,
602
+ source_simple_transistor,
603
+ source_simple_mosfet,
604
+ source_project_metadata
449
605
  ]);
450
- var source_port = z19.object({
451
- type: z19.literal("source_port"),
452
- pin_number: z19.number().optional(),
453
- port_hints: z19.array(z19.string()).optional(),
454
- name: z19.string(),
455
- source_port_id: z19.string(),
456
- source_component_id: z19.string()
457
- });
458
- var source_trace = z20.object({
459
- type: z20.literal("source_trace"),
460
- source_trace_id: z20.string(),
461
- connected_source_port_ids: z20.array(z20.string()),
462
- connected_source_net_ids: z20.array(z20.string())
463
- });
464
- var source_group = z21.object({
465
- type: z21.literal("source_group"),
466
- source_group_id: z21.string(),
467
- name: z21.string().optional()
468
- });
469
- var source_net = z22.object({
470
- type: z22.literal("source_net"),
471
- source_net_id: z22.string(),
472
- name: z22.string(),
473
- member_source_group_ids: z22.array(z22.string()),
474
- is_power: z22.boolean().optional(),
475
- is_ground: z22.boolean().optional(),
476
- is_digital_signal: z22.boolean().optional(),
477
- is_analog_signal: z22.boolean().optional(),
478
- trace_width: z22.number().optional()
479
- });
480
- var schematic_box = z23.object({
481
- type: z23.literal("schematic_box"),
482
- schematic_component_id: z23.string(),
606
+ var source_port = z28.object({
607
+ type: z28.literal("source_port"),
608
+ pin_number: z28.number().optional(),
609
+ port_hints: z28.array(z28.string()).optional(),
610
+ name: z28.string(),
611
+ source_port_id: z28.string(),
612
+ source_component_id: z28.string(),
613
+ subcircuit_id: z28.string().optional()
614
+ });
615
+ expectTypesMatch(true);
616
+ var source_trace = z29.object({
617
+ type: z29.literal("source_trace"),
618
+ source_trace_id: z29.string(),
619
+ connected_source_port_ids: z29.array(z29.string()),
620
+ connected_source_net_ids: z29.array(z29.string()),
621
+ subcircuit_id: z29.string().optional(),
622
+ subcircuit_connectivity_map_key: z29.string().optional(),
623
+ max_length: z29.number().optional(),
624
+ min_trace_thickness: z29.number().optional(),
625
+ display_name: z29.string().optional()
626
+ });
627
+ expectTypesMatch(true);
628
+ var source_group = z30.object({
629
+ type: z30.literal("source_group"),
630
+ source_group_id: z30.string(),
631
+ subcircuit_id: z30.string().optional(),
632
+ parent_subcircuit_id: z30.string().optional(),
633
+ is_subcircuit: z30.boolean().optional(),
634
+ name: z30.string().optional()
635
+ });
636
+ var source_net = z31.object({
637
+ type: z31.literal("source_net"),
638
+ source_net_id: z31.string(),
639
+ name: z31.string(),
640
+ member_source_group_ids: z31.array(z31.string()),
641
+ is_power: z31.boolean().optional(),
642
+ is_ground: z31.boolean().optional(),
643
+ is_digital_signal: z31.boolean().optional(),
644
+ is_analog_signal: z31.boolean().optional(),
645
+ trace_width: z31.number().optional(),
646
+ subcircuit_id: z31.string().optional()
647
+ });
648
+ var schematic_box = z32.object({
649
+ type: z32.literal("schematic_box"),
650
+ schematic_component_id: z32.string(),
483
651
  width: distance,
484
652
  height: distance,
485
653
  x: distance,
486
654
  y: distance
487
655
  }).describe("Draws a box on the schematic");
488
- var schematic_path = z24.object({
489
- type: z24.literal("schematic_path"),
490
- schematic_component_id: z24.string(),
491
- fill_color: z24.enum(["red", "blue"]).optional(),
492
- is_filled: z24.boolean().optional(),
493
- points: z24.array(point)
494
- });
495
- var schematic_pin_styles = z25.record(
496
- z25.object({
656
+ expectTypesMatch(true);
657
+ var schematic_path = z33.object({
658
+ type: z33.literal("schematic_path"),
659
+ schematic_component_id: z33.string(),
660
+ fill_color: z33.enum(["red", "blue"]).optional(),
661
+ is_filled: z33.boolean().optional(),
662
+ points: z33.array(point)
663
+ });
664
+ expectTypesMatch(true);
665
+ var schematic_pin_styles = z34.record(
666
+ z34.object({
497
667
  left_margin: length.optional(),
498
668
  right_margin: length.optional(),
499
669
  top_margin: length.optional(),
500
670
  bottom_margin: length.optional()
501
671
  })
502
672
  );
503
- var schematic_component = z25.object({
504
- type: z25.literal("schematic_component"),
505
- rotation: rotation.default(0),
673
+ var schematic_component_port_arrangement_by_size = z34.object({
674
+ left_size: z34.number(),
675
+ right_size: z34.number(),
676
+ top_size: z34.number().optional(),
677
+ bottom_size: z34.number().optional()
678
+ });
679
+ expectTypesMatch(true);
680
+ var schematic_component_port_arrangement_by_sides = z34.object({
681
+ left_side: z34.object({
682
+ pins: z34.array(z34.number()),
683
+ // @ts-ignore
684
+ direction: z34.enum(["top-to-bottom", "bottom-to-top"]).optional()
685
+ }).optional(),
686
+ right_side: z34.object({
687
+ pins: z34.array(z34.number()),
688
+ // @ts-ignore
689
+ direction: z34.enum(["top-to-bottom", "bottom-to-top"]).optional()
690
+ }).optional(),
691
+ top_side: z34.object({
692
+ pins: z34.array(z34.number()),
693
+ // @ts-ignore
694
+ direction: z34.enum(["left-to-right", "right-to-left"]).optional()
695
+ }).optional(),
696
+ bottom_side: z34.object({
697
+ pins: z34.array(z34.number()),
698
+ // @ts-ignore
699
+ direction: z34.enum(["left-to-right", "right-to-left"]).optional()
700
+ }).optional()
701
+ });
702
+ expectTypesMatch(true);
703
+ var port_arrangement = z34.union([
704
+ schematic_component_port_arrangement_by_size,
705
+ schematic_component_port_arrangement_by_sides
706
+ ]);
707
+ var schematic_component = z34.object({
708
+ type: z34.literal("schematic_component"),
506
709
  size,
507
710
  center: point,
508
- source_component_id: z25.string(),
509
- schematic_component_id: z25.string(),
711
+ source_component_id: z34.string(),
712
+ schematic_component_id: z34.string(),
510
713
  pin_spacing: length.optional(),
511
714
  pin_styles: schematic_pin_styles.optional(),
512
715
  box_width: length.optional(),
513
- symbol_name: z25.string().optional(),
514
- port_arrangement: z25.union([
515
- z25.object({
516
- left_size: z25.number(),
517
- right_size: z25.number(),
518
- top_size: z25.number().optional(),
519
- bottom_size: z25.number().optional()
520
- }),
521
- z25.object({
522
- left_side: z25.object({
523
- pins: z25.array(z25.number()),
524
- direction: z25.enum(["top-to-bottom", "bottom-to-top"]).optional()
525
- }).optional(),
526
- right_side: z25.object({
527
- pins: z25.array(z25.number()),
528
- direction: z25.enum(["top-to-bottom", "bottom-to-top"]).optional()
529
- }).optional(),
530
- top_side: z25.object({
531
- pins: z25.array(z25.number()),
532
- direction: z25.enum(["left-to-right", "right-to-left"]).optional()
533
- }).optional(),
534
- bottom_side: z25.object({
535
- pins: z25.array(z25.number()),
536
- direction: z25.enum(["left-to-right", "right-to-left"]).optional()
537
- }).optional()
538
- })
539
- ]).optional(),
540
- port_labels: z25.record(z25.string()).optional()
716
+ symbol_name: z34.string().optional(),
717
+ port_arrangement: port_arrangement.optional(),
718
+ port_labels: z34.record(z34.string()).optional(),
719
+ symbol_display_value: z34.string().optional()
541
720
  });
542
- var schematic_line = z26.object({
543
- type: z26.literal("schematic_line"),
544
- schematic_component_id: z26.string(),
721
+ expectTypesMatch(true);
722
+ var schematic_line = z35.object({
723
+ type: z35.literal("schematic_line"),
724
+ schematic_component_id: z35.string(),
545
725
  x1: distance,
546
726
  x2: distance,
547
727
  y1: distance,
548
728
  y2: distance
549
729
  });
550
- var schematic_trace = z27.object({
551
- type: z27.literal("schematic_trace"),
552
- schematic_trace_id: z27.string(),
553
- source_trace_id: z27.string(),
554
- edges: z27.array(
555
- z27.object({
556
- from: z27.object({
557
- x: z27.number(),
558
- y: z27.number()
730
+ expectTypesMatch(true);
731
+ var schematic_trace = z36.object({
732
+ type: z36.literal("schematic_trace"),
733
+ schematic_trace_id: z36.string(),
734
+ source_trace_id: z36.string(),
735
+ junctions: z36.array(
736
+ z36.object({
737
+ x: z36.number(),
738
+ y: z36.number()
739
+ })
740
+ ),
741
+ edges: z36.array(
742
+ z36.object({
743
+ from: z36.object({
744
+ x: z36.number(),
745
+ y: z36.number()
559
746
  }),
560
- to: z27.object({
561
- x: z27.number(),
562
- y: z27.number()
747
+ to: z36.object({
748
+ x: z36.number(),
749
+ y: z36.number()
563
750
  }),
564
- from_schematic_port_id: z27.string().optional(),
565
- to_schematic_port_id: z27.string().optional()
751
+ is_crossing: z36.boolean().optional(),
752
+ from_schematic_port_id: z36.string().optional(),
753
+ to_schematic_port_id: z36.string().optional()
566
754
  })
567
755
  )
568
756
  });
569
- var schematic_text = z28.object({
570
- type: z28.literal("schematic_text"),
571
- schematic_component_id: z28.string(),
572
- schematic_text_id: z28.string(),
573
- text: z28.string(),
574
- position: z28.object({
757
+ expectTypesMatch(true);
758
+ var schematic_text = z37.object({
759
+ type: z37.literal("schematic_text"),
760
+ schematic_component_id: z37.string(),
761
+ schematic_text_id: z37.string(),
762
+ text: z37.string(),
763
+ position: z37.object({
575
764
  x: distance,
576
765
  y: distance
577
766
  }),
578
- rotation: z28.number().default(0),
579
- anchor: z28.enum(["center", "left", "right", "top", "bottom"]).default("center"),
580
- color: z28.string().default("#000000")
581
- });
582
- var schematic_port = z29.object({
583
- type: z29.literal("schematic_port"),
584
- schematic_port_id: z29.string(),
585
- source_port_id: z29.string(),
586
- schematic_component_id: z29.string().optional(),
767
+ rotation: z37.number().default(0),
768
+ anchor: z37.enum(["center", "left", "right", "top", "bottom"]).default("center"),
769
+ color: z37.string().default("#000000")
770
+ });
771
+ expectTypesMatch(true);
772
+ var schematic_port = z38.object({
773
+ type: z38.literal("schematic_port"),
774
+ schematic_port_id: z38.string(),
775
+ source_port_id: z38.string(),
776
+ schematic_component_id: z38.string().optional(),
587
777
  center: point,
588
- facing_direction: z29.enum(["up", "down", "left", "right"]).optional(),
589
- distance_from_component_edge: z29.number().optional(),
590
- side_of_component: z29.enum(["top", "bottom", "left", "right"]).optional(),
591
- true_ccw_index: z29.number().optional(),
592
- pin_number: z29.number().optional()
778
+ facing_direction: z38.enum(["up", "down", "left", "right"]).optional(),
779
+ distance_from_component_edge: z38.number().optional(),
780
+ side_of_component: z38.enum(["top", "bottom", "left", "right"]).optional(),
781
+ true_ccw_index: z38.number().optional(),
782
+ pin_number: z38.number().optional(),
783
+ display_pin_label: z38.string().optional()
593
784
  }).describe("Defines a port on a schematic component");
594
- var schematic_net_label = z30.object({
595
- type: z30.literal("schematic_net_label"),
596
- source_net_id: z30.string(),
785
+ expectTypesMatch(true);
786
+ var schematic_net_label = z39.object({
787
+ type: z39.literal("schematic_net_label"),
788
+ source_net_id: z39.string(),
597
789
  center: point,
598
- anchor_side: z30.enum(["top", "bottom", "left", "right"]),
599
- text: z30.string()
600
- });
601
- var schematic_error = z31.object({
602
- schematic_error_id: z31.string(),
603
- type: z31.literal("schematic_error"),
790
+ anchor_position: point.optional(),
791
+ anchor_side: z39.enum(["top", "bottom", "left", "right"]),
792
+ text: z39.string(),
793
+ symbol_name: z39.string().optional()
794
+ });
795
+ var schematic_error = z40.object({
796
+ type: z40.literal("schematic_error"),
797
+ schematic_error_id: z40.string(),
604
798
  // eventually each error type should be broken out into a dir of files
605
- error_type: z31.literal("schematic_port_not_found"),
606
- message: z31.string()
799
+ error_type: z40.literal("schematic_port_not_found"),
800
+ message: z40.string()
607
801
  }).describe("Defines a schematic error on the schematic");
608
- var schematic_debug_object_base = z32.object({
609
- type: z32.literal("schematic_debug_object"),
610
- label: z32.string().optional()
802
+ expectTypesMatch(true);
803
+ var schematic_debug_object_base = z41.object({
804
+ type: z41.literal("schematic_debug_object"),
805
+ label: z41.string().optional()
611
806
  });
612
807
  var schematic_debug_rect = schematic_debug_object_base.extend({
613
- shape: z32.literal("rect"),
808
+ shape: z41.literal("rect"),
614
809
  center: point,
615
810
  size
616
811
  });
617
812
  var schematic_debug_line = schematic_debug_object_base.extend({
618
- shape: z32.literal("line"),
813
+ shape: z41.literal("line"),
619
814
  start: point,
620
815
  end: point
621
816
  });
622
817
  var schematic_debug_point = schematic_debug_object_base.extend({
623
- shape: z32.literal("point"),
818
+ shape: z41.literal("point"),
624
819
  center: point
625
820
  });
626
- var schematic_debug_object = z32.discriminatedUnion("shape", [
821
+ var schematic_debug_object = z41.discriminatedUnion("shape", [
627
822
  schematic_debug_rect,
628
823
  schematic_debug_line,
629
824
  schematic_debug_point
630
825
  ]);
826
+ expectTypesMatch(true);
827
+ var schematic_voltage_probe = z42.object({
828
+ type: z42.literal("schematic_voltage_probe"),
829
+ schematic_voltage_probe_id: z42.string(),
830
+ position: point,
831
+ schematic_trace_id: z42.string(),
832
+ voltage: voltage.optional()
833
+ }).describe("Defines a voltage probe measurement point on a schematic trace");
834
+ expectTypesMatch(true);
631
835
  var all_layers = [
632
836
  "top",
633
837
  "bottom",
@@ -638,9 +842,9 @@ var all_layers = [
638
842
  "inner5",
639
843
  "inner6"
640
844
  ];
641
- var layer_string = z33.enum(all_layers);
845
+ var layer_string = z43.enum(all_layers);
642
846
  var layer_ref = layer_string.or(
643
- z33.object({
847
+ z43.object({
644
848
  name: layer_string
645
849
  })
646
850
  ).transform((layer) => {
@@ -649,39 +853,40 @@ var layer_ref = layer_string.or(
649
853
  }
650
854
  return layer.name;
651
855
  });
652
- var visible_layer = z33.enum(["top", "bottom"]);
653
- var pcb_route_hint = z34.object({
856
+ var visible_layer = z43.enum(["top", "bottom"]);
857
+ var pcb_route_hint = z44.object({
654
858
  x: distance,
655
859
  y: distance,
656
- via: z34.boolean().optional(),
860
+ via: z44.boolean().optional(),
657
861
  via_to_layer: layer_ref.optional()
658
862
  });
659
- var pcb_route_hints = z34.array(pcb_route_hint);
660
- var route_hint_point = z35.object({
863
+ var pcb_route_hints = z44.array(pcb_route_hint);
864
+ var route_hint_point = z45.object({
661
865
  x: distance,
662
866
  y: distance,
663
- via: z35.boolean().optional(),
867
+ via: z45.boolean().optional(),
664
868
  to_layer: layer_ref.optional(),
665
869
  trace_width: distance.optional()
666
870
  });
667
- var expectTypesMatch = (shouldBe) => {
668
- };
669
- var pcb_component = z36.object({
670
- type: z36.literal("pcb_component"),
871
+ var pcb_component = z46.object({
872
+ type: z46.literal("pcb_component"),
671
873
  pcb_component_id: getZodPrefixedIdWithDefault("pcb_component"),
672
- source_component_id: z36.string(),
874
+ source_component_id: z46.string(),
673
875
  center: point,
674
876
  layer: layer_ref,
675
877
  rotation,
676
878
  width: length,
677
- height: length
879
+ height: length,
880
+ subcircuit_id: z46.string().optional()
678
881
  }).describe("Defines a component on the PCB");
679
882
  expectTypesMatch(true);
680
- var pcb_hole_circle_or_square = z37.object({
681
- type: z37.literal("pcb_hole"),
883
+ var pcb_hole_circle_or_square = z47.object({
884
+ type: z47.literal("pcb_hole"),
682
885
  pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
683
- hole_shape: z37.enum(["circle", "square"]),
684
- hole_diameter: z37.number(),
886
+ pcb_group_id: z47.string().optional(),
887
+ subcircuit_id: z47.string().optional(),
888
+ hole_shape: z47.enum(["circle", "square"]),
889
+ hole_diameter: z47.number(),
685
890
  x: distance,
686
891
  y: distance
687
892
  });
@@ -689,12 +894,14 @@ var pcb_hole_circle_or_square_shape = pcb_hole_circle_or_square.describe(
689
894
  "Defines a circular or square hole on the PCB"
690
895
  );
691
896
  expectTypesMatch(true);
692
- var pcb_hole_oval = z37.object({
693
- type: z37.literal("pcb_hole"),
897
+ var pcb_hole_oval = z47.object({
898
+ type: z47.literal("pcb_hole"),
694
899
  pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
695
- hole_shape: z37.literal("oval"),
696
- hole_width: z37.number(),
697
- hole_height: z37.number(),
900
+ pcb_group_id: z47.string().optional(),
901
+ subcircuit_id: z47.string().optional(),
902
+ hole_shape: z47.literal("oval"),
903
+ hole_width: z47.number(),
904
+ hole_height: z47.number(),
698
905
  x: distance,
699
906
  y: distance
700
907
  });
@@ -703,191 +910,291 @@ var pcb_hole_oval_shape = pcb_hole_oval.describe(
703
910
  );
704
911
  expectTypesMatch(true);
705
912
  var pcb_hole = pcb_hole_circle_or_square.or(pcb_hole_oval);
706
- var pcb_plated_hole_circle = z38.object({
707
- type: z38.literal("pcb_plated_hole"),
708
- shape: z38.literal("circle"),
709
- outer_diameter: z38.number(),
710
- hole_diameter: z38.number(),
913
+ var pcb_plated_hole_circle = z48.object({
914
+ type: z48.literal("pcb_plated_hole"),
915
+ shape: z48.literal("circle"),
916
+ pcb_group_id: z48.string().optional(),
917
+ subcircuit_id: z48.string().optional(),
918
+ outer_diameter: z48.number(),
919
+ hole_diameter: z48.number(),
711
920
  x: distance,
712
921
  y: distance,
713
- layers: z38.array(layer_ref),
714
- port_hints: z38.array(z38.string()).optional(),
715
- pcb_component_id: z38.string().optional(),
716
- pcb_port_id: z38.string().optional(),
922
+ layers: z48.array(layer_ref),
923
+ port_hints: z48.array(z48.string()).optional(),
924
+ pcb_component_id: z48.string().optional(),
925
+ pcb_port_id: z48.string().optional(),
717
926
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
718
927
  });
719
- var pcb_plated_hole_oval = z38.object({
720
- type: z38.literal("pcb_plated_hole"),
721
- shape: z38.enum(["oval", "pill"]),
722
- outer_width: z38.number(),
723
- outer_height: z38.number(),
724
- hole_width: z38.number(),
725
- hole_height: z38.number(),
928
+ var pcb_plated_hole_oval = z48.object({
929
+ type: z48.literal("pcb_plated_hole"),
930
+ shape: z48.enum(["oval", "pill"]),
931
+ pcb_group_id: z48.string().optional(),
932
+ subcircuit_id: z48.string().optional(),
933
+ outer_width: z48.number(),
934
+ outer_height: z48.number(),
935
+ hole_width: z48.number(),
936
+ hole_height: z48.number(),
726
937
  x: distance,
727
938
  y: distance,
728
- layers: z38.array(layer_ref),
729
- port_hints: z38.array(z38.string()).optional(),
730
- pcb_component_id: z38.string().optional(),
731
- pcb_port_id: z38.string().optional(),
939
+ layers: z48.array(layer_ref),
940
+ port_hints: z48.array(z48.string()).optional(),
941
+ pcb_component_id: z48.string().optional(),
942
+ pcb_port_id: z48.string().optional(),
732
943
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
733
944
  });
734
- var pcb_plated_hole = z38.union([
945
+ var pcb_circular_hole_with_rect_pad = z48.object({
946
+ type: z48.literal("pcb_plated_hole"),
947
+ shape: z48.literal("circular_hole_with_rect_pad"),
948
+ pcb_group_id: z48.string().optional(),
949
+ subcircuit_id: z48.string().optional(),
950
+ hole_shape: z48.literal("circle"),
951
+ pad_shape: z48.literal("rect"),
952
+ hole_diameter: z48.number(),
953
+ rect_pad_width: z48.number(),
954
+ rect_pad_height: z48.number(),
955
+ x: distance,
956
+ y: distance,
957
+ layers: z48.array(layer_ref),
958
+ port_hints: z48.array(z48.string()).optional(),
959
+ pcb_component_id: z48.string().optional(),
960
+ pcb_port_id: z48.string().optional(),
961
+ pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
962
+ });
963
+ var pcb_pill_hole_with_rect_pad = z48.object({
964
+ type: z48.literal("pcb_plated_hole"),
965
+ shape: z48.literal("pill_hole_with_rect_pad"),
966
+ pcb_group_id: z48.string().optional(),
967
+ subcircuit_id: z48.string().optional(),
968
+ hole_shape: z48.literal("pill"),
969
+ pad_shape: z48.literal("rect"),
970
+ hole_width: z48.number(),
971
+ hole_height: z48.number(),
972
+ rect_pad_width: z48.number(),
973
+ rect_pad_height: z48.number(),
974
+ x: distance,
975
+ y: distance,
976
+ layers: z48.array(layer_ref),
977
+ port_hints: z48.array(z48.string()).optional(),
978
+ pcb_component_id: z48.string().optional(),
979
+ pcb_port_id: z48.string().optional(),
980
+ pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
981
+ });
982
+ var pcb_plated_hole = z48.union([
735
983
  pcb_plated_hole_circle,
736
- pcb_plated_hole_oval
984
+ pcb_plated_hole_oval,
985
+ pcb_circular_hole_with_rect_pad
737
986
  ]);
738
987
  expectTypesMatch(
739
988
  true
740
989
  );
741
990
  expectTypesMatch(true);
742
- var pcb_port = z39.object({
743
- type: z39.literal("pcb_port"),
991
+ expectTypesMatch(true);
992
+ var pcb_port = z49.object({
993
+ type: z49.literal("pcb_port"),
744
994
  pcb_port_id: getZodPrefixedIdWithDefault("pcb_port"),
745
- source_port_id: z39.string(),
746
- pcb_component_id: z39.string(),
995
+ pcb_group_id: z49.string().optional(),
996
+ subcircuit_id: z49.string().optional(),
997
+ source_port_id: z49.string(),
998
+ pcb_component_id: z49.string(),
747
999
  x: distance,
748
1000
  y: distance,
749
- layers: z39.array(layer_ref)
1001
+ layers: z49.array(layer_ref)
750
1002
  }).describe("Defines a port on the PCB");
751
1003
  expectTypesMatch(true);
752
- var pcb_smtpad_circle = z40.object({
753
- type: z40.literal("pcb_smtpad"),
754
- shape: z40.literal("circle"),
1004
+ var pcb_smtpad_circle = z50.object({
1005
+ type: z50.literal("pcb_smtpad"),
1006
+ shape: z50.literal("circle"),
1007
+ pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
1008
+ pcb_group_id: z50.string().optional(),
1009
+ subcircuit_id: z50.string().optional(),
1010
+ x: distance,
1011
+ y: distance,
1012
+ radius: z50.number(),
1013
+ layer: layer_ref,
1014
+ port_hints: z50.array(z50.string()).optional(),
1015
+ pcb_component_id: z50.string().optional(),
1016
+ pcb_port_id: z50.string().optional()
1017
+ });
1018
+ var pcb_smtpad_rect = z50.object({
1019
+ type: z50.literal("pcb_smtpad"),
1020
+ shape: z50.literal("rect"),
755
1021
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
1022
+ pcb_group_id: z50.string().optional(),
1023
+ subcircuit_id: z50.string().optional(),
756
1024
  x: distance,
757
1025
  y: distance,
758
- radius: z40.number(),
1026
+ width: z50.number(),
1027
+ height: z50.number(),
759
1028
  layer: layer_ref,
760
- port_hints: z40.array(z40.string()).optional(),
761
- pcb_component_id: z40.string().optional(),
762
- pcb_port_id: z40.string().optional()
1029
+ port_hints: z50.array(z50.string()).optional(),
1030
+ pcb_component_id: z50.string().optional(),
1031
+ pcb_port_id: z50.string().optional()
763
1032
  });
764
- var pcb_smtpad_rect = z40.object({
765
- type: z40.literal("pcb_smtpad"),
766
- shape: z40.literal("rect"),
1033
+ var pcb_smtpad_rotated_rect = z50.object({
1034
+ type: z50.literal("pcb_smtpad"),
1035
+ shape: z50.literal("rotated_rect"),
767
1036
  pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
1037
+ pcb_group_id: z50.string().optional(),
1038
+ subcircuit_id: z50.string().optional(),
768
1039
  x: distance,
769
1040
  y: distance,
770
- width: z40.number(),
771
- height: z40.number(),
1041
+ width: z50.number(),
1042
+ height: z50.number(),
1043
+ ccw_rotation: rotation,
772
1044
  layer: layer_ref,
773
- port_hints: z40.array(z40.string()).optional(),
774
- pcb_component_id: z40.string().optional(),
775
- pcb_port_id: z40.string().optional()
1045
+ port_hints: z50.array(z50.string()).optional(),
1046
+ pcb_component_id: z50.string().optional(),
1047
+ pcb_port_id: z50.string().optional()
776
1048
  });
777
- var pcb_smtpad = z40.union([pcb_smtpad_circle, pcb_smtpad_rect]).describe("Defines an SMT pad on the PCB");
1049
+ var pcb_smtpad_pill = z50.object({
1050
+ type: z50.literal("pcb_smtpad"),
1051
+ shape: z50.literal("pill"),
1052
+ pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
1053
+ pcb_group_id: z50.string().optional(),
1054
+ subcircuit_id: z50.string().optional(),
1055
+ x: distance,
1056
+ y: distance,
1057
+ width: z50.number(),
1058
+ height: z50.number(),
1059
+ radius: z50.number(),
1060
+ layer: layer_ref,
1061
+ port_hints: z50.array(z50.string()).optional(),
1062
+ pcb_component_id: z50.string().optional(),
1063
+ pcb_port_id: z50.string().optional()
1064
+ });
1065
+ var pcb_smtpad = z50.union([
1066
+ pcb_smtpad_circle,
1067
+ pcb_smtpad_rect,
1068
+ pcb_smtpad_rotated_rect,
1069
+ pcb_smtpad_pill
1070
+ ]).describe("Defines an SMT pad on the PCB");
778
1071
  expectTypesMatch(true);
779
1072
  expectTypesMatch(true);
780
- var pcb_solder_paste_circle = z41.object({
781
- type: z41.literal("pcb_solder_paste"),
782
- shape: z41.literal("circle"),
1073
+ expectTypesMatch(true);
1074
+ expectTypesMatch(true);
1075
+ var pcb_solder_paste_circle = z51.object({
1076
+ type: z51.literal("pcb_solder_paste"),
1077
+ shape: z51.literal("circle"),
783
1078
  pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
1079
+ pcb_group_id: z51.string().optional(),
1080
+ subcircuit_id: z51.string().optional(),
784
1081
  x: distance,
785
1082
  y: distance,
786
- radius: z41.number(),
1083
+ radius: z51.number(),
787
1084
  layer: layer_ref,
788
- pcb_component_id: z41.string().optional(),
789
- pcb_smtpad_id: z41.string().optional()
1085
+ pcb_component_id: z51.string().optional(),
1086
+ pcb_smtpad_id: z51.string().optional()
790
1087
  });
791
- var pcb_solder_paste_rect = z41.object({
792
- type: z41.literal("pcb_solder_paste"),
793
- shape: z41.literal("rect"),
1088
+ var pcb_solder_paste_rect = z51.object({
1089
+ type: z51.literal("pcb_solder_paste"),
1090
+ shape: z51.literal("rect"),
794
1091
  pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
1092
+ pcb_group_id: z51.string().optional(),
1093
+ subcircuit_id: z51.string().optional(),
795
1094
  x: distance,
796
1095
  y: distance,
797
- width: z41.number(),
798
- height: z41.number(),
1096
+ width: z51.number(),
1097
+ height: z51.number(),
799
1098
  layer: layer_ref,
800
- pcb_component_id: z41.string().optional(),
801
- pcb_smtpad_id: z41.string().optional()
1099
+ pcb_component_id: z51.string().optional(),
1100
+ pcb_smtpad_id: z51.string().optional()
802
1101
  });
803
- var pcb_solder_paste = z41.union([pcb_solder_paste_circle, pcb_solder_paste_rect]).describe("Defines solderpaste on the PCB");
1102
+ var pcb_solder_paste = z51.union([pcb_solder_paste_circle, pcb_solder_paste_rect]).describe("Defines solderpaste on the PCB");
804
1103
  expectTypesMatch(true);
805
1104
  expectTypesMatch(true);
806
- var pcb_text = z42.object({
807
- type: z42.literal("pcb_text"),
1105
+ var pcb_text = z52.object({
1106
+ type: z52.literal("pcb_text"),
808
1107
  pcb_text_id: getZodPrefixedIdWithDefault("pcb_text"),
809
- text: z42.string(),
1108
+ pcb_group_id: z52.string().optional(),
1109
+ subcircuit_id: z52.string().optional(),
1110
+ text: z52.string(),
810
1111
  center: point,
811
1112
  layer: layer_ref,
812
1113
  width: length,
813
1114
  height: length,
814
- lines: z42.number(),
815
- align: z42.enum(["bottom-left"])
1115
+ lines: z52.number(),
1116
+ // @ts-ignore
1117
+ align: z52.enum(["bottom-left"])
816
1118
  }).describe("Defines text on the PCB");
817
1119
  expectTypesMatch(true);
818
- var pcb_trace_route_point_wire = z43.object({
819
- route_type: z43.literal("wire"),
1120
+ var pcb_trace_route_point_wire = z53.object({
1121
+ route_type: z53.literal("wire"),
820
1122
  x: distance,
821
1123
  y: distance,
822
1124
  width: distance,
823
- start_pcb_port_id: z43.string().optional(),
824
- end_pcb_port_id: z43.string().optional(),
1125
+ start_pcb_port_id: z53.string().optional(),
1126
+ end_pcb_port_id: z53.string().optional(),
825
1127
  layer: layer_ref
826
1128
  });
827
- var pcb_trace_route_point_via = z43.object({
828
- route_type: z43.literal("via"),
1129
+ var pcb_trace_route_point_via = z53.object({
1130
+ route_type: z53.literal("via"),
829
1131
  x: distance,
830
1132
  y: distance,
831
- from_layer: z43.string(),
832
- to_layer: z43.string()
1133
+ from_layer: z53.string(),
1134
+ to_layer: z53.string()
833
1135
  });
834
- var pcb_trace_route_point = z43.union([
1136
+ var pcb_trace_route_point = z53.union([
835
1137
  pcb_trace_route_point_wire,
836
1138
  pcb_trace_route_point_via
837
1139
  ]);
838
- var pcb_trace = z43.object({
839
- type: z43.literal("pcb_trace"),
840
- source_trace_id: z43.string().optional(),
841
- pcb_component_id: z43.string().optional(),
1140
+ var pcb_trace = z53.object({
1141
+ type: z53.literal("pcb_trace"),
1142
+ source_trace_id: z53.string().optional(),
1143
+ pcb_component_id: z53.string().optional(),
842
1144
  pcb_trace_id: getZodPrefixedIdWithDefault("pcb_trace"),
843
- route_thickness_mode: z43.enum(["constant", "interpolated"]).default("constant").optional(),
844
- route_order_index: z43.number().optional(),
845
- should_round_corners: z43.boolean().optional(),
846
- route: z43.array(
847
- z43.union([
848
- z43.object({
849
- route_type: z43.literal("wire"),
1145
+ pcb_group_id: z53.string().optional(),
1146
+ subcircuit_id: z53.string().optional(),
1147
+ route_thickness_mode: z53.enum(["constant", "interpolated"]).default("constant").optional(),
1148
+ route_order_index: z53.number().optional(),
1149
+ should_round_corners: z53.boolean().optional(),
1150
+ trace_length: z53.number().optional(),
1151
+ route: z53.array(
1152
+ z53.union([
1153
+ z53.object({
1154
+ route_type: z53.literal("wire"),
850
1155
  x: distance,
851
1156
  y: distance,
852
1157
  width: distance,
853
- start_pcb_port_id: z43.string().optional(),
854
- end_pcb_port_id: z43.string().optional(),
1158
+ start_pcb_port_id: z53.string().optional(),
1159
+ end_pcb_port_id: z53.string().optional(),
855
1160
  layer: layer_ref
856
1161
  }),
857
- z43.object({
858
- route_type: z43.literal("via"),
1162
+ z53.object({
1163
+ route_type: z53.literal("via"),
859
1164
  x: distance,
860
1165
  y: distance,
861
- from_layer: z43.string(),
862
- to_layer: z43.string()
1166
+ from_layer: z53.string(),
1167
+ to_layer: z53.string()
863
1168
  })
864
1169
  ])
865
1170
  )
866
1171
  }).describe("Defines a trace on the PCB");
867
1172
  expectTypesMatch(true);
868
1173
  expectTypesMatch(true);
869
- var pcb_trace_error = z44.object({
870
- type: z44.literal("pcb_trace_error"),
1174
+ var pcb_trace_error = z54.object({
1175
+ type: z54.literal("pcb_trace_error"),
871
1176
  pcb_trace_error_id: getZodPrefixedIdWithDefault("pcb_trace_error"),
872
- error_type: z44.literal("pcb_trace_error"),
873
- message: z44.string(),
1177
+ error_type: z54.literal("pcb_trace_error"),
1178
+ message: z54.string(),
874
1179
  center: point.optional(),
875
- pcb_trace_id: z44.string(),
876
- source_trace_id: z44.string(),
877
- pcb_component_ids: z44.array(z44.string()),
878
- pcb_port_ids: z44.array(z44.string())
1180
+ pcb_trace_id: z54.string(),
1181
+ source_trace_id: z54.string(),
1182
+ pcb_component_ids: z54.array(z54.string()),
1183
+ pcb_port_ids: z54.array(z54.string())
879
1184
  }).describe("Defines a trace error on the PCB");
880
1185
  expectTypesMatch(true);
881
- var pcb_port_not_matched_error = z45.object({
882
- type: z45.literal("pcb_port_not_matched_error"),
1186
+ var pcb_port_not_matched_error = z55.object({
1187
+ type: z55.literal("pcb_port_not_matched_error"),
883
1188
  pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
884
- message: z45.string(),
885
- pcb_component_ids: z45.array(z45.string())
1189
+ message: z55.string(),
1190
+ pcb_component_ids: z55.array(z55.string())
886
1191
  }).describe("Defines a trace error on the PCB where a port is not matched");
887
1192
  expectTypesMatch(true);
888
- var pcb_via = z46.object({
889
- type: z46.literal("pcb_via"),
1193
+ var pcb_via = z56.object({
1194
+ type: z56.literal("pcb_via"),
890
1195
  pcb_via_id: getZodPrefixedIdWithDefault("pcb_via"),
1196
+ pcb_group_id: z56.string().optional(),
1197
+ subcircuit_id: z56.string().optional(),
891
1198
  x: distance,
892
1199
  y: distance,
893
1200
  outer_diameter: distance.default("0.6mm"),
@@ -896,39 +1203,43 @@ var pcb_via = z46.object({
896
1203
  from_layer: layer_ref.optional(),
897
1204
  /** @deprecated */
898
1205
  to_layer: layer_ref.optional(),
899
- layers: z46.array(layer_ref),
900
- pcb_trace_id: z46.string().optional()
1206
+ layers: z56.array(layer_ref),
1207
+ pcb_trace_id: z56.string().optional()
901
1208
  }).describe("Defines a via on the PCB");
902
1209
  expectTypesMatch(true);
903
- var pcb_board = z47.object({
904
- type: z47.literal("pcb_board"),
1210
+ var pcb_board = z57.object({
1211
+ type: z57.literal("pcb_board"),
905
1212
  pcb_board_id: getZodPrefixedIdWithDefault("pcb_board"),
1213
+ is_subcircuit: z57.boolean().optional(),
1214
+ subcircuit_id: z57.string().optional(),
906
1215
  width: length,
907
1216
  height: length,
908
1217
  center: point,
909
1218
  thickness: length.optional().default(1.4),
910
- num_layers: z47.number().optional().default(4),
911
- outline: z47.array(point).optional()
1219
+ num_layers: z57.number().optional().default(4),
1220
+ outline: z57.array(point).optional()
912
1221
  }).describe("Defines the board outline of the PCB");
913
1222
  expectTypesMatch(true);
914
- var pcb_placement_error = z48.object({
915
- type: z48.literal("pcb_placement_error"),
1223
+ var pcb_placement_error = z58.object({
1224
+ type: z58.literal("pcb_placement_error"),
916
1225
  pcb_placement_error_id: getZodPrefixedIdWithDefault("pcb_placement_error"),
917
- message: z48.string()
1226
+ message: z58.string()
918
1227
  }).describe("Defines a placement error on the PCB");
919
1228
  expectTypesMatch(true);
920
- var pcb_trace_hint = z49.object({
921
- type: z49.literal("pcb_trace_hint"),
1229
+ var pcb_trace_hint = z59.object({
1230
+ type: z59.literal("pcb_trace_hint"),
922
1231
  pcb_trace_hint_id: getZodPrefixedIdWithDefault("pcb_trace_hint"),
923
- pcb_port_id: z49.string(),
924
- pcb_component_id: z49.string(),
925
- route: z49.array(route_hint_point)
1232
+ pcb_port_id: z59.string(),
1233
+ pcb_component_id: z59.string(),
1234
+ route: z59.array(route_hint_point)
926
1235
  }).describe("A hint that can be used during generation of a PCB trace");
927
1236
  expectTypesMatch(true);
928
- var pcb_silkscreen_line = z50.object({
929
- type: z50.literal("pcb_silkscreen_line"),
1237
+ var pcb_silkscreen_line = z60.object({
1238
+ type: z60.literal("pcb_silkscreen_line"),
930
1239
  pcb_silkscreen_line_id: getZodPrefixedIdWithDefault("pcb_silkscreen_line"),
931
- pcb_component_id: z50.string(),
1240
+ pcb_component_id: z60.string(),
1241
+ pcb_group_id: z60.string().optional(),
1242
+ subcircuit_id: z60.string().optional(),
932
1243
  stroke_width: distance.default("0.1mm"),
933
1244
  x1: distance,
934
1245
  y1: distance,
@@ -937,131 +1248,197 @@ var pcb_silkscreen_line = z50.object({
937
1248
  layer: visible_layer
938
1249
  }).describe("Defines a silkscreen line on the PCB");
939
1250
  expectTypesMatch(true);
940
- var pcb_silkscreen_path = z51.object({
941
- type: z51.literal("pcb_silkscreen_path"),
1251
+ var pcb_silkscreen_path = z61.object({
1252
+ type: z61.literal("pcb_silkscreen_path"),
942
1253
  pcb_silkscreen_path_id: getZodPrefixedIdWithDefault("pcb_silkscreen_path"),
943
- pcb_component_id: z51.string(),
1254
+ pcb_component_id: z61.string(),
1255
+ pcb_group_id: z61.string().optional(),
1256
+ subcircuit_id: z61.string().optional(),
944
1257
  layer: visible_layer,
945
- route: z51.array(point),
1258
+ route: z61.array(point),
946
1259
  stroke_width: length
947
1260
  }).describe("Defines a silkscreen path on the PCB");
948
1261
  expectTypesMatch(true);
949
- var pcb_silkscreen_text = z52.object({
950
- type: z52.literal("pcb_silkscreen_text"),
1262
+ var pcb_silkscreen_text = z62.object({
1263
+ type: z62.literal("pcb_silkscreen_text"),
951
1264
  pcb_silkscreen_text_id: getZodPrefixedIdWithDefault("pcb_silkscreen_text"),
952
- font: z52.literal("tscircuit2024").default("tscircuit2024"),
1265
+ pcb_group_id: z62.string().optional(),
1266
+ subcircuit_id: z62.string().optional(),
1267
+ font: z62.literal("tscircuit2024").default("tscircuit2024"),
953
1268
  font_size: distance.default("0.2mm"),
954
- pcb_component_id: z52.string(),
955
- text: z52.string(),
1269
+ pcb_component_id: z62.string(),
1270
+ text: z62.string(),
1271
+ ccw_rotation: z62.number().optional(),
956
1272
  layer: layer_ref,
957
- is_mirrored: z52.boolean().default(false).optional(),
1273
+ is_mirrored: z62.boolean().default(false).optional(),
958
1274
  anchor_position: point.default({ x: 0, y: 0 }),
959
- anchor_alignment: z52.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center")
1275
+ anchor_alignment: z62.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center")
960
1276
  }).describe("Defines silkscreen text on the PCB");
961
1277
  expectTypesMatch(true);
962
- var pcb_silkscreen_rect = z53.object({
963
- type: z53.literal("pcb_silkscreen_rect"),
1278
+ var pcb_silkscreen_rect = z63.object({
1279
+ type: z63.literal("pcb_silkscreen_rect"),
964
1280
  pcb_silkscreen_rect_id: getZodPrefixedIdWithDefault("pcb_silkscreen_rect"),
965
- pcb_component_id: z53.string(),
1281
+ pcb_component_id: z63.string(),
1282
+ pcb_group_id: z63.string().optional(),
1283
+ subcircuit_id: z63.string().optional(),
966
1284
  center: point,
967
1285
  width: length,
968
1286
  height: length,
969
- layer: layer_ref
1287
+ layer: layer_ref,
1288
+ stroke_width: length.default("1mm")
970
1289
  }).describe("Defines a silkscreen rect on the PCB");
971
1290
  expectTypesMatch(true);
972
- var pcb_silkscreen_circle = z54.object({
973
- type: z54.literal("pcb_silkscreen_circle"),
1291
+ var pcb_silkscreen_circle = z64.object({
1292
+ type: z64.literal("pcb_silkscreen_circle"),
974
1293
  pcb_silkscreen_circle_id: getZodPrefixedIdWithDefault(
975
1294
  "pcb_silkscreen_circle"
976
1295
  ),
977
- pcb_component_id: z54.string(),
1296
+ pcb_component_id: z64.string(),
1297
+ pcb_group_id: z64.string().optional(),
1298
+ subcircuit_id: z64.string().optional(),
978
1299
  center: point,
979
1300
  radius: length,
980
- layer: visible_layer
1301
+ layer: visible_layer,
1302
+ stroke_width: length.default("1mm")
981
1303
  }).describe("Defines a silkscreen circle on the PCB");
982
1304
  expectTypesMatch(true);
983
- var pcb_silkscreen_oval = z55.object({
984
- type: z55.literal("pcb_silkscreen_oval"),
1305
+ var pcb_silkscreen_oval = z65.object({
1306
+ type: z65.literal("pcb_silkscreen_oval"),
985
1307
  pcb_silkscreen_oval_id: getZodPrefixedIdWithDefault("pcb_silkscreen_oval"),
986
- pcb_component_id: z55.string(),
1308
+ pcb_component_id: z65.string(),
1309
+ pcb_group_id: z65.string().optional(),
1310
+ subcircuit_id: z65.string().optional(),
987
1311
  center: point,
988
1312
  radius_x: distance,
989
1313
  radius_y: distance,
990
1314
  layer: visible_layer
991
1315
  }).describe("Defines a silkscreen oval on the PCB");
992
1316
  expectTypesMatch(true);
993
- var pcb_fabrication_note_text = z56.object({
994
- type: z56.literal("pcb_fabrication_note_text"),
1317
+ var pcb_fabrication_note_text = z66.object({
1318
+ type: z66.literal("pcb_fabrication_note_text"),
995
1319
  pcb_fabrication_note_text_id: getZodPrefixedIdWithDefault(
996
1320
  "pcb_fabrication_note_text"
997
1321
  ),
998
- font: z56.literal("tscircuit2024").default("tscircuit2024"),
1322
+ subcircuit_id: z66.string().optional(),
1323
+ pcb_group_id: z66.string().optional(),
1324
+ font: z66.literal("tscircuit2024").default("tscircuit2024"),
999
1325
  font_size: distance.default("1mm"),
1000
- pcb_component_id: z56.string(),
1001
- text: z56.string(),
1326
+ pcb_component_id: z66.string(),
1327
+ text: z66.string(),
1002
1328
  layer: visible_layer,
1003
1329
  anchor_position: point.default({ x: 0, y: 0 }),
1004
- anchor_alignment: z56.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
1005
- color: z56.string().optional()
1330
+ anchor_alignment: z66.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
1331
+ color: z66.string().optional()
1006
1332
  }).describe(
1007
1333
  "Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"
1008
1334
  );
1009
1335
  expectTypesMatch(true);
1010
- var pcb_fabrication_note_path = z57.object({
1011
- type: z57.literal("pcb_fabrication_note_path"),
1336
+ var pcb_fabrication_note_path = z67.object({
1337
+ type: z67.literal("pcb_fabrication_note_path"),
1012
1338
  pcb_fabrication_note_path_id: getZodPrefixedIdWithDefault(
1013
1339
  "pcb_fabrication_note_path"
1014
1340
  ),
1015
- pcb_component_id: z57.string(),
1341
+ pcb_component_id: z67.string(),
1342
+ subcircuit_id: z67.string().optional(),
1016
1343
  layer: layer_ref,
1017
- route: z57.array(point),
1344
+ route: z67.array(point),
1018
1345
  stroke_width: length,
1019
- color: z57.string().optional()
1346
+ color: z67.string().optional()
1020
1347
  }).describe(
1021
1348
  "Defines a fabrication path on the PCB for fabricators or assemblers"
1022
1349
  );
1023
1350
  expectTypesMatch(true);
1024
- var pcb_keepout = z58.object({
1025
- type: z58.literal("pcb_keepout"),
1026
- shape: z58.literal("rect"),
1351
+ var pcb_keepout = z68.object({
1352
+ type: z68.literal("pcb_keepout"),
1353
+ shape: z68.literal("rect"),
1354
+ pcb_group_id: z68.string().optional(),
1355
+ subcircuit_id: z68.string().optional(),
1027
1356
  center: point,
1028
1357
  width: distance,
1029
1358
  height: distance,
1030
- pcb_keepout_id: z58.string(),
1031
- layers: z58.array(z58.string()),
1359
+ pcb_keepout_id: z68.string(),
1360
+ layers: z68.array(z68.string()),
1032
1361
  // Specify layers where the keepout applies
1033
- description: z58.string().optional()
1362
+ description: z68.string().optional()
1034
1363
  // Optional description of the keepout
1035
1364
  }).or(
1036
- z58.object({
1037
- type: z58.literal("pcb_keepout"),
1038
- shape: z58.literal("circle"),
1365
+ z68.object({
1366
+ type: z68.literal("pcb_keepout"),
1367
+ shape: z68.literal("circle"),
1368
+ pcb_group_id: z68.string().optional(),
1369
+ subcircuit_id: z68.string().optional(),
1039
1370
  center: point,
1040
1371
  radius: distance,
1041
- pcb_keepout_id: z58.string(),
1042
- layers: z58.array(z58.string()),
1372
+ pcb_keepout_id: z68.string(),
1373
+ layers: z68.array(z68.string()),
1043
1374
  // Specify layers where the keepout applies
1044
- description: z58.string().optional()
1375
+ description: z68.string().optional()
1045
1376
  // Optional description of the keepout
1046
1377
  })
1047
1378
  );
1048
- var cad_component = z59.object({
1049
- type: z59.literal("cad_component"),
1050
- cad_component_id: z59.string(),
1051
- pcb_component_id: z59.string(),
1052
- source_component_id: z59.string(),
1379
+ var pcb_missing_footprint_error = z69.object({
1380
+ type: z69.literal("pcb_missing_footprint_error"),
1381
+ pcb_missing_footprint_error_id: getZodPrefixedIdWithDefault(
1382
+ "pcb_missing_footprint_error"
1383
+ ),
1384
+ pcb_group_id: z69.string().optional(),
1385
+ subcircuit_id: z69.string().optional(),
1386
+ error_type: z69.literal("pcb_missing_footprint_error"),
1387
+ source_component_id: z69.string(),
1388
+ message: z69.string()
1389
+ }).describe("Defines a missing footprint error on the PCB");
1390
+ expectTypesMatch(
1391
+ true
1392
+ );
1393
+ var pcb_manual_edit_conflict_error = z70.object({
1394
+ type: z70.literal("pcb_manual_edit_conflict_error"),
1395
+ pcb_error_id: getZodPrefixedIdWithDefault("pcb_manual_edit_conflict_error"),
1396
+ message: z70.string(),
1397
+ pcb_component_id: z70.string(),
1398
+ pcb_group_id: z70.string().optional(),
1399
+ subcircuit_id: z70.string().optional(),
1400
+ source_component_id: z70.string()
1401
+ }).describe(
1402
+ "Error emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"
1403
+ );
1404
+ expectTypesMatch(true);
1405
+ var pcb_group = z71.object({
1406
+ type: z71.literal("pcb_group"),
1407
+ pcb_group_id: getZodPrefixedIdWithDefault("pcb_group"),
1408
+ source_group_id: z71.string(),
1409
+ is_subcircuit: z71.boolean().optional(),
1410
+ subcircuit_id: z71.string().optional(),
1411
+ width: length,
1412
+ height: length,
1413
+ center: point,
1414
+ pcb_component_ids: z71.array(z71.string()),
1415
+ name: z71.string().optional(),
1416
+ description: z71.string().optional()
1417
+ }).describe("Defines a group of components on the PCB");
1418
+ expectTypesMatch(true);
1419
+ var pcb_autorouting_error = z72.object({
1420
+ type: z72.literal("pcb_autorouting_error"),
1421
+ pcb_error_id: getZodPrefixedIdWithDefault("pcb_autorouting_error"),
1422
+ message: z72.string()
1423
+ }).describe("The autorouting has failed to route a portion of the board");
1424
+ expectTypesMatch(true);
1425
+ var cad_component = z73.object({
1426
+ type: z73.literal("cad_component"),
1427
+ cad_component_id: z73.string(),
1428
+ pcb_component_id: z73.string(),
1429
+ source_component_id: z73.string(),
1053
1430
  position: point3,
1054
1431
  rotation: point3.optional(),
1055
1432
  size: point3.optional(),
1056
1433
  layer: layer_ref.optional(),
1057
1434
  // These are all ways to generate/load the 3d model
1058
- footprinter_string: z59.string().optional(),
1059
- model_obj_url: z59.string().optional(),
1060
- model_stl_url: z59.string().optional(),
1061
- model_3mf_url: z59.string().optional(),
1062
- model_jscad: z59.any().optional()
1435
+ footprinter_string: z73.string().optional(),
1436
+ model_obj_url: z73.string().optional(),
1437
+ model_stl_url: z73.string().optional(),
1438
+ model_3mf_url: z73.string().optional(),
1439
+ model_jscad: z73.any().optional()
1063
1440
  }).describe("Defines a component on the PCB");
1064
- var any_circuit_element = z60.union([
1441
+ var any_circuit_element = z74.union([
1065
1442
  source_trace,
1066
1443
  source_port,
1067
1444
  any_source_component,
@@ -1075,8 +1452,19 @@ var any_circuit_element = z60.union([
1075
1452
  source_simple_resistor,
1076
1453
  source_simple_power_source,
1077
1454
  source_simple_battery,
1455
+ source_simple_inductor,
1456
+ source_simple_pin_header,
1457
+ source_simple_resonator,
1458
+ source_simple_switch,
1459
+ source_simple_transistor,
1460
+ source_simple_mosfet,
1461
+ source_simple_potentiometer,
1462
+ source_simple_push_button,
1463
+ source_project_metadata,
1078
1464
  pcb_component,
1079
1465
  pcb_hole,
1466
+ pcb_missing_footprint_error,
1467
+ pcb_manual_edit_conflict_error,
1080
1468
  pcb_plated_hole,
1081
1469
  pcb_keepout,
1082
1470
  pcb_port,
@@ -1086,6 +1474,7 @@ var any_circuit_element = z60.union([
1086
1474
  pcb_smtpad,
1087
1475
  pcb_solder_paste,
1088
1476
  pcb_board,
1477
+ pcb_group,
1089
1478
  pcb_trace_hint,
1090
1479
  pcb_silkscreen_line,
1091
1480
  pcb_silkscreen_path,
@@ -1098,6 +1487,7 @@ var any_circuit_element = z60.union([
1098
1487
  pcb_port_not_matched_error,
1099
1488
  pcb_fabrication_note_path,
1100
1489
  pcb_fabrication_note_text,
1490
+ pcb_autorouting_error,
1101
1491
  schematic_box,
1102
1492
  schematic_text,
1103
1493
  schematic_line,
@@ -1108,6 +1498,7 @@ var any_circuit_element = z60.union([
1108
1498
  schematic_error,
1109
1499
  schematic_net_label,
1110
1500
  schematic_debug_object,
1501
+ schematic_voltage_probe,
1111
1502
  cad_component
1112
1503
  ]);
1113
1504
  var any_soup_element = any_circuit_element;
@@ -1180,7 +1571,7 @@ var su = (soup, options = {}) => {
1180
1571
  }
1181
1572
  }
1182
1573
  }
1183
- const su22 = new Proxy(
1574
+ const su2 = new Proxy(
1184
1575
  {},
1185
1576
  {
1186
1577
  get: (proxy_target, component_type) => {
@@ -1288,7 +1679,7 @@ var su = (soup, options = {}) => {
1288
1679
  }
1289
1680
  }
1290
1681
  );
1291
- return su22;
1682
+ return su2;
1292
1683
  };
1293
1684
  su.unparsed = su;
1294
1685
  var su_default = su;
@@ -1549,7 +1940,7 @@ import { mm as mm2 } from "@tscircuit/mm";
1549
1940
  // lib/utils/easyeda-unit-to-mm.ts
1550
1941
  var mil10ToMm = (value) => value * 10 * 0.0254;
1551
1942
 
1552
- // lib/normalize-pin-labels.ts
1943
+ // lib/websafe/normalize-pin-labels.ts
1553
1944
  var normalizePinLabels = (inputPinLabels) => {
1554
1945
  const unqInputPinLabels = inputPinLabels.map((labels) => [...new Set(labels)]);
1555
1946
  const result = unqInputPinLabels.map(() => []);
@@ -1877,7 +2268,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, { useModelCdn, shouldRecente
1877
2268
  };
1878
2269
  var convertEasyEdaJsonToTscircuitSoupJson = convertEasyEdaJsonToCircuitJson;
1879
2270
 
1880
- // lib/fetch-easyeda-json.ts
2271
+ // lib/websafe/fetch-easyeda-json.ts
1881
2272
  async function fetchEasyEDAComponent(jlcpcbPartNumber, { fetch: fetch2 = globalThis.fetch } = {}) {
1882
2273
  const searchUrl = "https://easyeda.com/api/components/search";
1883
2274
  const componentUrl = (uuid) => `https://easyeda.com/api/components/${uuid}?version=6.4.7&uuid=${uuid}&datastrid=`;
@@ -1929,14 +2320,14 @@ async function fetchEasyEDAComponent(jlcpcbPartNumber, { fetch: fetch2 = globalT
1929
2320
  }
1930
2321
 
1931
2322
  // lib/schemas/easy-eda-json-schema.ts
1932
- import { z as z63 } from "zod";
2323
+ import { z as z77 } from "zod";
1933
2324
 
1934
2325
  // lib/schemas/package-detail-shape-schema.ts
1935
- import { z as z61 } from "zod";
1936
- var tenthmil = z61.union([z61.number(), z61.string()]).optional().transform(
2326
+ import { z as z75 } from "zod";
2327
+ var tenthmil = z75.union([z75.number(), z75.string()]).optional().transform(
1937
2328
  (n) => typeof n === "string" && n.endsWith("mil") ? n : `${Number.parseFloat(n) * 10}mil`
1938
- ).pipe(z61.string());
1939
- var PointSchema = z61.any().transform((p) => {
2329
+ ).pipe(z75.string());
2330
+ var PointSchema = z75.any().transform((p) => {
1940
2331
  if (Array.isArray(p)) {
1941
2332
  const [x, y] = p;
1942
2333
  return { x, y };
@@ -1945,98 +2336,98 @@ var PointSchema = z61.any().transform((p) => {
1945
2336
  }
1946
2337
  throw new Error(`Invalid point: ${p}`);
1947
2338
  }).pipe(
1948
- z61.object({
1949
- x: z61.number(),
1950
- y: z61.number()
2339
+ z75.object({
2340
+ x: z75.number(),
2341
+ y: z75.number()
1951
2342
  })
1952
2343
  );
1953
- var BaseShapeSchema = z61.object({
1954
- type: z61.string(),
1955
- id: z61.string().optional(),
1956
- layer: z61.coerce.number().optional()
2344
+ var BaseShapeSchema = z75.object({
2345
+ type: z75.string(),
2346
+ id: z75.string().optional(),
2347
+ layer: z75.coerce.number().optional()
1957
2348
  });
1958
2349
  var TrackSchema = BaseShapeSchema.extend({
1959
- type: z61.literal("TRACK"),
1960
- width: z61.coerce.number(),
1961
- points: z61.array(PointSchema)
2350
+ type: z75.literal("TRACK"),
2351
+ width: z75.coerce.number(),
2352
+ points: z75.array(PointSchema)
1962
2353
  });
1963
2354
  var PadSchema = BaseShapeSchema.extend({
1964
- type: z61.literal("PAD"),
1965
- shape: z61.enum(["RECT", "ELLIPSE", "OVAL"]),
1966
- center: z61.object({
2355
+ type: z75.literal("PAD"),
2356
+ shape: z75.enum(["RECT", "ELLIPSE", "OVAL"]),
2357
+ center: z75.object({
1967
2358
  x: tenthmil,
1968
2359
  y: tenthmil
1969
2360
  }),
1970
2361
  width: tenthmil,
1971
2362
  height: tenthmil,
1972
- layermask: z61.number(),
1973
- net: z61.union([z61.string(), z61.number()]).optional(),
1974
- number: z61.union([z61.string(), z61.number()]),
2363
+ layermask: z75.number(),
2364
+ net: z75.union([z75.string(), z75.number()]).optional(),
2365
+ number: z75.union([z75.string(), z75.number()]),
1975
2366
  holeRadius: tenthmil,
1976
- points: z61.array(PointSchema).optional(),
1977
- rotation: z61.number().optional(),
1978
- plated: z61.boolean()
2367
+ points: z75.array(PointSchema).optional(),
2368
+ rotation: z75.number().optional(),
2369
+ plated: z75.boolean()
1979
2370
  });
1980
2371
  var ArcSchema = BaseShapeSchema.extend({
1981
- type: z61.literal("ARC"),
1982
- width: z61.number(),
2372
+ type: z75.literal("ARC"),
2373
+ width: z75.number(),
1983
2374
  start: PointSchema,
1984
2375
  end: PointSchema,
1985
- radiusX: z61.number(),
1986
- radiusY: z61.number(),
1987
- largeArc: z61.boolean(),
1988
- sweepDirection: z61.enum(["CW", "CCW"])
2376
+ radiusX: z75.number(),
2377
+ radiusY: z75.number(),
2378
+ largeArc: z75.boolean(),
2379
+ sweepDirection: z75.enum(["CW", "CCW"])
1989
2380
  });
1990
2381
  var CircleSchema = BaseShapeSchema.extend({
1991
- type: z61.literal("CIRCLE"),
2382
+ type: z75.literal("CIRCLE"),
1992
2383
  center: PointSchema,
1993
- radius: z61.number(),
1994
- width: z61.number()
2384
+ radius: z75.number(),
2385
+ width: z75.number()
1995
2386
  });
1996
2387
  var SolidRegionSchema = BaseShapeSchema.extend({
1997
- type: z61.literal("SOLIDREGION"),
1998
- layermask: z61.number(),
1999
- points: z61.array(PointSchema),
2000
- fillStyle: z61.string()
2388
+ type: z75.literal("SOLIDREGION"),
2389
+ layermask: z75.number(),
2390
+ points: z75.array(PointSchema),
2391
+ fillStyle: z75.string()
2001
2392
  });
2002
2393
  var SVGNodeSchema = BaseShapeSchema.extend({
2003
- type: z61.literal("SVGNODE"),
2004
- svgData: z61.object({
2005
- gId: z61.string(),
2006
- nodeName: z61.string(),
2007
- nodeType: z61.number(),
2008
- layerid: z61.string(),
2009
- attrs: z61.record(z61.string(), z61.string()),
2010
- childNodes: z61.array(z61.unknown())
2394
+ type: z75.literal("SVGNODE"),
2395
+ svgData: z75.object({
2396
+ gId: z75.string(),
2397
+ nodeName: z75.string(),
2398
+ nodeType: z75.number(),
2399
+ layerid: z75.string(),
2400
+ attrs: z75.record(z75.string(), z75.string()),
2401
+ childNodes: z75.array(z75.unknown())
2011
2402
  })
2012
2403
  });
2013
2404
  var HoleSchema = BaseShapeSchema.extend({
2014
- type: z61.literal("HOLE"),
2405
+ type: z75.literal("HOLE"),
2015
2406
  center: PointSchema,
2016
- radius: z61.number()
2407
+ radius: z75.number()
2017
2408
  });
2018
2409
  var RectSchema = BaseShapeSchema.extend({
2019
- type: z61.literal("RECT"),
2410
+ type: z75.literal("RECT"),
2020
2411
  x: tenthmil,
2021
2412
  y: tenthmil,
2022
2413
  width: tenthmil,
2023
2414
  height: tenthmil,
2024
- lineWidth: z61.number(),
2025
- fillStyle: z61.string(),
2026
- rotation: z61.number().optional()
2415
+ lineWidth: z75.number(),
2416
+ fillStyle: z75.string(),
2417
+ rotation: z75.number().optional()
2027
2418
  });
2028
2419
  var TextSchema = BaseShapeSchema.extend({
2029
- type: z61.literal("TEXT"),
2030
- text: z61.string(),
2420
+ type: z75.literal("TEXT"),
2421
+ text: z75.string(),
2031
2422
  x: tenthmil,
2032
2423
  y: tenthmil,
2033
- size_mm: z61.number(),
2034
- rotation: z61.number().optional(),
2035
- layer: z61.number().optional(),
2036
- textAnchor: z61.enum(["L", "C", "R", ""]).optional().transform((val) => val === "" ? void 0 : val),
2037
- font: z61.string().optional()
2424
+ size_mm: z75.number(),
2425
+ rotation: z75.number().optional(),
2426
+ layer: z75.number().optional(),
2427
+ textAnchor: z75.enum(["L", "C", "R", ""]).optional().transform((val) => val === "" ? void 0 : val),
2428
+ font: z75.string().optional()
2038
2429
  });
2039
- var PackageDetailShapeSchema = z61.discriminatedUnion("type", [
2430
+ var PackageDetailShapeSchema = z75.discriminatedUnion("type", [
2040
2431
  TrackSchema,
2041
2432
  PadSchema,
2042
2433
  ArcSchema,
@@ -2057,9 +2448,9 @@ var pairs = (arr) => {
2057
2448
  var parsePoints = (pointsStr) => pairs(
2058
2449
  pointsStr.trim().split(" ").map((n) => Number(n))
2059
2450
  );
2060
- var ShapeItemSchema = z61.object({
2061
- type: z61.string(),
2062
- data: z61.string()
2451
+ var ShapeItemSchema = z75.object({
2452
+ type: z75.string(),
2453
+ data: z75.string()
2063
2454
  }).transform((shape) => {
2064
2455
  const [firstParam, ...restParams] = shape.data.split("~");
2065
2456
  const lastParam = restParams.pop();
@@ -2215,23 +2606,23 @@ var ShapeItemSchema = z61.object({
2215
2606
  return BaseShapeSchema.parse({ type: shape.type });
2216
2607
  }
2217
2608
  }).pipe(PackageDetailShapeSchema);
2218
- var ShapesArraySchema = z61.array(ShapeItemSchema);
2609
+ var ShapesArraySchema = z75.array(ShapeItemSchema);
2219
2610
 
2220
2611
  // lib/schemas/single-letter-shape-schema.ts
2221
- import { z as z62 } from "zod";
2612
+ import { z as z76 } from "zod";
2222
2613
  import "@tscircuit/mm";
2223
- var PointSchema2 = z62.object({
2224
- x: z62.number(),
2225
- y: z62.number()
2614
+ var PointSchema2 = z76.object({
2615
+ x: z76.number(),
2616
+ y: z76.number()
2226
2617
  });
2227
- var RectangleShapeOutputSchema = z62.object({
2228
- type: z62.literal("RECTANGLE"),
2618
+ var RectangleShapeOutputSchema = z76.object({
2619
+ type: z76.literal("RECTANGLE"),
2229
2620
  position: PointSchema2,
2230
- width: z62.number(),
2231
- height: z62.number(),
2232
- color: z62.string(),
2233
- lineWidth: z62.number(),
2234
- id: z62.string()
2621
+ width: z76.number(),
2622
+ height: z76.number(),
2623
+ color: z76.string(),
2624
+ lineWidth: z76.number(),
2625
+ id: z76.string()
2235
2626
  });
2236
2627
  var parseRectangle = (str) => {
2237
2628
  const [, x, y, , , width, height, color, lineWidth, , , id] = str.split("~");
@@ -2245,15 +2636,15 @@ var parseRectangle = (str) => {
2245
2636
  id
2246
2637
  };
2247
2638
  };
2248
- var RectangleShapeSchema = z62.string().startsWith("R~").transform(parseRectangle).pipe(RectangleShapeOutputSchema);
2249
- var EllipseShapeOutputSchema = z62.object({
2250
- type: z62.literal("ELLIPSE"),
2639
+ var RectangleShapeSchema = z76.string().startsWith("R~").transform(parseRectangle).pipe(RectangleShapeOutputSchema);
2640
+ var EllipseShapeOutputSchema = z76.object({
2641
+ type: z76.literal("ELLIPSE"),
2251
2642
  center: PointSchema2,
2252
- radiusX: z62.number(),
2253
- radiusY: z62.number(),
2254
- color: z62.string(),
2255
- lineWidth: z62.number(),
2256
- id: z62.string()
2643
+ radiusX: z76.number(),
2644
+ radiusY: z76.number(),
2645
+ color: z76.string(),
2646
+ lineWidth: z76.number(),
2647
+ id: z76.string()
2257
2648
  });
2258
2649
  var parseEllipse = (str) => {
2259
2650
  const [, x, y, radiusX, radiusY, color, lineWidth, , , id] = str.split("~");
@@ -2267,19 +2658,19 @@ var parseEllipse = (str) => {
2267
2658
  id
2268
2659
  };
2269
2660
  };
2270
- var EllipseShapeSchema = z62.string().startsWith("E~").transform(parseEllipse).pipe(EllipseShapeOutputSchema);
2271
- var PinShapeOutputSchema = z62.object({
2272
- type: z62.literal("PIN"),
2273
- visibility: z62.enum(["show", "hide"]),
2274
- pinNumber: z62.union([z62.string(), z62.number()]),
2275
- x: z62.number(),
2276
- y: z62.number(),
2277
- rotation: z62.number(),
2278
- id: z62.string(),
2279
- label: z62.string(),
2280
- labelColor: z62.string(),
2281
- path: z62.string(),
2282
- arrow: z62.string()
2661
+ var EllipseShapeSchema = z76.string().startsWith("E~").transform(parseEllipse).pipe(EllipseShapeOutputSchema);
2662
+ var PinShapeOutputSchema = z76.object({
2663
+ type: z76.literal("PIN"),
2664
+ visibility: z76.enum(["show", "hide"]),
2665
+ pinNumber: z76.union([z76.string(), z76.number()]),
2666
+ x: z76.number(),
2667
+ y: z76.number(),
2668
+ rotation: z76.number(),
2669
+ id: z76.string(),
2670
+ label: z76.string(),
2671
+ labelColor: z76.string(),
2672
+ path: z76.string(),
2673
+ arrow: z76.string()
2283
2674
  });
2284
2675
  var parsePin = (pinString) => {
2285
2676
  const parts = pinString.split("~");
@@ -2306,13 +2697,13 @@ var parsePin = (pinString) => {
2306
2697
  arrow
2307
2698
  };
2308
2699
  };
2309
- var PinShapeSchema = z62.string().startsWith("P~").transform(parsePin).pipe(PinShapeOutputSchema);
2310
- var PolylineShapeOutputSchema = z62.object({
2311
- type: z62.literal("POLYLINE"),
2312
- points: z62.array(PointSchema2),
2313
- color: z62.string(),
2314
- lineWidth: z62.number(),
2315
- id: z62.string()
2700
+ var PinShapeSchema = z76.string().startsWith("P~").transform(parsePin).pipe(PinShapeOutputSchema);
2701
+ var PolylineShapeOutputSchema = z76.object({
2702
+ type: z76.literal("POLYLINE"),
2703
+ points: z76.array(PointSchema2),
2704
+ color: z76.string(),
2705
+ lineWidth: z76.number(),
2706
+ id: z76.string()
2316
2707
  });
2317
2708
  var parsePoints2 = (pointsStr) => {
2318
2709
  return pointsStr.split(" ").reduce((acc, value, index) => {
@@ -2335,14 +2726,14 @@ var parsePolyline = (str) => {
2335
2726
  id
2336
2727
  };
2337
2728
  };
2338
- var PolylineShapeSchema = z62.string().startsWith("PL~").transform(parsePolyline).pipe(PolylineShapeOutputSchema);
2339
- var PolygonShapeOutputSchema = z62.object({
2340
- type: z62.literal("POLYGON"),
2341
- points: z62.array(PointSchema2),
2342
- fillColor: z62.string(),
2343
- lineWidth: z62.number(),
2344
- lineColor: z62.string(),
2345
- id: z62.string()
2729
+ var PolylineShapeSchema = z76.string().startsWith("PL~").transform(parsePolyline).pipe(PolylineShapeOutputSchema);
2730
+ var PolygonShapeOutputSchema = z76.object({
2731
+ type: z76.literal("POLYGON"),
2732
+ points: z76.array(PointSchema2),
2733
+ fillColor: z76.string(),
2734
+ lineWidth: z76.number(),
2735
+ lineColor: z76.string(),
2736
+ id: z76.string()
2346
2737
  });
2347
2738
  var parsePolygon = (str) => {
2348
2739
  const [, ...rest] = str.split("~");
@@ -2356,14 +2747,14 @@ var parsePolygon = (str) => {
2356
2747
  id
2357
2748
  };
2358
2749
  };
2359
- var PolygonShapeSchema = z62.string().startsWith("PG~").transform(parsePolygon).pipe(PolygonShapeOutputSchema);
2360
- var PathShapeOutputSchema = z62.object({
2361
- type: z62.literal("PATH"),
2362
- pathData: z62.string(),
2363
- fillColor: z62.string(),
2364
- strokeWidth: z62.number(),
2365
- strokeColor: z62.string(),
2366
- id: z62.string()
2750
+ var PolygonShapeSchema = z76.string().startsWith("PG~").transform(parsePolygon).pipe(PolygonShapeOutputSchema);
2751
+ var PathShapeOutputSchema = z76.object({
2752
+ type: z76.literal("PATH"),
2753
+ pathData: z76.string(),
2754
+ fillColor: z76.string(),
2755
+ strokeWidth: z76.number(),
2756
+ strokeColor: z76.string(),
2757
+ id: z76.string()
2367
2758
  });
2368
2759
  var parsePath = (str) => {
2369
2760
  const [, pathData, fillColor, strokeWidth, strokeColor, , id] = str.split("~");
@@ -2376,24 +2767,24 @@ var parsePath = (str) => {
2376
2767
  id
2377
2768
  };
2378
2769
  };
2379
- var PathShapeSchema = z62.string().startsWith("PT~").transform(parsePath).pipe(PathShapeOutputSchema);
2380
- var TextShapeOutputSchema = z62.object({
2381
- type: z62.literal("TEXT"),
2382
- alignment: z62.enum(["L", "C", "R"]),
2383
- x: z62.number(),
2384
- y: z62.number(),
2385
- rotation: z62.number(),
2386
- fontColor: z62.string(),
2387
- backgroundColor: z62.string().optional(),
2388
- fontSize: z62.string(),
2389
- fontWeight: z62.enum(["normal", "bold"]).optional().default("normal"),
2390
- fontStyle: z62.enum(["normal", "italic"]).optional().default("normal"),
2391
- fontDecoration: z62.enum(["", "underline"]),
2392
- content: z62.string(),
2393
- textType: z62.string(),
2394
- visibility: z62.enum(["0", "1"]),
2395
- mirror: z62.string(),
2396
- id: z62.string()
2770
+ var PathShapeSchema = z76.string().startsWith("PT~").transform(parsePath).pipe(PathShapeOutputSchema);
2771
+ var TextShapeOutputSchema = z76.object({
2772
+ type: z76.literal("TEXT"),
2773
+ alignment: z76.enum(["L", "C", "R"]),
2774
+ x: z76.number(),
2775
+ y: z76.number(),
2776
+ rotation: z76.number(),
2777
+ fontColor: z76.string(),
2778
+ backgroundColor: z76.string().optional(),
2779
+ fontSize: z76.string(),
2780
+ fontWeight: z76.enum(["normal", "bold"]).optional().default("normal"),
2781
+ fontStyle: z76.enum(["normal", "italic"]).optional().default("normal"),
2782
+ fontDecoration: z76.enum(["", "underline"]),
2783
+ content: z76.string(),
2784
+ textType: z76.string(),
2785
+ visibility: z76.enum(["0", "1"]),
2786
+ mirror: z76.string(),
2787
+ id: z76.string()
2397
2788
  });
2398
2789
  var parseText = (str) => {
2399
2790
  const [
@@ -2433,8 +2824,8 @@ var parseText = (str) => {
2433
2824
  id
2434
2825
  };
2435
2826
  };
2436
- var TextShapeSchema = z62.string().startsWith("T~").transform(parseText).pipe(TextShapeOutputSchema);
2437
- var SingleLetterShapeSchema = z62.string().transform((x) => {
2827
+ var TextShapeSchema = z76.string().startsWith("T~").transform(parseText).pipe(TextShapeOutputSchema);
2828
+ var SingleLetterShapeSchema = z76.string().transform((x) => {
2438
2829
  if (x.startsWith("R~")) return RectangleShapeSchema.parse(x);
2439
2830
  if (x.startsWith("E~")) return EllipseShapeSchema.parse(x);
2440
2831
  if (x.startsWith("P~")) return PinShapeSchema.parse(x);
@@ -2444,7 +2835,7 @@ var SingleLetterShapeSchema = z62.string().transform((x) => {
2444
2835
  if (x.startsWith("T~")) return TextShapeSchema.parse(x);
2445
2836
  throw new Error(`Invalid shape type: ${x}`);
2446
2837
  }).pipe(
2447
- z62.union([
2838
+ z76.union([
2448
2839
  RectangleShapeOutputSchema,
2449
2840
  EllipseShapeOutputSchema,
2450
2841
  PinShapeOutputSchema,
@@ -2456,81 +2847,81 @@ var SingleLetterShapeSchema = z62.string().transform((x) => {
2456
2847
  );
2457
2848
 
2458
2849
  // lib/schemas/easy-eda-json-schema.ts
2459
- var maybeNumber = z63.any().transform((k) => k === "nan" || Number.isNaN(k) ? null : k).pipe(z63.number().nullable().optional());
2460
- var SzlcscSchema = z63.object({
2461
- id: z63.number(),
2462
- number: z63.string(),
2463
- step: z63.number().optional(),
2464
- min: z63.number().optional(),
2465
- price: z63.number().optional(),
2466
- stock: z63.number().optional(),
2467
- url: z63.string().url().optional(),
2468
- image: z63.string().optional().optional()
2469
- });
2470
- var LcscSchema = z63.object({
2471
- id: z63.number(),
2472
- number: z63.string(),
2473
- step: z63.number().optional(),
2474
- min: z63.number().optional(),
2475
- price: z63.number().optional(),
2476
- stock: z63.number().optional(),
2477
- url: z63.string().url().optional()
2478
- });
2479
- var OwnerSchema = z63.object({
2480
- uuid: z63.string(),
2481
- username: z63.string(),
2482
- nickname: z63.string(),
2483
- avatar: z63.string()
2484
- });
2485
- var HeadSchema = z63.object({
2486
- docType: z63.string(),
2487
- editorVersion: z63.string(),
2488
- c_para: z63.record(z63.string(), z63.string()),
2489
- x: z63.number(),
2490
- y: z63.number(),
2491
- puuid: z63.string().optional(),
2492
- uuid: z63.string(),
2493
- utime: z63.number(),
2494
- importFlag: z63.number().optional(),
2495
- c_spiceCmd: z63.any().optional(),
2496
- hasIdFlag: z63.boolean()
2497
- });
2498
- var BBoxSchema = z63.object({
2499
- x: z63.number(),
2500
- y: z63.number(),
2501
- width: z63.number(),
2502
- height: z63.number()
2503
- });
2504
- var LayerItemSchema = z63.object({
2505
- name: z63.string(),
2506
- color: z63.string(),
2507
- visible: z63.boolean(),
2508
- active: z63.boolean(),
2509
- config: z63.boolean(),
2510
- transparency: z63.boolean()
2511
- });
2512
- var ObjectItemSchema = z63.object({
2513
- name: z63.string(),
2514
- visible: z63.boolean(),
2515
- locked: z63.boolean()
2516
- });
2517
- var DataStrSchema = z63.object({
2850
+ var maybeNumber = z77.any().transform((k) => k === "nan" || Number.isNaN(k) ? null : k).pipe(z77.number().nullable().optional());
2851
+ var SzlcscSchema = z77.object({
2852
+ id: z77.number(),
2853
+ number: z77.string(),
2854
+ step: z77.number().optional(),
2855
+ min: z77.number().optional(),
2856
+ price: z77.number().optional(),
2857
+ stock: z77.number().optional(),
2858
+ url: z77.string().url().optional(),
2859
+ image: z77.string().optional().optional()
2860
+ });
2861
+ var LcscSchema = z77.object({
2862
+ id: z77.number(),
2863
+ number: z77.string(),
2864
+ step: z77.number().optional(),
2865
+ min: z77.number().optional(),
2866
+ price: z77.number().optional(),
2867
+ stock: z77.number().optional(),
2868
+ url: z77.string().url().optional()
2869
+ });
2870
+ var OwnerSchema = z77.object({
2871
+ uuid: z77.string(),
2872
+ username: z77.string(),
2873
+ nickname: z77.string(),
2874
+ avatar: z77.string()
2875
+ });
2876
+ var HeadSchema = z77.object({
2877
+ docType: z77.string(),
2878
+ editorVersion: z77.string(),
2879
+ c_para: z77.record(z77.string(), z77.string()),
2880
+ x: z77.number(),
2881
+ y: z77.number(),
2882
+ puuid: z77.string().optional(),
2883
+ uuid: z77.string(),
2884
+ utime: z77.number(),
2885
+ importFlag: z77.number().optional(),
2886
+ c_spiceCmd: z77.any().optional(),
2887
+ hasIdFlag: z77.boolean()
2888
+ });
2889
+ var BBoxSchema = z77.object({
2890
+ x: z77.number(),
2891
+ y: z77.number(),
2892
+ width: z77.number(),
2893
+ height: z77.number()
2894
+ });
2895
+ var LayerItemSchema = z77.object({
2896
+ name: z77.string(),
2897
+ color: z77.string(),
2898
+ visible: z77.boolean(),
2899
+ active: z77.boolean(),
2900
+ config: z77.boolean(),
2901
+ transparency: z77.boolean()
2902
+ });
2903
+ var ObjectItemSchema = z77.object({
2904
+ name: z77.string(),
2905
+ visible: z77.boolean(),
2906
+ locked: z77.boolean()
2907
+ });
2908
+ var DataStrSchema = z77.object({
2518
2909
  head: HeadSchema,
2519
- canvas: z63.string(),
2520
- shape: z63.array(SingleLetterShapeSchema),
2910
+ canvas: z77.string(),
2911
+ shape: z77.array(SingleLetterShapeSchema),
2521
2912
  BBox: BBoxSchema,
2522
- colors: z63.array(z63.unknown())
2913
+ colors: z77.array(z77.unknown())
2523
2914
  });
2524
- var PackageDetailDataStrSchema = z63.object({
2915
+ var PackageDetailDataStrSchema = z77.object({
2525
2916
  head: HeadSchema,
2526
- canvas: z63.string(),
2527
- shape: z63.array(z63.string()).transform(
2917
+ canvas: z77.string(),
2918
+ shape: z77.array(z77.string()).transform(
2528
2919
  (shapes) => shapes.map((shape) => {
2529
2920
  const [type, ...data] = shape.split("~");
2530
2921
  return ShapeItemSchema.parse({ type, data: data.join("~") });
2531
2922
  })
2532
- ).pipe(z63.array(PackageDetailShapeSchema)),
2533
- layers: z63.array(z63.string()).transform(
2923
+ ).pipe(z77.array(PackageDetailShapeSchema)),
2924
+ layers: z77.array(z77.string()).transform(
2534
2925
  (layers) => layers.map((layer) => {
2535
2926
  const [name, color, visible, active, config, transparency] = layer.split("~");
2536
2927
  return LayerItemSchema.parse({
@@ -2543,7 +2934,7 @@ var PackageDetailDataStrSchema = z63.object({
2543
2934
  });
2544
2935
  })
2545
2936
  ),
2546
- objects: z63.array(z63.string()).transform(
2937
+ objects: z77.array(z77.string()).transform(
2547
2938
  (objects) => objects.map((obj) => {
2548
2939
  const [name, visible, locked] = obj.split("~");
2549
2940
  return ObjectItemSchema.parse({
@@ -2554,42 +2945,41 @@ var PackageDetailDataStrSchema = z63.object({
2554
2945
  })
2555
2946
  ),
2556
2947
  BBox: BBoxSchema,
2557
- netColors: z63.array(z63.unknown()).optional()
2948
+ netColors: z77.array(z77.unknown()).optional()
2558
2949
  });
2559
- var PackageDetailSchema = z63.object({
2560
- uuid: z63.string(),
2561
- title: z63.string(),
2562
- docType: z63.number(),
2563
- updateTime: z63.number(),
2950
+ var PackageDetailSchema = z77.object({
2951
+ uuid: z77.string(),
2952
+ title: z77.string(),
2953
+ docType: z77.number(),
2954
+ updateTime: z77.number(),
2564
2955
  owner: OwnerSchema,
2565
- datastrid: z63.string(),
2566
- writable: z63.boolean(),
2956
+ datastrid: z77.string(),
2957
+ writable: z77.boolean(),
2567
2958
  dataStr: PackageDetailDataStrSchema
2568
2959
  });
2569
- var EasyEdaJsonSchema = z63.object({
2570
- uuid: z63.string(),
2571
- title: z63.string(),
2572
- description: z63.string(),
2573
- docType: z63.number(),
2574
- type: z63.number(),
2960
+ var EasyEdaJsonSchema = z77.object({
2961
+ uuid: z77.string(),
2962
+ title: z77.string(),
2963
+ description: z77.string(),
2964
+ docType: z77.number(),
2965
+ type: z77.number(),
2575
2966
  szlcsc: SzlcscSchema,
2576
2967
  lcsc: LcscSchema,
2577
2968
  owner: OwnerSchema,
2578
- tags: z63.array(z63.string()),
2579
- updateTime: z63.number(),
2580
- updated_at: z63.string(),
2969
+ tags: z77.array(z77.string()),
2970
+ updateTime: z77.number(),
2971
+ updated_at: z77.string(),
2581
2972
  dataStr: DataStrSchema,
2582
- verify: z63.boolean(),
2583
- SMT: z63.boolean().optional(),
2584
- datastrid: z63.string(),
2585
- jlcOnSale: z63.number().optional(),
2586
- writable: z63.boolean(),
2587
- isFavorite: z63.boolean(),
2973
+ verify: z77.boolean(),
2974
+ SMT: z77.boolean().optional(),
2975
+ datastrid: z77.string(),
2976
+ jlcOnSale: z77.number().optional(),
2977
+ writable: z77.boolean(),
2978
+ isFavorite: z77.boolean(),
2588
2979
  packageDetail: PackageDetailSchema
2589
2980
  });
2590
2981
 
2591
- // lib/generate-footprint-tsx.ts
2592
- import "zod";
2982
+ // lib/websafe/generate-footprint-tsx.ts
2593
2983
  import { mmStr } from "@tscircuit/mm";
2594
2984
  var generateFootprintTsx = (circuitJson) => {
2595
2985
  const holes = su_default(circuitJson).pcb_hole.list();
@@ -2646,8 +3036,8 @@ var generateFootprintTsx = (circuitJson) => {
2646
3036
  `.trim();
2647
3037
  };
2648
3038
 
2649
- // lib/convert-to-typescript-component/soup-typescript-component-template.ts
2650
- var soupTypescriptComponentTemplate = ({
3039
+ // lib/websafe/convert-to-typescript-component/generate-typescript-component.ts
3040
+ var generateTypescriptComponent = ({
2651
3041
  pinLabels,
2652
3042
  componentName,
2653
3043
  objUrl,
@@ -2701,7 +3091,7 @@ function normalizeManufacturerPartNumber(partNumber) {
2701
3091
  return normalized;
2702
3092
  }
2703
3093
 
2704
- // lib/convert-to-typescript-component/index.tsx
3094
+ // lib/websafe/convert-to-typescript-component/index.tsx
2705
3095
  var convertRawEasyToTsx = async (rawEasy) => {
2706
3096
  const betterEasy = EasyEdaJsonSchema.parse(rawEasy);
2707
3097
  const result = await convertBetterEasyToTsx({
@@ -2744,7 +3134,7 @@ var convertBetterEasyToTsx = async ({
2744
3134
  const supplierPartNumbers = {
2745
3135
  jlcpcb: [betterEasy.lcsc.number]
2746
3136
  };
2747
- return soupTypescriptComponentTemplate({
3137
+ return generateTypescriptComponent({
2748
3138
  componentName: pn,
2749
3139
  manufacturerPartNumber: pn,
2750
3140
  pinLabels,
@@ -2854,4 +3244,4 @@ export {
2854
3244
  convertRawEasyToTsx,
2855
3245
  convertEasyEdaJsonToVariousFormats
2856
3246
  };
2857
- //# sourceMappingURL=chunk-CROLWOEW.js.map
3247
+ //# sourceMappingURL=chunk-YCCBLZAH.js.map